chungen0126 commented on code in PR #10600:
URL: https://github.com/apache/ozone/pull/10600#discussion_r3476432573


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java:
##########
@@ -208,27 +210,49 @@ private int runChunkInfoCommand(String volumeName, String 
bucketName,
 
   private int runChunkInfoAndVerifyPaths(String volumeName, String bucketName,
       String keyName) throws Exception {
-    int exitCode = 1;
-    try (GenericTestUtils.SystemOutCapturer capture = new GenericTestUtils
-        .SystemOutCapturer()) {
-      exitCode = runChunkInfoCommand(volumeName, bucketName, keyName);
-      Set<String> blockFilePaths = new HashSet<>();
-      String output = capture.getOutput();
-      ObjectMapper objectMapper = new ObjectMapper();
-      // Parse the JSON array string into a JsonNode
-      JsonNode jsonNode = objectMapper.readTree(output);
-      JsonNode keyLocations = jsonNode.get("keyLocations").get(0);
-      for (JsonNode element : keyLocations) {
-        String fileName =
-            element.get("file").toString();
-        blockFilePaths.add(fileName);
-      }
-      // DN storage directories are set differently for each DN
-      // in MiniOzoneCluster as datanode-0,datanode-1,datanode-2 which is why
-      // we expect 3 paths here in the set.
-      assertEquals(3, blockFilePaths.size());
+    AtomicInteger exitCode = new AtomicInteger(1);
+    AtomicInteger lastPathCount = new AtomicInteger(-1);
+    AtomicReference<Throwable> lastError = new AtomicReference<>();

Review Comment:
   Thanks @chihsuan for working on this. I don't think these three variables 
need to be atomic. Could you walk me through the reasoning behind using atomic 
here?



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