From fab9840abf46f3867eba81ee95b3b3cbda2124ac Mon Sep 17 00:00:00 2001 From: Andrew Lazarev Date: Tue, 25 Feb 2014 16:58:49 -0800 Subject: [PATCH] [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 --- .../java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java | 3 +++ 1 file changed, 3 insertions(+) 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 { LOG.debug("getData:" + range); } + preRemoteCommand("getData"); return getData(url, new Header(HEADER_RANGE, range), SwiftRestClient.NEWEST); @@ -656,6 +657,7 @@ public final class SwiftRestClient { public HttpBodyContent getData(SwiftObjectPath path, long offset, long length) throws IOException { + preRemoteCommand("getData"); return getData(pathToURI(path), offset, length); } @@ -708,6 +710,7 @@ public final class SwiftRestClient { public HttpBodyContent getData(SwiftObjectPath path, final Header... requestHeaders) throws IOException { + preRemoteCommand("getData"); return getData(pathToURI(path), requestHeaders); }