use of com.hazelcast.map.impl.MapContainer in project hazelcast by hazelcast.
the class MapEventPublisherImpl method publishWanReplicationUpdate.
@Override
public void publishWanReplicationUpdate(String mapName, EntryView entryView) {
MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
MapReplicationUpdate replicationEvent = new MapReplicationUpdate(mapName, mapContainer.getWanMergePolicy(), entryView);
mapContainer.getWanReplicationPublisher().publishReplicationEvent(SERVICE_NAME, replicationEvent);
}
use of com.hazelcast.map.impl.MapContainer in project hazelcast by hazelcast.
the class RemoveInterceptorOperation method run.
@Override
public void run() {
mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
mapContainer.getInterceptorRegistry().deregister(id);
}
use of com.hazelcast.map.impl.MapContainer in project hazelcast by hazelcast.
the class WriteBehindStateHolder method prepare.
void prepare(PartitionContainer container, int replicaIndex) {
int size = container.getMaps().size();
flushSequences = new HashMap<String, Queue<WriteBehindStore.Sequence>>(size);
delayedEntries = new HashMap<String, List<DelayedEntry>>(size);
for (Map.Entry<String, RecordStore> entry : container.getMaps().entrySet()) {
RecordStore recordStore = entry.getValue();
MapContainer mapContainer = recordStore.getMapContainer();
MapConfig mapConfig = mapContainer.getMapConfig();
if (mapConfig.getTotalBackupCount() < replicaIndex || !mapContainer.getMapStoreContext().isWriteBehindMapStoreEnabled()) {
continue;
}
WriteBehindStore mapDataStore = (WriteBehindStore) recordStore.getMapDataStore();
WriteBehindQueue<DelayedEntry> writeBehindQueue = mapDataStore.getWriteBehindQueue();
List<DelayedEntry> entries = writeBehindQueue.asList();
if (entries == null || entries.isEmpty()) {
continue;
}
String mapName = entry.getKey();
delayedEntries.put(mapName, entries);
flushSequences.put(mapName, new ArrayDeque<WriteBehindStore.Sequence>(mapDataStore.getFlushSequences()));
}
}
use of com.hazelcast.map.impl.MapContainer in project hazelcast by hazelcast.
the class PostJoinMapOperation method run.
@Override
public void run() throws Exception {
MapService mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
for (MapIndexInfo mapIndex : indexInfoList) {
final MapContainer mapContainer = mapServiceContext.getMapContainer(mapIndex.mapName);
final Indexes indexes = mapContainer.getIndexes();
for (MapIndexInfo.IndexInfo indexInfo : mapIndex.lsIndexes) {
indexes.addOrGetIndex(indexInfo.attributeName, indexInfo.ordered);
}
}
for (InterceptorInfo interceptorInfo : interceptorInfoList) {
final MapContainer mapContainer = mapServiceContext.getMapContainer(interceptorInfo.mapName);
InterceptorRegistry interceptorRegistry = mapContainer.getInterceptorRegistry();
Map<String, MapInterceptor> interceptorMap = interceptorRegistry.getId2InterceptorMap();
List<Map.Entry<String, MapInterceptor>> entryList = interceptorInfo.interceptors;
for (Map.Entry<String, MapInterceptor> entry : entryList) {
if (!interceptorMap.containsKey(entry.getKey())) {
interceptorRegistry.register(entry.getKey(), entry.getValue());
}
}
}
createQueryCaches();
}
use of com.hazelcast.map.impl.MapContainer in project hazelcast by hazelcast.
the class QueryRunner method runPartitionScanQueryOnGivenOwnedPartition.
Result runPartitionScanQueryOnGivenOwnedPartition(Query query, int partitionId) throws ExecutionException, InterruptedException {
MapContainer mapContainer = mapServiceContext.getMapContainer(query.getMapName());
Predicate predicate = queryOptimizer.optimize(query.getPredicate(), mapContainer.getIndexes());
Collection<QueryableEntry> entries = partitionScanExecutor.execute(query.getMapName(), predicate, Collections.singletonList(partitionId));
return populateTheResult(query, entries, Collections.singletonList(partitionId));
}
Aggregations