slfan1989 commented on code in PR #5660:
URL: https://github.com/apache/hadoop/pull/5660#discussion_r1194360518
##########
hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java:
##########
@@ -2300,4 +2316,38 @@ public Map execute(FileSystem fs) throws IOException {
return toJson(status);
}
}
+
+ /**
+ * Executor that performs a fs-status FileSystemAccess files
+ * system operation.
+ */
+ @InterfaceAudience.Private
+ public static class FSStatus
+ implements FileSystemAccess.FileSystemExecutor<Map> {
+ final private Path path;
+
+ /**
+ * Creates a fs-status executor.
+ *
+ * @param path the path to retrieve the status.
+ */
+ public FSStatus(String path) {
+ this.path = new Path(path);
+ }
+
+ /**
+ * Executes the filesystem getStatus operation and returns the
Review Comment:
```
/**
* Executes the filesystem getFileLinkStatus operation and returns the
* result in a JSON Map.
*
* @param fs filesystem instance to use.
* @return a Map object (JSON friendly) with the file status.
* @throws IOException thrown if an IO error occurred.
*/
@Override
public Map execute(FileSystem fs) throws IOException {
FileStatus status = fs.getFileLinkStatus(path);
HttpFSServerWebApp.get().getMetrics().incrOpsStat();
return toJson(status);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]