hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-17147 Reduce logging in BackupLogCleaner (Vladimir Rodionov)
Date Mon, 05 Dec 2016 18:42:54 GMT
Repository: hbase
Updated Branches:
  refs/heads/HBASE-7912 acd9a7061 -> 89e5b5508


HBASE-17147 Reduce logging in BackupLogCleaner (Vladimir Rodionov)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/89e5b550
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/89e5b550
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/89e5b550

Branch: refs/heads/HBASE-7912
Commit: 89e5b550875a306c443d16840d93ea8abcb7c49d
Parents: acd9a70
Author: tedyu <yuzhihong@gmail.com>
Authored: Mon Dec 5 10:42:47 2016 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Mon Dec 5 10:42:47 2016 -0800

----------------------------------------------------------------------
 .../hbase/backup/impl/BackupSystemTable.java    | 92 ++++++++++----------
 .../hbase/backup/master/BackupLogCleaner.java   |  2 +-
 2 files changed, 47 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/89e5b550/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
index e32d7d4..e04c36e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java
@@ -121,8 +121,8 @@ public final class BackupSystemTable implements Closeable {
    */
   public void updateBackupInfo(BackupInfo context) throws IOException {
 
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("update backup status in hbase:backup for: " + context.getBackupId()
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("update backup status in hbase:backup for: " + context.getBackupId()
           + " set status=" + context.getState());
     }
     try (Table table = connection.getTable(tableName)) {
@@ -139,8 +139,8 @@ public final class BackupSystemTable implements Closeable {
 
   public void deleteBackupInfo(String backupId) throws IOException {
 
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("delete backup status in hbase:backup for " + backupId);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("delete backup status in hbase:backup for " + backupId);
     }
     try (Table table = connection.getTable(tableName)) {
       Delete del = BackupSystemTableHelper.createDeleteForBackupInfo(backupId);
@@ -155,8 +155,8 @@ public final class BackupSystemTable implements Closeable {
    */
 
   public BackupInfo readBackupInfo(String backupId) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("read backup status from hbase:backup for: " + backupId);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("read backup status from hbase:backup for: " + backupId);
     }
 
     try (Table table = connection.getTable(tableName)) {
@@ -178,8 +178,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException exception
    */
   public String readBackupStartCode(String backupRoot) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("read backup start code from hbase:backup");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("read backup start code from hbase:backup");
     }
     try (Table table = connection.getTable(tableName)) {
       Get get = BackupSystemTableHelper.createGetForStartCode(backupRoot);
@@ -203,8 +203,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException exception
    */
   public void writeBackupStartCode(Long startCode, String backupRoot) throws IOException
{
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("write backup start code to hbase:backup " + startCode);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("write backup start code to hbase:backup " + startCode);
     }
     try (Table table = connection.getTable(tableName)) {
       Put put = BackupSystemTableHelper.createPutForStartCode(startCode.toString(), backupRoot);
@@ -220,8 +220,8 @@ public final class BackupSystemTable implements Closeable {
    */
   public HashMap<String, Long> readRegionServerLastLogRollResult(String backupRoot)
       throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("read region server last roll log result to hbase:backup");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("read region server last roll log result to hbase:backup");
     }
 
     Scan scan = BackupSystemTableHelper.createScanForReadRegionServerLastLogRollResult(backupRoot);
@@ -252,8 +252,8 @@ public final class BackupSystemTable implements Closeable {
    */
   public void writeRegionServerLastLogRollResult(String server, Long ts, String backupRoot)
       throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("write region server last roll log result to hbase:backup");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("write region server last roll log result to hbase:backup");
     }
     try (Table table = connection.getTable(tableName)) {
       Put put =
@@ -269,8 +269,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException exception
    */
   public ArrayList<BackupInfo> getBackupHistory(boolean onlyCompleted) throws IOException
{
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("get backup history from hbase:backup");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("get backup history from hbase:backup");
     }
     ArrayList<BackupInfo> list;
     BackupState state = onlyCompleted ? BackupState.COMPLETE : BackupState.ANY;
@@ -402,8 +402,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException exception
    */
   public ArrayList<BackupInfo> getBackupContexts(BackupState status) throws IOException
{
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("get backup contexts from hbase:backup");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("get backup contexts from hbase:backup");
     }
 
     Scan scan = BackupSystemTableHelper.createScanForBackupHistory();
@@ -434,8 +434,8 @@ public final class BackupSystemTable implements Closeable {
    */
   public void writeRegionServerLogTimestamp(Set<TableName> tables,
       HashMap<String, Long> newTimestamps, String backupRoot) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("write RS log time stamps to hbase:backup for tables ["
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("write RS log time stamps to hbase:backup for tables ["
           + StringUtils.join(tables, ",") + "]");
     }
     List<Put> puts = new ArrayList<Put>();
@@ -462,8 +462,8 @@ public final class BackupSystemTable implements Closeable {
    */
   public HashMap<TableName, HashMap<String, Long>> readLogTimestampMap(String
backupRoot)
       throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("read RS log ts from hbase:backup for root=" + backupRoot);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("read RS log ts from hbase:backup for root=" + backupRoot);
     }
 
     HashMap<TableName, HashMap<String, Long>> tableTimestampMap =
@@ -532,8 +532,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException exception
    */
   public Set<TableName> getIncrementalBackupTableSet(String backupRoot) throws IOException
{
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("get incr backup table set from hbase:backup");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("get incremental backup table set from hbase:backup");
     }
     TreeSet<TableName> set = new TreeSet<>();
 
@@ -560,8 +560,8 @@ public final class BackupSystemTable implements Closeable {
    */
   public void addIncrementalBackupTableSet(Set<TableName> tables, String backupRoot)
       throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Add incremental backup table set to hbase:backup. ROOT=" + backupRoot
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("Add incremental backup table set to hbase:backup. ROOT=" + backupRoot
           + " tables [" + StringUtils.join(tables, " ") + "]");
       for (TableName table : tables) {
         LOG.debug(table);
@@ -579,8 +579,8 @@ public final class BackupSystemTable implements Closeable {
    */
 
   public void deleteIncrementalBackupTableSet(String backupRoot) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Delete incremental backup table set to hbase:backup. ROOT=" + backupRoot);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("Delete incremental backup table set to hbase:backup. ROOT=" + backupRoot);
     }
     try (Table table = connection.getTable(tableName)) {
       Delete delete = BackupSystemTableHelper.createDeleteForIncrBackupTableSet(backupRoot);
@@ -597,8 +597,8 @@ public final class BackupSystemTable implements Closeable {
    */
   public void addWALFiles(List<String> files, String backupId, String backupRoot)
       throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("add WAL files to hbase:backup: " + backupId + " " + backupRoot + " files
["
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("add WAL files to hbase:backup: " + backupId + " " + backupRoot + " files
["
           + StringUtils.join(files, ",") + "]");
       for (String f : files) {
         LOG.debug("add :" + f);
@@ -617,8 +617,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException exception
    */
   public Iterator<WALItem> getWALFilesIterator(String backupRoot) throws IOException
{
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("get WAL files from hbase:backup");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("get WAL files from hbase:backup");
     }
     final Table table = connection.getTable(tableName);
     Scan scan = BackupSystemTableHelper.createScanForGetWALs(backupRoot);
@@ -676,8 +676,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException exception
    */
   public boolean isWALFileDeletable(String file) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Check if WAL file has been already backed up in hbase:backup " + file);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("Check if WAL file has been already backed up in hbase:backup " + file);
     }
     try (Table table = connection.getTable(tableName)) {
       Get get = BackupSystemTableHelper.createGetForCheckWALFile(file);
@@ -696,8 +696,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException exception
    */
   public boolean hasBackupSessions() throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Has backup sessions from hbase:backup");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("Has backup sessions from hbase:backup");
     }
     boolean result = false;
     Scan scan = BackupSystemTableHelper.createScanForBackupHistory();
@@ -721,8 +721,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException
    */
   public List<String> listBackupSets() throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug(" Backup set list");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace(" Backup set list");
     }
     List<String> list = new ArrayList<String>();
     Table table = null;
@@ -755,8 +755,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException
    */
   public List<TableName> describeBackupSet(String name) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug(" Backup set describe: " + name);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace(" Backup set describe: " + name);
     }
     Table table = null;
     try {
@@ -789,8 +789,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException
    */
   public void addToBackupSet(String name, String[] newTables) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Backup set add: " + name + " tables [" + StringUtils.join(newTables, " ")
+ "]");
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("Backup set add: " + name + " tables [" + StringUtils.join(newTables, " ")
+ "]");
     }
     Table table = null;
     String[] union = null;
@@ -836,8 +836,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException
    */
   public void removeFromBackupSet(String name, String[] toRemove) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug(" Backup set remove from : " + name + " tables [" + StringUtils.join(toRemove,
" ")
+    if (LOG.isTraceEnabled()) {
+      LOG.trace(" Backup set remove from : " + name + " tables [" + StringUtils.join(toRemove,
" ")
           + "]");
     }
     Table table = null;
@@ -892,8 +892,8 @@ public final class BackupSystemTable implements Closeable {
    * @throws IOException
    */
   public void deleteBackupSet(String name) throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug(" Backup set delete: " + name);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace(" Backup set delete: " + name);
     }
     Table table = null;
     try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/89e5b550/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
index dbea917..7251a3f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
@@ -86,7 +86,7 @@ public class BackupLogCleaner extends BaseLogCleanerDelegate {
       // If we do not have recorded backup sessions
       try {
         if (!table.hasBackupSessions()) {
-          LOG.debug("BackupLogCleaner has no backup sessions");
+          LOG.trace("BackupLogCleaner has no backup sessions");
           return files;
         }
       } catch (TableNotFoundException tnfe) {


Mime
View raw message