public class InternalPartitionImpl extends Object implements InternalPartition
MAX_REPLICA_COUNT
MAX_BACKUP_COUNT
Modifier and Type | Method and Description |
---|---|
Address |
getOwnerOrNull()
Returns the Address of the owner of this partition.
|
int |
getPartitionId()
Returns the partition id.
|
Address |
getReplicaAddress(int replicaIndex)
Returns Address of the replica.
|
int |
getReplicaIndex(Address address) |
static int |
getReplicaIndex(Address[] addresses,
Address address) |
boolean |
isLocal()
Checks if the partition is local.
|
boolean |
isMigrating()
Checks if there currently is a migration going on in this partition.
|
boolean |
isOwnerOrBackup(Address address)
Checks if given address is owner of primary or backup of this partition.
|
void |
setMigrating(boolean isMigrating) |
String |
toString() |
public int getPartitionId()
IPartition
getPartitionId
in interface IPartition
public boolean isMigrating()
IPartition
isMigrating
in interface IPartition
public void setMigrating(boolean isMigrating)
public boolean isLocal()
IPartition
IPartition.getOwnerOrNull()
returns the same address as 'this' address of the
ClusterService.getThisAddress()
. If the address is null or a different address, false
is returned.isLocal
in interface IPartition
public Address getOwnerOrNull()
IPartition
getOwnerOrNull
in interface IPartition
public Address getReplicaAddress(int replicaIndex)
IPartition
getReplicaAddress
in interface IPartition
replicaIndex
- the index of the replica.public boolean isOwnerOrBackup(Address address)
IPartition
isOwnerOrBackup
in interface IPartition
address
- owner addresspublic int getReplicaIndex(Address address)
getReplicaIndex
in interface InternalPartition
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.