You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-21 13:40:58 +03:00
@@ -1359,15 +1359,13 @@ ioManager::ioManager(FileBufferMgr& fbm,
|
|||||||
go();
|
go();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ioManager::buildOidFileName(const BRM::OID_t oid, const uint16_t dbRoot, const uint16_t partNum, const uint32_t segNum, char* file_name)
|
void ioManager::buildOidFileName(const BRM::OID_t oid, uint16_t dbRoot, const uint32_t partNum, const uint16_t segNum, char* file_name)
|
||||||
{
|
{
|
||||||
if (fFileOp.getFileName(oid, file_name, dbRoot, partNum, segNum) != WriteEngine::NO_ERROR)
|
// when it's a request for the version buffer, the dbroot comes in as 0 for legacy reasons
|
||||||
{
|
if (dbRoot == 0 && oid < 1000)
|
||||||
file_name[0] = 0;
|
dbRoot = fdbrm.getDBRootOfVBOID(oid);
|
||||||
throw std::runtime_error("fileOp.getFileName failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
//cout << "Oid2Filename o: " << oid << " n: " << file_name << endl;
|
fFileOp.getFileNameForPrimProc(oid, file_name, dbRoot, partNum, segNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int ioManager::localLbidLookup(BRM::LBID_t lbid,
|
const int ioManager::localLbidLookup(BRM::LBID_t lbid,
|
||||||
|
|||||||
@@ -83,9 +83,9 @@ public:
|
|||||||
uint32_t& fileBlockOffset);
|
uint32_t& fileBlockOffset);
|
||||||
|
|
||||||
void buildOidFileName(const BRM::OID_t oid,
|
void buildOidFileName(const BRM::OID_t oid,
|
||||||
const uint16_t dbRoot,
|
uint16_t dbRoot,
|
||||||
const uint16_t partNum,
|
const uint32_t partNum,
|
||||||
const uint32_t segNum,
|
const uint16_t segNum,
|
||||||
char* file_name);
|
char* file_name);
|
||||||
|
|
||||||
const uint32_t getExtentRows()
|
const uint32_t getExtentRows()
|
||||||
@@ -153,7 +153,6 @@ private:
|
|||||||
uint32_t fDecreaseOpenFilesCount;
|
uint32_t fDecreaseOpenFilesCount;
|
||||||
bool fFDCacheTrace;
|
bool fFDCacheTrace;
|
||||||
std::ofstream fFDTraceFile;
|
std::ofstream fFDTraceFile;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// @bug2631, for remount filesystem by loadBlock() in primitiveserver
|
// @bug2631, for remount filesystem by loadBlock() in primitiveserver
|
||||||
|
|||||||
@@ -2412,6 +2412,29 @@ int FileOp::oid2FileName( FID fid,
|
|||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FileOp::getFileNameForPrimProc(FID fid,
|
||||||
|
char* fullFileName,
|
||||||
|
uint16_t dbRoot,
|
||||||
|
uint32_t partition,
|
||||||
|
uint16_t segment) const
|
||||||
|
{
|
||||||
|
string dbRootPath = Config::getDBRootByNum(dbRoot);
|
||||||
|
if (dbRootPath.empty())
|
||||||
|
{
|
||||||
|
ostringstream oss;
|
||||||
|
oss << "(dbroot " << dbRoot << " offline)";
|
||||||
|
dbRootPath = oss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
// different filenames for the version buffer files
|
||||||
|
if (fid < 1000)
|
||||||
|
snprintf(fullFileName, FILE_NAME_SIZE, "%s/versionbuffer.cdf", dbRootPath.c_str());
|
||||||
|
else
|
||||||
|
snprintf(fullFileName, FILE_NAME_SIZE, "%s/%03u.dir/%03u.dir/%03u.dir/%03u.dir/%03u.dir/FILE%03d.cdf",
|
||||||
|
dbRootPath.c_str(), fid >> 24, (fid & 0x00ff0000) >> 16, (fid & 0x0000ff00) >> 8,
|
||||||
|
fid & 0x000000ff, partition, segment);
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************
|
/***********************************************************
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
* Search for directory path associated with specified OID.
|
* Search for directory path associated with specified OID.
|
||||||
|
|||||||
@@ -310,6 +310,12 @@ public:
|
|||||||
uint32_t partition,
|
uint32_t partition,
|
||||||
uint16_t segment ) const;
|
uint16_t segment ) const;
|
||||||
|
|
||||||
|
/* Added for MCOL-3251 */
|
||||||
|
void getFileNameForPrimProc(FID fid, char* fileName,
|
||||||
|
uint16_t dbRoot,
|
||||||
|
uint32_t partition,
|
||||||
|
uint16_t segment ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Construct directory path for the specified fid (OID), DBRoot, and
|
* @brief Construct directory path for the specified fid (OID), DBRoot, and
|
||||||
* partition number. Directory does not have to exist, nor is it created.
|
* partition number. Directory does not have to exist, nor is it created.
|
||||||
|
|||||||
Reference in New Issue
Block a user