use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class PartitionContainer method createRecordStore.
private RecordStore createRecordStore(String name) {
MapServiceContext serviceContext = mapService.getMapServiceContext();
MapContainer mapContainer = serviceContext.getMapContainer(name);
MapConfig mapConfig = mapContainer.getMapConfig();
NodeEngine nodeEngine = serviceContext.getNodeEngine();
IPartitionService ps = nodeEngine.getPartitionService();
OperationService opService = nodeEngine.getOperationService();
ExecutionService execService = nodeEngine.getExecutionService();
HazelcastProperties hazelcastProperties = nodeEngine.getProperties();
MapKeyLoader keyLoader = new MapKeyLoader(name, opService, ps, nodeEngine.getClusterService(), execService, mapContainer.toData(), serviceContext.getNodeWideLoadedKeyLimiter());
keyLoader.setMaxBatch(hazelcastProperties.getInteger(ClusterProperty.MAP_LOAD_CHUNK_SIZE));
keyLoader.setMaxSize(getMaxSizePerNode(mapConfig.getEvictionConfig()));
keyLoader.setHasBackup(mapConfig.getTotalBackupCount() > 0);
keyLoader.setMapOperationProvider(serviceContext.getMapOperationProvider(name));
if (!mapContainer.isGlobalIndexEnabled()) {
Indexes indexesForMap = mapContainer.createIndexes(false);
indexes.putIfAbsent(name, indexesForMap);
}
RecordStore recordStore = serviceContext.createRecordStore(mapContainer, partitionId, keyLoader);
recordStore.init();
return recordStore;
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class ForcedEviction method threadCount.
default int threadCount(MapOperation mapOperation) {
NodeEngine nodeEngine = mapOperation.getNodeEngine();
OperationService operationService = nodeEngine.getOperationService();
return operationService.getPartitionThreadCount();
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class DefaultRecordStore method hasPooledMemoryAllocator.
private boolean hasPooledMemoryAllocator() {
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
NativeMemoryConfig nativeMemoryConfig = nodeEngine.getConfig().getNativeMemoryConfig();
return nativeMemoryConfig != null && nativeMemoryConfig.getAllocatorType() == POOLED;
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class DefaultRecordStore method clearLockStore.
private void clearLockStore() {
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
LockSupportService lockService = nodeEngine.getServiceOrNull(LockSupportService.SERVICE_NAME);
if (lockService != null) {
ObjectNamespace namespace = MapService.getObjectNamespace(name);
lockService.clearLockStore(partitionId, namespace);
}
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class AbstractRecordStore method createLockStore.
protected LockStore createLockStore() {
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
LockSupportService lockService = nodeEngine.getServiceOrNull(LockSupportService.SERVICE_NAME);
if (lockService == null) {
return null;
}
return lockService.createLockStore(partitionId, MapService.getObjectNamespace(name));
}
Aggregations