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
clang format apply
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
*
|
||||
* jrodriguez@calpont.com *
|
||||
* *
|
||||
***************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -37,21 +37,19 @@
|
||||
#include "blocksize.h"
|
||||
|
||||
/**
|
||||
@author Jason Rodriguez <jrodriguez@calpont.com>
|
||||
@author Jason Rodriguez <jrodriguez@calpont.com>
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief represents a disk blockrequest
|
||||
**/
|
||||
namespace dbbc
|
||||
{
|
||||
|
||||
typedef struct FBData
|
||||
{
|
||||
BRM::LBID_t lbid;
|
||||
BRM::VER_t ver;
|
||||
uint8_t hits;
|
||||
BRM::LBID_t lbid;
|
||||
BRM::VER_t ver;
|
||||
uint8_t hits;
|
||||
} FBData_t;
|
||||
|
||||
//@bug 669 Change to list for least recently used cache
|
||||
@ -60,125 +58,122 @@ typedef std::list<FBData_t>::iterator filebuffer_list_iter_t;
|
||||
|
||||
class FileBuffer
|
||||
{
|
||||
public:
|
||||
FileBuffer();
|
||||
/**
|
||||
* @brief copy ctor
|
||||
**/
|
||||
FileBuffer(const FileBuffer& fb);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @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);
|
||||
|
||||
FileBuffer();
|
||||
/**
|
||||
* @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
|
||||
**/
|
||||
~FileBuffer();
|
||||
|
||||
/**
|
||||
* @brief disk block lbid@ver and empty data
|
||||
**/
|
||||
FileBuffer(const BRM::LBID_t lbid, const BRM::VER_t ver);
|
||||
/**
|
||||
* @brief set the data value of this block to d have len bytestream
|
||||
**/
|
||||
void setData(const uint8_t* d, const int len);
|
||||
void setData(const uint8_t* d); // assumes len = 8192
|
||||
|
||||
/**
|
||||
* @brief class dtor
|
||||
**/
|
||||
~FileBuffer();
|
||||
/**
|
||||
* @brief retrieve the data in byte* format from this data block
|
||||
**/
|
||||
inline const uint8_t* getData() const
|
||||
{
|
||||
return fByteData;
|
||||
}
|
||||
inline uint8_t* getData()
|
||||
{
|
||||
return fByteData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set the data value of this block to d have len bytestream
|
||||
**/
|
||||
void setData(const uint8_t* d, const int len);
|
||||
void setData(const uint8_t* d); // assumes len = 8192
|
||||
inline uint32_t datLen() const
|
||||
{
|
||||
return fDataLen;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief retrieve the data in byte* format from this data block
|
||||
**/
|
||||
inline const uint8_t* getData() const
|
||||
{
|
||||
return fByteData;
|
||||
}
|
||||
inline uint8_t* getData()
|
||||
{
|
||||
return fByteData;
|
||||
}
|
||||
/**
|
||||
* @brief assignment operator
|
||||
**/
|
||||
FileBuffer& operator=(const FileBuffer& rhs);
|
||||
|
||||
inline uint32_t datLen() const
|
||||
{
|
||||
return fDataLen;
|
||||
}
|
||||
/**
|
||||
* @brief equality operator is based on lbid@ver
|
||||
**/
|
||||
inline bool operator==(const FileBuffer& rhs) const
|
||||
{
|
||||
return (fLbid == rhs.fLbid && fVerid == rhs.fVerid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief assignment operator
|
||||
**/
|
||||
FileBuffer& operator= (const FileBuffer& rhs);
|
||||
/**
|
||||
* @brief inequality operator
|
||||
**/
|
||||
inline bool operator!=(const FileBuffer& rhs) const
|
||||
{
|
||||
return (!(fLbid == rhs.fLbid && fVerid == rhs.fVerid));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief equality operator is based on lbid@ver
|
||||
**/
|
||||
inline 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
|
||||
**/
|
||||
inline BRM::LBID_t Lbid() const
|
||||
{
|
||||
return fLbid;
|
||||
}
|
||||
inline void Lbid(const BRM::LBID_t l)
|
||||
{
|
||||
fLbid = l;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief inequality operator
|
||||
**/
|
||||
inline bool operator!=(const FileBuffer& rhs) const
|
||||
{
|
||||
return (!(fLbid == rhs.fLbid && fVerid == rhs.fVerid));
|
||||
}
|
||||
/**
|
||||
* @brief return the version of this disk block. ignored for range retrievals
|
||||
**/
|
||||
inline BRM::VER_t Verid() const
|
||||
{
|
||||
return fVerid;
|
||||
}
|
||||
inline void Verid(BRM::VER_t v)
|
||||
{
|
||||
fVerid = v;
|
||||
}
|
||||
|
||||
FileBuffer* thisPtr()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* @brief return the lbid value of disk bloc
|
||||
**/
|
||||
inline BRM::LBID_t Lbid() const
|
||||
{
|
||||
return fLbid;
|
||||
}
|
||||
inline void Lbid(const BRM::LBID_t l)
|
||||
{
|
||||
fLbid = l;
|
||||
}
|
||||
/**
|
||||
* @brief return the number of bytes in this disk blockrequest
|
||||
**/
|
||||
|
||||
/**
|
||||
* @brief return the version of this disk block. ignored for range retrievals
|
||||
**/
|
||||
inline BRM::VER_t Verid() const
|
||||
{
|
||||
return fVerid;
|
||||
}
|
||||
inline void Verid(BRM::VER_t v)
|
||||
{
|
||||
fVerid = v;
|
||||
}
|
||||
inline void listLoc(const filebuffer_list_iter_t& loc)
|
||||
{
|
||||
fListLoc = loc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief return the number of bytes in this disk blockrequest
|
||||
**/
|
||||
inline const filebuffer_list_iter_t& listLoc() const
|
||||
{
|
||||
return fListLoc;
|
||||
}
|
||||
|
||||
inline void listLoc(const filebuffer_list_iter_t& loc)
|
||||
{
|
||||
fListLoc = loc;
|
||||
}
|
||||
|
||||
inline const filebuffer_list_iter_t& listLoc() const
|
||||
{
|
||||
return fListLoc;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
uint8_t fByteData[BLOCK_SIZE];
|
||||
uint32_t fDataLen;
|
||||
BRM::LBID_t fLbid;
|
||||
BRM::VER_t fVerid;
|
||||
filebuffer_list_iter_t fListLoc;
|
||||
private:
|
||||
uint8_t fByteData[BLOCK_SIZE];
|
||||
uint32_t fDataLen;
|
||||
BRM::LBID_t fLbid;
|
||||
BRM::VER_t fVerid;
|
||||
filebuffer_list_iter_t fListLoc;
|
||||
};
|
||||
|
||||
typedef std::vector<FileBuffer> FileBufferPool_t;
|
||||
|
||||
}
|
||||
} // namespace dbbc
|
||||
|
Reference in New Issue
Block a user