use of org.infinispan.commands.remote.recovery.CompleteTransactionCommand in project infinispan by infinispan.
the class RecoveryManagerImpl method forceTransactionCompletionFromCluster.
@Override
public String forceTransactionCompletionFromCluster(XidImpl xid, Address where, boolean commit) {
CompleteTransactionCommand ctc = commandFactory.buildCompleteTransactionCommand(xid, commit);
CompletionStage<Map<Address, Response>> completionStage = rpcManager.invokeCommand(where, ctc, MapResponseCollector.validOnly(), rpcManager.getSyncRpcOptions());
Map<Address, Response> responseMap = rpcManager.blocking(completionStage);
if (responseMap.size() != 1 || responseMap.get(where) == null) {
log.expectedJustOneResponse(responseMap);
throw new CacheException("Expected response size is 1, received " + responseMap);
}
// noinspection rawtypes
return (String) ((SuccessfulResponse) responseMap.get(where)).getResponseValue();
}
Aggregations