BatchFailureListener<QueryBatchException>
,
FailureListener<QueryBatchException>
,
QueryFailureListener
,
WriteFailureListener
public class NoResponseListener extends HostAvailabilityListener
NoResponseListener is a default listener like HostAvailabilityListener that is automatically registered with the QueryBatcher and WriteBatcher instances. This listener is used to handle empty responses from the server. For some requests, we might not have any response from the server for a request when the server goes down or is unavailable. To handle such scenarios, we register this listener and this would automatically take care of retrying the batches.
This is different from HostAvailabilityListener in the fact that this listener's RetryListener inherited from HostAvailabilityListener might not be desirable when using an ApplyTransformListener. If we get empty responses when we try to apply a transform to the batch of URIs retrieved from the server, we are not sure what happened in the server - if the transform has been applied or it has not been applied. Retrying in those scenarios would apply the transform twice if the transform has been already applied and this is not desirable.
Constructor | Description |
---|---|
NoResponseListener(DataMovementManager moveMgr) |
Modifier and Type | Method | Description |
---|---|---|
static NoResponseListener |
getInstance(Batcher batcher) |
Returns the NoResponseListener instance
registered with the Batcher.
|
protected boolean |
isHostUnavailableException(java.lang.Throwable throwable,
java.util.Set<java.lang.Throwable> path) |
getHostUnavailableExceptions,
getMinHosts,
getSuspendTimeForHostUnavailable,
initializeRetryListener,
processFailure,
processFailure,
withHostUnavailableExceptions,
withMinHosts,
withSuspendTimeForHostUnavailable
public NoResponseListener(DataMovementManager moveMgr)
protected boolean isHostUnavailableException(java.lang.Throwable throwable, java.util.Set<java.lang.Throwable> path)
isHostUnavailableException
in
class HostAvailabilityListener
public static NoResponseListener getInstance(Batcher batcher)
batcher
- the Batcher instance for which the
registered NoResponseListener is returnedjava.lang.IllegalStateException
- if the passed
Batcher is neither a QueryBatcher nor a WriteBatcherCopyright © 2022 MarkLogic Corporation