1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-06 08:21:01 +03:00

Merge pull request #96 from mariadb-corporation/MCOL-505

MCOL-505 Performance improvements to ExeMgr
This commit is contained in:
Andrew Hutchings 2017-01-13 21:03:35 -06:00 committed by GitHub
commit c6799df640
4 changed files with 37 additions and 44 deletions

View File

@ -278,11 +278,11 @@ namespace oam
const string MODULE_TYPE = "ModuleType"; const string MODULE_TYPE = "ModuleType";
systemmoduletypeconfig.moduletypeconfig.clear(); systemmoduletypeconfig.moduletypeconfig.clear();
Config* sysConfig = Config::makeConfig(CalpontConfigFile.c_str());
for (int moduleTypeID = 1; moduleTypeID < MAX_MODULE_TYPE+1; moduleTypeID++) for (int moduleTypeID = 1; moduleTypeID < MAX_MODULE_TYPE+1; moduleTypeID++)
{ {
ModuleTypeConfig moduletypeconfig; ModuleTypeConfig moduletypeconfig;
Config* sysConfig = Config::makeConfig(CalpontConfigFile.c_str());
// get Module info // get Module info
@ -375,7 +375,7 @@ namespace oam
int moduleFound = 0; int moduleFound = 0;
//get NIC IP address/hostnames //get NIC IP address/hostnames
for (int moduleID = 1; moduleID < MAX_MODULE ; moduleID++) for (int moduleID = 1; moduleID <= moduletypeconfig.ModuleCount ; moduleID++)
{ {
DeviceNetworkConfig devicenetworkconfig; DeviceNetworkConfig devicenetworkconfig;
HostConfig hostconfig; HostConfig hostconfig;
@ -385,7 +385,9 @@ namespace oam
string ModuleIpAddr = MODULE_IP_ADDR + itoa(moduleID) + "-" + itoa(nicID) + "-" + itoa(moduleTypeID); string ModuleIpAddr = MODULE_IP_ADDR + itoa(moduleID) + "-" + itoa(nicID) + "-" + itoa(moduleTypeID);
string ipAddr = sysConfig->getConfig(Section, ModuleIpAddr); string ipAddr = sysConfig->getConfig(Section, ModuleIpAddr);
if (ipAddr.empty() || ipAddr == UnassignedIpAddr ) if (ipAddr.empty())
break;
else if (ipAddr == UnassignedIpAddr )
continue; continue;
string ModuleHostName = MODULE_SERVER_NAME + itoa(moduleID) + "-" + itoa(nicID) + "-" + itoa(moduleTypeID); string ModuleHostName = MODULE_SERVER_NAME + itoa(moduleID) + "-" + itoa(nicID) + "-" + itoa(moduleTypeID);
@ -428,7 +430,7 @@ namespace oam
// get dbroot IDs // get dbroot IDs
moduleFound = 0; moduleFound = 0;
for (int moduleID = 1; moduleID < MAX_MODULE+1 ; moduleID++) for (int moduleID = 1; moduleID <= moduletypeconfig.ModuleCount ; moduleID++)
{ {
string ModuleDBRootCount = MODULE_DBROOT_COUNT + itoa(moduleID) + "-" + itoa(moduleTypeID); string ModuleDBRootCount = MODULE_DBROOT_COUNT + itoa(moduleID) + "-" + itoa(moduleTypeID);
string temp = sysConfig->getConfig(Section, ModuleDBRootCount).c_str(); string temp = sysConfig->getConfig(Section, ModuleDBRootCount).c_str();
@ -1925,12 +1927,12 @@ namespace oam
const string SECTION_NAME = "PROCESSCONFIG"; const string SECTION_NAME = "PROCESSCONFIG";
systemprocessconfig.processconfig.clear(); systemprocessconfig.processconfig.clear();
Config* proConfig = Config::makeConfig(ProcessConfigFile.c_str());
for (int processID = 1; processID < MAX_PROCESS+1; processID++) for (int processID = 1; processID < MAX_PROCESS+1; processID++)
{ {
ProcessConfig processconfig; ProcessConfig processconfig;
Config* proConfig = Config::makeConfig(ProcessConfigFile.c_str());
// get process info // get process info
string sectionName = SECTION_NAME + itoa(processID); string sectionName = SECTION_NAME + itoa(processID);

View File

@ -141,29 +141,7 @@ uint32_t CGroupConfigurator::getNumCoresFromProc()
GetSystemInfo(&siSysInfo); GetSystemInfo(&siSysInfo);
return siSysInfo.dwNumberOfProcessors; return siSysInfo.dwNumberOfProcessors;
#else #else
ifstream cpuinfo("/proc/cpuinfo"); uint32_t nc = sysconf(_SC_NPROCESSORS_ONLN);
if (!cpuinfo.good())
return 0;
unsigned nc = 0;
regex re("Processor\\s*:\\s*[0-9]+", regex::normal|regex::icase);
string line;
getline(cpuinfo, line);
unsigned i = 0;
while (i < 10000 && cpuinfo.good() && !cpuinfo.eof())
{
if (regex_match(line, re))
nc++;
getline(cpuinfo, line);
++i;
}
return nc; return nc;
#endif #endif

View File

@ -32,6 +32,7 @@ using namespace std;
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/unordered_map.hpp>
using namespace boost; using namespace boost;
namespace fs=boost::filesystem; namespace fs=boost::filesystem;
@ -82,8 +83,9 @@ Config* Config::makeConfig(const char* cf)
{ {
mutex::scoped_lock lk(fInstanceMapMutex); mutex::scoped_lock lk(fInstanceMapMutex);
string configFile; static string installDir;
string installDir = startup::StartUp::installDir(); if (installDir.empty())
installDir = startup::StartUp::installDir();
if (cf == 0) if (cf == 0)
{ {
@ -96,18 +98,22 @@ Config* Config::makeConfig(const char* cf)
#endif #endif
if (cf == 0 || *cf == 0) if (cf == 0 || *cf == 0)
{ {
fs::path configFilePath = fs::path(installDir) / fs::path("etc") / defaultCalpontConfigFile; static string defaultFilePath;
configFile = configFilePath.string(); if (defaultFilePath.empty())
} {
else fs::path configFilePath;
{ configFilePath = fs::path(installDir) / fs::path("etc") / defaultCalpontConfigFile;
configFile = cf; defaultFilePath = configFilePath.string();
}
if (fInstanceMap.find(defaultFilePath) == fInstanceMap.end())
{
Config* instance = new Config(defaultFilePath, installDir);
fInstanceMap[defaultFilePath] = instance;
}
return fInstanceMap[defaultFilePath];
} }
} }
else string configFile(cf);
{
configFile = cf;
}
if (fInstanceMap.find(configFile) == fInstanceMap.end()) if (fInstanceMap.find(configFile) == fInstanceMap.end())
{ {
@ -241,7 +247,7 @@ const string Config::getConfig(const string& section, const string& name)
} }
} }
return fParser.getConfig(fDoc, section, name); return fParser.getConfig(fDoc, section, name);
} }
void Config::getConfig(const string& section, const string& name, vector<string>& values) void Config::getConfig(const string& section, const string& name, vector<string>& values)

View File

@ -800,7 +800,14 @@ int64_t Row::getSignedNullValue(uint32_t colIndex) const
RowGroup::RowGroup() : columnCount(0), data(NULL), rgData(NULL), strings(NULL), RowGroup::RowGroup() : columnCount(0), data(NULL), rgData(NULL), strings(NULL),
useStringTable(true), hasLongStringField(false), sTableThreshold(20) useStringTable(true), hasLongStringField(false), sTableThreshold(20)
{ } {
oldOffsets.reserve(1024);
oids.reserve(1024);
keys.reserve(1024);
types.reserve(1024);
scale.reserve(1024);
precision.reserve(1024);
}
RowGroup::RowGroup(uint32_t colCount, RowGroup::RowGroup(uint32_t colCount,
const vector<uint32_t> &positions, const vector<uint32_t> &positions,