Class IracResponseCollector
- java.lang.Object
-
- org.infinispan.xsite.irac.IracResponseCollector
-
- All Implemented Interfaces:
Runnable
public class IracResponseCollector extends Object implements Runnable
A response collector for an asynchronous cross site requests.Multiple keys are batched together in a single requests. The remote site sends a
BitSet
back where if bitn
is set, it means then
th key in the batch failed to be applied (example, lock failed to be acquired), and it needs to be retried.If an
Exception
is received (example, timed-out waiting for the remote site ack), it assumes all keys in the batch aren't applied, and they are retried.When all responses (or exceptions) are received,
IracResponseCollector.IracResponseCompleted.onResponseCompleted(IracBatchSendResult, Collection)
is invoked with the global result inIracBatchSendResult
and a collection with all the successfully applied keys. Also, theCompletableFuture
returned byfreeze()
is completed (completed value not relevant, and it is never completed exceptionally).- Since:
- 12
- Author:
- Pedro Ruivo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
IracResponseCollector.IracResponseCompleted
-
Constructor Summary
Constructors Constructor Description IracResponseCollector(String cacheName, Collection<org.infinispan.xsite.irac.IracManagerKeyState> batch, IracResponseCollector.IracResponseCompleted listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dependsOn(IracXSiteBackup backup, CompletionStage<? extends IntSet> request)
CompletionStage<Void>
freeze()
void
run()
-
-
-
Constructor Detail
-
IracResponseCollector
public IracResponseCollector(String cacheName, Collection<org.infinispan.xsite.irac.IracManagerKeyState> batch, IracResponseCollector.IracResponseCompleted listener)
-
-
Method Detail
-
dependsOn
public void dependsOn(IracXSiteBackup backup, CompletionStage<? extends IntSet> request)
-
freeze
public CompletionStage<Void> freeze()
-
-