HBASE-14730 region server needs to log warnings when there are attributes configured for cells with hfile v2 (huaxiang sun)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/736f5b3a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/736f5b3a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/736f5b3a Branch: refs/heads/branch-1.0 Commit: 736f5b3abf16e922439af614d4754e0dfa9858a2 Parents: 6b8662c Author: Matteo Bertozzi <matteo.berto...@cloudera.com> Authored: Thu Dec 17 09:31:04 2015 -0800 Committer: Matteo Bertozzi <matteo.berto...@cloudera.com> Committed: Thu Dec 17 09:32:59 2015 -0800 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/736f5b3a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java index 28c4655..edab0dc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java @@ -88,6 +88,9 @@ public class HFileWriterV2 extends AbstractHFileWriter { protected long maxMemstoreTS = 0; + /** warn on cell with tags */ + private static boolean warnCellWithTags = true; + static class WriterFactoryV2 extends HFile.WriterFactory { WriterFactoryV2(Configuration conf, CacheConfig cacheConf) { super(conf, cacheConf); @@ -267,6 +270,13 @@ public class HFileWriterV2 extends AbstractHFileWriter { newBlock(); } + if (warnCellWithTags && getFileContext().isIncludesTags()) { + LOG.warn("A minimum HFile version of " + HFile.MIN_FORMAT_VERSION_WITH_TAGS + + " is required to support cell attributes/tags. Consider setting " + + HFile.FORMAT_VERSION_KEY + " accordingly."); + warnCellWithTags = false; + } + fsBlockWriter.write(cell); totalKeyLength += CellUtil.estimatedSerializedSizeOfKey(cell);