IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid
Interface PartitionManager


public interface PartitionManager

This interface will be used for calculating the proper partition for a given input key. The set of partitions is determined by the BackingMap configuration.

Since:
WAS XD 6.0.1, XC10
See Also:
BackingMap.getPartitionManager()

Method Summary
 int getNumOfPartitions()
          Returns the number of configured partitions for this PartitionManager.
 int getPartition(Object key)
          Obtains a 0-based partition number determined by the input parameter's hashCode() method.
 List getPartitionLists(List keyList)
          This method is very similar to getPartitions(List), except it returns the keys organized by the partition identifiers.
 List getPartitions(List keyList)
          Obtains the 0-based partition numbers for each of the keys in the input List of keys.
 List partitionLogSequence(LogSequence ls)
          Partitions a LogSequence based on the partitioning algorithm for the Map.
 

Method Detail

getPartition

int getPartition(Object key)
Obtains a 0-based partition number determined by the input parameter's hashCode() method.

Parameters:
key - Individual key used to determine partition (can not be null)
Returns:
int 0-based partition number

getPartitions

List getPartitions(List keyList)
Obtains the 0-based partition numbers for each of the keys in the input List of keys. Each object in the returned list of partition identifiers is an instance of java.lang.Integer.

Parameters:
keyList - Ordered list of keys
Returns:
List of partition identifiers that corresponds to the input list of keys

getPartitionLists

List getPartitionLists(List keyList)
This method is very similar to getPartitions(List), except it returns the keys organized by the partition identifiers. The return value is a List of Lists. The outer List is an ordered List of the partition numbers, with the first entry in the List corresponding to partition 0. The inner Lists contain the keys from the input parameter that correspond to that partition identifier.

The return value will always contain a List object. Either the outer or the inner Lists may contain zero elements, but the List objects themselves will not be null.

Parameters:
keyList - Ordered list of keys
Returns:
List of Lists that correspond to the 0-based partition numbers, with each inner List containing the set of keys that parse to that partition number.

partitionLogSequence

List partitionLogSequence(LogSequence ls)
Partitions a LogSequence based on the partitioning algorithm for the Map.

Parameters:
ls - LogSequence that needs to be partitioned
Returns:
List of partitioned LogSequences. The first LogSequence in the List corresponds to the first partition, etc.

getNumOfPartitions

int getNumOfPartitions()
Returns the number of configured partitions for this PartitionManager.

Returns:
the number of configured partitions

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.