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

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -45,107 +45,142 @@
/**
* @brief represents a disk blockrequest
**/
namespace dbbc {
namespace dbbc
{
//Set block cache alogorithm to last recently used by defining LRU.
//Otherwise it will be FIFO.
typedef struct FBData{
BRM::LBID_t lbid;
BRM::VER_t ver;
typedef struct FBData
{
BRM::LBID_t lbid;
BRM::VER_t ver;
} FBData_t;
//@bug 669 Change to list for last recently used cache
//@bug 669 Change to list for last recently used cache
typedef std::list<FBData_t> filebuffer_list_t;
typedef std::list<FBData_t>::iterator filebuffer_list_iter_t;
class FileBuffer {
class FileBuffer
{
public:
/**
* @brief copy ctor
**/
FileBuffer(const FileBuffer& fb);
/**
* @brief the disk block from lbid@ver, and a data block len bytes long
**/
FileBuffer(const BRM::LBID_t lbid, const BRM::VER_t ver, const uint8_t* data, const uint32_t len);
/**
* @brief copy ctor
**/
FileBuffer(const FileBuffer& fb);
/**
* @brief disk block lbid@ver and empty data
**/
FileBuffer(const BRM::LBID_t lbid, const BRM::VER_t ver);
/**
* @brief the disk block from lbid@ver, and a data block len bytes long
**/
FileBuffer(const BRM::LBID_t lbid, const BRM::VER_t ver, const uint8_t* data, const uint32_t len);
/**
* @brief class dtor
**/
/**
* @brief disk block lbid@ver and empty data
**/
FileBuffer(const BRM::LBID_t lbid, const BRM::VER_t ver);
/**
* @brief class dtor
**/
~FileBuffer();
/**
* @brief set the data value of this block to d have len bytestream
**/
void setData(const uint8_t* d, const int len=8192);
/**
* @brief set the data value of this block to d have len bytestream
**/
void setData(const uint8_t* d, const int len = 8192);
/**
* @brief retrieve the data in byte* format from this data block
**/
const uint8_t* getData() const {return fByteData;}
uint8_t* getData() {return fByteData;}
/**
* @brief retrieve the data in byte* format from this data block
**/
const uint8_t* getData() const
{
return fByteData;
}
uint8_t* getData()
{
return fByteData;
}
const uint32_t datLen() const {return fDataLen;}
const uint32_t datLen() const
{
return fDataLen;
}
/**
* @brief assignment operator
**/
FileBuffer& operator= (const FileBuffer& rhs);
/**
* @brief assignment operator
**/
FileBuffer& operator= (const FileBuffer& rhs);
/**
* @brief equality operator is based on lbid@ver
**/
bool operator==(const FileBuffer& rhs) const {
return (fLbid == rhs.fLbid && fVerid == rhs.fVerid);
}
/**
* @brief equality operator is based on lbid@ver
**/
bool operator==(const FileBuffer& rhs) const
{
return (fLbid == rhs.fLbid && fVerid == rhs.fVerid);
}
/**
* @brief inequality operator
**/
bool operator!=(const FileBuffer& rhs) const {
return (!(fLbid == rhs.fLbid && fVerid == rhs.fVerid));
}
/**
* @brief inequality operator
**/
bool operator!=(const FileBuffer& rhs) const
{
return (!(fLbid == rhs.fLbid && fVerid == rhs.fVerid));
}
FileBuffer* thisPtr() {return this;}
/**
* @brief return the lbid value of disk bloc
**/
const BRM::LBID_t Lbid() const {return fLbid;}
void Lbid(const BRM::LBID_t l) {fLbid=l;}
FileBuffer* thisPtr()
{
return this;
}
/**
* @brief return the lbid value of disk bloc
**/
const BRM::LBID_t Lbid() const
{
return fLbid;
}
void Lbid(const BRM::LBID_t l)
{
fLbid = l;
}
/**
* @brief return the version of this disk block. ignored for range retrievals
**/
const BRM::VER_t Verid() const {return fVerid;}
void Verid(BRM::VER_t v) {fVerid=v;}
/**
* @brief return the version of this disk block. ignored for range retrievals
**/
const BRM::VER_t Verid() const
{
return fVerid;
}
void Verid(BRM::VER_t v)
{
fVerid = v;
}
/**
* @brief return the number of bytes in this disk blockrequest
**/
/**
* @brief return the number of bytes in this disk blockrequest
**/
void listLoc(const filebuffer_list_iter_t& loc) {fListLoc = loc;}
void listLoc(const filebuffer_list_iter_t& loc)
{
fListLoc = loc;
}
const filebuffer_list_iter_t& listLoc() const {return fListLoc;}
const filebuffer_list_iter_t& listLoc() const
{
return fListLoc;
}
private:
uint8_t fByteData[WriteEngine::BYTE_PER_BLOCK];
uint32_t fDataLen;
uint8_t fByteData[WriteEngine::BYTE_PER_BLOCK];
uint32_t fDataLen;
BRM::LBID_t fLbid;
BRM::VER_t fVerid;
filebuffer_list_iter_t fListLoc;
BRM::LBID_t fLbid;
BRM::VER_t fVerid;
filebuffer_list_iter_t fListLoc;
// do not implement
FileBuffer() {};
// do not implement
FileBuffer() {};
};
typedef std::vector<FileBuffer> FileBufferPool_t;