adoroszlai commented on code in PR #9427:
URL: https://github.com/apache/ozone/pull/9427#discussion_r2605598726


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/PrefixManagerImpl.java:
##########
@@ -235,33 +235,35 @@ public OMPrefixAclOpResult addAcl(OzoneObj ozoneObj, 
OzoneAcl ozoneAcl,
     // No explicit prefix create API, both add/set Acl can get new prefix
     // created. When new prefix is created, it should inherit parent prefix
     // or bucket default ACLs.
-    boolean newPrefix = false;
-    if (prefixInfo == null) {
-      OmPrefixInfo.Builder prefixInfoBuilder =
-          new OmPrefixInfo.Builder()
-          .setName(ozoneObj.getPath());
-      if (transactionLogIndex > 0) {
-        prefixInfoBuilder.setObjectID(OmUtils.getObjectIdFromTxId(
-            metadataManager.getOmEpoch(), transactionLogIndex));
-        prefixInfoBuilder.setUpdateID(transactionLogIndex);
-      }
-      prefixInfo = prefixInfoBuilder.build();
-      newPrefix = true;
+    boolean newPrefix = prefixInfo == null;
+    OmPrefixInfo.Builder prefixInfoBuilder = newPrefix
+        ? new OmPrefixInfo.Builder().setName(ozoneObj.getPath())

Review Comment:
   nit: please use `OmPrefixInfo.newBuilder()` (also in `setAcl`)



##########
hadoop-ozone/interface-storage/src/main/java/org/apache/hadoop/ozone/om/helpers/OmPrefixInfo.java:
##########
@@ -157,6 +168,14 @@ protected void validate() {
     protected OmPrefixInfo buildObject() {
       return new OmPrefixInfo(this);
     }
+
+    @Override
+    public Map<String, String> toAuditMap() {
+      Map<String, String> auditMap = new LinkedHashMap<>();
+      auditMap.put(OzoneConsts.OBJECT_ID, String.valueOf(this.getObjectID()));
+      auditMap.put(OzoneConsts.UPDATE_ID, String.valueOf(this.getUpdateID()));
+      return auditMap;
+    }

Review Comment:
   This seems to be unused.  For now, please remove and restore the TODO 
comment for the class, since it's not strictly related to the task anyway.  
(Some imports will become unused, too.)



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