use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator in project hazelcast by hazelcast.
the class MemberMapInvalidationMetaDataMigrationTest method getPartitionToSequenceMap.
private static Map<Integer, Long> getPartitionToSequenceMap(String mapName, HazelcastInstance instance) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(instance);
int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
MetaDataGenerator metaDataGenerator = getMetaDataGenerator(nodeEngineImpl);
Map<Integer, Long> partitionToSequenceMap = createHashMap(partitionCount);
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 MemberMapMetaDataGeneratorTest method destroying_map_removes_related_metadata_when_near_cache_exists.
@Test
public void destroying_map_removes_related_metadata_when_near_cache_exists() {
MapConfig mapConfig = getMapConfig(MAP_NAME);
Config config = getConfig().addMapConfig(mapConfig);
HazelcastInstance member = createHazelcastInstance(config);
IMap<Integer, Integer> map = member.getMap(MAP_NAME);
map.put(1, 1);
final MetaDataGenerator metaDataGenerator = getMetaDataGenerator(member);
assertTrueEventually(new AssertTask() {
@Override
public void run() {
assertNotNull(metaDataGenerator.getSequenceGenerators().get(MAP_NAME));
}
});
map.destroy();
assertNull(metaDataGenerator.getSequenceGenerators().get(MAP_NAME));
}
Aggregations