use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class MapReplicationSupportingService method handleRemove.
private void handleRemove(MapReplicationRemove replicationRemove) {
String mapName = replicationRemove.getMapName();
MapOperationProvider operationProvider = mapServiceContext.getMapOperationProvider(mapName);
MapOperation operation = operationProvider.createRemoveOperation(replicationRemove.getMapName(), replicationRemove.getKey(), true);
try {
int partitionId = nodeEngine.getPartitionService().getPartitionId(replicationRemove.getKey());
Future f = nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME, operation, partitionId);
f.get();
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
}
}
use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class BasicRecordStoreLoader method createOperation.
private Operation createOperation(List<Data> keyValueSequence, final AtomicInteger finishedBatchCounter) {
final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
MapOperationProvider operationProvider = mapServiceContext.getMapOperationProvider(name);
MapOperation operation = operationProvider.createPutFromLoadAllOperation(name, keyValueSequence);
operation.setNodeEngine(nodeEngine);
operation.setOperationResponseHandler(new OperationResponseHandler() {
@Override
public void sendResponse(Operation op, Object obj) {
if (finishedBatchCounter.decrementAndGet() == 0) {
loaded.set(true);
}
}
});
operation.setPartitionId(partitionId);
OperationAccessor.setCallerAddress(operation, nodeEngine.getThisAddress());
operation.setCallerUuid(nodeEngine.getLocalMember().getUuid());
operation.setServiceName(MapService.SERVICE_NAME);
return operation;
}
use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class MapExecuteWithPredicateMessageTask method createOperationFactory.
@Override
protected OperationFactory createOperationFactory() {
MapOperationProvider operationProvider = getOperationProvider(parameters.name);
EntryProcessor entryProcessor = serializationService.toObject(parameters.entryProcessor);
Predicate predicate = serializationService.toObject(parameters.predicate);
return operationProvider.createPartitionWideEntryWithPredicateOperationFactory(parameters.name, entryProcessor, predicate);
}
use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class MapExecuteOnAllKeysMessageTask method createOperationFactory.
@Override
protected OperationFactory createOperationFactory() {
MapOperationProvider operationProvider = getOperationProvider(parameters.name);
EntryProcessor entryProcessor = serializationService.toObject(parameters.entryProcessor);
return operationProvider.createPartitionWideEntryOperationFactory(parameters.name, entryProcessor);
}
use of com.hazelcast.map.impl.operation.MapOperationProvider in project hazelcast by hazelcast.
the class MapExecuteOnKeysMessageTask method createOperationFactory.
@Override
protected OperationFactory createOperationFactory() {
EntryProcessor processor = serializationService.toObject(parameters.entryProcessor);
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
return operationProvider.createMultipleEntryOperationFactory(parameters.name, new HashSet<Data>(parameters.keys), processor);
}
Aggregations