1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +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

@ -44,14 +44,14 @@ class ChunkManager;
*/
DctnryCompress0::DctnryCompress0()
{
m_compressionType = 0;
m_compressionType = 0;
}
DctnryCompress0::DctnryCompress0(Log* logger)
{
m_compressionType = 0;
setDebugLevel( logger->getDebugLevel() );
setLogger ( logger );
m_compressionType = 0;
setDebugLevel( logger->getDebugLevel() );
setLogger ( logger );
}
/**
@ -69,15 +69,16 @@ DctnryCompress0::~DctnryCompress0()
*/
DctnryCompress1::DctnryCompress1(Log* logger)
{
m_compressionType = 1;
m_chunkManager = new ChunkManager();
m_compressionType = 1;
m_chunkManager = new ChunkManager();
if (logger)
{
setDebugLevel( logger->getDebugLevel() );
setLogger ( logger );
}
m_chunkManager->fileOp(this);
if (logger)
{
setDebugLevel( logger->getDebugLevel() );
setLogger ( logger );
}
m_chunkManager->fileOp(this);
}
/**
@ -85,37 +86,38 @@ DctnryCompress1::DctnryCompress1(Log* logger)
*/
DctnryCompress1::~DctnryCompress1()
{
if (m_chunkManager)
delete m_chunkManager;
if (m_chunkManager)
delete m_chunkManager;
}
int DctnryCompress1::updateDctnryExtent(IDBDataFile* pFile, int nBlocks)
{
return m_chunkManager->updateDctnryExtent(pFile, nBlocks);
return m_chunkManager->updateDctnryExtent(pFile, nBlocks);
}
IDBDataFile* DctnryCompress1::createDctnryFile(const char *name,int width,const char *mode,int ioBuffSize)
IDBDataFile* DctnryCompress1::createDctnryFile(const char* name, int width, const char* mode, int ioBuffSize)
{
return m_chunkManager->createDctnryFile(
m_dctnryOID, width, m_dbRoot, m_partition, m_segment, name, mode, ioBuffSize);
return m_chunkManager->createDctnryFile(
m_dctnryOID, width, m_dbRoot, m_partition, m_segment, name, mode, ioBuffSize);
}
// @bug 5572 - HDFS usage: add *.tmp file backup flag
IDBDataFile* DctnryCompress1::openDctnryFile(bool useTmpSuffix)
{
return m_chunkManager->getFilePtr(
m_dctnryOID, m_dbRoot, m_partition, m_segment, m_segFileName, "r+b", DEFAULT_BUFSIZ, useTmpSuffix);
return m_chunkManager->getFilePtr(
m_dctnryOID, m_dbRoot, m_partition, m_segment, m_segFileName, "r+b", DEFAULT_BUFSIZ, useTmpSuffix);
}
void DctnryCompress1::closeDctnryFile(bool doFlush, std::map<FID,FID> & columnOids)
void DctnryCompress1::closeDctnryFile(bool doFlush, std::map<FID, FID>& columnOids)
{
if (doFlush)
m_chunkManager->flushChunks(NO_ERROR, columnOids);
else
m_chunkManager->cleanUp(columnOids);
m_dFile = NULL;
}
@ -130,10 +132,11 @@ int DctnryCompress1::readDBFile(IDBDataFile* pFile, unsigned char* readBuf, cons
const bool isFbo)
{
int fbo = lbid;
if (!isFbo)
RETURN_ON_ERROR(lbidToFbo(lbid, fbo));
return m_chunkManager->readBlock(pFile, readBuf, fbo);
return m_chunkManager->readBlock(pFile, readBuf, fbo);
}
@ -144,27 +147,27 @@ int DctnryCompress1::writeDBFile(IDBDataFile* pFile, const unsigned char* writeB
RETURN_ON_ERROR(lbidToFbo(lbid, fbo));
for (int i = 0; i < numOfBlock; i++)
RETURN_ON_ERROR(m_chunkManager->saveBlock(pFile, writeBuf, fbo+i));
RETURN_ON_ERROR(m_chunkManager->saveBlock(pFile, writeBuf, fbo + i));
return NO_ERROR;
}
int DctnryCompress1::writeDBFileNoVBCache(IDBDataFile* pFile,
const unsigned char * writeBuf, const int fbo,
const int numOfBlock)
const unsigned char* writeBuf, const int fbo,
const int numOfBlock)
{
//int fbo = 0;
//RETURN_ON_ERROR(lbidToFbo(lbid, fbo));
for (int i = 0; i < numOfBlock; i++)
RETURN_ON_ERROR(m_chunkManager->saveBlock(pFile, writeBuf, fbo+i));
RETURN_ON_ERROR(m_chunkManager->saveBlock(pFile, writeBuf, fbo + i));
return NO_ERROR;
}
int DctnryCompress1::flushFile(int rc, std::map<FID,FID> & columnOids)
int DctnryCompress1::flushFile(int rc, std::map<FID, FID>& columnOids)
{
return m_chunkManager->flushChunks(rc, columnOids);
return m_chunkManager->flushChunks(rc, columnOids);
}