Skip to content

Commit f583df5

Browse files
committed
Add more logging
1 parent 5e8138d commit f583df5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

presto-main/src/main/java/com/facebook/presto/server/remotetask/ReactorNettyHttpClient.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public <T, E extends Exception> HttpResponseFuture<T> executeAsync(Request airli
242242
.responseSingle((response, bytes) -> bytes.asInputStream().zipWith(Mono.just(response)))
243243
// Request timeout
244244
.timeout(java.time.Duration.of(requestTimeout.toMillis(), MILLIS))
245-
.subscribe(t -> onSuccess(responseHandler, t.getT1(), t.getT2(), listenableFuture), e -> onError(listenableFuture, e), () -> onComplete(listenableFuture));
245+
.subscribe(t -> onSuccess(responseHandler, t.getT1(), t.getT2(), listenableFuture, uri), e -> onError(listenableFuture, e), () -> onComplete(listenableFuture));
246246
break;
247247
case "POST":
248248
byte[] postBytes = ((StaticBodyGenerator) airliftRequest.getBodyGenerator()).getBody();
@@ -278,15 +278,15 @@ public <T, E extends Exception> HttpResponseFuture<T> executeAsync(Request airli
278278
.responseSingle((response, bytes) -> bytes.asInputStream().zipWith(Mono.just(response)))
279279
// Request timeout
280280
.timeout(java.time.Duration.of(requestTimeout.toMillis(), MILLIS))
281-
.subscribe(t -> onSuccess(responseHandler, t.getT1(), t.getT2(), listenableFuture), e -> onError(listenableFuture, e), () -> onComplete(listenableFuture));
281+
.subscribe(t -> onSuccess(responseHandler, t.getT1(), t.getT2(), listenableFuture, uri), e -> onError(listenableFuture, e), () -> onComplete(listenableFuture));
282282
break;
283283
case "DELETE":
284284
disposable = client.delete()
285285
.uri(uri)
286286
.responseSingle((response, bytes) -> bytes.asInputStream().zipWith(Mono.just(response)))
287287
// Request timeout
288288
.timeout(java.time.Duration.of(requestTimeout.toMillis(), MILLIS))
289-
.subscribe(t -> onSuccess(responseHandler, t.getT1(), t.getT2(), listenableFuture), e -> onError(listenableFuture, e), () -> onComplete(listenableFuture));
289+
.subscribe(t -> onSuccess(responseHandler, t.getT1(), t.getT2(), listenableFuture, uri), e -> onError(listenableFuture, e), () -> onComplete(listenableFuture));
290290
break;
291291
default:
292292
throw new UnsupportedOperationException("Unexpected request: " + airliftRequest);
@@ -341,7 +341,7 @@ public String getState()
341341
};
342342
}
343343

344-
public void onSuccess(ResponseHandler responseHandler, InputStream inputStream, HttpClientResponse response, SettableFuture<Object> listenableFuture)
344+
public void onSuccess(ResponseHandler responseHandler, InputStream inputStream, HttpClientResponse response, SettableFuture<Object> listenableFuture, URI uri)
345345
{
346346
ListMultimap<HeaderName, String> responseHeaders = ArrayListMultimap.create();
347347
HttpHeaders headers = response.responseHeaders();
@@ -382,14 +382,14 @@ else if (name.equalsIgnoreCase(CONTENT_ENCODING_HEADER_NAME.toString())) {
382382
if (contentEncoding != null && !contentEncoding.equalsIgnoreCase("identity")) {
383383
if (contentEncoding.equalsIgnoreCase("zstd")) {
384384
streamHolder[0] = new ZstdInputStream(inputStream);
385-
log.info("onSuccess zstd");
385+
log.info("onSuccess zstd - URI: %s", uri);
386386
}
387387
else if (contentEncoding.equalsIgnoreCase("gzip")) {
388388
streamHolder[0] = new GZIPInputStream(inputStream);
389-
log.info("onSuccess gzip");
389+
log.info("onSuccess gzip - URI: %s", uri);
390390
}
391391
else {
392-
throw new RuntimeException(format("Unsupported Content-Encoding: %s. Supported: zstd, gzip.", contentEncoding));
392+
throw new RuntimeException(format("Unsupported Content-Encoding: %s - URI: %s. Supported: zstd, gzip.", contentEncoding, uri));
393393
}
394394
}
395395

0 commit comments

Comments
 (0)