From 9c37d5dab7a42db72a6fbe66d716dacc69d02188 Mon Sep 17 00:00:00 2001 From: Lars Hofhansl Date: Thu, 29 Jan 2015 14:10:59 -0800 Subject: [PATCH] HBASE-12859; Addendum --- .../java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java index 26cb6c95334..250001efe25 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java @@ -157,7 +157,8 @@ public class HFileReaderV2 extends AbstractHFileReader { // File info fileInfo = new FileInfo(); fileInfo.read(blockIter.nextBlockWithBlockType(BlockType.FILE_INFO).getByteStream()); - this.hfileContext.setFileCreateTime(Bytes.toLong(fileInfo.get(FileInfo.CREATE_TIME_TS))); + byte[] creationTimeBytes = fileInfo.get(FileInfo.CREATE_TIME_TS); + this.hfileContext.setFileCreateTime(creationTimeBytes == null ? 0 : Bytes.toLong(creationTimeBytes)); lastKey = fileInfo.get(FileInfo.LASTKEY); avgKeyLen = Bytes.toInt(fileInfo.get(FileInfo.AVG_KEY_LEN)); avgValueLen = Bytes.toInt(fileInfo.get(FileInfo.AVG_VALUE_LEN));