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


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSBucketLayout.java:
##########
@@ -116,19 +118,21 @@ public static void initCluster() throws Exception {
         .setNumDatanodes(3)
         .build();
     cluster.waitForClusterToBeReady();
-    objectStore = cluster.getClient().getObjectStore();
+    client = cluster.getClient();
+    objectStore = client.getObjectStore();
     rootPath = String.format("%s://%s/",
         OzoneConsts.OZONE_OFS_URI_SCHEME, conf.get(OZONE_OM_ADDRESS_KEY));
 
     // create a volume and a bucket to be used by RootedOzoneFileSystem (OFS)
     volumeName =
-        TestDataUtil.createVolumeAndBucket(cluster)
+        TestDataUtil.createVolumeAndBucket(client)
             .getVolumeName();
     volumePath = new Path(OZONE_URI_DELIMITER, volumeName);
   }
 
   @AfterClass
   public static void teardown() throws IOException {
+    IOUtils.closeQuietly(client);

Review Comment:
   Since `client` is declared as `OzoneClient`, it will be a `null` instance of 
that type.
   
   Added a test (with `ByteArrayOutputStream` as `hdds-common` doesn't know 
`OzoneClient`) to verify.
   
   Also added `null` check for array.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java:
##########
@@ -178,15 +178,6 @@ void waitForPipelineTobeReady(HddsProtos.ReplicationFactor 
factor,
    */
   OzoneClient getClient() throws IOException;

Review Comment:
   Great idea.



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