From d025375c7fcacbeeb5c660feb812caabd52d127d Mon Sep 17 00:00:00 2001 From: zhangduo Date: Thu, 28 Jun 2018 22:00:11 +0800 Subject: [PATCH] HBASE-20810 Include the procedure id in the exception message in HBaseAdmin for better debugging --- .../org/apache/hadoop/hbase/client/HBaseAdmin.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 07e1be4a71b..7f3abea9a30 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -3361,7 +3361,7 @@ public class HBaseAdmin implements Admin { private V result = null; private final HBaseAdmin admin; - private final Long procId; + protected final Long procId; public ProcedureFuture(final HBaseAdmin admin, final Long procId) { this.admin = admin; @@ -3643,22 +3643,20 @@ public class HBaseAdmin implements Admin { * @return a description of the operation */ protected String getDescription() { - return "Operation: " + getOperationType() + ", " - + "Table Name: " + tableName.getNameWithNamespaceInclAsString(); - + return "Operation: " + getOperationType() + ", " + "Table Name: " + + tableName.getNameWithNamespaceInclAsString() + ", procId: " + procId; } protected abstract class TableWaitForStateCallable implements WaitForStateCallable { @Override public void throwInterruptedException() throws InterruptedIOException { - throw new InterruptedIOException("Interrupted while waiting for operation: " - + getOperationType() + " on table: " + tableName.getNameWithNamespaceInclAsString()); + throw new InterruptedIOException("Interrupted while waiting for " + getDescription()); } @Override public void throwTimeoutException(long elapsedTime) throws TimeoutException { - throw new TimeoutException("The operation: " + getOperationType() + " on table: " + - tableName.getNameAsString() + " has not completed after " + elapsedTime + "ms"); + throw new TimeoutException( + getDescription() + " has not completed after " + elapsedTime + "ms"); } }