Interface BiasedCollector
-
- All Superinterfaces:
Collector<ValidResponse>,ResponseCollector<ValidResponse>
public interface BiasedCollector extends Collector<ValidResponse>, ResponseCollector<ValidResponse>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddPendingAcks(boolean success, Address[] waitFor)default ValidResponseaddResponse(Address sender, Response response)Called when a response is received, or when a target node becomes unavailable.default ValidResponsefinish()Called afterResponseCollector.addResponse(Address, Response)returnsnullfor the last response.-
Methods inherited from interface org.infinispan.interceptors.distribution.Collector
getFuture, primaryException, primaryResult
-
-
-
-
Method Detail
-
addPendingAcks
void addPendingAcks(boolean success, Address[] waitFor)
-
addResponse
default ValidResponse addResponse(Address sender, Response response)
Description copied from interface:ResponseCollectorCalled when a response is received, or when a target node becomes unavailable.When a target node leaves the cluster, this method is called with a
CacheNotFoundResponse.Should return a non-
nullresult if the request should complete, ornullif it should wait for more responses. If the method throws an exception, the request will be completed with that exception. If the last response is received andaddResponse()still returnsnull,ResponseCollector.finish()will also be called to obtain a result.Thread safety:
addResponse()will *not* be called concurrently from multiple threads, and the request will not be completed whileaddResponse()is running.- Specified by:
addResponsein interfaceResponseCollector<ValidResponse>
-
finish
default ValidResponse finish()
Description copied from interface:ResponseCollectorCalled afterResponseCollector.addResponse(Address, Response)returnsnullfor the last response.If
finish()finishes normally, the request will complete with its return value (even ifnull). Iffinish()throws an exception, the request will complete exceptionally with that exception, wrapped in aCompletionException(unless the exception is already aCompletionException).- Specified by:
finishin interfaceResponseCollector<ValidResponse>
-
-