use of com.hazelcast.map.impl.MapService 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.MapService in project hazelcast by hazelcast.
the class MapGetInvalidationMetaDataOperation method getPartitionMetaDataGenerator.
private MetaDataGenerator getPartitionMetaDataGenerator() {
MapService mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager nearCacheManager = mapServiceContext.getMapNearCacheManager();
return nearCacheManager.getInvalidator().getMetaDataGenerator();
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapNearCacheStateHolder method prepare.
void prepare(PartitionContainer container, int replicaIndex) {
MapService mapService = container.getMapService();
MetaDataGenerator metaData = getPartitionMetaDataGenerator(mapService);
int partitionId = container.getPartitionId();
partitionUuid = metaData.getUuidOrNull(partitionId);
ConcurrentMap<String, RecordStore> maps = container.getMaps();
for (Map.Entry<String, RecordStore> entry : maps.entrySet()) {
if (mapNameSequencePairs == emptyList()) {
mapNameSequencePairs = new ArrayList(container.getMaps().size());
}
String mapName = entry.getKey();
mapNameSequencePairs.add(mapName);
mapNameSequencePairs.add(metaData.currentSequence(mapName, partitionId));
}
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapReplicationOperation method getRecordStore.
RecordStore getRecordStore(String mapName) {
final boolean skipLoadingOnRecordStoreCreate = true;
MapService mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
return mapServiceContext.getRecordStore(getPartitionId(), mapName, skipLoadingOnRecordStoreCreate);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class WriteBehindStateHolder method writeData.
@Override
public void writeData(ObjectDataOutput out) throws IOException {
MapService mapService = mapReplicationOperation.getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
out.writeInt(delayedEntries.size());
for (Map.Entry<String, List<DelayedEntry>> entry : delayedEntries.entrySet()) {
out.writeUTF(entry.getKey());
List<DelayedEntry> delayedEntryList = entry.getValue();
out.writeInt(delayedEntryList.size());
for (DelayedEntry e : delayedEntryList) {
Data key = mapServiceContext.toData(e.getKey());
Data value = mapServiceContext.toData(e.getValue());
out.writeData(key);
out.writeData(value);
out.writeLong(e.getStoreTime());
out.writeInt(e.getPartitionId());
out.writeLong(e.getSequence());
}
}
out.writeInt(flushSequences.size());
for (Map.Entry<String, Queue<WriteBehindStore.Sequence>> entry : flushSequences.entrySet()) {
out.writeUTF(entry.getKey());
Queue<WriteBehindStore.Sequence> queue = entry.getValue();
out.writeInt(queue.size());
for (WriteBehindStore.Sequence sequence : queue) {
out.writeLong(sequence.getSequence());
out.writeBoolean(sequence.isFullFlush());
}
}
}
Aggregations