ivandika3 commented on code in PR #5941:
URL: https://github.com/apache/ozone/pull/5941#discussion_r1468521154


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/OMRequestTestUtils.java:
##########
@@ -1623,4 +1625,55 @@ public static OMRequest 
createRequestWithS3Credentials(String accessId,
         .build();
   }
 
+  /**
+   * Add key entry to PrefixTable.
+   * @throws Exception
+   */
+  public static void addPrefixToTable(String volumeName, String bucketName, 
String prefixName, long trxnLogIndex,
+      OMMetadataManager omMetadataManager) throws Exception {
+
+    OmPrefixInfo omPrefixInfo = createOmPrefixInfo(volumeName, bucketName,
+        prefixName, trxnLogIndex);
+
+    addPrefixToTable(false, omPrefixInfo, trxnLogIndex,
+        omMetadataManager);
+  }
+
+  /**
+   * Add key entry to PrefixTable.
+   * @throws Exception
+   */
+  public static void addPrefixToTable(boolean addToCache, OmPrefixInfo 
omPrefixInfo, long trxnLogIndex,
+      OMMetadataManager omMetadataManager) throws Exception {
+    String prefixName = omPrefixInfo.getName();
+
+    if (addToCache) {
+      omMetadataManager.getPrefixTable()
+          .addCacheEntry(new CacheKey<>(omPrefixInfo.getName()),
+              new CacheValue<>(Optional.of(omPrefixInfo), trxnLogIndex));

Review Comment:
   Thanks for the review. Updated. 
   
   I also find some in my previous patches 
(`S3ExpiredMultipartUploadsAbortRequest`). Maybe since `CacheValue` is an 
internal class we can instead remove it entirely?



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/OMRequestTestUtils.java:
##########
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.UUID;
 
+import com.google.common.base.Optional;

Review Comment:
   Updated.



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