Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/505#discussion_r64832927
--- Diff: core/sql/ustat/hs_globals.cpp ---
@@ -546,10 +557,11 @@ NABoolean HSGlobalsClass::setHBaseCacheSize(double
sampleRatio)
Int64 workableCacheSize = (Int64)(sampleRatio * calibrationFactor);
if (workableCacheSize < 1)
workableCacheSize = 1; // can't go below 1 unfortunately
+ else if (workableCacheSize > 50)
+ workableCacheSize = 50;
- Int32 max = getDefaultAsLong(HBASE_NUM_CACHE_ROWS_MAX);
- if ((workableCacheSize < 10000) && // don't bother if 10000 works
- (max == 10000)) // don't do it if user has already set this CQD
+ Int32 maxDefault = getDefaultAsLong(HBASE_NUM_CACHE_ROWS_MAX);
+ if (maxDefault == 10000) // don't do it if user has already set this CQD
--- End diff --
This is existing code, but wanted to comment anyway: The code will break if
we ever update HBASE_NUM_CACHE_ROWS_MAX in nadefaults.cpp and fail to update
this file to the same value.
There is another way to do this check: NADefaults::getProvenance() will
return INIT_DEFAULT_DEFAULTS if a default hasn't been updated from the
hard-coded defaults.
I'm also wondering whether a higher value chosen by a user would be right
here, given that we may use very small sample ratios. This may be different
than the other workloads a user runs? Wouldn't it be better to use
MIN(maxDefault, workableCacheSize)?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---