use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ObjectMultiMapProxy method valueCount.
@Override
public int valueCount(K key) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
final NodeEngine nodeEngine = getNodeEngine();
Data dataKey = nodeEngine.toData(key);
return countInternal(dataKey);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ObjectMultiMapProxy method forceUnlock.
@Override
public void forceUnlock(K key) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
final NodeEngine nodeEngine = getNodeEngine();
Data dataKey = nodeEngine.toData(key);
lockSupport.forceUnlock(nodeEngine, dataKey);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ClearExpiredOperation method isOwner.
private boolean isOwner() {
final NodeEngine nodeEngine = getNodeEngine();
final Address owner = nodeEngine.getPartitionService().getPartitionOwner(getPartitionId());
return nodeEngine.getThisAddress().equals(owner);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class EvictionChecker method isOwnerOrBackup.
protected boolean isOwnerOrBackup(int partitionId) {
final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
final IPartitionService partitionService = nodeEngine.getPartitionService();
final IPartition partition = partitionService.getPartition(partitionId, false);
final Address thisAddress = nodeEngine.getThisAddress();
return partition.isOwnerOrBackup(thisAddress);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class EvictionChecker method findPartitionIds.
protected List<Integer> findPartitionIds() {
final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
final IPartitionService partitionService = nodeEngine.getPartitionService();
final int partitionCount = partitionService.getPartitionCount();
List<Integer> partitionIds = null;
for (int partitionId = 0; partitionId < partitionCount; partitionId++) {
if (isOwnerOrBackup(partitionId)) {
if (partitionIds == null) {
partitionIds = new ArrayList<Integer>();
}
partitionIds.add(partitionId);
}
}
return partitionIds == null ? Collections.<Integer>emptyList() : partitionIds;
}
Aggregations