This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new c365aa025f HDDS-11181. Cleanup of unnecessary try-catch blocks (#7210)
c365aa025f is described below

commit c365aa025fafdca042d920b7292fd6828b083a3f
Author: Nandakumar Vadivelu <[email protected]>
AuthorDate: Tue Sep 17 22:42:31 2024 +0530

    HDDS-11181. Cleanup of unnecessary try-catch blocks (#7210)
---
 .../OzoneManagerProtocolClientSideTranslatorPB.java    |  8 ++------
 .../org/apache/hadoop/ozone/om/OzoneManagerUtils.java  |  8 ++------
 .../org/apache/hadoop/ozone/s3/OzoneClientCache.java   |  2 --
 .../apache/hadoop/ozone/freon/RandomKeyGenerator.java  | 18 +++---------------
 .../hadoop/ozone/shell/volume/DeleteVolumeHandler.java |  6 +-----
 5 files changed, 8 insertions(+), 34 deletions(-)

diff --git 
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
 
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
index bdd1428b16..432b55051d 100644
--- 
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
+++ 
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
@@ -2117,12 +2117,8 @@ public final class 
OzoneManagerProtocolClientSideTranslatorPB
         .setGetFileStatusRequest(req)
         .build();
 
-    final GetFileStatusResponse resp;
-    try {
-      resp = handleError(submitRequest(omRequest)).getGetFileStatusResponse();
-    } catch (IOException e) {
-      throw e;
-    }
+    final GetFileStatusResponse resp = handleError(submitRequest(omRequest))
+        .getGetFileStatusResponse();
     return OzoneFileStatus.getFromProtobuf(resp.getStatus());
   }
 
diff --git 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerUtils.java
 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerUtils.java
index 5a4ff64315..2301bbbdbf 100644
--- 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerUtils.java
+++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerUtils.java
@@ -164,12 +164,8 @@ public final class OzoneManagerUtils {
        * buck-src has the actual BucketLayout that will be used by the
        * links.
        */
-      try {
-        return resolveBucketInfoLink(metadataManager,
-            buckInfo.getSourceVolume(), buckInfo.getSourceBucket(), visited);
-      } catch (IOException e) {
-        throw e;
-      }
+      return resolveBucketInfoLink(metadataManager, buckInfo.getSourceVolume(),
+          buckInfo.getSourceBucket(), visited);
     }
     return buckInfo;
   }
diff --git 
a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/OzoneClientCache.java
 
b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/OzoneClientCache.java
index 4f08527668..7614c4933a 100644
--- 
a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/OzoneClientCache.java
+++ 
b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/OzoneClientCache.java
@@ -154,8 +154,6 @@ public final class OzoneClientCache {
         }
       } catch (CertificateException ce) {
         throw new IOException(ce);
-      } catch (IOException e) {
-        throw e;
       } finally {
         if (certClient != null) {
           certClient.close();
diff --git 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java
 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java
index c964676f26..58b62d22b9 100644
--- 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java
+++ 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java
@@ -355,11 +355,7 @@ public final class RandomKeyGenerator implements 
Callable<Void> {
     // wait until all keys are added or exception occurred.
     while ((numberOfKeysAdded.get() != totalKeyCount)
            && exception == null) {
-      try {
-        Thread.sleep(CHECK_INTERVAL_MILLIS);
-      } catch (InterruptedException e) {
-        throw e;
-      }
+      Thread.sleep(CHECK_INTERVAL_MILLIS);
     }
     executor.shutdown();
     executor.awaitTermination(Integer.MAX_VALUE, TimeUnit.MILLISECONDS);
@@ -373,11 +369,7 @@ public final class RandomKeyGenerator implements 
Callable<Void> {
 
     if (validateExecutor != null) {
       while (!validationQueue.isEmpty()) {
-        try {
-          Thread.sleep(CHECK_INTERVAL_MILLIS);
-        } catch (InterruptedException e) {
-          throw e;
-        }
+        Thread.sleep(CHECK_INTERVAL_MILLIS);
       }
       validateExecutor.shutdown();
       validateExecutor.awaitTermination(Integer.MAX_VALUE,
@@ -421,11 +413,7 @@ public final class RandomKeyGenerator implements 
Callable<Void> {
       // wait until all Buckets are cleaned or exception occurred.
       while ((numberOfBucketsCleaned.get() != totalBucketCount)
           && exception == null) {
-        try {
-          Thread.sleep(CHECK_INTERVAL_MILLIS);
-        } catch (InterruptedException e) {
-          throw e;
-        }
+        Thread.sleep(CHECK_INTERVAL_MILLIS);
       }
     } catch (InterruptedException e) {
       LOG.error("Failed to wait until all Buckets are cleaned", e);
diff --git 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
index 8cc8050238..0027031073 100644
--- 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
+++ 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
@@ -227,11 +227,7 @@ public class DeleteVolumeHandler extends VolumeHandler {
       // wait until all Buckets are cleaned or exception occurred.
       while (numberOfBucketsCleaned.get() != totalBucketCount
           && exception == null) {
-        try {
-          Thread.sleep(100);
-        } catch (InterruptedException e) {
-          throw e;
-        }
+        Thread.sleep(100);
       }
     } catch (InterruptedException e) {
       LOG.error("Failed to wait until all Buckets are cleaned", e);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to