com.hazelcast.core
Interface PartitionService


public interface PartitionService

InternalPartitionService allows to query Partitions and attach/detach MigrationListeners to listen partition migration events.

See Also:
Partition, MigrationListener

Method Summary
 String addMigrationListener(MigrationListener migrationListener)
           
 Partition getPartition(Object key)
          Returns partition which given key belongs to.
 Set<Partition> getPartitions()
          Returns all partitions.
 String randomPartitionKey()
          Generates a random partition key.
 boolean removeMigrationListener(String registrationId)
           
 

Method Detail

getPartitions

Set<Partition> getPartitions()
Returns all partitions.

Returns:
all partitions

getPartition

Partition getPartition(Object key)
Returns partition which given key belongs to.

Parameters:
key - key
Returns:
partition which given key belongs to

randomPartitionKey

String randomPartitionKey()
Generates a random partition key. This is useful if you want to partition data in the same partition, but don't care which partition it is going to be. The returned value will never be null.

Returns:
the random partition key.

addMigrationListener

String addMigrationListener(MigrationListener migrationListener)
Parameters:
migrationListener - listener
Returns:
returns registration id.

removeMigrationListener

boolean removeMigrationListener(String registrationId)
Parameters:
registrationId - Id of listener registration.
Returns:
true if registration is removed, false otherwise


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.