pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] zhaijack commented on a change in pull request #2065: GCS offload support(2): replace `s3client` api with `jclouds` related api
Date Sat, 14 Jul 2018 07:18:07 GMT
zhaijack commented on a change in pull request #2065: GCS offload support(2): replace `s3client`
api with `jclouds` related api 
URL: https://github.com/apache/incubator-pulsar/pull/2065#discussion_r202508609
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/offload/impl/BackedInputStreamImpl.java
 ##########
 @@ -76,26 +70,24 @@ private boolean refillBufferIfNeeded() throws IOException {
             long startRange = cursor;
             long endRange = Math.min(cursor + bufferSize - 1,
                                      objectLen - 1);
-            GetObjectRequest req = new GetObjectRequest(bucket, key)
-                .withRange(startRange, endRange);
-            log.debug("Reading range {}-{} from {}/{}", startRange, endRange, bucket, key);
-            try (S3Object obj = s3client.getObject(req)) {
-                versionCheck.check(key, obj.getObjectMetadata());
 
-                Long[] range = obj.getObjectMetadata().getContentRange();
-                long bytesRead = range[1] - range[0] + 1;
+            try {
+                Blob blob = blobStore.getBlob(bucket, key);
+                versionCheck.check(key, blob);
 
+                InputStream payload = blob.getPayload().openStream();
 
 Review comment:
   Thanks, find a replacement, will change it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message