Search in sources :

Example 1 with AccumulatorInfoSupplier

use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier in project hazelcast by hazelcast.

the class AccumulatorSweeper method sendEndOfSequenceEvents.

public static void sendEndOfSequenceEvents(PublisherContext publisherContext, int partitionId) {
    QueryCacheEventData endOfSequenceEvent = createEndOfSequenceEvent(partitionId);
    QueryCacheContext context = publisherContext.getContext();
    EventPublisherAccumulatorProcessor processor = new EventPublisherAccumulatorProcessor(context.getQueryCacheEventService());
    AccumulatorInfoSupplier infoSupplier = publisherContext.getAccumulatorInfoSupplier();
    ConcurrentMap<String, ConcurrentMap<String, AccumulatorInfo>> all = infoSupplier.getAll();
    for (ConcurrentMap<String, AccumulatorInfo> oneMapsAccumulators : all.values()) {
        for (AccumulatorInfo accumulatorInfo : oneMapsAccumulators.values()) {
            if (accumulatorInfo.getDelaySeconds() == 0) {
                processor.setInfo(accumulatorInfo);
                processor.process(endOfSequenceEvent);
            }
        }
    }
}
Also used : AccumulatorInfoSupplier(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier) ConcurrentMap(java.util.concurrent.ConcurrentMap) QueryCacheContext(com.hazelcast.map.impl.querycache.QueryCacheContext) AccumulatorInfo(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo) QueryCacheEventData(com.hazelcast.map.impl.querycache.event.QueryCacheEventData)

Example 2 with AccumulatorInfoSupplier

use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier in project hazelcast by hazelcast.

the class PostJoinMapOperation method addAccumulatorInfo.

private void addAccumulatorInfo(QueryCacheContext context, AccumulatorInfo info) {
    PublisherContext publisherContext = context.getPublisherContext();
    AccumulatorInfoSupplier infoSupplier = publisherContext.getAccumulatorInfoSupplier();
    infoSupplier.putIfAbsent(info.getMapName(), info.getCacheId(), info);
}
Also used : AccumulatorInfoSupplier(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 3 with AccumulatorInfoSupplier

use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier in project hazelcast by hazelcast.

the class PublisherCreateOperation method registerAccumulatorInfo.

private void registerAccumulatorInfo() {
    String mapName = info.getMapName();
    String cacheId = info.getCacheId();
    PublisherContext publisherContext = getPublisherContext();
    AccumulatorInfoSupplier infoSupplier = publisherContext.getAccumulatorInfoSupplier();
    infoSupplier.putIfAbsent(mapName, cacheId, info);
}
Also used : AccumulatorInfoSupplier(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 4 with AccumulatorInfoSupplier

use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier in project hazelcast by hazelcast.

the class DestroyQueryCacheOperation method removeAccumulatorInfo.

private void removeAccumulatorInfo() {
    PublisherContext publisherContext = getPublisherContext();
    AccumulatorInfoSupplier infoSupplier = publisherContext.getAccumulatorInfoSupplier();
    infoSupplier.remove(name, cacheId);
}
Also used : AccumulatorInfoSupplier(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 5 with AccumulatorInfoSupplier

use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier in project hazelcast by hazelcast.

the class AbstractQueryCacheEndToEndConstructor method addInfoToSubscriberContext.

private void addInfoToSubscriberContext(AccumulatorInfo info) {
    SubscriberContext subscriberContext = context.getSubscriberContext();
    AccumulatorInfoSupplier accumulatorInfoSupplier = subscriberContext.getAccumulatorInfoSupplier();
    accumulatorInfoSupplier.putIfAbsent(info.getMapName(), info.getCacheId(), info);
}
Also used : AccumulatorInfoSupplier(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier)

Aggregations

AccumulatorInfoSupplier (com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier)8 PublisherContext (com.hazelcast.map.impl.querycache.publisher.PublisherContext)3 QueryCacheContext (com.hazelcast.map.impl.querycache.QueryCacheContext)1 AccumulatorInfo (com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo)1 QueryCacheEventData (com.hazelcast.map.impl.querycache.event.QueryCacheEventData)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1