in client/src/main/java/org/apache/cassandra/sidecar/client/RequestExecutor.java [214:243]
private void streamWithRetries(CompletableFuture<HttpResponse> future,
StreamConsumer streamConsumer,
Iterator<SidecarInstance> iterator,
SidecarInstance sidecarInstance,
RequestContext context,
int attempt)
{
logger.debug("Streaming from instance={}, request={}, attempt={}",
sidecarInstance, context.request(), attempt);
try
{
httpClient.stream(sidecarInstance, context, streamConsumer)
.whenComplete((HttpResponse response, Throwable throwable) ->
applyRetryPolicy(future,
streamConsumer,
iterator,
sidecarInstance,
context,
attempt,
response,
throwable));
}
catch (Throwable throwable)
{
logger.error("Unexpected error while streaming. instance={}, request={}, attempt={}",
sidecarInstance, context.request(), attempt);
future.completeExceptionally(throwable);
}
}