You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-520
This commit is contained in:
@ -34,6 +34,7 @@
|
||||
#include "configcpp.h"
|
||||
#include "calpontselectexecutionplan.h"
|
||||
#include "resourcedistributor.h"
|
||||
#include "installdir.h"
|
||||
|
||||
#include "atomicops.h"
|
||||
|
||||
@ -82,7 +83,7 @@ const uint32_t defaultProcessorThreadsPerScan = 16;
|
||||
const uint32_t defaultJoinerChunkSize = 16 * 1024 * 1024;
|
||||
|
||||
//bucketreuse
|
||||
const std::string defaultTempDiskPath = "/var/tmp";
|
||||
const std::string defaultTempDiskPath = "/tmp";
|
||||
const std::string defaultWorkingDir = "."; //"/tmp";
|
||||
|
||||
//largedatalist
|
||||
@ -282,7 +283,7 @@ public:
|
||||
|
||||
std::string getScTempDiskPath() const
|
||||
{
|
||||
return getStringVal(fSystemConfigStr, "TempDiskPath", defaultTempDiskPath );
|
||||
return startup::StartUp::tmpDir();
|
||||
}
|
||||
uint64_t getScTempSaveSize() const
|
||||
{
|
||||
@ -290,7 +291,7 @@ public:
|
||||
}
|
||||
std::string getScWorkingDir() const
|
||||
{
|
||||
return getStringVal(fSystemConfigStr, "WorkingDir", defaultWorkingDir );
|
||||
return startup::StartUp::tmpDir();
|
||||
}
|
||||
|
||||
uint32_t getTwMaxSize() const
|
||||
|
@ -62,6 +62,8 @@ using namespace execplan;
|
||||
#include "utils_utf8.h"
|
||||
|
||||
#include "crashtrace.h"
|
||||
#include "installdir.h"
|
||||
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
@ -71,7 +73,7 @@ DistributedEngineComm* Dec;
|
||||
|
||||
void setupCwd()
|
||||
{
|
||||
string workdir = config::Config::makeConfig()->getConfig("SystemConfig", "WorkingDir");
|
||||
string workdir = startup::StartUp::tmpDir();
|
||||
|
||||
if (workdir.length() == 0)
|
||||
workdir = ".";
|
||||
|
@ -83,6 +83,7 @@ using namespace joblist;
|
||||
#include "utils_utf8.h"
|
||||
|
||||
#include "crashtrace.h"
|
||||
#include "installdir.h"
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
@ -493,7 +494,7 @@ void rollbackAll(DBRM* dbrm)
|
||||
|
||||
void setupCwd()
|
||||
{
|
||||
string workdir = Config::makeConfig()->getConfig("SystemConfig", "WorkingDir");
|
||||
string workdir = startup::StartUp::tmpDir();
|
||||
|
||||
if (workdir.length() == 0)
|
||||
workdir = ".";
|
||||
|
@ -47,6 +47,8 @@ const int RESOURCE_DEBUG = false;
|
||||
static unsigned int usage[LOG_FREQ / MONITOR_FREQ];
|
||||
static int usageCount = 0;
|
||||
|
||||
extern string tmpDir;
|
||||
|
||||
/*****************************************************************************************
|
||||
* @brief cpuMonitor Thread
|
||||
*
|
||||
@ -519,9 +521,12 @@ void ServerMonitor::getCPUdata()
|
||||
{
|
||||
pcl.clear();
|
||||
|
||||
system("top -b -n1 | head -12 | awk '{print $9,$12}' | tail -5 > /tmp/columnstore_tmp_files/processCpu");
|
||||
string tmpProcessCpu = tmpDir + "/processCpu";
|
||||
|
||||
ifstream oldFile1 ("/tmp/columnstore_tmp_files/processCpu");
|
||||
string cmd = "top -b -n1 | head -12 | awk '{print $9,$12}' | tail -5 > " + tmpProcessCpu;
|
||||
system(cmd.c_str());
|
||||
|
||||
ifstream oldFile1 (tmpProcessCpu);
|
||||
|
||||
// read top 5 users
|
||||
int i = 0;
|
||||
@ -547,9 +552,14 @@ void ServerMonitor::getCPUdata()
|
||||
//
|
||||
// get and check Total CPU usage
|
||||
//
|
||||
system("top -b -n 6 -d 1 | awk '{print $5}' | grep %id > /tmp/columnstore_tmp_files/systemCpu");
|
||||
|
||||
ifstream oldFile ("/tmp/columnstore_tmp_files/systemCpu");
|
||||
|
||||
string tmpsystemCpu = tmpDir + "/processCpu";
|
||||
|
||||
cmd = "top -b -n 6 -d 1 | awk '{print $5}' | grep %id > " + tmpsystemCpu;
|
||||
system(cmd.c_str());
|
||||
|
||||
ifstream oldFile (tmpsystemCpu);
|
||||
|
||||
float systemIdle = 0;
|
||||
// skip first line in file, and average the next 5 entries which contains idle times
|
||||
|
@ -31,6 +31,8 @@ using namespace logging;
|
||||
using namespace servermonitor;
|
||||
//using namespace procheartbeat;
|
||||
|
||||
extern string tmpDir;
|
||||
|
||||
|
||||
/************************************************************************************************************
|
||||
* @brief hardwareMonitor function
|
||||
@ -72,7 +74,10 @@ void hardwareMonitor(int IPMI_SUPPORT)
|
||||
|
||||
if ( IPMI_SUPPORT == 0)
|
||||
{
|
||||
int returnCode = system("ipmitool sensor list > /tmp/harwareMonitor.txt");
|
||||
string tmpharwareMonitor = tmpDir + "/harwareMonitor.txt";
|
||||
|
||||
string cmd = "ipmitool sensor list > > " + tmpharwareMonitor;
|
||||
int returnCode = system(cmd.c_str());
|
||||
|
||||
if (returnCode)
|
||||
{
|
||||
@ -128,7 +133,7 @@ void hardwareMonitor(int IPMI_SUPPORT)
|
||||
{
|
||||
// parse output file
|
||||
|
||||
ifstream File ("/tmp/harwareMonitor.txt");
|
||||
ifstream File (tmpharwareMonitor);
|
||||
|
||||
if (!File)
|
||||
{
|
||||
@ -137,7 +142,7 @@ void hardwareMonitor(int IPMI_SUPPORT)
|
||||
MessageLog ml(lid);
|
||||
Message msg;
|
||||
Message::Args args;
|
||||
args.add("Error opening /tmp/harwareMonitor.txt!!!");
|
||||
args.add("Error opening harwareMonitor.txt!!!");
|
||||
msg.format(args);
|
||||
ml.logWarningMessage(msg);
|
||||
sleep(300);
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "serverMonitor.h"
|
||||
|
||||
#include "crashtrace.h"
|
||||
#include "installdir.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace servermonitor;
|
||||
@ -27,6 +28,8 @@ using namespace logging;
|
||||
|
||||
extern int swapFlag;
|
||||
|
||||
string tmpDir;
|
||||
|
||||
/*****************************************************************************
|
||||
* @brief main
|
||||
*
|
||||
@ -40,6 +43,11 @@ int main (int argc, char** argv)
|
||||
ServerMonitor serverMonitor;
|
||||
Oam oam;
|
||||
|
||||
string TempFileDir;
|
||||
oam.getSystemConfig("TempFileDir", TempFileDir);
|
||||
|
||||
tmpDir = startup::StartUp::tmpDir() + TempFileDir;
|
||||
|
||||
struct sigaction ign;
|
||||
|
||||
memset(&ign, 0, sizeof(ign));
|
||||
|
@ -39,6 +39,8 @@ uint64_t totalMem;
|
||||
|
||||
pthread_mutex_t MEMORY_LOCK;
|
||||
|
||||
extern string tmpDir;
|
||||
|
||||
/*****************************************************************************************
|
||||
* @brief memoryMonitor Thread
|
||||
*
|
||||
@ -500,9 +502,12 @@ void ServerMonitor::outputProcMemory(bool log)
|
||||
// get top 5 Memory users by process
|
||||
//
|
||||
|
||||
system("ps -e -orss=1,args= | sort -b -k1,1n |tail -n 5 | awk '{print $1,$2}' > /tmp/columnstore_tmp_files/processMem");
|
||||
string tmpprocessMem = tmpDir + "/processMem";
|
||||
|
||||
ifstream oldFile ("/tmp/columnstore_tmp_files/processMem");
|
||||
string cmd = "ps -e -orss=1,args= | sort -b -k1,1n |tail -n 5 | awk '{print $1,$2}' > " + tmpprocessMem;
|
||||
system(cmd.c_str());
|
||||
|
||||
ifstream oldFile (tmpprocessMem);
|
||||
|
||||
string process;
|
||||
long long memory;
|
||||
|
@ -39,6 +39,8 @@ extern ProcessMemoryList pml;
|
||||
extern pthread_mutex_t CPU_LOCK;
|
||||
extern pthread_mutex_t MEMORY_LOCK;
|
||||
|
||||
extern string tmpDir;
|
||||
|
||||
/**
|
||||
* constants define
|
||||
*/
|
||||
@ -252,9 +254,12 @@ void msgProcessor()
|
||||
ByteStream ackmsg;
|
||||
|
||||
// get cache MEMORY stats
|
||||
system("cat /proc/meminfo | grep Cached -m 1 | awk '{print $2}' > /tmp/cached");
|
||||
string tmpcached = tmpDir + "/cached";
|
||||
|
||||
ifstream oldFile ("/tmp/cached");
|
||||
string cmd = "cat /proc/meminfo | grep Cached -m 1 | awk '{print $2}' > " + tmpcached;
|
||||
system(cmd.c_str());
|
||||
|
||||
ifstream oldFile (tmpcached);
|
||||
|
||||
string strCache;
|
||||
long long cache;
|
||||
|
@ -72,6 +72,7 @@ using namespace idbdatafile;
|
||||
#include "cgroupconfigurator.h"
|
||||
|
||||
#include "crashtrace.h"
|
||||
#include "installdir.h"
|
||||
|
||||
namespace primitiveprocessor
|
||||
{
|
||||
@ -147,7 +148,7 @@ void setupSignalHandlers()
|
||||
|
||||
void setupCwd(Config* cf)
|
||||
{
|
||||
string workdir = cf->getConfig("SystemConfig", "WorkingDir");
|
||||
string workdir = startup::StartUp::tmpDir();
|
||||
|
||||
if (workdir.length() == 0)
|
||||
workdir = ".";
|
||||
|
@ -34,6 +34,9 @@
|
||||
#include "utils_utf8.h"
|
||||
#endif
|
||||
|
||||
#include "installdir.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace idbdatafile
|
||||
@ -213,23 +216,8 @@ void IDBPolicy::configIDBPolicy()
|
||||
}
|
||||
|
||||
// Directory in which to place file buffer temporary files.
|
||||
string hdfsRdwrScratch = cf->getConfig("SystemConfig", "hdfsRdwrScratch");
|
||||
|
||||
if ( hdfsRdwrScratch.length() == 0 )
|
||||
{
|
||||
string tmpPath = cf->getConfig("SystemConfig", "TempDiskPath");
|
||||
|
||||
if ( tmpPath.length() == 0 )
|
||||
{
|
||||
hdfsRdwrScratch = "/tmp/hdfsscratch";
|
||||
}
|
||||
else
|
||||
{
|
||||
hdfsRdwrScratch = tmpPath;
|
||||
hdfsRdwrScratch += "/hdfsscratch";
|
||||
}
|
||||
|
||||
}
|
||||
string tmpDir = startup::StartUp::tmpDir();
|
||||
string hdfsRdwrScratch = tmpDir + "/rdwrscratch";
|
||||
|
||||
IDBPolicy::init( idblog, bUseRdwrMemBuffer, hdfsRdwrScratch, hdfsRdwrBufferMaxSize );
|
||||
|
||||
|
@ -1418,8 +1418,7 @@ std::string WECmdArgs::getTmpFileDir()
|
||||
{
|
||||
if (!fTmpFileDir.empty()) return fTmpFileDir;
|
||||
|
||||
fTmpFileDir = config::Config::makeConfig()->getConfig("SystemConfig",
|
||||
"TempFileDir");
|
||||
fTmpFileDir = startup::StartUp::tmpDir() + "columnstore_tmp_files";
|
||||
|
||||
if (fTmpFileDir.empty())
|
||||
throw( runtime_error("Config ERROR: TmpFileDir not found!!"));
|
||||
|
Reference in New Issue
Block a user