From d47980ceabaf46fe5b0322ea5bbefa5a33b7a673 Mon Sep 17 00:00:00 2001 From: Patrick LeBlanc Date: Mon, 9 Sep 2019 09:50:30 -0500 Subject: [PATCH] MCOL-3488. Chunk shifting failed with SM enabled. The ChunkManager class was getting an IDBFileSystem instance in a different way than seemingly everything else. Added code to allow it to get an SMFileSystem if cloud storage is specified. --- writeengine/shared/we_chunkmanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/writeengine/shared/we_chunkmanager.cpp b/writeengine/shared/we_chunkmanager.cpp index c6bf3ef50..75a8feff8 100644 --- a/writeengine/shared/we_chunkmanager.cpp +++ b/writeengine/shared/we_chunkmanager.cpp @@ -47,6 +47,7 @@ using namespace execplan; #include "IDBDataFile.h" #include "IDBPolicy.h" +#include "cloudio/SMFileSystem.h" using namespace idbdatafile; namespace @@ -96,7 +97,9 @@ ChunkManager::ChunkManager() : fMaxActiveChunkNum(100), fLenCompressed(0), fIsBu fLocalModuleId(Config::getLocalModuleID()), fFs(fIsHdfs ? IDBFileSystem::getFs(IDBDataFile::HDFS) : - IDBFileSystem::getFs(IDBDataFile::BUFFERED)) + IDBPolicy::useCloud() ? + IDBFileSystem::getFs(IDBDataFile::CLOUD) : + IDBFileSystem::getFs(IDBDataFile::BUFFERED)) { fUserPaddings = Config::getNumCompressedPadBlks() * BYTE_PER_BLOCK; fCompressor.numUserPaddingBytes(fUserPaddings); @@ -2316,7 +2319,7 @@ int ChunkManager::swapTmpFile(const string& src, const string& dest) { // return value int rc = NO_ERROR; - + // if no change to the cdf, the tmp may not exist, no need to swap. if (!fFs.exists(src.c_str())) return rc;