use of com.hazelcast.internal.nearcache.impl.invalidation.Invalidator in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String mapName, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
InternalPartitionService partitionService = nodeEngineImpl.getPartitionService();
int partitionCount = partitionService.getPartitionCount();
metaDataGenerator.setCurrentSequence(mapName, getInt(partitionCount), getInt(MAX_VALUE));
}
use of com.hazelcast.internal.nearcache.impl.invalidation.Invalidator in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest 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.newSecureUUID());
}
use of com.hazelcast.internal.nearcache.impl.invalidation.Invalidator in project hazelcast by hazelcast.
the class MapOperation method invalidateNearCache.
// TODO improve here it is possible that client cannot manage to attach listener
protected final void invalidateNearCache(Data key) {
if (!mapContainer.hasInvalidationListener() || key == null) {
return;
}
Invalidator invalidator = getNearCacheInvalidator();
invalidator.invalidateKey(key, name, getCallerUuid());
}
use of com.hazelcast.internal.nearcache.impl.invalidation.Invalidator in project hazelcast by hazelcast.
the class MapOperation method invalidateAllKeysInNearCaches.
/**
* This method helps to add clearing near-cache event only from one-partition
* which matches partition-id of the map-name.
*/
protected final void invalidateAllKeysInNearCaches() {
if (!mapContainer.hasInvalidationListener() || getPartitionId() != getNodeEngine().getPartitionService().getPartitionId(name)) {
return;
}
Invalidator invalidator = getNearCacheInvalidator();
invalidator.invalidateAllKeys(name, getCallerUuid());
}
use of com.hazelcast.internal.nearcache.impl.invalidation.Invalidator in project hazelcast by hazelcast.
the class MemberMapMetaDataFetcherTest method distortRandomPartitionUuid.
private void distortRandomPartitionUuid(int partition, UUID uuid, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setUuid(partition, uuid);
}
Aggregations