You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by el...@apache.org on 2018/12/07 22:29:14 UTC
[31/51] [abbrv] hbase git commit: HBASE-21523 Avoid extra logging
when the backup system table already exists
HBASE-21523 Avoid extra logging when the backup system table already exists
Signed-off-by: Peter Somogyi <ps...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/fdddc47e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/fdddc47e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/fdddc47e
Branch: refs/heads/HBASE-20952
Commit: fdddc47e77d57ce1a95d9c194655f0a86d589124
Parents: 8a68f0d
Author: Josh Elser <el...@apache.org>
Authored: Wed Nov 28 21:56:10 2018 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Thu Nov 29 11:40:28 2018 -0500
----------------------------------------------------------------------
.../apache/hadoop/hbase/backup/impl/BackupSystemTable.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/fdddc47e/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
----------------------------------------------------------------------
diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
index d177384..94ccfe5 100644
--- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
+++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
@@ -229,8 +229,14 @@ public final class BackupSystemTable implements Closeable {
}
private void waitForSystemTable(Admin admin, TableName tableName) throws IOException {
+ // Return fast if the table is available and avoid a log message
+ if (admin.tableExists(tableName) && admin.isTableAvailable(tableName)) {
+ return;
+ }
long TIMEOUT = 60000;
long startTime = EnvironmentEdgeManager.currentTime();
+ LOG.debug("Backup table {} is not present and available, waiting for it to become so",
+ tableName);
while (!admin.tableExists(tableName) || !admin.isTableAvailable(tableName)) {
try {
Thread.sleep(100);
@@ -241,7 +247,7 @@ public final class BackupSystemTable implements Closeable {
"Failed to create backup system table " + tableName + " after " + TIMEOUT + "ms");
}
}
- LOG.debug("Backup table " + tableName + " exists and available");
+ LOG.debug("Backup table {} exists and available", tableName);
}
@Override