use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo in project hazelcast by hazelcast.
the class MapPostJoinAwareService method getAccumulatorInfoList.
private List<AccumulatorInfo> getAccumulatorInfoList() {
List<AccumulatorInfo> infoList = new ArrayList<>();
PublisherContext publisherContext = mapServiceContext.getQueryCacheContext().getPublisherContext();
MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
Map<String, PublisherRegistry> cachesOfMaps = mapPublisherRegistry.getAll();
Collection<PublisherRegistry> publisherRegistries = cachesOfMaps.values();
for (PublisherRegistry publisherRegistry : publisherRegistries) {
Collection<PartitionAccumulatorRegistry> partitionAccumulatorRegistries = publisherRegistry.getAll().values();
for (PartitionAccumulatorRegistry accumulatorRegistry : partitionAccumulatorRegistries) {
AccumulatorInfo info = accumulatorRegistry.getInfo();
infoList.add(info);
}
}
return infoList;
}
use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo in project hazelcast by hazelcast.
the class SubscriberAccumulator method getQueryCache.
private InternalQueryCache getQueryCache() {
AccumulatorInfo info = getInfo();
String cacheId = info.getCacheId();
SubscriberContext subscriberContext = context.getSubscriberContext();
QueryCacheFactory queryCacheFactory = subscriberContext.getQueryCacheFactory();
return queryCacheFactory.getOrNull(cacheId);
}
use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo in project hazelcast by hazelcast.
the class MapPublisherCreateWithValueMessageTask method createPublishersAndGetSnapshotOf.
private List<Future> createPublishersAndGetSnapshotOf(Collection<MemberImpl> members) {
List<Future> futures = new ArrayList<Future>(members.size());
OperationServiceImpl operationService = nodeEngine.getOperationService();
for (MemberImpl member : members) {
Predicate predicate = serializationService.toObject(parameters.predicate);
AccumulatorInfo accumulatorInfo = AccumulatorInfo.toAccumulatorInfo(parameters.mapName, parameters.cacheName, predicate, parameters.batchSize, parameters.bufferSize, parameters.delaySeconds, true, parameters.populate, parameters.coalesce);
PublisherCreateOperation operation = new PublisherCreateOperation(accumulatorInfo);
operation.setCallerUuid(endpoint.getUuid());
Address address = member.getAddress();
InvocationBuilder invocationBuilder = operationService.createInvocationBuilder(SERVICE_NAME, operation, address);
Future future = invocationBuilder.invoke();
futures.add(future);
}
return futures;
}
use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo in project hazelcast by hazelcast.
the class MapPublisherCreateWithValueMessageTask method createInvocations.
private void createInvocations(Collection<MemberImpl> members, List<Future> futures) {
final InternalOperationService operationService = nodeEngine.getOperationService();
final ClientEndpoint endpoint = getEndpoint();
for (MemberImpl member : members) {
Predicate predicate = serializationService.toObject(parameters.predicate);
AccumulatorInfo accumulatorInfo = AccumulatorInfo.createAccumulatorInfo(parameters.mapName, parameters.cacheName, predicate, parameters.batchSize, parameters.bufferSize, parameters.delaySeconds, true, parameters.populate, parameters.coalesce);
PublisherCreateOperation operation = new PublisherCreateOperation(accumulatorInfo);
operation.setCallerUuid(endpoint.getUuid());
Address address = member.getAddress();
InvocationBuilder invocationBuilder = operationService.createInvocationBuilder(SERVICE_NAME, operation, address);
Future future = invocationBuilder.invoke();
futures.add(future);
}
}
use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo 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());
}
Aggregations