use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.
the class MapFetchIndexOperationTest method testRangeComposite.
@Test
public void testRangeComposite() throws ExecutionException, InterruptedException {
PartitionIdSet partitions = getLocalPartitions(instance);
IndexIterationPointer[] pointers = new IndexIterationPointer[1];
pointers[0] = IndexIterationPointer.create(new CompositeValue(new Comparable[] { 30, CompositeValue.NEGATIVE_INFINITY }), true, new CompositeValue(new Comparable[] { CompositeValue.POSITIVE_INFINITY, CompositeValue.POSITIVE_INFINITY }), true, false, null);
MapOperationProvider operationProvider = getOperationProvider(map);
MapOperation operation = operationProvider.createFetchIndexOperation(mapName, compositeOrderedIndexName, pointers, partitions, 10);
Address address = instance.getCluster().getLocalMember().getAddress();
OperationServiceImpl operationService = getOperationService(instance);
MapFetchIndexOperationResult result = operationService.createInvocationBuilder(MapService.SERVICE_NAME, operation, address).<MapFetchIndexOperationResult>invoke().get();
assertResultSorted(result, Arrays.asList(new Person("person2", 39, "Dep1"), new Person("person5", 43, "Dep2"), new Person("person1", 45, "Dep1"), new Person("person4", 45, "Dep2"), new Person("person9", 45, "Dep3"), new Person("person10", 45, "Dep4"), new Person("person11", 45, "Dep5"), new Person("person3", 60, "Dep1"), new Person("person8", 79, null)));
}
use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.
the class MapFetchIndexOperationTest method testOneSideRange.
@Test
public void testOneSideRange() throws ExecutionException, InterruptedException {
PartitionIdSet partitions = getLocalPartitions(instance);
IndexIterationPointer[] pointers = new IndexIterationPointer[1];
pointers[0] = IndexIterationPointer.create(null, true, 60, false, true, null);
MapOperationProvider operationProvider = getOperationProvider(map);
MapOperation operation = operationProvider.createFetchIndexOperation(mapName, orderedIndexName, pointers, partitions, 10);
Address address = instance.getCluster().getLocalMember().getAddress();
OperationServiceImpl operationService = getOperationService(instance);
MapFetchIndexOperationResult result = operationService.createInvocationBuilder(MapService.SERVICE_NAME, operation, address).<MapFetchIndexOperationResult>invoke().get();
assertResultSorted(result, Arrays.asList(new Person("person11", 45, "Dep5"), new Person("person10", 45, "Dep4"), new Person("person9", 45, "Dep3"), new Person("person4", 45, "Dep2"), new Person("person1", 45, "Dep1"), new Person("person5", 43, "Dep2"), new Person("person2", 39, "Dep1")));
}
use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.
the class SlowOperationDetectorAbstractTest method shutdownOperationService.
static void shutdownOperationService(HazelcastInstance instance) {
if (instance == null) {
return;
}
OperationServiceImpl operationService = (OperationServiceImpl) getOperationService(instance);
operationService.shutdownInvocations();
operationService.shutdownOperationExecutor();
}
use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.
the class SlowOperationDetectorAbstractTest method getSlowOperationLogs.
static Collection<SlowOperationLog> getSlowOperationLogs(HazelcastInstance instance) {
OperationServiceImpl operationService = getOperationService(instance);
SlowOperationDetector slowOperationDetector = getFieldFromObject(operationService, "slowOperationDetector");
Map<Integer, SlowOperationLog> slowOperationLogs = getFieldFromObject(slowOperationDetector, "slowOperationLogs");
return slowOperationLogs.values();
}
use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.
the class QueryCacheIMapEventHandlingTest method executeMergeOperation.
private void executeMergeOperation(HazelcastInstance member, String mapName, int key, int mergedValue) throws Exception {
Node node = getNode(member);
NodeEngineImpl nodeEngine = node.nodeEngine;
OperationServiceImpl operationService = nodeEngine.getOperationService();
SerializationService serializationService = getSerializationService(member);
Data keyData = serializationService.toData(key);
Data valueData = serializationService.toData(mergedValue);
SplitBrainMergeTypes.MapMergeTypes mergingEntry = createMergingEntry(serializationService, keyData, valueData, Mockito.mock(Record.class), ExpiryMetadata.NULL);
Operation mergeOperation = new MergeOperation(mapName, singletonList(mergingEntry), new PassThroughMergePolicy<>(), false);
int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
Future<Object> future = operationService.invokeOnPartition(SERVICE_NAME, mergeOperation, partitionId);
future.get();
}
Aggregations