This is an automated email from the ASF dual-hosted git repository.
mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push:
new 02ff31b806 [NO ISSUE][*DB]: Close stream after done reading
02ff31b806 is described below
commit 02ff31b80662fc7162b0d584053470255d853a79
Author: Hussain Towaileb <[email protected]>
AuthorDate: Tue Jun 6 05:59:20 2023 +0300
[NO ISSUE][*DB]: Close stream after done reading
Change-Id: I9f365430811a62c513219b4257788746e22d684e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17591
Reviewed-by: Ian Maxon <[email protected]>
Tested-by: Hussain Towaileb <[email protected]>
Integration-Tests: Hussain Towaileb <[email protected]>
---
.../java/org/apache/asterix/cloud/clients/aws/s3/S3CloudClient.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/aws/s3/S3CloudClient.java
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/aws/s3/S3CloudClient.java
index 6db784d3d2..0b78682e4f 100644
---
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/aws/s3/S3CloudClient.java
+++
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/aws/s3/S3CloudClient.java
@@ -145,8 +145,8 @@ public class S3CloudClient implements ICloudClient {
@Override
public byte[] readAllBytes(String bucket, String path) throws
HyracksDataException {
GetObjectRequest getReq =
GetObjectRequest.builder().bucket(bucket).key(path).build();
- try {
- ResponseInputStream<GetObjectResponse> stream =
s3Client.getObject(getReq);
+
+ try (ResponseInputStream<GetObjectResponse> stream =
s3Client.getObject(getReq)) {
return stream.readAllBytes();
} catch (NoSuchKeyException e) {
return null;