diff --git a/dbcon/joblist/resourcemanager.cpp b/dbcon/joblist/resourcemanager.cpp index 3c684697d..aa3ca3b5b 100644 --- a/dbcon/joblist/resourcemanager.cpp +++ b/dbcon/joblist/resourcemanager.cpp @@ -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 temp = getIntVal(fExeMgrStr, "Priority", defaultEMPriority); diff --git a/dbcon/joblist/resourcemanager.h b/dbcon/joblist/resourcemanager.h index b5d1cea57..56774d328 100644 --- a/dbcon/joblist/resourcemanager.h +++ b/dbcon/joblist/resourcemanager.h @@ -119,8 +119,12 @@ class ResourceManager /** @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); + + // For UT + explicit ResourceManager(); + config::Config* getConfig() { return fConfig; diff --git a/tests/stlpoolallocator.cpp b/tests/stlpoolallocator.cpp index dc61d0bad..71ebbfc02 100644 --- a/tests/stlpoolallocator.cpp +++ b/tests/stlpoolallocator.cpp @@ -124,7 +124,7 @@ TEST_F(STLPoolAllocatorTest, ResourceManagerIntegration) using TestType = int8_t; using Allocator = STLPoolAllocator; - joblist::ResourceManager rm(true, nullptr); + joblist::ResourceManager rm; // To set the memory allowance rm.setMemory(MemoryAllowance); Allocator alloc(&rm, 1024, 512); diff --git a/utils/querystats/querystats.cpp b/utils/querystats/querystats.cpp index ac9ed79e6..08c67fd99 100644 --- a/utils/querystats/querystats.cpp +++ b/utils/querystats/querystats.cpp @@ -238,7 +238,8 @@ uint32_t QueryStats::userPriority(string _host, const string _user) if (!fPriority.empty()) return fPriorityLevel; - ResourceManager rm; + bool runningInExeMgr = false; + ResourceManager rm(runningInExeMgr); fPriorityLevel = DEFAULT_USER_PRIORITY_LEVEL; fPriority = DEFAULT_USER_PRIORITY;