You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-02 17:22:27 +03:00
* Fix clang warnings * Remove vim tab guides * initialize variables * 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length * Fix ISO C++17 does not allow 'register' storage class specifier for outdated bison * chars are unsigned on ARM, having if (ival < 0) always false * chars are unsigned by default on ARM and comparison with -1 if always true
101 lines
2.3 KiB
C++
101 lines
2.3 KiB
C++
/* Copyright (C) 2014 InfiniDB, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; version 2 of
|
|
the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
MA 02110-1301, USA. */
|
|
|
|
#pragma once
|
|
// $Id: iomanager.h 655 2008-07-08 16:42:54Z jrodriguez $
|
|
//
|
|
// C++ Interface: iomanager
|
|
//
|
|
// Description:
|
|
//
|
|
//
|
|
// Author: Jason Rodriguez <jrodriguez@calpont.com>
|
|
//
|
|
//
|
|
//
|
|
|
|
/**
|
|
@author Jason Rodriguez <jrodriguez@calpont.com>
|
|
*/
|
|
|
|
#include <pthread.h>
|
|
#include <string>
|
|
|
|
#include "writeengine.h"
|
|
#include "configcpp.h"
|
|
#include "brm.h"
|
|
#include "fileblockrequestqueue.h"
|
|
#include "filebuffermgr.h"
|
|
|
|
namespace dbbc
|
|
{
|
|
class ioManager
|
|
{
|
|
public:
|
|
ioManager(FileBufferMgr& fbm, fileBlockRequestQueue& fbrq, int thrCount, int bsPerRead);
|
|
// ioManager(FileBufferMgr& fbm, int thrCount);
|
|
~ioManager();
|
|
int readerCount() const
|
|
{
|
|
return fThreadCount;
|
|
}
|
|
fileRequest* getNextRequest();
|
|
void go(void);
|
|
void stop();
|
|
FileBufferMgr& fileBufferManager()
|
|
{
|
|
return fIOMfbMgr;
|
|
}
|
|
config::Config* configPtr()
|
|
{
|
|
return fConfig;
|
|
}
|
|
BRM::LBID_t lbidLookup(BRM::LBID_t lbid, BRM::VER_t verid, bool vbFlag, BRM::OID_t& oid, uint32_t& offset);
|
|
void buildOidFileName(const BRM::OID_t oid, char* file_name);
|
|
|
|
uint32_t getExtentSize()
|
|
{
|
|
return fdbrm.getExtentSize();
|
|
}
|
|
|
|
uint32_t blocksPerRead;
|
|
|
|
bool IOTrace() const
|
|
{
|
|
return fIOTrace;
|
|
}
|
|
|
|
private:
|
|
FileBufferMgr& fIOMfbMgr;
|
|
fileBlockRequestQueue& fIOMRequestQueue;
|
|
int fThreadCount;
|
|
pthread_t fPoppertid;
|
|
pthread_t fThreadArr[256];
|
|
int createReaders();
|
|
config::Config* fConfig;
|
|
BRM::DBRM fdbrm;
|
|
WriteEngine::FileOp fFileOp;
|
|
|
|
// do not implement
|
|
ioManager();
|
|
ioManager(const ioManager& iom);
|
|
const ioManager& operator=(const ioManager& iom);
|
|
bool fIOTrace;
|
|
};
|
|
|
|
} // namespace dbbc
|