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);
}
use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String mapName, 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();
InternalPartitionService partitionService = nodeEngineImpl.getPartitionService();
int partitionCount = partitionService.getPartitionCount();
metaDataGenerator.setCurrentSequence(mapName, getInt(partitionCount), getInt(MAX_VALUE));
}
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;
}
Aggregations