Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11181. Cleanup of unnecessary try-catch block. #7210

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2117,12 +2117,8 @@ public OzoneFileStatus getFileStatus(OmKeyArgs args) throws IOException {
.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());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,8 @@ private static OmBucketInfo resolveBucketInfoLink(
* 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ private void setCertificate(String omServiceID,
}
} catch (CertificateException ce) {
throw new IOException(ce);
} catch (IOException e) {
throw e;
} finally {
if (certClient != null) {
certClient.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,7 @@ public Void call() throws Exception {
// 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);
Expand All @@ -373,11 +369,7 @@ public Void call() throws Exception {

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,
Expand Down Expand Up @@ -421,11 +413,7 @@ private void doCleanObjects() throws InterruptedException {
// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,7 @@ private void doCleanBuckets() throws InterruptedException {
// 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);
Expand Down