1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

fix(UT): added dummy RM ctor to be used with UTs

This commit is contained in:
drrtuy
2025-04-30 09:21:46 +00:00
parent 246c5775a3
commit d8bef9dc11
4 changed files with 19 additions and 3 deletions

View File

@ -244,6 +244,17 @@ ResourceManager::ResourceManager(bool runningInExeMgr, config::Config* aConfig)
} }
} }
// For UT
ResourceManager::ResourceManager()
: fExeMgrStr("ForUT")
, fHJUmMaxMemorySmallSideDistributor(
fHashJoinStr, "UmMaxMemorySmallSide",
1024*1024,
1024*1024, 0)
, fHJPmMaxMemorySmallSideSessionMap(1024*1024)
{
}
int ResourceManager::getEmPriority() const int ResourceManager::getEmPriority() const
{ {
int temp = getIntVal(fExeMgrStr, "Priority", defaultEMPriority); int temp = getIntVal(fExeMgrStr, "Priority", defaultEMPriority);

View File

@ -119,8 +119,12 @@ class ResourceManager
/** @brief ctor /** @brief ctor
* *
*/ */
explicit ResourceManager(bool runningInExeMgr = false, config::Config* aConfig = nullptr); explicit ResourceManager(bool runningInExeMgr, config::Config* aConfig = nullptr);
static ResourceManager* instance(bool runningInExeMgr = false, config::Config* aConfig = nullptr); static ResourceManager* instance(bool runningInExeMgr = false, config::Config* aConfig = nullptr);
// For UT
explicit ResourceManager();
config::Config* getConfig() config::Config* getConfig()
{ {
return fConfig; return fConfig;

View File

@ -124,7 +124,7 @@ TEST_F(STLPoolAllocatorTest, ResourceManagerIntegration)
using TestType = int8_t; using TestType = int8_t;
using Allocator = STLPoolAllocator<TestType>; using Allocator = STLPoolAllocator<TestType>;
joblist::ResourceManager rm(true, nullptr); joblist::ResourceManager rm;
// To set the memory allowance // To set the memory allowance
rm.setMemory(MemoryAllowance); rm.setMemory(MemoryAllowance);
Allocator alloc(&rm, 1024, 512); Allocator alloc(&rm, 1024, 512);

View File

@ -238,7 +238,8 @@ uint32_t QueryStats::userPriority(string _host, const string _user)
if (!fPriority.empty()) if (!fPriority.empty())
return fPriorityLevel; return fPriorityLevel;
ResourceManager rm; bool runningInExeMgr = false;
ResourceManager rm(runningInExeMgr);
fPriorityLevel = DEFAULT_USER_PRIORITY_LEVEL; fPriorityLevel = DEFAULT_USER_PRIORITY_LEVEL;
fPriority = DEFAULT_USER_PRIORITY; fPriority = DEFAULT_USER_PRIORITY;