From f4711ef3ab4bb9676303d0aff79ff3d004f239ff Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Tue, 24 Apr 2012 13:46:25 +0000 Subject: [PATCH] HDFS-3314. HttpFS operation for getHomeDirectory is incorrect. (tucu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1329715 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/hadoop/fs/http/client/HttpFSFileSystem.java | 4 ++-- .../java/org/apache/hadoop/fs/http/server/HttpFSServer.java | 2 +- .../fs/http/server/TestCheckUploadContentTypeFilter.java | 2 +- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java index 03c8548813..4a1a205551 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java @@ -159,7 +159,7 @@ public static FILE_TYPE getType(FileStatus fileStatus) { * Get operations. */ public enum GetOpValues { - OPEN, GETFILESTATUS, LISTSTATUS, GETHOMEDIR, GETCONTENTSUMMARY, GETFILECHECKSUM, + OPEN, GETFILESTATUS, LISTSTATUS, GETHOMEDIRECTORY, GETCONTENTSUMMARY, GETFILECHECKSUM, GETDELEGATIONTOKEN, GETFILEBLOCKLOCATIONS, INSTRUMENTATION } @@ -684,7 +684,7 @@ public FileStatus getFileStatus(Path f) throws IOException { @Override public Path getHomeDirectory() { Map params = new HashMap(); - params.put(OP_PARAM, GetOpValues.GETHOMEDIR.toString()); + params.put(OP_PARAM, GetOpValues.GETHOMEDIRECTORY.toString()); try { HttpURLConnection conn = getConnection(HTTP_GET, params, new Path(getUri().toString(), "/"), false); validateResponse(conn, HttpURLConnection.HTTP_OK); diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java index 43d1f72242..95c494206d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java @@ -291,7 +291,7 @@ public Response get(@Context Principal user, response = Response.ok(json).type(MediaType.APPLICATION_JSON).build(); break; } - case GETHOMEDIR: { + case GETHOMEDIRECTORY: { FSOperations.FSHomeDir command = new FSOperations.FSHomeDir(); JSONObject json = fsExecute(user, doAs.value(), command); AUDIT_LOG.info(""); diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestCheckUploadContentTypeFilter.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestCheckUploadContentTypeFilter.java index 89497a4e04..2596be9754 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestCheckUploadContentTypeFilter.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestCheckUploadContentTypeFilter.java @@ -53,7 +53,7 @@ public void postUploadWrong() throws Exception { @Test public void getOther() throws Exception { - test("GET", HttpFSFileSystem.GetOpValues.GETHOMEDIR.toString(), "plain/text", false, false); + test("GET", HttpFSFileSystem.GetOpValues.GETHOMEDIRECTORY.toString(), "plain/text", false, false); } @Test diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index b241015dec..cf63b61c46 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -551,6 +551,8 @@ Release 2.0.0 - UNRELEASED HDFS-3305. GetImageServlet should consider SBN a valid requestor in a secure HA setup. (atm) + HDFS-3314. HttpFS operation for getHomeDirectory is incorrect. (tucu) + BREAKDOWN OF HDFS-1623 SUBTASKS HDFS-2179. Add fencing framework and mechanisms for NameNode HA. (todd)