use of com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry in project hazelcast by hazelcast.
the class DefaultRecordStore method hasQueryCache.
/**
* @return {@code true} if this IMap has any query-cache, otherwise return {@code false}
*/
private boolean hasQueryCache() {
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
PublisherContext publisherContext = queryCacheContext.getPublisherContext();
MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrNull(name);
return publisherRegistry != null;
}
use of com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry in project hazelcast by hazelcast.
the class QueryCacheUtil method getAccumulatorRegistryOrNull.
/**
* Returns {@code PartitionAccumulatorRegistry} of a {@code QueryCache}.
*
* @see PartitionAccumulatorRegistry
*/
public static PartitionAccumulatorRegistry getAccumulatorRegistryOrNull(QueryCacheContext context, String mapName, String cacheName) {
PublisherContext publisherContext = context.getPublisherContext();
MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrNull(mapName);
if (publisherRegistry == null) {
return null;
}
return publisherRegistry.getOrNull(cacheName);
}
use of com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry in project hazelcast by hazelcast.
the class PostJoinMapOperation method createQueryCaches.
private void createQueryCaches() {
MapService mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
PublisherContext publisherContext = queryCacheContext.getPublisherContext();
MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
for (AccumulatorInfo info : infoList) {
addAccumulatorInfo(queryCacheContext, info);
PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrCreate(info.getMapName());
publisherRegistry.getOrCreate(info.getCacheName());
// marker listener.
mapServiceContext.addLocalListenerAdapter(new ListenerAdapter<IMapEvent>() {
@Override
public void onEvent(IMapEvent event) {
}
}, info.getMapName());
}
}
use of com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry 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