Alachisoft.NCache.Common.Extensibility.Client.RPC.Impl.SingleNodePartitioner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-common Show documentation
Show all versions of nc-common Show documentation
Internal package of Alachisoft.
package Alachisoft.NCache.Common.Extensibility.Client.RPC.Impl;
import Alachisoft.NCache.Common.Extensibility.Client.RPC.IMethodArgumentPartitioner;
import Alachisoft.NCache.Common.Extensibility.Client.RPC.Partition;
import Alachisoft.NCache.Common.Extensibility.Client.RPC.PartitioningStrategy;
import java.util.HashMap;
public class SingleNodePartitioner implements IMethodArgumentPartitioner {
private String privatePartitionKey;
public final String getPartitionKey() {
return privatePartitionKey;
}
public final void setPartitionKey(String value) {
privatePartitionKey = value;
}
public final Iterable> PartitionArguments(Object[] arguments, PartitioningStrategy strategy) {
Partition partition = strategy.GetDestinationPartition(getPartitionKey());
HashMap argumentPartitions = new HashMap<>();
argumentPartitions.put(partition, arguments);
return argumentPartitions.entrySet();
}
}