public class InternalPartitionServiceImpl extends Object implements InternalPartitionService, ManagedService, EventPublishingService<MigrationEvent,MigrationListener>
DEFAULT_REPLICA_SYNC_DELAY, MAX_PARALLEL_REPLICATIONS, REPLICA_SYNC_RETRY_DELAY, SERVICE_NAME| Constructor and Description |
|---|
InternalPartitionServiceImpl(Node node) |
| Modifier and Type | Method and Description |
|---|---|
String |
addMigrationListener(MigrationListener listener) |
void |
clearPartitionReplicaVersions(int partitionId) |
void |
dispatchEvent(MigrationEvent migrationEvent,
MigrationListener migrationListener) |
void |
firstArrangement() |
Collection<MigrationInfo> |
getActiveMigrations() |
MemberImpl |
getMember(Address address) |
int |
getMemberGroupsSize() |
List<Integer> |
getMemberPartitions(Address target) |
Map<Address,List<Integer>> |
getMemberPartitionsMap() |
long |
getMigrationQueueSize() |
com.hazelcast.partition.impl.InternalPartitionImpl |
getPartition(int partitionId)
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) |
long[] |
getPartitionReplicaVersions(int partitionId) |
InternalPartition[] |
getPartitions() |
PartitionServiceProxy |
getPartitionServiceProxy() |
boolean |
hasOnGoingMigration()
Checks if there currently are any migrations.
|
long[] |
incrementPartitionReplicaVersions(int partitionId,
int backupCount) |
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes the ManagedService
|
void |
memberAdded(MemberImpl member) |
void |
memberRemoved(MemberImpl member) |
void |
pauseMigration() |
boolean |
prepareToSafeShutdown(long timeout,
TimeUnit unit) |
boolean |
removeMigrationListener(String registrationId) |
void |
reset()
reset service, back to initial state
|
void |
resumeMigration() |
void |
setPartitionReplicaVersions(int partitionId,
long[] versions) |
void |
shutdown(boolean terminate)
Shuts down the ManagedService.
|
String |
toString() |
void |
updatePartitionReplicaVersions(int partitionId,
long[] versions,
int replicaIndex) |
public InternalPartitionServiceImpl(Node node)
public void init(NodeEngine nodeEngine, Properties properties)
ManagedServiceinit in interface ManagedServicenodeEngine - the NodeEngine this ManagedService is initialized with.properties - the Propertiespublic Address getPartitionOwner(int partitionId)
getPartitionOwner in interface InternalPartitionServicepublic void firstArrangement()
firstArrangement in interface InternalPartitionServicepublic int getMemberGroupsSize()
getMemberGroupsSize in interface InternalPartitionServicepublic void memberAdded(MemberImpl member)
memberAdded in interface InternalPartitionServicepublic void memberRemoved(MemberImpl member)
memberRemoved in interface InternalPartitionServicepublic Collection<MigrationInfo> getActiveMigrations()
getActiveMigrations in interface InternalPartitionServicepublic InternalPartition[] getPartitions()
getPartitions in interface InternalPartitionServicepublic MemberImpl getMember(Address address)
getMember in interface InternalPartitionServicepublic com.hazelcast.partition.impl.InternalPartitionImpl getPartition(int partitionId)
InternalPartitionServicegetPartition in interface InternalPartitionServicepartitionId - the partitionIdpublic boolean prepareToSafeShutdown(long timeout,
TimeUnit unit)
prepareToSafeShutdown in interface InternalPartitionServicepublic boolean hasOnGoingMigration()
InternalPartitionServicehasOnGoingMigration in interface InternalPartitionServicepublic final int getPartitionId(Data key)
InternalPartitionServicegetPartitionId in interface InternalPartitionServicekey - the Data key.public final int getPartitionId(Object key)
InternalPartitionServicegetPartitionId in interface InternalPartitionServicekey - the object key.public final int getPartitionCount()
InternalPartitionServicegetPartitionCount in interface InternalPartitionServicepublic long[] incrementPartitionReplicaVersions(int partitionId,
int backupCount)
incrementPartitionReplicaVersions in interface InternalPartitionServicepublic void updatePartitionReplicaVersions(int partitionId,
long[] versions,
int replicaIndex)
updatePartitionReplicaVersions in interface InternalPartitionServicepublic long[] getPartitionReplicaVersions(int partitionId)
getPartitionReplicaVersions in interface InternalPartitionServicepublic void setPartitionReplicaVersions(int partitionId,
long[] versions)
setPartitionReplicaVersions in interface InternalPartitionServicepublic void clearPartitionReplicaVersions(int partitionId)
clearPartitionReplicaVersions in interface InternalPartitionServicepublic Map<Address,List<Integer>> getMemberPartitionsMap()
getMemberPartitionsMap in interface InternalPartitionServicepublic List<Integer> getMemberPartitions(Address target)
getMemberPartitions in interface InternalPartitionServicepublic void reset()
ManagedServicereset in interface ManagedServicepublic void pauseMigration()
pauseMigration in interface InternalPartitionServicepublic void resumeMigration()
resumeMigration in interface InternalPartitionServicepublic void shutdown(boolean terminate)
ManagedServiceshutdown in interface ManagedServicepublic long getMigrationQueueSize()
getMigrationQueueSize in interface InternalPartitionServicepublic PartitionServiceProxy getPartitionServiceProxy()
getPartitionServiceProxy in interface InternalPartitionServicepublic String addMigrationListener(MigrationListener listener)
addMigrationListener in interface InternalPartitionServicepublic boolean removeMigrationListener(String registrationId)
removeMigrationListener in interface InternalPartitionServicepublic void dispatchEvent(MigrationEvent migrationEvent, MigrationListener migrationListener)
dispatchEvent in interface EventPublishingService<MigrationEvent,MigrationListener>Copyright © 2021 Hazelcast, Inc.. All rights reserved.