Skip navigation links

Oracle® Coherence Java API Reference
v3.5.1

E15583-01


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. <p/> 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
See Also:
PartitionAssignmentStrategy.getPartitionOwner(int)

Skip navigation links

Oracle® Coherence Java API Reference
v3.5.1

E15583-01


Copyright © 2000, 2009, Oracle. All rights reserved.