Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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