Search in sources :

Example 1 with PublisherContext

use of com.hazelcast.map.impl.querycache.publisher.PublisherContext 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);
}
Also used : QueryCacheContext(com.hazelcast.map.impl.querycache.QueryCacheContext) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 2 with PublisherContext

use of com.hazelcast.map.impl.querycache.publisher.PublisherContext in project hazelcast by hazelcast.

the class MapPostJoinAwareService method getAccumulatorInfoList.

private List<AccumulatorInfo> getAccumulatorInfoList() {
    List<AccumulatorInfo> infoList = new ArrayList<AccumulatorInfo>();
    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;
}
Also used : MapPublisherRegistry(com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry) PartitionAccumulatorRegistry(com.hazelcast.map.impl.querycache.publisher.PartitionAccumulatorRegistry) MapPublisherRegistry(com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry) PublisherRegistry(com.hazelcast.map.impl.querycache.publisher.PublisherRegistry) ArrayList(java.util.ArrayList) AccumulatorInfo(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 3 with PublisherContext

use of com.hazelcast.map.impl.querycache.publisher.PublisherContext in project hazelcast by hazelcast.

the class QueryCacheEventPublisher method getPartitionAccumulatorRegistries.

private Collection<PartitionAccumulatorRegistry> getPartitionAccumulatorRegistries(String mapName) {
    PublisherContext publisherContext = queryCacheContext.getPublisherContext();
    MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
    PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrNull(mapName);
    if (publisherRegistry == null) {
        return Collections.emptySet();
    }
    // this collection contains all query-caches for this map
    return publisherRegistry.getAll().values();
}
Also used : MapPublisherRegistry(com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry) MapPublisherRegistry(com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry) PublisherRegistry(com.hazelcast.map.impl.querycache.publisher.PublisherRegistry) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 4 with PublisherContext

use of com.hazelcast.map.impl.querycache.publisher.PublisherContext in project hazelcast by hazelcast.

the class PostJoinMapOperation method addAccumulatorInfo.

private void addAccumulatorInfo(QueryCacheContext context, AccumulatorInfo info) {
    PublisherContext publisherContext = context.getPublisherContext();
    AccumulatorInfoSupplier infoSupplier = publisherContext.getAccumulatorInfoSupplier();
    infoSupplier.putIfAbsent(info.getMapName(), info.getCacheName(), info);
}
Also used : AccumulatorInfoSupplier(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 5 with PublisherContext

use of com.hazelcast.map.impl.querycache.publisher.PublisherContext in project hazelcast by hazelcast.

the class DestroyQueryCacheOperation method removeAccumulatorInfo.

private void removeAccumulatorInfo() {
    PublisherContext publisherContext = getPublisherContext();
    AccumulatorInfoSupplier infoSupplier = publisherContext.getAccumulatorInfoSupplier();
    infoSupplier.remove(name, cacheName);
}
Also used : AccumulatorInfoSupplier(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Aggregations

PublisherContext (com.hazelcast.map.impl.querycache.publisher.PublisherContext)17 MapPublisherRegistry (com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry)9 PublisherRegistry (com.hazelcast.map.impl.querycache.publisher.PublisherRegistry)9 QueryCacheContext (com.hazelcast.map.impl.querycache.QueryCacheContext)4 PartitionAccumulatorRegistry (com.hazelcast.map.impl.querycache.publisher.PartitionAccumulatorRegistry)4 AccumulatorInfo (com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo)3 AccumulatorInfoSupplier (com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier)3 MapListenerRegistry (com.hazelcast.map.impl.querycache.publisher.MapListenerRegistry)2 QueryCacheListenerRegistry (com.hazelcast.map.impl.querycache.publisher.QueryCacheListenerRegistry)2 IMapEvent (com.hazelcast.core.IMapEvent)1 MapService (com.hazelcast.map.impl.MapService)1 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)1 AccumulatorConsumerOperation (com.hazelcast.map.impl.operation.AccumulatorConsumerOperation)1 RecordStore (com.hazelcast.map.impl.recordstore.RecordStore)1 Operation (com.hazelcast.spi.Operation)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 MigrationEndpoint (com.hazelcast.spi.partition.MigrationEndpoint)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1