HBASE-10454 Tags presence file info can be wrong in HFiles when PrefixTree encoding is used.

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1564384 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
anoopsamjohn 2014-02-04 17:21:32 +00:00
parent 6b7fb21ec0
commit 42a2456b44
1 changed files with 5 additions and 1 deletions

View File

@ -188,7 +188,11 @@ public class HFileWriterV3 extends HFileWriterV2 {
protected void finishFileInfo() throws IOException {
super.finishFileInfo();
if (hFileContext.isIncludesTags()) {
if (hFileContext.getDataBlockEncoding() == DataBlockEncoding.PREFIX_TREE) {
// In case of Prefix Tree encoding, we always write tags information into HFiles even if all
// KVs are having no tags.
fileInfo.append(FileInfo.MAX_TAGS_LEN, Bytes.toBytes(this.maxTagsLength), false);
} else if (hFileContext.isIncludesTags()) {
// When tags are not being written in this file, MAX_TAGS_LEN is excluded
// from the FileInfo
fileInfo.append(FileInfo.MAX_TAGS_LEN, Bytes.toBytes(this.maxTagsLength), false);