use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class MapInvalidationMetaDataMigrationTest method getPartitionToSequenceMap.
private Map<Integer, Long> getPartitionToSequenceMap(String mapName, HazelcastInstance instance) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(instance);
int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
HashMap<Integer, Long> partitionToSequenceMap = new HashMap<Integer, Long>(partitionCount);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
for (int i = 0; i < partitionCount; i++) {
partitionToSequenceMap.put(i, metaDataGenerator.currentSequence(mapName, i));
}
return partitionToSequenceMap;
}
use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class MapInvalidationMetaDataMigrationTest method getPartitionToUuidMap.
private Map<Integer, UUID> getPartitionToUuidMap(HazelcastInstance instance) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(instance);
int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
HashMap<Integer, UUID> partitionToSequenceMap = new HashMap<Integer, UUID>(partitionCount);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
for (int i = 0; i < partitionCount; i++) {
partitionToSequenceMap.put(i, metaDataGenerator.getUuidOrNull(i));
}
return partitionToSequenceMap;
}
use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class CacheGetInvalidationMetaDataOperation method getNamePartitionSequenceList.
private Map<String, List<Map.Entry<Integer, Long>>> getNamePartitionSequenceList(List<Integer> ownedPartitionIds) {
MetaDataGenerator metaDataGenerator = getPartitionMetaDataGenerator();
Map<String, List<Map.Entry<Integer, Long>>> sequences = new HashMap<String, List<Map.Entry<Integer, Long>>>(ownedPartitionIds.size());
for (String name : names) {
List<Map.Entry<Integer, Long>> mapSequences = new ArrayList<Map.Entry<Integer, Long>>();
for (Integer partitionId : ownedPartitionIds) {
long partitionSequence = metaDataGenerator.currentSequence(name, partitionId);
if (partitionSequence != 0) {
mapSequences.add(new AbstractMap.SimpleEntry<Integer, Long>(partitionId, partitionSequence));
}
}
sequences.put(name, mapSequences);
}
return sequences;
}
use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class CacheGetInvalidationMetaDataOperation method getPartitionUuidList.
private Map<Integer, UUID> getPartitionUuidList(List<Integer> ownedPartitionIds) {
MetaDataGenerator metaDataGenerator = getPartitionMetaDataGenerator();
Map<Integer, UUID> partitionUuids = new HashMap<Integer, UUID>(ownedPartitionIds.size());
for (Integer partitionId : ownedPartitionIds) {
UUID uuid = metaDataGenerator.getUuidOrNull(partitionId);
if (uuid != null) {
partitionUuids.put(partitionId, uuid);
}
}
return partitionUuids;
}
use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class MapGetInvalidationMetaDataOperation method getPartitionUuidList.
private Map<Integer, UUID> getPartitionUuidList(List<Integer> ownedPartitionIds) {
MetaDataGenerator metaDataGenerator = getPartitionMetaDataGenerator();
Map<Integer, UUID> partitionUuids = new HashMap<Integer, UUID>(ownedPartitionIds.size());
for (Integer partitionId : ownedPartitionIds) {
UUID uuid = metaDataGenerator.getUuidOrNull(partitionId);
if (uuid != null) {
partitionUuids.put(partitionId, uuid);
}
}
return partitionUuids;
}
Aggregations