You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2015/12/17 18:34:18 UTC

[2/3] hbase git commit: HBASE-14730 region server needs to log warnings when there are attributes configured for cells with hfile v2 (huaxiang sun)

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

Branch: refs/heads/branch-1.1
Commit: af1f6ee18860ca3c6f2117a01fd6b9006e7ffefa
Parents: 8a7f862
Author: Matteo Bertozzi <ma...@cloudera.com>
Authored: Thu Dec 17 09:31:04 2015 -0800
Committer: Matteo Bertozzi <ma...@cloudera.com>
Committed: Thu Dec 17 09:31:52 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/af1f6ee1/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);