use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class MapTryRemoveMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation operation = operationProvider.createTryRemoveOperation(parameters.name, parameters.key, parameters.timeout);
operation.setThreadId(parameters.threadId);
return operation;
}
use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class MapSetWithMaxIdleMessageTask method prepareOperation.
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation op = operationProvider.createSetOperation(parameters.name, parameters.key, parameters.value, parameters.ttl, parameters.maxIdle);
op.setThreadId(parameters.threadId);
return op;
}
use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class MapSubmitToKeyMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
EntryProcessor processor = serializationService.toObject(parameters.entryProcessor);
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation op = operationProvider.createEntryOperation(parameters.name, parameters.key, processor);
op.setThreadId(parameters.threadId);
return op;
}
use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class MapTryPutMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation op = operationProvider.createTryPutOperation(parameters.name, parameters.key, parameters.value, parameters.timeout);
op.setThreadId(parameters.threadId);
return op;
}
use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class AbstractWanCustomPublisherMapTest method runMergeOpForWAN.
private void runMergeOpForWAN(boolean enableWANReplicationEvent) {
// init hazelcast instances
String mapName = "merge_operation_generates_wan_replication_event";
initInstancesAndMap(mapName);
// get internal services to use in this test
HazelcastInstance node = instance1;
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(node);
InternalPartitionService partitionService = nodeEngineImpl.getPartitionService();
OperationServiceImpl operationService = nodeEngineImpl.getOperationService();
SerializationService serializationService = nodeEngineImpl.getSerializationService();
MapService mapService = nodeEngineImpl.getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapOperationProvider operationProvider = mapServiceContext.getMapOperationProvider(mapName);
// prepare and send one merge operation
Data data = serializationService.toData(1);
MapOperation op;
SimpleEntryView<Data, Data> entryView = new SimpleEntryView<Data, Data>().withKey(data).withValue(data);
MapMergeTypes<Object, Object> mergingEntry = createMergingEntry(serializationService, entryView);
SplitBrainMergePolicy<Object, MapMergeTypes<Object, Object>, Object> mergePolicy = new com.hazelcast.spi.merge.PassThroughMergePolicy<>();
op = operationProvider.createMergeOperation(mapName, mergingEntry, mergePolicy, !enableWANReplicationEvent);
operationService.createInvocationBuilder(MapService.SERVICE_NAME, op, partitionService.getPartitionId(data)).invoke();
}
Aggregations