hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1587418 - /hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java
Date Tue, 15 Apr 2014 05:04:12 GMT
Author: ramkrishna
Date: Tue Apr 15 05:04:12 2014
New Revision: 1587418

URL: http://svn.apache.org/r1587418
Log:
HBASE-10972 - OOBE in prefix key encoding (Ram)

Modified:
    hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java

Modified: hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java?rev=1587418&r1=1587417&r2=1587418&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java
(original)
+++ hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java
Tue Apr 15 05:04:12 2014
@@ -407,5 +407,27 @@ public class TestDataBlockEncoders {
       assertEquals("Input of two methods is changed", onDataset, dataset);
     }
   }
+  
+  @Test
+  public void testZeroByte() throws IOException {
+    List<KeyValue> kvList = new ArrayList<KeyValue>();
+    byte[] row = Bytes.toBytes("abcd");
+    byte[] family = new byte[] { 'f' };
+    byte[] qualifier0 = new byte[] { 'b' };
+    byte[] qualifier1 = new byte[] { 'c' };
+    byte[] value0 = new byte[] { 'd' };
+    byte[] value1 = new byte[] { 0x00 };
+    if (includesTags) {
+      kvList.add(new KeyValue(row, family, qualifier0, 0, value0, new Tag[] { new Tag((byte)
1,
+          "value1") }));
+      kvList.add(new KeyValue(row, family, qualifier1, 0, value1, new Tag[] { new Tag((byte)
1,
+          "value1") }));
+    } else {
+      kvList.add(new KeyValue(row, family, qualifier0, 0, Type.Put, value0));
+      kvList.add(new KeyValue(row, family, qualifier1, 0, Type.Put, value1));
+    }
+    testEncodersOnDataset(RedundantKVGenerator.convertKvToByteBuffer(kvList, includesMemstoreTS),
+        kvList);
+  }
 
 }



Mime
View raw message