removed unused sqlf methods in PartitionedRegion

Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/f50a5f75
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/f50a5f75
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/f50a5f75

Branch: refs/heads/feature/GEODE-1464
Commit: f50a5f75c22b7e06b9e45362312a7ec5fc50b737
Parents: 58a482c
Author: Darrel Schneider <[email protected]>
Authored: Wed Jun 1 15:11:16 2016 -0700
Committer: Darrel Schneider <[email protected]>
Committed: Wed Jun 1 15:11:16 2016 -0700

----------------------------------------------------------------------
 .../internal/cache/PartitionedRegion.java       | 161 +------------------
 1 file changed, 3 insertions(+), 158 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f50a5f75/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
----------------------------------------------------------------------
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
index a6d6b9e..627d267 100755
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
@@ -5175,21 +5175,6 @@ public class PartitionedRegion extends LocalRegion 
implements
   /**
    * generates new partitioned region ID globally.
    */
-  // !!!:ezoerner:20080321 made this function public and static.
-  // @todo should be moved to the Distributed System level as a general service
-  // for getting a unique id, with different "domains" for different
-  // contexts
-  // :soubhik:pr_func merge20914:21056: overloaded static and non-static 
version of generatePRId.
-  //   static version is used mainly with sqlf & non-static in gfe.
-  public static int generatePRId(InternalDistributedSystem sys, Cache cache) {
-    
-    GemFireCacheImpl gfcache = (GemFireCacheImpl) cache;
-    
-    if(gfcache == null) return 0;
-    
-    return _generatePRId(sys, gfcache.getPartitionedRegionLockService());
-  }
-  
   public int generatePRId(InternalDistributedSystem sys) {
     final DistributedLockService lockService = 
getPartitionedRegionLockService();
     return _generatePRId(sys, lockService);
@@ -6360,15 +6345,6 @@ public class PartitionedRegion extends LocalRegion 
implements
   }
 
   /**
-   * Currently used by SQLFabric to get a non-wrapped iterator for all entries
-   * for index consistency check.
-   */
-  public Set allEntries() {
-    return new PREntriesSet();
-  }
-
-
-  /**
    * Set view of entries. This currently extends the keySet iterator and
    * performs individual getEntry() operations using the keys
    * 
@@ -7781,20 +7757,7 @@ public class PartitionedRegion extends LocalRegion 
implements
   }
         
   @Override
-  public void localDestroyRegion(Object aCallbackArgument) {
-    localDestroyRegion(aCallbackArgument, false);
-  }
-
-  /**
-   * Locally destroy a region.
-   * 
-   * SQLFabric change: The parameter "ignoreParent" has been added to allow
-   * skipping the check for parent colocated region. This is because SQLFabric
-   * DDLs are distributed in any case and are guaranteed to be atomic (i.e. no
-   * concurrent DMLs on that table). Without this it is quite ugly to implement
-   * "TRUNCATE TABLE" which first drops the table and recreates it.
-   */
-  public void localDestroyRegion(Object aCallbackArgument, boolean 
ignoreParent)
+  public void localDestroyRegion(Object aCallbackArgument)
   {
     getDataView().checkSupportsRegionDestroy();
     String prName = this.getColocatedWith();
@@ -7810,7 +7773,7 @@ public class PartitionedRegion extends LocalRegion 
implements
       }
     }
 
-    if ((!ignoreParent && prName != null)
+    if ((prName != null)
         || (!childRegionsWithoutSendersList.isEmpty())) {
       throw new UnsupportedOperationException(
           "Any Region in colocation chain cannot be destroyed locally.");
@@ -9533,8 +9496,6 @@ public class PartitionedRegion extends LocalRegion 
implements
 
   /**
    * This method is intended for testing purposes only.
-   * DO NOT use in product code else it will break SQLFabric that has cases
-   * where routing object is not part of only the key.
    */
   @Override
   public Object getValueOnDisk(Object key) throws EntryNotFoundException {
@@ -9547,8 +9508,6 @@ public class PartitionedRegion extends LocalRegion 
implements
   
   /**
    * This method is intended for testing purposes only.
-   * DO NOT use in product code else it will break SQLFabric that has cases
-   * where routing object is not part of only the key.
    */
   @Override
   public Object getValueOnDiskOrBuffer(Object key) throws 
EntryNotFoundException {
@@ -9668,33 +9627,13 @@ public class PartitionedRegion extends LocalRegion 
implements
   }
 
   public PartitionResolver getPartitionResolver() {
-    // [SQLFabric] use PartitionAttributes to get the the resolver
-    // since it may change after ALTER TABLE
     return this.partitionAttributes.getPartitionResolver();
   }
 
   public String getColocatedWith() {
-    // [SQLFabric] use PartitionAttributes to get colocated region
-    // since it may change after ALTER TABLE
     return this.partitionAttributes.getColocatedWith();
   }
 
-  // For SQLFabric ALTER TABLE. Need to set the colocated region using
-  // PartitionAttributesImpl and also reset the parentAdvisor for
-  // BucketAdvisors.
-  /**
-   * Set the colocated with region path and adjust the BucketAdvisor's. This
-   * should *only* be invoked when region is just newly created and has no data
-   * or existing buckets else will have undefined behaviour.
-   * 
-   * @since 6.5
-   */
-  public void setColocatedWith(String colocatedRegionFullPath) {
-    ((PartitionAttributesImpl)this.partitionAttributes)
-        .setColocatedWith(colocatedRegionFullPath);
-    this.getRegionAdvisor().resetBucketAdvisorParents();
-  }
-
   /**
    * Used to get membership events from our advisor to implement
    * RegionMembershipListener invocations. This is copied almost in whole from
@@ -9752,98 +9691,6 @@ public class PartitionedRegion extends LocalRegion 
implements
     }
   }
   
-  /*
-   * This is an internal API for sqlFabric only <br>
-   * This is usefull to execute a function on set of nodes irrelevant of the
-   * routinKeys <br>
-   * notes : This API uses DefaultResultCollector. If you want your Custome
-   * Result collector, let me know
-   * 
-   * @param functionName
-   * @param args
-   * @param nodes
-   *                Set of DistributedMembers on which this function will be
-   *                executed
-   * @throws Exception
-   *//*
-  public ResultCollector executeFunctionOnNodes(String functionName,
-      Serializable args, Set nodes) throws Exception {
-    Assert.assertTrue(functionName != null, "Error: functionName is null");
-    Assert.assertTrue(nodes != null, "Error: nodes set is null");
-    Assert.assertTrue(nodes.size() != 0, "Error: empty nodes Set");
-    ResultCollector rc = new DefaultResultCollector();
-    boolean isSelf = nodes.remove(getMyId());
-    PartitionedRegionFunctionResponse response = null;
-    //TODO Yogesh: this API is broken after Resultsender implementation
-    //response = new PartitionedRegionFunctionResponse(this.getSystem(), nodes,
-    //    rc);
-    Iterator i = nodes.iterator();
-    while (i.hasNext()) {
-      InternalDistributedMember recip = (InternalDistributedMember)i.next();
-      PartitionedRegionFunctionMessage.send(recip, this, functionName, args,
-          null routingKeys , response, null);
-    }
-    if (isSelf) {
-      // execute locally and collect the result
-      if (this.dataStore != null) {
-        this.dataStore.executeOnDataStore(
-            null routingKeys , functionName, args, 0,null,rc,null);
-      }
-    }
-    return response;
-  }*/
-
-
-  /*
-   * This is an internal API for sqlFabric only <br>
-   * API for invoking a function using primitive ints as the routing objects
-   * (i.e. passing the hashcodes of the routing objects directly). <br>
-   * notes : This API uses DefaultResultCollector. If you want to pass your
-   * Custom Result collector, let me know
-   * 
-   * @param functionName
-   * @param args
-   * @param hashcodes
-   *          hashcodes of the routing objects
-   * @throws Exception
-   *//*
-  public ResultCollector executeFunctionUsingHashCodes(String functionName,
-      Serializable args, int hashcodes[]) throws Exception {
-    Assert.assertTrue(functionName != null, "Error: functionName is null");
-    Assert.assertTrue(hashcodes != null, "Error: hashcodes array is null");
-    Assert.assertTrue(hashcodes.length != 0, "Error: empty hashcodes array");
-    Set nodes = new HashSet();
-    for (int i = 0; i < hashcodes.length; i++) {
-      int bucketId = hashcodes[i] % getTotalNumberOfBuckets();
-      InternalDistributedMember n = getNodeForBucketRead(bucketId);
-      nodes.add(n);
-    }
-    return executeFunctionOnNodes(functionName, args, nodes);
-  }*/
-
-  /**
-   * This is an internal API for sqlFabric only <br>
-   * Given a array of routing objects, returns a set of members on which the 
(owner of each
-   * buckets)
-   * 
-   * @param routingObjects array of routing objects passed 
-   * @return Set of  InternalDistributedMembers
-   */
-  public Set getMembersFromRoutingObjects(Object[] routingObjects) {
-    Assert.assertTrue(routingObjects != null, "Error: null routingObjects ");
-    Assert.assertTrue(routingObjects.length != 0, "Error: empty routingObjects 
");
-    Set nodeSet = new HashSet();
-    int bucketId;
-    for (int i = 0; i < routingObjects.length; i++) {
-      bucketId = PartitionedRegionHelper.getHashKey(routingObjects[i],
-                                                    getTotalNumberOfBuckets());
-      InternalDistributedMember lnode = getOrCreateNodeForBucketRead(bucketId);
-      if (lnode != null) {
-        nodeSet.add(lnode);
-      }
-    }
-    return nodeSet;
-  }
   @Override
   protected RegionEntry basicGetTXEntry(KeyInfo keyInfo) {
     int bucketId = keyInfo.getBucketId();
@@ -10628,9 +10475,7 @@ public class PartitionedRegion extends LocalRegion 
implements
   }
 
   /**
-   * Returns the local BucketRegion given the key and value. Particularly 
useful
-   * for SQLFabric where the routing object may be part of value and 
determining
-   * from key alone will require an expensive global index lookup.
+   * Returns the local BucketRegion given the key and value.
    * Returns null if no BucketRegion exists.
    */
   public BucketRegion getBucketRegion(Object key, Object value) {

Reply via email to