Repository: hbase
Updated Branches:
  refs/heads/branch-1.0 6b8662c9c -> 736f5b3ab
  refs/heads/branch-1.1 8a7f86257 -> af1f6ee18
  refs/heads/branch-1.2 d02a4d6dc -> a67f581a9


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/a67f581a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a67f581a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a67f581a

Branch: refs/heads/branch-1.2
Commit: a67f581a92f76906ac0c68535aa71cec6798318f
Parents: d02a4d6
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:31:04 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/a67f581a/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);

Reply via email to