public interface InternalPartitionService extends CoreService
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_REPLICA_SYNC_DELAY |
static String |
MIGRATION_EVENT_TOPIC
Static constant for dispatching and listening migration events
|
static String |
PARTITION_LOST_EVENT_TOPIC
Static constant for dispatching and listening internal partition lost events
|
static long |
REPLICA_SYNC_RETRY_DELAY |
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
String |
addLocalPartitionLostListener(PartitionLostListener partitionLostListener) |
String |
addMigrationListener(MigrationListener migrationListener) |
String |
addPartitionLostListener(PartitionLostListener partitionLostListener) |
void |
clearPartitionReplicaVersions(int partitionId) |
void |
firstArrangement() |
Collection<MigrationInfo> |
getActiveMigrations() |
int |
getMaxBackupCount() |
Member |
getMember(Address address) |
int |
getMemberGroupsSize() |
List<Integer> |
getMemberPartitions(Address target) |
Map<Address,List<Integer>> |
getMemberPartitionsMap()
Gets member partition IDs.
|
long |
getMigrationQueueSize() |
InternalPartition |
getPartition(int partitionId)
Returns the InternalPartition for a given partitionId.
|
InternalPartition |
getPartition(int partitionId,
boolean triggerOwnerAssignment)
Returns the InternalPartition 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.
|
long[] |
getPartitionReplicaVersions(int partitionId) |
InternalPartition[] |
getPartitions() |
PartitionService |
getPartitionServiceProxy() |
int |
getPartitionStateVersion() |
boolean |
hasOnGoingMigration()
Checks if there are any cluster-wide migrations.
|
boolean |
hasOnGoingMigrationLocal()
Checks if there are any local migrations.
|
long[] |
incrementPartitionReplicaVersions(int partitionId,
int totalBackupCount) |
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
|
void |
memberAdded(MemberImpl newMember) |
void |
memberRemoved(MemberImpl deadMember) |
void |
pauseMigration() |
boolean |
prepareToSafeShutdown(long timeout,
TimeUnit seconds) |
boolean |
removeMigrationListener(String registrationId) |
boolean |
removePartitionLostListener(String registrationId) |
void |
resumeMigration() |
void |
setPartitionReplicaVersions(int partitionId,
long[] versions,
int replicaOffset) |
void |
updatePartitionReplicaVersions(int partitionId,
long[] replicaVersions,
int replicaIndex) |
static final String SERVICE_NAME
static final long DEFAULT_REPLICA_SYNC_DELAY
static final long REPLICA_SYNC_RETRY_DELAY
static final String MIGRATION_EVENT_TOPIC
static final String PARTITION_LOST_EVENT_TOPIC
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 assignedInternalPartition getPartition(int partitionId)
partitionId
- the partitionIdInternalPartition getPartition(int partitionId, boolean triggerOwnerAssignment)
triggerOwnerAssignment
is true,
it will trigger partition assignment.
The InternalPartition for a given partitionId wil 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()
Map<Address,List<Integer>> getMemberPartitionsMap()
int getMemberGroupsSize()
int getMaxBackupCount()
String addMigrationListener(MigrationListener migrationListener)
boolean removeMigrationListener(String registrationId)
String addPartitionLostListener(PartitionLostListener partitionLostListener)
String addLocalPartitionLostListener(PartitionLostListener partitionLostListener)
boolean removePartitionLostListener(String registrationId)
long getMigrationQueueSize()
void pauseMigration()
void resumeMigration()
void memberAdded(MemberImpl newMember)
void memberRemoved(MemberImpl deadMember)
boolean prepareToSafeShutdown(long timeout, TimeUnit seconds)
boolean isMemberStateSafe()
true
if this member in a safe state, otherwise false
InternalPartition[] getPartitions()
Collection<MigrationInfo> getActiveMigrations()
void firstArrangement()
long[] getPartitionReplicaVersions(int partitionId)
void updatePartitionReplicaVersions(int partitionId, long[] replicaVersions, int replicaIndex)
long[] incrementPartitionReplicaVersions(int partitionId, int totalBackupCount)
void setPartitionReplicaVersions(int partitionId, long[] versions, int replicaOffset)
void clearPartitionReplicaVersions(int partitionId)
PartitionService getPartitionServiceProxy()
int getPartitionStateVersion()
boolean hasOnGoingMigration()
boolean hasOnGoingMigrationLocal()
boolean isPartitionOwner(int partitionId)
partitionId
- Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.