From 3a1e55851cf31239e8207808f8b50bdd99bbf8a1 Mon Sep 17 00:00:00 2001 From: "Charles S. Givre" Date: Mon, 6 May 2024 23:59:41 -0400 Subject: [PATCH] DRILL-8495: HTTP Caching Not Saving Pages (#2912) Co-authored-by: Charles Givre --- .../drill/exec/store/http/util/SimpleHttp.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java index d0a78e35920..3171e1c55f3 100644 --- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java +++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java @@ -1013,7 +1013,7 @@ public static String getRequestAndStringResponse(String url) { /** * - * @param url + * @param url The input URL * @return an input stream which the caller is responsible for closing. */ public static InputStream getRequestAndStreamResponse(String url) { @@ -1029,9 +1029,9 @@ public static InputStream getRequestAndStreamResponse(String url) { /** * - * @param url + * @param url The input URL * @return response body which the caller is responsible for closing. - * @throws IOException + * @throws IOException If anything goes wrong, throws an IOException */ public static ResponseBody makeSimpleGetRequest(String url) throws IOException { Request.Builder requestBuilder = new Request.Builder() @@ -1047,14 +1047,9 @@ public static ResponseBody makeSimpleGetRequest(String url) throws IOException { @Override public void close() { - Cache cache; try { - cache = client.cache(); - if (cache != null) { - cache.close(); - } client.connectionPool().evictAll(); - } catch (IOException e) { + } catch (Exception e) { logger.warn("Error closing cache. {}", e.getMessage()); } }