Class PassthroughMapResponseCollector
- java.lang.Object
-
- org.infinispan.remoting.transport.impl.PassthroughMapResponseCollector
-
- All Implemented Interfaces:
ResponseCollector<Map<Address,Response>>
public class PassthroughMapResponseCollector extends Object implements ResponseCollector<Map<Address,Response>>
Receive responses from multiple nodes, without checking that the responses are valid.- Since:
- 9.1
- Author:
- Dan Berindei
-
-
Constructor Summary
Constructors Constructor Description PassthroughMapResponseCollector(int expectedSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Address,Response>
addResponse(Address sender, Response response)
Called when a response is received, or when a target node becomes unavailable.Map<Address,Response>
finish()
Called afterResponseCollector.addResponse(Address, Response)
returnsnull
for the last response.
-
-
-
Method Detail
-
addResponse
public Map<Address,Response> addResponse(Address sender, Response response)
Description copied from interface:ResponseCollector
Called 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-
null
result if the request should complete, ornull
if 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:
addResponse
in interfaceResponseCollector<Map<Address,Response>>
-
finish
public Map<Address,Response> finish()
Description copied from interface:ResponseCollector
Called afterResponseCollector.addResponse(Address, Response)
returnsnull
for 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:
finish
in interfaceResponseCollector<Map<Address,Response>>
-
-