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:03:27 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 9ebafe6b0 -> 257df19cc


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/257df19c
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/257df19c
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/257df19c

Branch: refs/heads/master
Commit: 257df19cc339a5418036efb3f3c4e7b400614c30
Parents: 9ebafe6
Author: zhangduo <zhangduo@wandoujia.com>
Authored: Thu Jul 16 21:43:47 2015 +0800
Committer: zhangduo <zhangduo@wandoujia.com>
Committed: Fri Jul 17 08:55:20 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 ++++-------
 .../org/apache/hadoop/hbase/util/BloomFilterUtil.java    |  5 -----
 .../java/org/apache/hadoop/hbase/wal/WALSplitter.java    |  3 +--
 7 files changed, 13 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/257df19c/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 de82692..5992b09 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;
@@ -300,7 +301,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/257df19c/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/257df19c/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/257df19c/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/257df19c/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 e1a4304..553d830 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
@@ -198,13 +198,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/257df19c/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterUtil.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterUtil.java
index ff08f4b..dd90b2b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterUtil.java
@@ -192,11 +192,6 @@ public final class BloomFilterUtil {
     return bbf;
   }
 
-  /** Should only be used in tests */
-  public static boolean contains(byte[] buf, int offset, int length, ByteBuffer bloom) {
-    return contains(buf, offset, length, bloom);
-  }
-
   public static boolean contains(byte[] buf, int offset, int length,
       ByteBuffer bloomBuf, int bloomOffset, int bloomSize, Hash hash,
       int hashCount) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/257df19c/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 9a26a24..51043e4 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
@@ -1227,8 +1227,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