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

@ -49,48 +49,51 @@ class Log;
//------------------------------------------------------------------------------
class AllocExtEntry
{
public:
// Default constructor
AllocExtEntry() : fOid(0),
fColWidth(0),
fDbRoot(0),
fPartNum(0),
fSegNum(0),
fStartLbid(0),
fAllocSize(0),
fHwm(0),
fStatus(NO_ERROR),
fStripeKey(0) { }
public:
// Default constructor
AllocExtEntry()
: fOid(0)
, fColWidth(0)
, fDbRoot(0)
, fPartNum(0)
, fSegNum(0)
, fStartLbid(0)
, fAllocSize(0)
, fHwm(0)
, fStatus(NO_ERROR)
, fStripeKey(0)
{
}
// Used to create entry for an existing extent we are going to add data to.
AllocExtEntry ( OID& oid, int colWidth,
uint16_t dbRoot, uint32_t partNum, uint16_t segNum,
BRM::LBID_t startLbid, int allocSize,
HWM hwm, int status, const std::string& statusMsg,
unsigned int stripeKey ) :
fOid(oid),
fColWidth(colWidth),
fDbRoot(dbRoot),
fPartNum(partNum),
fSegNum(segNum),
fStartLbid(startLbid),
fAllocSize(allocSize),
fHwm(hwm),
fStatus(status),
fStatusMsg(statusMsg),
fStripeKey(stripeKey) { }
// Used to create entry for an existing extent we are going to add data to.
AllocExtEntry(OID& oid, int colWidth, uint16_t dbRoot, uint32_t partNum, uint16_t segNum,
BRM::LBID_t startLbid, int allocSize, HWM hwm, int status, const std::string& statusMsg,
unsigned int stripeKey)
: fOid(oid)
, fColWidth(colWidth)
, fDbRoot(dbRoot)
, fPartNum(partNum)
, fSegNum(segNum)
, fStartLbid(startLbid)
, fAllocSize(allocSize)
, fHwm(hwm)
, fStatus(status)
, fStatusMsg(statusMsg)
, fStripeKey(stripeKey)
{
}
OID fOid; // column OID
int fColWidth; // colum width (in bytes)
uint16_t fDbRoot; // DBRoot of allocated extent
uint32_t fPartNum; // Partition number of allocated extent
uint16_t fSegNum; // Segment number of allocated extent
BRM::LBID_t fStartLbid; // Starting LBID of allocated extent
int fAllocSize; // Number of allocated LBIDS
HWM fHwm; // Starting fbo or hwm of allocated extent
int fStatus; // Status of extent allocation
std::string fStatusMsg; // Status msg of extent allocation
unsigned int fStripeKey;// "Stripe" identifier for this extent
OID fOid; // column OID
int fColWidth; // colum width (in bytes)
uint16_t fDbRoot; // DBRoot of allocated extent
uint32_t fPartNum; // Partition number of allocated extent
uint16_t fSegNum; // Segment number of allocated extent
BRM::LBID_t fStartLbid; // Starting LBID of allocated extent
int fAllocSize; // Number of allocated LBIDS
HWM fHwm; // Starting fbo or hwm of allocated extent
int fStatus; // Status of extent allocation
std::string fStatusMsg; // Status msg of extent allocation
unsigned int fStripeKey; // "Stripe" identifier for this extent
};
//------------------------------------------------------------------------------
@ -100,10 +103,10 @@ public:
//------------------------------------------------------------------------------
struct AllocExtHasher : public std::unary_function<OID, std::size_t>
{
std::size_t operator()(OID val) const
{
return static_cast<std::size_t>(val);
}
std::size_t operator()(OID val) const
{
return static_cast<std::size_t>(val);
}
};
//------------------------------------------------------------------------------
@ -114,69 +117,59 @@ struct AllocExtHasher : public std::unary_function<OID, std::size_t>
//------------------------------------------------------------------------------
class ExtentStripeAlloc
{
public:
public:
/** @brief Constructor
* @param tableOID OID of table for which extents will be allocated.
* @param logger Log object used for debug logging.
*/
ExtentStripeAlloc(OID tableOID, Log* logger);
/** @brief Constructor
* @param tableOID OID of table for which extents will be allocated.
* @param logger Log object used for debug logging.
*/
ExtentStripeAlloc ( OID tableOID,
Log* logger );
/** @brief Destructor
*/
~ExtentStripeAlloc();
/** @brief Destructor
*/
~ExtentStripeAlloc( );
/** @brief Add the specified column to our "stripe" of extents to allocate.
* @param colOID Column OID to be added to extent allocation list.
* @param colWidth Width of column associated with colOID.
*/
void addColumn(OID colOID, int colWidth);
/** @brief Add the specified column to our "stripe" of extents to allocate.
* @param colOID Column OID to be added to extent allocation list.
* @param colWidth Width of column associated with colOID.
*/
void addColumn( OID colOID,
int colWidth );
/** @brief Request an extent allocation for the specified OID and DBRoot.
* A "stripe" of extents for the corresponding table will be allocated
* if no extent exists to satisfy the request; else the previously
* allocated extent will be returned.
* @param oid Column OID extent to be allocated
* @param dbRoot Requested DBRoot for the new extent
* @param partNum (in/out) Partition number of the allocated extent,
* Input if empty DBRoot, else only used as output.
* @param segNum (out) Segment number of the allocated extent
* @param startLbid (out) Starting LBID of the allocated extent
* @param allocSize (out) Number of blocks in the allocated extent
* @param hwm (out) Starting FBO or hwm for the allocated extent
* @param errMsg (out) Error msg associated with the extent allocation
* @return NO_ERROR returned upon success
*/
int allocateExtent(OID oid, uint16_t dbRoot, uint32_t& partNum, uint16_t& segNum, BRM::LBID_t& startLbid,
int& allocSize, HWM& hwm, std::string& errMsg);
/** @brief Request an extent allocation for the specified OID and DBRoot.
* A "stripe" of extents for the corresponding table will be allocated
* if no extent exists to satisfy the request; else the previously
* allocated extent will be returned.
* @param oid Column OID extent to be allocated
* @param dbRoot Requested DBRoot for the new extent
* @param partNum (in/out) Partition number of the allocated extent,
* Input if empty DBRoot, else only used as output.
* @param segNum (out) Segment number of the allocated extent
* @param startLbid (out) Starting LBID of the allocated extent
* @param allocSize (out) Number of blocks in the allocated extent
* @param hwm (out) Starting FBO or hwm for the allocated extent
* @param errMsg (out) Error msg associated with the extent allocation
* @return NO_ERROR returned upon success
*/
int allocateExtent( OID oid,
uint16_t dbRoot,
uint32_t& partNum,
uint16_t& segNum,
BRM::LBID_t& startLbid,
int& allocSize,
HWM& hwm,
std::string& errMsg );
/** @brief Debug print function.
*/
void print();
/** @brief Debug print function.
*/
void print( );
private:
OID fTableOID; // Table extents to be allocated
Log* fLog; // Log used for debug logging
unsigned int fStripeCount; // Extent "stripe" counter
boost::mutex fMapMutex; // protects unordered map access
std::vector<OID> fColOIDs; // Vector of column OIDs
std::vector<int> fColWidths; // Widths associated with fColOIDs
private:
OID fTableOID; // Table extents to be allocated
Log* fLog; // Log used for debug logging
unsigned int fStripeCount; // Extent "stripe" counter
boost::mutex fMapMutex; // protects unordered map access
std::vector<OID> fColOIDs; // Vector of column OIDs
std::vector<int> fColWidths; // Widths associated with fColOIDs
// unordered map where we collect the allocated extents
std::tr1::unordered_multimap<OID, AllocExtEntry, AllocExtHasher> fMap;
// unordered map where we collect the allocated extents
std::tr1::unordered_multimap<OID, AllocExtEntry, AllocExtHasher> fMap;
// disable copy constructor and assignment operator
ExtentStripeAlloc(const ExtentStripeAlloc&);
ExtentStripeAlloc& operator=(const ExtentStripeAlloc&);
// disable copy constructor and assignment operator
ExtentStripeAlloc(const ExtentStripeAlloc&);
ExtentStripeAlloc& operator=(const ExtentStripeAlloc&);
};
} //end of namespace
} // namespace WriteEngine