hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject hbase git commit: HBASE-14100 Fix high priority findbugs warnings
Date Fri, 17 Jul 2015 01:04:15 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 5bb840c83 -> ca57ef2cf


HBASE-14100 Fix high priority findbugs warnings


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

Branch: refs/heads/branch-1.2
Commit: ca57ef2cf2c4212c592afc4c182cb86d84fc0c77
Parents: 5bb840c
Author: zhangduo <zhangduo@wandoujia.com>
Authored: Thu Jul 16 21:43:47 2015 +0800
Committer: zhangduo <zhangduo@wandoujia.com>
Committed: Fri Jul 17 08:57:05 2015 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/master/SplitLogManager.java  |  4 +++-
 .../hbase/master/normalizer/SimpleRegionNormalizer.java  |  2 +-
 .../hadoop/hbase/quotas/AverageIntervalRateLimiter.java  |  2 ++
 .../hadoop/hbase/quotas/FixedIntervalRateLimiter.java    |  2 ++
 .../java/org/apache/hadoop/hbase/quotas/RateLimiter.java | 11 ++++-------
 .../java/org/apache/hadoop/hbase/wal/WALSplitter.java    |  3 +--
 6 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ca57ef2c/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
index 103947a..5d8be58 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
@@ -27,6 +27,7 @@ import static org.apache.hadoop.hbase.master.SplitLogManager.TerminationStatus.S
 import java.io.IOException;
 import java.io.InterruptedIOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -299,7 +300,8 @@ public class SplitLogManager {
         FileStatus[] files = fs.listStatus(logDir);
         if (files != null && files.length > 0) {
           LOG.warn("Returning success without actually splitting and "
-              + "deleting all the log files in path " + logDir + ": " + files, ioe);
+              + "deleting all the log files in path " + logDir + ": "
+              + Arrays.toString(files), ioe);
         } else {
           LOG.warn("Unable to delete log src dir. Ignoring. " + logDir, ioe);
         }

http://git-wip-us.apache.org/repos/asf/hbase/blob/ca57ef2c/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
index 75989d5..8971664 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
@@ -150,7 +150,7 @@ public class SimpleRegionNormalizer implements RegionNormalizer {
     // is more high priority normalization action than merge.
     if (largestRegion.getSecond() > 2 * avgRegionSize) {
       LOG.debug("Table " + table + ", largest region "
-        + largestRegion.getFirst().getRegionName() + " has size "
+        + largestRegion.getFirst().getRegionNameAsString() + " has size "
         + largestRegion.getSecond() + ", more than 2 times than avg size, splitting");
       return new SplitNormalizationPlan(largestRegion.getFirst(), null);
     } else {

http://git-wip-us.apache.org/repos/asf/hbase/blob/ca57ef2c/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/AverageIntervalRateLimiter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/AverageIntervalRateLimiter.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/AverageIntervalRateLimiter.java
index 1fb721a..75e6aea 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/AverageIntervalRateLimiter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/AverageIntervalRateLimiter.java
@@ -53,11 +53,13 @@ public class AverageIntervalRateLimiter extends RateLimiter {
 
   // This method is for strictly testing purpose only
   @VisibleForTesting
+  @Override
   public void setNextRefillTime(long nextRefillTime) {
     this.nextRefillTime = nextRefillTime;
   }
 
   @VisibleForTesting
+  @Override
   public long getNextRefillTime() {
     return this.nextRefillTime;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/ca57ef2c/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FixedIntervalRateLimiter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FixedIntervalRateLimiter.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FixedIntervalRateLimiter.java
index 475f778..5eb7e13 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FixedIntervalRateLimiter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FixedIntervalRateLimiter.java
@@ -45,11 +45,13 @@ public class FixedIntervalRateLimiter extends RateLimiter {
 
   // This method is for strictly testing purpose only
   @VisibleForTesting
+  @Override
   public void setNextRefillTime(long nextRefillTime) {
     this.nextRefillTime = nextRefillTime;
   }
 
   @VisibleForTesting
+  @Override
   public long getNextRefillTime() {
     return this.nextRefillTime;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/ca57ef2c/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RateLimiter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RateLimiter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RateLimiter.java
index e359601..45089e8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RateLimiter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RateLimiter.java
@@ -191,13 +191,10 @@ public abstract class RateLimiter {
     return (amount <= avail) ? 0 : getWaitInterval(limit, avail, amount);
   }
 
-  // This method is for strictly testing purpose only
+  // These two method are for strictly testing purpose only
   @VisibleForTesting
-  public void setNextRefillTime(long nextRefillTime) {
-    this.setNextRefillTime(nextRefillTime);
-  }
+  public abstract void setNextRefillTime(long nextRefillTime);
 
-  public long getNextRefillTime() {
-    return this.getNextRefillTime();
-  }
+  @VisibleForTesting
+  public abstract long getNextRefillTime();
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/ca57ef2c/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java
index 4958bde..7fed610 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java
@@ -1235,8 +1235,7 @@ public class WALSplitter {
         }
       }
       controller.checkForErrors();
-      LOG.info((this.writerThreads == null? 0: this.writerThreads.size()) +
-        " split writers finished; closing...");
+      LOG.info(this.writerThreads.size() + " split writers finished; closing...");
       return (!progress_failed);
     }
 


Mime
View raw message