You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-08 14:22:09 +03:00
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.
This commit is contained in:
@@ -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"));
|
||||
|
Reference in New Issue
Block a user