public interface IPartitionService extends CoreService
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_NAME
The name of the service.
|
Modifier and Type | Method and Description |
---|---|
String |
addLocalPartitionLostListener(PartitionLostListener partitionLostListener) |
String |
addMigrationListener(MigrationListener migrationListener) |
String |
addPartitionLostListener(PartitionLostListener partitionLostListener) |
int |
getMaxAllowedBackupCount()
Returns maximum allowed backup count according to current
cluster formation and partition group configuration.
|
List<Integer> |
getMemberPartitions(Address target)
Returns partition ID list assigned to given target.
|
Map<Address,List<Integer>> |
getMemberPartitionsMap()
Gets member partition IDs.
|
long |
getMigrationQueueSize() |
IPartition |
getPartition(int partitionId)
Returns the IPartition for a given partitionId.
|
IPartition |
getPartition(int partitionId,
boolean triggerOwnerAssignment)
Returns the IPartition for a given partitionId.
|
int |
getPartitionCount()
Returns the number of partitions.
|
int |
getPartitionId(Data key)
Returns the partition ID for a Data key.
|
int |
getPartitionId(Object key)
Returns the partition ID for a given object.
|
Address |
getPartitionOwner(int partitionId)
Gets the owner of the partition if it's set.
|
Address |
getPartitionOwnerOrWait(int partitionId)
Gets the owner of the partition.
|
IPartition[] |
getPartitions() |
int |
getPartitionStateVersion() |
boolean |
hasOnGoingMigration()
Checks if there are any cluster-wide migrations.
|
boolean |
hasOnGoingMigrationLocal()
Checks if there are any local migrations.
|
boolean |
isMemberStateSafe()
Query and return if this member in a safe state or not.
|
boolean |
isPartitionOwner(int partitionId)
Check if this node is the owner of a partition
|
boolean |
removeMigrationListener(String registrationId) |
boolean |
removePartitionLostListener(String registrationId) |
static final String SERVICE_NAME
Address getPartitionOwner(int partitionId)
partitionId
- the partitionIdAddress getPartitionOwnerOrWait(int partitionId)
partitionId
- the partitionIdInterruptedException
NoDataMemberInClusterException
- if all nodes are lite members and partitions can't be assignedIPartition getPartition(int partitionId)
partitionId
- the partitionIdIPartition getPartition(int partitionId, boolean triggerOwnerAssignment)
triggerOwnerAssignment
is true,
it will trigger partition assignment.
The IPartition for a given partitionId will never change, so it can be cached safely.partitionId
- the partitionIdtriggerOwnerAssignment
- flag to trigger partition assignmentint getPartitionId(Data key)
key
- the Data key.NullPointerException
- if key is null.int getPartitionId(Object key)
key
- the object key.int getPartitionCount()
List<Integer> getMemberPartitions(Address target)
Map<Address,List<Integer>> getMemberPartitionsMap()
String addMigrationListener(MigrationListener migrationListener)
boolean removeMigrationListener(String registrationId)
String addPartitionLostListener(PartitionLostListener partitionLostListener)
String addLocalPartitionLostListener(PartitionLostListener partitionLostListener)
boolean removePartitionLostListener(String registrationId)
long getMigrationQueueSize()
boolean isMemberStateSafe()
true
if this member in a safe state, otherwise false
int getMaxAllowedBackupCount()
IPartition.MAX_BACKUP_COUNT
].int getPartitionStateVersion()
boolean hasOnGoingMigration()
boolean hasOnGoingMigrationLocal()
boolean isPartitionOwner(int partitionId)
partitionId
- IPartition[] getPartitions()
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.