use of com.hazelcast.internal.partition.IPartition in project hazelcast by hazelcast.
the class LocalLockCleanupOperation method shouldBackup.
@Override
public boolean shouldBackup() {
final NodeEngine nodeEngine = getNodeEngine();
IPartitionService partitionService = nodeEngine.getPartitionService();
IPartition partition = partitionService.getPartition(getPartitionId());
return partition.isLocal() && Boolean.TRUE.equals(response);
}
use of com.hazelcast.internal.partition.IPartition in project hazelcast by hazelcast.
the class ConsumeAccumulatorOperation method isLocal.
private boolean isLocal() {
NodeEngine nodeEngine = getNodeEngine();
IPartitionService partitionService = nodeEngine.getPartitionService();
IPartition partition = partitionService.getPartition(getPartitionId());
return partition.isLocal();
}
use of com.hazelcast.internal.partition.IPartition in project hazelcast by hazelcast.
the class ClearExpiredRecordsTask method runInternal.
private void runInternal() {
runningCleanupOperationsCount = 0;
long nowInMillis = nowInMillis();
boolean lostPartitionDetected = lostPartitionDetected();
List<T> containersToProcess = null;
for (int partitionId = 0; partitionId < partitionCount; partitionId++) {
T container = this.containers[partitionId];
IPartition partition = partitionService.getPartition(partitionId, false);
if (partition.isMigrating()) {
continue;
}
if (partition.isLocal()) {
if (lostPartitionDetected) {
equalizeBackupSizeWithPrimary(container);
}
}
if (canProcessContainer(container, partition, nowInMillis)) {
containersToProcess = addContainerTo(containersToProcess, container);
}
}
if (!isEmpty(containersToProcess)) {
sortPartitionContainers(containersToProcess);
sendCleanupOperations(containersToProcess);
}
sendExpiryQueuesToBackupIncrementally();
}
use of com.hazelcast.internal.partition.IPartition in project hazelcast by hazelcast.
the class LocalMapStatsProvider method getReplicaAddress.
/**
* Gets replica address. Waits if necessary.
*
* @see #waitForReplicaAddress
*/
private Address getReplicaAddress(int partitionId, int replicaNumber, int backupCount) {
IPartition partition = partitionService.getPartition(partitionId);
Address replicaAddress = partition.getReplicaAddress(replicaNumber);
if (replicaAddress == null) {
replicaAddress = waitForReplicaAddress(replicaNumber, partition, backupCount);
}
return replicaAddress;
}
use of com.hazelcast.internal.partition.IPartition in project hazelcast by hazelcast.
the class EvictorImpl method isBackup.
protected boolean isBackup(RecordStore recordStore) {
int partitionId = recordStore.getPartitionId();
IPartition partition = partitionService.getPartition(partitionId, false);
return !partition.isLocal();
}
Aggregations