Search in sources :

Example 1 with InvalidationMetaDataFetcher

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);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) ClusterService(com.hazelcast.internal.cluster.ClusterService) RepairingTask(com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask) ILogger(com.hazelcast.logging.ILogger) OperationService(com.hazelcast.spi.impl.operationservice.OperationService) ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService) MemberMapInvalidationMetaDataFetcher(com.hazelcast.map.impl.nearcache.invalidation.MemberMapInvalidationMetaDataFetcher) UUID(java.util.UUID) MemberMapInvalidationMetaDataFetcher(com.hazelcast.map.impl.nearcache.invalidation.MemberMapInvalidationMetaDataFetcher) InvalidationMetaDataFetcher(com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher)

Example 2 with InvalidationMetaDataFetcher

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);
}
Also used : RepairingTask(com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask) RepairingHandler(com.hazelcast.internal.nearcache.impl.invalidation.RepairingHandler) UUID(java.util.UUID) MetaDataContainer(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataContainer) InvalidationMetaDataFetcher(com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 3 with InvalidationMetaDataFetcher

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);
    });
}
Also used : RepairingTask(com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask) ILogger(com.hazelcast.logging.ILogger) ClientMapInvalidationMetaDataFetcher(com.hazelcast.client.map.impl.nearcache.invalidation.ClientMapInvalidationMetaDataFetcher) ClientCacheInvalidationMetaDataFetcher(com.hazelcast.client.cache.impl.nearcache.invalidation.ClientCacheInvalidationMetaDataFetcher) InvalidationMetaDataFetcher(com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher)

Example 4 with InvalidationMetaDataFetcher

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);
}
Also used : RepairingTask(com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask) RepairingHandler(com.hazelcast.internal.nearcache.impl.invalidation.RepairingHandler) UUID(java.util.UUID) MetaDataContainer(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataContainer) InvalidationMetaDataFetcher(com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 5 with InvalidationMetaDataFetcher

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);
}
Also used : RepairingTask(com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask) RepairingHandler(com.hazelcast.internal.nearcache.impl.invalidation.RepairingHandler) UUID(java.util.UUID) MetaDataContainer(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataContainer) InvalidationMetaDataFetcher(com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

InvalidationMetaDataFetcher (com.hazelcast.internal.nearcache.impl.invalidation.InvalidationMetaDataFetcher)5 RepairingTask (com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask)5 UUID (java.util.UUID)4 MetaDataContainer (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataContainer)3 RepairingHandler (com.hazelcast.internal.nearcache.impl.invalidation.RepairingHandler)3 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 Test (org.junit.Test)3 ILogger (com.hazelcast.logging.ILogger)2 ClientCacheInvalidationMetaDataFetcher (com.hazelcast.client.cache.impl.nearcache.invalidation.ClientCacheInvalidationMetaDataFetcher)1 ClientMapInvalidationMetaDataFetcher (com.hazelcast.client.map.impl.nearcache.invalidation.ClientMapInvalidationMetaDataFetcher)1 ClusterService (com.hazelcast.internal.cluster.ClusterService)1 MemberMapInvalidationMetaDataFetcher (com.hazelcast.map.impl.nearcache.invalidation.MemberMapInvalidationMetaDataFetcher)1 ExecutionService (com.hazelcast.spi.impl.executionservice.ExecutionService)1 OperationService (com.hazelcast.spi.impl.operationservice.OperationService)1 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)1