diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Deadline.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Deadline.java index 2e00005..1167ebb 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Deadline.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Deadline.java @@ -155,18 +155,14 @@ public static void checkTimeout() throws MetaException { private static final long NO_DEADLINE = Long.MIN_VALUE; private void check() throws MetaException{ - try { - if (startTime == NO_DEADLINE) { - throw new DeadlineException("Should execute startTimer() method before " + - "checkTimeout. Error happens in method: " + method); - } - long elapsedTime = System.nanoTime() - startTime; - if (elapsedTime > timeoutNanos) { - throw new DeadlineException("Timeout when executing method: " + method + "; " - + (elapsedTime / 1000000L) + "ms exceeds " + (timeoutNanos / 1000000L) + "ms"); - } - } catch (DeadlineException e) { - throw MetaStoreUtils.newMetaException(e); + if (startTime == NO_DEADLINE) { + throw MetaStoreUtils.newMetaException(new DeadlineException("Should execute startTimer() method before " + + "checkTimeout. Error happens in method: " + method)); + } + long elapsedTime = System.nanoTime() - startTime; + if (elapsedTime > timeoutNanos) { + throw MetaStoreUtils.newMetaException(new DeadlineException("Timeout when executing method: " + method + "; " + + (elapsedTime / 1000000L) + "ms exceeds " + (timeoutNanos / 1000000L) + "ms")); } } }