|
@@ -73,9 +73,11 @@ import org.apache.hadoop.fs.permission.AclStatus;
|
|
import org.apache.hadoop.fs.permission.FsAction;
|
|
import org.apache.hadoop.fs.permission.FsAction;
|
|
import org.apache.hadoop.fs.permission.FsCreateModes;
|
|
import org.apache.hadoop.fs.permission.FsCreateModes;
|
|
import org.apache.hadoop.fs.permission.FsPermission;
|
|
import org.apache.hadoop.fs.permission.FsPermission;
|
|
|
|
+import org.apache.hadoop.fs.FsStatus;
|
|
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
|
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
|
import org.apache.hadoop.hdfs.DFSUtil;
|
|
import org.apache.hadoop.hdfs.DFSUtil;
|
|
import org.apache.hadoop.hdfs.DFSUtilClient;
|
|
import org.apache.hadoop.hdfs.DFSUtilClient;
|
|
|
|
+import org.apache.hadoop.hdfs.DFSClient;
|
|
import org.apache.hadoop.hdfs.XAttrHelper;
|
|
import org.apache.hadoop.hdfs.XAttrHelper;
|
|
import org.apache.hadoop.hdfs.protocol.BlockStoragePolicy;
|
|
import org.apache.hadoop.hdfs.protocol.BlockStoragePolicy;
|
|
import org.apache.hadoop.hdfs.protocol.ClientProtocol;
|
|
import org.apache.hadoop.hdfs.protocol.ClientProtocol;
|
|
@@ -1396,6 +1398,15 @@ public class NamenodeWebHdfsMethods {
|
|
final String js = JsonUtil.toJsonString(status, true);
|
|
final String js = JsonUtil.toJsonString(status, true);
|
|
return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
|
|
return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
|
|
}
|
|
}
|
|
|
|
+ case GETSTATUS: {
|
|
|
|
+ long[] states = cp.getStats();
|
|
|
|
+ FsStatus status = new FsStatus(
|
|
|
|
+ DFSClient.getStateAtIndex(states, 0),
|
|
|
|
+ DFSClient.getStateAtIndex(states, 1),
|
|
|
|
+ DFSClient.getStateAtIndex(states, 2));
|
|
|
|
+ final String js = JsonUtil.toJsonString(status);
|
|
|
|
+ return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
|
|
|
|
+ }
|
|
default:
|
|
default:
|
|
throw new UnsupportedOperationException(op + " is not supported");
|
|
throw new UnsupportedOperationException(op + " is not supported");
|
|
}
|
|
}
|
|
@@ -1535,6 +1546,7 @@ public class NamenodeWebHdfsMethods {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/** Handle HTTP DELETE request for the root. */
|
|
/** Handle HTTP DELETE request for the root. */
|
|
@DELETE
|
|
@DELETE
|
|
@Path("/")
|
|
@Path("/")
|