Search in sources :

Example 6 with PublisherRegistry

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

the class DestroyQueryCacheOperation method removePublisherAccumulators.

private void removePublisherAccumulators() {
    PublisherContext publisherContext = getPublisherContext();
    MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
    PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrNull(name);
    if (publisherRegistry == null) {
        return;
    }
    publisherRegistry.remove(cacheId);
}
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 7 with PublisherRegistry

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

the class ClientQueryCacheMemoryLeakTest method assertNoPartitionAccumulatorRegistryLeft.

private static void assertNoPartitionAccumulatorRegistryLeft(HazelcastInstance node, String mapName) {
    PublisherContext publisherContext = getPublisherContext(node);
    MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
    PublisherRegistry registry = mapPublisherRegistry.getOrCreate(mapName);
    if (registry == null) {
        return;
    }
    Map<String, PartitionAccumulatorRegistry> accumulatorRegistryMap = registry.getAll();
    assertTrue(accumulatorRegistryMap.isEmpty());
}
Also used : MapPublisherRegistry(com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry) PartitionAccumulatorRegistry(com.hazelcast.map.impl.querycache.publisher.PartitionAccumulatorRegistry) PublisherRegistry(com.hazelcast.map.impl.querycache.publisher.PublisherRegistry) MapPublisherRegistry(com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 8 with PublisherRegistry

use of com.hazelcast.map.impl.querycache.publisher.PublisherRegistry 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());
}
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) AccumulatorInfo(com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 9 with PublisherRegistry

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

the class QueryCacheMemoryLeakTest method assertNoPartitionAccumulatorRegistryLeft.

private static void assertNoPartitionAccumulatorRegistryLeft(HazelcastInstance node, String mapName) {
    PublisherContext publisherContext = getPublisherContext(node);
    MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
    PublisherRegistry registry = mapPublisherRegistry.getOrCreate(mapName);
    if (registry == null) {
        return;
    }
    Map<String, PartitionAccumulatorRegistry> accumulatorRegistryMap = registry.getAll();
    assertTrue(accumulatorRegistryMap.isEmpty());
}
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) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Example 10 with PublisherRegistry

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

the class ConsumeAccumulatorOperation 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.getCacheId();
    PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrNull(mapName);
    if (publisherRegistry == null) {
        return;
    }
    PartitionAccumulatorRegistry partitionAccumulatorRegistry = publisherRegistry.getOrNull(cacheName);
    if (partitionAccumulatorRegistry == null) {
        return;
    }
    partitionAccumulatorRegistry.remove(getPartitionId());
}
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) PublisherContext(com.hazelcast.map.impl.querycache.publisher.PublisherContext)

Aggregations

MapPublisherRegistry (com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry)12 PublisherContext (com.hazelcast.map.impl.querycache.publisher.PublisherContext)12 PublisherRegistry (com.hazelcast.map.impl.querycache.publisher.PublisherRegistry)12 PartitionAccumulatorRegistry (com.hazelcast.map.impl.querycache.publisher.PartitionAccumulatorRegistry)7 AccumulatorInfo (com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo)3 QueryCacheContext (com.hazelcast.map.impl.querycache.QueryCacheContext)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 Address (com.hazelcast.cluster.Address)1 MapUtil.createHashMap (com.hazelcast.internal.util.MapUtil.createHashMap)1 IMapEvent (com.hazelcast.map.IMapEvent)1 MapInterceptor (com.hazelcast.map.MapInterceptor)1 InterceptorRegistry (com.hazelcast.map.impl.InterceptorRegistry)1 ListenerAdapter (com.hazelcast.map.impl.ListenerAdapter)1 MapContainer (com.hazelcast.map.impl.MapContainer)1 MapDataSerializerHook (com.hazelcast.map.impl.MapDataSerializerHook)1 MapService (com.hazelcast.map.impl.MapService)1 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)1 AccumulatorInfoSupplier (com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfoSupplier)1 ObjectDataInput (com.hazelcast.nio.ObjectDataInput)1