You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/02/03 17:55:33 UTC
[GitHub] [ozone] adoroszlai commented on a change in pull request #3040: HDDS-6245. Add BucketLayout logging to Audit Logs
adoroszlai commented on a change in pull request #3040:
URL: https://github.com/apache/ozone/pull/3040#discussion_r798827131
##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ResolvedBucket.java
##########
@@ -108,4 +117,25 @@ public boolean isLink() {
return auditMap;
}
+ /**
+ * Adds audit information about the bucket and its bucket layout (and if it's
+ * a link, then the real bucket, too) to {@code auditMap}.
+ *
+ * @return the same map for convenience
+ */
+ public Map<String, String> auditWithBucketLayout(Map<String, String> auditMap,
+ OzoneManager om) {
+ audit(auditMap);
+ try {
+ // Add BucketLayout to auditMap from the resolved Bucket.
+ auditMap.put(OzoneConsts.BUCKET_LAYOUT, String.valueOf(
+ om.getBucketInfo(realVolume(), realBucket()).getBucketLayout()
Review comment:
I would definitely avoid passing around OM and having to look up bucket info.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org