use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class WriteBehindEntryStoreQueueReplicationTest method dumpNotExpiredRecordsToString.
private static String dumpNotExpiredRecordsToString(HazelcastInstance node, String mapName) {
List<Long> msg = new ArrayList<>();
NodeEngineImpl nodeEngine = getNode(node).getNodeEngine();
MapService mapService = nodeEngine.getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
int partitionCount = nodeEngine.getPartitionService().getPartitionCount();
for (int i = 0; i < partitionCount; i++) {
RecordStore<Record> recordStore = mapServiceContext.getExistingRecordStore(i, mapName);
if (recordStore == null) {
continue;
}
recordStore.forEach((data, record) -> msg.add(recordStore.getExpirySystem().getExpiryMetadata(data).getTtl()), false);
}
return msg.toString();
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class NearCacheTestSupport method getNearCache.
protected NearCache getNearCache(String mapName, HazelcastInstance instance) {
NodeEngineImpl nodeEngine = getNode(instance).nodeEngine;
MapService service = nodeEngine.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
NearCacheConfig nearCacheConfig = nodeEngine.getConfig().getMapConfig(mapName).getNearCacheConfig();
return mapNearCacheManager.getOrCreateNearCache(mapName, nearCacheConfig);
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class WriteBehindFailAndRetryTest method sizeOfWriteBehindQueueInPartition.
private static int sizeOfWriteBehindQueueInPartition(int partitionId, IMap map) {
MapService mapService = (MapService) ((MapProxyImpl) map).getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
PartitionContainer container = mapServiceContext.getPartitionContainer(partitionId);
RecordStore recordStore = container.getRecordStore(map.getName());
return ((WriteBehindStore) recordStore.getMapDataStore()).getWriteBehindQueue().size();
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class MemberMapInvalidationMetadataDistortionTest 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.newUnsecureUUID());
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class MemberMapInvalidationMetadataDistortionTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String mapName, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
InternalPartitionService partitionService = nodeEngineImpl.getPartitionService();
int partitionCount = partitionService.getPartitionCount();
metaDataGenerator.setCurrentSequence(mapName, getInt(partitionCount), getInt(MAX_VALUE));
}
Aggregations