1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-17 10:37:05 +03:00

chore(codestyle): mark virtual methods as override

This commit is contained in:
Aleksei Antipovskii 2024-09-12 12:27:02 +02:00 committed by Leonid Fedorov
parent 6001db44ab
commit 5556d818f8
303 changed files with 4091 additions and 4894 deletions

View File

@ -58,7 +58,7 @@ class DataCondition
return mError;
}
// Adjust a sigened integer of any size to the range [-absMaxVal , +absMaxVal]
// Adjust a signed integer of any size to the range [-absMaxVal , +absMaxVal]
template <typename T>
void adjustSIntXRange(T& val, T absMaxVal)
{

View File

@ -125,7 +125,7 @@ struct WidthToSIntegralType<16> : _WidthToSIntegralType<16, int128_t>
{
};
void decimalPrecisionAndScale(const utils::NullString& value, int &precision, int &scale);
void decimalPrecisionAndScale(const utils::NullString& value, int& precision, int& scale);
// XXX: It is assumed here that ALL TYPES have width, scale and precision.
// XXX: And then some of them have the type tag itself.
@ -147,8 +147,8 @@ class TypeAttributesStd
/**
@brief Convenience method to get int128 from a std::string.
*/
int128_t decimal128FromString(const std::string& value, bool* saturate = 0) const;
int128_t decimal128FromString(const utils::NullString& value, bool* saturate = 0) const;
int128_t decimal128FromString(const std::string& value, bool* saturate = nullptr) const;
int128_t decimal128FromString(const utils::NullString& value, bool* saturate = nullptr) const;
/**
@brief The method sets the legacy scale and precision of a wide decimal
@ -507,7 +507,7 @@ class SessionParam
long m_timeZone;
public:
SessionParam(long timeZone) : m_timeZone(timeZone)
explicit SessionParam(long timeZone) : m_timeZone(timeZone)
{
}
long timeZone() const
@ -576,7 +576,7 @@ class SimpleValue
class SimpleValueSInt64 : public SimpleValue
{
public:
SimpleValueSInt64(int64_t value) : SimpleValue(value, 0, 0)
explicit SimpleValueSInt64(int64_t value) : SimpleValue(value, 0, 0)
{
}
};
@ -584,7 +584,7 @@ class SimpleValueSInt64 : public SimpleValue
class SimpleValueUInt64 : public SimpleValue
{
public:
SimpleValueUInt64(uint64_t value) : SimpleValue(static_cast<int64_t>(value), 0, 0)
explicit SimpleValueUInt64(uint64_t value) : SimpleValue(static_cast<int64_t>(value), 0, 0)
{
}
};
@ -592,7 +592,7 @@ class SimpleValueUInt64 : public SimpleValue
class SimpleValueSInt128 : public SimpleValue
{
public:
SimpleValueSInt128(int128_t value) : SimpleValue(0, value, 0)
explicit SimpleValueSInt128(int128_t value) : SimpleValue(0, value, 0)
{
}
};
@ -740,7 +740,7 @@ class MinMaxPartitionInfo : public MinMaxInfo
public:
MinMaxPartitionInfo() : m_status(0){};
MinMaxPartitionInfo(const BRM::EMEntry& entry);
explicit MinMaxPartitionInfo(const BRM::EMEntry& entry);
void set_invalid()
{
m_status |= CPINVALID;
@ -859,8 +859,8 @@ class DatabaseQualifiedColumnName
std::string m_column;
public:
DatabaseQualifiedColumnName(const std::string& db, const std::string& table, const std::string& column)
: m_db(db), m_table(table), m_column(column)
DatabaseQualifiedColumnName(std::string db, std::string table, std::string column)
: m_db(std::move(db)), m_table(std::move(table)), m_column(std::move(column))
{
}
const std::string& db() const
@ -880,9 +880,8 @@ class DatabaseQualifiedColumnName
class StoreField
{
public:
virtual ~StoreField()
{
}
virtual ~StoreField() = default;
virtual int32_t colWidth() const = 0;
virtual int32_t precision() const = 0;
virtual int32_t scale() const = 0;
@ -910,9 +909,8 @@ class StoreField
class WriteBatchField
{
public:
virtual ~WriteBatchField()
{
}
virtual ~WriteBatchField() = default;
virtual size_t ColWriteBatchDate(const unsigned char* buf, bool nullVal, ColBatchWriter& ci) = 0;
virtual size_t ColWriteBatchDatetime(const unsigned char* buf, bool nullVal, ColBatchWriter& ci) = 0;
virtual size_t ColWriteBatchTime(const unsigned char* buf, bool nullVal, ColBatchWriter& ci) = 0;
@ -957,9 +955,8 @@ class TypeHandler
public:
static const TypeHandler* find(SystemCatalog::ColDataType typeCode, const TypeAttributesStd& attr);
static const TypeHandler* find_by_ddltype(const ddlpackage::ColumnType& ct);
virtual ~TypeHandler()
{
}
virtual ~TypeHandler() = default;
virtual const string& name() const = 0;
virtual const string print(const TypeAttributesStd& attr) const
{
@ -985,11 +982,11 @@ class TypeHandler
const SimpleColumnParam& prm) const = 0;
virtual SimpleValue getMinValueSimple() const
{
return SimpleValue(std::numeric_limits<int64_t>::min(), std::numeric_limits<int64_t>::min(), 0);
return {std::numeric_limits<int64_t>::min(), std::numeric_limits<int64_t>::min(), 0};
}
virtual SimpleValue getMaxValueSimple() const
{
return SimpleValue(std::numeric_limits<int64_t>::max(), std::numeric_limits<int64_t>::max(), 0);
return {std::numeric_limits<int64_t>::max(), std::numeric_limits<int64_t>::max(), 0};
}
virtual SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const = 0;
@ -1052,18 +1049,18 @@ class TypeHandlerBit : public TypeHandler
const SimpleColumnParam& prm) const override
{
idbassert(0);
return NULL;
return nullptr;
}
SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const override
{
idbassert(0);
return SimpleValue();
return {};
}
boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{
// TODO: How to communicate with write engine?
return boost::any();
return {};
}
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override;
@ -1808,11 +1805,11 @@ class TypeHandlerSDecimal128 : public TypeHandlerXDecimal
}
SimpleValue getMinValueSimple() const override
{
return SimpleValue(std::numeric_limits<int64_t>::min(), datatypes::minInt128, 0);
return {std::numeric_limits<int64_t>::min(), datatypes::minInt128, 0};
}
SimpleValue getMaxValueSimple() const override
{
return SimpleValue(std::numeric_limits<int64_t>::max(), datatypes::maxInt128, 0);
return {std::numeric_limits<int64_t>::max(), datatypes::maxInt128, 0};
}
MinMaxInfo widenMinMaxInfo(const TypeAttributesStd& attr, const MinMaxInfo& a,
const MinMaxInfo& b) const override
@ -1914,7 +1911,7 @@ class TypeHandlerReal : public TypeHandler
SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const override
{
return SimpleValue(); // QQ: real types were not handled in IDB_format()
return {}; // QQ: real types were not handled in IDB_format()
}
std::string format(const SimpleValue& v, const TypeAttributesStd& attr) const override
{
@ -2047,13 +2044,13 @@ class TypeHandlerSLongDouble : public TypeHandlerReal
boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{
// QQ: DDLPackageProcessor::getNullValueForType() did not handle LONGDOUBLE
return boost::any();
return {};
}
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override
{
throw logging::QueryDataExcept("convertColumnData: unknown column data type.", logging::dataTypeErr);
return boost::any();
return {};
}
const uint8_t* getEmptyValueForType(const TypeAttributesStd& attr) const override
{
@ -2255,7 +2252,7 @@ class TypeHandlerClob : public TypeHandlerStr
}
boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{
return boost::any(); // QQ
return {}; // QQ
}
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override;

View File

@ -300,9 +300,9 @@ struct lldiv_t_128
inline lldiv_t_128 lldiv128(const int128_t& dividend, const int128_t& divisor)
{
if (UNLIKELY(divisor == 0) || UNLIKELY(dividend == 0))
return lldiv_t_128();
return {};
return lldiv_t_128(dividend / divisor, dividend % divisor);
return {dividend / divisor, dividend % divisor};
}
// TODO: derive it from TSInt64 eventually
@ -381,9 +381,8 @@ class TDecimal128 : public TSInt128
}
public:
TDecimal128()
{
}
TDecimal128() = default;
explicit TDecimal128(const int128_t val) : TSInt128(val)
{
}
@ -541,11 +540,6 @@ class Decimal : public TDecimal128, public TDecimal64
return TSInt128(s128Value);
}
inline TFloat128 toTFloat128() const
{
return TFloat128(s128Value);
}
inline double toDouble() const
{
int128_t scaleDivisor;
@ -554,7 +548,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<double>(tmpval);
}
inline operator double() const
inline explicit operator double() const
{
return toDouble();
}
@ -567,7 +561,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<float>(tmpval);
}
inline operator float() const
inline explicit operator float() const
{
return toFloat();
}
@ -580,7 +574,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<long double>(tmpval);
}
inline operator long double() const
inline explicit operator long double() const
{
return toLongDouble();
}
@ -1016,7 +1010,6 @@ struct NoOverflowCheck
{
void operator()(const int128_t& x, const int128_t& y)
{
return;
}
};

View File

@ -349,11 +349,9 @@ enum DDL_SERIAL_TYPE
*/
struct SchemaObject
{
virtual ~SchemaObject()
{
}
virtual ~SchemaObject() = default;
SchemaObject(std::string name) : fName(name)
explicit SchemaObject(std::string name) : fName(name)
{
}
@ -418,9 +416,7 @@ struct SqlStatement
*/
struct SqlStatementList
{
SqlStatementList()
{
}
SqlStatementList() = default;
SqlStatement* operator[](int i) const
{
@ -452,17 +448,13 @@ struct QualifiedName
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
QualifiedName()
{
}
QualifiedName() = default;
EXPORT QualifiedName(const char* name);
EXPORT explicit QualifiedName(const char* name);
EXPORT QualifiedName(const char* name, const char* schema);
EXPORT QualifiedName(const char* name, const char* schema, const char* catalog);
virtual ~QualifiedName()
{
}
virtual ~QualifiedName() = default;
std::string fCatalog;
std::string fName;
@ -479,7 +471,7 @@ struct TableDef : public SchemaObject
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
TableDef() : fQualifiedName(0)
TableDef() : fQualifiedName(nullptr)
{
}
@ -495,7 +487,7 @@ struct TableDef : public SchemaObject
{
}
EXPORT virtual ~TableDef();
EXPORT ~TableDef() override;
QualifiedName* fQualifiedName;
@ -512,22 +504,22 @@ struct TableDef : public SchemaObject
struct CreateTableStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
EXPORT CreateTableStatement();
/** @brief You can't have a CreateTableStatement without a
table defintion */
EXPORT CreateTableStatement(TableDef* tableDef);
EXPORT explicit CreateTableStatement(TableDef* tableDef);
EXPORT virtual ~CreateTableStatement();
EXPORT ~CreateTableStatement() override;
/** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
std::string schemaName() const
{
@ -561,13 +553,9 @@ struct AlterTableAction
EXPORT virtual int serialize(messageqcpp::ByteStream& bs) = 0;
/** @brief Ctor for deserialization */
AlterTableAction()
{
}
AlterTableAction() = default;
virtual ~AlterTableAction()
{
}
virtual ~AlterTableAction() = default;
/** @brief QualifiedName of the focal table for this
statement. */
@ -582,24 +570,24 @@ struct AlterTableAction
struct AtaAddColumn : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaAddColumn() : fColumnDef(0)
AtaAddColumn() : fColumnDef(nullptr)
{
}
/** @brief You can't add a column without specifying a column
definition. */
AtaAddColumn(ColumnDef* columnDef);
explicit AtaAddColumn(ColumnDef* columnDef);
virtual ~AtaAddColumn();
~AtaAddColumn() override;
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief The focal column definition. */
ColumnDef* fColumnDef;
@ -611,22 +599,20 @@ struct AtaAddColumn : public AlterTableAction
struct AtaAddColumns : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaAddColumns()
{
}
AtaAddColumns() = default;
AtaAddColumns(TableElementList* tableElements);
explicit AtaAddColumns(TableElementList* tableElements);
virtual ~AtaAddColumns();
~AtaAddColumns() override;
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
ColumnDefList fColumns;
};
@ -637,22 +623,20 @@ struct AtaAddColumns : public AlterTableAction
struct AtaDropColumns : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaDropColumns()
{
}
AtaDropColumns() = default;
EXPORT AtaDropColumns(ColumnNameList* tableElements);
EXPORT explicit AtaDropColumns(ColumnNameList* tableElements);
EXPORT virtual ~AtaDropColumns();
EXPORT ~AtaDropColumns() override;
/** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
ColumnNameList fColumns;
};
@ -662,22 +646,22 @@ struct AtaDropColumns : public AlterTableAction
struct AtaAddTableConstraint : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaAddTableConstraint() : fTableConstraint(0)
AtaAddTableConstraint() : fTableConstraint(nullptr)
{
}
AtaAddTableConstraint(TableConstraintDef* tableConstraint);
explicit AtaAddTableConstraint(TableConstraintDef* tableConstraint);
virtual ~AtaAddTableConstraint();
~AtaAddTableConstraint() override;
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
TableConstraintDef* fTableConstraint;
};
@ -687,25 +671,21 @@ struct AtaAddTableConstraint : public AlterTableAction
struct AtaDropColumn : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaDropColumn()
{
}
AtaDropColumn() = default;
/** @brief Ctor for parser construction */
EXPORT AtaDropColumn(std::string columnName, DDL_REFERENTIAL_ACTION dropBehavior);
/** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~AtaDropColumn()
{
}
~AtaDropColumn() override = default;
std::string fColumnName;
DDL_REFERENTIAL_ACTION fDropBehavior;
};
@ -715,19 +695,19 @@ struct AtaDropColumn : public AlterTableAction
struct AtaSetColumnDefault : AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
AtaSetColumnDefault() : fDefaultValue(0)
AtaSetColumnDefault() : fDefaultValue(nullptr)
{
}
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~AtaSetColumnDefault();
~AtaSetColumnDefault() override;
AtaSetColumnDefault(const char* colName, ColumnDefaultValue* defaultValue);
@ -739,25 +719,21 @@ struct AtaSetColumnDefault : AlterTableAction
struct AtaDropColumnDefault : AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaDropColumnDefault()
{
}
AtaDropColumnDefault() = default;
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~AtaDropColumnDefault()
{
}
~AtaDropColumnDefault() override = default;
/** @brief Ctor for parser construction */
AtaDropColumnDefault(const char* colName);
explicit AtaDropColumnDefault(const char* colName);
std::string fColumnName;
};
@ -766,22 +742,18 @@ struct AtaDropColumnDefault : AlterTableAction
struct AtaDropTableConstraint : AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaDropTableConstraint()
{
}
AtaDropTableConstraint() = default;
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~AtaDropTableConstraint()
{
}
~AtaDropTableConstraint() override = default;
AtaDropTableConstraint(const char* constraintName, DDL_REFERENTIAL_ACTION dropBehavior);
@ -793,21 +765,21 @@ struct AtaDropTableConstraint : AlterTableAction
struct AtaRenameTable : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaRenameTable() : fQualifiedName(0)
AtaRenameTable() : fQualifiedName(nullptr)
{
}
AtaRenameTable(QualifiedName* qualifiedName);
explicit AtaRenameTable(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~AtaRenameTable();
~AtaRenameTable() override;
QualifiedName* fQualifiedName;
};
@ -816,21 +788,21 @@ struct AtaRenameTable : public AlterTableAction
struct AtaTableComment : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaTableComment() : fTableComment("")
{
}
AtaTableComment(const char* tableComment);
explicit AtaTableComment(const char* tableComment);
/** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~AtaTableComment();
~AtaTableComment() override;
std::string fTableComment;
};
@ -839,13 +811,13 @@ struct AtaTableComment : public AlterTableAction
struct AtaModifyColumnType : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaModifyColumnType() : fColumnType(0)
AtaModifyColumnType() : fColumnType(nullptr)
{
}
@ -854,12 +826,12 @@ struct AtaModifyColumnType : public AlterTableAction
{
}
AtaModifyColumnType(QualifiedName* qualifiedName);
explicit AtaModifyColumnType(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~AtaModifyColumnType();
~AtaModifyColumnType() override;
ColumnType* fColumnType;
@ -870,28 +842,28 @@ struct AtaModifyColumnType : public AlterTableAction
struct AtaRenameColumn : public AlterTableAction
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
AtaRenameColumn() : fNewType(0), fDefaultValue(0)
AtaRenameColumn() : fNewType(nullptr), fDefaultValue(nullptr)
{
}
AtaRenameColumn(const char* name, const char* newName, ColumnType* newType, const char* comment = NULL)
AtaRenameColumn(const char* name, const char* newName, ColumnType* newType, const char* comment = nullptr)
: fName(name), fNewName(newName), fNewType(newType)
{
if (comment)
fComment = comment;
fDefaultValue = 0;
fDefaultValue = nullptr;
}
AtaRenameColumn(const char* name, const char* newName, ColumnType* newType,
ColumnConstraintList* constraint_list, ColumnDefaultValue* defaultValue,
const char* comment = NULL)
const char* comment = nullptr)
: fName(name), fNewName(newName), fNewType(newType), fDefaultValue(defaultValue)
{
if (constraint_list)
@ -906,12 +878,12 @@ struct AtaRenameColumn : public AlterTableAction
fComment = comment;
}
AtaRenameColumn(QualifiedName* qualifiedName);
explicit AtaRenameColumn(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~AtaRenameColumn();
~AtaRenameColumn() override;
std::string fName; ///< current column name
std::string fNewName; ///< new column name
@ -935,7 +907,7 @@ struct ColumnType
EXPORT int serialize(messageqcpp::ByteStream& bs);
/** @brief For deserialization. */
ColumnType() : fCharset(NULL), fCollate(NULL), fCharsetNum(0), fExplicitLength(false)
ColumnType() : fCharset(nullptr), fCollate(nullptr), fCharsetNum(0), fExplicitLength(false)
{
}
@ -951,9 +923,7 @@ struct ColumnType
EXPORT ColumnType(int type);
virtual ~ColumnType()
{
}
virtual ~ColumnType() = default;
/** @brief Type code from DDL_DATATYPES */
int fType;
@ -1003,19 +973,15 @@ struct ColumnConstraintDef : public SchemaObject
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
ColumnConstraintDef()
{
}
ColumnConstraintDef() = default;
/** @brief Constructs as check constraint. */
EXPORT ColumnConstraintDef(const char* check);
EXPORT explicit ColumnConstraintDef(const char* check);
/** @brief Constructs as other constraint. */
EXPORT ColumnConstraintDef(DDL_CONSTRAINTS type);
EXPORT explicit ColumnConstraintDef(DDL_CONSTRAINTS type);
virtual ~ColumnConstraintDef()
{
}
~ColumnConstraintDef() override = default;
/** @brief Whether deferrable. */
bool fDeferrable;
@ -1039,15 +1005,11 @@ struct ColumnDefaultValue
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
ColumnDefaultValue()
{
}
ColumnDefaultValue() = default;
ColumnDefaultValue(const char* value);
explicit ColumnDefaultValue(const char* value);
virtual ~ColumnDefaultValue()
{
}
virtual ~ColumnDefaultValue() = default;
/** @brief Is NULL the default value? */
bool fNull;
@ -1067,20 +1029,20 @@ struct ColumnDef : public SchemaObject
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
/** @brief For deserialization. */
ColumnDef() : fType(0)
ColumnDef() : fType(nullptr)
{
}
EXPORT virtual ~ColumnDef();
EXPORT ~ColumnDef() override;
/** @brief Parser ctor. */
EXPORT ColumnDef(const char* name, ColumnType* type, ColumnConstraintList* constraint_list,
ColumnDefaultValue* defaultValue, const char* comment = NULL);
ColumnDefaultValue* defaultValue, const char* comment = nullptr);
/** @brief ColumnDef ctor.
* ctor */
ColumnDef(const char* name, ColumnType* type, ColumnConstraintList constraints,
ColumnDefaultValue* defaultValue = NULL, const char* comment = NULL)
ColumnDefaultValue* defaultValue = nullptr, const char* comment = nullptr)
: SchemaObject(name), fType(type), fConstraints(constraints), fDefaultValue(defaultValue)
{
}
@ -1114,14 +1076,12 @@ struct TableConstraintDef : public SchemaObject
TableConstraintDef();
TableConstraintDef(DDL_CONSTRAINTS cType);
explicit TableConstraintDef(DDL_CONSTRAINTS cType);
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
virtual ~TableConstraintDef()
{
}
~TableConstraintDef() override = default;
// std::string fName;
DDL_CONSTRAINTS fConstraintType;
};
@ -1131,28 +1091,26 @@ struct TableConstraintDef : public SchemaObject
struct TableUniqueConstraintDef : public TableConstraintDef
{
/** @brief Return DDL_SERIAL code */
virtual DDL_SERIAL_TYPE getSerialType()
DDL_SERIAL_TYPE getSerialType() override
{
return DDL_TABLE_UNIQUE_CONSTRAINT_DEF;
}
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
TableUniqueConstraintDef() : TableConstraintDef(DDL_UNIQUE)
{
}
TableUniqueConstraintDef(ColumnNameList* columns);
virtual ~TableUniqueConstraintDef()
{
}
explicit TableUniqueConstraintDef(ColumnNameList* columns);
~TableUniqueConstraintDef() override = default;
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
ColumnNameList fColumnNameList;
};
@ -1162,29 +1120,27 @@ struct TableUniqueConstraintDef : public TableConstraintDef
struct TablePrimaryKeyConstraintDef : public TableConstraintDef
{
/** @brief Return DDL_SERIAL code */
virtual DDL_SERIAL_TYPE getSerialType()
DDL_SERIAL_TYPE getSerialType() override
{
return DDL_TABLE_PRIMARY_CONSTRAINT_DEF;
}
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
TablePrimaryKeyConstraintDef() : TableConstraintDef(DDL_PRIMARY_KEY)
{
}
EXPORT TablePrimaryKeyConstraintDef(ColumnNameList* columns);
EXPORT explicit TablePrimaryKeyConstraintDef(ColumnNameList* columns);
virtual ~TablePrimaryKeyConstraintDef()
{
}
~TablePrimaryKeyConstraintDef() override = default;
/** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
ColumnNameList fColumnNameList;
};
@ -1194,9 +1150,7 @@ struct TablePrimaryKeyConstraintDef : public TableConstraintDef
*/
struct ReferentialAction
{
virtual ~ReferentialAction()
{
}
virtual ~ReferentialAction() = default;
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
@ -1213,18 +1167,19 @@ struct ReferentialAction
struct TableReferencesConstraintDef : public TableConstraintDef
{
/** @brief Return DDL_SERIAL code */
virtual DDL_SERIAL_TYPE getSerialType()
DDL_SERIAL_TYPE getSerialType() override
{
return DDL_TABLE_REFERENCES_CONSTRAINT_DEF;
}
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
TableReferencesConstraintDef() : TableConstraintDef(DDL_REFERENCES), fTableName(0), fRefAction(0)
TableReferencesConstraintDef()
: TableConstraintDef(DDL_REFERENCES), fTableName(nullptr), fRefAction(nullptr)
{
}
@ -1232,10 +1187,10 @@ struct TableReferencesConstraintDef : public TableConstraintDef
ColumnNameList* foreignColumns, DDL_MATCH_TYPE matchType,
ReferentialAction* refAction);
virtual ~TableReferencesConstraintDef();
~TableReferencesConstraintDef() override;
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
ColumnNameList fColumns;
QualifiedName* fTableName;
@ -1249,29 +1204,27 @@ struct TableReferencesConstraintDef : public TableConstraintDef
struct TableCheckConstraintDef : public TableConstraintDef
{
/** @brief Return DDL_SERIAL code */
virtual DDL_SERIAL_TYPE getSerialType()
DDL_SERIAL_TYPE getSerialType() override
{
return DDL_TABLE_CHECK_CONSTRAINT_DEF;
}
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
TableCheckConstraintDef() : TableConstraintDef(DDL_CHECK)
{
}
TableCheckConstraintDef(const char* check);
explicit TableCheckConstraintDef(const char* check);
/** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~TableCheckConstraintDef()
{
}
~TableCheckConstraintDef() override = default;
std::string fCheck;
};
@ -1284,22 +1237,22 @@ struct TableCheckConstraintDef : public TableConstraintDef
struct AlterTableStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
AlterTableStatement() : fTableName(0)
AlterTableStatement() : fTableName(nullptr)
{
}
EXPORT AlterTableStatement(QualifiedName* qName, AlterTableActionList* ataList);
/** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
/** @brief Delete members. */
EXPORT virtual ~AlterTableStatement();
EXPORT ~AlterTableStatement() override;
std::string schemaName() const
{
@ -1341,18 +1294,14 @@ struct ConstraintAttributes
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
ConstraintAttributes()
{
}
ConstraintAttributes() = default;
ConstraintAttributes(DDL_CONSTRAINT_ATTRIBUTES checkTime, bool deferrable)
: fCheckTime(checkTime), fDeferrable(deferrable)
{
}
virtual ~ConstraintAttributes()
{
}
virtual ~ConstraintAttributes() = default;
DDL_CONSTRAINT_ATTRIBUTES fCheckTime;
bool fDeferrable;
@ -1366,19 +1315,19 @@ struct ConstraintAttributes
struct CreateIndexStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
CreateIndexStatement();
CreateIndexStatement(QualifiedName* qualifiedName1, QualifiedName* qualifiedName2,
ColumnNameList* columnNames, bool unique);
/** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~CreateIndexStatement();
~CreateIndexStatement() override;
QualifiedName* fIndexName;
QualifiedName* fTableName;
@ -1391,20 +1340,20 @@ struct CreateIndexStatement : public SqlStatement
struct DropIndexStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs);
int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs);
int serialize(messageqcpp::ByteStream& bs) override;
DropIndexStatement() : fIndexName(0)
DropIndexStatement() : fIndexName(nullptr)
{
}
DropIndexStatement(QualifiedName* qualifiedName);
explicit DropIndexStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
virtual ~DropIndexStatement();
~DropIndexStatement() override;
QualifiedName* fIndexName;
};
@ -1414,20 +1363,20 @@ struct DropIndexStatement : public SqlStatement
struct DropTableStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
DropTableStatement() : fTableName(0)
DropTableStatement() : fTableName(nullptr)
{
}
EXPORT DropTableStatement(QualifiedName* qualifiedName, bool cascade);
/** @brief Dump to stdout. */
EXPORT std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~DropTableStatement()
~DropTableStatement() override
{
delete fTableName;
}
@ -1473,20 +1422,20 @@ struct DebugDDLStatement : public SqlStatement
struct TruncTableStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
TruncTableStatement() : fTableName(0)
TruncTableStatement() : fTableName(nullptr)
{
}
EXPORT TruncTableStatement(QualifiedName* qualifiedName);
EXPORT explicit TruncTableStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */
EXPORT std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~TruncTableStatement()
~TruncTableStatement() override
{
delete fTableName;
}
@ -1508,23 +1457,23 @@ struct TruncTableStatement : public SqlStatement
struct MarkPartitionStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
MarkPartitionStatement() : fTableName(0)
MarkPartitionStatement() : fTableName(nullptr)
{
}
/** @brief You can't have a CreateTableStatement without a table defintion */
EXPORT MarkPartitionStatement(QualifiedName* qualifiedName);
EXPORT explicit MarkPartitionStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~MarkPartitionStatement()
~MarkPartitionStatement() override
{
delete fTableName;
}
@ -1539,22 +1488,22 @@ struct MarkPartitionStatement : public SqlStatement
struct RestorePartitionStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
RestorePartitionStatement() : fTableName(0)
RestorePartitionStatement() : fTableName(nullptr)
{
}
EXPORT RestorePartitionStatement(QualifiedName* qualifiedName);
EXPORT explicit RestorePartitionStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~RestorePartitionStatement()
~RestorePartitionStatement() override
{
delete fTableName;
}
@ -1569,22 +1518,22 @@ struct RestorePartitionStatement : public SqlStatement
struct DropPartitionStatement : public SqlStatement
{
/** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */
DropPartitionStatement() : fTableName(0)
DropPartitionStatement() : fTableName(nullptr)
{
}
EXPORT DropPartitionStatement(QualifiedName* qualifiedName);
EXPORT explicit DropPartitionStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const;
EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~DropPartitionStatement()
~DropPartitionStatement() override
{
delete fTableName;
}

View File

@ -29,7 +29,7 @@
#include <stdexcept>
#include "collation.h" // CHARSET_INFO
#include "ddlpkg.h"
#include "mariadb_my_sys.h" // myf, MYF()
#include "mariadb_my_sys.h" // myf, MYF()
#define EXPORT
@ -86,12 +86,8 @@ struct pass_to_bison
const CHARSET_INFO* default_table_charset;
myf utf8_flag;
pass_to_bison(ParseTree* pt) :
fParseTree(pt)
, scanner(NULL)
, default_table_charset(NULL)
, utf8_flag(MYF(0))
{};
pass_to_bison(ParseTree* pt)
: fParseTree(pt), scanner(nullptr), default_table_charset(nullptr), utf8_flag(MYF(0)){};
};
class SqlParser

View File

@ -49,7 +49,7 @@ class CreateTableProcessor : public DDLPackageProcessor
*
* @param createTableStmt the CreateTableStatement
*/
DDLResult processPackageInternal(ddlpackage::SqlStatement* sqlTableStmt);
DDLResult processPackageInternal(ddlpackage::SqlStatement* sqlTableStmt) override;
};
} // namespace ddlpackageprocessor

View File

@ -22,7 +22,7 @@
***********************************************************************/
/** @file */
#ifndef DDLINDEXPOPULATOR_H
#pragma once
#include <string>
#include <stdexcept>
@ -302,5 +302,4 @@ class DDLIndexPopulator
};
};
} // namespace ddlpackageprocessor
#endif // DDLPINDEXPOPULATOR_H
} // namespace ddlpackageprocessor

View File

@ -29,7 +29,7 @@
#include <stdexcept>
#include <sstream>
#include <iostream>
#include <stdint.h>
#include <cstdint>
#include <boost/any.hpp>
#include <boost/tuple/tuple.hpp>
@ -49,7 +49,7 @@
#define EXPORT
//#define IDB_DDL_DEBUG
// #define IDB_DDL_DEBUG
namespace ddlpackageprocessor
{
#define SUMMARY_INFO(message) \
@ -206,8 +206,8 @@ class DDLPackageProcessor
struct NJLSysDataList
{
NJLSysDataVector sysDataVec;
EXPORT NJLSysDataList(){};
EXPORT ~NJLSysDataList();
EXPORT NJLSysDataList() = default;
EXPORT ~NJLSysDataList() = default;
NJLSysDataVector::const_iterator begin()
{
return sysDataVec.begin();

View File

@ -38,7 +38,7 @@ class DropIndexProcessor : public DDLPackageProcessor
*
* @param dropIndexStmt the drop index statement
*/
DDLResult processPackageInternal(ddlpackage::SqlStatement& dropIndexStmt);
DDLResult processPackageInternal(ddlpackage::SqlStatement* dropIndexStmt) override;
protected:
private:

View File

@ -46,7 +46,7 @@ class DropPartitionProcessor : public DDLPackageProcessor, FormatStatementString
*
* @param dropTableStmt the drop table statement
*/
DDLResult processPackageInternal(ddlpackage::SqlStatement* dropPartitionStmt);
DDLResult processPackageInternal(ddlpackage::SqlStatement* dropPartitionStmt) override;
};
} // namespace ddlpackageprocessor

View File

@ -46,7 +46,7 @@ class DropTableProcessor : public DDLPackageProcessor
*
* @param dropTableStmt the drop table statement
*/
DDLResult processPackageInternal(ddlpackage::SqlStatement* dropTableStmt);
DDLResult processPackageInternal(ddlpackage::SqlStatement* dropTableStmt) override;
};
/** @brief specialization of a DDLPacakageProcessor
@ -66,7 +66,7 @@ class TruncTableProcessor : public DDLPackageProcessor
*
* @param truncTableStmt the truncate table statement
*/
DDLResult processPackageInternal(ddlpackage::SqlStatement* truncTableStmt);
DDLResult processPackageInternal(ddlpackage::SqlStatement* truncTableStmt) override;
};
} // namespace ddlpackageprocessor

View File

@ -46,7 +46,7 @@ class MarkPartitionProcessor : public DDLPackageProcessor, FormatStatementString
*
* @param createTableStmt the CreateTableStatement
*/
DDLResult processPackageInternal(ddlpackage::SqlStatement* MarkPartitionStmt);
DDLResult processPackageInternal(ddlpackage::SqlStatement* MarkPartitionStmt) override;
};
} // namespace ddlpackageprocessor

View File

@ -46,7 +46,7 @@ class RestorePartitionProcessor : public DDLPackageProcessor, FormatStatementStr
*
* @param dropTableStmt the drop table statement
*/
DDLResult processPackageInternal(ddlpackage::SqlStatement* RestorePartitionStmt);
DDLResult processPackageInternal(ddlpackage::SqlStatement* RestorePartitionStmt) override;
};
} // namespace ddlpackageprocessor

View File

@ -188,7 +188,7 @@ class CalpontDMLPackage
{
fTableName = tableName;
if (fTable != 0)
if (fTable != nullptr)
fTable->set_TableName(tableName);
}
@ -207,7 +207,7 @@ class CalpontDMLPackage
{
fSchemaName = schemaName;
if (fTable != 0)
if (fTable != nullptr)
fTable->set_SchemaName(schemaName);
}

View File

@ -47,33 +47,33 @@ class CommandDMLPackage : public CalpontDMLPackage
/** @brief dtor
*/
EXPORT virtual ~CommandDMLPackage();
EXPORT ~CommandDMLPackage() override;
/** @brief write a CommandDMLPackage to a ByteStream
*
* @param bytestream the ByteStream to write to
*/
EXPORT int write(messageqcpp::ByteStream& bytestream);
EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief read CommandDMLPackage from bytestream
*
* @param bytestream the ByteStream to read from
*/
EXPORT int read(messageqcpp::ByteStream& bytestream);
EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief do nothing
*
* @param buffer
* @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer
*/
inline int buildFromBuffer(std::string& buffer, int columns = 0, int rows = 0)
inline int buildFromBuffer(std::string& buffer, int columns = 0, int rows = 0) override
{
return 1;
};
/** @brief build a CommandDMLPackage from a CommandSqlStatement
*/
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement);
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief build a InsertDMLPackage from MySQL buffer
*
@ -81,7 +81,7 @@ class CommandDMLPackage : public CalpontDMLPackage
* @param rows the number of rows in the buffer
*/
int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows,
NullValuesBitset& nullValues)
NullValuesBitset& nullValues) override
{
return 1;
};

View File

@ -53,19 +53,19 @@ class DeleteDMLPackage : public CalpontDMLPackage
/** @brief dtor
*/
EXPORT virtual ~DeleteDMLPackage();
EXPORT ~DeleteDMLPackage() override;
/** @brief write a DeleteDMLPackage to a ByteStream
*
* @param bytestream the ByteStream to write to
*/
EXPORT int write(messageqcpp::ByteStream& bytestream);
EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief read a DeleteDMLPackage from a ByteStream
*
* @param bytestream the ByteStream to read from
*/
EXPORT int read(messageqcpp::ByteStream& bytestream);
EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief build a DeleteDMLPackage from a string buffer
*
@ -73,20 +73,20 @@ class DeleteDMLPackage : public CalpontDMLPackage
* @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer
*/
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows);
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows) override;
/** @brief build a DeleteDMLPackage from a parsed DeleteSqlStatement
*
* @param sqlStatement the parsed DeleteSqlStatement
*/
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement);
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief build a InsertDMLPackage from MySQL buffer
*
* @param colNameList, tableValuesMap
* @param rows the number of rows in the buffer
*/
EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns,
int rows, NullValuesBitset& nullValues);
int rows, NullValuesBitset& nullValues) override;
protected:
private:

View File

@ -52,27 +52,27 @@ class DMLColumn : public DMLObject
uint32_t funcScale = 0, bool isNULL = false);
/** @brief new ctor
*
*
*/
EXPORT DMLColumn(std::string name, utils::NullString& value, bool isFromCol = false,
uint32_t funcScale = 0, bool isNULL = false);
EXPORT DMLColumn(std::string name, utils::NullString& value, bool isFromCol = false, uint32_t funcScale = 0,
bool isNULL = false);
/** @brief dtor
*/
EXPORT ~DMLColumn();
EXPORT ~DMLColumn() override;
/** @brief read a DMLColumn from a ByteStream
*
* @param bytestream the ByteStream to read from
*/
EXPORT int read(messageqcpp::ByteStream& bytestream);
EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief write a DML column to a ByteStream
*
* @param bytestream the ByteStream to write to
*/
EXPORT int write(messageqcpp::ByteStream& bytestream);
EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief get the data for the column
*/

View File

@ -23,13 +23,14 @@
/** @file */
#pragma once
#include <utility>
#include <vector>
#include <string>
#include <map>
#include <utility>
#include <iostream>
#include <bitset>
#include <stdint.h>
#include <cstdint>
#include "nullstring.h"
namespace dmlpackage
@ -158,9 +159,7 @@ class SqlStatementList
public:
/** @brief ctor
*/
SqlStatementList()
{
}
SqlStatementList() = default;
/** @brief dtor
*/
@ -218,19 +217,19 @@ class InsertSqlStatement : public SqlStatement
/** @brief dtor
*/
virtual ~InsertSqlStatement();
~InsertSqlStatement() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get a string representation of the query spec
*/
virtual std::string getQueryString() const;
std::string getQueryString() const override;
/** @brief get the statement type - DML_INSERT
*/
inline virtual int getStatementType() const
inline int getStatementType() const override
{
return DML_INSERT;
}
@ -259,25 +258,25 @@ class UpdateSqlStatement : public SqlStatement
* @param whereClausePtr pointer to a WhereClause object - default 0
*/
UpdateSqlStatement(TableName* tableNamePtr, ColumnAssignmentList* colAssignmentListPtr,
WhereClause* whereClausePtr = 0);
WhereClause* whereClausePtr = nullptr);
/** @brief dtor
*/
virtual ~UpdateSqlStatement();
~UpdateSqlStatement() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the
* SET assignment_commalist opt_where_clause
* statement
*/
virtual std::string getQueryString() const;
std::string getQueryString() const override;
/** @brief get the statement type - DML_UPDATE
*/
inline virtual int getStatementType() const
inline int getStatementType() const override
{
return DML_UPDATE;
}
@ -304,23 +303,23 @@ class DeleteSqlStatement : public SqlStatement
* @param tableNamePtr pointer to a TableName object
* @param whereClausePtr pointer to a WhereClause object - default = 0
*/
DeleteSqlStatement(TableName* tableNamePtr, WhereClause* whereClausePtr = 0);
explicit DeleteSqlStatement(TableName* tableNamePtr, WhereClause* whereClausePtr = nullptr);
/** @brief dtor
*/
virtual ~DeleteSqlStatement();
~DeleteSqlStatement() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the WHERE clause
*/
virtual std::string getQueryString() const;
std::string getQueryString() const override;
/** @brief get the statement type - DML_DELETE
*/
inline virtual int getStatementType() const
inline int getStatementType() const override
{
return DML_DELETE;
}
@ -346,22 +345,22 @@ class CommandSqlStatement : public SqlStatement
*
* @param command the COMMIT or ROLLBACK string
*/
CommandSqlStatement(std::string command);
explicit CommandSqlStatement(std::string command);
/** @brief get the statement type - DML_COMMAND
*/
inline virtual int getStatementType() const
inline int getStatementType() const override
{
return DML_COMMAND;
}
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the COMMIT or ROLLBACK string
*/
virtual std::string getQueryString() const;
std::string getQueryString() const override;
std::string fCommandText;
};
@ -380,7 +379,7 @@ class TableName
*
* @param name the table name
*/
TableName(char* name);
explicit TableName(char* name);
/** @brief ctor
*
@ -406,11 +405,10 @@ class TableName
class ColumnAssignment
{
public:
explicit ColumnAssignment(std::string const& column, std::string const& op = "=",
std::string const& expr = "")
: fColumn(column)
, fOperator(op)
, fScalarExpression(expr)
explicit ColumnAssignment(std::string column, std::string op = "=", std::string expr = "")
: fColumn(std::move(column))
, fOperator(std::move(op))
, fScalarExpression(std::move(expr))
, fFromCol(false)
, fFuncScale(0)
, fIsNull(false){};
@ -449,13 +447,13 @@ class ValuesOrQuery
*
* @param valuesPtr pointer to a ValuesList object
*/
ValuesOrQuery(ValuesList* valuesPtr);
explicit ValuesOrQuery(ValuesList* valuesPtr);
/** @brief ctor
*
* @param querySpecPtr pointer to a QuerySpec object
*/
ValuesOrQuery(QuerySpec* querySpecPtr);
explicit ValuesOrQuery(QuerySpec* querySpecPtr);
/** @brief dtor
*/
@ -491,7 +489,7 @@ class SelectFilter
*
* @param columnListPtr pointer to a ColumnNameList object
*/
SelectFilter(ColumnNameList* columnListPtr);
explicit SelectFilter(ColumnNameList* columnListPtr);
/** @brief dtor
*/
@ -524,7 +522,7 @@ class FromClause
*
* @param tableNameList pointer to a TableNameList object
*/
FromClause(TableNameList* tableNameList);
explicit FromClause(TableNameList* tableNameList);
/** @brief dtor
*/
@ -663,7 +661,7 @@ class Predicate
*
* @param predicateType the PREDICATE_TYPE
*/
Predicate(PREDICATE_TYPE predicateType);
explicit Predicate(PREDICATE_TYPE predicateType);
/** @brief dtor
*/
@ -696,16 +694,16 @@ class ComparisonPredicate : public Predicate
/** @brief dtor
*/
~ComparisonPredicate();
~ComparisonPredicate() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the COMPARISON
* predicate
*/
virtual std::string getPredicateString() const;
std::string getPredicateString() const override;
std::string fLHScalarExpression;
std::string fRHScalarExpression;
@ -731,16 +729,16 @@ class BetweenPredicate : public Predicate
/** @brief dtor
*/
~BetweenPredicate();
~BetweenPredicate() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the BETWEEN
* predicate
*/
virtual std::string getPredicateString() const;
std::string getPredicateString() const override;
std::string fLHScalarExpression;
std::string fRH1ScalarExpression;
@ -766,16 +764,16 @@ class LikePredicate : public Predicate
/** @brief dtor
*/
~LikePredicate();
~LikePredicate() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the LIKE
* predicate
*/
virtual std::string getPredicateString() const;
std::string getPredicateString() const override;
std::string fLHScalarExpression;
std::string fAtom;
@ -800,16 +798,16 @@ class NullTestPredicate : public Predicate
/** @brief dtor
*/
~NullTestPredicate();
~NullTestPredicate() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the NULL test
* predicate
*/
std::string getPredicateString() const;
std::string getPredicateString() const override;
std::string fColumnRef;
@ -834,16 +832,16 @@ class InPredicate : public Predicate
/** @brief dtor
*/
~InPredicate();
~InPredicate() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the IN
* predicate
*/
virtual std::string getPredicateString() const;
std::string getPredicateString() const override;
std::string fScalarExpression;
std::string fOperator;
@ -867,16 +865,16 @@ class AllOrAnyPredicate : public Predicate
/** @brief dtor
*/
~AllOrAnyPredicate();
~AllOrAnyPredicate() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the
* ALL or ANY predicate
*/
virtual std::string getPredicateString() const;
std::string getPredicateString() const override;
std::string fScalarExpression;
std::string fOperator;
@ -900,16 +898,16 @@ class ExistanceTestPredicate : public Predicate
/** @brief dtor
*/
~ExistanceTestPredicate();
~ExistanceTestPredicate() override;
/** @brief dump to stdout
*/
virtual std::ostream& put(std::ostream& os) const;
std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the EXISTS
* predicate
*/
virtual std::string getPredicateString() const;
std::string getPredicateString() const override;
QuerySpec* fSubQuerySpecPtr;
};

View File

@ -44,7 +44,7 @@ class DMLTable : public DMLObject
/** @brief dtor
*/
~DMLTable();
~DMLTable() override;
/** @brief get the schema name
*/
@ -85,7 +85,7 @@ class DMLTable : public DMLObject
*
* @param bytestream the ByteStream to read from
*/
int read(messageqcpp::ByteStream& bytestream);
int read(messageqcpp::ByteStream& bytestream) override;
/** @brief read a DMLTable metadata from a ByteStream
*
@ -103,7 +103,7 @@ class DMLTable : public DMLObject
*
* @param bytestream the ByteStream to write to
*/
int write(messageqcpp::ByteStream& bytestream);
int write(messageqcpp::ByteStream& bytestream) override;
protected:
private:

View File

@ -53,19 +53,19 @@ class InsertDMLPackage : public CalpontDMLPackage
/** @brief dtor
*/
EXPORT virtual ~InsertDMLPackage();
EXPORT ~InsertDMLPackage() override;
/** @brief write a InsertDMLPackage to a ByteStream
*
* @param bytestream the ByteStream to write to
*/
EXPORT int write(messageqcpp::ByteStream& bytestream);
EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief read InsertDMLPackage from bytestream
*
* @param bytestream the ByteStream to read from
*/
EXPORT int read(messageqcpp::ByteStream& bytestream);
EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief read InsertDMLPackage metadata from bytestream
*
@ -85,7 +85,7 @@ class InsertDMLPackage : public CalpontDMLPackage
* @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer
*/
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows);
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows) override;
/** @brief build a InsertDMLPackage from MySQL buffer
*
@ -95,13 +95,13 @@ class InsertDMLPackage : public CalpontDMLPackage
* @param rows number of rows to be touched
*/
EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns,
int rows, NullValuesBitset& nullValues);
int rows, NullValuesBitset& nullValues) override;
/** @brief build a InsertDMLPackage from a InsertSqlStatement
*
* @param sqlStmt the InsertSqlStatement
*/
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement);
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief Dump the InsertDMLPackage for debugging purposes
*/

View File

@ -45,7 +45,7 @@ class Row : public DMLObject
/** @brief dtor
*/
EXPORT ~Row();
EXPORT ~Row() override;
/** @brief copy constructor
*/
@ -55,13 +55,13 @@ class Row : public DMLObject
*
* @param bytestream the ByteStream to read from
*/
EXPORT int read(messageqcpp::ByteStream& bytestream);
EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief write a Row to a ByteStream
*
* @param bytestream the ByteStream to write to
*/
EXPORT int write(messageqcpp::ByteStream& bytestream);
EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief get the list of columns in the row
*/

View File

@ -53,19 +53,19 @@ class UpdateDMLPackage : public CalpontDMLPackage
/** @brief dtor
*/
EXPORT virtual ~UpdateDMLPackage();
EXPORT ~UpdateDMLPackage() override;
/** @brief write a UpdateDMLPackage to a ByteStream
*
* @param bytestream the ByteStream to write to
*/
EXPORT int write(messageqcpp::ByteStream& bytestream);
EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief read a UpdateDMLPackage from a ByteStream
*
* @param bytestream the ByteStream to read from
*/
EXPORT int read(messageqcpp::ByteStream& bytestream);
EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief build a UpdateDMLPackage from a string buffer
*
@ -73,13 +73,13 @@ class UpdateDMLPackage : public CalpontDMLPackage
* @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer
*/
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows);
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows) override;
/** @brief build a UpdateDMLPackage from a parsed UpdateSqlStatement
*
* @param sqlStatement the parsed UpdateSqlStatement
*/
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement);
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief build a InsertDMLPackage from MySQL buffer
*
@ -87,7 +87,7 @@ class UpdateDMLPackage : public CalpontDMLPackage
* @param rows the number of rows in the buffer
*/
EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns,
int rows, NullValuesBitset& nullValues);
int rows, NullValuesBitset& nullValues) override;
void buildUpdateFromMysqlBuffer(UpdateSqlStatement& updateStmt);
protected:

View File

@ -23,10 +23,11 @@
/** @file */
#pragma once
#include <string>
#include <utility>
#include <vector>
#include <map>
#include <bitset>
#include <stdint.h>
#include <cstdint>
#include "dmlpkg.h"
#define EXPORT
@ -57,7 +58,7 @@ class VendorDMLStatement
EXPORT VendorDMLStatement(std::string dmlstatement, int stmttype, std::string tName, std::string schema,
int rows, int columns, ColNameList& colNameList, TableValuesMap& tableValuesMap,
NullValuesBitset& nullValues, int sessionID);
/** @brief destructor
*/
EXPORT ~VendorDMLStatement();
@ -73,7 +74,7 @@ class VendorDMLStatement
*/
inline void set_TableName(std::string value)
{
fTableName = value;
fTableName = std::move(value);
}
/** @brief Get the schema name
@ -87,7 +88,7 @@ class VendorDMLStatement
*/
inline void set_SchemaName(std::string value)
{
fSchema = value;
fSchema = std::move(value);
}
/** @brief Get the DML statVendorDMLStatement classement type
@ -115,7 +116,7 @@ class VendorDMLStatement
*/
inline void set_DMLStatement(std::string dmlStatement)
{
fDMLStatement = dmlStatement;
fDMLStatement = std::move(dmlStatement);
}
/** @brief Get the number of rows
@ -157,7 +158,7 @@ class VendorDMLStatement
*/
inline void set_DataBuffer(std::string value)
{
fDataBuffer = value;
fDataBuffer = std::move(value);
}
/** @brief Get the session ID
*/

View File

@ -21,7 +21,7 @@
#pragma once
#include <stdint.h>
#include <cstdint>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
@ -48,4 +48,3 @@ class AutoincrementData
OIDNextValue fOidNextValueMap;
boost::mutex fOIDnextvalLock;
};

View File

@ -94,7 +94,7 @@ class AggregateColumn : public ReturnedColumn
/**
* ctor
*/
AggregateColumn(const uint32_t sessionID);
explicit AggregateColumn(const uint32_t sessionID);
/**
* ctor
@ -109,9 +109,7 @@ class AggregateColumn : public ReturnedColumn
/**
* Destructors
*/
virtual ~AggregateColumn()
{
}
~AggregateColumn() override = default;
/**
* Accessor Methods
@ -167,7 +165,7 @@ class AggregateColumn : public ReturnedColumn
*
* deep copy of this pointer and return the copy
*/
inline virtual AggregateColumn* clone() const override
inline AggregateColumn* clone() const override
{
return new AggregateColumn(*this);
}
@ -190,14 +188,14 @@ class AggregateColumn : public ReturnedColumn
/**
* ASC flag
*/
inline virtual bool asc() const override
inline bool asc() const override
{
return fAsc;
}
/**
* ASC flag
*/
inline virtual void asc(const bool asc) override
inline void asc(const bool asc) override
{
fAsc = asc;
}
@ -205,7 +203,7 @@ class AggregateColumn : public ReturnedColumn
/**
* fData: SQL representation of this object
*/
virtual const std::string data() const override
const std::string data() const override
{
return fData;
}
@ -221,24 +219,24 @@ class AggregateColumn : public ReturnedColumn
/**
* Overloaded stream operator
*/
virtual const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
const std::string toString() const override;
std::string toCppCode(IncludeSet& includes) const override;
/**
* Serialize interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
void serialize(messageqcpp::ByteStream&) const override;
/**
* Serialize interface
*/
virtual void unserialize(messageqcpp::ByteStream&) override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -253,7 +251,7 @@ class AggregateColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -309,8 +307,8 @@ class AggregateColumn : public ReturnedColumn
static AggOp agname2num(const std::string&);
using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override;
virtual bool hasWindowFunc() override
bool hasAggregate() override;
bool hasWindowFunc() override
{
return false;
}
@ -357,7 +355,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{
bool localIsNull = false;
evaluate(row, localIsNull);
@ -368,7 +366,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getIntVal();
@ -377,7 +375,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getUintVal();
@ -386,7 +384,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override
float getFloatVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getFloatVal();
@ -395,7 +393,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override
double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDoubleVal();
@ -404,7 +402,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getLongDoubleVal();
@ -413,7 +411,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDecimalVal();
@ -421,7 +419,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDateIntVal();
@ -429,7 +427,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getTimeIntVal();
@ -437,7 +435,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDatetimeIntVal();
@ -445,7 +443,7 @@ class AggregateColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getTimestampIntVal();

View File

@ -51,7 +51,7 @@ class ArithmeticColumn : public ReturnedColumn
ArithmeticColumn();
ArithmeticColumn(const std::string& sql, const uint32_t sessionID = 0);
ArithmeticColumn(const ArithmeticColumn& rhs, const uint32_t sessionID = 0);
virtual ~ArithmeticColumn();
~ArithmeticColumn() override;
inline ParseTree* expression() const
{
@ -102,7 +102,7 @@ class ArithmeticColumn : public ReturnedColumn
/**
* get SQL representation of this object
*/
virtual const std::string data() const override
const std::string data() const override
{
return fData;
}
@ -110,7 +110,7 @@ class ArithmeticColumn : public ReturnedColumn
/**
* set SQL representation of this object
*/
virtual void data(const std::string data) override
void data(const std::string data) override
{
fData = data;
}
@ -118,13 +118,13 @@ class ArithmeticColumn : public ReturnedColumn
/**
* virtual stream method
*/
virtual const std::string toString() const override;
const std::string toString() const override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual ArithmeticColumn* clone() const override
inline ArithmeticColumn* clone() const override
{
return new ArithmeticColumn(*this);
}
@ -132,15 +132,15 @@ class ArithmeticColumn : public ReturnedColumn
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -154,7 +154,7 @@ class ArithmeticColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -164,16 +164,16 @@ class ArithmeticColumn : public ReturnedColumn
bool operator!=(const ArithmeticColumn& t) const;
using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override;
virtual bool hasWindowFunc() override;
bool hasAggregate() override;
bool hasWindowFunc() override;
virtual void setDerivedTable() override;
virtual void replaceRealCol(std::vector<SRCP>&) override;
virtual const std::vector<SimpleColumn*>& simpleColumnList() const override
void setDerivedTable() override;
void replaceRealCol(std::vector<SRCP>&) override;
const std::vector<SimpleColumn*>& simpleColumnList() const override
{
return fSimpleColumnList;
}
virtual void setSimpleColumnList() override;
void setSimpleColumnList() override;
/**
* Return the table that the column arguments belong to.
@ -181,13 +181,13 @@ class ArithmeticColumn : public ReturnedColumn
* @return tablename, if all arguments belong to one table
* empty string "", if multiple tables are involved in this func
*/
virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
std::string fTableAlias; // table alias for this column
bool fAsc = false; // asc flag for order by column
bool fAsc = false; // asc flag for order by column
std::string fData;
/** build expression tree
@ -211,62 +211,62 @@ class ArithmeticColumn : public ReturnedColumn
* F&E framework *
***********************************************************/
public:
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getStrVal(row, isNull);
}
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getIntVal(row, isNull);
}
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getUintVal(row, isNull);
}
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override
float getFloatVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getFloatVal(row, isNull);
}
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override
double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getDoubleVal(row, isNull);
}
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getLongDoubleVal(row, isNull);
}
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getDecimalVal(row, isNull);
}
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getDateIntVal(row, isNull);
}
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getDatetimeIntVal(row, isNull);
}
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getTimestampIntVal(row, isNull);
}
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getTimeIntVal(row, isNull);
}
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override
bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{
return fExpression->getBoolVal(row, isNull);
}

View File

@ -46,16 +46,16 @@ class ArithmeticOperator : public Operator
public:
ArithmeticOperator();
ArithmeticOperator(const std::string& operatorName);
explicit ArithmeticOperator(const std::string& operatorName);
ArithmeticOperator(const ArithmeticOperator& rhs);
virtual ~ArithmeticOperator();
~ArithmeticOperator() override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual ArithmeticOperator* clone() const override
inline ArithmeticOperator* clone() const override
{
return new ArithmeticOperator(*this);
}
@ -72,15 +72,15 @@ class ArithmeticOperator : public Operator
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -94,7 +94,7 @@ class ArithmeticOperator : public Operator
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -107,11 +107,11 @@ class ArithmeticOperator : public Operator
* F&E framework *
***********************************************************/
using Operator::evaluate;
inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override;
inline void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override;
using Operator::getStrVal;
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop,
ParseTree* rop) override
const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop,
ParseTree* rop) override
{
bool localIsNull = false;
evaluate(row, localIsNull, lop, rop);
@ -119,38 +119,37 @@ class ArithmeticOperator : public Operator
return localIsNull ? fResult.strVal.dropString() : TreeNode::getStrVal(fTimeZone);
}
using Operator::getIntVal;
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getIntVal();
}
using Operator::getUintVal;
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getUintVal();
}
using Operator::getFloatVal;
virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getFloatVal();
}
using Operator::getDoubleVal;
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getDoubleVal();
}
using Operator::getLongDoubleVal;
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop,
ParseTree* rop) override
long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getLongDoubleVal();
}
using Operator::getDecimalVal;
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
@ -169,32 +168,31 @@ class ArithmeticOperator : public Operator
return TreeNode::getDecimalVal();
}
using Operator::getDateIntVal;
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getDateIntVal();
}
using Operator::getDatetimeIntVal;
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getDatetimeIntVal();
}
using Operator::getTimestampIntVal;
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop,
ParseTree* rop) override
int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getTimestampIntVal();
}
using Operator::getTimeIntVal;
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getTimeIntVal();
}
using Operator::getBoolVal;
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
evaluate(row, isNull, lop, rop);
return TreeNode::getBoolVal();
@ -209,7 +207,7 @@ class ArithmeticOperator : public Operator
fDecimalOverflowCheck = check;
}
inline virtual std::string toCppCode(IncludeSet& includes) const override
inline std::string toCppCode(IncludeSet& includes) const override
{
includes.insert("arithmeticoperator.h");
std::stringstream ss;

View File

@ -23,6 +23,6 @@
// # of bytes in a block
const uint64_t BLOCK_SIZE = 8192;
// lobgical_block_rids is the # of rows 1-byter-column in a block
// logical_block_rids is the # of rows 1-byter-column in a block
// its value is the same as block_size, but different unit
const uint64_t LOGICAL_BLOCK_RIDS = BLOCK_SIZE;

View File

@ -25,13 +25,13 @@
using namespace std;
#include <boost/uuid/uuid_io.hpp>
#include <utility>
#include "bytestream.h"
using namespace messageqcpp;
#include "calpontselectexecutionplan.h"
#include "objectreader.h"
#include "filter.h"
#include "returnedcolumn.h"
#include "simplecolumn.h"
#include "querystats.h"
@ -63,10 +63,10 @@ CalpontSelectExecutionPlan::ColumnMap CalpontSelectExecutionPlan::fColMap;
/**
* Constructors/Destructors
*/
CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(const int location)
CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(int location)
: fLocalQuery(GLOBAL_QUERY)
, fFilters(0)
, fHaving(0)
, fFilters(nullptr)
, fHaving(nullptr)
, fLocation(location)
, fDependent(false)
, fTxnID(-1)
@ -98,17 +98,18 @@ CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(const int location)
fUuid = QueryTeleClient::genUUID();
}
CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(
const ReturnedColumnList& returnedCols, ParseTree* filters, const SelectList& subSelects,
const GroupByColumnList& groupByCols, ParseTree* having, const OrderByColumnList& orderByCols,
const string alias, const int location, const bool dependent, const bool withRollup)
: fReturnedCols(returnedCols)
CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(ReturnedColumnList returnedCols, ParseTree* filters,
SelectList subSelects, GroupByColumnList groupByCols,
ParseTree* having, OrderByColumnList orderByCols,
string alias, int location, bool dependent,
bool withRollup)
: fReturnedCols(std::move(returnedCols))
, fFilters(filters)
, fSubSelects(subSelects)
, fGroupByCols(groupByCols)
, fSubSelects(std::move(subSelects))
, fGroupByCols(std::move(groupByCols))
, fHaving(having)
, fOrderByCols(orderByCols)
, fTableAlias(alias)
, fOrderByCols(std::move(orderByCols))
, fTableAlias(std::move(alias))
, fLocation(location)
, fDependent(dependent)
, fPriority(querystats::DEFAULT_USER_PRIORITY_LEVEL)
@ -118,23 +119,18 @@ CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(
}
CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(string data)
: fData(data)
, fPriority(querystats::DEFAULT_USER_PRIORITY_LEVEL)
, fWithRollup(false)
: fData(std::move(data)), fPriority(querystats::DEFAULT_USER_PRIORITY_LEVEL), fWithRollup(false)
{
fUuid = QueryTeleClient::genUUID();
}
CalpontSelectExecutionPlan::~CalpontSelectExecutionPlan()
{
if (fFilters != NULL)
delete fFilters;
delete fFilters;
delete fHaving;
if (fHaving != NULL)
delete fHaving;
fFilters = NULL;
fHaving = NULL;
fFilters = nullptr;
fHaving = nullptr;
if (!fDynamicParseTreeVec.empty())
{
@ -145,11 +141,11 @@ CalpontSelectExecutionPlan::~CalpontSelectExecutionPlan()
// 'delete fFilters;' above has already deleted objects pointed
// to by parseTree->left()/right()/data(), so we set the
// pointers to NULL here before calling 'delete parseTree;'
parseTree->left((ParseTree*)(NULL));
parseTree->right((ParseTree*)(NULL));
parseTree->data((TreeNode*)(NULL));
parseTree->left((ParseTree*)(nullptr));
parseTree->right((ParseTree*)(nullptr));
parseTree->data((TreeNode*)(nullptr));
delete parseTree;
parseTree = NULL;
parseTree = nullptr;
}
}
@ -265,7 +261,7 @@ string CalpontSelectExecutionPlan::toString() const
// Filters
output << ">>Filters" << endl;
if (filters() != 0)
if (filters() != nullptr)
filters()->walk(ParseTree::print, output);
else
output << "empty filter tree" << endl;
@ -282,7 +278,7 @@ string CalpontSelectExecutionPlan::toString() const
}
// Having
if (having() != 0)
if (having() != nullptr)
{
output << ">>Having" << endl;
having()->walk(ParseTree::print, output);
@ -496,16 +492,16 @@ void CalpontSelectExecutionPlan::unserialize(messageqcpp::ByteStream& b)
fDerivedTableList.clear();
fSelectSubList.clear();
if (fFilters != 0)
if (fFilters != nullptr)
{
delete fFilters;
fFilters = 0;
fFilters = nullptr;
}
if (fHaving != 0)
if (fHaving != nullptr)
{
delete fHaving;
fHaving = 0;
fHaving = nullptr;
}
if (!fDynamicParseTreeVec.empty())
@ -517,11 +513,11 @@ void CalpontSelectExecutionPlan::unserialize(messageqcpp::ByteStream& b)
// 'delete fFilters;' above has already deleted objects pointed
// to by parseTree->left()/right()/data(), so we set the
// pointers to NULL here before calling 'delete parseTree;'
parseTree->left((ParseTree*)(NULL));
parseTree->right((ParseTree*)(NULL));
parseTree->data((TreeNode*)(NULL));
parseTree->left((ParseTree*)(nullptr));
parseTree->right((ParseTree*)(nullptr));
parseTree->data((TreeNode*)(nullptr));
delete parseTree;
parseTree = NULL;
parseTree = nullptr;
}
}
@ -699,12 +695,12 @@ bool CalpontSelectExecutionPlan::operator==(const CalpontSelectExecutionPlan& t)
return false;
// fFilters
if (fFilters != NULL && t.fFilters != NULL)
if (fFilters != nullptr && t.fFilters != nullptr)
{
if (*fFilters != *t.fFilters)
return false;
}
else if (fFilters != NULL || t.fFilters != NULL)
else if (fFilters != nullptr || t.fFilters != nullptr)
return false;
// fSubSelects
@ -725,12 +721,12 @@ bool CalpontSelectExecutionPlan::operator==(const CalpontSelectExecutionPlan& t)
return false;
// fHaving
if (fHaving != NULL && t.fHaving != NULL)
if (fHaving != nullptr && t.fHaving != nullptr)
{
if (*fHaving != *t.fHaving)
return false;
}
else if (fHaving != NULL || t.fHaving != NULL)
else if (fHaving != nullptr || t.fHaving != nullptr)
return false;
// fOrderByCols
@ -795,7 +791,7 @@ bool CalpontSelectExecutionPlan::operator==(const CalpontExecutionPlan* t) const
ac = dynamic_cast<const CalpontSelectExecutionPlan*>(t);
if (ac == NULL)
if (ac == nullptr)
return false;
return *this == *ac;

View File

@ -146,19 +146,18 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/**
* Constructors
*/
CalpontSelectExecutionPlan(const int location = MAIN);
explicit CalpontSelectExecutionPlan(int location = MAIN);
CalpontSelectExecutionPlan(const ReturnedColumnList& returnedCols, ParseTree* filters,
const SelectList& subSelects, const GroupByColumnList& groupByCols,
ParseTree* having, const OrderByColumnList& orderByCols, const std::string alias,
const int location, const bool dependent, const bool withRollup);
CalpontSelectExecutionPlan(ReturnedColumnList returnedCols, ParseTree* filters, SelectList subSelects,
GroupByColumnList groupByCols, ParseTree* having, OrderByColumnList orderByCols,
std::string alias, int location, bool dependent, bool withRollup);
CalpontSelectExecutionPlan(const std::string data);
explicit CalpontSelectExecutionPlan(std::string data);
/**
* Destructors
*/
virtual ~CalpontSelectExecutionPlan();
~CalpontSelectExecutionPlan() override;
/**
* Access and mutator methods
@ -366,13 +365,13 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/** sql representation of this select query
*
*/
const std::string data() const
const std::string& data() const
{
return fData;
}
void data(const std::string data)
void data(std::string data)
{
fData = data;
fData = std::move(data);
}
/** session id
@ -679,7 +678,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
fDJSSmallSideLimit = l;
}
uint64_t djsSmallSideLimit()
uint64_t djsSmallSideLimit() const
{
return fDJSSmallSideLimit;
}
@ -688,7 +687,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
fDJSLargeSideLimit = l;
}
uint64_t djsLargeSideLimit()
uint64_t djsLargeSideLimit() const
{
return fDJSLargeSideLimit;
}
@ -697,7 +696,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
fDJSPartitionSize = l;
}
uint64_t djsPartitionSize()
uint64_t djsPartitionSize() const
{
return fDJSPartitionSize;
}
@ -715,7 +714,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
fDJSForceRun = b;
}
bool djsForceRun()
bool djsForceRun() const
{
return fDJSForceRun;
}
@ -724,7 +723,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
fMaxPmJoinResultCount = value;
}
uint32_t maxPmJoinResultCount()
uint32_t maxPmJoinResultCount() const
{
return fMaxPmJoinResultCount;
}
@ -733,7 +732,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
fUMMemLimit = l;
}
int64_t umMemLimit()
int64_t umMemLimit() const
{
return fUMMemLimit;
}
@ -742,7 +741,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
fIsDML = b;
}
bool isDML()
bool isDML() const
{
return fIsDML;
}
@ -762,15 +761,15 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/**
* @note Serialize() assumes that none of the vectors contain NULL pointers.
*/
virtual void serialize(messageqcpp::ByteStream&) const;
virtual void unserialize(messageqcpp::ByteStream&);
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const CalpontExecutionPlan* t) const;
bool operator==(const CalpontExecutionPlan* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -784,7 +783,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const CalpontExecutionPlan* t) const;
bool operator!=(const CalpontExecutionPlan* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -863,7 +862,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/**
* A tree of Filter objects
*/
ParseTree* fFilters = nullptr;
ParseTree* fFilters{nullptr};
/**
* A list of CalpontExecutionPlan objects
*/
@ -875,7 +874,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/**
* A tree of having clause condition associated with group by clause
*/
ParseTree* fHaving;
ParseTree* fHaving{nullptr};
/**
* A list of order by columns
*/
@ -955,7 +954,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
// Derived table involved in the query. For derived table optimization
std::vector<SCSEP> fSubSelectList;
boost::uuids::uuid fUuid;
boost::uuids::uuid fUuid{};
/* Disk-based join vars */
uint64_t fDJSSmallSideLimit = 0;

View File

@ -139,9 +139,8 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
{
}
DictOID(const DictOID& rhs)
: dictOID(rhs.dictOID), listOID(rhs.listOID), treeOID(rhs.treeOID), compressionType(rhs.compressionType)
{
}
= default;
OID dictOID;
OID listOID;
OID treeOID;
@ -176,7 +175,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
// If we used an unorderedmap<OID, ColumnResult*>, we might improve performance.
// Maybe.
NJLSysDataVector sysDataVec;
NJLSysDataList(){};
NJLSysDataList() = default;
~NJLSysDataList();
NJLSysDataVector::const_iterator begin() const
{
@ -439,9 +438,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
*/
struct TableName
{
TableName()
{
}
TableName() = default;
TableName(std::string sch, std::string tb) : schema(sch), table(tb)
{
}
@ -873,7 +870,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
private:
/** Constuctors */
explicit CalpontSystemCatalog(const CalpontSystemCatalog& rhs);
CalpontSystemCatalog(const CalpontSystemCatalog& rhs);
CalpontSystemCatalog& operator=(const CalpontSystemCatalog& rhs);

View File

@ -56,7 +56,7 @@ class ClientRotator
}
}
/** @brief connnect
/** @brief connect
*
* Try connecting to client based on session id. If no connection,
* try connectList.
@ -79,7 +79,7 @@ class ClientRotator
{
fClient->shutdown();
delete fClient;
fClient = 0;
fClient = nullptr;
}
}
@ -140,7 +140,7 @@ class ClientRotator
*/
bool exeConnect(const std::string& clientName);
/** @brief connnect to list
/** @brief connect to list
*
* Try connecting to next client on list
* until timeout lapses. Then throw exception.

View File

@ -67,22 +67,23 @@ class ConstantColumn : public ReturnedColumn
/**
* ctor
*/
ConstantColumn(const std::string& sql, TYPE type = LITERAL);
explicit ConstantColumn(const std::string& sql, TYPE type = LITERAL);
/**
* ctor
*/
ConstantColumn(const int64_t val, TYPE type = NUM); // deprecate
explicit ConstantColumn(const int64_t val, TYPE type = NUM); // deprecate
/**
* ctor
*/
ConstantColumn(const uint64_t val, TYPE type = NUM, int8_t scale = 0, uint8_t precision = 0); // deprecate
explicit ConstantColumn(const uint64_t val, TYPE type = NUM, int8_t scale = 0,
uint8_t precision = 0); // deprecate
// There are more ctors below...
/**
* dtor
*/
virtual ~ConstantColumn();
~ConstantColumn() override;
/*
* Accessor Methods
@ -144,25 +145,25 @@ class ConstantColumn : public ReturnedColumn
/**
* accessor
*/
virtual const std::string data() const override;
const std::string data() const override;
/**
* accessor
*/
virtual void data(const std::string data) override
void data(const std::string data) override
{
fData = data;
}
/**
* accessor
*/
virtual const std::string toString() const override;
const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual ConstantColumn* clone() const override
inline ConstantColumn* clone() const override
{
return new ConstantColumn(*this);
}
@ -173,18 +174,18 @@ class ConstantColumn : public ReturnedColumn
/**
* serialize
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
void serialize(messageqcpp::ByteStream&) const override;
/**
* unserialize
*/
virtual void unserialize(messageqcpp::ByteStream&) override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -198,7 +199,7 @@ class ConstantColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -207,13 +208,13 @@ class ConstantColumn : public ReturnedColumn
*/
bool operator!=(const ConstantColumn& t) const;
virtual bool hasWindowFunc() override
bool hasWindowFunc() override
{
return false;
}
/** Constant column on the filte can always be moved into derived table */
virtual void setDerivedTable() override
void setDerivedTable() override
{
fDerivedTable = std::string("*");
}
@ -267,7 +268,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override
bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
return TreeNode::getBoolVal();
@ -275,7 +276,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
return fResult.strVal;
@ -283,7 +284,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
return fResult.intVal;
@ -291,7 +292,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
return fResult.uintVal;
@ -299,7 +300,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override
float getFloatVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
return fResult.floatVal;
@ -307,7 +308,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override
double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
return fResult.doubleVal;
@ -315,7 +316,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
return fResult.decimalVal;
@ -323,7 +324,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
@ -338,7 +339,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
@ -354,7 +355,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
@ -370,7 +371,7 @@ class ConstantColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = isNull || (fType == NULLDATA);
@ -409,7 +410,7 @@ class ConstantColumnNull : public ConstantColumn
class ConstantColumnString : public ConstantColumn
{
public:
ConstantColumnString(const std::string& str) : ConstantColumn(str, ConstantColumn::LITERAL)
explicit ConstantColumnString(const std::string& str) : ConstantColumn(str, ConstantColumn::LITERAL)
{
}
};
@ -471,7 +472,6 @@ std::ostream& operator<<(std::ostream& output, const ConstantColumn& rhs);
class RollupMarkColumn : public ReturnedColumn
{
public:
/**
* ctor
*/
@ -483,7 +483,7 @@ class RollupMarkColumn : public ReturnedColumn
/**
* dtor
*/
virtual ~RollupMarkColumn();
~RollupMarkColumn() override;
/**
* accessor
@ -502,26 +502,26 @@ class RollupMarkColumn : public ReturnedColumn
/**
* accessor
*/
virtual const std::string data() const override
const std::string data() const override
{
return "";
}
/**
* accessor
*/
virtual void data(const std::string data) override
void data(const std::string data) override
{
idbassert(0);
}
/**
* accessor
*/
virtual const std::string toString() const override
const std::string toString() const override
{
return "RollupMarkColumn";
}
virtual std::string toCppCode(IncludeSet& includes) const override
std::string toCppCode(IncludeSet& includes) const override
{
idbassert(0);
}
@ -529,7 +529,7 @@ class RollupMarkColumn : public ReturnedColumn
*
* deep copy of this pointer and return the copy
*/
inline virtual RollupMarkColumn* clone() const override
inline RollupMarkColumn* clone() const override
{
return new RollupMarkColumn();
}
@ -540,18 +540,18 @@ class RollupMarkColumn : public ReturnedColumn
/**
* serialize
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
void serialize(messageqcpp::ByteStream&) const override;
/**
* unserialize
*/
virtual void unserialize(messageqcpp::ByteStream&) override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override
bool operator==(const TreeNode* t) const override
{
return false;
}
@ -571,7 +571,7 @@ class RollupMarkColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override
bool operator!=(const TreeNode* t) const override
{
return true;
}
@ -586,13 +586,13 @@ class RollupMarkColumn : public ReturnedColumn
return false;
}
virtual bool hasWindowFunc() override
bool hasWindowFunc() override
{
return false;
}
/** Constant column on the filte can always be moved into derived table */
virtual void setDerivedTable() override
void setDerivedTable() override
{
fDerivedTable = std::string("*");
}
@ -617,18 +617,18 @@ class RollupMarkColumn : public ReturnedColumn
/**
* F&E
*/
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override
bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{
return true;
}
/**
* F&E
*/
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
/**
* F&E
*/
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = false;
return 0x12340000UL;
@ -636,28 +636,28 @@ class RollupMarkColumn : public ReturnedColumn
/**
* F&E
*/
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{
return getIntVal(row, isNull);
}
/**
* F&E
*/
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override
float getFloatVal(rowgroup::Row& row, bool& isNull) override
{
return getIntVal(row, isNull);
}
/**
* F&E
*/
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override
double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{
return getIntVal(row, isNull);
}
/**
* F&E
*/
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{
isNull = false;
return fResult.decimalVal;
@ -665,7 +665,7 @@ class RollupMarkColumn : public ReturnedColumn
/**
* F&E
*/
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = false;
@ -680,7 +680,7 @@ class RollupMarkColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = false;
@ -696,7 +696,7 @@ class RollupMarkColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = false;
@ -712,7 +712,7 @@ class RollupMarkColumn : public ReturnedColumn
/**
* F&E
*/
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{
isNull = false;

View File

@ -64,7 +64,7 @@ class ConstantFilter : public Filter
*/
ConstantFilter();
ConstantFilter(const SOP& op, ReturnedColumn* lhs, ReturnedColumn* rhs);
ConstantFilter(SimpleFilter* sf);
explicit ConstantFilter(SimpleFilter* sf);
// for code generation purposes only
ConstantFilter(const SOP& op, const FilterList& filterList, const SRCP& col,
const std::string& functionName, const std::string& data);
@ -75,7 +75,7 @@ class ConstantFilter : public Filter
/**
* Destructors
*/
virtual ~ConstantFilter();
~ConstantFilter() override;
/**
* Accessor Methods
@ -114,20 +114,20 @@ class ConstantFilter : public Filter
}
// virtual const std::string data() const;
virtual const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
const std::string toString() const override;
std::string toCppCode(IncludeSet& includes) const override;
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -141,7 +141,7 @@ class ConstantFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -188,17 +188,17 @@ class ConstantFilter : public Filter
FilterList fFilterList; /// vector of simple filters
SRCP fCol; /// the common column
std::string fFunctionName; /// function name
/***********************************************************
* F&E framework *
***********************************************************/
/***********************************************************
* F&E framework *
***********************************************************/
public:
ConstantFilter(const ConstantFilter& rhs);
inline virtual ConstantFilter* clone() const override
inline ConstantFilter* clone() const override
{
return new ConstantFilter(*this);
}
inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override;
inline bool getBoolVal(rowgroup::Row& row, bool& isNull) override;
// get all simple columns involved in this column
const std::vector<SimpleColumn*>& simpleColumnList();

View File

@ -49,9 +49,9 @@ class ExistsFilter : public Filter
* Constructors
*/
ExistsFilter();
ExistsFilter(const SCSEP& sub, const bool existsFlag = false, const bool correlated = false);
explicit ExistsFilter(const SCSEP& sub, const bool existsFlag = false, const bool correlated = false);
ExistsFilter(const ExistsFilter& rhs);
virtual ~ExistsFilter();
~ExistsFilter() override;
/**
* Accessor Methods
@ -87,19 +87,19 @@ class ExistsFilter : public Filter
* Overloaded stream operator
*/
// virtual std::ostream& operator<< (std::ostream& output);
virtual const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
const std::string toString() const override;
std::string toCppCode(IncludeSet& includes) const override;
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual ExistsFilter* clone() const override
inline ExistsFilter* clone() const override
{
return new ExistsFilter(*this);
}
@ -109,7 +109,7 @@ class ExistsFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -123,7 +123,7 @@ class ExistsFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*

View File

@ -53,12 +53,12 @@ struct Token
TreeNode* value;
bool is_operator() const
{
if (value == 0)
if (value == nullptr)
return false;
return (typeid(*value) == typeid(Operator));
}
Token() : value(0)
Token() : value(nullptr)
{
}
Token(TreeNode* v) : value(v)

View File

@ -60,14 +60,14 @@ class Filter : public TreeNode
* Constructors
*/
Filter();
Filter(const std::string& sql);
explicit Filter(const std::string& sql);
// not needed yet
// Filter(const Filter& rhs);
/**
* Destructors
*/
virtual ~Filter();
~Filter() override;
/**
* Accessor Methods
*/
@ -75,15 +75,15 @@ class Filter : public TreeNode
/**
* Operations
*/
virtual const std::string toString() const override;
const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
virtual const std::string data() const override
const std::string data() const override
{
return fData;
}
virtual void data(const std::string data) override
void data(const std::string data) override
{
fData = data;
}
@ -92,7 +92,7 @@ class Filter : public TreeNode
*
* deep copy of this pointer and return the copy
*/
inline virtual Filter* clone() const override
inline Filter* clone() const override
{
return new Filter(*this);
}
@ -100,15 +100,15 @@ class Filter : public TreeNode
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -122,7 +122,7 @@ class Filter : public TreeNode
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -133,9 +133,9 @@ class Filter : public TreeNode
/** @brief test if this filter can be combined with the argument filter
* This is for operation combine optimization
* @param f the filter that this fiter tries to combine with
* @param f the filter that this filter tries to combine with
* @param op the operator that connects the two filters. if one or both of the
* two filters is constantFilter, need to make sure operator is consistant.
* two filters is constantFilter, need to make sure operator is consistent.
* @return a filter(constantfilter) if successfully combined. otherwise
* return NULL
* For Oracle front end. Deprecated now.

View File

@ -51,11 +51,11 @@ class FunctionColumn : public ReturnedColumn
{
public:
FunctionColumn();
FunctionColumn(std::string& funcName);
explicit FunctionColumn(std::string& funcName);
FunctionColumn(const std::string& functionName, const std::string& funcParmsInString,
const uint32_t sessionID = 0);
FunctionColumn(const FunctionColumn& rhs, const uint32_t sessionID = 0);
virtual ~FunctionColumn();
~FunctionColumn() override;
/** get function name
*
@ -131,19 +131,19 @@ class FunctionColumn : public ReturnedColumn
fTimeZone = timeZone;
}
virtual const std::string data() const override;
virtual void data(const std::string data) override
const std::string data() const override;
void data(const std::string data) override
{
fData = data;
}
virtual const std::string toString() const override;
const std::string toString() const override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual FunctionColumn* clone() const override
inline FunctionColumn* clone() const override
{
return new FunctionColumn(*this);
}
@ -151,20 +151,20 @@ class FunctionColumn : public ReturnedColumn
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override;
virtual bool hasWindowFunc() override;
virtual void setDerivedTable() override;
virtual void replaceRealCol(std::vector<SRCP>&) override;
bool hasAggregate() override;
bool hasWindowFunc() override;
void setDerivedTable() override;
void replaceRealCol(std::vector<SRCP>&) override;
virtual const std::vector<SimpleColumn*>& simpleColumnList() const override
{
return fSimpleColumnList;
}
virtual void setSimpleColumnList() override;
void setSimpleColumnList() override;
/**
* Return the tableAlias name of the table that the column arguments belong to.
*
@ -172,9 +172,9 @@ class FunctionColumn : public ReturnedColumn
* @return true, if all arguments belong to one table
* false, if multiple tables are involved in the function
*/
virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
/**
@ -190,7 +190,7 @@ class FunctionColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -204,7 +204,7 @@ class FunctionColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -217,7 +217,7 @@ class FunctionColumn : public ReturnedColumn
* F&E framework *
***********************************************************/
public:
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
fResult.strVal.dropString();
@ -228,32 +228,32 @@ class FunctionColumn : public ReturnedColumn
}
return fResult.strVal;
}
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getIntVal(row, fFunctionParms, isNull, fOperationType);
}
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getUintVal(row, fFunctionParms, isNull, fOperationType);
}
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override
float getFloatVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getFloatVal(row, fFunctionParms, isNull, fOperationType);
}
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override
double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getDoubleVal(row, fFunctionParms, isNull, fOperationType);
}
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getLongDoubleVal(row, fFunctionParms, isNull, fOperationType);
}
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
IDB_Decimal decimal = fFunctor->getDecimalVal(row, fFunctionParms, isNull, fOperationType);
@ -290,36 +290,37 @@ class FunctionColumn : public ReturnedColumn
if (fResultType.scale > decimal.scale)
decimal.value *= IDB_pow[fResultType.scale - decimal.scale];
else
decimal.value = (int64_t)(
decimal.value > 0 ? (double)decimal.value / IDB_pow[decimal.scale - fResultType.scale] + 0.5
: (double)decimal.value / IDB_pow[decimal.scale - fResultType.scale] - 0.5);
decimal.value =
(int64_t)(decimal.value > 0
? (double)decimal.value / IDB_pow[decimal.scale - fResultType.scale] + 0.5
: (double)decimal.value / IDB_pow[decimal.scale - fResultType.scale] - 0.5);
}
decimal.scale = fResultType.scale;
decimal.precision = std::max(fResultType.precision, static_cast<int32_t>(decimal.precision));
return decimal;
}
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override
bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getBoolVal(row, fFunctionParms, isNull, fOperationType);
}
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getDateIntVal(row, fFunctionParms, isNull, fOperationType);
}
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getDatetimeIntVal(row, fFunctionParms, isNull, fOperationType);
}
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getTimestampIntVal(row, fFunctionParms, isNull, fOperationType);
}
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{
fOperationType.setTimeZone(fTimeZone);
return fFunctor->getTimeIntVal(row, fFunctionParms, isNull, fOperationType);
@ -332,8 +333,8 @@ class FunctionColumn : public ReturnedColumn
private:
funcexp::FunctionParm fFunctionParms;
funcexp::Func* fFunctor; /// functor to execute this function
funcexp::Func* fDynamicFunctor = NULL; // for rand encode decode
funcexp::Func* fFunctor; /// functor to execute this function
funcexp::Func* fDynamicFunctor = nullptr; // for rand encode decode
bool fFixed = false;
};

View File

@ -52,25 +52,25 @@ class GroupConcatColumn : public AggregateColumn
*/
GroupConcatColumn();
GroupConcatColumn(const uint32_t sessionID);
explicit GroupConcatColumn(const uint32_t sessionID);
GroupConcatColumn(const GroupConcatColumn& rhs, const uint32_t sessionID = 0);
/**
* Destructors
*/
virtual ~GroupConcatColumn();
~GroupConcatColumn() override;
/**
* Overloaded stream operator
*/
virtual const std::string toString() const override;
const std::string toString() const override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
virtual GroupConcatColumn* clone() const override
GroupConcatColumn* clone() const override
{
return new GroupConcatColumn(*this);
}
@ -98,8 +98,8 @@ class GroupConcatColumn : public AggregateColumn
/**
* Serialize interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -107,7 +107,7 @@ class GroupConcatColumn : public AggregateColumn
* @return true iff every member of t is a duplicate copy of every member of this;
* false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -124,7 +124,7 @@ class GroupConcatColumn : public AggregateColumn
* @return false iff every member of t is a duplicate copy of every member of this;
* true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -135,7 +135,7 @@ class GroupConcatColumn : public AggregateColumn
using AggregateColumn::operator!=;
virtual bool operator!=(const GroupConcatColumn& t) const;
virtual string toCppCode(IncludeSet& includes) const override;
string toCppCode(IncludeSet& includes) const override;
private:
std::vector<SRCP> fOrderCols;

View File

@ -79,9 +79,7 @@ class IntervalColumn : public ReturnedColumn
IntervalColumn();
IntervalColumn(SRCP&, int);
IntervalColumn(const IntervalColumn& rhs, const uint32_t sessionID = 0);
virtual ~IntervalColumn()
{
}
~IntervalColumn() override = default;
const SRCP& val() const
{
return fVal;
@ -99,22 +97,22 @@ class IntervalColumn : public ReturnedColumn
fIntervalType = intervalType;
}
const std::string toString() const override;
inline virtual IntervalColumn* clone() const override
inline IntervalColumn* clone() const override
{
return new IntervalColumn(*this);
}
using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override
bool hasAggregate() override
{
return false;
}
virtual bool hasWindowFunc() override
bool hasWindowFunc() override
{
return false;
}
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
/**
@ -124,12 +122,12 @@ class IntervalColumn : public ReturnedColumn
int fIntervalType;
// okay to be private for now.
virtual bool operator==(const TreeNode* t) const override
bool operator==(const TreeNode* t) const override
{
return false;
}
bool operator==(const IntervalColumn& t) const;
virtual bool operator!=(const TreeNode* t) const override
bool operator!=(const TreeNode* t) const override
{
return false;
}

View File

@ -47,25 +47,25 @@ class JsonArrayAggColumn : public AggregateColumn
*/
JsonArrayAggColumn();
JsonArrayAggColumn(const uint32_t sessionID);
explicit JsonArrayAggColumn(const uint32_t sessionID);
JsonArrayAggColumn(const JsonArrayAggColumn& rhs, const uint32_t sessionID = 0);
/**
* Destructors
*/
virtual ~JsonArrayAggColumn();
~JsonArrayAggColumn() override;
/**
* Overloaded stream operator
*/
virtual const std::string toString() const override;
const std::string toString() const override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
virtual JsonArrayAggColumn* clone() const override
JsonArrayAggColumn* clone() const override
{
return new JsonArrayAggColumn(*this);
}
@ -93,8 +93,8 @@ class JsonArrayAggColumn : public AggregateColumn
/**
* Serialize interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -102,7 +102,7 @@ class JsonArrayAggColumn : public AggregateColumn
* @return true iff every member of t is a duplicate copy of every member of this;
* false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -119,7 +119,7 @@ class JsonArrayAggColumn : public AggregateColumn
* @return false iff every member of t is a duplicate copy of every member of this;
* true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -130,7 +130,7 @@ class JsonArrayAggColumn : public AggregateColumn
using AggregateColumn::operator!=;
virtual bool operator!=(const JsonArrayAggColumn& t) const;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
std::vector<SRCP> fOrderCols;

View File

@ -27,7 +27,7 @@
#include <iosfwd>
#include <boost/shared_ptr.hpp>
//#include "expressionparser.h"
// #include "expressionparser.h"
#include "operator.h"
#include "parsetree.h"
@ -64,13 +64,13 @@ class LogicOperator : public Operator
* Constructors
*/
LogicOperator();
LogicOperator(const std::string& operatorName);
explicit LogicOperator(const std::string& operatorName);
LogicOperator(const LogicOperator& rhs);
/**
* Destructors
*/
virtual ~LogicOperator();
~LogicOperator() override;
/**
* Accessor Methods
@ -80,7 +80,7 @@ class LogicOperator : public Operator
*
* deep copy of this pointer and return the copy
*/
inline virtual LogicOperator* clone() const override
inline LogicOperator* clone() const override
{
return new LogicOperator(*this);
}
@ -88,15 +88,15 @@ class LogicOperator : public Operator
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -110,7 +110,7 @@ class LogicOperator : public Operator
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -123,7 +123,7 @@ class LogicOperator : public Operator
// F&E framework
using Operator::getBoolVal;
inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
inline bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
switch (fOp)
{
@ -165,12 +165,12 @@ class LogicOperator : public Operator
}
using TreeNode::evaluate;
inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
inline void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{
fResult.boolVal = getBoolVal(row, isNull, lop, rop);
}
inline virtual std::string toCppCode(IncludeSet& includes) const override
inline std::string toCppCode(IncludeSet& includes) const override
{
includes.insert("logicoperator.h");
std::stringstream ss;

View File

@ -54,7 +54,7 @@ class MCSAnalyzeTableExecutionPlan : public CalpontExecutionPlan
{
}
virtual ~MCSAnalyzeTableExecutionPlan() = default;
~MCSAnalyzeTableExecutionPlan() override = default;
const ReturnedColumnList& returnedCols() const
{
@ -232,16 +232,16 @@ class MCSAnalyzeTableExecutionPlan : public CalpontExecutionPlan
return ((fSessionID & 0x80000000) != 0);
}
virtual void serialize(messageqcpp::ByteStream& bs) const;
void serialize(messageqcpp::ByteStream& bs) const override;
virtual void unserialize(messageqcpp::ByteStream& bs);
void unserialize(messageqcpp::ByteStream& bs) override;
// TODO: Why do we need this?
virtual bool operator==(const CalpontExecutionPlan* t) const
bool operator==(const CalpontExecutionPlan* t) const override
{
return false;
}
virtual bool operator!=(const CalpontExecutionPlan* t) const
bool operator!=(const CalpontExecutionPlan* t) const override
{
return false;
}

View File

@ -28,7 +28,7 @@
#include <exception>
#include <string>
#include <stdint.h>
#include <cstdint>
namespace messageqcpp
{
@ -53,9 +53,9 @@ class ObjectReader
class UnserializeException : public std::exception
{
public:
UnserializeException(std::string) throw();
virtual ~UnserializeException() throw();
virtual const char* what() const throw();
explicit UnserializeException(std::string) noexcept;
~UnserializeException() noexcept override;
const char* what() const noexcept override;
private:
std::string fWhat;

View File

@ -70,23 +70,23 @@ class Operator : public TreeNode
{
public:
Operator();
Operator(const std::string& operatorName);
explicit Operator(const std::string& operatorName);
Operator(const Operator& rhs);
virtual ~Operator();
~Operator() override;
virtual const std::string toString() const override;
virtual const std::string data() const override
const std::string toString() const override;
const std::string data() const override
{
return fData;
}
virtual void data(const std::string data) override;
void data(const std::string data) override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual Operator* clone() const override
inline Operator* clone() const override
{
return new Operator(*this);
}
@ -101,15 +101,15 @@ class Operator : public TreeNode
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -123,7 +123,7 @@ class Operator : public TreeNode
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -139,7 +139,7 @@ class Operator : public TreeNode
*/
virtual void reverseOp();
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
protected:
std::string fData;
@ -231,11 +231,11 @@ class Operator : public TreeNode
virtual void setOpType(Type& l, Type& r)
{
}
virtual void operationType(const Type& ot) override
void operationType(const Type& ot) override
{
fOperationType = ot;
}
virtual const Type& operationType() const override
const Type& operationType() const override
{
return fOperationType;
}

View File

@ -49,9 +49,9 @@ class OuterJoinOnFilter : public Filter
* Constructors
*/
OuterJoinOnFilter();
OuterJoinOnFilter(const SPTP& pt);
explicit OuterJoinOnFilter(const SPTP& pt);
OuterJoinOnFilter(const OuterJoinOnFilter& rhs);
virtual ~OuterJoinOnFilter();
~OuterJoinOnFilter() override;
/**
* Accessor Methods
@ -69,19 +69,19 @@ class OuterJoinOnFilter : public Filter
* Overloaded stream operator
*/
// virtual std::ostream& operator<< (std::ostream& output);
virtual const std::string toString() const override;
const std::string toString() const override;
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual OuterJoinOnFilter* clone() const override
inline OuterJoinOnFilter* clone() const override
{
return new OuterJoinOnFilter(*this);
}
@ -91,7 +91,7 @@ class OuterJoinOnFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -105,7 +105,7 @@ class OuterJoinOnFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -113,7 +113,8 @@ class OuterJoinOnFilter : public Filter
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
bool operator!=(const OuterJoinOnFilter& t) const;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
// default okay?
// OuterJoinOnFilter& operator=(const OuterJoinOnFilter& rhs);

View File

@ -59,7 +59,7 @@ class ParseTree
* Constructor / Destructor
*/
inline ParseTree();
inline ParseTree(TreeNode* data);
inline explicit ParseTree(TreeNode* data);
inline ParseTree(TreeNode* data, ParseTree* left, ParseTree* right);
inline ParseTree(const ParseTree& rhs);
inline virtual ~ParseTree();
@ -210,9 +210,9 @@ class ParseTree
inline static void deleter(ParseTree*& n)
{
delete n->fData;
n->fData = 0;
n->fData = nullptr;
delete n;
n = 0;
n = nullptr;
}
inline void derivedTable(const std::string& derivedTable)
@ -238,7 +238,7 @@ class ParseTree
{
ParseTree* node;
GoTo direction;
StackFrame(ParseTree* node_, GoTo direction_ = GoTo::Left) : node(node_), direction(direction_)
explicit StackFrame(ParseTree* node_, GoTo direction_ = GoTo::Left) : node(node_), direction(direction_)
{
}
};
@ -370,11 +370,11 @@ namespace execplan
/**
* Class Definition
*/
inline ParseTree::ParseTree() : fData(0), fLeft(0), fRight(0), fDerivedTable("")
inline ParseTree::ParseTree() : fData(nullptr), fLeft(nullptr), fRight(nullptr), fDerivedTable("")
{
}
inline ParseTree::ParseTree(TreeNode* data) : fData(data), fLeft(0), fRight(0)
inline ParseTree::ParseTree(TreeNode* data) : fData(data), fLeft(nullptr), fRight(nullptr)
{
// bug5984. Need to validate data to be not null
if (data)
@ -389,7 +389,7 @@ inline ParseTree::ParseTree(TreeNode* data, ParseTree* left, ParseTree* right)
}
inline ParseTree::ParseTree(const ParseTree& rhs)
: fData(0), fLeft(0), fRight(0), fDerivedTable(rhs.fDerivedTable)
: fData(nullptr), fLeft(nullptr), fRight(nullptr), fDerivedTable(rhs.fDerivedTable)
{
copyTree(rhs);
}
@ -613,22 +613,22 @@ inline ParseTree& ParseTree::operator=(const ParseTree& rhs)
inline void ParseTree::copyTree(const ParseTree& src)
{
if (fLeft != NULL)
if (fLeft != nullptr)
delete fLeft;
if (fRight != NULL)
if (fRight != nullptr)
delete fRight;
fLeft = NULL;
fRight = NULL;
fLeft = nullptr;
fRight = nullptr;
if (src.left() != NULL)
if (src.left() != nullptr)
{
fLeft = new ParseTree();
fLeft->copyTree(*(src.left()));
}
if (src.right() != NULL)
if (src.right() != nullptr)
{
fRight = new ParseTree();
fRight->copyTree(*(src.right()));
@ -636,29 +636,29 @@ inline void ParseTree::copyTree(const ParseTree& src)
delete fData;
if (src.data() == NULL)
fData = NULL;
if (src.data() == nullptr)
fData = nullptr;
else
fData = src.data()->clone();
}
inline void ParseTree::destroyTree(ParseTree* root)
{
if (root == NULL)
if (root == nullptr)
return;
if (root->left() != NULL)
if (root->left() != nullptr)
{
destroyTree(root->fLeft);
}
if (root->right() != NULL)
if (root->right() != nullptr)
{
destroyTree(root->fRight);
}
delete root;
root = 0;
root = nullptr;
}
inline void ParseTree::draw(const ParseTree* n, std::ostream& dotFile)
@ -668,13 +668,11 @@ inline void ParseTree::draw(const ParseTree* n, std::ostream& dotFile)
l = n->left();
r = n->right();
if (l != 0)
dotFile << "n" << (void*)n << " -> "
<< "n" << (void*)l << std::endl;
if (l != nullptr)
dotFile << "n" << (void*)n << " -> " << "n" << (void*)l << std::endl;
if (r != 0)
dotFile << "n" << (void*)n << " -> "
<< "n" << (void*)r << std::endl;
if (r != nullptr)
dotFile << "n" << (void*)n << " -> " << "n" << (void*)r << std::endl;
auto& node = *(n->data());
dotFile << "n" << (void*)n << " [label=\"" << n->data()->data() << " (" << n << ") "

View File

@ -27,7 +27,7 @@
#include <string>
#include <sstream>
#if defined(__FreeBSD__)
#if defined(__FreeBSD__)
#include <cstdlib>
#else
#include <alloca.h>
@ -52,15 +52,15 @@ class PredicateOperator : public Operator
{
public:
PredicateOperator();
PredicateOperator(const std::string& operatorName);
explicit PredicateOperator(const std::string& operatorName);
PredicateOperator(const PredicateOperator& rhs);
virtual ~PredicateOperator();
~PredicateOperator() override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual PredicateOperator* clone() const override
inline PredicateOperator* clone() const override
{
return new PredicateOperator(*this);
}
@ -68,15 +68,15 @@ class PredicateOperator : public Operator
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -90,7 +90,7 @@ class PredicateOperator : public Operator
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -107,10 +107,10 @@ class PredicateOperator : public Operator
* F&E framework *
***********************************************************/
using Operator::getBoolVal;
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop) override;
bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop) override;
void setOpType(Type& l, Type& r) override;
inline virtual std::string toCppCode(IncludeSet& includes) const override
inline std::string toCppCode(IncludeSet& includes) const override
{
includes.insert("predicateoperator.h");
std::stringstream ss;

View File

@ -62,7 +62,7 @@ class PseudoColumn : public SimpleColumn
* Constructors
*/
PseudoColumn();
PseudoColumn(const uint32_t pseudoType);
explicit PseudoColumn(const uint32_t pseudoType);
PseudoColumn(const std::string& token, const uint32_t pseudoType, const uint32_t sessionID = 0);
PseudoColumn(const std::string& schema, const std::string& table, const std::string& col,
const uint32_t pseudoType, const uint32_t sessionID = 0);
@ -74,13 +74,13 @@ class PseudoColumn : public SimpleColumn
/**
* Destructor
*/
virtual ~PseudoColumn();
~PseudoColumn() override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual PseudoColumn* clone() const override
inline PseudoColumn* clone() const override
{
return new PseudoColumn(*this);
}
@ -106,17 +106,17 @@ class PseudoColumn : public SimpleColumn
/**
* The serialize interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
virtual const std::string toString() const override;
const std::string toString() const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -130,7 +130,7 @@ class PseudoColumn : public SimpleColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -141,7 +141,7 @@ class PseudoColumn : public SimpleColumn
static uint32_t pseudoNameToType(std::string& name);
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
/**

View File

@ -83,20 +83,20 @@ class ReturnedColumn : public TreeNode
* Constructors
*/
ReturnedColumn();
ReturnedColumn(const std::string& sql);
ReturnedColumn(const uint32_t sessionID, const bool returnAll = false);
explicit ReturnedColumn(const std::string& sql);
explicit ReturnedColumn(const uint32_t sessionID, const bool returnAll = false);
ReturnedColumn(const ReturnedColumn& rhs, const uint32_t sessionID = 0);
/**
* Destructors
*/
virtual ~ReturnedColumn();
~ReturnedColumn() override;
/**
* Accessor Methods
*/
virtual const std::string data() const override;
virtual void data(const std::string data) override
const std::string data() const override;
void data(const std::string data) override
{
fData = data;
}
@ -231,22 +231,22 @@ class ReturnedColumn : public TreeNode
/**
* Operations
*/
virtual ReturnedColumn* clone() const override = 0;
ReturnedColumn* clone() const override = 0;
/**
* The serialize interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
virtual const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
const std::string toString() const override;
std::string toCppCode(IncludeSet& includes) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -261,7 +261,7 @@ class ReturnedColumn : public TreeNode
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*

View File

@ -56,13 +56,13 @@ class RowColumn : public ReturnedColumn
/**
* Constructors
*/
RowColumn(const uint32_t sessionID = 0);
explicit RowColumn(const uint32_t sessionID = 0);
RowColumn(const RowColumn& rhs, const uint32_t sessionID = 0);
RowColumn(const std::vector<SRCP>& columnVec, const uint32_t sessionID = 0);
explicit RowColumn(const std::vector<SRCP>& columnVec, const uint32_t sessionID = 0);
/**
* Destructor
*/
virtual ~RowColumn();
~RowColumn() override;
/**
* Accessor Methods
@ -80,7 +80,7 @@ class RowColumn : public ReturnedColumn
*
* deep copy of this pointer and return the copy
*/
inline virtual RowColumn* clone() const override
inline RowColumn* clone() const override
{
return new RowColumn(*this);
}
@ -95,20 +95,20 @@ class RowColumn : public ReturnedColumn
// virtual void serialize(messageqcpp::ByteStream&) const;
// virtual void unserialize(messageqcpp::ByteStream&);
virtual const std::string toString() const override;
const std::string toString() const override;
/**
* Serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -122,7 +122,7 @@ class RowColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -131,16 +131,16 @@ class RowColumn : public ReturnedColumn
*/
bool operator!=(const RowColumn& t) const;
using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override
bool hasAggregate() override
{
return false;
}
virtual bool hasWindowFunc() override
bool hasWindowFunc() override
{
return false;
}
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
/**
@ -156,23 +156,21 @@ class SubSelect : public ReturnedColumn
SubSelect() : ReturnedColumn()
{
}
~SubSelect()
{
}
~SubSelect() override = default;
SubSelect* clone() const override
{
return new SubSelect();
}
using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override
bool hasAggregate() override
{
return false;
}
virtual bool hasWindowFunc() override
bool hasWindowFunc() override
{
return false;
}
virtual const std::string toString() const override;
const std::string toString() const override;
};
/**

View File

@ -63,7 +63,7 @@ class SelectFilter : public Filter
/**
* Destructors
*/
virtual ~SelectFilter();
~SelectFilter() override;
/**
* Accessor Methods
@ -107,13 +107,13 @@ class SelectFilter : public Filter
fCorrelated = correlated;
}
virtual const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
virtual inline const std::string data() const override
const std::string toString() const override;
std::string toCppCode(IncludeSet& includes) const override;
inline const std::string data() const override
{
return fData;
}
virtual inline void data(const std::string data) override
inline void data(const std::string data) override
{
fData = data;
}
@ -130,14 +130,14 @@ class SelectFilter : public Filter
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual SelectFilter* clone() const override
inline SelectFilter* clone() const override
{
return new SelectFilter(*this);
}
@ -147,7 +147,7 @@ class SelectFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -161,7 +161,7 @@ class SelectFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*

View File

@ -67,7 +67,7 @@ namespace execplan
* immediately, causing all subsequent references to fail. This only affects
* 'leakcheck'.
*/
//#define DESTROYSHMSEG
// #define DESTROYSHMSEG
class SessionManager
{
@ -94,7 +94,7 @@ class SessionManager
* and no operation other than reset() should be performed on a
* SessionManager instantiated with this.
*/
SessionManager(bool nolock);
explicit SessionManager(bool nolock);
/** @brief Destructor
*
@ -211,4 +211,3 @@ class SessionManager
};
} // namespace execplan

View File

@ -36,7 +36,7 @@
#include "shmkeys.h"
#include "brmtypes.h"
//#define SM_DEBUG
// #define SM_DEBUG
namespace execplan
{
@ -132,7 +132,7 @@ class SessionMonitor
{
txnCount = 0;
verID = 0;
activeTxns = NULL;
activeTxns = nullptr;
};
};
typedef struct SessionMonitorData_struct SessionMonitorData_t;

View File

@ -57,13 +57,15 @@ class SimpleColumn : public ReturnedColumn
/**
* Constructors
*/
class ForTestPurposeWithoutOID{};
class ForTestPurposeWithoutOID
{
};
SimpleColumn();
SimpleColumn(const std::string& token, ForTestPurposeWithoutOID);
SimpleColumn(const std::string& token, const uint32_t sessionID = 0);
explicit SimpleColumn(const std::string& token, const uint32_t sessionID = 0);
SimpleColumn(const std::string& schema, const std::string& table, const std::string& col,
const uint32_t sessionID = 0, const int lower_case_table_names = 0);
@ -75,7 +77,7 @@ class SimpleColumn : public ReturnedColumn
/**
* Destructor
*/
virtual ~SimpleColumn();
~SimpleColumn() override;
/**
* Accessor Methods
@ -124,8 +126,8 @@ class SimpleColumn : public ReturnedColumn
fOid = oid;
}
virtual const std::string data() const override;
virtual void data(const std::string data) override
const std::string data() const override;
void data(const std::string data) override
{
fData = data;
}
@ -179,7 +181,7 @@ class SimpleColumn : public ReturnedColumn
*
* deep copy of this pointer and return the copy
*/
inline virtual SimpleColumn* clone() const override
inline SimpleColumn* clone() const override
{
return new SimpleColumn(*this);
}
@ -191,17 +193,17 @@ class SimpleColumn : public ReturnedColumn
/**
* The serialize interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
virtual const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
const std::string toString() const override;
std::string toCppCode(IncludeSet& includes) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -217,7 +219,7 @@ class SimpleColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -227,7 +229,7 @@ class SimpleColumn : public ReturnedColumn
bool operator!=(const SimpleColumn& t) const;
/** @brief check if this column is the same as the argument */
virtual bool sameColumn(const ReturnedColumn* rc) const override;
bool sameColumn(const ReturnedColumn* rc) const override;
/** @brief return column type of this column (could be of any engine type) */
const CalpontSystemCatalog::ColType& colType() const
@ -238,7 +240,7 @@ class SimpleColumn : public ReturnedColumn
/** @brief set the column's OID from the syscat */
void setOID();
virtual bool hasWindowFunc() override
bool hasWindowFunc() override
{
return false;
}
@ -252,7 +254,7 @@ class SimpleColumn : public ReturnedColumn
* @return true, if all arguments belong to one table
* false, if multiple tables are involved in the function
*/
virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
protected:
/**
@ -282,13 +284,13 @@ class SimpleColumn : public ReturnedColumn
* F&E framework *
***********************************************************/
public:
virtual void evaluate(rowgroup::Row& row, bool& isNull) override;
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override
void evaluate(rowgroup::Row& row, bool& isNull) override;
bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getBoolVal();
}
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{
bool localIsNull = false;
evaluate(row, localIsNull);
@ -301,37 +303,37 @@ class SimpleColumn : public ReturnedColumn
return TreeNode::getStrVal(fTimeZone);
}
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getIntVal();
}
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getUintVal();
}
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override
float getFloatVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getFloatVal();
}
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override
double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDoubleVal();
}
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getLongDoubleVal();
}
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);

View File

@ -54,35 +54,33 @@ class SimpleColumn_Decimal : public SimpleColumn
public:
/** Constructors */
SimpleColumn_Decimal();
SimpleColumn_Decimal(const std::string& token, const uint32_t sessionID = 0);
explicit SimpleColumn_Decimal(const std::string& token, const uint32_t sessionID = 0);
SimpleColumn_Decimal(const std::string& schema, const std::string& table, const std::string& col,
const bool isColumnStore, const uint32_t sessionID = 0);
SimpleColumn_Decimal(const SimpleColumn& rhs, const uint32_t sessionID = 0);
explicit SimpleColumn_Decimal(const SimpleColumn& rhs, const uint32_t sessionID = 0);
/** Destructor */
virtual ~SimpleColumn_Decimal()
{
}
~SimpleColumn_Decimal() override = default;
inline virtual SimpleColumn_Decimal* clone() const override
inline SimpleColumn_Decimal* clone() const override
{
return new SimpleColumn_Decimal<len>(*this);
}
/** Evaluate methods */
virtual inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
virtual inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
virtual inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
virtual inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
/** The serialize interface */
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
uint64_t fNullVal;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
void setNullVal();

View File

@ -53,36 +53,34 @@ class SimpleColumn_INT : public SimpleColumn
public:
/** Constructors */
SimpleColumn_INT();
SimpleColumn_INT(const std::string& token, const uint32_t sessionID = 0);
explicit SimpleColumn_INT(const std::string& token, const uint32_t sessionID = 0);
SimpleColumn_INT(const std::string& schema, const std::string& table, const std::string& col,
const bool isColumnStore, const uint32_t sessionID = 0);
SimpleColumn_INT(const SimpleColumn& rhs, const uint32_t sessionID = 0);
explicit SimpleColumn_INT(const SimpleColumn& rhs, const uint32_t sessionID = 0);
/** Destructor */
virtual ~SimpleColumn_INT()
{
}
~SimpleColumn_INT() override = default;
inline virtual SimpleColumn_INT* clone() const override
inline SimpleColumn_INT* clone() const override
{
return new SimpleColumn_INT<len>(*this);
}
/** Evaluate methods */
virtual inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
virtual inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
virtual inline uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override;
virtual inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
virtual inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
inline uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override;
inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
/** The serialize interface */
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
uint64_t fNullVal;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
void setNullVal();
@ -93,8 +91,8 @@ std::string SimpleColumn_INT<len>::toCppCode(IncludeSet& includes) const
{
includes.insert("simplecolumn_int.h");
std::stringstream ss;
ss << "SimpleColumn_INT<" << len << ">(" << std::quoted(fSchemaName) << ", " << std::quoted(fTableName) << ", " <<
std::quoted(fColumnName) << ", " << fisColumnStore << ", " << sessionID() << ")";
ss << "SimpleColumn_INT<" << len << ">(" << std::quoted(fSchemaName) << ", " << std::quoted(fTableName)
<< ", " << std::quoted(fColumnName) << ", " << fisColumnStore << ", " << sessionID() << ")";
return ss.str();
}
@ -146,7 +144,7 @@ void SimpleColumn_INT<len>::setNullVal()
}
template <int len>
inline const utils::NullString & SimpleColumn_INT<len>::getStrVal(rowgroup::Row& row, bool& isNull)
inline const utils::NullString& SimpleColumn_INT<len>::getStrVal(rowgroup::Row& row, bool& isNull)
{
if (row.equals<len>(fNullVal, fInputIndex))
{

View File

@ -53,36 +53,34 @@ class SimpleColumn_UINT : public SimpleColumn
public:
/** Constructors */
SimpleColumn_UINT();
SimpleColumn_UINT(const std::string& token, const uint32_t sessionID = 0);
explicit SimpleColumn_UINT(const std::string& token, const uint32_t sessionID = 0);
SimpleColumn_UINT(const std::string& schema, const std::string& table, const std::string& col,
const bool isColumnStore, const uint32_t sessionID = 0);
SimpleColumn_UINT(const SimpleColumn& rhs, const uint32_t sessionID = 0);
explicit SimpleColumn_UINT(const SimpleColumn& rhs, const uint32_t sessionID = 0);
/** Destructor */
virtual ~SimpleColumn_UINT()
{
}
~SimpleColumn_UINT() override = default;
inline virtual SimpleColumn_UINT* clone() const override
inline SimpleColumn_UINT* clone() const override
{
return new SimpleColumn_UINT<len>(*this);
}
/** Evaluate methods */
virtual inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
virtual inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
virtual inline uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override;
virtual inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
virtual inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
inline uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override;
inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
/** The serialize interface */
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
uint64_t fNullVal;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
void setNullVal();

View File

@ -65,17 +65,19 @@ class SimpleFilter : public Filter
SEMI
};
struct ForTestPurposesWithoutColumnsOIDS{};
struct ForTestPurposesWithoutColumnsOIDS
{
};
SimpleFilter();
SimpleFilter(const std::string& sql);
explicit SimpleFilter(const std::string& sql);
SimpleFilter(const std::string& sql, ForTestPurposesWithoutColumnsOIDS);
SimpleFilter(const SOP& op, ReturnedColumn* lhs, ReturnedColumn* rhs, const long timeZone = 0);
SimpleFilter(const SimpleFilter& rhs);
virtual ~SimpleFilter();
~SimpleFilter() override;
inline virtual SimpleFilter* clone() const override
inline SimpleFilter* clone() const override
{
return new SimpleFilter(*this);
}
@ -106,7 +108,7 @@ class SimpleFilter : public Filter
}
using Filter::data;
virtual const std::string data() const override;
const std::string data() const override;
/** assign fLhs
*
@ -129,20 +131,20 @@ class SimpleFilter : public Filter
*/
void rhs(ReturnedColumn* rhs);
virtual const std::string toString() const override;
const std::string toString() const override;
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true if every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -160,7 +162,6 @@ class SimpleFilter : public Filter
bool operator<(const SimpleFilter& t) const;
bool semanticEq(const SimpleFilter& t) const;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
@ -168,7 +169,7 @@ class SimpleFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false if every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -221,7 +222,7 @@ class SimpleFilter : public Filter
static std::string escapeString(const std::string& input);
virtual string toCppCode(IncludeSet& includes) const override;
string toCppCode(IncludeSet& includes) const override;
private:
SOP fOp; /// operator
@ -237,10 +238,10 @@ class SimpleFilter : public Filter
* F&E framework *
***********************************************************/
public:
inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override;
inline virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
inline virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline bool getBoolVal(rowgroup::Row& row, bool& isNull) override;
inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
// get all simple columns involved in this column
const std::vector<SimpleColumn*>& simpleColumnList();

View File

@ -65,7 +65,7 @@ class SimpleScalarFilter : public Filter
/**
* Destructors
*/
virtual ~SimpleScalarFilter();
~SimpleScalarFilter() override;
/**
* Accessor Methods
@ -100,13 +100,13 @@ class SimpleScalarFilter : public Filter
fSub = sub;
}
virtual const std::string toString() const override;
const std::string toString() const override;
virtual inline const std::string data() const override
inline const std::string data() const override
{
return fData;
}
virtual inline void data(const std::string data) override
inline void data(const std::string data) override
{
fData = data;
}
@ -114,14 +114,14 @@ class SimpleScalarFilter : public Filter
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual SimpleScalarFilter* clone() const override
inline SimpleScalarFilter* clone() const override
{
return new SimpleScalarFilter(*this);
}
@ -131,7 +131,7 @@ class SimpleScalarFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -145,7 +145,7 @@ class SimpleScalarFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -154,7 +154,7 @@ class SimpleScalarFilter : public Filter
*/
bool operator!=(const SimpleScalarFilter& t) const;
virtual string toCppCode(IncludeSet& includes) const override;
string toCppCode(IncludeSet& includes) const override;
private:
// default okay?

View File

@ -269,7 +269,9 @@ class TreeNode
***********************************************************************/
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull)
{
isNull = isNull || fResult.strVal.isNull(); // XXX: NullString returns isNull, we should remove that parameter altogether.
isNull = isNull ||
fResult.strVal
.isNull(); // XXX: NullString returns isNull, we should remove that parameter altogether.
return fResult.strVal;
}
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull)
@ -475,19 +477,20 @@ inline const utils::NullString& TreeNode::getStrVal(const long timeZone)
case CalpontSystemCatalog::VARCHAR:
if (fResultType.colWidth <= 7)
{
const char *intAsChar = (const char*) (&fResult.origIntVal);
const char* intAsChar = (const char*)(&fResult.origIntVal);
fResult.strVal.assign((const uint8_t*)intAsChar, strlen(intAsChar));
}
break;
case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::VARBINARY: // XXX: TODO: we don't have varbinary support now, but it may be handled just like varchar.
case CalpontSystemCatalog::VARBINARY: // XXX: TODO: we don't have varbinary support now, but it may be
// handled just like varchar.
case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT:
if (fResultType.colWidth <= 8)
{
const char *intAsChar = (const char*) (&fResult.origIntVal);
const char* intAsChar = (const char*)(&fResult.origIntVal);
fResult.strVal.assign((const uint8_t*)intAsChar, strlen(intAsChar));
}
@ -865,27 +868,27 @@ inline double TreeNode::getDoubleVal()
{
case CalpontSystemCatalog::CHAR:
if (fResultType.colWidth <= 8)
return strtod((char*)(&fResult.origIntVal), NULL);
return strtod((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str());
return strtod(fResult.strVal.str(), NULL);
return strtod(fResult.strVal.str(), nullptr);
case CalpontSystemCatalog::VARCHAR:
if (fResultType.colWidth <= 7)
return strtod((char*)(&fResult.origIntVal), NULL);
return strtod((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str());
return strtod(fResult.strVal.str(), NULL);
return strtod(fResult.strVal.str(), nullptr);
// FIXME: ???
case CalpontSystemCatalog::VARBINARY:
case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT:
if (fResultType.colWidth <= 7)
return strtod((char*)(&fResult.origIntVal), NULL);
return strtod((char*)(&fResult.origIntVal), nullptr);
//idbassert(fResult.strVal.str());
return strtod(fResult.strVal.safeString("").c_str(), NULL);
// idbassert(fResult.strVal.str());
return strtod(fResult.strVal.safeString("").c_str(), nullptr);
case CalpontSystemCatalog::BIGINT:
case CalpontSystemCatalog::TINYINT:
@ -936,27 +939,27 @@ inline long double TreeNode::getLongDoubleVal()
{
case CalpontSystemCatalog::CHAR:
if (fResultType.colWidth <= 8)
return strtold((char*)(&fResult.origIntVal), NULL);
return strtold((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str());
return strtold(fResult.strVal.str(), NULL);
return strtold(fResult.strVal.str(), nullptr);
case CalpontSystemCatalog::VARCHAR:
if (fResultType.colWidth <= 7)
return strtold((char*)(&fResult.origIntVal), NULL);
return strtold((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str());
return strtold(fResult.strVal.str(), NULL);
return strtold(fResult.strVal.str(), nullptr);
// FIXME: ???
case CalpontSystemCatalog::VARBINARY:
case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT:
if (fResultType.colWidth <= 7)
return strtold((char*)(&fResult.origIntVal), NULL);
return strtold((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str());
return strtold(fResult.strVal.str(), NULL);
return strtold(fResult.strVal.str(), nullptr);
case CalpontSystemCatalog::BIGINT:
case CalpontSystemCatalog::TINYINT:

View File

@ -50,14 +50,14 @@ class TreeNodeImpl : public TreeNode
* Constructors
*/
TreeNodeImpl();
TreeNodeImpl(const std::string& sql);
explicit TreeNodeImpl(const std::string& sql);
// not needed yet
// TreeNodeImpl(const TreeNodeImpl& rhs);
/**
* Destructors
*/
virtual ~TreeNodeImpl();
~TreeNodeImpl() override;
/**
* Accessor Methods
*/
@ -65,13 +65,13 @@ class TreeNodeImpl : public TreeNode
/**
* Operations
*/
virtual const std::string toString() const override;
const std::string toString() const override;
virtual const std::string data() const override
const std::string data() const override
{
return fData;
}
virtual void data(const std::string data) override
void data(const std::string data) override
{
fData = data;
}
@ -80,7 +80,7 @@ class TreeNodeImpl : public TreeNode
*
* deep copy of this pointer and return the copy
*/
inline virtual TreeNodeImpl* clone() const override
inline TreeNodeImpl* clone() const override
{
return new TreeNodeImpl(*this);
}
@ -88,15 +88,15 @@ class TreeNodeImpl : public TreeNode
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -110,7 +110,7 @@ class TreeNodeImpl : public TreeNode
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -119,7 +119,8 @@ class TreeNodeImpl : public TreeNode
*/
bool operator!=(const TreeNodeImpl& t) const;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
// default okay
// TreeNodeImpl& operator=(const TreeNodeImpl& rhs);

View File

@ -48,25 +48,25 @@ class UDAFColumn : public AggregateColumn
*/
UDAFColumn();
UDAFColumn(const uint32_t sessionID);
explicit UDAFColumn(const uint32_t sessionID);
UDAFColumn(const UDAFColumn& rhs, const uint32_t sessionID = 0);
/**
* Destructors
*/
virtual ~UDAFColumn();
~UDAFColumn() override;
/**
* Overloaded stream operator
*/
virtual const std::string toString() const override;
const std::string toString() const override;
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
virtual UDAFColumn* clone() const override
UDAFColumn* clone() const override
{
return new UDAFColumn(*this);
}
@ -82,8 +82,8 @@ class UDAFColumn : public AggregateColumn
/**
* Serialize interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -91,7 +91,7 @@ class UDAFColumn : public AggregateColumn
* @return true iff every member of t is a duplicate copy of every member of this;
* false otherwise
*/
virtual bool operator==(const TreeNode* t) const override;
bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -108,7 +108,7 @@ class UDAFColumn : public AggregateColumn
* @return false iff every member of t is a duplicate copy of every member of this;
* true otherwise
*/
virtual bool operator!=(const TreeNode* t) const override;
bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
@ -119,7 +119,7 @@ class UDAFColumn : public AggregateColumn
using AggregateColumn::operator!=;
virtual bool operator!=(const UDAFColumn& t) const;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
private:
mcsv1sdk::mcsv1Context context;

View File

@ -43,15 +43,11 @@ enum WF_FRAME
struct WF_Boundary
{
WF_Boundary()
{
}
WF_Boundary(WF_FRAME frame) : fFrame(frame)
{
}
~WF_Boundary()
WF_Boundary() = default;
explicit WF_Boundary(WF_FRAME frame) : fFrame(frame)
{
}
~WF_Boundary() = default;
const std::string toString() const;
void serialize(messageqcpp::ByteStream&) const;
void unserialize(messageqcpp::ByteStream&);
@ -67,9 +63,7 @@ struct WF_Frame
fStart.fFrame = WF_UNBOUNDED_PRECEDING;
fEnd.fFrame = WF_UNBOUNDED_FOLLOWING;
}
~WF_Frame()
{
}
~WF_Frame() = default;
const std::string toString() const;
void serialize(messageqcpp::ByteStream&) const;
void unserialize(messageqcpp::ByteStream&);
@ -83,13 +77,11 @@ struct WF_Frame
*/
struct WF_OrderBy
{
WF_OrderBy()
WF_OrderBy() = default;
explicit WF_OrderBy(std::vector<SRCP> orders) : fOrders(orders)
{
}
WF_OrderBy(std::vector<SRCP> orders) : fOrders(orders)
{
}
~WF_OrderBy(){};
~WF_OrderBy() = default;
const std::string toString() const;
void serialize(messageqcpp::ByteStream&) const;
void unserialize(messageqcpp::ByteStream&);

View File

@ -54,14 +54,12 @@ class WindowFunctionColumn : public ReturnedColumn
{
public:
WindowFunctionColumn();
WindowFunctionColumn(const std::string& functionName, const uint32_t sessionID = 0);
explicit WindowFunctionColumn(const std::string& functionName, const uint32_t sessionID = 0);
WindowFunctionColumn(const std::string& functionName, const std::vector<SRCP>& functionParms,
const std::vector<SRCP>& partitions, WF_OrderBy& orderby,
const uint32_t sessionID = 0);
WindowFunctionColumn(const WindowFunctionColumn& rhs, const uint32_t sessionID = 0);
virtual ~WindowFunctionColumn()
{
}
~WindowFunctionColumn() override = default;
/** get function name */
inline const std::string& functionName() const
@ -112,7 +110,7 @@ class WindowFunctionColumn : public ReturnedColumn
}
/** make a clone of this window function */
inline virtual WindowFunctionColumn* clone() const override
inline WindowFunctionColumn* clone() const override
{
return new WindowFunctionColumn(*this);
}
@ -122,22 +120,22 @@ class WindowFunctionColumn : public ReturnedColumn
/** output the function for debug purpose */
const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override;
std::string toCppCode(IncludeSet& includes) const override;
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override;
void serialize(messageqcpp::ByteStream&) const override;
void unserialize(messageqcpp::ByteStream&) override;
// util function for connector to use.
void addToPartition(std::vector<SRCP>& groupByList);
using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override
bool hasAggregate() override
{
return false;
}
virtual bool hasWindowFunc() override;
bool hasWindowFunc() override;
void adjustResultType();
// UDAnF support
@ -170,12 +168,12 @@ class WindowFunctionColumn : public ReturnedColumn
WF_OrderBy fOrderBy; /// order by clause
// not support for window functions for now.
virtual bool operator==(const TreeNode* t) const override
bool operator==(const TreeNode* t) const override
{
return false;
}
bool operator==(const WindowFunctionColumn& t) const;
virtual bool operator!=(const TreeNode* t) const override
bool operator!=(const TreeNode* t) const override
{
return false;
}
@ -190,7 +188,7 @@ class WindowFunctionColumn : public ReturnedColumn
***********************************************************/
public:
using TreeNode::getStrVal;
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{
bool localIsNull = false;
evaluate(row, localIsNull);
@ -198,57 +196,57 @@ class WindowFunctionColumn : public ReturnedColumn
return localIsNull ? fResult.strVal.dropString() : TreeNode::getStrVal(fTimeZone);
}
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getIntVal();
}
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getUintVal();
}
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override
float getFloatVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getFloatVal();
}
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override
double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDoubleVal();
}
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getLongDoubleVal();
}
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDecimalVal();
}
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDateIntVal();
}
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getDatetimeIntVal();
}
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getTimestampIntVal();
}
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{
evaluate(row, isNull);
return TreeNode::getTimeIntVal();

View File

@ -29,7 +29,7 @@
#include <boost/thread/condition.hpp>
#include "largedatalist.h"
//#include "bucketdl.h"
// #include "bucketdl.h"
#include <time.h>
@ -68,9 +68,9 @@ class BandedDL : public LargeDataList<std::vector<element_t>, element_t>
protected:
private:
explicit BandedDL(){};
explicit BandedDL(const BandedDL&){};
BandedDL& operator=(const BandedDL&){};
explicit BandedDL() = default;
BandedDL(const BandedDL&){};
BandedDL& operator=(const BandedDL&) {};
// vars to support the WSDL-like next() fcn
boost::condition nextSetLoaded;

View File

@ -161,7 +161,7 @@ class BucketDL : public DataList<element_t>
private:
// Declare default constructors but don't define to disable their use
explicit BucketDL();
explicit BucketDL(const BucketDL<element_t>&);
BucketDL(const BucketDL<element_t>&);
BucketDL<element_t>& operator=(const BucketDL<element_t>&);
ResourceManager* fRm;

View File

@ -40,18 +40,17 @@ namespace joblist
class ColumnCommandJL : public CommandJL
{
public:
ColumnCommandJL(const pColScanStep&, std::vector<BRM::LBID_t> lastLBID,
bool hasAuxCol_, const std::vector<BRM::EMEntry>& extentsAux_,
execplan::CalpontSystemCatalog::OID oidAux);
ColumnCommandJL(const pColStep&);
ColumnCommandJL(const pColScanStep&, std::vector<BRM::LBID_t> lastLBID, bool hasAuxCol_,
const std::vector<BRM::EMEntry>& extentsAux_, execplan::CalpontSystemCatalog::OID oidAux);
explicit ColumnCommandJL(const pColStep&);
ColumnCommandJL(const ColumnCommandJL&, const DictStepJL&);
virtual ~ColumnCommandJL();
~ColumnCommandJL() override;
virtual void createCommand(messageqcpp::ByteStream& bs) const override;
virtual void runCommand(messageqcpp::ByteStream& bs) const override;
void createCommand(messageqcpp::ByteStream& bs) const override;
void runCommand(messageqcpp::ByteStream& bs) const override;
void setLBID(uint64_t rid, uint32_t dbroot) override;
uint8_t getTableColumnType() override;
virtual std::string toString() override;
std::string toString() override;
uint16_t getWidth() override;
CommandType getCommandType() override
{

View File

@ -60,76 +60,76 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
/** @brief CrossEngineStep destructor
*/
~CrossEngineStep();
~CrossEngineStep() override;
/** @brief virtual void Run method
*/
void run();
void run() override;
/** @brief virtual void join method
*/
void join();
void join() override;
/** @brief virtual string toString method
*/
const std::string toString() const;
const std::string toString() const override;
// from BatchPrimitive
bool getFeederFlag() const
bool getFeederFlag() const override
{
return false;
}
uint64_t getLastTupleId() const
uint64_t getLastTupleId() const override
{
return 0;
}
uint32_t getStepCount() const
uint32_t getStepCount() const override
{
return 1;
}
void setBPP(JobStep* jobStep);
void setFirstStepType(PrimitiveStepType firstStepType)
void setBPP(JobStep* jobStep) override;
void setFirstStepType(PrimitiveStepType firstStepType) override
{
}
void setIsProjectionOnly()
void setIsProjectionOnly() override
{
}
void setLastTupleId(uint64_t id)
void setLastTupleId(uint64_t id) override
{
}
void setOutputType(BPSOutputType outputType)
void setOutputType(BPSOutputType outputType) override
{
}
void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2);
void setStepCount()
void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2) override;
void setStepCount() override
{
}
void setSwallowRows(const bool swallowRows)
void setSwallowRows(const bool swallowRows) override
{
}
void setBppStep()
void setBppStep() override
{
}
void dec(DistributedEngineComm* dec)
void dec(DistributedEngineComm* dec) override
{
}
const OIDVector& getProjectOids() const
const OIDVector& getProjectOids() const override
{
return fOIDVector;
}
uint64_t blksSkipped() const
uint64_t blksSkipped() const override
{
return 0;
}
bool wasStepRun() const
bool wasStepRun() const override
{
return fRunExecuted;
}
BPSOutputType getOutputType() const
BPSOutputType getOutputType() const override
{
return ROW_GROUP;
}
uint64_t getRows() const
uint64_t getRows() const override
{
return fRowsReturned;
}
@ -145,27 +145,27 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
{
return fAlias;
}
void setJobInfo(const JobInfo* jobInfo)
void setJobInfo(const JobInfo* jobInfo) override
{
}
void setOutputRowGroup(const rowgroup::RowGroup&);
const rowgroup::RowGroup& getOutputRowGroup() const;
void setOutputRowGroup(const rowgroup::RowGroup&) override;
const rowgroup::RowGroup& getOutputRowGroup() const override;
// from DECEventListener
void newPMOnline(uint32_t)
void newPMOnline(uint32_t) override
{
}
const rowgroup::RowGroup& getDeliveredRowGroup() const;
void deliverStringTableRowGroup(bool b);
bool deliverStringTableRowGroup() const;
uint32_t nextBand(messageqcpp::ByteStream& bs);
const rowgroup::RowGroup& getDeliveredRowGroup() const override;
void deliverStringTableRowGroup(bool b) override;
bool deliverStringTableRowGroup() const override;
uint32_t nextBand(messageqcpp::ByteStream& bs) override;
void addFcnJoinExp(const std::vector<execplan::SRCP>&);
void addFcnExpGroup1(const boost::shared_ptr<execplan::ParseTree>&);
void setFE1Input(const rowgroup::RowGroup&);
void setFcnExpGroup3(const std::vector<execplan::SRCP>&);
void setFE23Output(const rowgroup::RowGroup&);
void addFcnJoinExp(const std::vector<execplan::SRCP>&) override;
void addFcnExpGroup1(const boost::shared_ptr<execplan::ParseTree>&) override;
void setFE1Input(const rowgroup::RowGroup&) override;
void setFcnExpGroup3(const std::vector<execplan::SRCP>&) override;
void setFE23Output(const rowgroup::RowGroup&) override;
void addFilter(JobStep* jobStep);
void addProject(JobStep* jobStep);
@ -201,7 +201,7 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
class Runner
{
public:
Runner(CrossEngineStep* step) : fStep(step)
explicit Runner(CrossEngineStep* step) : fStep(step)
{
}
void operator()()
@ -248,4 +248,3 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
};
} // namespace joblist

View File

@ -161,9 +161,10 @@ DataList<element_t>::DataList()
, consumersFinished(0)
, fElemDiskFirstSize(sizeof(uint64_t))
, fElemDiskSecondSize(sizeof(uint64_t))
, fOID(0){
// pthread_mutex_init(&mutex, NULL);
};
, fOID(0)
{
// pthread_mutex_init(&mutex, NULL);
}
template <typename element_t>
DataList<element_t>::DataList(const DataList<element_t>& dl)
@ -174,12 +175,13 @@ DataList<element_t>::DataList(const DataList<element_t>& dl)
consumersFinished = dl.consumersFinished;
fElemDiskFirstSize = dl.fElemDiskFirstSize;
fElemDiskSecondSize = dl.fElemDiskSecondSize;
};
}
template <typename element_t>
DataList<element_t>::~DataList(){
// pthread_mutex_destroy(&mutex);
};
DataList<element_t>::~DataList()
{
// pthread_mutex_destroy(&mutex);
}
template <typename element_t>
DataList<element_t>& DataList<element_t>::operator=(const DataList<element_t>& dl)
@ -189,25 +191,25 @@ DataList<element_t>& DataList<element_t>::operator=(const DataList<element_t>& d
consumersFinished = dl.consumersFinished;
fElemDiskFirstSize = dl.fElemDiskFirstSize;
fElemDiskSecondSize = dl.fElemDiskSecondSize;
};
}
template <typename element_t>
void DataList<element_t>::endOfInput()
{
noMoreInput = true;
};
}
template <typename element_t>
void DataList<element_t>::lock()
{
mutex.lock(); // pthread_mutex_lock(&mutex);
};
}
template <typename element_t>
void DataList<element_t>::unlock()
{
mutex.unlock(); // pthread_mutex_unlock(&mutex);
};
}
template <typename element_t>
void DataList<element_t>::setDiskElemSize(uint32_t size1st, uint32_t size2nd)

View File

@ -44,17 +44,17 @@ template <typename container_t, typename element_t>
class DataListImpl : public DataList<element_t>
{
public:
DataListImpl(uint32_t numConsumers);
explicit DataListImpl(uint32_t numConsumers);
DataListImpl(const DataListImpl& dl);
virtual ~DataListImpl();
~DataListImpl() override;
DataListImpl& operator=(const DataListImpl& dl);
// derived classes need to lock around these fcns
virtual void insert(const element_t& e);
virtual void insert(const std::vector<element_t>& v);
virtual uint64_t getIterator();
virtual bool next(uint64_t it, element_t* e);
void insert(const element_t& e) override;
void insert(const std::vector<element_t>& v) override;
uint64_t getIterator() override;
bool next(uint64_t it, element_t* e) override;
virtual void setNumConsumers(uint32_t);
virtual uint32_t getNumConsumers() const;
@ -141,20 +141,24 @@ DataListImpl<container_t, element_t>::DataListImpl(const DataListImpl<container_
for (i = 0; i < numConsumers; i++)
cIterators[i] = dl.cIterators[i];
};
}
template <typename container_t, typename element_t>
DataListImpl<container_t, element_t>::~DataListImpl()
{
delete c;
delete[] cIterators;
};
}
// lock at a higher level
template <typename container_t, typename element_t>
DataListImpl<container_t, element_t>& DataListImpl<container_t, element_t>::operator=(
const DataListImpl<container_t, element_t>& dl)
{
if (&dl == this)
{
return *this;
}
uint64_t i;
static_cast<DataList<element_t> >(*this) = static_cast<DataList<element_t> >(dl);
@ -170,7 +174,7 @@ DataListImpl<container_t, element_t>& DataListImpl<container_t, element_t>::oper
cIterators[i] = dl.cIterators[i];
return *this;
};
}
template <typename container_t, typename element_t>
uint64_t DataListImpl<container_t, element_t>::getIterator()
@ -178,8 +182,8 @@ uint64_t DataListImpl<container_t, element_t>::getIterator()
if (itIndex >= numConsumers)
{
std::ostringstream oss;
oss << "DataListImpl::getIterator(): caller attempted to grab too many iterators: "
<< "have " << numConsumers << " asked for " << (itIndex + 1);
oss << "DataListImpl::getIterator(): caller attempted to grab too many iterators: " << "have "
<< numConsumers << " asked for " << (itIndex + 1);
throw std::logic_error(oss.str().c_str());
}
@ -198,7 +202,7 @@ inline void DataListImpl<container_t, element_t>::insert(const std::vector<eleme
{
if (typeid(container_t) == typeid(std::vector<element_t>))
{
std::vector<element_t>* vc = (std::vector<element_t>*)c;
auto* vc = (std::vector<element_t>*)c;
vc->insert(vc->end(), v.begin(), v.end());
}
else
@ -245,7 +249,7 @@ void DataListImpl<container_t, element_t>::eraseUpTo(uint64_t id)
#endif
c->erase(c->begin(), cIterators[id]);
};
}
template <typename container_t, typename element_t>
void DataListImpl<container_t, element_t>::reset()

View File

@ -40,26 +40,27 @@ class DictStepJL : public CommandJL
{
public:
DictStepJL();
DictStepJL(const pDictionaryStep&);
virtual ~DictStepJL();
explicit DictStepJL(const pDictionaryStep&);
~DictStepJL() override;
void setLBID(uint64_t data, uint32_t dbroot); // converts a rid or dictionary token to an LBID. For
// ColumnCommandJL it's a RID, for a DictStep it's a token.
uint8_t getTableColumnType();
std::string toString();
void setLBID(uint64_t data,
uint32_t dbroot) override; // converts a rid or dictionary token to an LBID. For
// ColumnCommandJL it's a RID, for a DictStep it's a token.
uint8_t getTableColumnType() override;
std::string toString() override;
/* XXXPAT: The width is only valid for projection steps and the output
type is TUPLE at the moment. */
void setWidth(uint16_t);
uint16_t getWidth();
uint16_t getWidth() override;
CommandType getCommandType()
CommandType getCommandType() override
{
return DICT_STEP;
}
void createCommand(messageqcpp::ByteStream&) const;
void runCommand(messageqcpp::ByteStream&) const;
void createCommand(messageqcpp::ByteStream&) const override;
void runCommand(messageqcpp::ByteStream&) const override;
messageqcpp::ByteStream getFilterString() const
{

View File

@ -33,11 +33,11 @@ class DiskJoinStep : public JobStep
public:
DiskJoinStep();
DiskJoinStep(TupleHashJoinStep*, int djsIndex, int joinerIndex, bool lastOne);
virtual ~DiskJoinStep();
~DiskJoinStep() override;
void run();
void join();
const std::string toString() const;
void run() override;
void join() override;
const std::string toString() const override;
void loadExistingData(std::vector<rowgroup::RGData>& data);
uint32_t getIterationCount()
@ -73,7 +73,7 @@ class DiskJoinStep : public JobStep
void mainRunner();
struct Runner
{
Runner(DiskJoinStep* d) : djs(d)
explicit Runner(DiskJoinStep* d) : djs(d)
{
}
void operator()()

View File

@ -77,7 +77,7 @@ constexpr uint32_t defaultLocalConnectionId()
class DECEventListener
{
public:
virtual ~DECEventListener(){};
virtual ~DECEventListener() = default;
/* Do whatever needs to be done to init the new PM */
virtual void newPMOnline(uint32_t newConnectionNumber) = 0;
@ -140,7 +140,7 @@ class DistributedEngineComm
/** reads queuesize/divisor msgs */
EXPORT void read_some(uint32_t key, uint32_t divisor, std::vector<messageqcpp::SBS>& v,
bool* flowControlOn = NULL);
bool* flowControlOn = nullptr);
/** @brief Write a primitive message
*

View File

@ -147,9 +147,7 @@ struct RowWrapper
et[i] = rg.et[i];
}
~RowWrapper()
{
}
~RowWrapper() = default;
inline RowWrapper& operator=(const RowWrapper& rg)
{
@ -170,7 +168,7 @@ struct RIDElementType
uint64_t first;
RIDElementType();
RIDElementType(uint64_t f);
explicit RIDElementType(uint64_t f);
const char* getHashString(uint64_t mode, uint64_t* len) const
{
@ -194,9 +192,7 @@ struct TupleType
{
uint64_t first;
char* second;
TupleType()
{
}
TupleType() = default;
TupleType(uint64_t f, char* s) : first(f), second(s)
{
}
@ -244,14 +240,14 @@ extern std::ostream& operator<<(std::ostream& out, const TupleType& rhs);
#ifndef NO_DATALISTS
//#include "bandeddl.h"
//#include "wsdl.h"
// #include "bandeddl.h"
// #include "wsdl.h"
#include "fifo.h"
//#include "bucketdl.h"
//#include "constantdatalist.h"
//#include "swsdl.h"
//#include "zdl.h"
//#include "deliverywsdl.h"
// #include "bucketdl.h"
// #include "constantdatalist.h"
// #include "swsdl.h"
// #include "zdl.h"
// #include "deliverywsdl.h"
namespace joblist
{
@ -350,7 +346,6 @@ class AnyDataList
~AnyDataList() = default;
inline void rowGroupDL(boost::shared_ptr<RowGroupDL> dl)
{
fDatalist = dl;
@ -368,8 +363,6 @@ class AnyDataList
return fDatalist.get();
}
enum DataListTypes
{
UNKNOWN_DATALIST, /*!< 0 Unknown DataList */
@ -408,8 +401,8 @@ class AnyDataList
// bool operator==(const AnyDataList& rhs);
private:
AnyDataList(const AnyDataList& rhs);
AnyDataList& operator=(const AnyDataList& rhs);
AnyDataList(const AnyDataList& rhs) = delete;
AnyDataList& operator=(const AnyDataList& rhs) = delete;
boost::shared_ptr<RowGroupDL> fDatalist;
bool fDisown;
};
@ -435,4 +428,3 @@ extern std::ostream& omitOidInDL(std::ostream& strm);
} // namespace joblist
#endif

View File

@ -38,7 +38,7 @@ struct ErrorInfo
uint32_t errCode;
std::string errMsg;
// for backward compat
ErrorInfo(uint16_t v) : errCode(v)
explicit ErrorInfo(uint16_t v) : errCode(v)
{
}
ErrorInfo& operator=(uint16_t v)
@ -51,4 +51,3 @@ struct ErrorInfo
typedef boost::shared_ptr<ErrorInfo> SErrorInfo;
} // namespace joblist

View File

@ -23,7 +23,7 @@
#pragma once
//#define NDEBUG
// #define NDEBUG
#include "jobstep.h"
#include "filter.h"
@ -48,35 +48,35 @@ class ExpressionStep : public JobStep
public:
// constructors
ExpressionStep();
ExpressionStep(const JobInfo&);
explicit ExpressionStep(const JobInfo&);
// destructor constructors
virtual ~ExpressionStep();
~ExpressionStep() override;
// inherited methods
void run();
void join();
const std::string toString() const;
void run() override;
void join() override;
const std::string toString() const override;
execplan::CalpontSystemCatalog::OID oid() const
execplan::CalpontSystemCatalog::OID oid() const override
{
return 0;
}
execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOids.empty() ? 0 : fTableOids.front();
}
using JobStep::alias;
std::string alias() const
std::string alias() const override
{
return fAliases.empty() ? "" : fAliases.front();
}
using JobStep::view;
std::string view() const
std::string view() const override
{
return fViews.empty() ? "" : fViews.front();
}
using JobStep::schema;
std::string schema() const
std::string schema() const override
{
return fSchemas.empty() ? "" : fSchemas.front();
}

View File

@ -45,7 +45,7 @@ template <typename element_t>
class FIFO : public DataListImpl<std::vector<element_t>, element_t>
{
private:
typedef DataListImpl<std::vector<element_t>, element_t> base;
using base = DataListImpl<std::vector<element_t>, element_t>;
public:
enum ElementMode
@ -55,15 +55,15 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
};
FIFO(uint32_t numConsumers, uint32_t maxElements);
virtual ~FIFO();
~FIFO() override;
/* DataList<element_t> interface */
inline void insert(const element_t& e);
inline void insert(const std::vector<element_t>& v);
inline bool next(uint64_t it, element_t* e);
uint64_t getIterator();
void endOfInput();
void setMultipleProducers(bool b);
inline void insert(const element_t& e) override;
inline void insert(const std::vector<element_t>& v) override;
inline bool next(uint64_t it, element_t* e) override;
uint64_t getIterator() override;
void endOfInput() override;
void setMultipleProducers(bool b) override;
/* Use this insert() to detect when insertion fills up buffer. */
/* When this happens, call waitTillReadyForInserts() before resuming*/
@ -72,16 +72,16 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
inline void waitTillReadyForInserts();
inline bool isOutputBlocked() const;
void OID(execplan::CalpontSystemCatalog::OID oid)
void OID(execplan::CalpontSystemCatalog::OID oid) override
{
base::OID(oid);
}
execplan::CalpontSystemCatalog::OID OID() const
execplan::CalpontSystemCatalog::OID OID() const override
{
return base::OID();
}
inline void dropToken(){};
inline void dropToken() {};
inline void dropToken(uint32_t){};
// Counters that reflect how many many times this FIFO blocked on reads/writes
@ -89,7 +89,7 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
uint64_t blockedReadCount() const;
// @bug 653 set number of consumers when it is empty.
void setNumConsumers(uint32_t nc);
void setNumConsumers(uint32_t nc) override;
void inOrder(bool order)
{
@ -109,7 +109,7 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
{
fTotSize = totSize;
}
uint64_t totalSize()
uint64_t totalSize() override
{
return fTotSize;
}
@ -495,14 +495,11 @@ void FIFO<element_t>::maxElements(uint64_t max)
{
fMaxElements = max;
if (pBuffer)
delete[] pBuffer;
delete[] pBuffer;
delete[] cBuffer;
if (cBuffer)
delete[] cBuffer;
pBuffer = 0;
cBuffer = 0;
pBuffer = nullptr;
cBuffer = nullptr;
for (uint64_t i = 0; i < base::numConsumers; ++i)
cpos[i] = fMaxElements;
@ -528,4 +525,3 @@ void FIFO<element_t>::totalFileCounts(uint64_t& numFiles, uint64_t& numBytes) co
}
} // namespace joblist

View File

@ -34,16 +34,16 @@ namespace joblist
class FilterCommandJL : public CommandJL
{
public:
FilterCommandJL(const FilterStep&);
virtual ~FilterCommandJL();
explicit FilterCommandJL(const FilterStep&);
~FilterCommandJL() override;
void setLBID(uint64_t rid, uint32_t dbroot);
uint8_t getTableColumnType();
CommandType getCommandType();
std::string toString();
void createCommand(messageqcpp::ByteStream& bs) const;
void runCommand(messageqcpp::ByteStream& bs) const;
uint16_t getWidth();
void setLBID(uint64_t rid, uint32_t dbroot) override;
uint8_t getTableColumnType() override;
CommandType getCommandType() override;
std::string toString() override;
void createCommand(messageqcpp::ByteStream& bs) const override;
void runCommand(messageqcpp::ByteStream& bs) const override;
uint16_t getWidth() override;
uint8_t getBOP() const
{
return fBOP;

View File

@ -26,7 +26,6 @@
#include <vector>
#include <boost/scoped_ptr.hpp>
#include "returnedcolumn.h" // SRCP
#include "rowgroup.h" // RowGroup
#include "rowaggregation.h" // SP_GroupConcat
@ -48,7 +47,7 @@ class GroupConcatInfo
virtual ~GroupConcatInfo();
void prepGroupConcat(JobInfo&);
void mapColumns(const rowgroup::RowGroup&);
virtual void mapColumns(const rowgroup::RowGroup&);
std::set<uint32_t>& columns()
{
@ -59,11 +58,11 @@ class GroupConcatInfo
return fGroupConcat;
}
const std::string toString() const;
virtual const std::string toString() const;
protected:
uint32_t getColumnKey(const execplan::SRCP& srcp, JobInfo& jobInfo);
std::shared_ptr<int[]> makeMapping(const rowgroup::RowGroup&, const rowgroup::RowGroup&);
virtual uint32_t getColumnKey(const execplan::SRCP& srcp, JobInfo& jobInfo);
virtual std::shared_ptr<int[]> makeMapping(const rowgroup::RowGroup&, const rowgroup::RowGroup&);
std::set<uint32_t> fColumns;
std::vector<rowgroup::SP_GroupConcat> fGroupConcat;
@ -72,22 +71,22 @@ class GroupConcatInfo
class GroupConcatAgUM : public rowgroup::GroupConcatAg
{
public:
EXPORT GroupConcatAgUM(rowgroup::SP_GroupConcat&);
EXPORT ~GroupConcatAgUM();
EXPORT explicit GroupConcatAgUM(rowgroup::SP_GroupConcat&);
EXPORT ~GroupConcatAgUM() override;
using rowgroup::GroupConcatAg::merge;
void initialize();
void processRow(const rowgroup::Row&);
EXPORT void merge(const rowgroup::Row&, int64_t);
void initialize() override;
void processRow(const rowgroup::Row&) override;
EXPORT virtual void merge(const rowgroup::Row&, int64_t);
boost::scoped_ptr<GroupConcator>& concator()
{
return fConcator;
}
EXPORT uint8_t* getResult();
EXPORT uint8_t* getResult() override;
protected:
void applyMapping(const std::shared_ptr<int[]>&, const rowgroup::Row&);
virtual void applyMapping(const std::shared_ptr<int[]>&, const rowgroup::Row&);
boost::scoped_ptr<GroupConcator> fConcator;
boost::scoped_array<uint8_t> fData;
@ -133,17 +132,17 @@ class GroupConcatNoOrder : public GroupConcator
{
public:
GroupConcatNoOrder();
virtual ~GroupConcatNoOrder();
~GroupConcatNoOrder() override;
void initialize(const rowgroup::SP_GroupConcat&);
void processRow(const rowgroup::Row&);
void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&) override;
void merge(GroupConcator*);
void merge(GroupConcator*) override;
using GroupConcator::getResult;
uint8_t* getResultImpl(const std::string& sep);
//uint8_t* getResult(const std::string& sep);
uint8_t* getResultImpl(const std::string& sep) override;
// uint8_t* getResult(const std::string& sep);
const std::string toString() const;
const std::string toString() const override;
protected:
rowgroup::RowGroup fRowGroup;
@ -163,19 +162,19 @@ class GroupConcatOrderBy : public GroupConcator, public ordering::IdbOrderBy
{
public:
GroupConcatOrderBy();
virtual ~GroupConcatOrderBy();
~GroupConcatOrderBy() override;
using ordering::IdbOrderBy::initialize;
void initialize(const rowgroup::SP_GroupConcat&);
void processRow(const rowgroup::Row&);
uint64_t getKeyLength() const;
void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&) override;
uint64_t getKeyLength() const override;
void merge(GroupConcator*);
void merge(GroupConcator*) override;
using GroupConcator::getResult;
uint8_t* getResultImpl(const std::string& sep);
//uint8_t* getResult(const std::string& sep);
uint8_t* getResultImpl(const std::string& sep) override;
// uint8_t* getResult(const std::string& sep);
const std::string toString() const;
const std::string toString() const override;
protected:
};

View File

@ -73,15 +73,14 @@ const int32_t CNX_EXP_TABLE_ID = 999;
struct TupleInfo
{
TupleInfo(uint32_t w = 0, uint32_t o = 0, uint32_t k = -1, uint32_t t = -1, uint32_t s = 0, uint32_t p = 0,
execplan::CalpontSystemCatalog::ColDataType dt = execplan::CalpontSystemCatalog::BIT,
uint32_t csn = 8)
explicit TupleInfo(uint32_t w = 0, uint32_t o = 0, uint32_t k = -1, uint32_t t = -1, uint32_t s = 0,
uint32_t p = 0,
execplan::CalpontSystemCatalog::ColDataType dt = execplan::CalpontSystemCatalog::BIT,
uint32_t csn = 8)
: width(w), oid(o), key(k), tkey(t), scale(s), precision(p), dtype(dt), csNum(csn)
{
}
~TupleInfo()
{
}
~TupleInfo() = default;
uint32_t width;
uint32_t oid;
@ -146,7 +145,7 @@ struct UniqId
: fId(i), fTable(t), fSchema(s), fView(v), fPseudo(pi), fSubId(l)
{
}
UniqId(const execplan::SimpleColumn* sc);
explicit UniqId(const execplan::SimpleColumn* sc);
UniqId(int o, const execplan::SimpleColumn* sc);
std::string toString() const;
@ -193,7 +192,7 @@ struct TupleKeyInfo
//------------------------------------------------------------------------------
struct JobInfo
{
JobInfo(ResourceManager* r)
explicit JobInfo(ResourceManager* r)
: rm(r)
, sessionId(0)
, txnId(0)
@ -204,7 +203,7 @@ struct JobInfo
, fifoSize(rm->getJlFifoSize())
, logger(new Logger())
, traceFlags(0)
, projectingTableOID(0)
, projectingTableOID(nullptr)
, isExeMgr(false)
, trace(false)
, tryTuples(false)
@ -219,7 +218,7 @@ struct JobInfo
, subLevel(0)
, subNum(0)
, subId(0)
, pJobInfo(NULL)
, pJobInfo(nullptr)
, constantFalse(false)
, cntStarPos(-1)
, stringScanThreshold(1)

View File

@ -217,10 +217,10 @@ class JobList
class TupleJobList : public JobList
{
public:
TupleJobList(bool isEM = false);
virtual ~TupleJobList();
explicit TupleJobList(bool isEM = false);
~TupleJobList() override;
EXPORT uint32_t projectTable(execplan::CalpontSystemCatalog::OID, messageqcpp::ByteStream&);
EXPORT uint32_t projectTable(execplan::CalpontSystemCatalog::OID, messageqcpp::ByteStream&) override;
EXPORT const rowgroup::RowGroup& getOutputRowGroup() const;
TupleDeliveryStep* getDeliveryStep()
{
@ -231,7 +231,7 @@ class TupleJobList : public JobList
return fQuery;
}
void setDeliveryFlag(bool f);
void abort();
void abort() override;
/** Does some light validation on the final joblist
*
@ -239,7 +239,7 @@ class TupleJobList : public JobList
* there's one and only one projection step, and that its fake table OID is 100.
* @note The fake OID check is disabled atm because it's not always 100 although it's supposed to be.
*/
EXPORT void validate() const;
EXPORT void validate() const override;
private:
// defaults okay
@ -255,4 +255,3 @@ typedef boost::shared_ptr<TupleJobList> STJLP;
} // namespace joblist
#undef EXPORT

View File

@ -60,12 +60,8 @@ namespace joblist
class JobStepAssociation
{
public:
JobStepAssociation()
{
}
virtual ~JobStepAssociation()
{
}
JobStepAssociation() = default;
virtual ~JobStepAssociation() = default;
void inAdd(const AnyDataListSPtr& spdl) __attribute__((deprecated))
{
@ -127,10 +123,8 @@ class JobStep
public:
/** constructor
*/
JobStep()
{
}
JobStep(const JobInfo&);
JobStep() = default;
explicit JobStep(const JobInfo&);
/** destructor
*/
virtual ~JobStep()
@ -508,12 +502,8 @@ class JobStep
class TupleJobStep
{
public:
TupleJobStep()
{
}
virtual ~TupleJobStep()
{
}
TupleJobStep() = default;
virtual ~TupleJobStep() = default;
virtual void setOutputRowGroup(const rowgroup::RowGroup&) = 0;
virtual void setFcnExpGroup3(const std::vector<execplan::SRCP>&)
{
@ -527,9 +517,7 @@ class TupleJobStep
class TupleDeliveryStep : public TupleJobStep
{
public:
virtual ~TupleDeliveryStep()
{
}
~TupleDeliveryStep() override = default;
virtual uint32_t nextBand(messageqcpp::ByteStream& bs) = 0;
virtual const rowgroup::RowGroup& getDeliveredRowGroup() const = 0;
virtual void deliverStringTableRowGroup(bool b) = 0;
@ -541,17 +529,17 @@ class NullStep : public JobStep
public:
/** @brief virtual void Run method
*/
virtual void run()
void run() override
{
}
/** @brief virtual void join method
*/
virtual void join()
void join() override
{
}
/** @brief virtual string toString method
*/
virtual const std::string toString() const
const std::string toString() const override
{
return "NullStep";
}
@ -566,4 +554,3 @@ typedef boost::shared_ptr<JobStepAssociation> JobStepAssociationSPtr;
typedef boost::shared_ptr<JobStep> SJSTEP;
} // namespace joblist

View File

@ -24,7 +24,6 @@
#include <vector>
#include <boost/scoped_ptr.hpp>
#include "groupconcat.h"
#define EXPORT
@ -39,31 +38,31 @@ class JsonArrayInfo : public GroupConcatInfo
{
public:
void prepJsonArray(JobInfo&);
void mapColumns(const rowgroup::RowGroup&);
void mapColumns(const rowgroup::RowGroup&) override;
const std::string toString() const;
const std::string toString() const override;
protected:
uint32_t getColumnKey(const execplan::SRCP& srcp, JobInfo& jobInfo);
std::shared_ptr<int[]> makeMapping(const rowgroup::RowGroup&, const rowgroup::RowGroup&);
uint32_t getColumnKey(const execplan::SRCP& srcp, JobInfo& jobInfo) override;
std::shared_ptr<int[]> makeMapping(const rowgroup::RowGroup&, const rowgroup::RowGroup&) override;
};
class JsonArrayAggregatAgUM : public GroupConcatAgUM
{
public:
EXPORT JsonArrayAggregatAgUM(rowgroup::SP_GroupConcat&);
EXPORT ~JsonArrayAggregatAgUM();
EXPORT explicit JsonArrayAggregatAgUM(rowgroup::SP_GroupConcat&);
EXPORT ~JsonArrayAggregatAgUM() override;
using rowgroup::GroupConcatAg::merge;
void initialize();
void processRow(const rowgroup::Row&);
EXPORT void merge(const rowgroup::Row&, int64_t);
void initialize() override;
void processRow(const rowgroup::Row&) override;
EXPORT void merge(const rowgroup::Row&, int64_t) override;
EXPORT void getResult(uint8_t*);
EXPORT uint8_t* getResult();
EXPORT uint8_t* getResult() override;
protected:
void applyMapping(const std::shared_ptr<int[]>&, const rowgroup::Row&);
void applyMapping(const std::shared_ptr<int[]>&, const rowgroup::Row&) override;
};
// JSON_ARRAYAGG base
@ -71,17 +70,17 @@ class JsonArrayAggregator : public GroupConcator
{
public:
JsonArrayAggregator();
virtual ~JsonArrayAggregator();
~JsonArrayAggregator() override;
virtual void initialize(const rowgroup::SP_GroupConcat&);
virtual void processRow(const rowgroup::Row&) = 0;
void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&) override = 0;
virtual const std::string toString() const;
const std::string toString() const override;
protected:
virtual bool concatColIsNull(const rowgroup::Row&);
virtual void outputRow(std::ostringstream&, const rowgroup::Row&);
virtual int64_t lengthEstimate(const rowgroup::Row&);
bool concatColIsNull(const rowgroup::Row&) override;
void outputRow(std::ostringstream&, const rowgroup::Row&) override;
int64_t lengthEstimate(const rowgroup::Row&) override;
};
// For JSON_ARRAYAGG withour distinct or orderby
@ -89,17 +88,17 @@ class JsonArrayAggNoOrder : public JsonArrayAggregator
{
public:
JsonArrayAggNoOrder();
virtual ~JsonArrayAggNoOrder();
~JsonArrayAggNoOrder() override;
void initialize(const rowgroup::SP_GroupConcat&);
void processRow(const rowgroup::Row&);
void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&) override;
using GroupConcator::merge;
void merge(GroupConcator*);
void merge(GroupConcator*) override;
using GroupConcator::getResult;
uint8_t* getResultImpl(const std::string& sep);
uint8_t* getResultImpl(const std::string& sep) override;
const std::string toString() const;
const std::string toString() const override;
protected:
rowgroup::RowGroup fRowGroup;
@ -118,19 +117,19 @@ class JsonArrayAggOrderBy : public JsonArrayAggregator, public ordering::IdbOrde
{
public:
JsonArrayAggOrderBy();
virtual ~JsonArrayAggOrderBy();
~JsonArrayAggOrderBy() override;
using ordering::IdbOrderBy::initialize;
void initialize(const rowgroup::SP_GroupConcat&);
void processRow(const rowgroup::Row&);
uint64_t getKeyLength() const;
void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&) override;
uint64_t getKeyLength() const override;
using GroupConcator::merge;
void merge(GroupConcator*);
void merge(GroupConcator*) override;
using GroupConcator::getResult;
uint8_t* getResultImpl(const std::string& sep);
uint8_t* getResultImpl(const std::string& sep) override;
const std::string toString() const;
const std::string toString() const override;
protected:
};

View File

@ -89,7 +89,7 @@ struct DiskIoInfo
bool fWrite;
// c: byte count; b: is write operation?
DiskIoInfo(bool b = false) : fBytes(0), fWrite(b)
explicit DiskIoInfo(bool b = false) : fBytes(0), fWrite(b)
{
}
};
@ -205,7 +205,7 @@ LargeDataList<container_t, element_t>::LargeDataList(uint32_t nc, uint32_t eleme
, fTraceOn(false)
, fReUse(false)
, fSaveForReuse(false)
, fRestoreInfo(NULL)
, fRestoreInfo(nullptr)
{
loadedSet = 0;
setCount = 1;

View File

@ -256,9 +256,7 @@ class HashJoin
};
template <typename element_t>
HashJoin<element_t>::HashJoin()
{
}
HashJoin<element_t>::HashJoin() = default;
template <typename element_t>
HashJoin<element_t>::HashJoin(joblist::BDLWrapper<element_t>& set1, joblist::BDLWrapper<element_t>& set2,

View File

@ -38,17 +38,17 @@ class LimitedOrderBy : public ordering::IdbOrderBy
{
public:
LimitedOrderBy();
virtual ~LimitedOrderBy();
~LimitedOrderBy() override;
using ordering::IdbOrderBy::initialize;
void initialize(const rowgroup::RowGroup&, const JobInfo&, bool invertRules = false,
bool isMultiThreded = false);
void processRow(const rowgroup::Row&);
uint64_t getKeyLength() const;
void processRow(const rowgroup::Row&) override;
uint64_t getKeyLength() const override;
uint64_t getLimitCount() const
{
return fCount;
}
const std::string toString() const;
const std::string toString() const override;
void finalize();

View File

@ -41,18 +41,19 @@ class PassThruStep;
class PassThruCommandJL : public CommandJL
{
public:
PassThruCommandJL(const PassThruStep&);
virtual ~PassThruCommandJL();
explicit PassThruCommandJL(const PassThruStep&);
~PassThruCommandJL() override;
void setLBID(uint64_t data, uint32_t dbroot); // converts a rid or dictionary token to an LBID. For
// ColumnCommandJL it's a RID, for a DictStep it's a token.
uint8_t getTableColumnType();
std::string toString();
void setLBID(uint64_t data,
uint32_t dbroot) override; // converts a rid or dictionary token to an LBID. For
// ColumnCommandJL it's a RID, for a DictStep it's a token.
uint8_t getTableColumnType() override;
std::string toString() override;
void createCommand(messageqcpp::ByteStream&) const;
void runCommand(messageqcpp::ByteStream&) const;
uint16_t getWidth();
CommandType getCommandType()
void createCommand(messageqcpp::ByteStream&) const override;
void runCommand(messageqcpp::ByteStream&) const override;
uint16_t getWidth() override;
CommandType getCommandType() override
{
return PASS_THRU;
}

View File

@ -35,7 +35,6 @@
#pragma pack(push, 1)
// from blocksize.h
const int32_t DATA_BLOCK_SIZE = BLOCK_SIZE;
@ -65,7 +64,7 @@ using utils::ConstString;
class StringComparator : public datatypes::Charset
{
public:
StringComparator(const Charset& cs) : Charset(cs)
explicit StringComparator(const Charset& cs) : Charset(cs)
{
}
bool op(int* error, uint8_t COP, const ConstString& str1, const ConstString& str2) const
@ -74,7 +73,8 @@ class StringComparator : public datatypes::Charset
return like(COP & COMPARE_NOT, str1, str2);
if (COP == COMPARE_NULLEQ)
return str1.isNull() == str2.isNull(); // XXX: TODO: I do not know the logic here, so it is temporary solution.
return str1.isNull() ==
str2.isNull(); // XXX: TODO: I do not know the logic here, so it is temporary solution.
int cmp = strnncollsp(str1, str2);
@ -335,7 +335,7 @@ struct ColRequestHeaderDataType : public datatypes::Charset
ColRequestHeaderDataType() : Charset(my_charset_bin), CompType(0), DataSize(0), DataType(0)
{
}
ColRequestHeaderDataType(const execplan::CalpontSystemCatalog::ColType& rhs)
explicit ColRequestHeaderDataType(const execplan::CalpontSystemCatalog::ColType& rhs)
: Charset(rhs.charsetNumber)
, CompType(rhs.compressionType)
, DataSize(rhs.colWidth)
@ -633,7 +633,7 @@ struct TokenByScanResultHeader
uint16_t Pad1;
uint32_t CacheIO; // I/O count from buffer cache
uint32_t PhysicalIO; // Physical I/O count from disk
}; // what follows is NVALS Tokens or DataValues.
}; // what follows is NVALS Tokens or DataValues.
// DICT_SIGNATURE
@ -889,5 +889,4 @@ struct LbidAtVer
uint32_t Ver;
};
#pragma pack(pop)

View File

@ -102,26 +102,26 @@ class pColStep : public JobStep
pColStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid,
const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo);
pColStep(const pColScanStep& rhs);
explicit pColStep(const pColScanStep& rhs);
pColStep(const PassThruStep& rhs);
explicit pColStep(const PassThruStep& rhs);
virtual ~pColStep(){};
~pColStep() override = default;
/** @brief Starts processing. Set at least the RID list before calling.
*
* Starts processing. Set at least the RID list before calling this.
*/
virtual void run() {};
void run() override {};
/** @brief Sync's the caller with the end of execution.
*
* Does nothing. Returns when this instance is finished.
*/
virtual void join() {};
void join() override {};
virtual const std::string toString() const;
const std::string toString() const override;
virtual bool isDictCol() const
bool isDictCol() const override
{
return fIsDict;
}
@ -186,12 +186,12 @@ class pColStep : public JobStep
return fSwallowRows;
}
virtual execplan::CalpontSystemCatalog::OID oid() const
execplan::CalpontSystemCatalog::OID oid() const override
{
return fOid;
}
virtual execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOid;
}
@ -222,15 +222,15 @@ class pColStep : public JobStep
{
isFilterFeeder = filterFeeder;
}
virtual uint64_t msgsRcvdCount() const
uint64_t msgsRcvdCount() const override
{
return msgsRecvd;
}
virtual uint64_t msgBytesIn() const
uint64_t msgBytesIn() const override
{
return fMsgBytesIn;
}
virtual uint64_t msgBytesOut() const
uint64_t msgBytesOut() const override
{
return fMsgBytesOut;
}
@ -336,16 +336,14 @@ class pColScanStep : public JobStep
pColScanStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid,
const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo);
pColScanStep(const pColStep& rhs);
~pColScanStep()
{
}
explicit pColScanStep(const pColStep& rhs);
~pColScanStep() override = default;
/** @brief Starts processing.
*
* Starts processing.
*/
virtual void run()
void run() override
{
}
@ -353,11 +351,11 @@ class pColScanStep : public JobStep
*
* Does nothing. Returns when this instance is finished.
*/
virtual void join()
void join() override
{
}
virtual bool isDictCol() const
bool isDictCol() const override
{
return fIsDict;
};
@ -413,14 +411,14 @@ class pColScanStep : public JobStep
return fFilterCount;
}
virtual const std::string toString() const;
const std::string toString() const override;
virtual execplan::CalpontSystemCatalog::OID oid() const
execplan::CalpontSystemCatalog::OID oid() const override
{
return fOid;
}
virtual execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOid;
}
@ -433,11 +431,11 @@ class pColScanStep : public JobStep
return fRm;
}
virtual uint64_t msgBytesIn() const
uint64_t msgBytesIn() const override
{
return fMsgBytesIn;
}
virtual uint64_t msgBytesOut() const
uint64_t msgBytesOut() const override
{
return fMsgBytesOut;
}
@ -479,7 +477,6 @@ class pColScanStep : public JobStep
return fFilters;
}
private:
// defaults okay?
// pColScanStep(const pColScanStep& rhs);
@ -545,16 +542,14 @@ class pDictionaryStep : public JobStep
pDictionaryStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tabelOid,
const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo);
virtual ~pDictionaryStep()
{
}
~pDictionaryStep() override = default;
/** @brief virtual void Run method
*/
virtual void run()
void run() override
{
}
virtual void join()
void join() override
{
}
// void setOutList(StringDataList* rids);
@ -568,7 +563,7 @@ class pDictionaryStep : public JobStep
fBOP = b;
}
virtual const std::string toString() const;
const std::string toString() const override;
execplan::CalpontSystemCatalog::ColType& colType()
{
@ -579,23 +574,23 @@ class pDictionaryStep : public JobStep
return fColType;
}
virtual execplan::CalpontSystemCatalog::OID oid() const
execplan::CalpontSystemCatalog::OID oid() const override
{
return fOid;
}
virtual execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOid;
}
virtual uint64_t msgsRcvdCount() const
uint64_t msgsRcvdCount() const override
{
return msgsRecvd;
}
virtual uint64_t msgBytesIn() const
uint64_t msgBytesIn() const override
{
return fMsgBytesIn;
}
virtual uint64_t msgBytesOut() const
uint64_t msgBytesOut() const override
{
return fMsgBytesOut;
}
@ -677,18 +672,18 @@ class pDictionaryScan : public JobStep
pDictionaryScan(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid,
const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo);
~pDictionaryScan();
~pDictionaryScan() override;
/** @brief virtual void Run method
*/
virtual void run();
virtual void join();
void run() override;
void join() override;
void setInputList(DataList_t* rids);
void setBOP(int8_t b);
void sendPrimitiveMessages();
void receivePrimitiveMessages();
void setSingleThread();
virtual const std::string toString() const;
const std::string toString() const override;
void setRidList(DataList<ElementType>* rids);
@ -713,32 +708,32 @@ class pDictionaryScan : public JobStep
fDec->addQueue(uniqueID);
}
virtual execplan::CalpontSystemCatalog::OID oid() const
execplan::CalpontSystemCatalog::OID oid() const override
{
return fOid;
}
virtual execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOid;
}
uint64_t phyIOCount() const
uint64_t phyIOCount() const override
{
return fPhysicalIO;
}
uint64_t cacheIOCount() const
uint64_t cacheIOCount() const override
{
return fCacheIO;
}
uint64_t msgsRcvdCount() const
uint64_t msgsRcvdCount() const override
{
return msgsRecvd;
}
uint64_t msgBytesIn() const
uint64_t msgBytesIn() const override
{
return fMsgBytesIn;
}
uint64_t msgBytesOut() const
uint64_t msgBytesOut() const override
{
return fMsgBytesOut;
}
@ -781,7 +776,7 @@ class pDictionaryScan : public JobStep
}
void appendFilter(const messageqcpp::ByteStream& filter, unsigned count);
virtual void abort();
void abort() override;
const execplan::CalpontSystemCatalog::ColType& colType() const
{
@ -859,7 +854,7 @@ class pDictionaryScan : public JobStep
class BatchPrimitive : public JobStep, public DECEventListener
{
public:
BatchPrimitive(const JobInfo& jobInfo) : JobStep(jobInfo)
explicit BatchPrimitive(const JobInfo& jobInfo) : JobStep(jobInfo)
{
}
virtual bool getFeederFlag() const = 0;
@ -922,20 +917,20 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
TupleBPS(const pDictionaryStep& rhs, const JobInfo& jobInfo);
TupleBPS(const pDictionaryScan& rhs, const JobInfo& jobInfo);
TupleBPS(const PassThruStep& rhs, const JobInfo& jobInfo);
virtual ~TupleBPS();
~TupleBPS() override;
/** @brief Starts processing.
*
* Starts processing.
*/
virtual void run();
void run() override;
/** @brief Sync's the caller with the end of execution.
*
* Does nothing. Returns when this instance is finished.
*/
virtual void join();
void join() override;
void abort();
void abort() override;
void abort_nolock();
/** @brief The main loop for the send-side thread
@ -960,11 +955,11 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
* Add a filter when the column is anything but a 4-byte float type, including
* 8-byte doubles.
*/
void setBPP(JobStep* jobStep);
void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2);
void setBPP(JobStep* jobStep) override;
void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2) override;
bool scanit(uint64_t rid);
void storeCasualPartitionInfo(const bool estimateRowCounts);
bool getFeederFlag() const
bool getFeederFlag() const override
{
return isFilterFeeder;
}
@ -972,7 +967,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
{
isFilterFeeder = filterFeeder;
}
void setSwallowRows(const bool swallowRows)
void setSwallowRows(const bool swallowRows) override
{
fSwallowRows = swallowRows;
}
@ -982,25 +977,25 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
}
/* Base class interface fcn that can go away */
void setOutputType(BPSOutputType)
void setOutputType(BPSOutputType) override
{
} // Can't change the ot of a TupleBPS
BPSOutputType getOutputType() const
BPSOutputType getOutputType() const override
{
return ROW_GROUP;
}
void setBppStep()
void setBppStep() override
{
}
void setIsProjectionOnly()
void setIsProjectionOnly() override
{
}
uint64_t getRows() const
uint64_t getRows() const override
{
return ridsReturned;
}
void setFirstStepType(PrimitiveStepType firstStepType)
void setFirstStepType(PrimitiveStepType firstStepType) override
{
ffirstStepType = firstStepType;
}
@ -1008,19 +1003,19 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
{
return ffirstStepType;
}
void setStepCount()
void setStepCount() override
{
fStepCount++;
}
uint32_t getStepCount() const
uint32_t getStepCount() const override
{
return fStepCount;
}
void setLastTupleId(uint64_t id)
void setLastTupleId(uint64_t id) override
{
fLastTupleId = id;
}
uint64_t getLastTupleId() const
uint64_t getLastTupleId() const override
{
return fLastTupleId;
}
@ -1029,20 +1024,20 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
*
* Set the DistributedEngineComm object this instance should use
*/
void dec(DistributedEngineComm* dec);
void dec(DistributedEngineComm* dec) override;
virtual void stepId(uint16_t stepId);
virtual uint16_t stepId() const
void stepId(uint16_t stepId) override;
uint16_t stepId() const override
{
return fStepId;
}
virtual const std::string toString() const;
const std::string toString() const override;
virtual execplan::CalpontSystemCatalog::OID oid() const
execplan::CalpontSystemCatalog::OID oid() const override
{
return fOid;
}
virtual execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOid;
}
@ -1050,40 +1045,40 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
{
return fColType;
}
const OIDVector& getProjectOids() const
const OIDVector& getProjectOids() const override
{
return projectOids;
}
virtual uint64_t phyIOCount() const
uint64_t phyIOCount() const override
{
return fPhysicalIO;
}
virtual uint64_t cacheIOCount() const
uint64_t cacheIOCount() const override
{
return fCacheIO;
}
virtual uint64_t msgsRcvdCount() const
uint64_t msgsRcvdCount() const override
{
return msgsRecvd;
}
virtual uint64_t msgBytesIn() const
uint64_t msgBytesIn() const override
{
return fMsgBytesIn;
}
virtual uint64_t msgBytesOut() const
uint64_t msgBytesOut() const override
{
return fMsgBytesOut;
}
virtual uint64_t blockTouched() const
uint64_t blockTouched() const override
{
return fBlockTouched;
}
uint32_t nextBand(messageqcpp::ByteStream& bs);
uint32_t nextBand(messageqcpp::ByteStream& bs) override;
//...Currently only supported by pColStep and pColScanStep, so didn't bother
//...to define abstract method in base class, but if start adding to other
//...classes, then should consider adding pure virtual method to JobStep.
uint64_t blksSkipped() const
uint64_t blksSkipped() const override
{
return fNumBlksSkipped;
}
@ -1094,17 +1089,17 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
}
void useJoiner(std::shared_ptr<joiner::TupleJoiner>);
void useJoiners(const std::vector<std::shared_ptr<joiner::TupleJoiner>>&);
bool wasStepRun() const
bool wasStepRun() const override
{
return fRunExecuted;
}
// DEC event listener interface
void newPMOnline(uint32_t connectionNumber);
void newPMOnline(uint32_t connectionNumber) override;
void setInputRowGroup(const rowgroup::RowGroup& rg);
void setOutputRowGroup(const rowgroup::RowGroup& rg);
const rowgroup::RowGroup& getOutputRowGroup() const;
void setOutputRowGroup(const rowgroup::RowGroup& rg) override;
const rowgroup::RowGroup& getOutputRowGroup() const override;
void setAggregateStep(const rowgroup::SP_ROWAGG_PM_t& agg, const rowgroup::RowGroup& rg);
@ -1118,7 +1113,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
return bop;
}
void setJobInfo(const JobInfo* jobInfo);
void setJobInfo(const JobInfo* jobInfo) override;
// @bug 2123. Added getEstimatedRowCount function.
/* @brief estimates the number of rows that will be returned for use in determining the
@ -1141,9 +1136,9 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
JLF should register that object with the TBPS for that table. If it's
cross-table, then JLF should register it with the join step.
*/
void addFcnJoinExp(const std::vector<execplan::SRCP>& fe);
void addFcnExpGroup1(const boost::shared_ptr<execplan::ParseTree>& fe);
void setFE1Input(const rowgroup::RowGroup& feInput);
void addFcnJoinExp(const std::vector<execplan::SRCP>& fe) override;
void addFcnExpGroup1(const boost::shared_ptr<execplan::ParseTree>& fe) override;
void setFE1Input(const rowgroup::RowGroup& feInput) override;
/* for use by the THJS only... */
void setFcnExpGroup2(const boost::shared_ptr<funcexp::FuncExpWrapper>& fe2,
@ -1152,17 +1147,17 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
/* Functions & Expressions in select and groupby clause.
JLF should use these only if there isn't a join. If there is, call the
equivalent fcn on THJS instead */
void setFcnExpGroup3(const std::vector<execplan::SRCP>& fe);
void setFE23Output(const rowgroup::RowGroup& rg);
void setFcnExpGroup3(const std::vector<execplan::SRCP>& fe) override;
void setFE23Output(const rowgroup::RowGroup& rg) override;
bool hasFcnExpGroup3()
{
return (fe2 != NULL);
}
// rowgroup to connector
const rowgroup::RowGroup& getDeliveredRowGroup() const;
void deliverStringTableRowGroup(bool b);
bool deliverStringTableRowGroup() const;
const rowgroup::RowGroup& getDeliveredRowGroup() const override;
void deliverStringTableRowGroup(bool b) override;
bool deliverStringTableRowGroup() const override;
/* Interface for adding add'l predicates for casual partitioning.
* This fcn checks for any intersection between the values in vals
@ -1185,7 +1180,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
void reloadExtentLists();
void initExtentMarkers(); // need a better name for this
virtual bool stringTableFriendly()
bool stringTableFriendly() override
{
return true;
}
@ -1486,16 +1481,16 @@ class FilterStep : public JobStep
{
public:
FilterStep(const execplan::CalpontSystemCatalog::ColType& colType, const JobInfo& jobInfo);
~FilterStep();
~FilterStep() override;
/** @brief virtual void Run method
*/
void run();
void join();
void run() override;
void join() override;
const std::string toString() const;
const std::string toString() const override;
execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOID;
}
@ -1526,7 +1521,7 @@ class FilterStep : public JobStep
private:
// This i/f is not meaningful in this step
execplan::CalpontSystemCatalog::OID oid() const
execplan::CalpontSystemCatalog::OID oid() const override
{
return 0;
}
@ -1562,31 +1557,31 @@ class PassThruStep : public JobStep
PassThruStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid,
const execplan::CalpontSystemCatalog::ColType& colType, const JobInfo& jobInfo);
PassThruStep(const pColStep& rhs);
PassThruStep(const PseudoColStep& rhs);
explicit PassThruStep(const pColStep& rhs);
explicit PassThruStep(const PseudoColStep& rhs);
virtual ~PassThruStep();
~PassThruStep() override;
/** @brief Starts processing. Set at least the RID list before calling.
*
* Starts processing. Set at least the RID list before calling this.
*/
virtual void run();
void run() override;
/** @brief Sync's the caller with the end of execution.
*
* Does nothing. Returns when this instance is finished.
*/
virtual void join();
void join() override;
virtual const std::string toString() const;
const std::string toString() const override;
virtual execplan::CalpontSystemCatalog::OID oid() const
execplan::CalpontSystemCatalog::OID oid() const override
{
return fOid;
}
virtual execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOid;
}
@ -1595,7 +1590,7 @@ class PassThruStep : public JobStep
{
return colWidth;
}
bool isDictCol() const
bool isDictCol() const override
{
return isDictColumn;
}
@ -1663,13 +1658,11 @@ class PseudoColStep : public pColStep
{
}
PseudoColStep(const PassThruStep& rhs) : pColStep(rhs), fPseudoColumnId(rhs.pseudoType())
explicit PseudoColStep(const PassThruStep& rhs) : pColStep(rhs), fPseudoColumnId(rhs.pseudoType())
{
}
virtual ~PseudoColStep()
{
}
~PseudoColStep() override = default;
uint32_t pseudoColumnId() const
{
@ -1686,8 +1679,8 @@ class PseudoColStep : public pColStep
private:
/** @brief disabled constuctor
*/
PseudoColStep(const pColScanStep&);
PseudoColStep(const pColStep&);
explicit PseudoColStep(const pColScanStep&);
explicit PseudoColStep(const pColStep&);
};
} // namespace joblist

View File

@ -24,12 +24,12 @@ namespace joblist
class PseudoCCJL : public ColumnCommandJL
{
public:
PseudoCCJL(const PseudoColStep&);
virtual ~PseudoCCJL();
explicit PseudoCCJL(const PseudoColStep&);
~PseudoCCJL() override;
virtual void createCommand(messageqcpp::ByteStream&) const;
virtual void runCommand(messageqcpp::ByteStream&) const;
virtual std::string toString();
void createCommand(messageqcpp::ByteStream&) const override;
void runCommand(messageqcpp::ByteStream&) const override;
std::string toString() override;
uint32_t getFunction() const
{
return function;

View File

@ -58,7 +58,7 @@ extern const unsigned maxSessionsDefault;
class LockedSessionMap
{
public:
LockedSessionMap(uint64_t resource, unsigned maxSessions = maxSessionsDefault)
explicit LockedSessionMap(uint64_t resource, unsigned maxSessions = maxSessionsDefault)
: fResourceBlock(resource), fMaxSessions(maxSessions)
{
}
@ -93,9 +93,7 @@ class ResourceDistributor
{
}
virtual ~ResourceDistributor()
{
}
virtual ~ResourceDistributor() = default;
typedef std::map<uint32_t, uint64_t> SessionMap;

View File

@ -100,9 +100,9 @@ const uint64_t defaultRowsPerBatch = 10000;
/* HJ CP feedback, see bug #1465 */
const uint32_t defaultHjCPUniqueLimit = 100;
const constexpr uint64_t defaultFlowControlEnableBytesThresh = 50000000; // ~50Mb
const constexpr uint64_t defaultFlowControlEnableBytesThresh = 50000000; // ~50Mb
const constexpr uint64_t defaultFlowControlDisableBytesThresh = 10000000; // ~10 MB
const constexpr uint64_t defaultBPPSendThreadBytesThresh = 250000000; // ~250 MB
const constexpr uint64_t defaultBPPSendThreadBytesThresh = 250000000; // ~250 MB
const constexpr uint64_t BPPSendThreadMsgThresh = 100;
const bool defaultAllowDiskAggregation = false;
@ -117,7 +117,7 @@ class ResourceManager
/** @brief ctor
*
*/
ResourceManager(bool runningInExeMgr = false, config::Config* aConfig = nullptr);
explicit ResourceManager(bool runningInExeMgr = false, config::Config* aConfig = nullptr);
static ResourceManager* instance(bool runningInExeMgr = false, config::Config* aConfig = nullptr);
config::Config* getConfig()
{
@ -126,9 +126,7 @@ class ResourceManager
/** @brief dtor
*/
virtual ~ResourceManager()
{
}
virtual ~ResourceManager() = default;
typedef std::map<uint32_t, uint64_t> MemMap;
@ -286,12 +284,14 @@ class ResourceManager
uint64_t getDECEnableBytesThresh() const
{
return getUintVal(FlowControlStr, "DECFlowControlEnableBytesThresh(", defaultFlowControlEnableBytesThresh);
return getUintVal(FlowControlStr, "DECFlowControlEnableBytesThresh(",
defaultFlowControlEnableBytesThresh);
}
uint32_t getDECDisableBytesThresh() const
{
return getUintVal(FlowControlStr, "DECFlowControlDisableBytesThresh", defaultFlowControlDisableBytesThresh);
return getUintVal(FlowControlStr, "DECFlowControlDisableBytesThresh",
defaultFlowControlDisableBytesThresh);
}
uint32_t getBPPSendThreadBytesThresh() const

View File

@ -42,24 +42,25 @@ class RTSCommandJL : public CommandJL
public:
RTSCommandJL(const pColStep&, const pDictionaryStep&);
RTSCommandJL(const PassThruStep&, const pDictionaryStep&);
virtual ~RTSCommandJL();
~RTSCommandJL() override;
void setLBID(uint64_t data, uint32_t dbroot); // converts a rid or dictionary token to an LBID. For
// ColumnCommandJL it's a RID, for a DictStep it's a token.
uint8_t getTableColumnType();
std::string toString();
void setLBID(uint64_t data,
uint32_t dbroot) override; // converts a rid or dictionary token to an LBID. For
// ColumnCommandJL it's a RID, for a DictStep it's a token.
uint8_t getTableColumnType() override;
std::string toString() override;
bool isPassThru()
{
return (passThru != 0);
}
uint16_t getWidth();
CommandType getCommandType()
uint16_t getWidth() override;
CommandType getCommandType() override
{
return RID_TO_STRING;
}
void createCommand(messageqcpp::ByteStream&) const;
void runCommand(messageqcpp::ByteStream&) const;
void createCommand(messageqcpp::ByteStream&) const override;
void runCommand(messageqcpp::ByteStream&) const override;
private:
RTSCommandJL();

View File

@ -40,28 +40,28 @@ class SubQueryStep : public JobStep
public:
/** @brief SubQueryStep constructor
*/
SubQueryStep(const JobInfo&);
explicit SubQueryStep(const JobInfo&);
/** @brief SubQueryStep destructor
*/
~SubQueryStep();
~SubQueryStep() override;
/** @brief virtual void run method
*/
void run();
void run() override;
/** @brief virtual void join method
*/
void join();
void join() override;
/** @brief virtual void abort method
*/
void abort();
void abort() override;
/** @brief virtual get table OID
* @returns OID
*/
execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOid;
}
@ -76,7 +76,7 @@ class SubQueryStep : public JobStep
/** @brief virtual output info to a string
* @returns string
*/
const std::string toString() const;
const std::string toString() const override;
/** @brief virtual set the output rowgroup
*/
@ -128,24 +128,24 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
/** @brief SubAdapterStep destructor
*/
~SubAdapterStep();
~SubAdapterStep() override;
/** @brief virtual void run method
*/
void run();
void run() override;
/** @brief virtual void join method
*/
void join();
void join() override;
/** @brief virtual void abort method
*/
void abort();
void abort() override;
/** @brief virtual get table OID
* @returns OID
*/
execplan::CalpontSystemCatalog::OID tableOid() const
execplan::CalpontSystemCatalog::OID tableOid() const override
{
return fTableOid;
}
@ -160,16 +160,16 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
/** @brief virtual output info to a string
* @returns string
*/
const std::string toString() const;
const std::string toString() const override;
/** @brief virtual set the output rowgroup
*/
void setOutputRowGroup(const rowgroup::RowGroup& rg);
void setOutputRowGroup(const rowgroup::RowGroup& rg) override;
/** @brief virtual get the output rowgroup
* @returns RowGroup
*/
const rowgroup::RowGroup& getOutputRowGroup() const
const rowgroup::RowGroup& getOutputRowGroup() const override
{
return fRowGroupOut;
}
@ -177,24 +177,24 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
/** @brief TupleDeliveryStep's pure virtual methods nextBand
* @returns row count
*/
uint32_t nextBand(messageqcpp::ByteStream& bs);
uint32_t nextBand(messageqcpp::ByteStream& bs) override;
/** @brief Delivered Row Group
* @returns RowGroup
*/
const rowgroup::RowGroup& getDeliveredRowGroup() const
const rowgroup::RowGroup& getDeliveredRowGroup() const override
{
return fRowGroupDeliver;
}
/** @brief Turn on/off string table delivery
*/
void deliverStringTableRowGroup(bool b);
void deliverStringTableRowGroup(bool b) override;
/** @brief Check useStringTable flag on delivered RowGroup
* @returns boolean
*/
bool deliverStringTableRowGroup() const;
bool deliverStringTableRowGroup() const override;
/** @brief set the rowgroup for FE to work on
*/
@ -255,7 +255,7 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
class Runner
{
public:
Runner(SubAdapterStep* step) : fStep(step)
explicit Runner(SubAdapterStep* step) : fStep(step)
{
}
void operator()()
@ -272,4 +272,3 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
};
} // namespace joblist

View File

@ -176,15 +176,15 @@ class SimpleScalarTransformer : public SubQueryTransformer
/** @brief SimpleScalarTransformer constructor
* @param SubQueryTransformer
*/
SimpleScalarTransformer(const SubQueryTransformer& rhs);
explicit SimpleScalarTransformer(const SubQueryTransformer& rhs);
/** @brief SimpleScalarTransformer destructor
*/
virtual ~SimpleScalarTransformer();
~SimpleScalarTransformer() override;
/** @brief virtual void run method
*/
void run();
void run() override;
/** @brief virtual get scalar result
* @param jobInfo
@ -222,4 +222,3 @@ class SimpleScalarTransformer : public SubQueryTransformer
};
} // namespace joblist

View File

@ -28,8 +28,6 @@
#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>
namespace joblist
{
struct TSQSize_t
@ -56,7 +54,7 @@ class ThreadSafeQueue
*
* @warning this class takes ownership of the passed-in pointers.
*/
ThreadSafeQueue(boost::mutex* pimplLock = 0, boost::condition* pimplCond = 0)
ThreadSafeQueue(boost::mutex* pimplLock = nullptr, boost::condition* pimplCond = nullptr)
: fShutdown(false), bytes(0), zeroCount(0)
{
fPimplLock.reset(pimplLock);
@ -113,7 +111,7 @@ class ThreadSafeQueue
*/
T& front()
{
if (fPimplLock == 0 || fPimplCond == 0)
if (fPimplLock == nullptr || fPimplCond == nullptr)
throw std::runtime_error("TSQ: front(): no sync!");
boost::mutex::scoped_lock lk(*fPimplLock);
@ -140,7 +138,7 @@ class ThreadSafeQueue
{
TSQSize_t ret = {0, 0};
if (fPimplLock == 0 || fPimplCond == 0)
if (fPimplLock == nullptr || fPimplCond == nullptr)
throw std::runtime_error("TSQ: push(): no sync!");
if (fShutdown)
@ -161,7 +159,7 @@ class ThreadSafeQueue
{
TSQSize_t ret = {0, 0};
if (fPimplLock == 0)
if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: pop(): no sync!");
if (fShutdown)
@ -213,7 +211,7 @@ class ThreadSafeQueue
uint32_t curSize, workSize;
TSQSize_t ret = {0, 0};
if (fPimplLock == 0)
if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: pop_some(): no sync!");
t.clear();
@ -268,7 +266,7 @@ class ThreadSafeQueue
*/
bool empty() const
{
if (fPimplLock == 0)
if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: empty(): no sync!");
boost::mutex::scoped_lock lk(*fPimplLock);
@ -281,7 +279,7 @@ class ThreadSafeQueue
{
TSQSize_t ret;
if (fPimplLock == 0)
if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: size(): no sync!");
boost::mutex::scoped_lock lk(*fPimplLock);
@ -298,15 +296,13 @@ class ThreadSafeQueue
{
fShutdown = true;
if (fPimplCond != 0)
if (fPimplCond != nullptr)
fPimplCond->notify_all();
return;
}
void clear()
{
if (fPimplLock == 0)
if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: clear(): no sync!");
boost::mutex::scoped_lock lk(*fPimplLock);
@ -315,7 +311,6 @@ class ThreadSafeQueue
fImpl.pop();
bytes = 0;
return;
}
private:

View File

@ -33,27 +33,27 @@ class JSTimeStamp
{
public:
JSTimeStamp();
~JSTimeStamp(){};
~JSTimeStamp() = default;
inline void setFirstInsertTime()
{
gettimeofday(&fFirstInsertTime, 0);
gettimeofday(&fFirstInsertTime, nullptr);
}
inline void setLastInsertTime()
{
gettimeofday(&fLastInsertTime, 0);
gettimeofday(&fLastInsertTime, nullptr);
}
inline void setEndOfInputTime()
{
gettimeofday(&fEndofInputTime, 0);
gettimeofday(&fEndofInputTime, nullptr);
}
inline void setFirstReadTime()
{
gettimeofday(&fFirstReadTime, 0);
gettimeofday(&fFirstReadTime, nullptr);
}
inline void setLastReadTime()
{
gettimeofday(&fLastReadTime, 0);
gettimeofday(&fLastReadTime, nullptr);
}
inline void setFirstInsertTime(const struct timeval& t)

View File

@ -103,21 +103,21 @@ class TupleAggregateStep : public JobStep, public TupleDeliveryStep
/** @brief TupleAggregateStep destructor
*/
~TupleAggregateStep();
~TupleAggregateStep() override;
/** @brief virtual void Run method
*/
void run();
void join();
void run() override;
void join() override;
const std::string toString() const;
const std::string toString() const override;
void setOutputRowGroup(const rowgroup::RowGroup&);
const rowgroup::RowGroup& getOutputRowGroup() const;
const rowgroup::RowGroup& getDeliveredRowGroup() const;
void deliverStringTableRowGroup(bool b);
bool deliverStringTableRowGroup() const;
uint32_t nextBand(messageqcpp::ByteStream& bs);
void setOutputRowGroup(const rowgroup::RowGroup&) override;
const rowgroup::RowGroup& getOutputRowGroup() const override;
const rowgroup::RowGroup& getDeliveredRowGroup() const override;
void deliverStringTableRowGroup(bool b) override;
bool deliverStringTableRowGroup() const override;
uint32_t nextBand(messageqcpp::ByteStream& bs) override;
uint32_t nextBand_singleThread(messageqcpp::ByteStream& bs);
bool setPmHJAggregation(JobStep* step);
void savePmHJData(rowgroup::SP_ROWAGG_t&, rowgroup::SP_ROWAGG_t&, rowgroup::RowGroup&);
@ -167,9 +167,10 @@ class TupleAggregateStep : public JobStep, public TupleDeliveryStep
template <class GroupByMap>
static bool tryToFindEqualFunctionColumnByTupleKey(JobInfo& jobInfo, GroupByMap& groupByMap,
const uint32_t tupleKey, uint32_t& foundTypleKey);
// This functions are workaround for the function above. For some reason different parts of the code with same
// semantics use different containers.
static uint32_t getTupleKeyFromTuple(const boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*, std::vector<uint32_t>*>& tuple);
// This functions are workaround for the function above. For some reason different parts of the code with
// same semantics use different containers.
static uint32_t getTupleKeyFromTuple(
const boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*, std::vector<uint32_t>*>& tuple);
static uint32_t getTupleKeyFromTuple(uint32_t key);
boost::shared_ptr<execplan::CalpontSystemCatalog> fCatalog;
@ -198,7 +199,7 @@ class TupleAggregateStep : public JobStep, public TupleDeliveryStep
class Aggregator
{
public:
Aggregator(TupleAggregateStep* step) : fStep(step)
explicit Aggregator(TupleAggregateStep* step) : fStep(step)
{
}
void operator()()

View File

@ -42,30 +42,30 @@ class TupleAnnexStep : public JobStep, public TupleDeliveryStep
public:
/** @brief TupleAnnexStep constructor
*/
TupleAnnexStep(const JobInfo& jobInfo);
explicit TupleAnnexStep(const JobInfo& jobInfo);
// Copy ctor to have a class mutex
TupleAnnexStep(const TupleAnnexStep& copy);
/** @brief TupleAnnexStep destructor
*/
~TupleAnnexStep();
~TupleAnnexStep() override;
// inherited methods
void run();
void join();
const std::string toString() const;
void run() override;
void join() override;
const std::string toString() const override;
/** @brief TupleJobStep's pure virtual methods
*/
const rowgroup::RowGroup& getOutputRowGroup() const;
void setOutputRowGroup(const rowgroup::RowGroup&);
const rowgroup::RowGroup& getOutputRowGroup() const override;
void setOutputRowGroup(const rowgroup::RowGroup&) override;
/** @brief TupleDeliveryStep's pure virtual methods
*/
uint32_t nextBand(messageqcpp::ByteStream& bs);
const rowgroup::RowGroup& getDeliveredRowGroup() const;
void deliverStringTableRowGroup(bool b);
bool deliverStringTableRowGroup() const;
uint32_t nextBand(messageqcpp::ByteStream& bs) override;
const rowgroup::RowGroup& getDeliveredRowGroup() const override;
void deliverStringTableRowGroup(bool b) override;
bool deliverStringTableRowGroup() const override;
void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo);
@ -95,7 +95,7 @@ class TupleAnnexStep : public JobStep, public TupleDeliveryStep
fMaxThreads = number;
}
virtual bool stringTableFriendly()
bool stringTableFriendly() override
{
return true;
}
@ -132,7 +132,7 @@ class TupleAnnexStep : public JobStep, public TupleDeliveryStep
class Runner
{
public:
Runner(TupleAnnexStep* step) : fStep(step), id(0)
explicit Runner(TupleAnnexStep* step) : fStep(step), id(0)
{
}
Runner(TupleAnnexStep* step, uint32_t id) : fStep(step), id(id)
@ -178,7 +178,7 @@ class reservablePQ : private std::priority_queue<T>
{
public:
typedef typename std::priority_queue<T>::size_type size_type;
reservablePQ(size_type capacity = 0)
explicit reservablePQ(size_type capacity = 0)
{
reserve(capacity);
};
@ -193,4 +193,3 @@ class reservablePQ : private std::priority_queue<T>
};
} // namespace joblist

Some files were not shown because too many files have changed in this diff Show More