use of com.hazelcast.spi.partition.IPartitionService in project hazelcast by hazelcast.
the class AtomicLongService method getPartitionId.
private int getPartitionId(String name) {
IPartitionService partitionService = nodeEngine.getPartitionService();
String partitionKey = getPartitionKey(name);
return partitionService.getPartitionId(partitionKey);
}
use of com.hazelcast.spi.partition.IPartitionService in project hazelcast by hazelcast.
the class MapContainer method initEvictor.
// this method is overridden.
public void initEvictor() {
MapEvictionPolicy mapEvictionPolicy = mapConfig.getMapEvictionPolicy();
if (mapEvictionPolicy == null) {
evictor = NULL_EVICTOR;
} else {
MemoryInfoAccessor memoryInfoAccessor = getMemoryInfoAccessor();
EvictionChecker evictionChecker = new EvictionChecker(memoryInfoAccessor, mapServiceContext);
IPartitionService partitionService = mapServiceContext.getNodeEngine().getPartitionService();
evictor = new EvictorImpl(mapEvictionPolicy, evictionChecker, partitionService);
}
}
use of com.hazelcast.spi.partition.IPartitionService in project hazelcast by hazelcast.
the class RecordStoreTest method getRecordStore.
private DefaultRecordStore getRecordStore(IMap<Object, Object> map, int key) {
MapServiceContext mapServiceContext = getMapServiceContext((MapProxyImpl) map);
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
IPartitionService partitionService = nodeEngine.getPartitionService();
int partitionId = partitionService.getPartitionId(key);
PartitionContainer container = mapServiceContext.getPartitionContainer(partitionId);
RecordStore recordStore = container.getRecordStore(map.getName());
return (DefaultRecordStore) recordStore;
}
Aggregations