1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +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

@ -36,231 +36,335 @@
namespace dmlpackage
{
/** @brief abstract class that defines the general interface and
* implemetation of a CalpontDMLPackage
/** @brief abstract class that defines the general interface and
* implemetation of a CalpontDMLPackage
*/
class CalpontDMLPackage
{
public:
/** @brief ctor
*/
class CalpontDMLPackage
CalpontDMLPackage();
/** @brief ctor
*
* @param schemaName the schema of the table being operated on
* @param tableName the name of the table being operated on
* @param dmlStatement the dml statement
* @param sessionID the session id
*/
CalpontDMLPackage( std::string schemaName, std::string tableName,
std::string dmlStatement, int sessionID );
/** @brief dtor
*/
virtual ~CalpontDMLPackage();
/** @brief write a CalpontDMLPackage to a ByteStream
*
* @param bytestream the ByteStream to write to
*/
virtual int write( messageqcpp::ByteStream& bytestream ) = 0;
/** @brief read a CalpontDMLPackage from a ByteStream
*
* @param bytestream the ByteStream to read from
*/
virtual int read( messageqcpp::ByteStream& bytestream ) = 0;
/** @brief build a CalpontDMLPackage from a string buffer
*
* @param buffer the row buffer
* @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer
*/
virtual int buildFromBuffer( std::string& buffer, int columns, int rows ) = 0;
/** @brief build a CalpontDMLPackage from a parsed SqlStatement
*
* @param sqlStatement the parsed SqlStatement
*/
virtual int buildFromSqlStatement( SqlStatement& sqlStatement ) = 0;
/** @brief build a CalpontDMLPackage from valuelist built from mysql table fields
*
* @param tableValuesMap the value list for each column in the table
* @param colNameList the column name for each column
* @param columns number of columns in the table
* @param rows number of rows to be touched
*/
virtual int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows, NullValuesBitset& nullValues) = 0;
/** @brief get the table object
*/
DMLTable* get_Table()
{
return fTable;
}
public:
/** @brief ctor
*/
CalpontDMLPackage();
/** @brief set the DML statement (the parsed statement)
*
* @param statement the dml statement to set
*/
void set_DMLStatement( const std::string& statement )
{
fDMLStatement = statement;
}
/** @brief ctor
*
* @param schemaName the schema of the table being operated on
* @param tableName the name of the table being operated on
* @param dmlStatement the dml statement
* @param sessionID the session id
*/
CalpontDMLPackage( std::string schemaName, std::string tableName,
std::string dmlStatement, int sessionID );
/** @brief get the DML statement (the parsed statement)
*/
const std::string get_DMLStatement() const
{
return fDMLStatement;
}
/** @brief dtor
*/
virtual ~CalpontDMLPackage();
/** @brief set the SQL statement (the original SQL statement)
*
* @param statement the SQL statement to set (the original SQL statement with quotes)
*/
void set_SQLStatement( const std::string& statement )
{
fSQLStatement = statement;
}
/** @brief write a CalpontDMLPackage to a ByteStream
*
* @param bytestream the ByteStream to write to
*/
virtual int write( messageqcpp::ByteStream& bytestream ) = 0;
/** @brief get the SQL statement (the original SQL statement)
*/
const std::string get_SQLStatement() const
{
return fSQLStatement;
}
/** @brief read a CalpontDMLPackage from a ByteStream
*
* @param bytestream the ByteStream to read from
*/
virtual int read( messageqcpp::ByteStream& bytestream ) = 0;
/** @brief get the logging flag
*/
const bool get_Logging() const
{
return fLogging;
}
/** @brief build a CalpontDMLPackage from a string buffer
*
* @param buffer the row buffer
* @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer
*/
virtual int buildFromBuffer( std::string& buffer, int columns, int rows ) = 0;
/** @brief set the logging flag
*
* @param logging the logging flag to set
*/
void set_Logging( bool logging )
{
fLogging = logging;
}
/** @brief build a CalpontDMLPackage from a parsed SqlStatement
*
* @param sqlStatement the parsed SqlStatement
*/
virtual int buildFromSqlStatement( SqlStatement& sqlStatement ) = 0;
/** @brief get the logending flag
*/
const bool get_Logending() const
{
return fLogending;
}
/** @brief build a CalpontDMLPackage from valuelist built from mysql table fields
*
* @param tableValuesMap the value list for each column in the table
* @param colNameList the column name for each column
* @param columns number of columns in the table
* @param rows number of rows to be touched
*/
virtual int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows, NullValuesBitset& nullValues) = 0;
/** @brief set the logending flag
*
* @param logending the logending flag to set
*/
void set_Logending( bool logending )
{
fLogending = logending;
}
/** @brief get the table object
*/
DMLTable* get_Table() { return fTable; }
/** @brief get the isFromCol flag
*/
const bool get_IsFromCol() const
{
return fIsFromCol;
}
/** @brief set the DML statement (the parsed statement)
*
* @param statement the dml statement to set
*/
void set_DMLStatement( const std::string& statement ) { fDMLStatement = statement; }
/** @brief set the update column from column flag
*
* @param logging the logging flag to set
*/
void set_IsFromCol ( bool isFromCol )
{
fIsFromCol = isFromCol;
}
/** @brief set the Table name
*
* @param tableName the name to set
*/
void set_TableName( std::string& tableName )
{
fTableName = tableName;
/** @brief get the DML statement (the parsed statement)
*/
const std::string get_DMLStatement() const { return fDMLStatement; }
if (fTable != 0)
fTable->set_TableName(tableName);
}
/** @brief set the SQL statement (the original SQL statement)
*
* @param statement the SQL statement to set (the original SQL statement with quotes)
*/
void set_SQLStatement( const std::string& statement ) { fSQLStatement = statement; }
/** @brief get the Table name
*/
const std::string get_TableName() const
{
return fTableName;
}
/** @brief get the SQL statement (the original SQL statement)
*/
const std::string get_SQLStatement() const { return fSQLStatement; }
/** @brief set the Schema name
*
* @param the schema to set
*/
void set_SchemaName( std::string& schemaName )
{
fSchemaName = schemaName;
/** @brief get the logging flag
*/
const bool get_Logging() const { return fLogging; }
if (fTable != 0)
fTable->set_SchemaName(schemaName);
}
/** @brief set the logging flag
*
* @param logging the logging flag to set
*/
void set_Logging( bool logging ) { fLogging = logging; }
/** @brief get the Schema name
*/
const std::string get_SchemaName() const
{
return fSchemaName;
}
/** @brief get the logending flag
*/
const bool get_Logending() const { return fLogending; }
/** @brief does this dml statement have a filter
*/
bool HasFilter() const
{
return fHasFilter;
}
void HasFilter( bool hasFilter)
{
fHasFilter = hasFilter;
}
/** @brief set the logending flag
*
* @param logending the logending flag to set
*/
void set_Logending( bool logending ) { fLogending = logending; }
/** @brief get the filter statement
*/
const std::string get_QueryString() const
{
return fQueryString;
}
/** @brief get the isFromCol flag
*/
const bool get_IsFromCol() const { return fIsFromCol; }
/** @brief set the sessionID associated with this package
*/
void set_SessionID( int sessionID )
{
fSessionID = sessionID;
}
/** @brief set the update column from column flag
*
* @param logging the logging flag to set
*/
void set_IsFromCol ( bool isFromCol ) { fIsFromCol = isFromCol; }
/** @brief set the Table name
*
* @param tableName the name to set
*/
void set_TableName( std::string& tableName )
{
fTableName = tableName;
if(fTable != 0)
fTable->set_TableName(tableName);
}
/** @brief get the sessionID associated with this package
*/
int get_SessionID() const
{
return fSessionID;
}
/** @brief get the Table name
*/
const std::string get_TableName() const { return fTableName; }
/** @brief set the transaction ID associated with this package
*/
void set_TxnID( execplan::CalpontSystemCatalog::SCN txnID )
{
fTxnId = txnID;
}
/** @brief set the Schema name
*
* @param the schema to set
*/
void set_SchemaName( std::string& schemaName )
{
fSchemaName = schemaName;
if(fTable != 0)
fTable->set_SchemaName(schemaName);
}
/** @brief get the transaction ID associated with this package
*/
execplan::CalpontSystemCatalog::SCN get_TxnID() const
{
return fTxnId;
}
/** @brief set the chunkmanager associated with this package
*/
void set_ChunkManager( WriteEngine::ChunkManager* cm )
{
fCM = cm;
}
/** @brief get the Schema name
*/
const std::string get_SchemaName() const { return fSchemaName; }
/** @brief get the chunkmanager associated with this package
*/
WriteEngine::ChunkManager* get_ChunkManager() const
{
return fCM;
}
/** @brief does this dml statement have a filter
*/
bool HasFilter() const { return fHasFilter; }
void HasFilter( bool hasFilter) { fHasFilter = hasFilter; }
/** @brief get the ExecutionPlan associated with this package
*/
boost::shared_ptr<messageqcpp::ByteStream> get_ExecutionPlan()
{
return fPlan;
}
/** @brief get the filter statement
*/
const std::string get_QueryString() const { return fQueryString; }
bool get_isInsertSelect()
{
return fIsInsertSelect;
}
void set_isInsertSelect( const bool isInsertSelect )
{
fIsInsertSelect = isInsertSelect;
}
/** @brief set the sessionID associated with this package
*/
void set_SessionID( int sessionID ) { fSessionID = sessionID; }
bool get_isBatchInsert()
{
return fIsBatchInsert;
}
void set_isBatchInsert( const bool isBatchInsert )
{
fIsBatchInsert = isBatchInsert;
}
/** @brief get the sessionID associated with this package
*/
int get_SessionID() const { return fSessionID; }
bool get_isAutocommitOn()
{
return fIsAutocommitOn;
}
void set_isAutocommitOn( const bool isAutocommitOn )
{
fIsAutocommitOn = isAutocommitOn;
}
/** @brief set the transaction ID associated with this package
*/
void set_TxnID( execplan::CalpontSystemCatalog::SCN txnID ) { fTxnId = txnID; }
bool get_isWarnToError()
{
return fIsWarnToError;
}
void set_isWarnToError( const bool isWarnToError )
{
fIsWarnToError = isWarnToError;
}
/** @brief get the transaction ID associated with this package
*/
execplan::CalpontSystemCatalog::SCN get_TxnID() const { return fTxnId; }
/** @brief set the chunkmanager associated with this package
*/
void set_ChunkManager( WriteEngine::ChunkManager* cm ) { fCM = cm; }
uint32_t getTableOid()
{
return fTableOid;
}
void setTableOid( const uint32_t tableOid )
{
fTableOid = tableOid;
}
/** @brief get the chunkmanager associated with this package
*/
WriteEngine::ChunkManager* get_ChunkManager() const { return fCM; }
void uuid(const boost::uuids::uuid& uuid)
{
fUuid = uuid;
}
const boost::uuids::uuid& uuid() const
{
return fUuid;
}
/** @brief get the ExecutionPlan associated with this package
*/
boost::shared_ptr<messageqcpp::ByteStream> get_ExecutionPlan()
{
return fPlan;
}
protected:
bool get_isInsertSelect() { return fIsInsertSelect; }
void set_isInsertSelect( const bool isInsertSelect ) { fIsInsertSelect = isInsertSelect; }
void initializeTable();
bool get_isBatchInsert() { return fIsBatchInsert; }
void set_isBatchInsert( const bool isBatchInsert ) { fIsBatchInsert = isBatchInsert; }
bool get_isAutocommitOn() { return fIsAutocommitOn; }
void set_isAutocommitOn( const bool isAutocommitOn ) { fIsAutocommitOn = isAutocommitOn; }
bool get_isWarnToError() { return fIsWarnToError; }
void set_isWarnToError( const bool isWarnToError ) { fIsWarnToError = isWarnToError; }
uint32_t getTableOid() { return fTableOid; }
void setTableOid( const uint32_t tableOid ) { fTableOid = tableOid; }
void uuid(const boost::uuids::uuid& uuid) { fUuid = uuid; }
const boost::uuids::uuid& uuid() const { return fUuid; }
protected:
void initializeTable();
std::string fSchemaName;
std::string fTableName;
std::string fDMLStatement;
std::string fSQLStatement;
std::string fQueryString;
int fSessionID;
boost::uuids::uuid fUuid;
execplan::CalpontSystemCatalog::SCN fTxnId;
boost::shared_ptr<messageqcpp::ByteStream> fPlan;
DMLTable *fTable;
bool fHasFilter;
bool fLogging;
bool fLogending;
bool fIsFromCol;
std::string StripLeadingWhitespace( std::string value );
bool fIsInsertSelect;
bool fIsBatchInsert;
bool fIsAutocommitOn;
bool fIsWarnToError;
uint32_t fTableOid;
WriteEngine::ChunkManager* fCM;
};
std::string fSchemaName;
std::string fTableName;
std::string fDMLStatement;
std::string fSQLStatement;
std::string fQueryString;
int fSessionID;
boost::uuids::uuid fUuid;
execplan::CalpontSystemCatalog::SCN fTxnId;
boost::shared_ptr<messageqcpp::ByteStream> fPlan;
DMLTable* fTable;
bool fHasFilter;
bool fLogging;
bool fLogending;
bool fIsFromCol;
std::string StripLeadingWhitespace( std::string value );
bool fIsInsertSelect;
bool fIsBatchInsert;
bool fIsAutocommitOn;
bool fIsWarnToError;
uint32_t fTableOid;
WriteEngine::ChunkManager* fCM;
};
}
#endif //CALPONTDMLPACKAGE_H