Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 502CD200AF5 for ; Thu, 2 Jun 2016 20:31:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4EC7F160A51; Thu, 2 Jun 2016 18:31:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 56646160A3E for ; Thu, 2 Jun 2016 20:31:10 +0200 (CEST) Received: (qmail 99729 invoked by uid 500); 2 Jun 2016 18:31:09 -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 99677 invoked by uid 99); 2 Jun 2016 18:31:09 -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; Thu, 02 Jun 2016 18:31:09 +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 21F711A056C for ; Thu, 2 Jun 2016 18:31:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 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=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id bjmmpOpBDe6C for ; Thu, 2 Jun 2016 18:31:07 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 3DED55FAC3 for ; Thu, 2 Jun 2016 18:31:06 +0000 (UTC) Received: (qmail 99423 invoked by uid 99); 2 Jun 2016 18:31:05 -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; Thu, 02 Jun 2016 18:31:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BB89DF97F; Thu, 2 Jun 2016 18:31:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dschneider@apache.org To: commits@geode.incubator.apache.org Date: Thu, 02 Jun 2016 18:31:07 -0000 Message-Id: In-Reply-To: <616701159ee544579fdef5204ccfe28f@git.apache.org> References: <616701159ee544579fdef5204ccfe28f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/10] incubator-geode git commit: removed getLeaderRegionName and getColocatedRegionName archived-at: Thu, 02 Jun 2016 18:31:11 -0000 removed getLeaderRegionName and getColocatedRegionName Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/89a48fe2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/89a48fe2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/89a48fe2 Branch: refs/heads/feature/GEODE-1464 Commit: 89a48fe28155186ecec4caa06b50cb24925557dc Parents: 9a30e02 Author: Darrel Schneider Authored: Thu Jun 2 10:49:20 2016 -0700 Committer: Darrel Schneider Committed: Thu Jun 2 10:49:20 2016 -0700 ---------------------------------------------------------------------- .../internal/cache/ColocationHelper.java | 64 +------------------- 1 file changed, 2 insertions(+), 62 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/89a48fe2/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ColocationHelper.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ColocationHelper.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ColocationHelper.java index 72edc10..651551f 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ColocationHelper.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ColocationHelper.java @@ -42,9 +42,7 @@ import com.gemstone.gemfire.internal.cache.execute.InternalRegionFunctionContext import com.gemstone.gemfire.internal.cache.partitioned.PRLocallyDestroyedException; import com.gemstone.gemfire.internal.cache.persistence.PRPersistentConfig; import com.gemstone.gemfire.internal.cache.wan.parallel.ParallelGatewaySenderQueue; -import com.gemstone.gemfire.internal.i18n.LocalizedStrings; import com.gemstone.gemfire.internal.logging.LogService; -import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage; /** * An utility class to retrieve colocated regions in a colocation hierarchy in @@ -57,55 +55,8 @@ public class ColocationHelper { /** Logging mechanism for debugging */ private static final Logger logger = LogService.getLogger(); - /** - * An utility method to retrieve colocated region name of a given partitioned - * region without waiting on initialize - * - * @param partitionedRegion - * @return colocated PartitionedRegion - * @since cheetah - */ - public static PartitionedRegion getColocatedRegionName( - final PartitionedRegion partitionedRegion) { - Assert.assertTrue(partitionedRegion != null); // precondition1 - String colocatedWith = partitionedRegion.getPartitionAttributes().getColocatedWith(); - if (colocatedWith == null) { - // the region is not colocated with any region - return null; - } - PartitionedRegion colocatedPR = partitionedRegion.getColocatedWithRegion(); - if (colocatedPR != null && !colocatedPR.isLocallyDestroyed - && !colocatedPR.isDestroyed()) { - return colocatedPR; - } - Region prRoot = PartitionedRegionHelper.getPRRoot(partitionedRegion - .getCache()); - PartitionRegionConfig prConf = (PartitionRegionConfig)prRoot - .get(getRegionIdentifier(colocatedWith)); - int prID = -1; - try { - if (prConf == null) { - colocatedPR = getColocatedPR(partitionedRegion, colocatedWith); - } - else { - prID = prConf.getPRId(); - colocatedPR = PartitionedRegion.getPRFromId(prID); - if (colocatedPR == null && prID > 0) { - // colocatedPR might have not called registerPartitionedRegion() yet, but since prID is valid, - // we are able to get colocatedPR and do colocatedPR.waitOnBucketMetadataInitialization() - colocatedPR = getColocatedPR(partitionedRegion, colocatedWith); - } - } - } - catch (PRLocallyDestroyedException e) { - if (logger.isDebugEnabled()) { - logger.debug("PRLocallyDestroyedException : Region with prId=" + prID - + " is locally destroyed on this node", e); - } - } - return colocatedPR; - } - private static PartitionedRegion getColocatedPR( + + private static PartitionedRegion getColocatedPR( final PartitionedRegion partitionedRegion, final String colocatedWith) { PartitionedRegion colocatedPR = (PartitionedRegion) partitionedRegion .getCache().getPartitionedRegion(colocatedWith, false); @@ -527,17 +478,6 @@ public class ColocationHelper { return prRegion; } - - // Gemfirexd will skip initialization for PR, so just get region name without waitOnInitialize - public static PartitionedRegion getLeaderRegionName(PartitionedRegion prRegion) { - PartitionedRegion parentRegion; - - while((parentRegion = getColocatedRegionName(prRegion)) != null) { - prRegion = parentRegion; - } - - return prRegion; - } private static String getRegionIdentifier(String regionName) { if (regionName.startsWith("/")) {