use of com.hazelcast.map.impl.querycache.publisher.PartitionAccumulatorRegistry in project hazelcast by hazelcast.
the class AccumulatorConsumerOperation method removeAccumulator.
private void removeAccumulator(QueryCacheContext context, Accumulator accumulator) {
PublisherContext publisherContext = context.getPublisherContext();
MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
AccumulatorInfo info = accumulator.getInfo();
String mapName = info.getMapName();
String cacheName = info.getCacheName();
PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrNull(mapName);
if (publisherRegistry == null) {
return;
}
PartitionAccumulatorRegistry partitionAccumulatorRegistry = publisherRegistry.getOrNull(cacheName);
if (partitionAccumulatorRegistry == null) {
return;
}
partitionAccumulatorRegistry.remove(getPartitionId());
}
use of com.hazelcast.map.impl.querycache.publisher.PartitionAccumulatorRegistry in project hazelcast by hazelcast.
the class QueryCacheEventPublisher method hintMapEvent.
// TODO known issue: Locked keys will also be cleared from the query-cache after calling a map-wide event like clear/evictAll
public void hintMapEvent(Address caller, String mapName, EntryEventType eventType, int numberOfEntriesAffected, int partitionId) {
// this collection contains all defined query-caches on this map.
Collection<PartitionAccumulatorRegistry> partitionAccumulatorRegistries = getPartitionAccumulatorRegistries(mapName);
for (PartitionAccumulatorRegistry accumulatorRegistry : partitionAccumulatorRegistries) {
Accumulator accumulator = accumulatorRegistry.getOrCreate(partitionId);
QueryCacheEventData singleEventData = newQueryCacheEventDataBuilder(false).withPartitionId(partitionId).withEventType(eventType.getType()).build();
accumulator.accumulate(singleEventData);
}
}
Aggregations