use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class DefaultRecordStore method readBackupData.
@Override
public Data readBackupData(Data key) {
final long now = getNow();
final Record record = getRecord(key);
if (record == null) {
return null;
}
// expiration has delay on backups, but reading backup data should not be affected by this delay.
// this is the reason why we are passing `false` to isExpired() method.
final boolean expired = isExpired(record, now, false);
if (expired) {
return null;
}
final MapServiceContext mapServiceContext = this.mapServiceContext;
final Object value = record.getValue();
mapServiceContext.interceptAfterGet(name, value);
// this serialization step is needed not to expose the object, see issue 1292
return mapServiceContext.toData(value);
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class PartitionWideEntryWithPredicateOperationFactory method getKeysFromIndex.
private Set<Data> getKeysFromIndex(NodeEngine nodeEngine) {
// Do not use index in this case, because it requires full-table-scan.
if (predicate == TruePredicate.INSTANCE) {
return emptySet();
}
// get indexes
MapService mapService = nodeEngine.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
Indexes indexes = mapServiceContext.getMapContainer(name).getIndexes();
// optimize predicate
QueryOptimizer queryOptimizer = mapServiceContext.getQueryOptimizer();
predicate = queryOptimizer.optimize(predicate, indexes);
Set<QueryableEntry> querySet = indexes.query(predicate);
if (querySet == null) {
return emptySet();
}
List<Data> keys = null;
for (QueryableEntry e : querySet) {
if (keys == null) {
keys = new ArrayList<Data>(querySet.size());
}
keys.add(e.getKeyData());
}
return keys == null ? Collections.<Data>emptySet() : newBuilder(keys).build();
}
use of com.hazelcast.map.impl.MapServiceContext 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.MapServiceContext 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.MapServiceContext 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);
}
Aggregations