trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject [1/4] trafodion git commit: [TRAFODION-3145] Make "hbase_options" as default setting and use cqd to change the default setting
Date Sat, 21 Jul 2018 16:23:53 GMT
Repository: trafodion
Updated Branches:
  refs/heads/master 8b56ed242 -> 60b3eb02c


[TRAFODION-3145] Make "hbase_options" as default setting and use cqd to change the default
setting


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/86fdb25c
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/86fdb25c
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/86fdb25c

Branch: refs/heads/master
Commit: 86fdb25c09785da8d17b05e38e4f802af97932e9
Parents: 0db94ea
Author: Liu Ming <ovis_poly@sina.com>
Authored: Sun Jul 15 18:37:40 2018 -0400
Committer: Liu Ming <ovis_poly@sina.com>
Committed: Sun Jul 15 18:37:40 2018 -0400

----------------------------------------------------------------------
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 19 +++++++++++++++++++
 core/sql/sqlcomp/DefaultConstants.h      |  1 +
 core/sql/sqlcomp/nadefaults.cpp          |  2 ++
 3 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/86fdb25c/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 9e6e464..2565cfd 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -10880,8 +10880,10 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
 
   NABoolean dataBlockEncodingOptionSpecified = FALSE;
   NABoolean compressionOptionSpecified = FALSE;
+  NABoolean memstoreFlushSizeOptionSpecified = FALSE;
   const char *dataBlockEncodingOptionString = "DATA_BLOCK_ENCODING";
   const char *compressionOptionString = "COMPRESSION";
+  const char *flushSizeOptionString = "MEMSTORE_FLUSH_SIZE";
 
   Lng32 numHbaseOptions = 0;
   if (hbaseOptionsClause)
@@ -10902,6 +10904,8 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
         dataBlockEncodingOptionSpecified = TRUE;
       else if (hbaseOption->key() == compressionOptionString)
         compressionOptionSpecified = TRUE;
+      else if (hbaseOption->key() == flushSizeOptionString)
+        memstoreFlushSizeOptionSpecified= TRUE;
       
       hbaseOptionsStr += hbaseOption->key();
       hbaseOptionsStr += "='";
@@ -10974,6 +10978,8 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
     CmpCommon::getDefaultString(HBASE_DATA_BLOCK_ENCODING_OPTION);
   NAString compression = 
     CmpCommon::getDefaultString(HBASE_COMPRESSION_OPTION);
+  NAString flushSize =
+    CmpCommon::getDefaultString(HBASE_MEMSTORE_FLUSH_SIZE_OPTION); 
   HbaseCreateOption * hbaseOption = NULL;
   
   char optionStr[200];
@@ -10991,7 +10997,20 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
           hbaseOptionsStr += optionStr;
         }
     }
+  if (!flushSize.isNull() && !memstoreFlushSizeOptionSpecified)
+    {
+      hbaseOption = new(STMTHEAP) HbaseCreateOption("MEMSTORE_FLUSH_SIZE", 
+                                                    flushSize.data());
+      hbaseCreateOptions.insert(hbaseOption);
 
+      if (ActiveSchemaDB()->getDefaults().userDefault
+          (HBASE_MEMSTORE_FLUSH_SIZE_OPTION) == TRUE)
+        {
+          numHbaseOptions += 1;
+          sprintf(optionStr, "MEMSTORE_FLUSH_SIZE='%s'|", flushSize.data());
+          hbaseOptionsStr += optionStr;
+        }
+    }
   if (!compression.isNull() && !compressionOptionSpecified)
     {
       hbaseOption = new(STMTHEAP) HbaseCreateOption("COMPRESSION", 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/86fdb25c/core/sql/sqlcomp/DefaultConstants.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/DefaultConstants.h b/core/sql/sqlcomp/DefaultConstants.h
index 77f14b4..ad75632 100644
--- a/core/sql/sqlcomp/DefaultConstants.h
+++ b/core/sql/sqlcomp/DefaultConstants.h
@@ -2921,6 +2921,7 @@ enum DefaultConstants
 
   HBASE_DATA_BLOCK_ENCODING_OPTION,
   HBASE_COMPRESSION_OPTION,
+  HBASE_MEMSTORE_FLUSH_SIZE_OPTION,
   HQC_LOG,
   HQC_LOG_FILE, // specify the HQC log file name
   HYBRID_QUERY_CACHE,

http://git-wip-us.apache.org/repos/asf/trafodion/blob/86fdb25c/core/sql/sqlcomp/nadefaults.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/nadefaults.cpp b/core/sql/sqlcomp/nadefaults.cpp
index a12557f..86447c7 100644
--- a/core/sql/sqlcomp/nadefaults.cpp
+++ b/core/sql/sqlcomp/nadefaults.cpp
@@ -1465,6 +1465,7 @@ SDDkwd__(EXE_DIAGNOSTIC_EVENTS,		"OFF"),
  DDui___(HBASE_MAX_COLUMN_VAL_LENGTH,                  "1000"),
  DDui___(HBASE_MAX_ESPS,                        "9999"),
  DDui___(HBASE_MAX_NUM_SEARCH_KEYS,                  "512"),
+ DDkwd__(HBASE_MEMSTORE_FLUSH_SIZE_OPTION,              ""),
  DDui1__(HBASE_MIN_BYTES_PER_ESP_PARTITION,     "67108864"),
 
   DDkwd__(HBASE_NATIVE_IUD,		"ON"),
@@ -5964,6 +5965,7 @@ DefaultToken NADefaults::token(Int32 attrEnum,
         (attrEnum == USE_HIVE_SOURCE) ||
         (attrEnum == HIVE_FILE_CHARSET) ||
         (attrEnum == HBASE_DATA_BLOCK_ENCODING_OPTION) ||
+        (attrEnum == HBASE_MEMSTORE_FLUSH_SIZE_OPTION) ||
         (attrEnum == HBASE_COMPRESSION_OPTION))
       return DF_USER;
     


Mime
View raw message