use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapQueryEngineImplTest method before.
@Before
public void before() {
instance = createHazelcastInstance();
map = instance.getMap(randomName());
MapService mapService = getNodeEngineImpl(instance).getService(MapService.SERVICE_NAME);
queryEngine = mapService.getMapServiceContext().getMapQueryEngine(map.getName());
partitionId = 100;
key = generateKeyForPartition(instance, partitionId);
value = randomString();
map.put(key, value);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapQueryEngineImpl_queryLocalPartitions_resultSizeLimitTest method setup.
@Before
public void setup() {
Config config = new Config();
config.setProperty(GroupProperty.PARTITION_COUNT.getName(), "" + PARTITION_COUNT);
config.setProperty(GroupProperty.QUERY_RESULT_SIZE_LIMIT.getName(), "" + RESULT_SIZE_LIMIT);
HazelcastInstance hz = createHazelcastInstance(config);
map = hz.getMap(randomName());
MapService mapService = getNodeEngineImpl(hz).getService(MapService.SERVICE_NAME);
queryEngine = new MapQueryEngineImpl(mapService.getMapServiceContext());
// we fill all partitions, so we get the NodeResultLimit for all partitions as well
QueryResultSizeLimiter resultSizeLimiter = queryEngine.getQueryResultSizeLimiter();
limit = (int) resultSizeLimiter.getNodeResultLimit(PARTITION_COUNT);
}
use of com.hazelcast.map.impl.MapService 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;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class IndexIntegrationTest method getIndexOfAttributeForMap.
private static Index getIndexOfAttributeForMap(HazelcastInstance instance, String mapName, String attribute) {
Node node = getNode(instance);
MapService service = node.nodeEngine.getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
Indexes indexes = mapContainer.getIndexes();
return indexes.getIndex(attribute);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapNearCacheStateHolder method applyState.
void applyState() {
MapService mapService = mapReplicationOperation.getService();
MetaDataGenerator metaDataGenerator = getPartitionMetaDataGenerator(mapService);
int partitionId = mapReplicationOperation.getPartitionId();
if (partitionUuid != null) {
metaDataGenerator.setUuid(partitionId, partitionUuid);
}
for (int i = 0; i < mapNameSequencePairs.size(); ) {
String mapName = (String) mapNameSequencePairs.get(i++);
long sequence = (Long) mapNameSequencePairs.get(i++);
metaDataGenerator.setCurrentSequence(mapName, partitionId, sequence);
}
}
Aggregations