All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Alachisoft.NCache.Common.Extensibility.Client.RPC.Impl.SingleNodePartitioner Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy