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

Revert "No boost condition (#2822)" (#2828)

This reverts commit f916e64927.
This commit is contained in:
Roman Nozdrin
2023-04-22 13:49:50 +01:00
committed by GitHub
parent f916e64927
commit 4fe9cd64a3
245 changed files with 2007 additions and 1261 deletions

View File

@ -72,8 +72,7 @@ using namespace rowgroup;
#include "installdir.h"
#include <boost/thread/thread.hpp>
#include <map>
#include <mutex>
#include <boost/thread/mutex.hpp>
#include <boost/version.hpp>
@ -370,7 +369,7 @@ void CalpontSystemCatalog::TableAliasName::unserialize(messageqcpp::ByteStream&
}
/*static*/
std::mutex CalpontSystemCatalog::map_mutex;
boost::mutex CalpontSystemCatalog::map_mutex;
/*static*/
CalpontSystemCatalog::CatalogMap CalpontSystemCatalog::fCatalogMap;
/*static*/
@ -502,7 +501,7 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::lookupOID(const TableColName& ta
checkSysCatVer();
}
std::unique_lock lk2(fOIDmapLock);
boost::mutex::scoped_lock lk2(fOIDmapLock);
if (fOIDmap.size() > 0)
{
@ -732,7 +731,7 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::lookupOID(const TableColName& ta
// delete col[9];
ct.columnOID = coloid;
// populate colinfomap cache and oidbitmap
std::unique_lock lk3(fColinfomapLock);
boost::mutex::scoped_lock lk3(fColinfomapLock);
fColinfomap[coloid] = ct;
return coloid;
}
@ -1037,7 +1036,7 @@ const CalpontSystemCatalog::ColType CalpontSystemCatalog::colType(const OID& Oid
}
// check colinfomap first for system table column or cached column type
std::unique_lock lk3(fColinfomapLock);
boost::mutex::scoped_lock lk3(fColinfomapLock);
if (fColinfomap.size() > 0)
{
@ -1246,7 +1245,7 @@ const CalpontSystemCatalog::ColType CalpontSystemCatalog::colType(const OID& Oid
// populate colinfomap cache and oidbitmap
lk3.lock();
std::unique_lock lk2(fOIDmapLock);
boost::mutex::scoped_lock lk2(fOIDmapLock);
fColinfomap[Oid] = ct;
fOIDmap[tcn] = Oid;
@ -1367,7 +1366,7 @@ const CalpontSystemCatalog::TableColName CalpontSystemCatalog::colName(const OID
}
// check oidmap for system table columns and cached columns
std::unique_lock lk2(fOIDmapLock);
boost::mutex::scoped_lock lk2(fOIDmapLock);
OIDmap::const_iterator iter = fOIDmap.begin();
while (iter != fOIDmap.end())
@ -1872,7 +1871,7 @@ const CalpontSystemCatalog::SCN CalpontSystemCatalog::scn(void) const
/* static */
boost::shared_ptr<CalpontSystemCatalog> CalpontSystemCatalog::makeCalpontSystemCatalog(uint32_t sessionID)
{
std::unique_lock lock(map_mutex);
boost::mutex::scoped_lock lock(map_mutex);
boost::shared_ptr<CalpontSystemCatalog> instance;
CatalogMap::const_iterator it = fCatalogMap.find(sessionID);
@ -1917,7 +1916,7 @@ boost::shared_ptr<CalpontSystemCatalog> CalpontSystemCatalog::makeCalpontSystemC
/* static */
void CalpontSystemCatalog::removeCalpontSystemCatalog(uint32_t sessionID)
{
std::unique_lock lock(map_mutex);
boost::mutex::scoped_lock lock(map_mutex);
DEBUG << "remove calpont system catalog for session " << sessionID << endl;
fCatalogMap.erase(sessionID);
/*
@ -2294,9 +2293,9 @@ const CalpontSystemCatalog::IndexNameList CalpontSystemCatalog::colValueSysconst
boost::algorithm::to_lower(aTableColName.column);
#if BOOST_VERSION < 104000
std::unique_lock lk1(fColIndexListmapLock, false);
boost::mutex::scoped_lock lk1(fColIndexListmapLock, false);
#else
std::unique_lock lk1(fColIndexListmapLock, std::defer_lock);
boost::mutex::scoped_lock lk1(fColIndexListmapLock, boost::defer_lock);
#endif
if (useCache)
@ -2926,7 +2925,7 @@ const CalpontSystemCatalog::ROPair CalpontSystemCatalog::columnRID(const TableCo
tablename=tableColName.table and columnname=tableColName.column;*/
// this function is duplicate to lookupOID() and will be deprecated soon
rp.objnum = lookupOID(tableColName);
std::unique_lock lk2(fOIDmapLock);
boost::mutex::scoped_lock lk2(fOIDmapLock);
ColRIDmap::const_iterator iter = fColRIDmap.find(aTableColName);
@ -2962,18 +2961,18 @@ const CalpontSystemCatalog::RIDList CalpontSystemCatalog::columnRIDs(const Table
checkSysCatVer();
}
std::unique_lock lk1(fTableInfoMapLock);
boost::mutex::scoped_lock lk1(fTableInfoMapLock);
TableInfoMap::const_iterator ti_iter = fTableInfoMap.find(aTableName);
// search fOIDmap for system catalog tables
// or if fTableInfoMap has entry for this table, column oids are cached.
// because columnRIDs(), colType() and tableInfo() are actually binded.
#if BOOST_VERSION < 103800
std::unique_lock lk2(fOIDmapLock, false);
boost::mutex::scoped_lock lk2(fOIDmapLock, false);
#else
std::unique_lock lk2(fOIDmapLock, std::defer_lock);
boost::mutex::scoped_lock lk2(fOIDmapLock, boost::defer_lock);
#endif
std::unique_lock lk3(fColinfomapLock);
boost::mutex::scoped_lock lk3(fColinfomapLock);
if (aTableName.schema == CALPONT_SCHEMA || (useCache && ti_iter != fTableInfoMap.end()))
{
@ -3356,7 +3355,7 @@ const CalpontSystemCatalog::TableName CalpontSystemCatalog::tableName(const OID&
}
// check cache
std::unique_lock lk(fTableNameMapLock);
boost::mutex::scoped_lock lk(fTableNameMapLock);
if (fTableNameMap.size() > 0)
{
@ -3478,7 +3477,7 @@ const CalpontSystemCatalog::ROPair CalpontSystemCatalog::tableRID(const TableNam
// rp.rid = -1; @bug1866 use default
// calpontsys only needs oid
std::unique_lock lk1(fTableInfoMapLock);
boost::mutex::scoped_lock lk1(fTableInfoMapLock);
Tablemap::const_iterator iter = fTablemap.find(aTableName);
if (aTableName.schema.compare("calpontsys") == 0 && iter != fTablemap.end())
@ -3635,7 +3634,7 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::tableAUXColumnOID(const TableNam
checkSysCatVer();
std::unique_lock lk1(fTableAUXColumnOIDMapLock);
boost::mutex::scoped_lock lk1(fTableAUXColumnOIDMapLock);
TableOIDmap::const_iterator iter = fTableAUXColumnOIDMap.find(aTableName);
if (iter != fTableAUXColumnOIDMap.end())
@ -3748,7 +3747,7 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid)
checkSysCatVer();
std::unique_lock lk1(fAUXColumnOIDToTableOIDMapLock);
boost::mutex::scoped_lock lk1(fAUXColumnOIDToTableOIDMapLock);
AUXColumnOIDTableOIDmap::const_iterator iter = fAUXColumnOIDToTableOIDMap.find(oid);
if (iter != fAUXColumnOIDToTableOIDMap.end())
@ -5129,7 +5128,7 @@ const CalpontSystemCatalog::TableInfo CalpontSystemCatalog::tableInfo(const Tabl
return ti;
}
std::unique_lock lk1(fTableInfoMapLock);
boost::mutex::scoped_lock lk1(fTableInfoMapLock);
TableInfoMap::const_iterator ti_iter = fTableInfoMap.find(aTableName);
if (ti_iter != fTableInfoMap.end())
@ -5506,7 +5505,7 @@ void CalpontSystemCatalog::getSchemaInfo(const string& in_schema, int lower_case
// Check whether cache needs to be flushed
checkSysCatVer();
std::unique_lock lk(fSchemaCacheLock);
boost::mutex::scoped_lock lk(fSchemaCacheLock);
set<string>::iterator setIt = fSchemaCache.find(schema);
if (setIt != fSchemaCache.end())
@ -5809,7 +5808,7 @@ void CalpontSystemCatalog::getSchemaInfo(const string& in_schema, int lower_case
}
// populate colinfo cache
// std::unique_lock lk3(fColinfomapLock);
// boost::mutex::scoped_lock lk3(fColinfomapLock);
for (uint32_t i = 0; i < ctList.size(); i++)
fColinfomap[ctList[i].columnOID] = ctList[i];
@ -5858,32 +5857,32 @@ ostream& operator<<(ostream& os, const CalpontSystemCatalog::TableColName& rhs)
void CalpontSystemCatalog::flushCache()
{
std::unique_lock lk1(fOIDmapLock);
boost::mutex::scoped_lock lk1(fOIDmapLock);
fOIDmap.clear();
buildSysOIDmap();
lk1.unlock();
std::unique_lock lk2(fColinfomapLock);
boost::mutex::scoped_lock lk2(fColinfomapLock);
fColinfomap.clear();
buildSysColinfomap();
lk2.unlock();
std::unique_lock lk3(fTableInfoMapLock);
boost::mutex::scoped_lock lk3(fTableInfoMapLock);
fTableInfoMap.clear();
fTablemap.clear();
fTableRIDmap.clear();
buildSysTablemap();
lk3.unlock();
std::unique_lock namemaplk(fTableNameMapLock);
boost::mutex::scoped_lock namemaplk(fTableNameMapLock);
fTableNameMap.clear();
namemaplk.unlock();
std::unique_lock auxlk(fTableAUXColumnOIDMapLock);
boost::mutex::scoped_lock auxlk(fTableAUXColumnOIDMapLock);
fTableAUXColumnOIDMap.clear();
auxlk.unlock();
std::unique_lock auxtotableoidlk(fAUXColumnOIDToTableOIDMapLock);
boost::mutex::scoped_lock auxtotableoidlk(fAUXColumnOIDToTableOIDMapLock);
fAUXColumnOIDToTableOIDMap.clear();
auxtotableoidlk.unlock();
@ -5898,7 +5897,7 @@ void CalpontSystemCatalog::flushCache()
void CalpontSystemCatalog::updateColinfoCache(CalpontSystemCatalog::OIDNextvalMap& oidNextvalMap)
{
std::unique_lock lk(fColinfomapLock);
boost::mutex::scoped_lock lk(fColinfomapLock);
CalpontSystemCatalog::OIDNextvalMap::const_iterator iter = oidNextvalMap.begin();
OID oid = 0;
long long nextVal = 0;
@ -6293,7 +6292,7 @@ void CalpontSystemCatalog::checkSysCatVer()
newScn = fSessionManager->sysCatVerID().currentScn;
}
std::unique_lock sysCatLk(fSyscatSCNLock);
boost::mutex::scoped_lock sysCatLk(fSyscatSCNLock);
if (fSyscatSCN != newScn)
{