use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class DefaultRecordStore method hasQueryCache.
/**
* @return {@code true} if this IMap has any query-cache, otherwise return {@code false}
*/
public 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.QueryCacheContext in project hazelcast by hazelcast.
the class QueryCacheRecoveryUponEventLossTest method getBrokenSequences.
private Map getBrokenSequences(HazelcastInstance instance, String mapName, QueryCache queryCache) {
Node node = getNode(instance);
MapService service = node.getNodeEngine().getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
QueryCacheContext context = mapServiceContext.getQueryCacheContext();
SubscriberContext subscriberContext = context.getSubscriberContext();
MapSubscriberRegistry mapSubscriberRegistry = subscriberContext.getMapSubscriberRegistry();
SubscriberRegistry subscriberRegistry = mapSubscriberRegistry.getOrNull(mapName);
if (subscriberRegistry == null) {
return Collections.emptyMap();
}
String cacheId = ((InternalQueryCache) queryCache).getCacheId();
Accumulator accumulator = subscriberRegistry.getOrNull(cacheId);
if (accumulator == null) {
return Collections.emptyMap();
}
SubscriberAccumulator subscriberAccumulator = (SubscriberAccumulator) accumulator;
return subscriberAccumulator.getBrokenSequences();
}
use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class NodeQueryCacheEventServiceTest method getSubscriberContext.
private static SubscriberContext getSubscriberContext(HazelcastInstance node) {
MapService mapService = getNodeEngineImpl(node).getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
return queryCacheContext.getSubscriberContext();
}
use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class ClientQueryCacheRecoveryUponEventLossTest method setTestSequencer.
private void setTestSequencer(IMap map, int eventCount) {
ClientMapProxy proxy = (ClientMapProxy) map;
QueryCacheContext queryCacheContext = proxy.getQueryCacheContext();
queryCacheContext.setSubscriberContext(new TestClientSubscriberContext(queryCacheContext, eventCount, true));
}
use of com.hazelcast.map.impl.querycache.QueryCacheContext in project hazelcast by hazelcast.
the class ClientQueryCacheEventLostListenerTest method setTestSequencer.
private void setTestSequencer(IMap map, int eventCount) {
ClientMapProxy proxy = (ClientMapProxy) map;
QueryCacheContext queryCacheContext = proxy.getQueryContext();
queryCacheContext.setSubscriberContext(new TestClientSubscriberContext(queryCacheContext, eventCount, true));
}
Aggregations