Skip to content
Open
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 @@ -209,7 +209,7 @@
throw new UnsupportedOperationException("Not yet implemented");
}

public RequestStatus getRequestStatus() throws TException {

Check failure on line 212 in standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/AbstractRequestHandler.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 17 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=apache_hive&issues=AZ4B8YCYzpQtN5oZ92Zk&open=AZ4B8YCYzpQtN5oZ92Zk&pullRequest=6465
String logMsgPrefix = toString();
if (future == null) {
throw new IllegalStateException(logMsgPrefix + " hasn't started yet");
Expand All @@ -232,12 +232,16 @@
// The background handler thread was cancelled
LOG.trace("{} The background handler was cancelled", logMsgPrefix);
} catch (ExecutionException | InterruptedException e) {
// No op, we will deal with this exception later
LOG.error("{} Failed", logMsgPrefix, e);
if (e.getCause() instanceof Exception ex && !aborted.get()) {
throw handleException(ex).throwIfInstance(TException.class).defaultMetaException();
}
String errorMsg = e.getCause() != null ? e.getCause().getMessage() : e.getMessage();
Throwable t = e.getCause() != null ? e.getCause() : e;
if (!(t instanceof TException)) {
LOG.error("{} Failed", logMsgPrefix, t);
} else if (LOG.isDebugEnabled()) {
LOG.debug("{} Failed", logMsgPrefix, t);
}
String errorMsg = t.getMessage();
throw new MetaException(logMsgPrefix + " failed with " + errorMsg);
}
return resp;
Expand Down
Loading
Loading