use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class MapNearCacheStateHolder method prepare.
void prepare(PartitionContainer container, int replicaIndex) {
MapService mapService = container.getMapService();
MetaDataGenerator metaData = getPartitionMetaDataGenerator(mapService);
int partitionId = container.getPartitionId();
partitionUuid = metaData.getUuidOrNull(partitionId);
ConcurrentMap<String, RecordStore> maps = container.getMaps();
for (Map.Entry<String, RecordStore> entry : maps.entrySet()) {
if (mapNameSequencePairs == emptyList()) {
mapNameSequencePairs = new ArrayList(container.getMaps().size());
}
String mapName = entry.getKey();
mapNameSequencePairs.add(mapName);
mapNameSequencePairs.add(metaData.currentSequence(mapName, partitionId));
}
}
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 MemberMapMetaDataFetcherTest method distortRandomPartitionUuid.
private void distortRandomPartitionUuid(int partition, UUID uuid, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setUuid(partition, uuid);
}
use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class MemberMapMetaDataFetcherTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String mapName, int partition, long sequence, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setCurrentSequence(mapName, partition, sequence);
}
Aggregations