@ Override public void initializeListener ( QueryBatcher queryBatcher ) { HostAvailabilityListener hostAvailabilityListener = HostAvailabilityListener . getInstance ( queryBatcher ) ; if ( hostAvailabilityListener != null ) { BatchFailureListener < QueryBatch > retryListener = hostAvailabilityListener . initializeRetryListener ( this ) ; if ( retryListener != null ) onFailure ( retryListener ) ; } NoResponseListener noResponseListener = NoResponseListener . getInstance ( queryBatcher ) ; if ( noResponseListener != null ) { BatchFailureListener < QueryBatch > noResponseRetryListener = noResponseListener . initializeRetryListener ( this ) ; if ( noResponseRetryListener != null ) onFailure ( noResponseRetryListener ) ; } }
This implementation of initializeListener adds this instance of ExportToWriterListener to the two RetryListener s in this QueryBatcher so they will retry any batches that fail during the read request .