hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject git commit: HBASE-11921 Minor fixups that come of testing branch-1 (Stack)
Date Tue, 09 Sep 2014 19:05:57 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 0259d2734 -> f7bcf3df6


HBASE-11921 Minor fixups that come of testing branch-1 (Stack)


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

Branch: refs/heads/master
Commit: f7bcf3df6bb439888e2d47d941149dcb8aeadd17
Parents: 0259d27
Author: Enis Soztutar <enis@apache.org>
Authored: Tue Sep 9 12:05:43 2014 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Tue Sep 9 12:05:43 2014 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/client/AsyncProcess.java   |  6 +++---
 .../hadoop/hbase/client/RetryingCallable.java      |  1 -
 .../hbase/client/ScannerCallableWithReplicas.java  | 17 +++++++++--------
 .../org/apache/hadoop/hbase/util/ChecksumType.java |  6 +++---
 .../org/apache/hadoop/hbase/io/hfile/HFile.java    |  1 +
 .../hadoop/hbase/regionserver/HRegionServer.java   |  2 +-
 .../hadoop/hbase/regionserver/StoreFile.java       |  5 -----
 .../apache/hadoop/hbase/io/hfile/TestChecksum.java |  2 --
 .../hadoop/hbase/io/hfile/TestHFileBlock.java      |  4 ----
 .../hadoop/hbase/io/hfile/TestHFileBlockIndex.java |  1 -
 10 files changed, 17 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
index 34136e9..f8cdb57 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
@@ -1204,7 +1204,7 @@ class AsyncProcess {
         .append("/").append(numTries).append(" ");
 
       if (failureCount > 0 || error != null){
-        sb.append("failed ").append(failureCount).append(" ops").append(", last exception:
").
+        sb.append("failed=").append(failureCount).append("ops").append(", last exception:
").
             append(error == null ? "null" : error);
       } else {
         sb.append("succeeded");
@@ -1213,8 +1213,8 @@ class AsyncProcess {
       sb.append(" on ").append(sn).append(", tracking started ").append(startTime);
 
       if (willRetry) {
-        sb.append(", retrying after ").append(backOffTime).append(" ms").
-            append(", replay ").append(replaySize).append(" ops");
+        sb.append(", retrying after=").append(backOffTime).append("ms").
+            append(", replay=").append(replaySize).append("ops");
       } else if (failureCount > 0) {
         if (stopped > 0) {
           sb.append("; not retrying ").append(stopped).append(" due to success from other
replica");

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetryingCallable.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetryingCallable.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetryingCallable.java
index 5bc6c1a..29c58af 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetryingCallable.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetryingCallable.java
@@ -20,7 +20,6 @@
 package org.apache.hadoop.hbase.client;
 
 import java.io.IOException;
-import java.util.concurrent.Callable;
 
 import org.apache.hadoop.classification.InterfaceAudience;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java
index fc7c347..6e1e8f7 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java
@@ -53,7 +53,6 @@ import org.apache.hadoop.hbase.util.Pair;
  * in which case, the other replicas are queried (as in (3) above).
  *
  */
-
 @InterfaceAudience.Private
 class ScannerCallableWithReplicas implements RetryingCallable<Result[]> {
   private final Log LOG = LogFactory.getLog(this.getClass());
@@ -115,8 +114,8 @@ class ScannerCallableWithReplicas implements RetryingCallable<Result[]>
{
     if (currentScannerCallable != null && currentScannerCallable.closed) {
       // For closing we target that exact scanner (and not do replica fallback like in
       // the case of normal reads)
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("Closing scanner " + currentScannerCallable.scannerId);
+      if (LOG.isTraceEnabled()) {
+        LOG.trace("Closing scanner id=" + currentScannerCallable.scannerId);
       }
       Result[] r = currentScannerCallable.call(timeout);
       currentScannerCallable = null;
@@ -211,15 +210,17 @@ class ScannerCallableWithReplicas implements RetryingCallable<Result[]>
{
       // store where to start the replica scanner from if we need to.
       if (result != null && result.length != 0) this.lastResult = result[result.length
- 1];
       if (LOG.isTraceEnabled()) {
-        LOG.trace("Setting current scanner as " + currentScannerCallable.scannerId +
-            " associated with " + currentScannerCallable.getHRegionInfo().getReplicaId());
+        LOG.trace("Setting current scanner as id=" + currentScannerCallable.scannerId +
+            " associated with replica=" + currentScannerCallable.getHRegionInfo().getReplicaId());
       }
       // close all outstanding replica scanners but the one we heard back from
       outstandingCallables.remove(scanner);
       for (ScannerCallable s : outstandingCallables) {
-        if (LOG.isDebugEnabled()) {
-          LOG.debug("Closing scanner " + s.scannerId +
-              " because this was slow and another replica succeeded");
+        if (LOG.isTraceEnabled()) {
+          LOG.trace("Closing scanner id=" + s.scannerId +
+            ", replica=" + s.getHRegionInfo().getRegionId() +
+            " because slow and replica=" +
+            this.currentScannerCallable.getHRegionInfo().getReplicaId() + " succeeded");
         }
         // Submit the "close" to the pool since this might take time, and we don't
         // want to wait for the "close" to happen yet. The "wait" will happen when

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java
index 7de74bd..86af5e7 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java
@@ -65,7 +65,7 @@ public enum ChecksumType {
       // check if hadoop library is available
       try {
         ctor = ChecksumFactory.newConstructor(PURECRC32);
-        LOG.debug("Checksum using " + PURECRC32);
+        LOG.debug(PURECRC32 + " available");
       } catch (Exception e) {
         LOG.trace(PURECRC32 + " not available.");
       }
@@ -74,7 +74,7 @@ public enum ChecksumType {
         // This is available on all JVMs.
         if (ctor == null) {
           ctor = ChecksumFactory.newConstructor(JDKCRC);
-          LOG.debug("Checksum can use " + JDKCRC);
+          LOG.debug(JDKCRC + " available");
         }
       } catch (Exception e) {
         LOG.trace(JDKCRC + " not available.");
@@ -108,7 +108,7 @@ public enum ChecksumType {
       LOG = LogFactory.getLog(ChecksumType.class);
       try {
         ctor = ChecksumFactory.newConstructor(PURECRC32C);
-        LOG.debug("Checksum can use " + PURECRC32C);
+        LOG.debug(PURECRC32C + " available");
       } catch (Exception e) {
         LOG.trace(PURECRC32C + " not available.");
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
index c0dd672..209bd27 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
@@ -180,6 +180,7 @@ public class HFile {
    * The number of bytes per checksum.
    */
   public static final int DEFAULT_BYTES_PER_CHECKSUM = 16 * 1024;
+  // TODO: This define is done in three places.  Fix.
   public static final ChecksumType DEFAULT_CHECKSUM_TYPE = ChecksumType.CRC32;
 
   // For measuring number of checksum failures

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 7947c4a..c5cdacf 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -870,7 +870,7 @@ public class HRegionServer extends HasThread implements
     }
 
     // so callers waiting for meta without timeout can stop
-    metaTableLocator.stop();
+    if (this.metaTableLocator != null) this.metaTableLocator.stop();
     if (this.shortCircuitConnection != null && !shortCircuitConnection.isClosed())
{
       try {
         this.shortCircuitConnection.close();

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
index 6a45c47..26e007a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
@@ -56,7 +56,6 @@ import org.apache.hadoop.hbase.util.BloomFilter;
 import org.apache.hadoop.hbase.util.BloomFilterFactory;
 import org.apache.hadoop.hbase.util.BloomFilterWriter;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.ChecksumType;
 import org.apache.hadoop.hbase.util.Writables;
 import org.apache.hadoop.io.WritableUtils;
 
@@ -704,10 +703,6 @@ public class StoreFile {
     private KeyValue lastDeleteFamilyKV = null;
     private long deleteFamilyCnt = 0;
 
-
-    /** Checksum type */
-    protected ChecksumType checksumType;
-
     /** Bytes per Checksum */
     protected int bytesPerChecksum;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java
index 020a293..20a450c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java
@@ -93,7 +93,6 @@ public class TestChecksum {
                             .withCompression(algo)
                             .withIncludesMvcc(true)
                             .withIncludesTags(useTags)
-                            .withChecksumType(HFile.DEFAULT_CHECKSUM_TYPE)
                             .withBytesPerCheckSum(HFile.DEFAULT_BYTES_PER_CHECKSUM)
                             .build();
         HFileBlock.Writer hbw = new HFileBlock.Writer(null, meta);
@@ -202,7 +201,6 @@ public class TestChecksum {
                             .withIncludesTags(useTags)
                             .withHBaseCheckSum(true)
                             .withBytesPerCheckSum(bytesPerChecksum)
-                            .withChecksumType(HFile.DEFAULT_CHECKSUM_TYPE)
                             .build();
         HFileBlock.Writer hbw = new HFileBlock.Writer(null,
            meta);

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java
index 09561cb..bc09c88 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java
@@ -205,7 +205,6 @@ public class TestHFileBlock {
                         .withIncludesMvcc(includesMemstoreTS)
                         .withIncludesTags(includesTag)
                         .withBytesPerCheckSum(HFile.DEFAULT_BYTES_PER_CHECKSUM)
-                        .withChecksumType(HFile.DEFAULT_CHECKSUM_TYPE)
                         .build();
     HFileBlock.Writer hbw = new HFileBlock.Writer(null, meta);
     DataOutputStream dos = hbw.startWriting(blockType);
@@ -289,7 +288,6 @@ public class TestHFileBlock {
                            .withIncludesMvcc(includesMemstoreTS)
                            .withIncludesTags(includesTag)
                            .withBytesPerCheckSum(HFile.DEFAULT_BYTES_PER_CHECKSUM)
-                           .withChecksumType(HFile.DEFAULT_CHECKSUM_TYPE)
                            .build();
         HFileBlock.Writer hbw = new HFileBlock.Writer(null,
            meta);
@@ -372,7 +370,6 @@ public class TestHFileBlock {
                               .withIncludesMvcc(includesMemstoreTS)
                               .withIncludesTags(includesTag)
                               .withBytesPerCheckSum(HFile.DEFAULT_BYTES_PER_CHECKSUM)
-                              .withChecksumType(HFile.DEFAULT_CHECKSUM_TYPE)
                               .build();
           HFileBlock.Writer hbw = new HFileBlock.Writer(dataBlockEncoder, meta);
           long totalSize = 0;
@@ -722,7 +719,6 @@ public class TestHFileBlock {
                         .withIncludesTags(includesTag)
                         .withCompression(compressAlgo)
                         .withBytesPerCheckSum(HFile.DEFAULT_BYTES_PER_CHECKSUM)
-                        .withChecksumType(HFile.DEFAULT_CHECKSUM_TYPE)
                         .build();
     HFileBlock.Writer hbw = new HFileBlock.Writer(null, meta);
     Map<BlockType, Long> prevOffsetByType = new HashMap<BlockType, Long>();

http://git-wip-us.apache.org/repos/asf/hbase/blob/f7bcf3df/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java
index f3e2f51..1e0d9e6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java
@@ -251,7 +251,6 @@ public class TestHFileBlockIndex {
                         .withIncludesMvcc(includesMemstoreTS)
                         .withIncludesTags(useTags)
                         .withCompression(compr)
-                        .withChecksumType(HFile.DEFAULT_CHECKSUM_TYPE)
                         .withBytesPerCheckSum(HFile.DEFAULT_BYTES_PER_CHECKSUM)
                         .build();
     HFileBlock.Writer hbw = new HFileBlock.Writer(null,


Mime
View raw message