wujinhu commented on code in PR #6904:
URL: https://github.com/apache/hadoop/pull/6904#discussion_r1682025092


##########
hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java:
##########
@@ -527,17 +530,14 @@ protected OSSListRequest createListObjectsRequest(String 
prefix,
    * @return This method returns null if the key is not found.
    */
   public InputStream retrieve(String key, long byteStart, long byteEnd) {
-    try {
-      GetObjectRequest request = new GetObjectRequest(bucketName, key);
-      request.setRange(byteStart, byteEnd);
-      InputStream in = ossClient.getObject(request).getObjectContent();
-      statistics.incrementReadOps(1);
-      return in;
-    } catch (OSSException | ClientException e) {
-      LOG.error("Exception thrown when store retrieves key: "
-              + key + ", exception: " + e);
-      return null;
+    GetObjectRequest request = new GetObjectRequest(bucketName, key);
+    if (useStandardHttpRangeBehavior) {
+      request.addHeader("x-oss-range-behavior", "standard");

Review Comment:
   Ok, I will add some comments. OSS does not support multiple ranges.



-- 
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]

Reply via email to