|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hazelcast.partition.impl.InternalPartitionServiceImpl
public class InternalPartitionServiceImpl
The InternalPartitionService implementation.
| Field Summary |
|---|
| Fields inherited from interface com.hazelcast.partition.InternalPartitionService |
|---|
DEFAULT_REPLICA_SYNC_DELAY, REPLICA_SYNC_RETRY_DELAY, SERVICE_NAME |
| Constructor Summary | |
|---|---|
InternalPartitionServiceImpl(Node node)
|
|
| Method Summary | |
|---|---|
String |
addMigrationListener(MigrationListener listener)
|
void |
clearPartitionReplicaVersions(int partitionId)
|
void |
dispatchEvent(MigrationEvent migrationEvent,
MigrationListener migrationListener)
|
void |
firstArrangement()
|
Collection<MigrationInfo> |
getActiveMigrations()
|
int |
getMaxBackupCount()
|
MemberImpl |
getMember(Address address)
|
int |
getMemberGroupsSize()
|
List<Integer> |
getMemberPartitions(Address target)
|
Map<Address,List<Integer>> |
getMemberPartitionsMap()
Gets member partition IDs. |
long |
getMigrationQueueSize()
|
Node |
getNode()
|
com.hazelcast.partition.impl.InternalPartitionImpl |
getPartition(int partitionId)
Returns the InternalPartition for a given partitionId. |
com.hazelcast.partition.impl.InternalPartitionImpl |
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. |
long |
getPartitionMigrationTimeout()
|
Address |
getPartitionOwner(int partitionId)
Gets the owner of the partition if it's set. |
Address |
getPartitionOwnerOrWait(int partition)
Gets the owner of the partition. |
long[] |
getPartitionReplicaVersions(int partitionId)
|
InternalPartition[] |
getPartitions()
|
PartitionServiceProxy |
getPartitionServiceProxy()
|
int |
getPartitionStateVersion()
|
boolean |
hasOnGoingMigration()
Checks if there currently are any migrations. |
boolean |
hasOnGoingMigrationLocal()
|
long[] |
incrementPartitionReplicaVersions(int partitionId,
int backupCount)
|
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this ManagedService |
boolean |
isMemberStateSafe()
Query and return if this member in a safe state or not. |
boolean |
isMigrationActive()
|
void |
memberAdded(MemberImpl member)
|
void |
memberRemoved(MemberImpl member)
|
void |
pauseMigration()
|
boolean |
prepareToSafeShutdown(long timeout,
TimeUnit unit)
|
boolean |
removeMigrationListener(String registrationId)
|
void |
reset()
reset this ManagedService back to initial state. |
void |
resumeMigration()
|
void |
setPartitionReplicaVersions(int partitionId,
long[] versions,
int replicaOffset)
|
void |
shutdown(boolean terminate)
Shuts down this ManagedService. |
String |
toString()
|
void |
updatePartitionReplicaVersions(int partitionId,
long[] versions,
int replicaIndex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public InternalPartitionServiceImpl(Node node)
| Method Detail |
|---|
public void init(NodeEngine nodeEngine,
Properties properties)
ManagedService
init in interface ManagedServicenodeEngine - the NodeEngine this ManagedService belongs to.properties - the Properties. Can be used to pass settings to the service.public Address getPartitionOwner(int partitionId)
InternalPartitionService
getPartitionOwner in interface InternalPartitionServicepartitionId - the partitionId
public Address getPartitionOwnerOrWait(int partition)
throws InterruptedException
InternalPartitionService
getPartitionOwnerOrWait in interface InternalPartitionServicepartition - the partitionId
InterruptedExceptionpublic void firstArrangement()
firstArrangement in interface InternalPartitionServicepublic int getMemberGroupsSize()
getMemberGroupsSize in interface InternalPartitionServicepublic int getMaxBackupCount()
getMaxBackupCount 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)
InternalPartitionService
getPartition in interface InternalPartitionServicepartitionId - the partitionId
public com.hazelcast.partition.impl.InternalPartitionImpl getPartition(int partitionId,
boolean triggerOwnerAssignment)
InternalPartitionServicetriggerOwnerAssignment is true,
it will trigger partition assignment.
The InternalPartition for a given partitionId wil never change; so it can be cached safely.
getPartition in interface InternalPartitionServicepartitionId - the partitionIdtriggerOwnerAssignment - flag to trigger partition assignment
public boolean prepareToSafeShutdown(long timeout,
TimeUnit unit)
prepareToSafeShutdown in interface InternalPartitionServicepublic boolean isMemberStateSafe()
InternalPartitionService
isMemberStateSafe in interface InternalPartitionServicetrue if this member in a safe state, otherwise falsepublic boolean hasOnGoingMigration()
InternalPartitionService
hasOnGoingMigration in interface InternalPartitionServicepublic boolean hasOnGoingMigrationLocal()
hasOnGoingMigrationLocal in interface InternalPartitionServicepublic final int getPartitionId(Data key)
InternalPartitionService
getPartitionId in interface InternalPartitionServicekey - the Data key.
public final int getPartitionId(Object key)
InternalPartitionService
getPartitionId in interface InternalPartitionServicekey - the object key.
public final int getPartitionCount()
InternalPartitionService
getPartitionCount in interface InternalPartitionServicepublic long getPartitionMigrationTimeout()
public long[] incrementPartitionReplicaVersions(int partitionId,
int backupCount)
incrementPartitionReplicaVersions in interface InternalPartitionService
public void updatePartitionReplicaVersions(int partitionId,
long[] versions,
int replicaIndex)
updatePartitionReplicaVersions in interface InternalPartitionServicepublic long[] getPartitionReplicaVersions(int partitionId)
getPartitionReplicaVersions in interface InternalPartitionService
public void setPartitionReplicaVersions(int partitionId,
long[] versions,
int replicaOffset)
setPartitionReplicaVersions in interface InternalPartitionServicepublic void clearPartitionReplicaVersions(int partitionId)
clearPartitionReplicaVersions in interface InternalPartitionServicepublic Map<Address,List<Integer>> getMemberPartitionsMap()
InternalPartitionService
getMemberPartitionsMap in interface InternalPartitionServicepublic List<Integer> getMemberPartitions(Address target)
getMemberPartitions in interface InternalPartitionServicepublic void reset()
ManagedService
reset in interface ManagedServicepublic void pauseMigration()
pauseMigration in interface InternalPartitionServicepublic void resumeMigration()
resumeMigration in interface InternalPartitionServicepublic boolean isMigrationActive()
public void shutdown(boolean terminate)
ManagedService
shutdown 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 InternalPartitionService
public void dispatchEvent(MigrationEvent migrationEvent,
MigrationListener migrationListener)
dispatchEvent in interface EventPublishingService<MigrationEvent,MigrationListener>public String toString()
toString in class Objectpublic Node getNode()
public int getPartitionStateVersion()
getPartitionStateVersion in interface InternalPartitionService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||