public interface InternalPartitionService extends IPartitionService, ManagedService, GracefulShutdownAwareService
Modifier and Type | Field and Description |
---|---|
static String |
MIGRATION_EVENT_TOPIC
Static constant for dispatching and listening migration events
|
static int |
MIGRATION_RETRY_COUNT
Retry count for migration operations.
|
static long |
MIGRATION_RETRY_PAUSE
Retry pause for migration operations in milliseconds.
|
static String |
PARTITION_LOST_EVENT_TOPIC
Static constant for dispatching and listening internal partition lost events
|
SERVICE_NAME
Modifier and Type | Method and Description |
---|---|
PartitionRuntimeState |
createPartitionState()
Creates the current partition runtime state.
|
PartitionTableView |
createPartitionTableView()
Creates an immutable/readonly view of partition table.
|
PartitionRuntimeState |
firstArrangement()
Causes the partition table to be arranged and published to members if :
this instance has started
this instance is the master
the cluster is
ClusterState.ACTIVE
if the partition table has not already been arranged
if there is no cluster membership change
If this instance is not the master, it will trigger the master to assign the partitions. |
InternalPartition[] |
getInternalPartitions() |
int |
getMemberGroupsSize()
Number of the member groups to be used in partition assignments.
|
List<Integer> |
getMemberPartitionsIfAssigned(Address target)
Returns partition ID list assigned to given target if partitions are assigned when method is called.
|
InternalPartition |
getPartition(int partitionId)
Returns the
IPartition for a given partition ID. |
InternalPartition |
getPartition(int partitionId,
boolean triggerOwnerAssignment)
Returns the
IPartition for a given partition ID. |
PartitionReplicaStateChecker |
getPartitionReplicaStateChecker() |
PartitionReplicaVersionManager |
getPartitionReplicaVersionManager() |
PartitionServiceProxy |
getPartitionServiceProxy()
Returns the
PartitionServiceProxy of the partition service.. |
void |
memberAdded(Member member)
Called when a member is added to the cluster.
|
void |
memberRemoved(Member member)
Called when a member is removed from the cluster.
|
void |
pauseMigration()
Pause all migrations
|
void |
resumeMigration()
Resume all migrations
|
addLocalPartitionLostListener, addMigrationListener, addPartitionLostListener, getMaxAllowedBackupCount, getMemberPartitions, getMemberPartitionsMap, getMigrationQueueSize, getPartitionCount, getPartitionId, getPartitionId, getPartitionOwner, getPartitionOwnerOrWait, getPartitions, getPartitionStateVersion, hasOnGoingMigration, hasOnGoingMigrationLocal, isMemberStateSafe, isPartitionOwner, removeMigrationListener, removePartitionLostListener
init, reset, shutdown
onShutdown
static final int MIGRATION_RETRY_COUNT
Current Invocation mechanism retries first 5 invocations without pausing.
static final long MIGRATION_RETRY_PAUSE
static final String MIGRATION_EVENT_TOPIC
static final String PARTITION_LOST_EVENT_TOPIC
InternalPartition getPartition(int partitionId)
IPartitionService
IPartition
for a given partition ID.
If the owner of the partition is not set yet, it will trigger partition assignment.
The IPartition
for a given partition ID will never change, so the result can be cached safely.
getPartition
in interface IPartitionService
partitionId
- the partition IDInternalPartition getPartition(int partitionId, boolean triggerOwnerAssignment)
IPartitionService
IPartition
for a given partition ID.
If the owner of the partition is not set yet and triggerOwnerAssignment
is true
,
it will trigger partition assignment.
The IPartition
for a given partition ID will never change, so the result can be cached safely.
getPartition
in interface IPartitionService
partitionId
- the partition IDtriggerOwnerAssignment
- flag to trigger the partition assignmentint getMemberGroupsSize()
MemberGroupFactory
,
PartitionGroupConfig
void pauseMigration()
void resumeMigration()
void memberAdded(Member member)
member
- new membervoid memberRemoved(Member member)
member
- removed memberInternalPartition[] getInternalPartitions()
PartitionRuntimeState firstArrangement()
ClusterState.ACTIVE
PartitionRuntimeState
if this node is the master and the partition table is initializedHazelcastException
- if the partition state generator failed to arrange the partitionsPartitionStateManager.initializePartitionAssignments(java.util.Set)
PartitionRuntimeState createPartitionState()
null
if the node should fetch the most recent partition
table (e.g. this node is a newly appointed master) or if the partition state manager is not initialized.InternalPartitionServiceImpl.isFetchMostRecentPartitionTableTaskRequired()
,
FetchPartitionStateOperation
,
PartitionStateManager.isInitialized()
PartitionReplicaVersionManager getPartitionReplicaVersionManager()
PartitionTableView createPartitionTableView()
List<Integer> getMemberPartitionsIfAssigned(Address target)
PartitionServiceProxy getPartitionServiceProxy()
PartitionServiceProxy
of the partition service..PartitionServiceProxy
PartitionReplicaStateChecker getPartitionReplicaStateChecker()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.