hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject git commit: Revert "HBASE-11234 FastDiffDeltaEncoder#getFirstKeyInBlock returns wrong result"
Date Fri, 23 May 2014 19:44:57 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 996705c61 -> b985e4fd0


Revert "HBASE-11234 FastDiffDeltaEncoder#getFirstKeyInBlock returns wrong result"

This reverts commit 494e0b50e9f57245ecfbb6be5a61e2630a119fa6.


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

Branch: refs/heads/0.98
Commit: b985e4fd0ebdd920b5c3b33dd5549713d82fa16a
Parents: 996705c
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri May 23 12:38:39 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri May 23 12:38:39 2014 -0700

----------------------------------------------------------------------
 .../hbase/io/encoding/FastDiffDeltaEncoder.java |  3 +-
 .../io/encoding/PrefixKeyDeltaEncoder.java      |  3 +-
 .../regionserver/TestReversibleScanners.java    | 47 +++++++++-----------
 3 files changed, 23 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b985e4fd/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java
index c4260c3..0346b20 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java
@@ -389,8 +389,7 @@ public class FastDiffDeltaEncoder extends BufferedDataBlockEncoder {
     ByteBufferUtils.readCompressedInt(block); // commonLength
     int pos = block.position();
     block.reset();
-    return ByteBuffer.wrap(block.array(), block.arrayOffset() + pos, keyLength)
-        .slice();
+    return ByteBuffer.wrap(block.array(), pos, keyLength).slice();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/b985e4fd/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java
index df2688a..f57ff4f 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java
@@ -154,8 +154,7 @@ public class PrefixKeyDeltaEncoder extends BufferedDataBlockEncoder {
     }
     int pos = block.position();
     block.reset();
-    return ByteBuffer.wrap(block.array(), block.arrayOffset() + pos, keyLength)
-        .slice();
+    return ByteBuffer.wrap(block.array(), pos, keyLength).slice();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/b985e4fd/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
index fa09263..8842b90 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
@@ -51,7 +51,6 @@ import org.apache.hadoop.hbase.filter.FilterList;
 import org.apache.hadoop.hbase.filter.FilterList.Operator;
 import org.apache.hadoop.hbase.filter.PageFilter;
 import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
-import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
 import org.apache.hadoop.hbase.io.hfile.HFileContext;
 import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
@@ -89,32 +88,28 @@ public class TestReversibleScanners {
         TEST_UTIL.getDataTestDir("testReversibleStoreFileScanner"),
         "regionname"), "familyname");
     CacheConfig cacheConf = new CacheConfig(TEST_UTIL.getConfiguration());
-    for (DataBlockEncoding encoding : DataBlockEncoding.values()) {
-      HFileContextBuilder hcBuilder = new HFileContextBuilder();
-      hcBuilder.withBlockSize(2 * 1024);
-      hcBuilder.withDataBlockEncoding(encoding);
-      HFileContext hFileContext = hcBuilder.build();
-      StoreFile.Writer writer = new StoreFile.WriterBuilder(
-          TEST_UTIL.getConfiguration(), cacheConf, fs).withOutputDir(hfilePath)
-          .withFileContext(hFileContext).build();
-      writeStoreFile(writer);
-
-      StoreFile sf = new StoreFile(fs, writer.getPath(),
-          TEST_UTIL.getConfiguration(), cacheConf, BloomType.NONE);
-
-      List<StoreFileScanner> scanners = StoreFileScanner
-          .getScannersForStoreFiles(Collections.singletonList(sf), false, true,
-              false, Long.MAX_VALUE);
-      StoreFileScanner scanner = scanners.get(0);
-      seekTestOfReversibleKeyValueScanner(scanner);
-      for (int readPoint = 0; readPoint < MAXMVCC; readPoint++) {
-        LOG.info("Setting read point to " + readPoint);
-        scanners = StoreFileScanner.getScannersForStoreFiles(
-            Collections.singletonList(sf), false, true, false, readPoint);
-        seekTestOfReversibleKeyValueScannerWithMVCC(scanners.get(0), readPoint);
-      }
-    }
+    HFileContextBuilder hcBuilder = new HFileContextBuilder();
+    hcBuilder.withBlockSize(2 * 1024);
+    HFileContext hFileContext = hcBuilder.build();
+    StoreFile.Writer writer = new StoreFile.WriterBuilder(
+        TEST_UTIL.getConfiguration(), cacheConf, fs).withOutputDir(
+        hfilePath).withFileContext(hFileContext).build();
+    writeStoreFile(writer);
 
+    StoreFile sf = new StoreFile(fs, writer.getPath(),
+        TEST_UTIL.getConfiguration(), cacheConf, BloomType.NONE);
+
+    List<StoreFileScanner> scanners = StoreFileScanner
+        .getScannersForStoreFiles(Collections.singletonList(sf), false, true,
+            false, Long.MAX_VALUE);
+    StoreFileScanner scanner = scanners.get(0);
+    seekTestOfReversibleKeyValueScanner(scanner);
+    for (int readPoint = 0; readPoint < MAXMVCC; readPoint++) {
+      LOG.info("Setting read point to " + readPoint);
+      scanners = StoreFileScanner.getScannersForStoreFiles(
+          Collections.singletonList(sf), false, true, false, readPoint);
+      seekTestOfReversibleKeyValueScannerWithMVCC(scanners.get(0), readPoint);
+    }
   }
 
   @Test


Mime
View raw message