summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lazarev <alazarev@mirantis.com>2014-02-25 16:58:49 -0800
committerAndrew Lazarev <alazarev@mirantis.com>2014-02-25 16:58:49 -0800
commitfab9840abf46f3867eba81ee95b3b3cbda2124ac (patch)
treea4697e3c16d962d23b443df83b4328b0cbeda2e2
parent3ba0ee2a1f06b62003e96b6d7d875cad1b2c8b21 (diff)
[hadoop-swift] Added auth check before getData call2014.1.b3
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
Notes
Notes (review): Verified+2: Jenkins Approved+1: Sergey Lukjanov <slukjanov@mirantis.com> Code-Review+2: Sergey Lukjanov <slukjanov@mirantis.com> Code-Review+1: Dmitry Mescheryakov <dmescheryakov@mirantis.com> Code-Review+2: Alexander Ignatov <aignatov@mirantis.com> Code-Review+1: Nikolay Mahotkin <nmakhotkin@mirantis.com> Submitted-by: Jenkins Submitted-at: Thu, 27 Feb 2014 17:03:25 +0000 Reviewed-on: https://review.openstack.org/76405 Project: openstack/savanna-extra Branch: refs/heads/master
-rw-r--r--hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java b/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java
index 88cd200..692d48f 100644
--- a/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java
+++ b/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java
@@ -637,6 +637,7 @@ public final class SwiftRestClient {
637 LOG.debug("getData:" + range); 637 LOG.debug("getData:" + range);
638 } 638 }
639 639
640 preRemoteCommand("getData");
640 return getData(url, 641 return getData(url,
641 new Header(HEADER_RANGE, range), 642 new Header(HEADER_RANGE, range),
642 SwiftRestClient.NEWEST); 643 SwiftRestClient.NEWEST);
@@ -656,6 +657,7 @@ public final class SwiftRestClient {
656 public HttpBodyContent getData(SwiftObjectPath path, 657 public HttpBodyContent getData(SwiftObjectPath path,
657 long offset, 658 long offset,
658 long length) throws IOException { 659 long length) throws IOException {
660 preRemoteCommand("getData");
659 return getData(pathToURI(path), offset, length); 661 return getData(pathToURI(path), offset, length);
660 } 662 }
661 663
@@ -708,6 +710,7 @@ public final class SwiftRestClient {
708 public HttpBodyContent getData(SwiftObjectPath path, 710 public HttpBodyContent getData(SwiftObjectPath path,
709 final Header... requestHeaders) 711 final Header... requestHeaders)
710 throws IOException { 712 throws IOException {
713 preRemoteCommand("getData");
711 return getData(pathToURI(path), requestHeaders); 714 return getData(pathToURI(path), requestHeaders);
712 } 715 }
713 716