use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class PartitionReplicaSyncRequest method sendResponse.
/**
* Send a synchronization response to the caller replica containing the replication operations to be executed
*/
private void sendResponse(Collection<Operation> operations, Collection<ChunkSupplier> chunkSuppliers, ServiceNamespace ns) {
NodeEngine nodeEngine = getNodeEngine();
PartitionReplicaSyncResponse syncResponse = createResponse(operations, chunkSuppliers, ns);
Address target = getCallerAddress();
ILogger logger = getLogger();
if (logger.isFinestEnabled()) {
logger.finest("Sending sync response to -> " + target + " for partitionId=" + partitionId() + ", replicaIndex=" + getReplicaIndex() + ", namespaces=" + ns);
}
// PartitionReplicaSyncResponse is TargetAware and sent directly without invocation system.
syncResponse.setTarget(target);
OperationService operationService = nodeEngine.getOperationService();
operationService.send(syncResponse, target);
}
use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class PublisherCreateOperation method readAndResetAccumulator.
/**
* Read and reset the accumulator of query cache inside the given partition.
*/
private Future<Object> readAndResetAccumulator(String mapName, String cacheId, Integer partitionId) {
Operation operation = new ReadAndResetAccumulatorOperation(mapName, cacheId);
OperationService operationService = getNodeEngine().getOperationService();
return operationService.invokeOnPartition(MapService.SERVICE_NAME, operation, partitionId);
}
use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class BasicRecordStoreLoader method sendOperation.
/**
* Invokes an operation to put the provided key-value pairs to the partition
* record store.
*
* @param loadingSequence the list of serialised key-value-(expirationTime)
* sequences
* @return the future representing the pending completion of the put operation
*/
private Future<?> sendOperation(List<Data> loadingSequence) {
OperationService operationService = mapServiceContext.getNodeEngine().getOperationService();
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
Operation operation = createOperation(loadingSequence);
operation.setNodeEngine(nodeEngine);
operation.setPartitionId(partitionId);
OperationAccessor.setCallerAddress(operation, nodeEngine.getThisAddress());
operation.setCallerUuid(nodeEngine.getLocalMember().getUuid());
operation.setServiceName(MapService.SERVICE_NAME);
return operationService.invokeOnPartition(MapService.SERVICE_NAME, operation, partitionId);
}
use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class CollectionService method rollbackTransaction.
@Override
public void rollbackTransaction(UUID transactionId) {
final Set<String> collectionNames = getContainerMap().keySet();
OperationService operationService = nodeEngine.getOperationService();
for (String name : collectionNames) {
int partitionId = partitionService.getPartitionId(StringPartitioningStrategy.getPartitionKey(name));
Operation operation = new CollectionTransactionRollbackOperation(name, transactionId).setPartitionId(partitionId).setService(this).setNodeEngine(nodeEngine);
operationService.invokeOnPartition(operation);
}
}
use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class QueueService method rollbackTransaction.
@Override
public void rollbackTransaction(UUID transactionId) {
final Set<String> queueNames = containerMap.keySet();
OperationService operationService = nodeEngine.getOperationService();
for (String name : queueNames) {
int partitionId = partitionService.getPartitionId(StringPartitioningStrategy.getPartitionKey(name));
Operation operation = new QueueTransactionRollbackOperation(name, transactionId).setPartitionId(partitionId).setService(this).setNodeEngine(nodeEngine);
operationService.invokeOnPartition(operation);
}
}
Aggregations