Search in sources :

Example 1 with MetaDataFetcher

use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataFetcher in project hazelcast by hazelcast.

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

Example 2 with MetaDataFetcher

use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataFetcher in project hazelcast by hazelcast.

the class ClientCacheMetaDataFetcherTest method fetches_sequence_and_uuid.

@Test
public void fetches_sequence_and_uuid() throws Exception {
    String cacheName = "test";
    int partition = 1;
    long givenSequence = getInt(1, MAX_VALUE);
    UUID givenUuid = UuidUtil.newSecureUUID();
    RepairingTask repairingTask = getRepairingTask(cacheName, partition, givenSequence, givenUuid);
    MetaDataFetcher metaDataFetcher = repairingTask.getMetaDataFetcher();
    ConcurrentMap<String, RepairingHandler> handlers = repairingTask.getHandlers();
    metaDataFetcher.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) MetaDataFetcher(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataFetcher) MetaDataContainer(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataContainer) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 3 with MetaDataFetcher

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

Example 4 with MetaDataFetcher

use of com.hazelcast.internal.nearcache.impl.invalidation.MetaDataFetcher 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);
}
Also used : RepairingTask(com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask) ILogger(com.hazelcast.logging.ILogger) ClientCacheMetaDataFetcher(com.hazelcast.client.cache.impl.nearcache.invalidation.ClientCacheMetaDataFetcher) MetaDataFetcher(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataFetcher) ClientMapMetaDataFetcher(com.hazelcast.client.map.impl.nearcache.invalidation.ClientMapMetaDataFetcher)

Aggregations

MetaDataFetcher (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataFetcher)4 RepairingTask (com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask)4 MetaDataContainer (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataContainer)3 RepairingHandler (com.hazelcast.internal.nearcache.impl.invalidation.RepairingHandler)3 ParallelTest (com.hazelcast.test.annotation.ParallelTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 UUID (java.util.UUID)3 Test (org.junit.Test)3 ClientCacheMetaDataFetcher (com.hazelcast.client.cache.impl.nearcache.invalidation.ClientCacheMetaDataFetcher)1 ClientMapMetaDataFetcher (com.hazelcast.client.map.impl.nearcache.invalidation.ClientMapMetaDataFetcher)1 ILogger (com.hazelcast.logging.ILogger)1