sadanand48 commented on code in PR #7285:
URL: https://github.com/apache/ozone/pull/7285#discussion_r1793470124
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java:
##########
@@ -2230,7 +2236,17 @@ void testFileSystemWithObjectStoreLayout() throws
IOException {
OzoneConfiguration config = new OzoneConfiguration(fs.getConf());
config.set(FS_DEFAULT_NAME_KEY, obsRootPath);
- IllegalArgumentException e =
assertThrows(IllegalArgumentException.class, () -> FileSystem.get(config));
+ IllegalArgumentException e =
+ assertThrows(IllegalArgumentException.class, () -> {
+ FileSystem fileSystem = null;
+ try {
+ fileSystem = FileSystem.get(config);
+ } finally {
+ if (fileSystem != null) {
+ fileSystem.close();
+ }
+ }
Review Comment:
Done, thanks.
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java:
##########
@@ -193,18 +193,24 @@ public BasicOzoneClientAdapterImpl(String omHost, int
omPort,
OzoneClientFactory.getRpcClient(conf);
}
objectStore = ozoneClient.getObjectStore();
- this.volume = objectStore.getVolume(volumeStr);
- this.bucket = volume.getBucket(bucketStr);
- bucketReplicationConfig = this.bucket.getReplicationConfig();
- nextReplicationConfigRefreshTime =
- clock.millis() + bucketRepConfigRefreshPeriodMS;
-
- // resolve the bucket layout in case of Link Bucket
- BucketLayout resolvedBucketLayout =
- OzoneClientUtils.resolveLinkBucketLayout(bucket, objectStore,
- new HashSet<>());
-
- OzoneFSUtils.validateBucketLayout(bucket.getName(), resolvedBucketLayout);
+ try {
+ this.volume = objectStore.getVolume(volumeStr);
+ this.bucket = volume.getBucket(bucketStr);
+ bucketReplicationConfig = this.bucket.getReplicationConfig();
+ nextReplicationConfigRefreshTime = clock.millis() +
bucketRepConfigRefreshPeriodMS;
+
+ // resolve the bucket layout in case of Link Bucket
+ BucketLayout resolvedBucketLayout =
+ OzoneClientUtils.resolveLinkBucketLayout(bucket, objectStore, new
HashSet<>());
+
+ OzoneFSUtils.validateBucketLayout(bucket.getName(),
resolvedBucketLayout);
+ } catch (IOException | IllegalArgumentException exception) {
Review Comment:
Done.
--
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]