Merge -r 1329714:1329715 from trunk to branch. FIXES: HDFS-3314

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1329725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alejandro Abdelnur 2012-04-24 13:52:07 +00:00
parent 2eacd6d90a
commit 2690acc9d5
4 changed files with 6 additions and 4 deletions

View File

@ -159,7 +159,7 @@ public class HttpFSFileSystem extends FileSystem {
* Get operations. * Get operations.
*/ */
public enum GetOpValues { public enum GetOpValues {
OPEN, GETFILESTATUS, LISTSTATUS, GETHOMEDIR, GETCONTENTSUMMARY, GETFILECHECKSUM, OPEN, GETFILESTATUS, LISTSTATUS, GETHOMEDIRECTORY, GETCONTENTSUMMARY, GETFILECHECKSUM,
GETDELEGATIONTOKEN, GETFILEBLOCKLOCATIONS, INSTRUMENTATION GETDELEGATIONTOKEN, GETFILEBLOCKLOCATIONS, INSTRUMENTATION
} }
@ -684,7 +684,7 @@ public class HttpFSFileSystem extends FileSystem {
@Override @Override
public Path getHomeDirectory() { public Path getHomeDirectory() {
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
params.put(OP_PARAM, GetOpValues.GETHOMEDIR.toString()); params.put(OP_PARAM, GetOpValues.GETHOMEDIRECTORY.toString());
try { try {
HttpURLConnection conn = getConnection(HTTP_GET, params, new Path(getUri().toString(), "/"), false); HttpURLConnection conn = getConnection(HTTP_GET, params, new Path(getUri().toString(), "/"), false);
validateResponse(conn, HttpURLConnection.HTTP_OK); validateResponse(conn, HttpURLConnection.HTTP_OK);

View File

@ -291,7 +291,7 @@ public class HttpFSServer {
response = Response.ok(json).type(MediaType.APPLICATION_JSON).build(); response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
break; break;
} }
case GETHOMEDIR: { case GETHOMEDIRECTORY: {
FSOperations.FSHomeDir command = new FSOperations.FSHomeDir(); FSOperations.FSHomeDir command = new FSOperations.FSHomeDir();
JSONObject json = fsExecute(user, doAs.value(), command); JSONObject json = fsExecute(user, doAs.value(), command);
AUDIT_LOG.info(""); AUDIT_LOG.info("");

View File

@ -53,7 +53,7 @@ public class TestCheckUploadContentTypeFilter {
@Test @Test
public void getOther() throws Exception { 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 @Test

View File

@ -425,6 +425,8 @@ Release 2.0.0 - UNRELEASED
HDFS-3305. GetImageServlet should consider SBN a valid requestor in a HDFS-3305. GetImageServlet should consider SBN a valid requestor in a
secure HA setup. (atm) secure HA setup. (atm)
HDFS-3314. HttpFS operation for getHomeDirectory is incorrect. (tucu)
BREAKDOWN OF HDFS-1623 SUBTASKS BREAKDOWN OF HDFS-1623 SUBTASKS
HDFS-2179. Add fencing framework and mechanisms for NameNode HA. (todd) HDFS-2179. Add fencing framework and mechanisms for NameNode HA. (todd)