geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [03/10] incubator-geode git commit: removed getLeaderRegionName and getColocatedRegionName
Date Thu, 02 Jun 2016 18:31:07 GMT
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 <dschneider@pivotal.io>
Authored: Thu Jun 2 10:49:20 2016 -0700
Committer: Darrel Schneider <dschneider@pivotal.io>
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("/")) {


Mime
View raw message