CoherenceTM v3.4
Copyright© 2000-2008 by Oracle Corporation

com.tangosol.net.partition
Interface KeyPartitioningStrategy


public interface KeyPartitioningStrategy

A KeyPartitioningStrategy is a pluggable strategy for assigning keys to specific partitions.

Since:
Coherence 3.0

Method Summary
 int getKeyPartition(java.lang.Object oKey)
          Determine the partition to which a particular key should be assigned.
 void init(PartitionedService service)
          Initialize the KeyPartitioningStrategy and bind it to a PartitionedService.
 

Method Detail

init

void init(PartitionedService service)
Initialize the KeyPartitioningStrategy and bind it to a PartitionedService.

Parameters:
service - the PartitionedService that this strategy is being bound to

getKeyPartition

int getKeyPartition(java.lang.Object oKey)
Determine the partition to which a particular key should be assigned.

The resulting partition ID must be in the range [0..N), where N is the value returned from PartitionedService.getPartitionCount().

Parameters:
oKey - a key in its Object form
Returns:
the parition ID that the specified key is assigned to

CoherenceTM v3.4
Copyright© 2000-2008 by Oracle Corporation