jasperjiaguo commented on code in PR #8753:
URL: https://github.com/apache/pinot/pull/8753#discussion_r893815757
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/http/HttpClient.java:
##########
@@ -394,6 +395,29 @@ public int downloadFile(URI uri, int socketTimeoutMs, File
dest, AuthProvider au
}
}
+ public File downloadUntarFileStreamed(URI uri, int socketTimeoutMs, File
dest, AuthProvider authProvider,
+ List<Header> httpHeaders, long rateLimit)
+ throws IOException, HttpErrorStatusException {
+ HttpUriRequest request = getDownloadFileRequest(uri, socketTimeoutMs,
authProvider, httpHeaders);
+ File ret;
+ try (CloseableHttpResponse response = _httpClient.execute(request)) {
+ StatusLine statusLine = response.getStatusLine();
+ int statusCode = statusLine.getStatusCode();
+ if (statusCode >= 300) {
+ throw new HttpErrorStatusException(HttpClient.getErrorMessage(request,
response), statusCode);
+ }
+
+ try (InputStream inputStream = response.getEntity().getContent()) {
+ ret = TarGzCompressionUtils.untarRateLimit(inputStream, dest,
rateLimit).get(0);
+ }
+
Review Comment:
Discussed offline. The untar library will fail on checksum and report
IOException if files are corrupted during transmission
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]