removed withRoutingObjects and hasRoutingObjects
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/91e04848 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/91e04848 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/91e04848 Branch: refs/heads/feature/GEODE-1464 Commit: 91e0484821d642e173f3dae8ebe03252d0619265 Parents: c193b5d Author: Darrel Schneider <[email protected]> Authored: Wed Jun 1 16:23:05 2016 -0700 Committer: Darrel Schneider <[email protected]> Committed: Wed Jun 1 16:23:05 2016 -0700 ---------------------------------------------------------------------- .../internal/cache/PartitionedRegion.java | 17 +++--------- .../cache/execute/AbstractExecution.java | 18 ------------- .../cache/execute/InternalExecution.java | 27 +------------------- .../cache/execute/MemberFunctionExecutor.java | 7 ----- .../execute/MultiRegionFunctionExecutor.java | 7 ----- .../cache/execute/ServerFunctionExecutor.java | 7 ----- .../gemfire/internal/i18n/LocalizedStrings.java | 1 - 7 files changed, 5 insertions(+), 79 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91e04848/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 2b5e3e7..16d5436 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 @@ -3561,10 +3561,8 @@ public class PartitionedRegion extends LocalRegion implements boolean isBucketSetAsFilter) { final Set routingKeys = execution.getFilter(); final boolean primaryMembersNeeded = function.optimizeForWrite(); - final boolean hasRoutingObjects = execution.hasRoutingObjects(); HashMap<Integer, HashSet> bucketToKeysMap = FunctionExecutionNodePruner - .groupByBucket(this, routingKeys, primaryMembersNeeded, - hasRoutingObjects, isBucketSetAsFilter); + .groupByBucket(this, routingKeys, primaryMembersNeeded, false, isBucketSetAsFilter); HashMap<InternalDistributedMember, HashSet> memberToKeysMap = new HashMap<InternalDistributedMember, HashSet>(); HashMap<InternalDistributedMember, HashSet<Integer>> memberToBuckets = FunctionExecutionNodePruner .groupByMemberToBuckets(this, bucketToKeysMap.keySet(), primaryMembersNeeded); @@ -3654,7 +3652,7 @@ public class PartitionedRegion extends LocalRegion implements else { localBucketSet = FunctionExecutionNodePruner .getBucketSet(PartitionedRegion.this, localKeys, - hasRoutingObjects, isBucketSetAsFilter); + false, isBucketSetAsFilter); remoteOnly = false; } @@ -3690,7 +3688,7 @@ public class PartitionedRegion extends LocalRegion implements FunctionRemoteContext context = new FunctionRemoteContext(function, execution.getArgumentsForMember(recip.getId()), memKeys, FunctionExecutionNodePruner.getBucketSet(this, memKeys, - hasRoutingObjects, isBucketSetAsFilter), execution.isReExecute(), + false, isBucketSetAsFilter), execution.isReExecute(), execution.isFnSerializationReqd()); recipMap.put(recip, context); } @@ -3720,15 +3718,8 @@ public class PartitionedRegion extends LocalRegion implements if (isBucketSetAsFilter) { bucketId = ((Integer) key).intValue(); } else { - if (execution.hasRoutingObjects()) { - bucketId = Integer.valueOf(PartitionedRegionHelper - .getHashKey(this, key)); - } else { - // bucketId = Integer.valueOf(PartitionedRegionHelper.getHashKey(this, - // Operation.FUNCTION_EXECUTION, key, null)); - bucketId = Integer.valueOf(PartitionedRegionHelper.getHashKey(this, + bucketId = Integer.valueOf(PartitionedRegionHelper.getHashKey(this, Operation.FUNCTION_EXECUTION, key, null, null)); - } } InternalDistributedMember targetNode = null; if (function.optimizeForWrite()) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91e04848/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/AbstractExecution.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/AbstractExecution.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/AbstractExecution.java index ff736be..6bbe81c 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/AbstractExecution.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/AbstractExecution.java @@ -159,7 +159,6 @@ public abstract class AbstractExecution implements InternalExecution { } protected AbstractExecution() { - this.hasRoutingObjects = false; } protected AbstractExecution(AbstractExecution ae) { @@ -173,7 +172,6 @@ public abstract class AbstractExecution implements InternalExecution { this.memberMappedArg = ae.memberMappedArg; } this.isMemberMappedArgument = ae.isMemberMappedArgument; - this.hasRoutingObjects = ae.hasRoutingObjects; this.isClientServerMode = ae.isClientServerMode; if (ae.proxyCache != null) { this.proxyCache = ae.proxyCache; @@ -211,26 +209,10 @@ public abstract class AbstractExecution implements InternalExecution { return this.rc; } - public AbstractExecution withRoutingObjects(Set<Object> routingObjects) { - if (routingObjects == null) { - throw new FunctionException( - LocalizedStrings.FunctionService_ROUTING_OBJECTS_SET_IS_NULL - .toLocalizedString()); - } - this.filter.clear(); - this.filter.addAll(routingObjects); - this.hasRoutingObjects = true; - return this; - } - public Set getFilter() { return this.filter; } - public boolean hasRoutingObjects() { - return this.hasRoutingObjects; - } - public AbstractExecution setIsReExecute() { this.isReExecute = true; if (this.executionNodesListener != null) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91e04848/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalExecution.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalExecution.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalExecution.java index d3fd2f2..6de6877 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalExecution.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalExecution.java @@ -25,7 +25,7 @@ import com.gemstone.gemfire.cache.execute.FunctionService; import com.gemstone.gemfire.cache.execute.ResultCollector; /** - * Internal interface for SQLFabric. It has internal methods specific for SQLFabric + * Internal interface that adds some internal methods to the Execution interface. * * @since 5.8LA * @@ -36,31 +36,6 @@ public interface InternalExecution extends Execution { MemberMappedArgument argument); /** - * Specifies a data filter of routing objects for selecting the GemFire - * members to execute the function that are not GemFire keys rather routing - * objects as determined by resolver. Currently used by SQL fabric for passing - * routing objects obtained from the custom resolvers. - * <p> - * If the set is empty the function is executed on all members that have the - * {@linkplain FunctionService#onRegion(com.gemstone.gemfire.cache.Region) - * region defined}. - * </p> - * - * @param routingObjects - * Set defining the routing objects to be used for executing the - * function. - * - * @return an Execution with the routing objects - * - * @throws IllegalArgumentException - * if the set of routing objects passed is null. - * @throws UnsupportedOperationException - * if not called after - * {@link FunctionService#onRegion(com.gemstone.gemfire.cache.Region)} - */ - public InternalExecution withRoutingObjects(Set<Object> routingObjects); - - /** * Specifies a filter of bucketIDs for selecting the GemFire * members to execute the function on. * <p> http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91e04848/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutor.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutor.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutor.java index ac628a0..3912245 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutor.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutor.java @@ -239,13 +239,6 @@ public class MemberFunctionExecutor extends AbstractExecution { .toLocalizedString("bucket as filter")); } - @Override - public AbstractExecution withRoutingObjects(Set<Object> routingObjects) { - throw new FunctionException( - LocalizedStrings.ExecuteFunction_CANNOT_SPECIFY_0_FOR_DATA_INDEPENDENT_FUNCTIONS - .toLocalizedString("routing objects")); - } - public InternalExecution withMemberMappedArgument( MemberMappedArgument argument) { if(argument == null){ http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91e04848/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutor.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutor.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutor.java index 1929169..a9f933a 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutor.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutor.java @@ -182,13 +182,6 @@ public class MultiRegionFunctionExecutor extends AbstractExecution { } @Override - public AbstractExecution withRoutingObjects(Set<Object> routingObjects) { - throw new FunctionException( - LocalizedStrings.ExecuteFunction_CANNOT_SPECIFY_0_FOR_ONREGIONS_FUNCTION - .toLocalizedString("routing objects")); - } - - @Override protected ResultCollector executeFunction(Function function) { if (function.hasResult()) { ResultCollector rc = this.rc; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91e04848/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/ServerFunctionExecutor.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/ServerFunctionExecutor.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/ServerFunctionExecutor.java index 9c06bf6..d821b32 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/ServerFunctionExecutor.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/ServerFunctionExecutor.java @@ -266,13 +266,6 @@ public class ServerFunctionExecutor extends AbstractExecution { .toLocalizedString("buckets as filter")); } - @Override - public AbstractExecution withRoutingObjects(Set<Object> routingObjects) { - throw new FunctionException( - LocalizedStrings.ExecuteFunction_CANNOT_SPECIFY_0_FOR_DATA_INDEPENDENT_FUNCTIONS - .toLocalizedString("routing objects")); - } - public Execution withArgs(Object args) { if (args == null) { throw new FunctionException( http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91e04848/geode-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java index b3a36af..50a7d7f 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java @@ -734,7 +734,6 @@ public class LocalizedStrings { public static final StringId PartitionedRegion_FAILED_REGISTRATION_PRID_0_NAMED_1 = new StringId(1872, "FAILED_REGISTRATION prId={0} named {1}"); public static final StringId PartitionedRegion_FORCEREATTEMPT_EXCEPTION___0 = new StringId(1873, "ForceReattempt exception : {0}"); public static final StringId PartitionedRegion_NEWLY_ADDED_MEMBER_TO_THE_PR_IS_AN_ACCESSOR_AND_WILL_NOT_RECEIVE_INDEX_INFORMATION_0 = new StringId(1874, "Newly added member to the PR is an accessor and will not receive index information : {0}"); - public static final StringId FunctionService_ROUTING_OBJECTS_SET_IS_NULL = new StringId(1875, "Set for routing objects passed is null"); public static final StringId PartitionedRegion_NO_VM_AVAILABLE_FOR_CONTAINS_KEY_IN_1_ATTEMPTS = new StringId(1877, "No VM available for contains key in {1} attempts"); public static final StringId PartitionedRegion_NO_VM_AVAILABLE_FOR_CONTAINS_VALUE_FOR_KEY_IN_1_ATTEMPTS = new StringId(1878, "No VM available for contains value for key in {1} attempts");
