@Override public ClientResponse<RetryResponseHolder<Intermediate>> handleResponse(HttpResponse httpResponse,
      TrafficCop trafficCop) {
    LOG.debug("UnauthorizedResponseHandler - Got response status {}", httpResponse.getStatus());
    if (httpResponse.getStatus().equals(HttpResponseStatus.UNAUTHORIZED)) {
      // Drain the buffer
      //noinspection ResultOfMethodCallIgnored
      httpResponse.getContent().toString();
      return ClientResponse.unfinished(RetryResponseHolder.retry());
    } else {
      return wrap(httpResponseHandler.handleResponse(httpResponse, trafficCop));
    }
  }
Class handling retry on Unauthorized responses.

@param <Intermediate> Intermediate response type.
@param <Final> final result type.
druid-handler/src/java/org/apache/hadoop/hive/druid/security/RetryIfUnauthorizedResponseHandler.java