Search in sources :

Example 86 with NodeEngine

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;
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) IPartitionService(com.hazelcast.internal.partition.IPartitionService) RecordStore(com.hazelcast.map.impl.recordstore.RecordStore) MapConfig(com.hazelcast.config.MapConfig) OperationService(com.hazelcast.spi.impl.operationservice.OperationService) ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService) Indexes(com.hazelcast.query.impl.Indexes)

Example 87 with NodeEngine

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();
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) OperationService(com.hazelcast.spi.impl.operationservice.OperationService)

Example 88 with NodeEngine

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;
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) NativeMemoryConfig(com.hazelcast.config.NativeMemoryConfig)

Example 89 with NodeEngine

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);
    }
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) LockSupportService(com.hazelcast.internal.locksupport.LockSupportService) ObjectNamespace(com.hazelcast.internal.services.ObjectNamespace)

Example 90 with NodeEngine

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));
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) LockSupportService(com.hazelcast.internal.locksupport.LockSupportService)

Aggregations

NodeEngine (com.hazelcast.spi.impl.NodeEngine)165 Data (com.hazelcast.internal.serialization.Data)48 OperationService (com.hazelcast.spi.impl.operationservice.OperationService)30 Address (com.hazelcast.cluster.Address)22 Test (org.junit.Test)21 ILogger (com.hazelcast.logging.ILogger)20 HazelcastInstance (com.hazelcast.core.HazelcastInstance)18 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)18 QuickTest (com.hazelcast.test.annotation.QuickTest)18 Config (com.hazelcast.config.Config)17 Operation (com.hazelcast.spi.impl.operationservice.Operation)16 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)15 IPartitionService (com.hazelcast.internal.partition.IPartitionService)12 Nonnull (javax.annotation.Nonnull)12 ArrayList (java.util.ArrayList)11 Future (java.util.concurrent.Future)11 Member (com.hazelcast.cluster.Member)10 UUID (java.util.UUID)10 InitializingObject (com.hazelcast.spi.impl.InitializingObject)9 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)9