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

MCOL-3488. Found places with similar code.

This commit is contained in:
Patrick LeBlanc
2019-09-09 12:27:13 -05:00
parent d47980ceab
commit 9c7e2e923e
3 changed files with 15 additions and 7 deletions

View File

@ -486,8 +486,9 @@ int RedistributeWorkerThread::sendData()
int16_t source = fPlanEntry.source; int16_t source = fPlanEntry.source;
int16_t dest = fPlanEntry.destination; int16_t dest = fPlanEntry.destination;
IDBDataFile::Types fileType = IDBDataFile::Types fileType = (IDBPolicy::useHdfs() ? IDBDataFile::HDFS :
(IDBPolicy::useHdfs() ? IDBDataFile::HDFS : IDBDataFile::UNBUFFERED); IDBPolicy::useCloud() ? IDBDataFile::CLOUD : IDBDataFile::UNBUFFERED);
IDBFileSystem& fs = IDBFileSystem::getFs( fileType ); IDBFileSystem& fs = IDBFileSystem::getFs( fileType );
if ((remotePM) && (fileType != IDBDataFile::HDFS)) if ((remotePM) && (fileType != IDBDataFile::HDFS))
@ -1519,8 +1520,11 @@ void RedistributeWorkerThread::handleDataAbort(SBS& sbs, size_t& size)
if (fNewFilePtr != NULL) if (fNewFilePtr != NULL)
closeFile(fNewFilePtr); closeFile(fNewFilePtr);
IDBFileSystem& fs = IDBFileSystem::getFs( IDBFileSystem& fs = (IDBPolicy::useHdfs() ?
(IDBPolicy::useHdfs() ? IDBDataFile::HDFS : IDBDataFile::UNBUFFERED) ); IDBFileSystem::getFs(IDBDataFile::HDFS) :
IDBPolicy::useCloud() ?
IDBFileSystem::getFs(IDBDataFile::CLOUD) :
IDBFileSystem::getFs(IDBDataFile::BUFFERED));
// remove local files // remove local files
for (set<string>::iterator i = fNewDirSet.begin(); i != fNewDirSet.end(); i++) for (set<string>::iterator i = fNewDirSet.begin(); i != fNewDirSet.end(); i++)

View File

@ -183,6 +183,8 @@ struct ColumnThread
if (bUsingHdfs) if (bUsingHdfs)
fileType = IDBDataFile::HDFS; fileType = IDBDataFile::HDFS;
else if (IDBPolicy::useCloud())
fileType = IDBDataFile::CLOUD;
else else
fileType = IDBDataFile::UNBUFFERED; fileType = IDBDataFile::UNBUFFERED;

View File

@ -49,9 +49,11 @@ namespace WriteEngine
// on useHdfs() to tell me which FileSystem reference to get. // on useHdfs() to tell me which FileSystem reference to get.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
ConfirmHdfsDbFile::ConfirmHdfsDbFile() : ConfirmHdfsDbFile::ConfirmHdfsDbFile() :
fFs( (idbdatafile::IDBPolicy::useHdfs()) ? fFs(idbdatafile::IDBPolicy::useHdfs() ?
idbdatafile::IDBFileSystem::getFs(idbdatafile::IDBDataFile::HDFS) : idbdatafile::IDBFileSystem::getFs(idbdatafile::IDBDataFile::HDFS) :
idbdatafile::IDBFileSystem::getFs(idbdatafile::IDBDataFile::BUFFERED)) idbdatafile::IDBPolicy::useCloud() ?
idbdatafile::IDBFileSystem::getFs(idbdatafile::IDBDataFile::CLOUD) :
idbdatafile::IDBFileSystem::getFs(idbdatafile::IDBDataFile::BUFFERED))
{ {
} }