Search in sources :

Example 36 with MetaDataGenerator

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

the class ClientCacheInvalidationMetaDataFetcherTest method distortRandomPartitionSequence.

private void distortRandomPartitionSequence(String cacheName, int partition, long sequence, HazelcastInstance member) {
    NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
    CacheService service = nodeEngineImpl.getService(SERVICE_NAME);
    CacheEventHandler cacheEventHandler = service.getCacheEventHandler();
    MetaDataGenerator metaDataGenerator = cacheEventHandler.getMetaDataGenerator();
    metaDataGenerator.setCurrentSequence(cacheName, partition, sequence);
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) Accessors.getNodeEngineImpl(com.hazelcast.test.Accessors.getNodeEngineImpl) CacheEventHandler(com.hazelcast.cache.impl.CacheEventHandler) MetaDataGenerator(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator) CacheService(com.hazelcast.cache.impl.CacheService)

Example 37 with MetaDataGenerator

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

the class ClientCacheInvalidationMetaDataFetcherTest method distortRandomPartitionUuid.

private void distortRandomPartitionUuid(int partition, UUID uuid, HazelcastInstance member) {
    NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
    CacheService service = nodeEngineImpl.getService(SERVICE_NAME);
    CacheEventHandler cacheEventHandler = service.getCacheEventHandler();
    MetaDataGenerator metaDataGenerator = cacheEventHandler.getMetaDataGenerator();
    metaDataGenerator.setUuid(partition, uuid);
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) Accessors.getNodeEngineImpl(com.hazelcast.test.Accessors.getNodeEngineImpl) CacheEventHandler(com.hazelcast.cache.impl.CacheEventHandler) MetaDataGenerator(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator) CacheService(com.hazelcast.cache.impl.CacheService)

Example 38 with MetaDataGenerator

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

the class ClientCacheInvalidationMetadataDistortionTest method distortRandomPartitionUuid.

private void distortRandomPartitionUuid(HazelcastInstance member) {
    NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
    int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
    CacheService service = nodeEngineImpl.getService(CacheService.SERVICE_NAME);
    CacheEventHandler cacheEventHandler = service.getCacheEventHandler();
    MetaDataGenerator metaDataGenerator = cacheEventHandler.getMetaDataGenerator();
    UUID uuid = UuidUtil.newUnsecureUUID();
    int randomPartition = getInt(partitionCount);
    metaDataGenerator.setUuid(randomPartition, uuid);
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) Accessors.getNodeEngineImpl(com.hazelcast.test.Accessors.getNodeEngineImpl) CacheEventHandler(com.hazelcast.cache.impl.CacheEventHandler) MetaDataGenerator(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator) UUID(java.util.UUID) CacheService(com.hazelcast.cache.impl.CacheService)

Example 39 with MetaDataGenerator

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

the class ClientCacheInvalidationMetadataDistortionTest method distortRandomPartitionSequence.

private void distortRandomPartitionSequence(String mapName, HazelcastInstance member) {
    NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
    CacheService service = nodeEngineImpl.getService(CacheService.SERVICE_NAME);
    CacheEventHandler cacheEventHandler = service.getCacheEventHandler();
    MetaDataGenerator metaDataGenerator = cacheEventHandler.getMetaDataGenerator();
    InternalPartitionService partitionService = nodeEngineImpl.getPartitionService();
    int partitionCount = partitionService.getPartitionCount();
    int randomPartition = getInt(partitionCount);
    int randomSequence = getInt(MAX_VALUE);
    metaDataGenerator.setCurrentSequence(mapName, randomPartition, randomSequence);
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) Accessors.getNodeEngineImpl(com.hazelcast.test.Accessors.getNodeEngineImpl) InternalPartitionService(com.hazelcast.internal.partition.InternalPartitionService) CacheEventHandler(com.hazelcast.cache.impl.CacheEventHandler) MetaDataGenerator(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator) CacheService(com.hazelcast.cache.impl.CacheService)

Example 40 with MetaDataGenerator

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

the class ClientMapInvalidationMetadataDistortionTest method distortRandomPartitionUuid.

private void distortRandomPartitionUuid(HazelcastInstance member) {
    NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
    int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
    int partitionId = getInt(partitionCount);
    MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
    MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
    Invalidator invalidator = mapNearCacheManager.getInvalidator();
    MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
    metaDataGenerator.setUuid(partitionId, UuidUtil.newUnsecureUUID());
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) Accessors.getNodeEngineImpl(com.hazelcast.test.Accessors.getNodeEngineImpl) MapNearCacheManager(com.hazelcast.map.impl.nearcache.MapNearCacheManager) Invalidator(com.hazelcast.internal.nearcache.impl.invalidation.Invalidator) MapService(com.hazelcast.map.impl.MapService) MetaDataGenerator(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Aggregations

MetaDataGenerator (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator)47 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)31 MapService (com.hazelcast.map.impl.MapService)23 Invalidator (com.hazelcast.internal.nearcache.impl.invalidation.Invalidator)20 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)20 MapNearCacheManager (com.hazelcast.map.impl.nearcache.MapNearCacheManager)20 Accessors.getNodeEngineImpl (com.hazelcast.test.Accessors.getNodeEngineImpl)17 CacheEventHandler (com.hazelcast.cache.impl.CacheEventHandler)10 CacheService (com.hazelcast.cache.impl.CacheService)10 InternalPartitionService (com.hazelcast.internal.partition.InternalPartitionService)8 ArrayList (java.util.ArrayList)8 UUID (java.util.UUID)8 HashMap (java.util.HashMap)5 Config (com.hazelcast.config.Config)4 NearCacheConfig (com.hazelcast.config.NearCacheConfig)4 HazelcastInstance (com.hazelcast.core.HazelcastInstance)4 AssertTask (com.hazelcast.test.AssertTask)4 Test (org.junit.Test)4 ICacheService (com.hazelcast.cache.impl.ICacheService)3 Map (java.util.Map)3