Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CD82A18A53 for ; Mon, 29 Feb 2016 20:50:17 +0000 (UTC) Received: (qmail 79942 invoked by uid 500); 29 Feb 2016 20:50:14 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 79911 invoked by uid 500); 29 Feb 2016 20:50:14 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 79902 invoked by uid 99); 29 Feb 2016 20:50:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Feb 2016 20:50:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 3EBE61A0C95 for ; Mon, 29 Feb 2016 20:50:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.549 X-Spam-Level: X-Spam-Status: No, score=-3.549 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id GeTrnDdwn4WK for ; Mon, 29 Feb 2016 20:50:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with SMTP id C602D60CE4 for ; Mon, 29 Feb 2016 20:50:10 +0000 (UTC) Received: (qmail 78788 invoked by uid 99); 29 Feb 2016 20:50:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Feb 2016 20:50:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5E27DE7890; Mon, 29 Feb 2016 20:50:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Mon, 29 Feb 2016 20:50:25 -0000 Message-Id: <16d8b02b554a4304ab5e191f3fbe6a74@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [17/19] incubator-geode git commit: GEODE-870: Adding GMSJoinLeaveTestHelper back after gemfire/geode merge GEODE-870: Adding GMSJoinLeaveTestHelper back after gemfire/geode merge Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/3879739a Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/3879739a Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/3879739a Branch: refs/heads/feature/GEODE-953 Commit: 3879739a5e4f4d2e2eabc6bbee21faecfc990d69 Parents: 21cd26d Author: Udo Kohlmeyer Authored: Tue Feb 23 08:20:45 2016 +1100 Committer: Udo Kohlmeyer Committed: Mon Feb 29 16:47:29 2016 +1100 ---------------------------------------------------------------------- .../gms/membership/GMSJoinLeaveTestHelper.java | 67 -------------------- 1 file changed, 67 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3879739a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveTestHelper.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveTestHelper.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveTestHelper.java deleted file mode 100644 index 493c625..0000000 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveTestHelper.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.gemstone.gemfire.distributed.internal.membership.gms.membership; - -import com.gemstone.gemfire.distributed.Locator; -import com.gemstone.gemfire.distributed.internal.DM; -import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; -import com.gemstone.gemfire.distributed.internal.membership.gms.Services; -import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershipManager; - -public class GMSJoinLeaveTestHelper { - - public static void becomeCoordinatorForTest(GMSJoinLeave gmsJoinLeave) { - synchronized (gmsJoinLeave.getViewInstallationLock()) { - gmsJoinLeave.becomeCoordinator(); - } - } - - public static boolean isViewCreator() { - GMSJoinLeave gmsJoinLeave = getGmsJoinLeave(); - if (gmsJoinLeave != null) { - GMSJoinLeave.ViewCreator viewCreator = gmsJoinLeave.getViewCreator(); - if (viewCreator != null && !viewCreator.isShutdown()) { - return true; - } else { - return false; - } - } - throw new RuntimeException("This should not have happened. There should be a JoinLeave for every DS"); - } - - private static GMSJoinLeave getGmsJoinLeave() { - InternalDistributedSystem distributedSystem = getInternalDistributedSystem(); - DM dm = distributedSystem.getDM(); - GMSMembershipManager membershipManager = (GMSMembershipManager) dm.getMembershipManager(); - Services services = membershipManager.getServices(); - return (GMSJoinLeave) services.getJoinLeave(); - } - - public static Integer getViewId() { - return getGmsJoinLeave().getView().getViewId(); - } - - private static InternalDistributedSystem getInternalDistributedSystem() { - InternalDistributedSystem distributedSystem = InternalDistributedSystem.getAnyInstance(); - if (distributedSystem == null) { - Locator locator = Locator.getLocator(); - return (InternalDistributedSystem) locator.getDistributedSystem(); - } else { - return distributedSystem; - } - } -}