Search in sources :

Example 46 with IPartitionService

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);
}
Also used : IPartitionService(com.hazelcast.spi.partition.IPartitionService)

Example 47 with IPartitionService

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);
    }
}
Also used : EvictionChecker(com.hazelcast.map.impl.eviction.EvictionChecker) IPartitionService(com.hazelcast.spi.partition.IPartitionService) EvictorImpl(com.hazelcast.map.impl.eviction.EvictorImpl) RuntimeMemoryInfoAccessor(com.hazelcast.util.RuntimeMemoryInfoAccessor) MemoryInfoAccessor(com.hazelcast.util.MemoryInfoAccessor) MapEvictionPolicy(com.hazelcast.map.eviction.MapEvictionPolicy)

Example 48 with IPartitionService

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;
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) IPartitionService(com.hazelcast.spi.partition.IPartitionService) RecordStore(com.hazelcast.map.impl.recordstore.RecordStore) DefaultRecordStore(com.hazelcast.map.impl.recordstore.DefaultRecordStore) DefaultRecordStore(com.hazelcast.map.impl.recordstore.DefaultRecordStore)

Aggregations

IPartitionService (com.hazelcast.spi.partition.IPartitionService)48 Data (com.hazelcast.nio.serialization.Data)11 NodeEngine (com.hazelcast.spi.NodeEngine)11 Address (com.hazelcast.nio.Address)8 HashMap (java.util.HashMap)8 OperationService (com.hazelcast.spi.OperationService)7 MigrationEndpoint (com.hazelcast.spi.partition.MigrationEndpoint)7 Map (java.util.Map)7 RecordStore (com.hazelcast.map.impl.recordstore.RecordStore)5 IPartition (com.hazelcast.spi.partition.IPartition)5 MapService (com.hazelcast.map.impl.MapService)3 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)3 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)3 ICacheService (com.hazelcast.cache.impl.ICacheService)2 CacheRecord (com.hazelcast.cache.impl.record.CacheRecord)2 QueueReplicationOperation (com.hazelcast.collection.impl.queue.operations.QueueReplicationOperation)2 Member (com.hazelcast.core.Member)2 ClusterService (com.hazelcast.internal.cluster.ClusterService)2 MapEvictionPolicy (com.hazelcast.map.eviction.MapEvictionPolicy)2