use of com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask in project hazelcast by hazelcast.
the class ClientMapMetaDataFetcherTest method fetches_sequence_and_uuid.
@Test
public void fetches_sequence_and_uuid() throws Exception {
String mapName = "test";
int partition = 1;
long givenSequence = getInt(1, Integer.MAX_VALUE);
UUID givenUuid = UuidUtil.newSecureUUID();
RepairingTask repairingTask = getRepairingTask(mapName, partition, givenSequence, givenUuid);
MetaDataFetcher metaDataFetcher = repairingTask.getMetaDataFetcher();
ConcurrentMap<String, RepairingHandler> handlers = repairingTask.getHandlers();
metaDataFetcher.fetchMetadata(handlers);
RepairingHandler repairingHandler = handlers.get(mapName);
MetaDataContainer metaDataContainer = repairingHandler.getMetaDataContainer(partition);
UUID foundUuid = metaDataContainer.getUuid();
long foundSequence = metaDataContainer.getSequence();
assertEquals(givenSequence, foundSequence);
assertEquals(givenUuid, foundUuid);
}
use of com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask in project hazelcast by hazelcast.
the class ClientContext method newRepairingTask.
private RepairingTask newRepairingTask(String serviceName) {
MetaDataFetcher metaDataFetcher = newMetaDataFetcher(serviceName);
ILogger logger = loggingService.getLogger(RepairingTask.class);
return new RepairingTask(metaDataFetcher, executionService, minimalPartitionService, properties, localUuid, logger);
}
use of com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask in project hazelcast by hazelcast.
the class MapNearCacheLeakTest method createNearCacheContextBuilder.
private <K, V> NearCacheTestContextBuilder<K, V, Data, String> createNearCacheContextBuilder() {
Config configWithNearCache = getConfig(true);
HazelcastInstance nearCacheInstance = hazelcastFactory.newHazelcastInstance(configWithNearCache);
IMap<K, V> nearCacheMap = nearCacheInstance.getMap(DEFAULT_NEAR_CACHE_NAME);
NearCacheManager nearCacheManager = getMapNearCacheManager(nearCacheInstance);
NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
RepairingTask repairingTask = ((MapNearCacheManager) nearCacheManager).getRepairingTask();
return new NearCacheTestContextBuilder<K, V, Data, String>(nearCacheConfig, getSerializationService(nearCacheInstance)).setNearCacheInstance(nearCacheInstance).setNearCacheAdapter(new IMapDataStructureAdapter<K, V>(nearCacheMap)).setNearCache(nearCache).setNearCacheManager(nearCacheManager).setHasLocalData(true).setRepairingTask(repairingTask);
}
use of com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask in project hazelcast by hazelcast.
the class TxnMapNearCacheLeakTest method createNearCacheContextBuilder.
private <K, V> NearCacheTestContextBuilder<K, V, Data, String> createNearCacheContextBuilder() {
Config configWithNearCache = getConfig(true);
HazelcastInstance nearCacheInstance = hazelcastFactory.newHazelcastInstance(configWithNearCache);
nearCacheInstance.getMap(DEFAULT_NEAR_CACHE_NAME);
NearCacheManager nearCacheManager = getMapNearCacheManager(nearCacheInstance);
NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
RepairingTask repairingTask = ((MapNearCacheManager) nearCacheManager).getRepairingTask();
return new NearCacheTestContextBuilder<K, V, Data, String>(nearCacheConfig, getSerializationService(nearCacheInstance)).setNearCacheInstance(nearCacheInstance).setNearCacheAdapter(new TransactionalMapDataStructureAdapter<K, V>(nearCacheInstance, DEFAULT_NEAR_CACHE_NAME)).setNearCache(nearCache).setNearCacheManager(nearCacheManager).setRepairingTask(repairingTask);
}
Aggregations