From 9363504dd4838f8e63acb49e8861510e51927abc Mon Sep 17 00:00:00 2001 From: Patrick LeBlanc Date: Tue, 20 Nov 2018 12:43:05 -0600 Subject: [PATCH] MCOL-1847. Addressed feedback from Daniel. Instead of a seperate param for cache size, we decided to allow an override of the NumBlocksPct param instead. If NumBlocksPct ends in an 'm' or a 'g', it will be interpreted as megabytes or gigabytes instead of a %age. --- oam/etc/Columnstore.xml | 7 ++----- oam/etc/Columnstore.xml.singleserver | 7 ++----- primitives/primproc/primproc.cpp | 29 +++++++++++----------------- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/oam/etc/Columnstore.xml b/oam/etc/Columnstore.xml index 79fb0cff5..b5610bf11 100644 --- a/oam/etc/Columnstore.xml +++ b/oam/etc/Columnstore.xml @@ -427,12 +427,9 @@ + - - - - 1 0 diff --git a/oam/etc/Columnstore.xml.singleserver b/oam/etc/Columnstore.xml.singleserver index 75e741ada..0c291579a 100644 --- a/oam/etc/Columnstore.xml.singleserver +++ b/oam/etc/Columnstore.xml.singleserver @@ -419,12 +419,9 @@ + 50 - - - - 1 0 diff --git a/primitives/primproc/primproc.cpp b/primitives/primproc/primproc.cpp index 3957cc783..4ec66b767 100644 --- a/primitives/primproc/primproc.cpp +++ b/primitives/primproc/primproc.cpp @@ -503,16 +503,10 @@ int main(int argc, char* argv[]) } string strBlockPct = cf->getConfig(dbbc, "NumBlocksPct"); - string strBlockAbs = cf->getConfig(dbbc, "NumBlocksInMB"); - bool usePct = !(strBlockPct.empty()); // which to use. Prefer Pct if both are specified. - - if (usePct) - temp = atoi(strBlockPct.c_str()); - else - temp = atoi(strBlockAbs.c_str()); + temp = atoi(strBlockPct.c_str()); #ifdef _MSC_VER - /* TODO: implement handling for NumBlocksInMB */ + /* TODO: implement handling for the 'm' or 'g' chars in NumBlocksPct */ if (temp > 0) BRPBlocksPct = temp; @@ -532,19 +526,18 @@ int main(int argc, char* argv[]) } #else - if (usePct) + if (temp > 0) + BRPBlocksPct = temp; + /* MCOL-1847. Did the user specify this in MB or GB? */ + int len = strBlockPct.length(); + if (strBlockPct[len-1] == 'g' || strBlockPct[len-1] == 'm') { - if (temp > 0) - BRPBlocksPct = temp; - BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192; + if (strBlockPct[len-1] == 'g') + BRPBlocksPct *= 1024; + BRPBlocks = BRPBlocksPct * 128; // 128 blocks per MB } else - { - if (temp > 0) - BRPBlocks = temp * 128; // 128 blocks per MB. - else - BRPBlocks = 131072; // 1GB, why not. - } + BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192; #endif #if 0 temp = toInt(cf->getConfig(dbbc, "NumThreads"));