Search in sources :

Example 1 with AccumulatorInfo

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

the class AccumulatorConsumerOperation method publishAccumulator.

private void publishAccumulator(EventPublisherAccumulatorProcessor processor, AccumulatorHandler<Sequenced> handler, Accumulator accumulator) {
    AccumulatorInfo info = accumulator.getInfo();
    processor.setInfo(info);
    accumulator.poll(handler, info.getDelaySeconds(), TimeUnit.SECONDS);
}
Also used : AccumulatorInfo(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo)

Example 2 with AccumulatorInfo

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

the class SubscriberAccumulator method createAccumulatorHandler.

private SubscriberAccumulatorHandler createAccumulatorHandler() {
    AccumulatorInfo info = getInfo();
    boolean includeValue = info.isIncludeValue();
    InternalQueryCache queryCache = getQueryCache();
    InternalSerializationService serializationService = context.getSerializationService();
    return new SubscriberAccumulatorHandler(includeValue, queryCache, serializationService);
}
Also used : AccumulatorInfo(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo) InternalSerializationService(com.hazelcast.internal.serialization.InternalSerializationService)

Example 3 with AccumulatorInfo

use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo 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 4 with AccumulatorInfo

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

the class BatchPublisherAccumulator method accumulate.

@Override
public void accumulate(Sequenced sequenced) {
    super.accumulate(sequenced);
    AccumulatorInfo info = getInfo();
    if (!info.isPublishable()) {
        return;
    }
    poll(handler, info.getBatchSize());
    poll(handler, info.getDelaySeconds(), TimeUnit.SECONDS);
}
Also used : AccumulatorInfo(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo)

Example 5 with AccumulatorInfo

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

the class MapPostJoinAwareService method getPostJoinOperation.

@Override
public Operation getPostJoinOperation() {
    PostJoinMapOperation postJoinOp = new PostJoinMapOperation();
    final Map<String, MapContainer> mapContainers = mapServiceContext.getMapContainers();
    for (MapContainer mapContainer : mapContainers.values()) {
        postJoinOp.addMapInterceptors(mapContainer);
    }
    List<AccumulatorInfo> infoList = getAccumulatorInfoList();
    postJoinOp.setInfoList(infoList);
    postJoinOp.setNodeEngine(mapServiceContext.getNodeEngine());
    return postJoinOp;
}
Also used : AccumulatorInfo(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo) PostJoinMapOperation(com.hazelcast.map.impl.operation.PostJoinMapOperation)

Aggregations

AccumulatorInfo (com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo)21 PublisherCreateOperation (com.hazelcast.map.impl.querycache.subscriber.operation.PublisherCreateOperation)4 Address (com.hazelcast.cluster.Address)3 MapPublisherRegistry (com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry)3 PartitionAccumulatorRegistry (com.hazelcast.map.impl.querycache.publisher.PartitionAccumulatorRegistry)3 PublisherContext (com.hazelcast.map.impl.querycache.publisher.PublisherContext)3 PublisherRegistry (com.hazelcast.map.impl.querycache.publisher.PublisherRegistry)3 Predicate (com.hazelcast.query.Predicate)3 Future (java.util.concurrent.Future)3 MemberImpl (com.hazelcast.cluster.impl.MemberImpl)2 ArrayList (java.util.ArrayList)2 ClientEndpoint (com.hazelcast.client.ClientEndpoint)1 MapAssignAndGetUuidsOperation (com.hazelcast.client.impl.protocol.task.map.MapAssignAndGetUuidsOperation)1 MapAssignAndGetUuidsOperationFactory (com.hazelcast.client.impl.protocol.task.map.MapAssignAndGetUuidsOperationFactory)1 QueryCacheConfig (com.hazelcast.config.QueryCacheConfig)1 MemberImpl (com.hazelcast.instance.MemberImpl)1 IndexIterationPointer (com.hazelcast.internal.iteration.IndexIterationPointer)1 LocalRecordStoreStatsImpl (com.hazelcast.internal.monitor.impl.LocalRecordStoreStatsImpl)1 BatchNearCacheInvalidation (com.hazelcast.internal.nearcache.impl.invalidation.BatchNearCacheInvalidation)1 SingleNearCacheInvalidation (com.hazelcast.internal.nearcache.impl.invalidation.SingleNearCacheInvalidation)1