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

View File

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

View File

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