use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo in project hazelcast by hazelcast.
the class MapPublisherCreateMessageTask method createInvocations.
private void createInvocations(Collection<MemberImpl> members, List<Future> futures) {
final 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, false, 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 ClientQueryCacheContext method recreateAllCaches.
public void recreateAllCaches() {
// Since query cache is lost we are firing event lost event for each cache and for each partition
QueryCacheFactory queryCacheFactory = subscriberContext.getQueryCacheFactory();
Map<String, SubscriberRegistry> registryMap = subscriberContext.getMapSubscriberRegistry().getAll();
for (SubscriberRegistry subscriberRegistry : registryMap.values()) {
Map<String, Accumulator> accumulatorMap = subscriberRegistry.getAll();
for (Accumulator accumulator : accumulatorMap.values()) {
AccumulatorInfo info = accumulator.getInfo();
String cacheId = info.getCacheId();
InternalQueryCache queryCache = queryCacheFactory.getOrNull(cacheId);
if (queryCache != null) {
queryCache.recreate();
}
}
}
}
use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo in project hazelcast by hazelcast.
the class CoalescingPublisherAccumulator method accumulate.
@Override
public void accumulate(QueryCacheEventData eventData) {
setSequence(eventData);
getBuffer().add(eventData);
AccumulatorInfo info = getInfo();
if (!info.isPublishable()) {
return;
}
poll(handler, info.getBatchSize());
poll(handler, info.getDelaySeconds(), SECONDS);
}
use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo in project hazelcast by hazelcast.
the class DefaultPublisherContext method removePartitionAccumulatorRegistry.
private PartitionAccumulatorRegistry removePartitionAccumulatorRegistry(PartitionAccumulatorRegistry registry) {
AccumulatorInfo info = registry.getInfo();
String mapName = info.getMapName();
String cacheId = info.getCacheId();
MapPublisherRegistry mapPublisherRegistry = getMapPublisherRegistry();
PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrNull(mapName);
if (publisherRegistry == null) {
return null;
}
return publisherRegistry.remove(cacheId);
}
use of com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo in project hazelcast by hazelcast.
the class NonStopPublisherAccumulator method accumulate.
@Override
public void accumulate(Sequenced eventData) {
super.accumulate(eventData);
AccumulatorInfo info = getInfo();
if (!info.isPublishable()) {
return;
}
poll(handler, 0, TimeUnit.SECONDS);
}
Aggregations