You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
This reverts commit f916e64927
.
This commit is contained in:
@ -59,9 +59,7 @@
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
#include <condition_variable>
|
||||
#include <shared_mutex>
|
||||
|
||||
#include <boost/thread/condition.hpp>
|
||||
#include <pthread.h>
|
||||
//#define NDEBUG
|
||||
#include <cassert>
|
||||
@ -81,7 +79,7 @@ using namespace logging;
|
||||
|
||||
#include "fsutils.h"
|
||||
|
||||
|
||||
#include "rwlock_local.h"
|
||||
|
||||
#include "iomanager.h"
|
||||
#include "liboamcpp.h"
|
||||
@ -257,9 +255,8 @@ struct fdCountCompare
|
||||
typedef multiset<FdCountEntry_t, fdCountCompare> FdCacheCountType_t;
|
||||
|
||||
FdCacheType_t fdcache;
|
||||
std::mutex fdMapMutex;
|
||||
std::shared_mutex localLock;
|
||||
|
||||
boost::mutex fdMapMutex;
|
||||
rwlock::RWLock_local localLock;
|
||||
|
||||
char* alignTo(const char* in, int av)
|
||||
{
|
||||
@ -461,13 +458,13 @@ void* thr_popper(ioManager* arg)
|
||||
|
||||
if (locked)
|
||||
{
|
||||
localLock.unlock_shared();
|
||||
localLock.read_unlock();
|
||||
locked = false;
|
||||
}
|
||||
|
||||
fr = iom->getNextRequest();
|
||||
|
||||
localLock.lock_shared();
|
||||
localLock.read_lock();
|
||||
locked = true;
|
||||
|
||||
if (iom->IOTrace())
|
||||
@ -527,7 +524,7 @@ void* thr_popper(ioManager* arg)
|
||||
|
||||
#ifdef IDB_COMP_POC_DEBUG
|
||||
{
|
||||
std::unique_lock lk(primitiveprocessor::compDebugMutex);
|
||||
boost::mutex::scoped_lock lk(primitiveprocessor::compDebugMutex);
|
||||
|
||||
if (compType != 0)
|
||||
cout << boldStart;
|
||||
@ -860,7 +857,7 @@ void* thr_popper(ioManager* arg)
|
||||
i = fp->pread(&alignedbuff[0], fdit->second->ptrList[idx].first, fdit->second->ptrList[idx].second);
|
||||
#ifdef IDB_COMP_POC_DEBUG
|
||||
{
|
||||
std::unique_lock lk(primitiveprocessor::compDebugMutex);
|
||||
boost::mutex::scoped_lock lk(primitiveprocessor::compDebugMutex);
|
||||
cout << boldStart << "pread1.1(" << fp << ", 0x" << hex << (ptrdiff_t)&alignedbuff[0] << dec
|
||||
<< ", " << fdit->second->ptrList[idx].second << ", " << fdit->second->ptrList[idx].first
|
||||
<< ") = " << i << ' ' << cmpOffFact.quot << ' ' << cmpOffFact.rem << boldStop << endl;
|
||||
@ -907,7 +904,7 @@ void* thr_popper(ioManager* arg)
|
||||
i = fp->pread(&alignedbuff[acc], longSeekOffset, readSize - acc);
|
||||
#ifdef IDB_COMP_POC_DEBUG
|
||||
{
|
||||
std::unique_lock lk(primitiveprocessor::compDebugMutex);
|
||||
boost::mutex::scoped_lock lk(primitiveprocessor::compDebugMutex);
|
||||
cout << "pread1.2(" << fp << ", 0x" << hex << (ptrdiff_t)&alignedbuff[acc] << dec << ", "
|
||||
<< (readSize - acc) << ", " << longSeekOffset << ") = " << i << ' ' << cmpOffFact.quot << ' '
|
||||
<< cmpOffFact.rem << endl;
|
||||
@ -995,7 +992,7 @@ void* thr_popper(ioManager* arg)
|
||||
size_t blen = 4 * 1024 * 1024 + 4;
|
||||
#ifdef IDB_COMP_POC_DEBUG
|
||||
{
|
||||
std::unique_lock lk(primitiveprocessor::compDebugMutex);
|
||||
boost::mutex::scoped_lock lk(primitiveprocessor::compDebugMutex);
|
||||
cout << "decompress(0x" << hex << (ptrdiff_t)&alignedbuff[0] << dec << ", "
|
||||
<< fdit->second->ptrList[cmpOffFact.quot].second << ", 0x" << hex << (ptrdiff_t)uCmpBuf
|
||||
<< dec << ", " << blen << ")" << endl;
|
||||
@ -1016,7 +1013,7 @@ void* thr_popper(ioManager* arg)
|
||||
if (dcrc != 0)
|
||||
{
|
||||
#ifdef IDB_COMP_POC_DEBUG
|
||||
std::unique_lock lk(primitiveprocessor::compDebugMutex);
|
||||
boost::mutex::scoped_lock lk(primitiveprocessor::compDebugMutex);
|
||||
#endif
|
||||
|
||||
if (++decompRetryCount < 30)
|
||||
@ -1085,7 +1082,7 @@ void* thr_popper(ioManager* arg)
|
||||
{
|
||||
if (debugWrite)
|
||||
{
|
||||
std::unique_lock lk(primitiveprocessor::compDebugMutex);
|
||||
boost::mutex::scoped_lock lk(primitiveprocessor::compDebugMutex);
|
||||
cout << boldStart << "i = " << i << ", ptr = 0x" << hex << (ptrdiff_t)&ptr[i * BLOCK_SIZE]
|
||||
<< dec << boldStop << endl;
|
||||
cout << boldStart;
|
||||
@ -1203,22 +1200,23 @@ namespace dbbc
|
||||
{
|
||||
void setReadLock()
|
||||
{
|
||||
localLock.lock_shared();
|
||||
localLock.read_lock();
|
||||
}
|
||||
|
||||
void releaseReadLock()
|
||||
{
|
||||
localLock.unlock_shared();
|
||||
localLock.read_unlock();
|
||||
}
|
||||
|
||||
void dropFDCache()
|
||||
{
|
||||
std::unique_lock lock(localLock);
|
||||
localLock.write_lock();
|
||||
fdcache.clear();
|
||||
localLock.write_unlock();
|
||||
}
|
||||
void purgeFDCache(std::vector<BRM::FileInfo>& files)
|
||||
{
|
||||
std::unique_lock lock(localLock);
|
||||
localLock.write_lock();
|
||||
|
||||
FdCacheType_t::iterator fdit;
|
||||
|
||||
@ -1231,6 +1229,8 @@ void purgeFDCache(std::vector<BRM::FileInfo>& files)
|
||||
if (fdit != fdcache.end())
|
||||
fdcache.erase(fdit);
|
||||
}
|
||||
|
||||
localLock.write_unlock();
|
||||
}
|
||||
|
||||
ioManager::ioManager(FileBufferMgr& fbm, fileBlockRequestQueue& fbrq, int thrCount, int bsPerRead)
|
||||
|
Reference in New Issue
Block a user