1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -21,7 +21,7 @@
*
* jrodriguez@calpont.com *
* *
***************************************************************************/
***************************************************************************/
#pragma once
@ -37,22 +37,20 @@
#include <vector>
/**
@author Jason Rodriguez <jrodriguez@calpont.com>
@author Jason Rodriguez <jrodriguez@calpont.com>
*/
/**
* @brief represents a disk blockrequest
**/
namespace dbbc
{
//Set block cache alogorithm to last recently used by defining LRU.
//Otherwise it will be FIFO.
// 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;
BRM::LBID_t lbid;
BRM::VER_t ver;
} FBData_t;
//@bug 669 Change to list for last recently used cache
@ -61,127 +59,124 @@ typedef std::list<FBData_t>::iterator filebuffer_list_iter_t;
class FileBuffer
{
public:
/**
* @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);
/**
* @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 = 8192);
/**
* @brief class dtor
**/
~FileBuffer();
/**
* @brief retrieve the data in byte* format from this data block
**/
const uint8_t* getData() const
{
return fByteData;
}
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 = 8192);
const uint32_t datLen() const
{
return fDataLen;
}
/**
* @brief retrieve the data in byte* format from this data block
**/
const uint8_t* getData() const
{
return fByteData;
}
uint8_t* getData()
{
return fByteData;
}
/**
* @brief assignment operator
**/
FileBuffer& operator=(const FileBuffer& rhs);
const uint32_t datLen() const
{
return fDataLen;
}
/**
* @brief equality operator is based on lbid@ver
**/
bool operator==(const FileBuffer& rhs) const
{
return (fLbid == rhs.fLbid && fVerid == rhs.fVerid);
}
/**
* @brief assignment operator
**/
FileBuffer& operator= (const FileBuffer& rhs);
/**
* @brief inequality operator
**/
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);
}
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 inequality operator
**/
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
**/
const BRM::VER_t Verid() const
{
return fVerid;
}
void Verid(BRM::VER_t v)
{
fVerid = v;
}
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 number of bytes in this disk blockrequest
**/
/**
* @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;
}
void listLoc(const filebuffer_list_iter_t& loc)
{
fListLoc = loc;
}
/**
* @brief return the number of bytes in this disk blockrequest
**/
const filebuffer_list_iter_t& listLoc() const
{
return fListLoc;
}
void listLoc(const filebuffer_list_iter_t& loc)
{
fListLoc = loc;
}
private:
uint8_t fByteData[WriteEngine::BYTE_PER_BLOCK];
uint32_t fDataLen;
const filebuffer_list_iter_t& listLoc() const
{
return fListLoc;
}
BRM::LBID_t fLbid;
BRM::VER_t fVerid;
filebuffer_list_iter_t fListLoc;
private:
uint8_t fByteData[WriteEngine::BYTE_PER_BLOCK];
uint32_t fDataLen;
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;
}
} // namespace dbbc