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

@ -36,7 +36,7 @@ class ObSqlExpression;
struct ExtBound {
OB_UNIS_VERSION_V(1);
public:
public:
ExtBound() : my_phy_plan_(NULL), is_preceding_(false), is_unbounded_(false), is_nmb_literal_(false), sql_expr_(NULL)
{
MEMSET(sql_exprs_, 0, sizeof(ObSqlExpression*) * BOUND_EXPR_MAX);
@ -52,7 +52,7 @@ struct ExtBound {
struct FuncInfo {
OB_UNIS_VERSION_V(1);
public:
public:
FuncInfo()
: my_phy_plan_(NULL),
func_type_(T_MAX),
@ -113,7 +113,7 @@ struct FuncInfo {
class ObWindowFunction : public ObSingleChildPhyOperator {
OB_UNIS_VERSION_V(1);
private:
private:
struct WinFrame {
WinFrame(const int64_t head = -1, const int64_t tail = -1) : head_(head), tail_(tail)
{}
@ -123,7 +123,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class IGetRow {
public:
public:
inline int at(const int64_t row_idx, const common::ObNewRow*& row)
{
int ret = common::OB_SUCCESS;
@ -138,7 +138,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
return ret;
}
protected:
protected:
virtual int inner_get_row(const int64_t row_idx, const common::ObNewRow*& row) = 0;
};
@ -146,7 +146,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
class RowsWrapper : public IGetRow {
friend class RowReader;
public:
public:
RowsWrapper() : rows_buf_(NULL /*allocator*/, true /*keep_projector*/), begin_idx_(0), row_cnt_(0)
{}
inline int add_row(const common::ObNewRow& row)
@ -175,30 +175,30 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
}
TO_STRING_KV(K_(begin_idx), K_(row_cnt));
private:
private:
virtual int inner_get_row(const int64_t row_idx, const common::ObNewRow*& row)
{
return rows_buf_.get_row(row_idx - begin_idx_, row);
}
private:
private:
ObRARowStore rows_buf_;
int64_t begin_idx_;
int64_t row_cnt_;
};
class RowReader : public IGetRow {
public:
public:
RowReader(RowsWrapper& rw) : rw_(rw), reader_(rw.rows_buf_)
{}
private:
private:
virtual int inner_get_row(const int64_t row_idx, const common::ObNewRow*& row)
{
return reader_.get_row(row_idx - rw_.begin_idx_, row);
}
private:
private:
RowsWrapper& rw_;
ObRARowStore::Reader reader_;
};
@ -219,7 +219,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class BaseFunc : public common::ObDLinkBase<BaseFunc> {
public:
public:
virtual ~BaseFunc()
{}
WinFrame last_valid_frame_;
@ -236,13 +236,13 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
}
TO_STRING_EMPTY();
protected:
protected:
virtual void reset_for_restart_self()
{}
};
class AggFunc : public BaseFunc {
public:
public:
virtual ~AggFunc();
int trans(const common::ObNewRow& row)
{
@ -270,7 +270,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
virtual int init_all_first();
TO_STRING_EMPTY();
protected:
protected:
virtual int trans_self(const common::ObNewRow& row);
virtual int inv_trans_self(const common::ObNewRow& row)
{
@ -281,7 +281,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
}
virtual void reset_for_restart_self();
private:
private:
bool prepare_;
ObAggregateFunction aggr_func_;
ObAggrExprList aggr_columns_;
@ -291,7 +291,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class NonAggFunc : public BaseFunc {
public:
public:
virtual int eval(RowReader& assist_reader, const int64_t row_idx, const common::ObNewRow& row,
const WinFrame& frame, common::ObObj& val) = 0;
virtual bool is_agg() const
@ -302,7 +302,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class NonAggFuncRowNumber : public NonAggFunc {
public:
public:
virtual int eval(RowReader& assist_reader, const int64_t row_idx, const common::ObNewRow& row,
const WinFrame& frame, common::ObObj& val);
virtual void reset_for_restart_self()
@ -310,7 +310,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class NonAggFuncNtile : public NonAggFunc {
public:
public:
virtual int eval(RowReader& assist_reader, const int64_t row_idx, const common::ObNewRow& row,
const WinFrame& frame, common::ObObj& val);
virtual void reset_for_restart_self()
@ -318,7 +318,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class NonAggFuncNthValue : public NonAggFunc {
public:
public:
virtual int eval(RowReader& assist_reader, const int64_t row_idx, const common::ObNewRow& row,
const WinFrame& frame, common::ObObj& val);
virtual void reset_for_restart_self()
@ -326,14 +326,14 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class NonAggFuncLeadOrLag : public NonAggFunc {
public:
public:
virtual int eval(RowReader& assist_reader, const int64_t row_idx, const common::ObNewRow& row,
const WinFrame& frame, common::ObObj& val);
virtual void reset_for_restart_self();
};
class NonAggFuncRankLike : public NonAggFunc {
public:
public:
virtual int eval(RowReader& assist_reader, const int64_t row_idx, const common::ObNewRow& row,
const WinFrame& frame, common::ObObj& val);
virtual void reset_for_restart_self();
@ -341,7 +341,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class NonAggFuncCumeDist : public NonAggFunc {
public:
public:
virtual int eval(RowReader& assist_reader, const int64_t row_idx, const common::ObNewRow& row,
const WinFrame& frame, common::ObObj& val);
virtual void reset_for_restart_self()
@ -349,7 +349,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class Utils {
public:
public:
static int copy_new_row(common::ObIAllocator& allocator, const common::ObNewRow& src, common::ObNewRow*& dst);
static int clone_cell(common::ObIAllocator& allocator, const common::ObObj& cell, common::ObObj& cell_clone);
static int convert_stored_row(const common::ObNewRow& stored_row, common::ObNewRow& row);
@ -363,7 +363,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
};
class FuncAllocer {
public:
public:
template <class FuncType>
int alloc(BaseFunc*& return_func);
common::ObIAllocator* local_allocator_;
@ -373,7 +373,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
friend class ObWindowFunction;
typedef common::ObDList<BaseFunc> BaseFuncList;
public:
public:
explicit ObWindowFunctionCtx(ObExecContext& ctx);
virtual ~ObWindowFunctionCtx()
{}
@ -405,11 +405,11 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
int input_first_row();
int compute(RowReader& assist_reader, BaseFunc* func, const int64_t row_idx, common::ObObj& val);
private:
private:
int parallel_winbuf_process();
int get_whole_msg(bool is_end, ObWinbufWholeMsg& whole, const ObNewRow* res_row = NULL);
private:
private:
RowsWrapper rw_;
BaseFuncList func_list_;
common::ObArenaAllocator local_allocator_;
@ -448,7 +448,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
bool finish_parallel_;
};
public:
public:
explicit ObWindowFunction(common::ObIAllocator& alloc);
virtual ~ObWindowFunction();
@ -474,7 +474,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
}
static int get_param_int_value(ObExprCtx& expr_ctx, const ObObj& tmp_obj, int64_t& value);
private:
private:
/**
* @brief init operator context, will create a physical operator context (and a current row space)
* @param ctx[in], execute context
@ -500,11 +500,11 @@ class ObWindowFunction : public ObSingleChildPhyOperator {
virtual int inner_close(ObExecContext& ctx) const;
virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const;
private:
private:
// disallow copy
DISALLOW_COPY_AND_ASSIGN(ObWindowFunction);
private:
private:
common::ObFixedArray<FuncInfo, common::ObIAllocator> func_infos_;
bool is_parallel_;
};

View File

@ -30,11 +30,11 @@ namespace sql {
struct WinFuncInfo {
OB_UNIS_VERSION_V(1);
public:
public:
struct ExtBound {
OB_UNIS_VERSION_V(1);
public:
public:
ExtBound()
: is_preceding_(false),
is_unbounded_(false),
@ -53,7 +53,7 @@ struct WinFuncInfo {
// b)
};
public:
public:
WinFuncInfo() : win_type_(WINDOW_MAX), func_type_(T_MAX), is_ignore_null_(false), is_from_first_(false), expr_(NULL)
{}
@ -109,28 +109,28 @@ struct WinFuncInfo {
typedef common::ObFixedArray<WinFuncInfo, common::ObIAllocator> WFInfoFixedArray;
class ObWindowFunctionSpec : public ObOpSpec {
public:
public:
OB_UNIS_VERSION_V(1);
public:
public:
ObWindowFunctionSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type)
: ObOpSpec(alloc, type), wf_infos_(alloc), all_expr_(alloc), is_parallel_(false)
{}
DECLARE_VIRTUAL_TO_STRING;
virtual int register_to_datahub(ObExecContext& ctx) const override;
public:
public:
WFInfoFixedArray wf_infos_;
ExprFixedArray all_expr_; // child output + all sort expr
bool is_parallel_;
private:
private:
// disallow copy
DISALLOW_COPY_AND_ASSIGN(ObWindowFunctionSpec);
};
class ObWindowFunctionOp : public ObOperator {
public:
public:
struct Frame {
Frame(const int64_t head = -1, const int64_t tail = -1) : head_(head), tail_(tail)
{}
@ -145,7 +145,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class RowsStore {
public:
public:
RowsStore() : rows_buf_(NULL /*allocator*/), begin_idx_(0), row_cnt_(0)
{}
~RowsStore()
@ -210,14 +210,14 @@ class ObWindowFunctionOp : public ObOperator {
}
TO_STRING_KV(K_(begin_idx), K_(row_cnt), K_(rows_buf));
public:
public:
ObRADatumStore rows_buf_;
int64_t begin_idx_;
int64_t row_cnt_;
};
class RowsReader {
public:
public:
RowsReader(RowsStore& rows_store) : rows_store_(rows_store), reader_(rows_store.rows_buf_)
{}
inline int get_row(const int64_t row_idx, const ObRADatumStore::StoredRow*& sr)
@ -235,13 +235,13 @@ class ObWindowFunctionOp : public ObOperator {
return ret;
}
private:
private:
RowsStore& rows_store_;
ObRADatumStore::Reader reader_;
};
class WinFuncCell : public common::ObDLinkBase<WinFuncCell> {
public:
public:
WinFuncCell(WinFuncInfo& wf_info, ObWindowFunctionOp& op)
: wf_info_(wf_info),
op_(op),
@ -262,11 +262,11 @@ class ObWindowFunctionOp : public ObOperator {
virtual bool is_aggr() const = 0;
VIRTUAL_TO_STRING_KV(K_(wf_idx), K_(wf_info), K_(part_first_row_idx), K_(part_rows_store), K_(last_valid_frame));
protected:
protected:
virtual void reset_for_restart_self()
{}
public:
public:
WinFuncInfo& wf_info_;
ObWindowFunctionOp& op_;
@ -279,7 +279,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class AggrCell : public WinFuncCell {
public:
public:
AggrCell(WinFuncInfo& wf_info, ObWindowFunctionOp& op, ObIArray<ObAggrInfo>& aggr_infos)
: WinFuncCell(wf_info, op),
finish_prepared_(false),
@ -321,7 +321,7 @@ class ObWindowFunctionOp : public ObOperator {
}
DECLARE_VIRTUAL_TO_STRING;
protected:
protected:
virtual int trans_self(const ObRADatumStore::StoredRow& row);
virtual int inv_trans_self(const ObRADatumStore::StoredRow& row)
{
@ -338,7 +338,7 @@ class ObWindowFunctionOp : public ObOperator {
got_result_ = false;
}
public:
public:
bool finish_prepared_;
ObAggregateProcessor aggr_processor_;
ObDatum result_;
@ -346,7 +346,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class NonAggrCell : public WinFuncCell {
public:
public:
NonAggrCell(WinFuncInfo& wf_info, ObWindowFunctionOp& op) : WinFuncCell(wf_info, op)
{}
virtual int eval(RowsReader& assist_reader, const int64_t row_idx, const ObRADatumStore::StoredRow& row,
@ -358,7 +358,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class NonAggrCellRowNumber : public NonAggrCell {
public:
public:
NonAggrCellRowNumber(WinFuncInfo& wf_info, ObWindowFunctionOp& op) : NonAggrCell(wf_info, op)
{}
virtual int eval(RowsReader& assist_reader, const int64_t row_idx, const ObRADatumStore::StoredRow& row,
@ -366,7 +366,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class NonAggrCellNtile : public NonAggrCell {
public:
public:
NonAggrCellNtile(WinFuncInfo& wf_info, ObWindowFunctionOp& op) : NonAggrCell(wf_info, op)
{}
virtual int eval(RowsReader& assist_reader, const int64_t row_idx, const ObRADatumStore::StoredRow& row,
@ -374,7 +374,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class NonAggrCellNthValue : public NonAggrCell {
public:
public:
NonAggrCellNthValue(WinFuncInfo& wf_info, ObWindowFunctionOp& op) : NonAggrCell(wf_info, op)
{}
virtual int eval(RowsReader& assist_reader, const int64_t row_idx, const ObRADatumStore::StoredRow& row,
@ -382,7 +382,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class NonAggrCellLeadOrLag : public NonAggrCell {
public:
public:
NonAggrCellLeadOrLag(WinFuncInfo& wf_info, ObWindowFunctionOp& op) : NonAggrCell(wf_info, op)
{}
virtual int eval(RowsReader& assist_reader, const int64_t row_idx, const ObRADatumStore::StoredRow& row,
@ -390,7 +390,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class NonAggrCellRankLike : public NonAggrCell {
public:
public:
NonAggrCellRankLike(WinFuncInfo& wf_info, ObWindowFunctionOp& op) : NonAggrCell(wf_info, op), rank_of_prev_row_(0)
{}
virtual int eval(RowsReader& assist_reader, const int64_t row_idx, const ObRADatumStore::StoredRow& row,
@ -405,7 +405,7 @@ class ObWindowFunctionOp : public ObOperator {
};
class NonAggrCellCumeDist : public NonAggrCell {
public:
public:
NonAggrCellCumeDist(WinFuncInfo& wf_info, ObWindowFunctionOp& op) : NonAggrCell(wf_info, op)
{}
virtual int eval(RowsReader& assist_reader, const int64_t row_idx, const ObRADatumStore::StoredRow& row,
@ -415,13 +415,13 @@ class ObWindowFunctionOp : public ObOperator {
typedef common::ObDList<WinFuncCell> WinFuncCellList;
class FuncAllocer {
public:
public:
template <class FuncType>
int alloc(WinFuncCell*& return_func, WinFuncInfo& wf_info, ObWindowFunctionOp& op, const int64_t tenant_id);
common::ObIAllocator* local_allocator_;
};
public:
public:
ObWindowFunctionOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input)
: ObOperator(exec_ctx, spec, input),
local_allocator_(),
@ -444,7 +444,7 @@ class ObWindowFunctionOp : public ObOperator {
virtual int inner_get_next_row() override;
virtual void destroy() override;
protected:
protected:
int init();
inline int reset_for_scan(const int64_t tenant_id)
@ -484,11 +484,11 @@ class ObWindowFunctionOp : public ObOperator {
int get_whole_msg(bool is_end, ObWinbufWholeMsg& whole, const ObRADatumStore::StoredRow* row = NULL);
int copy_datum_row(const ObRADatumStore::StoredRow& row, ObWinbufPieceMsg& piece, int64_t buf_len, char* buf);
private:
private:
// disallow copy
DISALLOW_COPY_AND_ASSIGN(ObWindowFunctionOp);
private:
private:
common::ObArenaAllocator local_allocator_;
RowsStore rows_store_;