private boolean isOwner() { final NodeEngine nodeEngine = getNodeEngine(); final Address owner = nodeEngine.getPartitionService().getPartitionOwner(getPartitionId()); return nodeEngine.getThisAddress().equals(owner); }
private boolean isOwner() { final NodeEngine nodeEngine = getNodeEngine(); final Address owner = nodeEngine.getPartitionService().getPartitionOwner(getPartitionId()); return nodeEngine.getThisAddress().equals(owner); }
@Override public void run() throws Exception { if (getNodeEngine().getLocalMember().isLiteMember()) { // this operation shouldn't run on lite members. This situation can potentially be seen // when converting a data-member to lite-member during merge operations. return; } MapService mapService = getService(); MapServiceContext mapServiceContext = mapService.getMapServiceContext(); PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(getPartitionId()); ConcurrentMap<String, RecordStore> recordStores = partitionContainer.getMaps(); boolean backup = !isOwner(); for (final RecordStore recordStore : recordStores.values()) { if (recordStore.size() > 0 && recordStore.isExpirable()) { recordStore.evictExpiredEntries(expirationPercentage, backup); recordStore.disposeDeferredBlocks(); } } }
@Override public void run() throws Exception { if (getNodeEngine().getLocalMember().isLiteMember()) { // this operation shouldn't run on lite members. This situation can potentially be seen // when converting a data-member to lite-member during merge operations. return; } MapService mapService = getService(); MapServiceContext mapServiceContext = mapService.getMapServiceContext(); PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(getPartitionId()); ConcurrentMap<String, RecordStore> recordStores = partitionContainer.getMaps(); boolean backup = !isOwner(); for (final RecordStore recordStore : recordStores.values()) { if (recordStore.size() > 0 && recordStore.isExpirable()) { recordStore.evictExpiredEntries(expirationPercentage, backup); recordStore.disposeDeferredBlocks(); } } }