jojochuang commented on code in PR #5920:
URL: https://github.com/apache/ozone/pull/5920#discussion_r1442143051


##########
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:
   Should the parsing of path be done at client side or OM side? Looking at 
code it is usually done at server side.



##########
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?

Review Comment:
   yeah we should because this call may be potentially one of those that 
destroy OM performance.



-- 
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]

Reply via email to