1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00

filesystem ambiguaty

This commit is contained in:
Leonid Fedorov
2021-10-26 14:30:57 +00:00
parent 3c4c6687b6
commit 56d8a33f0b
3 changed files with 21 additions and 21 deletions

View File

@@ -102,8 +102,8 @@ RedistributeControl::RedistributeControl() : fInfoFilePtr(NULL), fPlanFilePtr(NU
//struct stat st; //struct stat st;
//if (stat(fRedistributeDir.c_str(), &st) != 0) //if (stat(fRedistributeDir.c_str(), &st) != 0)
//filesystem::path dirPath(fRedistributeDir); //boost::filesystem::path dirPath(fRedistributeDir);
if (filesystem::exists(fRedistributeDir)) if (boost::filesystem::exists(fRedistributeDir))
{ {
// try to open info file for update if dir exists // try to open info file for update if dir exists
RedistributeInfo info; RedistributeInfo info;
@@ -521,7 +521,7 @@ void RedistributeControl::updateState(uint32_t s)
try try
{ {
if (filesystem::exists(fInfoFilePath) && filesystem::exists(fPlanFilePath)) if (boost::filesystem::exists(fInfoFilePath) && boost::filesystem::exists(fPlanFilePath))
{ {
bool mergeOk = false; bool mergeOk = false;
FILE* infoPtr = fopen(fInfoFilePath.c_str(), "r+b"); FILE* infoPtr = fopen(fInfoFilePath.c_str(), "r+b");
@@ -559,19 +559,19 @@ void RedistributeControl::updateState(uint32_t s)
fclose(entryPtr); fclose(entryPtr);
if (mergeOk) if (mergeOk)
filesystem::remove(fPlanFilePath); boost::filesystem::remove(fPlanFilePath);
} }
if (filesystem::exists(fInfoFilePath)) if (boost::filesystem::exists(fInfoFilePath))
{ {
string newInfoPath = fRedistributeDir + "/archive" + InfoFileName + "." + oss.str(); string newInfoPath = fRedistributeDir + "/archive" + InfoFileName + "." + oss.str();
filesystem::rename(fInfoFilePath, newInfoPath); boost::filesystem::rename(fInfoFilePath, newInfoPath);
} }
if (filesystem::exists(fPlanFilePath)) if (boost::filesystem::exists(fPlanFilePath))
{ {
string newPlanPath = fRedistributeDir + "/archive" + PlanFileName + "." + oss.str(); string newPlanPath = fRedistributeDir + "/archive" + PlanFileName + "." + oss.str();
filesystem::rename(fPlanFilePath, newPlanPath); boost::filesystem::rename(fPlanFilePath, newPlanPath);
} }
} }
catch (const std::exception&) catch (const std::exception&)
@@ -592,15 +592,15 @@ void RedistributeControl::updateState(uint32_t s)
// in IDLE state there is no redistribute.info file // in IDLE state there is no redistribute.info file
if (s == RED_STATE_ACTIVE) if (s == RED_STATE_ACTIVE)
{ {
// filesystem::path dirPath(fRedistributeDir); // boost::filesystem::path dirPath(fRedistributeDir);
// if (filesystem::exists(fRedistributeDir) && !filesystem::is_directory(fRedistributeDir)) // if (boost::filesystem::exists(fRedistributeDir) && !boost::filesystem::is_directory(fRedistributeDir))
// filesystem::remove(fRedistributeDir); // boost::filesystem::remove(fRedistributeDir);
if (!filesystem::exists(fRedistributeDir)) if (!boost::filesystem::exists(fRedistributeDir))
{ {
errno = 0; errno = 0;
filesystem::create_directory(fRedistributeDir); boost::filesystem::create_directory(fRedistributeDir);
if (!filesystem::exists(fRedistributeDir)) if (!boost::filesystem::exists(fRedistributeDir))
{ {
int e = errno; int e = errno;
ostringstream oss; ostringstream oss;
@@ -610,10 +610,10 @@ void RedistributeControl::updateState(uint32_t s)
} }
errno = 0; errno = 0;
filesystem::path archivePath(fRedistributeDir + "/archive"); boost::filesystem::path archivePath(fRedistributeDir + "/archive");
filesystem::create_directory(archivePath); boost::filesystem::create_directory(archivePath);
if (!filesystem::exists(archivePath)) if (!boost::filesystem::exists(archivePath))
{ {
int e = errno; int e = errno;
ostringstream oss; ostringstream oss;

View File

@@ -800,13 +800,13 @@ int RedistributeWorkerThread::sendData()
// msg that IDBFileSystem::copyFile() currently swallows. // msg that IDBFileSystem::copyFile() currently swallows.
try try
{ {
filesystem::copy_file(sourceName, destName); boost::filesystem::copy_file(sourceName, destName);
} }
#if BOOST_VERSION >= 105200 #if BOOST_VERSION >= 105200
catch (filesystem::filesystem_error& e) catch (boost::filesystem::filesystem_error& e)
#else #else
catch (filesystem::basic_filesystem_error<filesystem::path>& e) catch (boost::filesystem::basic_filesystem_error<filesystem::path>& e)
#endif #endif
{ {
fErrorCode = RED_EC_COPY_FILE_FAIL; fErrorCode = RED_EC_COPY_FILE_FAIL;

View File

@@ -89,7 +89,7 @@ private:
int connectToWes(int); int connectToWes(int);
int updateDbrm(); int updateDbrm();
void confirmToPeer(); void confirmToPeer();
bool checkDataTransferAck(SBS&, size_t); bool checkDataTransferAck(messageqcpp::SBS&, size_t);
void sendResponse(uint32_t); void sendResponse(uint32_t);