use of com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher in project hazelcast by hazelcast.
the class MapNearCacheManager method createRepairingInvalidationTask.
private RepairingTask createRepairingInvalidationTask() {
ExecutionService executionService = nodeEngine.getExecutionService();
ClusterService clusterService = nodeEngine.getClusterService();
OperationService operationService = nodeEngine.getOperationService();
HazelcastProperties properties = nodeEngine.getProperties();
ILogger metadataFetcherLogger = nodeEngine.getLogger(MemberMapInvalidationMetaDataFetcher.class);
InvalidationMetaDataFetcher invalidationMetaDataFetcher = new MemberMapInvalidationMetaDataFetcher(clusterService, operationService, metadataFetcherLogger);
ILogger repairingTaskLogger = nodeEngine.getLogger(RepairingTask.class);
UUID localUuid = nodeEngine.getLocalMember().getUuid();
return new RepairingTask(properties, invalidationMetaDataFetcher, executionService.getGlobalTaskScheduler(), serializationService, partitionService, localUuid, repairingTaskLogger);
}
use of com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher in project hazelcast by hazelcast.
the class ClientCacheInvalidationMetaDataFetcherTest method fetches_sequence_and_uuid.
@Test
public void fetches_sequence_and_uuid() {
String cacheName = "test";
int partition = 1;
long givenSequence = getInt(1, MAX_VALUE);
UUID givenUuid = UuidUtil.newUnsecureUUID();
RepairingTask repairingTask = getRepairingTask(cacheName, partition, givenSequence, givenUuid);
InvalidationMetaDataFetcher invalidationMetaDataFetcher = repairingTask.getInvalidationMetaDataFetcher();
ConcurrentMap<String, RepairingHandler> handlers = repairingTask.getHandlers();
invalidationMetaDataFetcher.fetchMetadata(handlers);
RepairingHandler repairingHandler = handlers.get(getPrefixedName(cacheName));
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.InvalidationMetaDataFetcher in project hazelcast by hazelcast.
the class ClientContext method getRepairingTask.
public RepairingTask getRepairingTask(String serviceName) {
return getOrPutIfAbsent(repairingTasks, serviceName, name -> {
InvalidationMetaDataFetcher invalidationMetaDataFetcher = newMetaDataFetcher(serviceName);
ILogger logger = loggingService.getLogger(RepairingTask.class);
return new RepairingTask(properties, invalidationMetaDataFetcher, taskScheduler, serializationService, minimalPartitionService, clientConnectionManager.getClientUuid(), logger);
});
}
use of com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher in project hazelcast by hazelcast.
the class MemberMapInvalidationMetaDataFetcherTest method fetches_sequence_and_uuid.
@Test
public void fetches_sequence_and_uuid() {
String mapName = "test";
int partition = 1;
long givenSequence = getInt(1, Integer.MAX_VALUE);
UUID givenUuid = UuidUtil.newUnsecureUUID();
RepairingTask repairingTask = getRepairingTask(mapName, partition, givenSequence, givenUuid);
InvalidationMetaDataFetcher invalidationMetaDataFetcher = repairingTask.getInvalidationMetaDataFetcher();
ConcurrentMap<String, RepairingHandler> handlers = repairingTask.getHandlers();
invalidationMetaDataFetcher.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.InvalidationMetaDataFetcher in project hazelcast by hazelcast.
the class ClientMapInvalidationMetaDataFetcherTest method fetches_sequence_and_uuid.
@Test
public void fetches_sequence_and_uuid() {
String mapName = "test";
int partition = 1;
long givenSequence = getInt(1, Integer.MAX_VALUE);
UUID givenUuid = UuidUtil.newUnsecureUUID();
RepairingTask repairingTask = getRepairingTask(mapName, partition, givenSequence, givenUuid);
InvalidationMetaDataFetcher invalidationMetaDataFetcher = repairingTask.getInvalidationMetaDataFetcher();
ConcurrentMap<String, RepairingHandler> handlers = repairingTask.getHandlers();
invalidationMetaDataFetcher.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);
}
Aggregations