use of org.infinispan.commands.irac.IracStateResponseCommand in project infinispan by infinispan.
the class DefaultIracManager method createAndSendBatch.
private Completable createAndSendBatch(Address dst, Collection<? extends IracManagerKeyState> batch) {
if (log.isTraceEnabled()) {
log.tracef("Sending state response to %s. Batch=%s", dst, Util.toStr(batch));
}
RpcOptions rpcOptions = rpcManager.getSyncRpcOptions();
ResponseCollector<Void> rspCollector = ignoreLeavers();
IracStateResponseCommand cmd = commandsFactory.buildIracStateResponseCommand(batch.size());
for (IracManagerKeyState state : batch) {
IracMetadata tombstone = iracTombstoneManager.getTombstone(state.getKey());
cmd.add(state, tombstone);
}
return Completable.fromCompletionStage(rpcManager.invokeCommand(dst, cmd, rspCollector, rpcOptions).exceptionally(throwable -> {
if (log.isTraceEnabled()) {
log.tracef(throwable, "Batch sent to %s failed! Batch=%s", dst, Util.toStr(batch));
}
return null;
}));
}
Aggregations