[
https://issues.apache.org/jira/browse/HBASE-12824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14270146#comment-14270146
]
Enis Soztutar commented on HBASE-12824:
---------------------------------------
HBASE-12069 had this change which maybe the cause:
{code}
diff --git
hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java
hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java
index 355719d..850dc02 100644
--- hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java
+++ hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java
@@ -28,13 +28,18 @@ import
org.apache.hadoop.hbase.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellComparator;
+import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.io.compress.Compression;
import org.apache.hadoop.hbase.io.hfile.AbstractHFileWriter;
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
import org.apache.hadoop.hbase.io.hfile.HFile;
import org.apache.hadoop.hbase.io.hfile.HFileContext;
import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
+import org.apache.hadoop.hbase.io.hfile.HFileScanner;
import org.apache.hadoop.io.compress.Compressor;
/**
@@ -119,19 +124,25 @@ public class CompressionTest {
.withPath(fs, path)
.withFileContext(context)
.create();
- writer.append(Bytes.toBytes("testkey"), Bytes.toBytes("testval"));
- writer.appendFileInfo(Bytes.toBytes("infokey"), Bytes.toBytes("infoval"));
+ // Write any-old Cell...
+ final byte [] rowKey = Bytes.toBytes("compressiontestkey");
+ Cell c = CellUtil.createCell(rowKey, Bytes.toBytes("compressiontestval"));
+ writer.append(c);;
+ writer.appendFileInfo(Bytes.toBytes("compressioninfokey"),
Bytes.toBytes("compressioninfoval"));
writer.close();
-
+ Cell cc = null;
HFile.Reader reader = HFile.createReader(fs, path, new CacheConfig(conf),
conf);
- reader.loadFileInfo();
- byte[] key = reader.getFirstKey();
- boolean rc = Bytes.toString(key).equals("testkey");
- reader.close();
-
- if (!rc) {
- throw new Exception("Read back incorrect result: " +
- Bytes.toStringBinary(key));
+ try {
+ reader.loadFileInfo();
+ HFileScanner scanner = reader.getScanner(false, true);
+ scanner.next();
+ // Scanner does not do Cells yet. Do below for now till fixed.
+ cc = scanner.getKeyValue();
+ if (CellComparator.compareRows(c, cc) != 0) {
+ throw new Exception("Read back incorrect result: " + c.toString() + "
vs " + cc.toString());
+ }
+ } finally {
+ reader.close();
}
}
{code}
> CompressionTest fails with
> org.apache.hadoop.hbase.io.hfile.AbstractHFileReader$NotSeekedException: Not
> seeked to a key/value
> -----------------------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-12824
> URL: https://issues.apache.org/jira/browse/HBASE-12824
> Project: HBase
> Issue Type: Bug
> Reporter: Enis Soztutar
> Priority: Critical
> Fix For: 1.0.0, 2.0.0, 1.1.0
>
>
> {code}
> HW10676:hbase$ bin/hbase org.apache.hadoop.hbase.util.CompressionTest
> /tmp/CompressionInput2.txt none
> 2015-01-08 13:45:55,303 WARN [main] util.NativeCodeLoader: Unable to load
> native-hadoop library for your platform... using builtin-java classes where
> applicable
> 2015-01-08 13:45:55,590 INFO [main] hfile.CacheConfig: CacheConfig:disabled
> 2015-01-08 13:45:55,670 INFO [main] hfile.CacheConfig: CacheConfig:disabled
> Exception in thread "main"
> org.apache.hadoop.hbase.io.hfile.AbstractHFileReader$NotSeekedException: Not
> seeked to a key/value
> at
> org.apache.hadoop.hbase.io.hfile.AbstractHFileReader$Scanner.assertSeeked(AbstractHFileReader.java:305)
> at
> org.apache.hadoop.hbase.io.hfile.HFileReaderV2$ScannerV2.next(HFileReaderV2.java:796)
> at
> org.apache.hadoop.hbase.util.CompressionTest.doSmokeTest(CompressionTest.java:138)
> at
> org.apache.hadoop.hbase.util.CompressionTest.main(CompressionTest.java:164)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)