use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class EntryOperation method getLocalMapStats.
private LocalMapStatsImpl getLocalMapStats() {
final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
final LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider();
return localMapStatsProvider.getLocalMapStatsImpl(name);
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class MapDataStores method createWriteBehindStore.
/**
* Creates a write behind data store.
*
* @param mapStoreContext context for map store operations.
* @param partitionId partition id of partition.
* @param writeBehindProcessor the {@link WriteBehindProcessor}
* @param <K> type of key to store.
* @param <V> type of value to store.
* @return new write behind store manager.
*/
public static <K, V> MapDataStore<K, V> createWriteBehindStore(MapStoreContext mapStoreContext, int partitionId, WriteBehindProcessor writeBehindProcessor) {
MapServiceContext mapServiceContext = mapStoreContext.getMapServiceContext();
MapStoreConfig mapStoreConfig = mapStoreContext.getMapStoreConfig();
WriteBehindStore mapDataStore = new WriteBehindStore(mapStoreContext, partitionId);
mapDataStore.setWriteBehindQueue(newWriteBehindQueue(mapServiceContext, mapStoreConfig.isWriteCoalescing()));
mapDataStore.setWriteBehindProcessor(writeBehindProcessor);
return (MapDataStore<K, V>) mapDataStore;
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class MapDataStores method createWriteThroughStore.
/**
* Creates a write through data store.
*
* @param mapStoreContext context for map store operations.
* @param <K> type of key to store.
* @param <V> type of value to store.
* @return new write through store manager.
*/
public static <K, V> MapDataStore<K, V> createWriteThroughStore(MapStoreContext mapStoreContext) {
final MapStoreWrapper store = mapStoreContext.getMapStoreWrapper();
final MapServiceContext mapServiceContext = mapStoreContext.getMapServiceContext();
final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
final SerializationService serializationService = nodeEngine.getSerializationService();
return (MapDataStore<K, V>) new WriteThroughStore(store, serializationService);
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method distortRandomPartitionUuid.
private void distortRandomPartitionUuid(HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
int partitionId = getInt(partitionCount);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setUuid(partitionId, UuidUtil.newSecureUUID());
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class MapStoreWriteBehindTest method writeBehindQueueSize.
private int writeBehindQueueSize(HazelcastInstance node, String mapName) {
int size = 0;
final NodeEngineImpl nodeEngine = getNode(node).getNodeEngine();
MapService mapService = nodeEngine.getService(MapService.SERVICE_NAME);
final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
final int partitionCount = nodeEngine.getPartitionService().getPartitionCount();
for (int i = 0; i < partitionCount; i++) {
final RecordStore recordStore = mapServiceContext.getExistingRecordStore(i, mapName);
if (recordStore == null) {
continue;
}
final MapDataStore mapDataStore = recordStore.getMapDataStore();
size += ((WriteBehindStore) mapDataStore).getWriteBehindQueue().size();
}
return size;
}
Aggregations