|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.net.partition.DefaultKeyPartitioningStrategy
public class DefaultKeyPartitioningStrategy
DefaultKeyPartitioningStrategy provides a simple strategy for assigning keys to partitions which is based on the hash code of keys in internal (serialized to Binary) form.
Field Summary | |
---|---|
protected PartitionedService |
m_service The PartitionedService that this strategy is bound to. |
Constructor Summary | |
---|---|
DefaultKeyPartitioningStrategy() Default constructor. |
Method Summary | |
---|---|
static int |
calculateKeyPartition(PartitionedService service, Object oKey) Determine the partition to which the given key should be assigned for the specified PartitionService, taking into consideration the associations provided by the service's KeyAssociator. |
PartitionSet |
getAssociatedPartitions(Object oKey) Determine the set of partitions that all keys associated with the specified key are assigned to. |
int |
getKeyPartition(Object oKey) Determine the partition to which a particular key should be assigned. |
void |
init(PartitionedService service) Initialize the KeyPartitioningStrategy and bind it to the specified PartitionedService. |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString |
Field Detail |
---|
protected PartitionedService m_service
Constructor Detail |
---|
public DefaultKeyPartitioningStrategy()
Method Detail |
---|
public void init(PartitionedService service)
init
in interface KeyPartitioningStrategy
service
- the PartitionedService that this strategy is being bound topublic int getKeyPartition(Object oKey)
associated key
would be assigned to the same partition. <p/> The resulting partition must be in the range [0..N-1], where N is the value returned from PartitionedService.getPartitionCount()
.getKeyPartition
in interface KeyPartitioningStrategy
oKey
- a key in its Object formPartitionAssignmentStrategy.getPartitionOwner(int)
public PartitionSet getAssociatedPartitions(Object oKey)
getKeyPartition
method.getAssociatedPartitions
in interface KeyPartitioningStrategy
oKey
- a key in its Object formpublic static int calculateKeyPartition(PartitionedService service, Object oKey)
PartitionedService.getPartitionCount()
method.service
- the PartitionedServiceoKey
- a key in its original (Object) format
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |