smengcl commented on code in PR #5920:
URL: https://github.com/apache/ozone/pull/5920#discussion_r1442441905
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -3186,6 +3192,132 @@ public ServiceInfoEx getServiceInfo() throws
IOException {
return serviceInfo.provide();
}
+ @Override
+ public ListOpenFilesResult listOpenFiles(String path,
+ long maxKeys,
+ String contToken)
+ throws IOException {
+
+// metrics.incListOpenFiles(); // TODO: Do we want a counter for this?
+
+ final UserGroupInformation ugi = getRemoteUser();
+ if (!isAdmin(ugi)) {
+ final OMException omEx = new OMException(
+ "Only Ozone admins are allowed to list open files.",
+ PERMISSION_DENIED);
+ AUDIT.logWriteFailure(buildAuditMessageForFailure(
+ OMAction.LIST_OPEN_FILES, new LinkedHashMap<>(), omEx));
+ throw omEx;
+ }
+
+ final String dbOpenKeyPrefix;
+ final Table<String, OmKeyInfo> openKeyTable;
+ if (path == null || path.isEmpty() || path.equals(OM_KEY_PREFIX)) {
Review Comment:
IMO it is more flexible (in terms of not having to break protobuf msg) to
parse it on the server side.
--
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]