reformat source code

according to code styles, 'AccessModifierOffset' should be -2.
This commit is contained in:
gm
2021-06-16 15:48:42 +08:00
committed by MizuhaHimuraki
parent 8c4a2f26a6
commit 4a92b6d7df
3314 changed files with 23131 additions and 23401 deletions

View File

@ -20,7 +20,7 @@ using namespace common;
namespace sql {
class ObAppend::ObAppendCtx : public ObPhyOperatorCtx {
public:
public:
explicit ObAppendCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), current_child_op_idx_(0)
{}
~ObAppendCtx()
@ -30,7 +30,7 @@ class ObAppend::ObAppendCtx : public ObPhyOperatorCtx {
ObPhyOperatorCtx::destroy_base();
}
public:
public:
int64_t current_child_op_idx_;
};

View File

@ -21,7 +21,7 @@
namespace oceanbase {
namespace sql {
class ObAppend : public ObMultiChildrenPhyOperator {
public:
public:
class ObAppendCtx;
explicit ObAppend(common::ObIAllocator& alloc);
~ObAppend();

View File

@ -21,17 +21,17 @@ class ObExecContext;
class ObAppendSpec : public ObOpSpec {
OB_UNIS_VERSION(1);
public:
public:
ObAppendSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type)
{}
virtual ~ObAppendSpec(){};
private:
private:
DISALLOW_COPY_AND_ASSIGN(ObAppendSpec);
};
class ObAppendOp : public ObOperator {
public:
public:
ObAppendOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input)
: ObOperator(exec_ctx, spec, input), current_child_op_idx_(0)
{}
@ -57,10 +57,10 @@ class ObAppendOp : public ObOperator {
*/
int get_next_row();
public:
public:
int64_t current_child_op_idx_;
private:
private:
DISALLOW_COPY_AND_ASSIGN(ObAppendOp);
};

View File

@ -26,7 +26,7 @@ class ObHashExcept::ObHashExceptCtx : public ObHashSetOperatorCtx {
~ObHashExceptCtx()
{}
private:
private:
DISALLOW_COPY_AND_ASSIGN(ObHashExceptCtx);
friend class ObHashExcept;
};

View File

@ -18,15 +18,15 @@
namespace oceanbase {
namespace sql {
class ObHashExcept : public ObHashSetOperator {
private:
private:
class ObHashExceptCtx;
public:
public:
explicit ObHashExcept(common::ObIAllocator& alloc);
virtual ~ObHashExcept();
private:
private:
int build_hash_table_by_part(ObExecContext& ctx, ObHashExceptCtx* except_ctx) const;
virtual int inner_create_operator_ctx(ObExecContext& ctx, ObPhyOperatorCtx*& op_ctx) const;

View File

@ -21,12 +21,12 @@ namespace sql {
class ObHashExceptSpec : public ObHashSetSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObHashExceptSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
};
class ObHashExceptOp : public ObHashSetOp {
public:
public:
ObHashExceptOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input);
~ObHashExceptOp()
{}
@ -37,7 +37,7 @@ class ObHashExceptOp : public ObHashSetOp {
virtual int rescan() override;
virtual void destroy() override;
private:
private:
int build_hash_table_by_part();
};

View File

@ -26,7 +26,7 @@ class ObHashIntersect::ObHashIntersectCtx : public ObHashSetOperatorCtx {
~ObHashIntersectCtx()
{}
private:
private:
DISALLOW_COPY_AND_ASSIGN(ObHashIntersectCtx);
friend class ObHashIntersect;
};

View File

@ -18,15 +18,15 @@
namespace oceanbase {
namespace sql {
class ObHashIntersect : public ObHashSetOperator {
private:
private:
class ObHashIntersectCtx;
public:
public:
explicit ObHashIntersect(common::ObIAllocator& alloc);
virtual ~ObHashIntersect();
private:
private:
int build_hash_table_by_part(ObExecContext& ctx, ObHashIntersectCtx* intersect_ctx) const;
int get_next_group_part(ObExecContext& ctx, ObHashIntersectCtx* intersect_ctx) const;
virtual int inner_create_operator_ctx(ObExecContext& ctx, ObPhyOperatorCtx*& op_ctx) const;

View File

@ -21,12 +21,12 @@ namespace sql {
class ObHashIntersectSpec : public ObHashSetSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObHashIntersectSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
};
class ObHashIntersectOp : public ObHashSetOp {
public:
public:
ObHashIntersectOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input);
~ObHashIntersectOp()
{}
@ -37,7 +37,7 @@ class ObHashIntersectOp : public ObHashSetOp {
virtual int rescan() override;
virtual void destroy() override;
private:
private:
int build_hash_table_by_part();
};

View File

@ -24,7 +24,7 @@ namespace sql {
class ObHashSetSpec : public ObSetSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObHashSetSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
INHERIT_TO_STRING_KV("op_spec", ObSetSpec, K_(hash_funcs));
@ -32,7 +32,7 @@ class ObHashSetSpec : public ObSetSpec {
};
class ObHashSetOp : public ObOperator {
public:
public:
ObHashSetOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input);
~ObHashSetOp()
{}
@ -42,7 +42,7 @@ class ObHashSetOp : public ObOperator {
virtual int rescan() override;
virtual void destroy() override;
protected:
protected:
void reset();
int is_left_has_row(bool& left_has_row);
int get_left_row();
@ -51,7 +51,7 @@ class ObHashSetOp : public ObOperator {
int init_hash_partition_infras();
int convert_row(const common::ObIArray<ObExpr*>& src_exprs, const common::ObIArray<ObExpr*>& dst_exprs);
protected:
protected:
// used by intersect and except
bool first_get_left_;
bool has_got_part_;

View File

@ -23,9 +23,9 @@ namespace sql {
class ObHashSetOperator : public ObSetOperator {
OB_UNIS_VERSION_V(1);
protected:
protected:
class HashCols {
public:
public:
explicit HashCols() : row_(NULL), col_collation_(NULL)
{}
~HashCols()
@ -34,13 +34,13 @@ class ObHashSetOperator : public ObSetOperator {
uint64_t hash() const;
bool operator==(const HashCols& other) const;
public:
public:
const common::ObNewRow* row_;
const common::ObIArray<common::ObCollationType>* col_collation_;
};
class ObHashSetOperatorCtx : public ObPhyOperatorCtx {
public:
public:
static const int64_t MIN_BUCKET_COUNT = 10000;
static const int64_t MAX_BUCKET_COUNT = 500000;
static const int64_t HASH_SET_BUCKET_RATIO = 10;
@ -69,11 +69,11 @@ class ObHashSetOperator : public ObSetOperator {
int is_left_has_row(ObExecContext& ctx, bool& left_has_row);
int get_left_row(ObExecContext& ctx, const common::ObNewRow*& cur_row);
private:
private:
DISALLOW_COPY_AND_ASSIGN(ObHashSetOperatorCtx);
friend class ObHashSetOperator;
protected:
protected:
// used by intersect and except
bool first_get_left_;
bool has_got_part_;
@ -85,13 +85,13 @@ class ObHashSetOperator : public ObSetOperator {
ObBasicHashPartInfrastructure<HashPartCols, ObPartStoredRow> hp_infras_;
};
public:
public:
explicit ObHashSetOperator(common::ObIAllocator& alloc);
~ObHashSetOperator();
virtual int rescan(ObExecContext& ctx) const;
protected:
protected:
virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const;
int build_hash_table(ObExecContext& ctx, bool from_child) const;
@ -100,7 +100,7 @@ class ObHashSetOperator : public ObSetOperator {
virtual int inner_close(ObExecContext& ctx) const;
virtual int init_hash_partition_infras(ObExecContext& ctx) const;
private:
private:
DISALLOW_COPY_AND_ASSIGN(ObHashSetOperator);
};

View File

@ -18,17 +18,17 @@ using namespace common;
namespace sql {
class ObHashUnion::ObHashUnionCtx : public ObHashSetOperatorCtx {
public:
public:
explicit ObHashUnionCtx(ObExecContext& ctx) : ObHashSetOperatorCtx(ctx), cur_child_op_(NULL), is_left_child_(true)
{}
virtual ~ObHashUnionCtx()
{}
private:
private:
DISALLOW_COPY_AND_ASSIGN(ObHashUnionCtx);
protected:
protected:
ObPhyOperator* cur_child_op_;
bool is_left_child_;

View File

@ -18,16 +18,16 @@
namespace oceanbase {
namespace sql {
class ObHashUnion : public ObHashSetOperator {
private:
private:
class ObHashUnionCtx;
public:
public:
explicit ObHashUnion(common::ObIAllocator& alloc);
virtual ~ObHashUnion();
virtual int rescan(ObExecContext& ctx) const;
private:
private:
virtual int inner_create_operator_ctx(ObExecContext& ctx, ObPhyOperatorCtx*& op_ctx) const;
virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const;

View File

@ -21,12 +21,12 @@ namespace sql {
class ObHashUnionSpec : public ObHashSetSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObHashUnionSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
};
class ObHashUnionOp : public ObHashSetOp {
public:
public:
ObHashUnionOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input);
~ObHashUnionOp()
{}
@ -37,10 +37,10 @@ class ObHashUnionOp : public ObHashSetOp {
virtual int rescan() override;
virtual void destroy() override;
private:
private:
int get_child_next_row();
private:
private:
ObOperator* cur_child_op_;
bool is_left_child_;
};

View File

@ -23,7 +23,7 @@ using namespace common;
namespace sql {
class ObMergeExcept::ObMergeExceptCtx : public ObMergeSetOperatorCtx {
public:
public:
explicit ObMergeExceptCtx(ObExecContext& ctx) : ObMergeSetOperatorCtx(ctx), right_iter_end_(false), right_row_(NULL)
{
need_skip_init_row_ = true;
@ -42,7 +42,7 @@ class ObMergeExcept::ObMergeExceptCtx : public ObMergeSetOperatorCtx {
ObMergeSetOperatorCtx::destroy();
}
private:
private:
bool right_iter_end_;
const ObNewRow* right_row_;
friend class ObMergeExcept;

View File

@ -19,10 +19,10 @@
namespace oceanbase {
namespace sql {
class ObMergeExcept : public ObMergeSetOperator {
private:
private:
class ObMergeExceptCtx;
public:
public:
explicit ObMergeExcept(common::ObIAllocator& alloc);
virtual ~ObMergeExcept();
virtual int rescan(ObExecContext& ctx) const;
@ -31,7 +31,7 @@ class ObMergeExcept : public ObMergeSetOperator {
virtual void set_distinct(bool is_distinct);
private:
private:
int distinct_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const;
int all_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const;
/**
@ -60,7 +60,7 @@ class ObMergeExcept : public ObMergeSetOperator {
*/
virtual int inner_close(ObExecContext& ctx) const;
private:
private:
typedef int (ObMergeExcept::*GetNextRowFunc)(ObExecContext& ctx, const common::ObNewRow*& row) const;
GetNextRowFunc get_next_row_func_;
DISALLOW_COPY_AND_ASSIGN(ObMergeExcept);

View File

@ -21,12 +21,12 @@ namespace sql {
class ObMergeExceptSpec : public ObMergeSetSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObMergeExceptSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
};
class ObMergeExceptOp : public ObMergeSetOp {
public:
public:
ObMergeExceptOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input);
virtual int inner_open() override;
@ -35,7 +35,7 @@ class ObMergeExceptOp : public ObMergeSetOp {
virtual void destroy() override;
virtual int inner_get_next_row() override;
private:
private:
bool right_iter_end_;
bool first_got_right_row_;
};

View File

@ -19,7 +19,7 @@ using namespace common;
namespace sql {
class ObMergeIntersect::ObMergeIntersectCtx : public ObMergeSetOperatorCtx {
public:
public:
explicit ObMergeIntersectCtx(ObExecContext& ctx)
: ObMergeSetOperatorCtx(ctx), right_iter_end_(false), right_row_(NULL)
{
@ -39,7 +39,7 @@ class ObMergeIntersect::ObMergeIntersectCtx : public ObMergeSetOperatorCtx {
ObMergeSetOperatorCtx::destroy();
}
private:
private:
bool right_iter_end_;
const ObNewRow* right_row_;

View File

@ -19,10 +19,10 @@
namespace oceanbase {
namespace sql {
class ObMergeIntersect : public ObMergeSetOperator {
private:
private:
class ObMergeIntersectCtx;
public:
public:
explicit ObMergeIntersect(common::ObIAllocator& alloc);
virtual ~ObMergeIntersect();
virtual int rescan(ObExecContext& ctx) const;
@ -31,7 +31,7 @@ class ObMergeIntersect : public ObMergeSetOperator {
virtual void set_distinct(bool is_distinct);
private:
private:
int distinct_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const;
int all_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const;
/**
@ -60,7 +60,7 @@ class ObMergeIntersect : public ObMergeSetOperator {
*/
virtual int inner_close(ObExecContext& ctx) const;
private:
private:
typedef int (ObMergeIntersect::*GetNextRowFunc)(ObExecContext& ctx, const common::ObNewRow*& row) const;
GetNextRowFunc get_next_row_func_;
DISALLOW_COPY_AND_ASSIGN(ObMergeIntersect);

View File

@ -21,12 +21,12 @@ namespace sql {
class ObMergeIntersectSpec : public ObMergeSetSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObMergeIntersectSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
};
class ObMergeIntersectOp : public ObMergeSetOp {
public:
public:
ObMergeIntersectOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input);
virtual int inner_open() override;
@ -35,7 +35,7 @@ class ObMergeIntersectOp : public ObMergeSetOp {
virtual void destroy() override;
virtual int inner_get_next_row() override;
private:
private:
bool right_iter_end_;
bool first_got_right_row_;
};

View File

@ -23,12 +23,12 @@ namespace sql {
class ObMergeSetSpec : public ObSetSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObMergeSetSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
};
class ObMergeSetOp : public ObOperator {
public:
public:
ObMergeSetOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input);
virtual int inner_open() override;
@ -36,7 +36,7 @@ class ObMergeSetOp : public ObOperator {
virtual int rescan() override;
virtual void destroy() override;
class Compare {
public:
public:
Compare() : sort_collations_(nullptr), cmp_funcs_(nullptr), ret_code_(common::OB_SUCCESS)
{}
int init(const common::ObIArray<ObSortFieldCollation>* sort_collations,
@ -50,7 +50,7 @@ class ObMergeSetOp : public ObOperator {
int ret_code_;
};
protected:
protected:
int do_strict_distinct(ObOperator& child_op, const common::ObIArray<ObExpr*>& compare_row,
const common::ObIArray<ObExpr*>*& row, int& cmp);
template <typename T>
@ -68,7 +68,7 @@ class ObMergeSetOp : public ObOperator {
need_skip_init_row_ = need_skip_init_row;
}
protected:
protected:
common::ObArenaAllocator alloc_;
ObChunkDatumStore::LastStoredRow<> last_row_;
Compare cmp_;

View File

@ -26,9 +26,9 @@ enum ObCTEPseudoColumn { CTE_SEARCH = 0, CTE_CYCLE = 1, CTE_PSEUDO_COLUMN_CNT =
class ObMergeSetOperator : public ObSetOperator {
OB_UNIS_VERSION_V(1);
protected:
protected:
class ObMergeSetOperatorCtx : public ObPhyOperatorCtx {
public:
public:
explicit ObMergeSetOperatorCtx(ObExecContext& ctx)
: ObPhyOperatorCtx(ctx), last_output_row_(), last_row_buf_(nullptr), need_skip_init_row_(false)
{}
@ -92,14 +92,14 @@ class ObMergeSetOperator : public ObSetOperator {
need_skip_init_row_ = b;
}
protected:
protected:
common::ObNewRow last_output_row_;
void* last_row_buf_;
static const int64_t OB_ROW_BUF_SIZE;
bool need_skip_init_row_;
};
public:
public:
explicit ObMergeSetOperator(common::ObIAllocator& alloc);
~ObMergeSetOperator();
virtual void reset();
@ -111,7 +111,7 @@ class ObMergeSetOperator : public ObSetOperator {
int init_cte_pseudo_column();
int set_map_array(const ObIArray<int64_t>& map_array);
protected:
protected:
int init_set_directions(int64_t count);
int strict_compare(const common::ObNewRow& row1, const common::ObNewRow& row2, int& cmp) const;
int strict_compare(const common::ObNewRow& row1, const common::ObNewRow& row2, bool& equal) const;
@ -149,10 +149,10 @@ class ObMergeSetOperator : public ObSetOperator {
// disallow copy
DISALLOW_COPY_AND_ASSIGN(ObMergeSetOperator);
public:
public:
static const int64_t UNUSED_POS;
protected:
protected:
static const int32_t CMP_DIRECTION_ASC = 1;
static const int32_t CMP_DIRECTION_DESC = -1;
common::ObFixedArray<int32_t, common::ObIAllocator> set_directions_;

View File

@ -27,7 +27,7 @@ namespace sql {
// REGISTER_PHY_OPERATOR(ObMergeUnion, PHY_MERGE_UNION);
class ObMergeUnion::ObMergeUnionCtx : public ObMergeSetOperatorCtx {
public:
public:
explicit ObMergeUnionCtx(ObExecContext& ctx)
: ObMergeSetOperatorCtx(ctx),
cur_child_op_(NULL),
@ -41,7 +41,7 @@ class ObMergeUnion::ObMergeUnionCtx : public ObMergeSetOperatorCtx {
ObMergeSetOperatorCtx::destroy();
}
private:
private:
ObPhyOperator* cur_child_op_;
int64_t next_child_op_idx_;
bool got_first_row_;

View File

@ -21,10 +21,10 @@ class ObNewRow;
}
namespace sql {
class ObMergeUnion : public ObMergeSetOperator {
private:
private:
class ObMergeUnionCtx;
public:
public:
explicit ObMergeUnion(common::ObIAllocator& alloc);
virtual ~ObMergeUnion();
virtual void reset();
@ -33,7 +33,7 @@ class ObMergeUnion : public ObMergeSetOperator {
virtual void set_distinct(bool is_distinct);
private:
private:
int get_first_row(ObExecContext& ctx, ObMergeUnionCtx& union_ctx, const common::ObNewRow*& row) const;
/**
* @brief get next row expected the same row in the same group
@ -78,7 +78,7 @@ class ObMergeUnion : public ObMergeSetOperator {
typedef int (ObMergeUnion::*GetNextRowFunc)(ObExecContext& ctx, const common::ObNewRow*& row) const;
private:
private:
GetNextRowFunc get_next_row_func_;
DISALLOW_COPY_AND_ASSIGN(ObMergeUnion);
};

View File

@ -21,12 +21,12 @@ namespace sql {
class ObMergeUnionSpec : public ObMergeSetSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObMergeUnionSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
};
class ObMergeUnionOp : public ObMergeSetOp {
public:
public:
ObMergeUnionOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input);
virtual int inner_open() override;
@ -35,12 +35,12 @@ class ObMergeUnionOp : public ObMergeSetOp {
virtual void destroy() override;
virtual int inner_get_next_row() override;
private:
private:
int get_first_row(const ObIArray<ObExpr*>*& output_row);
int distinct_get_next_row();
int all_get_next_row();
private:
private:
typedef int (ObMergeUnionOp::*GetNextRowFunc)();
ObOperator* cur_child_op_;
ObOperator* candidate_child_op_;

View File

@ -22,7 +22,7 @@ namespace sql {
class ObSetSpec : public ObOpSpec {
OB_UNIS_VERSION_V(1);
public:
public:
ObSetSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
INHERIT_TO_STRING_KV("op_spec", ObOpSpec, K_(is_distinct), K_(sort_collations));

View File

@ -19,7 +19,7 @@
namespace oceanbase {
namespace sql {
class ObSetOperator : public ObPhyOperator {
public:
public:
ObSetOperator();
explicit ObSetOperator(common::ObIAllocator& alloc);
~ObSetOperator();
@ -31,7 +31,7 @@ class ObSetOperator : public ObPhyOperator {
bool is_distinct() const;
int add_collation_type(common::ObCollationType cs_type);
protected:
protected:
int init_collation_types(int64_t count);
/**
@ -61,7 +61,7 @@ class ObSetOperator : public ObPhyOperator {
// disallow copy
DISALLOW_COPY_AND_ASSIGN(ObSetOperator);
protected:
protected:
bool distinct_;
common::ObFixedArray<common::ObCollationType, common::ObIAllocator> cs_types_;
int32_t child_num_;