use of com.hazelcast.map.impl.querycache.event.QueryCacheEventData in project hazelcast by hazelcast.
the class SubscriberListener method onEvent.
@Override
public void onEvent(IMapEvent iMapEvent) {
if (iMapEvent instanceof SingleIMapEvent) {
QueryCacheEventData eventData = ((SingleIMapEvent) iMapEvent).getEventData();
eventData.setSerializationService(serializationService);
accumulator.accumulate(eventData);
return;
}
if (iMapEvent instanceof BatchIMapEvent) {
BatchIMapEvent batchIMapEvent = (BatchIMapEvent) iMapEvent;
BatchEventData batchEventData = batchIMapEvent.getBatchEventData();
Collection<QueryCacheEventData> events = batchEventData.getEvents();
for (QueryCacheEventData eventData : events) {
eventData.setSerializationService(serializationService);
accumulator.accumulate(eventData);
}
return;
}
}
use of com.hazelcast.map.impl.querycache.event.QueryCacheEventData 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