Browse Source

[hadoop-swift] Added auth check before getData call

Without such check client doesn't try to authenticate during method call.
This leads to read failure in case if this is the first use of client.

Change-Id: Ib2389a83b4e73fac49066ffe0411ff430482f848
Closes-Bug: #1284906
Andrew Lazarev 5 years ago
parent
commit
fab9840abf

+ 3
- 0
hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java View File

@@ -637,6 +637,7 @@ public final class SwiftRestClient {
637 637
       LOG.debug("getData:" + range);
638 638
     }
639 639
 
640
+    preRemoteCommand("getData");
640 641
     return getData(url,
641 642
                    new Header(HEADER_RANGE, range),
642 643
                    SwiftRestClient.NEWEST);
@@ -656,6 +657,7 @@ public final class SwiftRestClient {
656 657
   public HttpBodyContent getData(SwiftObjectPath path,
657 658
                                  long offset,
658 659
                                  long length) throws IOException {
660
+    preRemoteCommand("getData");
659 661
     return getData(pathToURI(path), offset, length);
660 662
   }
661 663
 
@@ -708,6 +710,7 @@ public final class SwiftRestClient {
708 710
   public HttpBodyContent getData(SwiftObjectPath path,
709 711
                                  final Header... requestHeaders)
710 712
           throws IOException {
713
+    preRemoteCommand("getData");
711 714
     return getData(pathToURI(path), requestHeaders);
712 715
   }
713 716
 

Loading…
Cancel
Save