public final class PartitionServiceProxy extends Object implements PartitionService
| Constructor and Description |
|---|
PartitionServiceProxy(ClientPartitionService partitionService) |
| Modifier and Type | Method and Description |
|---|---|
String |
addMigrationListener(MigrationListener migrationListener) |
boolean |
forceLocalMemberToBeSafe(long timeout,
TimeUnit unit)
Force local member to be safe by checking and syncing owned partitions with 1st backups.
|
Partition |
getPartition(Object key)
Returns partition which given key belongs to.
|
Set<Partition> |
getPartitions()
Returns all partitions.
|
boolean |
isClusterSafe()
Checks whether the cluster is in a safe state.
|
boolean |
isLocalMemberSafe()
Check if local member is safe to shutdown, means check if 1st backups of partitions
those owned by local member are sync with primary.
|
boolean |
isMemberSafe(Member member)
Check if the given member is safe to shutdown, means check if 1st backups of partitions
those owned by given member are sync with primary.
|
String |
randomPartitionKey()
Generates a random partition key.
|
boolean |
removeMigrationListener(String registrationId) |
public PartitionServiceProxy(ClientPartitionService partitionService)
public String randomPartitionKey()
PartitionServicerandomPartitionKey in interface PartitionServicepublic Set<Partition> getPartitions()
PartitionServicegetPartitions in interface PartitionServicepublic Partition getPartition(Object key)
PartitionServicegetPartition in interface PartitionServicekey - keypublic String addMigrationListener(MigrationListener migrationListener)
addMigrationListener in interface PartitionServicemigrationListener - listenerpublic boolean removeMigrationListener(String registrationId)
removeMigrationListener in interface PartitionServiceregistrationId - Id of listener registration.public boolean isClusterSafe()
PartitionServiceisClusterSafe in interface PartitionServicetrue if there are no partitions being migrated, and there are sufficient backups
for each partition per the configuration, otherwise false.public boolean isMemberSafe(Member member)
PartitionServiceisMemberSafe in interface PartitionServicemember - Cluster member to query.true if member in a safe state, other wise false.public boolean isLocalMemberSafe()
PartitionServiceisLocalMemberSafe in interface PartitionServicepublic boolean forceLocalMemberToBeSafe(long timeout,
TimeUnit unit)
PartitionServiceforceLocalMemberToBeSafe in interface PartitionServiceCopyright © 2014 Hazelcast, Inc.. All Rights Reserved.