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


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/response/snapshot/TestOMSnapshotMoveTableKeysResponse.java:
##########
@@ -163,10 +164,18 @@ public void testMoveTableKeysToNextSnapshot(boolean 
nextSnapshotExists) throws E
               
.setCmdType(OzoneManagerProtocolProtos.Type.SnapshotMoveTableKeys).build(),
           snapshotInfo1, nextSnapshotExists ? snapshotInfo2 : null, 
omBucketInfo.getObjectID(), deletedTable,
           deletedDirTable, renamedTable);
-      try (BatchOperation batchOperation = 
getOmMetadataManager().getStore().initBatchOperation()) {
-        response.addToDBBatch(getOmMetadataManager(), batchOperation);
-        getOmMetadataManager().getStore().commitBatchOperation(batchOperation);
-      }
+      CompletableFuture<Void> future = new CompletableFuture<>();
+      CompletableFuture.runAsync(() -> {
+        try (BatchOperation batchOperation = 
getOmMetadataManager().getStore().initBatchOperation()) {
+          response.addToDBBatch(getOmMetadataManager(), batchOperation);
+          
getOmMetadataManager().getStore().commitBatchOperation(batchOperation);
+        } catch (IOException e) {
+          future.completeExceptionally(e);
+          return;
+        }
+        future.complete(null);
+      });
+      future.get();

Review Comment:
   i don't understand this change. It made the original code asynchronous but 
then it waits for the result to return, so it has essentially the same effect?



##########
hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneManagerLock.java:
##########
@@ -122,20 +129,31 @@ void testLockingOrder() {
 
   @ParameterizedTest
   @EnumSource
-  public void testFlatLockWithParallelResource(FlatResource flatResource) {
+  public void testDAGLockWithParallelResource(DAGLeveledResource 
dagLeveledResource) {
+    Map<DAGLeveledResource, Set<Resource>> forbiddenLockOrdering =
+        ImmutableMap.of(SNAPSHOT_DB_CONTENT_LOCK, 
ImmutableSet.of(DAGLeveledResource.SNAPSHOT_DB_LOCK,
+            SNAPSHOT_LOCAL_DATA_LOCK));
     OzoneManagerLock lock = new OzoneManagerLock(new OzoneConfiguration());
     List<Resource> resources = new ArrayList<>();
     
resources.addAll(Arrays.stream(LeveledResource.values()).collect(Collectors.toList()));
-    
resources.addAll(Arrays.stream(FlatResource.values()).collect(Collectors.toList()));
+    
resources.addAll(Arrays.stream(dagLeveledResource.values()).collect(Collectors.toList()));
     for (Resource otherResource : resources) {
       String[] otherResourceName = generateResourceName(otherResource);
-      String[] flatResourceName = generateResourceName(flatResource);
+      String[] flatResourceName = generateResourceName(dagLeveledResource);

Review Comment:
   nit update variable name
   ```suggestion
         String[] dagResourceName = generateResourceName(dagLeveledResource);
   ```



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