use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class MapClientAwareService method clientDisconnected.
@Override
public void clientDisconnected(String clientUuid) {
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
PublisherContext publisherContext = queryCacheContext.getPublisherContext();
publisherContext.handleDisconnectedSubscriber(clientUuid);
}
use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class AccumulatorConsumerOperation method run.
@Override
public void run() throws Exception {
QueryCacheContext context = getQueryCacheContext();
QueryCacheEventService queryCacheEventService = context.getQueryCacheEventService();
EventPublisherAccumulatorProcessor processor = new EventPublisherAccumulatorProcessor(queryCacheEventService);
AccumulatorHandler<Sequenced> handler = new PublisherAccumulatorHandler(context, processor);
int processed = 0;
do {
Accumulator accumulator = accumulators.poll();
if (accumulator == null) {
break;
}
if (isLocal()) {
// consume the accumulator if only this node is the owner
// of accumulators partition
publishAccumulator(processor, handler, accumulator);
} else {
// if the accumulator is not local, it should be a leftover
// stayed after partition migrations and remove that accumulator
removeAccumulator(context, accumulator);
}
processed++;
} while (processed <= maxProcessableAccumulatorCount);
}
use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class ReadAndResetAccumulatorOperation method run.
@Override
public void run() throws Exception {
QueryCacheContext context = getQueryCacheContext();
Map<Integer, Accumulator> accumulators = getAccumulators(context, name, cacheName);
Accumulator<Sequenced> accumulator = accumulators.get(getPartitionId());
if (accumulator.isEmpty()) {
return;
}
eventDataList = new ArrayList<Sequenced>(accumulator.size());
for (Sequenced sequenced : accumulator) {
eventDataList.add(sequenced);
}
accumulator.reset();
}
use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class ClientMapProxy method getQueryCacheInternal.
private QueryCache getQueryCacheInternal(String name, MapListener listener, Predicate predicate, Boolean includeValue, IMap map) {
QueryCacheContext context = getQueryContext();
QueryCacheRequest request = newQueryCacheRequest().withUserGivenCacheName(name).withCacheName(UuidUtil.newUnsecureUuidString()).withListener(listener).withPredicate(predicate).withIncludeValue(includeValue).forMap(map).withContext(context);
return createQueryCache(request);
}
use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class ClientQueryCacheRecoveryUponEventLossTest method setTestSequencer.
private void setTestSequencer(IMap map, int eventCount) {
ClientMapProxy proxy = (ClientMapProxy) map;
QueryCacheContext queryCacheContext = proxy.getQueryContext();
queryCacheContext.setSubscriberContext(new TestClientSubscriberContext(queryCacheContext, eventCount, true));
}
Aggregations