diff --git a/.clang-format b/.clang-format index 7ce4de332..6bf5c1bb4 100644 --- a/.clang-format +++ b/.clang-format @@ -2,7 +2,7 @@ Language: Cpp # BasedOnStyle: LLVM SortIncludes: false -AccessModifierOffset: -4 +AccessModifierOffset: -2 AlignAfterOpenBracket: DontAlign AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false diff --git a/deps/easy/src/packet/easy_tbnet.h b/deps/easy/src/packet/easy_tbnet.h index 450f4efb5..e219852d6 100644 --- a/deps/easy/src/packet/easy_tbnet.h +++ b/deps/easy/src/packet/easy_tbnet.h @@ -43,7 +43,7 @@ static uint64_t addrv_to_server_id(easy_addr_t addr) class IServerAdapter; class Transport; class DataBuffer { - public: +public: DataBuffer(easy_buf_t* pb) { b = pb; @@ -180,7 +180,7 @@ class DataBuffer { return true; } - private: +private: easy_pool_t* pool; easy_list_t* l; easy_buf_t* b; @@ -188,14 +188,14 @@ class DataBuffer { }; class PacketHeader { - public: +public: uint32_t _chid; int _pcode; int _dataLen; }; class Packet { - public: +public: Packet() { memset(&_packetHeader, 0, sizeof(PacketHeader)); @@ -241,13 +241,13 @@ class Packet { virtual bool encode(DataBuffer* output) = 0; virtual bool decode(DataBuffer* input, PacketHeader* header) = 0; - public: +public: PacketHeader _packetHeader; easy_request_t* r; }; class ControlPacket : public Packet { - public: +public: enum { CMD_BAD_PACKET = 1, CMD_TIMEOUT_PACKET, CMD_DISCONN_PACKET }; ControlPacket(int c) : _command(c) {} @@ -268,12 +268,12 @@ class ControlPacket : public Packet { return false; } - private: +private: int _command; }; class IOComponent { - public: +public: IOComponent() {} ~IOComponent() @@ -283,12 +283,12 @@ class IOComponent { this->l = l; } - private: +private: easy_listen_t* l; }; class IPacketFactory { - public: +public: IPacketFactory() { flag = 0x416e4574; @@ -304,7 +304,7 @@ class IPacketFactory { class IPacketStreamer { - public: +public: IPacketStreamer() { _factory = NULL; @@ -410,12 +410,12 @@ class IPacketStreamer { return EASY_OK; } - protected: +protected: IPacketFactory* _factory; }; class IPacketHandler { - public: +public: enum HPRetCode { KEEP_CHANNEL = 0, // easy_ok CLOSE_CHANNEL = -1, // easy_error @@ -482,13 +482,13 @@ class IPacketHandler { {} virtual HPRetCode handlePacket(Packet* packet, void* args) = 0; - protected: +protected: IPacketStreamer* client_streamer; easy_io_handler_pt client_handler; }; class PacketQueue { - public: +public: PacketQueue(easy_message_t* pm) { m = pm; @@ -502,7 +502,7 @@ class PacketQueue { class Connection { - public: +public: Connection() {} Connection(easy_connection_t* c, easy_request_t* r) @@ -565,14 +565,14 @@ class Connection { return htons(((addr.addr >> 32) & 0xffff)); } - protected: +protected: easy_addr_t addr; easy_connection_t* c; easy_request_t* r; }; class IServerAdapter { - public: +public: IServerAdapter() { memset(&server_handler, 0, sizeof(easy_io_handler_pt)); @@ -646,14 +646,14 @@ class IServerAdapter { return false; } - protected: +protected: IPacketStreamer* server_streamer; easy_io_handler_pt server_handler; }; class DefaultPacketStreamer : public IPacketStreamer { - public: +public: DefaultPacketStreamer() {} @@ -673,7 +673,7 @@ class DefaultPacketStreamer : public IPacketStreamer { class Transport { - public: +public: Transport() { _eio = easy_eio_create(NULL, 1); @@ -742,19 +742,19 @@ class Transport { return _eio; } - private: +private: easy_io_t* _eio; }; class IPacketQueueHandler { - public: +public: virtual ~IPacketQueueHandler() {} virtual bool handlePacketQueue(Packet* packet, void* args) = 0; }; class PacketQueueThread { - public: +public: PacketQueueThread() { _threadPool = NULL; @@ -794,13 +794,13 @@ class PacketQueueThread { return easy_thread_pool_push_message(_threadPool, queue.m, (int64_t)(long)queue.m); } - private: +private: IPacketQueueHandler* _handler; easy_thread_pool_t* _threadPool; }; class ConnectionManager { - public: +public: ConnectionManager(Transport* transport, IPacketStreamer* streamer, IPacketHandler* packetHandler) { _transport = transport; @@ -871,7 +871,7 @@ class ConnectionManager { return true; } - private: +private: Transport* _transport; IPacketHandler* _packetHandler; easy_client_t* _cl; diff --git a/deps/oblib/src/common/cell/ob_cell_reader.h b/deps/oblib/src/common/cell/ob_cell_reader.h index 4eda432fe..d92fda072 100644 --- a/deps/oblib/src/common/cell/ob_cell_reader.h +++ b/deps/oblib/src/common/cell/ob_cell_reader.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObCellReader { - public: +public: ObCellReader(); virtual ~ObCellReader() {} @@ -38,7 +38,7 @@ class ObCellReader { } int read_cell(common::ObObj& obj); - private: +private: inline int read_oracle_timestamp( const ObObjType obj_type, const uint8_t meta_attr, const ObOTimestampMetaAttrType otmat, ObObj& obj); int read_interval_ds(ObObj& obj); @@ -49,7 +49,7 @@ class ObCellReader { int read(const T*& ptr); inline int is_es_end_object(const common::ObObj& obj, bool& is_end_obj); - private: +private: const char* buf_; int64_t buf_size_; int64_t pos_; diff --git a/deps/oblib/src/common/cell/ob_cell_writer.h b/deps/oblib/src/common/cell/ob_cell_writer.h index cfa1af8fd..86ff5c917 100644 --- a/deps/oblib/src/common/cell/ob_cell_writer.h +++ b/deps/oblib/src/common/cell/ob_cell_writer.h @@ -36,7 +36,7 @@ enum ObCompactStoreType { const uint8_t TEXT_CELL_META_VERSION = 1; class ObCellWriter { - public: +public: struct CellMeta { static const uint64_t SF_BIT_TYPE = 6; static const uint64_t SF_BIT_ATTR = 2; @@ -66,7 +66,7 @@ class ObCellWriter { EV_LOCK_ROW = 5 }; - public: +public: ObCellWriter(); virtual ~ObCellWriter() {} @@ -111,7 +111,7 @@ class ObCellWriter { return true; } - private: +private: template int append(const T& value); inline int write_int(const ObObj& obj, const enum common::ObObjType meta_type, const int64_t value); @@ -133,7 +133,7 @@ class ObCellWriter { return old_text_format_; } - private: +private: char* buf_; int64_t buf_size_; int64_t pos_; diff --git a/deps/oblib/src/common/data_buffer.h b/deps/oblib/src/common/data_buffer.h index 90f2f9bae..70592c0f0 100644 --- a/deps/oblib/src/common/data_buffer.h +++ b/deps/oblib/src/common/data_buffer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class ObDataBuffer : public ObIAllocator { - public: +public: ObDataBuffer() : data_(NULL), capacity_(0), position_(0), limit_(0) {} @@ -138,7 +138,7 @@ class ObDataBuffer : public ObIAllocator { OB_UNIS_VERSION(1); - protected: +protected: char* data_; int64_t capacity_; int64_t position_; diff --git a/deps/oblib/src/common/log/ob_direct_log_reader.h b/deps/oblib/src/common/log/ob_direct_log_reader.h index 01743f618..38f80b19b 100644 --- a/deps/oblib/src/common/log/ob_direct_log_reader.h +++ b/deps/oblib/src/common/log/ob_direct_log_reader.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObDirectLogReader : public ObSingleLogReader { - public: +public: ObDirectLogReader(); virtual ~ObDirectLogReader(); diff --git a/deps/oblib/src/common/log/ob_log_cursor.h b/deps/oblib/src/common/log/ob_log_cursor.h index f8cb191d9..059457e0c 100644 --- a/deps/oblib/src/common/log/ob_log_cursor.h +++ b/deps/oblib/src/common/log/ob_log_cursor.h @@ -44,7 +44,7 @@ struct ObLogCursor { ObLogCursor& set_cursor(ObLogCursor& cursor, const int64_t file_id, const int64_t log_id, const int64_t offset); class ObAtomicLogCursor { - public: +public: ObAtomicLogCursor() {} ~ObAtomicLogCursor() @@ -52,7 +52,7 @@ class ObAtomicLogCursor { int get_cursor(ObLogCursor& cursor) const; int set_cursor(ObLogCursor& cursor); - private: +private: ObLogCursor log_cursor_; mutable common::SpinRWLock cursor_lock_; }; diff --git a/deps/oblib/src/common/log/ob_log_data_writer.h b/deps/oblib/src/common/log/ob_log_data_writer.h index 36cc65070..b0c02dd44 100644 --- a/deps/oblib/src/common/log/ob_log_data_writer.h +++ b/deps/oblib/src/common/log/ob_log_data_writer.h @@ -22,7 +22,7 @@ namespace common { int myfallocate(int fd, int mode, off_t offset, off_t len); class MinAvailFileIdGetter { - public: +public: MinAvailFileIdGetter() {} virtual ~MinAvailFileIdGetter() @@ -31,12 +31,12 @@ class MinAvailFileIdGetter { }; class ObLogDataWriter { - public: +public: static const int OPEN_FLAG = O_WRONLY | O_DIRECT; static const int OPEN_MODE = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; static const int CREATE_FLAG = OPEN_FLAG | O_CREAT; class AppendBuffer { - public: + public: static const int64_t DEFAULT_BUF_SIZE = 1 << 22; AppendBuffer(); ~AppendBuffer(); @@ -44,14 +44,14 @@ class ObLogDataWriter { int flush(int fd); void destroy(); - private: + private: int64_t file_pos_; char* buf_; int64_t buf_end_; int64_t buf_limit_; }; - public: +public: ObLogDataWriter(); ~ObLogDataWriter(); int init(const char* log_dir, const int64_t file_size, const int64_t du_percent, const int64_t log_sync_type, @@ -67,13 +67,13 @@ class ObLogDataWriter { } int64_t to_string(char* buf, const int64_t len) const; - protected: +protected: int check_eof_after_log_cursor(const ObLogCursor& cursor); int prepare_fd(const int64_t file_id); int reuse(const char* pool_file, const char* fname); const char* select_pool_file(char* fname, const int64_t limit); - private: +private: AppendBuffer write_buffer_; const char* log_dir_; int64_t file_size_; diff --git a/deps/oblib/src/common/log/ob_log_dir_scanner.h b/deps/oblib/src/common/log/ob_log_dir_scanner.h index 63e226988..75bf39f6d 100644 --- a/deps/oblib/src/common/log/ob_log_dir_scanner.h +++ b/deps/oblib/src/common/log/ob_log_dir_scanner.h @@ -30,7 +30,7 @@ struct ObSimpleLogFile { }; class ObLogDirScanner { - public: +public: ObLogDirScanner(); virtual ~ObLogDirScanner(); @@ -66,7 +66,7 @@ class ObLogDirScanner { bool has_ckpt() const; void reset(); - private: +private: /** * Find all log files under directory */ @@ -90,7 +90,7 @@ class ObLogDirScanner { DISALLOW_COPY_AND_ASSIGN(ObLogDirScanner); - private: +private: uint64_t min_log_id_; uint64_t max_log_id_; uint64_t max_ckpt_id_; diff --git a/deps/oblib/src/common/log/ob_log_generator.cpp b/deps/oblib/src/common/log/ob_log_generator.cpp index 5c67b4745..6f6fff101 100644 --- a/deps/oblib/src/common/log/ob_log_generator.cpp +++ b/deps/oblib/src/common/log/ob_log_generator.cpp @@ -98,7 +98,7 @@ static int64_t calc_nop_log_len(int64_t pos, int64_t min_log_size) char ObLogGenerator::eof_flag_buf_[LOG_FILE_ALIGN_SIZE] __attribute__((aligned(DIO_ALIGN_SIZE))); static class EOF_FLAG_BUF_CONSTRUCTOR { - public: +public: EOF_FLAG_BUF_CONSTRUCTOR() { const char* mark_str = "end_of_log_file"; diff --git a/deps/oblib/src/common/log/ob_log_generator.h b/deps/oblib/src/common/log/ob_log_generator.h index 9a3989d3a..c8e39965c 100644 --- a/deps/oblib/src/common/log/ob_log_generator.h +++ b/deps/oblib/src/common/log/ob_log_generator.h @@ -35,11 +35,11 @@ struct DebugLog { int64_t last_ctime_; }; class ObLogGenerator { - public: +public: static const int64_t LOG_FILE_ALIGN_SIZE = 1 << OB_DIRECT_IO_ALIGN_BITS; static const int64_t LOG_FILE_ALIGN_MASK = LOG_FILE_ALIGN_SIZE - 1; static const int64_t LOG_BUF_RESERVED_SIZE = 3 * LOG_FILE_ALIGN_SIZE; // nop + switch_log + eof - public: +public: ObLogGenerator(); ~ObLogGenerator(); int init(int64_t log_buf_size, int64_t log_file_max_size, const ObAddr* id = NULL); @@ -63,12 +63,12 @@ class ObLogGenerator { int64_t to_string(char* buf, const int64_t len) const; static bool is_eof(const char* buf, int64_t len); - public: +public: int get_start_cursor(ObLogCursor& log_cursor) const; int get_end_cursor(ObLogCursor& log_cursor) const; int dump_for_debug() const; - protected: +protected: bool is_inited() const; int check_state() const; bool has_log() const; @@ -78,10 +78,10 @@ class ObLogGenerator { int write_nop(const bool force_write = false); int append_eof(); - public: +public: static char eof_flag_buf_[LOG_FILE_ALIGN_SIZE] __attribute__((aligned(DIO_ALIGN_SIZE))); - private: +private: bool is_frozen_; int64_t log_file_max_size_; ObLogCursor start_cursor_; diff --git a/deps/oblib/src/common/log/ob_log_reader.h b/deps/oblib/src/common/log/ob_log_reader.h index 85771cb61..90eed4081 100644 --- a/deps/oblib/src/common/log/ob_log_reader.h +++ b/deps/oblib/src/common/log/ob_log_reader.h @@ -29,11 +29,11 @@ namespace common { * short time before reading the log again */ class ObLogReader { - public: +public: static const int64_t WAIT_TIME = 1000000; // us static const int FAIL_TIMES = 60; - public: +public: ObLogReader(); virtual ~ObLogReader(); @@ -60,12 +60,12 @@ class ObLogReader { inline int get_cursor(common::ObLogCursor& cursor); inline int get_next_cursor(common::ObLogCursor& cursor); - private: +private: int seek(uint64_t log_seq); int open_log_(const uint64_t log_file_id, const uint64_t last_log_seq = 0); int read_log_(LogCommand& cmd, uint64_t& log_seq, char*& log_data, int64_t& data_len); - private: +private: uint64_t cur_log_file_id_; uint64_t cur_log_seq_id_; uint64_t max_log_file_id_; diff --git a/deps/oblib/src/common/log/ob_single_log_reader.h b/deps/oblib/src/common/log/ob_single_log_reader.h index f05561bf2..34567dff5 100644 --- a/deps/oblib/src/common/log/ob_single_log_reader.h +++ b/deps/oblib/src/common/log/ob_single_log_reader.h @@ -23,10 +23,10 @@ namespace oceanbase { namespace common { class ObSingleLogReader { - public: +public: static const int64_t LOG_BUFFER_MAX_LENGTH; - public: +public: ObSingleLogReader(); virtual ~ObSingleLogReader(); @@ -88,18 +88,18 @@ class ObSingleLogReader { dio_ = false; } - protected: +protected: int read_header(ObLogEntry& entry); int trim_last_zero_padding(int64_t header_size); int open_with_lucky(const uint64_t file_id, const uint64_t last_log_seq); - protected: +protected: /** * Read data from the log file to the read buffer */ int read_log_(); - protected: +protected: bool is_inited_; // Initialization tag uint64_t file_id_; // Log file id uint64_t last_log_seq_; // Last log (Mutator) serial number diff --git a/deps/oblib/src/common/ob_accuracy.h b/deps/oblib/src/common/ob_accuracy.h index f7c4c344e..66ff5a9a0 100644 --- a/deps/oblib/src/common/ob_accuracy.h +++ b/deps/oblib/src/common/ob_accuracy.h @@ -73,7 +73,7 @@ inline bool is_oracle_byte_length(const bool is_oracle_mode, const ObLengthSeman } class ObAccuracy { - public: +public: ObAccuracy() { reset(); @@ -157,7 +157,7 @@ class ObAccuracy { accuracy_ = -1; } - public: +public: OB_INLINE ObAccuracy& operator=(const ObAccuracy& other) { if (this != &other) { @@ -174,7 +174,7 @@ class ObAccuracy { return accuracy_ != other.accuracy_; } - public: +public: // why we expose this 3 arrays directly? // imagine that we add 'if ... else' statements in ddl_default_accuracy() first, // and 'int ret = OB_SUCCESS' and 'return ret' statements too. @@ -188,7 +188,7 @@ class ObAccuracy { static const ObAccuracy DML_DEFAULT_ACCURACY[ObMaxType]; static const ObAccuracy MAX_ACCURACY_OLD[ObMaxType]; - public: +public: TO_STRING_KV(N_LENGTH, length_, N_PRECISION, precision_, N_SCALE, scale_); NEED_SERIALIZE_AND_DESERIALIZE; diff --git a/deps/oblib/src/common/ob_action_flag.h b/deps/oblib/src/common/ob_action_flag.h index 749f9d835..49472fa6f 100644 --- a/deps/oblib/src/common/ob_action_flag.h +++ b/deps/oblib/src/common/ob_action_flag.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObActionFlag { - public: +public: static const int64_t OP_MIN_OBJ = 1; static const int64_t OP_MAX_OBJ = 2; static const int64_t OP_NOP = 3; diff --git a/deps/oblib/src/common/ob_balance_filter.h b/deps/oblib/src/common/ob_balance_filter.h index 63a12755a..f75228fd7 100644 --- a/deps/oblib/src/common/ob_balance_filter.h +++ b/deps/oblib/src/common/ob_balance_filter.h @@ -31,23 +31,23 @@ class ObBalanceFilter : public lib::ThreadPool { static const int64_t MAX_THREAD_NUM = 4096; static const int64_t REBALANCE_INTERVAL = 3L * 1000000L; - public: +public: ObBalanceFilter(); ~ObBalanceFilter(); - public: +public: int init(const int64_t thread_num, const bool dynamic_rebalance); void destroy(); void run1() override; - public: +public: uint64_t filt(const uint64_t input); void migrate(const int64_t bucket_pos, const int64_t thread_pos); void log_info(); void add_thread(const int64_t add_num); void sub_thread(const int64_t sub_num); - private: +private: bool inited_; int64_t bucket_node_num_; volatile int64_t thread_node_num_; diff --git a/deps/oblib/src/common/ob_buffer.h b/deps/oblib/src/common/ob_buffer.h index 879be0980..43a76c273 100644 --- a/deps/oblib/src/common/ob_buffer.h +++ b/deps/oblib/src/common/ob_buffer.h @@ -70,18 +70,18 @@ struct ObAlignedAllocator { template > class base_buffer { - public: +public: static const int64_t DEFAULT_CAPACITY = BUFSIZ; static const bool USE_EXCEPTION = true; static const bool NO_EXCEPTION = false; - protected: +protected: int64_t capacity_; int64_t length_; int64_t base_; Alloc alloc_; - protected: +protected: int64_t min(int64_t a, int64_t b) const { return a < b ? a : b; @@ -140,7 +140,7 @@ class base_buffer { return len; } - public: +public: base_buffer() : capacity_(0), length_(0), base_(0) { init_capacity_(DEFAULT_CAPACITY); @@ -157,7 +157,7 @@ class base_buffer { length_ = 0; } - public: +public: virtual char* ptre() = 0; virtual const char* ptre() const = 0; virtual char* ptr() = 0; @@ -230,7 +230,7 @@ class base_buffer { return ObDataBuffer(ptr(), capacity()); } - public: +public: int64_t compare(const char* str, int64_t len) const { int64_t r = MEMCMP(ptr(), str, min(length(), len)); @@ -252,7 +252,7 @@ class base_buffer { return compare(rbuf.ptr(), rbuf.length()); } - public: +public: int append(const char* str, int64_t len) { if (0 == str || len < 0) { @@ -469,7 +469,7 @@ class base_buffer { } } - public: +public: int assign(const char* str, int64_t len) { if (0 == str || len < 0) { @@ -606,13 +606,13 @@ class base_buffer { return appende(h); } - public: +public: template class iterator_base { - private: + private: charT* cur_; - public: + public: explicit iterator_base(charT* p) { cur_ = p; @@ -716,13 +716,13 @@ class base_buffer { template > class base_normal_buffer : public base_buffer { - protected: +protected: char* ptr_; - public: +public: typedef base_buffer Parent; - protected: +protected: virtual int reset_size_(bool exception, int64_t size, bool retain_data) { if (0 == ptr_) { @@ -765,7 +765,7 @@ class base_normal_buffer : public base_buffer { } } - public: +public: base_normal_buffer() : base_buffer() { preset_(); @@ -784,7 +784,7 @@ class base_normal_buffer : public base_buffer { Parent::length_ = 0; } - public: +public: virtual char* ptre() { return ptr_ + Parent::base_; @@ -805,13 +805,13 @@ class base_normal_buffer : public base_buffer { template > class sbuffer : public base_buffer { - protected: +protected: char buff_[N]; - public: +public: typedef base_buffer Parent; - protected: +protected: virtual int reset_size_(bool exception, int64_t size, bool retain_data) { (void)size; @@ -823,13 +823,13 @@ class sbuffer : public base_buffer { } } - public: +public: sbuffer() : base_buffer(N) {} virtual ~sbuffer() {} - public: +public: virtual char* ptre() { return buff_ + Parent::base_; diff --git a/deps/oblib/src/common/ob_clock_generator.h b/deps/oblib/src/common/ob_clock_generator.h index 7bc3aa7a1..97a720e2f 100644 --- a/deps/oblib/src/common/ob_clock_generator.h +++ b/deps/oblib/src/common/ob_clock_generator.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace common { class ObClockGenerator : public lib::ThreadPool { - private: +private: ObClockGenerator() : inited_(false), ready_(false), cur_ts_(0), last_used_time_(0) {} ~ObClockGenerator() @@ -34,7 +34,7 @@ class ObClockGenerator : public lib::ThreadPool { destroy(); } - public: +public: static int init(); static void destroy(); static int64_t getClock(); @@ -43,11 +43,11 @@ class ObClockGenerator : public lib::ThreadPool { static void msleep(const int64_t ms); static void usleep(const int64_t us); - private: +private: int64_t get_us(); void run1() final; - private: +private: bool inited_; bool ready_; int64_t cur_ts_; diff --git a/deps/oblib/src/common/ob_common_utility.h b/deps/oblib/src/common/ob_common_utility.h index c4371a4ab..ad8044316 100644 --- a/deps/oblib/src/common/ob_common_utility.h +++ b/deps/oblib/src/common/ob_common_utility.h @@ -46,13 +46,13 @@ inline int check_stack_overflow(void) * The of pointer of the class is maintained on thread local. */ class ObFatalErrExtraInfoGuard { - public: +public: explicit ObFatalErrExtraInfoGuard(); virtual ~ObFatalErrExtraInfoGuard(); static const ObFatalErrExtraInfoGuard* get_thd_local_val_ptr(); DEFINE_VIRTUAL_TO_STRING(); - private: +private: static ObFatalErrExtraInfoGuard*& get_val(); ObFatalErrExtraInfoGuard* last_; }; diff --git a/deps/oblib/src/common/ob_field.h b/deps/oblib/src/common/ob_field.h index cdc6e9bc3..cafe04c9f 100644 --- a/deps/oblib/src/common/ob_field.h +++ b/deps/oblib/src/common/ob_field.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace common { struct ObParamedSelectItemCtx { - public: +public: // paramed column for display ObString paramed_cname_; // Record every parameterized? Offset relative to field name @@ -69,7 +69,7 @@ struct ObParamedSelectItemCtx { // NOTE: ~ObFileld may not called, all memory should be auto free. class ObField { - public: +public: ObString dname_; // database name for display ObString tname_; // table name for display ObString org_tname_; // original table name @@ -119,7 +119,7 @@ class ObField { static int get_field_mb_length( const ObObjType type, const ObAccuracy& accuracy, const ObCollationType charsetnr, int32_t& length); - private: +private: static int32_t my_decimal_precision_to_length_no_truncation(int16_t precision, int16_t scale, bool unsigned_flag) { /* diff --git a/deps/oblib/src/common/ob_hint.h b/deps/oblib/src/common/ob_hint.h index 812ea2af2..3cafddbad 100644 --- a/deps/oblib/src/common/ob_hint.h +++ b/deps/oblib/src/common/ob_hint.h @@ -22,7 +22,7 @@ const char* get_consistency_level_str(ObConsistencyLevel level); /// @retval -1 on error ObConsistencyLevel get_consistency_level_by_str(const ObString& level); struct ObTableScanHint { - public: +public: int64_t max_parallel_count_; bool enable_parallel_; int64_t timeout_us_; @@ -30,7 +30,7 @@ struct ObTableScanHint { ObConsistencyLevel read_consistency_; bool force_refresh_lc_; - public: +public: ObTableScanHint() : max_parallel_count_(OB_DEFAULT_MAX_PARALLEL_COUNT), enable_parallel_(true), diff --git a/deps/oblib/src/common/ob_i_callback.h b/deps/oblib/src/common/ob_i_callback.h index fe0f4d59e..a44053fb7 100644 --- a/deps/oblib/src/common/ob_i_callback.h +++ b/deps/oblib/src/common/ob_i_callback.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace common { class ObICallback { - public: +public: ObICallback() {} virtual ~ObICallback() @@ -25,7 +25,7 @@ class ObICallback { }; class ObICallbackHandler { - public: +public: ObICallbackHandler() {} virtual ~ObICallbackHandler() diff --git a/deps/oblib/src/common/ob_i_rs_cb.h b/deps/oblib/src/common/ob_i_rs_cb.h index 2b1c39cb1..f52091b33 100644 --- a/deps/oblib/src/common/ob_i_rs_cb.h +++ b/deps/oblib/src/common/ob_i_rs_cb.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObIRSCb { - public: +public: virtual int submit_pt_update_task(const common::ObPartitionKey& part_key, const int64_t data_version) = 0; }; } // namespace common diff --git a/deps/oblib/src/common/ob_member.h b/deps/oblib/src/common/ob_member.h index 542691487..a7d9609ad 100644 --- a/deps/oblib/src/common/ob_member.h +++ b/deps/oblib/src/common/ob_member.h @@ -23,11 +23,11 @@ namespace oceanbase { namespace common { class ObMember { - public: +public: ObMember(); ObMember(const common::ObAddr& server, const int64_t timestamp); - public: +public: const common::ObAddr& get_server() const; int64_t get_timestamp() const; virtual void reset(); @@ -42,7 +42,7 @@ class ObMember { TO_YSON_KV(Y_(server), OB_ID(t), timestamp_, Y_(flag)); OB_UNIS_VERSION(1); - protected: +protected: common::ObAddr server_; int64_t timestamp_; int64_t flag_; @@ -65,7 +65,7 @@ inline bool operator<(const ObMember& lhs, const ObMember& rhs) } class ObReplicaMember : public ObMember { - public: +public: ObReplicaMember() : ObMember(), replica_type_(REPLICA_TYPE_FULL), region_(DEFAULT_REGION_NAME), memstore_percent_(100) {} ObReplicaMember(const common::ObAddr& server, const int64_t timestamp) @@ -93,7 +93,7 @@ class ObReplicaMember : public ObMember { : ObMember(server, timestamp), replica_type_(replica_type), region_(region), memstore_percent_(memstore_percent) {} - public: +public: common::ObReplicaType get_replica_type() const; int set_replica_type(const common::ObReplicaType replica_type); const common::ObRegion& get_region() const; @@ -115,7 +115,7 @@ class ObReplicaMember : public ObMember { TO_STRING_KV(K_(server), K_(timestamp), K_(flag), K_(replica_type), K_(region), K_(memstore_percent)); OB_UNIS_VERSION(1); - private: +private: common::ObReplicaType replica_type_; common::ObRegion region_; int64_t memstore_percent_; diff --git a/deps/oblib/src/common/ob_member_list.h b/deps/oblib/src/common/ob_member_list.h index 0d5d1a344..101402d67 100644 --- a/deps/oblib/src/common/ob_member_list.h +++ b/deps/oblib/src/common/ob_member_list.h @@ -22,11 +22,11 @@ template class ObMemberListBase { OB_UNIS_VERSION(1); - public: +public: ObMemberListBase(); ~ObMemberListBase(); - public: +public: void reset(); bool is_valid() const; int add_member(const common::ObMember& member); @@ -51,7 +51,7 @@ class ObMemberListBase { int64_t to_string(char* buf, const int64_t buf_len) const; TO_YSON_KV(OB_ID(member), common::ObArrayWrap(member_, member_number_)); - private: +private: int64_t member_number_; common::ObMember member_[MAX_MEMBER_NUM]; }; diff --git a/deps/oblib/src/common/ob_partition_key.h b/deps/oblib/src/common/ob_partition_key.h index d9b30f7c1..2f3f89d5b 100644 --- a/deps/oblib/src/common/ob_partition_key.h +++ b/deps/oblib/src/common/ob_partition_key.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace common { struct ObPartitionKey final { - public: +public: ObPartitionKey() : table_id_(OB_INVALID_ID), part_id_(OB_INVALID_INDEX), assit_id_(OB_INVALID_INDEX), hash_value_(0) {} @@ -116,7 +116,7 @@ struct ObPartitionKey final { uint64_t tablegroup_id_; }; - private: +private: int32_t part_id_; // First level part_id union { int32_t subpart_id_; // Secondary part_id @@ -141,14 +141,14 @@ typedef ObSEArray ObPartitionTy class ObPartitionLeaderArray { OB_UNIS_VERSION(1); - public: +public: ObPartitionLeaderArray() {} ~ObPartitionLeaderArray() {} void reset(); - public: +public: int push(const common::ObPartitionKey& partition, const common::ObAddr& leader, const common::ObPartitionType& type = ObPartitionType::NORMAL_PARTITION); int assign(const ObPartitionLeaderArray& pla); @@ -175,7 +175,7 @@ class ObPartitionLeaderArray { TO_STRING_KV(K_(partitions), K_(leaders), K_(type_array)); - private: +private: common::ObPartitionArray partitions_; common::ObAddrArray leaders_; common::ObPartitionTypeArray type_array_; diff --git a/deps/oblib/src/common/ob_queue_thread.h b/deps/oblib/src/common/ob_queue_thread.h index d99105124..320e927a1 100644 --- a/deps/oblib/src/common/ob_queue_thread.h +++ b/deps/oblib/src/common/ob_queue_thread.h @@ -35,16 +35,16 @@ class ObCond { static const int64_t SPIN_WAIT_NUM = 0; static const int64_t BUSY_INTERVAL = 1000; - public: +public: explicit ObCond(const int64_t spin_wait_num = SPIN_WAIT_NUM); ~ObCond(); - public: +public: void signal(); int timedwait(const int64_t time_us); int wait(); - private: +private: const int64_t spin_wait_num_; volatile bool bcond_; int64_t last_waked_time_; @@ -89,14 +89,14 @@ class S2MQueueThread { typedef DRWLock::WRLockGuard WRLockGuard; typedef ObTCCounter Counter; - public: +public: enum { HIGH_PRIO_QUEUE = 0, HOTSPOT_QUEUE = 1, NORMAL_PRIO_QUEUE = 2, LOW_PRIO_QUEUE = 3, QUEUE_COUNT = 4 }; - public: +public: S2MQueueThread(); virtual ~S2MQueueThread(); - public: +public: int init( const int64_t thread_num, const int64_t task_num_limit, const bool queue_rebalance, const bool dynamic_rebalance); int set_prio_quota(v4si& quota); @@ -114,7 +114,7 @@ class S2MQueueThread { }; int wakeup(); - public: +public: int push(void* task, const int64_t prio = NORMAL_PRIV); int push(void* task, const uint64_t task_sign, const int64_t prio); int push_low_prio(void* task); @@ -137,12 +137,12 @@ class S2MQueueThread { UNUSED(ptr); }; - private: +private: void* rebalance_(int64_t& idx, const ThreadConf& cur_thread); int launch_thread_(const int64_t thread_num, const int64_t task_num_limit); static void* thread_func_(void* data); - private: +private: int64_t thread_num_; volatile uint64_t thread_conf_iter_; RWLock thread_conf_lock_; @@ -157,15 +157,15 @@ typedef S2MCond M2SCond; class M2SQueueThread { static const int64_t QUEUE_WAIT_TIME; - public: +public: M2SQueueThread(); virtual ~M2SQueueThread(); - public: +public: int init(const int64_t task_num_limit, const int64_t idle_interval); void destroy(); - public: +public: int push(void* task); int64_t get_queued_num() const; virtual void handle(void* task, void* pdata) = 0; @@ -179,10 +179,10 @@ class M2SQueueThread { }; virtual void on_idle(){}; - private: +private: static void* thread_func_(void* data); - private: +private: bool inited_; pthread_t pd_; volatile bool run_flag_; @@ -195,15 +195,15 @@ class M2SQueueThread { class SeqQueueThread { static const int64_t QUEUE_WAIT_TIME = 10 * 1000; - public: +public: SeqQueueThread(); virtual ~SeqQueueThread(); - public: +public: int init(const int64_t task_num_limit, const int64_t idle_interval); void destroy(); - public: +public: virtual int push(void* task); int64_t get_queued_num() const; virtual void handle(void* task, void* pdata) = 0; @@ -222,13 +222,13 @@ class SeqQueueThread { virtual void on_idle(){}; virtual int64_t get_seq(void* task) = 0; - private: +private: static void* thread_func_(void* data); - protected: +protected: ObSeqQueue task_queue_; - private: +private: bool inited_; pthread_t pd_; volatile bool run_flag_; diff --git a/deps/oblib/src/common/ob_range.h b/deps/oblib/src/common/ob_range.h index c239fa654..c703a4328 100644 --- a/deps/oblib/src/common/ob_range.h +++ b/deps/oblib/src/common/ob_range.h @@ -24,13 +24,13 @@ namespace common { class ObStoreRange; class ObBorderFlag { - public: +public: static const int8_t INCLUSIVE_START = 0x1; static const int8_t INCLUSIVE_END = 0x2; static const int8_t MIN_VALUE = 0x4; static const int8_t MAX_VALUE = 0x8; - public: +public: ObBorderFlag() : data_(0) {} virtual ~ObBorderFlag() @@ -103,7 +103,7 @@ class ObBorderFlag { TO_STRING_KV(N_FLAG, data_); - private: +private: int8_t data_; }; @@ -291,7 +291,7 @@ struct ObVersion { }; class ObVersionProvider { - public: +public: virtual ~ObVersionProvider() {} virtual const ObVersion get_frozen_version() const = 0; @@ -310,7 +310,7 @@ class ObVersionProvider { struct ObVersionRange { OB_UNIS_VERSION(1); - public: +public: static const int64_t MIN_VERSION = 0; static const int64_t MAX_VERSION = INT64_MAX; @@ -337,7 +337,7 @@ struct ObVersionRange { struct ObLogTsRange { OB_UNIS_VERSION(1); - public: +public: static const int64_t MIN_TS = 0; static const int64_t MAX_TS = INT64_MAX; @@ -383,7 +383,7 @@ struct ObLogTsRange { class ObNewRange { - public: +public: uint64_t table_id_; ObBorderFlag border_flag_; ObRowkey start_key_; diff --git a/deps/oblib/src/common/ob_role_mgr.h b/deps/oblib/src/common/ob_role_mgr.h index e34c44727..fad0eca15 100644 --- a/deps/oblib/src/common/ob_role_mgr.h +++ b/deps/oblib/src/common/ob_role_mgr.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { /// @brief ObRoleMgr manages the role and status of the process class ObRoleMgr { - public: +public: static const int32_t OB_MASTER = 1; static const int32_t OB_SLAVE = 2; enum Role { @@ -50,7 +50,7 @@ class ObRoleMgr { BOOTOK = 8, }; - public: +public: ObRoleMgr() : role_(SLAVE), state_(INIT) {} @@ -75,10 +75,10 @@ class ObRoleMgr { inline const char* get_state_str() const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRoleMgr); - private: +private: volatile Role role_; volatile State state_; }; diff --git a/deps/oblib/src/common/ob_segmented_buffer.h b/deps/oblib/src/common/ob_segmented_buffer.h index 931c9e1f8..531b0e434 100644 --- a/deps/oblib/src/common/ob_segmented_buffer.h +++ b/deps/oblib/src/common/ob_segmented_buffer.h @@ -21,7 +21,7 @@ namespace common { class ObSegmentedBufffer { friend class ObSegmentedBuffferIterator; - public: +public: ObSegmentedBufffer(const int block_size, const lib::ObMemAttr attr) : block_size_(block_size), attr_(attr), head_(nullptr), block_(nullptr), pos_(0) {} @@ -35,7 +35,7 @@ class ObSegmentedBufffer { void destory(); int dump_to_file(const char* file_name); - private: +private: const int block_size_; const lib::ObMemAttr attr_; char* head_; @@ -44,12 +44,12 @@ class ObSegmentedBufffer { }; class ObSegmentedBuffferIterator { - public: +public: ObSegmentedBuffferIterator(ObSegmentedBufffer& sb) : next_buf_(sb.head_), sb_(sb) {} char* next(int64_t& len); - private: +private: char* next_buf_; const ObSegmentedBufffer& sb_; }; diff --git a/deps/oblib/src/common/ob_server_ext.h b/deps/oblib/src/common/ob_server_ext.h index efe348c10..304496421 100644 --- a/deps/oblib/src/common/ob_server_ext.h +++ b/deps/oblib/src/common/ob_server_ext.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObServerExt { - public: +public: friend class ObOcmInstance; ObServerExt(); ~ObServerExt(); @@ -34,7 +34,7 @@ class ObServerExt { ObAddr& get_server(); int deep_copy(const ObServerExt& server_ext); - private: +private: char hostname_[OB_MAX_HOST_NAME_LENGTH]; ObAddr server_; int64_t magic_num_; diff --git a/deps/oblib/src/common/ob_simple_iterator.h b/deps/oblib/src/common/ob_simple_iterator.h index 925542858..7f5215684 100644 --- a/deps/oblib/src/common/ob_simple_iterator.h +++ b/deps/oblib/src/common/ob_simple_iterator.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace common { template class ObSimpleIterator { - public: +public: ObSimpleIterator() : item_arr_(LABEL, OB_MALLOC_NORMAL_BLOCK_SIZE) { reset(); @@ -40,7 +40,7 @@ class ObSimpleIterator { } int get_next(T& item); - private: +private: bool is_ready_; typename common::ObSEArray item_arr_; typename common::ObSEArray::iterator it_; diff --git a/deps/oblib/src/common/ob_simple_tpl.h b/deps/oblib/src/common/ob_simple_tpl.h index c8cbc6665..a91ca01f5 100644 --- a/deps/oblib/src/common/ob_simple_tpl.h +++ b/deps/oblib/src/common/ob_simple_tpl.h @@ -63,10 +63,10 @@ struct Pair { template struct TSI { - public: +public: typedef typename Factory::InstanceType T; - public: +public: TSI(Factory& factory) : create_err_(0), factory_(factory) { create_err_ = pthread_key_create(&key_, destroy); @@ -94,7 +94,7 @@ struct TSI { return val; } - private: +private: static void destroy(void* arg) { if (NULL != arg) { @@ -109,7 +109,7 @@ struct TSI { // Can not be deleted, regardless of memory template class SimpleList { - public: +public: SimpleList() : tail_((T*)&guard_) { tail_->next_ = tail_; @@ -141,23 +141,23 @@ class SimpleList { return tail_->next_; } - private: +private: T* guard_; T* tail_; }; template class ObHandyAllocatorWrapper : public Allocator { - public: +public: ObHandyAllocatorWrapper() : allocated_(0) {} ~ObHandyAllocatorWrapper() {} - private: +private: volatile int64_t allocated_; - public: +public: int64_t get_alloc_size() const { return allocated_; diff --git a/deps/oblib/src/common/ob_smart_var.h b/deps/oblib/src/common/ob_smart_var.h index b280c8320..6c17393e7 100644 --- a/deps/oblib/src/common/ob_smart_var.h +++ b/deps/oblib/src/common/ob_smart_var.h @@ -50,7 +50,7 @@ extern void* smart_alloc(const int64_t, const char*); extern void smart_free(void*); class _SBase { - public: +public: _SBase(const int ret, const bool from_heap) : ret_(ret), from_heap_(from_heap) {} int ret_; @@ -59,7 +59,7 @@ class _SBase { template class _S : public _SBase { - public: +public: static int precheck(bool& from_heap, bool& by_vla) { int ret = OB_SUCCESS; @@ -72,7 +72,7 @@ class _S : public _SBase { return ret; } - public: +public: template _S(const int ret, const bool from_heap, Args&&... args) : _SBase(ret, from_heap), v_(nullptr) { @@ -110,7 +110,7 @@ template class _S : public _SBase { typedef T Array[N]; - public: +public: static int precheck(bool& from_heap, bool& by_vla) { int ret = OB_SUCCESS; @@ -123,7 +123,7 @@ class _S : public _SBase { return ret; } - public: +public: _S(const int ret, const bool from_heap) : _SBase(ret, from_heap), v_(nullptr) { if (OB_SUCCESS == ret_) { @@ -160,7 +160,7 @@ class _S : public _SBase { template class _S : public _SBase { - public: +public: static int precheck(bool& from_heap, bool& by_vla) { from_heap = false; @@ -168,7 +168,7 @@ class _S : public _SBase { return OB_SUCCESS; } - public: +public: template _S(const int ret, const bool from_heap, Args&&... args) : _SBase(ret, from_heap), obj_(args...), v_(&obj_) {} @@ -184,7 +184,7 @@ template class _S : public _SBase { typedef T Array[N]; - public: +public: static int precheck(bool& from_heap, bool& by_vla) { from_heap = false; @@ -192,7 +192,7 @@ class _S : public _SBase { return OB_SUCCESS; } - public: +public: _S(const int ret, const bool from_heap) : _SBase(ret, from_heap), v_(&array_[0]) {} Array& get() diff --git a/deps/oblib/src/common/ob_store_format.h b/deps/oblib/src/common/ob_store_format.h index d4f7f1252..511eaa85d 100644 --- a/deps/oblib/src/common/ob_store_format.h +++ b/deps/oblib/src/common/ob_store_format.h @@ -46,17 +46,17 @@ struct ObStoreFormatItem { }; class ObStoreFormat { - public: +public: static const ObStoreFormatType STORE_FORMAT_MYSQL_START = OB_STORE_FORMAT_REDUNDANT_MYSQL; static const ObStoreFormatType STORE_FORMAT_MYSQL_DEFAULT = OB_STORE_FORMAT_COMPACT_MYSQL; static const ObStoreFormatType STORE_FORMAT_ORACLE_START = OB_STORE_FORMAT_NOCOMPRESS_ORACLE; static const ObStoreFormatType STORE_FORMAT_ORACLE_DEFAULT = OB_STORE_FORMAT_OLTP_ORACLE; - private: +private: ObStoreFormat(){}; virtual ~ObStoreFormat(){}; - public: +public: static inline bool is_row_store_type_valid(const ObRowStoreType type) { return type == FLAT_ROW_STORE || type == SPARSE_ROW_STORE; @@ -111,7 +111,7 @@ class ObStoreFormat { static int find_store_format_type( const ObString& store_format, const bool is_oracle_mode, ObStoreFormatType& store_format_type); - private: +private: static const ObStoreFormatItem store_format_items[OB_STORE_FORMAT_MAX]; static const char* row_store_name[MAX_ROW_STORE]; }; diff --git a/deps/oblib/src/common/ob_store_range.h b/deps/oblib/src/common/ob_store_range.h index 38c3d12e3..139863339 100644 --- a/deps/oblib/src/common/ob_store_range.h +++ b/deps/oblib/src/common/ob_store_range.h @@ -27,7 +27,7 @@ namespace common { // because the comparison of the start_key_ and end_key_ of the range requires additional // (column order) information. class ObStoreRange { - public: +public: ObStoreRange() { reset(); @@ -158,7 +158,7 @@ class ObStoreRange { inline int get_common_store_rowkey(ObStoreRowkey& store_rowkey) const; - private: +private: uint64_t table_id_; ObBorderFlag border_flag_; ObStoreRowkey start_key_; @@ -166,7 +166,7 @@ class ObStoreRange { // FIXME-: remove interfaces below after changing code that calls below methods // ObStoreRange should NOT provide compare semantics - public: +public: inline void set_whole_range(); inline bool is_whole_range() const { @@ -343,7 +343,7 @@ inline int deep_copy_range(ObIAllocator& allocator, const ObStoreRange& src, ObS * for better performance. */ class ObExtStoreRange { - public: +public: ObExtStoreRange(); explicit ObExtStoreRange(const ObStoreRange& range); @@ -394,7 +394,7 @@ class ObExtStoreRange { TO_STRING_KV(K_(range), K_(ext_start_key), K_(ext_end_key)); - private: +private: ObStoreRange range_; // used for search macro block ObExtStoreRowkey ext_start_key_; @@ -402,13 +402,13 @@ class ObExtStoreRange { }; class ObVersionStoreRangeConversionHelper { - public: +public: static int store_rowkey_to_multi_version_range(const ObExtStoreRowkey& src_rowkey, const ObVersionRange& version_range, ObIAllocator& allocator, ObExtStoreRange& multi_version_range); static int range_to_multi_version_range(const ObExtStoreRange& src_range, const ObVersionRange& version_range, ObIAllocator& allocator, ObExtStoreRange& multi_version_range); - private: +private: static int build_multi_version_store_rowkey(const ObStoreRowkey& rowkey, const int64_t trans_version, ObIAllocator& allocator, ObStoreRowkey& multi_version_rowkey); }; diff --git a/deps/oblib/src/common/ob_string_buf.h b/deps/oblib/src/common/ob_string_buf.h index 8cbc01981..7be29d949 100644 --- a/deps/oblib/src/common/ob_string_buf.h +++ b/deps/oblib/src/common/ob_string_buf.h @@ -25,7 +25,7 @@ namespace common { // ObStringBufT is used to store the ObString and ObObj object. template > class ObStringBufT { - public: +public: explicit ObStringBufT( const lib::ObLabel& label = ObModIds::OB_STRING_BUF, const int64_t block_size = DEF_MEM_BLOCK_SIZE); explicit ObStringBufT(PageArenaT& arena); @@ -33,7 +33,7 @@ class ObStringBufT { int reset(); int reuse(); - public: +public: // Writes a string to buf. // @param [in] str the string object to be stored. // @param [out] stored_str records the stored ptr and length of string. @@ -80,11 +80,11 @@ class ObStringBufT { arena_.free(static_cast(ptr)); } - private: +private: static const int64_t DEF_MEM_BLOCK_SIZE; static const int64_t MIN_DEF_MEM_BLOCK_SIZE; - private: +private: PageArenaT local_arena_; PageArenaT& arena_; DISALLOW_COPY_AND_ASSIGN(ObStringBufT); diff --git a/deps/oblib/src/common/ob_timeout_ctx.h b/deps/oblib/src/common/ob_timeout_ctx.h index a09c87b4a..0c40d251a 100644 --- a/deps/oblib/src/common/ob_timeout_ctx.h +++ b/deps/oblib/src/common/ob_timeout_ctx.h @@ -26,7 +26,7 @@ namespace common { // Pass timeout argument by thread local variable, // to avoid add timeout argument to all functions. class ObTimeoutCtx { - public: +public: ObTimeoutCtx(); virtual ~ObTimeoutCtx(); @@ -52,14 +52,14 @@ class ObTimeoutCtx { TO_STRING_KV(K_(abs_timeout_us)); - private: +private: explicit ObTimeoutCtx(bool link_self); void do_link_self(); - private: +private: static ObTimeoutCtx*& header(); - private: +private: int64_t abs_timeout_us_; // query_timeout int64_t trx_timeout_us_; // trx_timeout ObTimeoutCtx* next_; diff --git a/deps/oblib/src/common/ob_trace_profile.h b/deps/oblib/src/common/ob_trace_profile.h index 0a239c896..273a260f2 100644 --- a/deps/oblib/src/common/ob_trace_profile.h +++ b/deps/oblib/src/common/ob_trace_profile.h @@ -20,12 +20,12 @@ namespace oceanbase { namespace common { class ObTraceProfile { - public: +public: ObTraceProfile(); ~ObTraceProfile() {} - public: +public: int init(const char* module, const int64_t warn_timeout, const bool is_tracing); void set_sign(const uint64_t sign); void reset(); @@ -35,7 +35,7 @@ class ObTraceProfile { int trace(const ObPartitionKey& partition_key, const char* flag, const ObAddr& server); void report_trace(); - private: +private: struct TraceEntry { void reset(); ObPartitionKey partition_key_; @@ -56,7 +56,7 @@ class ObTraceProfile { TraceEntry entry_[MAX_TRACE_NUM]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTraceProfile); }; diff --git a/deps/oblib/src/common/ob_unit_info.h b/deps/oblib/src/common/ob_unit_info.h index a6d6e87cb..58ee56908 100644 --- a/deps/oblib/src/common/ob_unit_info.h +++ b/deps/oblib/src/common/ob_unit_info.h @@ -24,17 +24,17 @@ namespace share { struct ObUnit { OB_UNIS_VERSION(1); - public: +public: enum Status { UNIT_STATUS_ACTIVE = 0, UNIT_STATUS_DELETING, UNIT_STATUS_MAX, }; - public: +public: static const char* const unit_status_strings[UNIT_STATUS_MAX]; - public: +public: ObUnit(); ~ObUnit() {} @@ -73,7 +73,7 @@ typedef common::ObFixedLengthString ObUnitConfig struct ObUnitConfig { OB_UNIS_VERSION(1); - public: +public: static constexpr double CPU_EPSILON = 0.00001; ObUnitConfig(); ~ObUnitConfig() @@ -105,7 +105,7 @@ typedef common::ObFixedLengthString ObResource struct ObResourcePool { OB_UNIS_VERSION(1); - public: +public: static const int64_t DEFAULT_ZONE_COUNT = 5; ObResourcePool(); @@ -124,7 +124,7 @@ struct ObResourcePool { uint64_t tenant_id_; common::ObReplicaType replica_type_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObResourcePool); }; @@ -151,7 +151,7 @@ struct ObUnitInfo { ObUnitConfig config_; ObResourcePool pool_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUnitInfo); }; diff --git a/deps/oblib/src/common/ob_version_provider.h b/deps/oblib/src/common/ob_version_provider.h index a1ecf2ad6..33b997d26 100644 --- a/deps/oblib/src/common/ob_version_provider.h +++ b/deps/oblib/src/common/ob_version_provider.h @@ -15,18 +15,18 @@ namespace oceanbase { namespace common { class ObVersionProvider { - public: +public: ObVersionProvider(){}; virtual ~ObVersionProvider(){}; virtual common::ObVersion get_frozen_version() const = 0; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObVersionProvider); - private: +private: // data members }; } // end namespace common diff --git a/deps/oblib/src/common/ob_zerofill_info.h b/deps/oblib/src/common/ob_zerofill_info.h index 36d47bc4a..9f5a8c486 100644 --- a/deps/oblib/src/common/ob_zerofill_info.h +++ b/deps/oblib/src/common/ob_zerofill_info.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace common { struct ObZerofillInfo { - public: +public: ObZerofillInfo(const bool zf, const ObLength len) : max_length_(len), need_zerofill_(zf) {} ObZerofillInfo() : max_length_(0), need_zerofill_(false) {} - public: +public: ObLength max_length_; bool need_zerofill_; }; diff --git a/deps/oblib/src/common/object/ob_obj_compare.h b/deps/oblib/src/common/object/ob_obj_compare.h index f392eb412..28f515ed7 100644 --- a/deps/oblib/src/common/object/ob_obj_compare.h +++ b/deps/oblib/src/common/object/ob_obj_compare.h @@ -42,7 +42,7 @@ OB_INLINE bool ob_is_invalid_cmp_op_bool(ObCmpOp cmp_op) } class ObCompareCtx final { - public: +public: // member functions ObCompareCtx(const ObObjType cmp_type, const ObCollationType cmp_cs_type, const bool is_null_safe, const int64_t tz_off, const ObCmpNullPos null_pos) @@ -61,7 +61,7 @@ class ObCompareCtx final { {} TO_STRING_KV(K_(cmp_type), K_(cmp_cs_type), K_(is_null_safe), K_(tz_off)); - public: +public: // data members ObObjType cmp_type_; // used by upper functions, not in these compare functions. ObCollationType cmp_cs_type_; @@ -84,7 +84,7 @@ typedef int (*obj_cmp_func_nullsafe)( * so actually we can do any compare operations which NEED NOT cast. */ class ObObjCmpFuncs { - public: +public: static inline bool is_datetime_timestamp_cmp(ObObjType type1, ObObjType type2) { return (ObTimestampType == type1 && ObDateTimeType == type2) || @@ -217,13 +217,13 @@ class ObObjCmpFuncs { template static int cmp_func(const ObObj& Obj1, const ObObj& obj2, const ObCompareCtx& cmp_ctx); - private: +private: OB_INLINE static int INT_TO_CR(int val) { return val < 0 ? CR_LT : val > 0 ? CR_GT : CR_EQ; } - private: +private: static const obj_cmp_func cmp_funcs[ObMaxTC][ObMaxTC][CO_MAX]; static const obj_cmp_func_nullsafe cmp_funcs_nullsafe[ObMaxTC][ObMaxTC]; static const ObObj cmp_res_objs_bool[CR_BOOL_CNT]; diff --git a/deps/oblib/src/common/object/ob_object.h b/deps/oblib/src/common/object/ob_object.h index 06a422d4a..349eccead 100644 --- a/deps/oblib/src/common/object/ob_object.h +++ b/deps/oblib/src/common/object/ob_object.h @@ -47,7 +47,7 @@ inline ObCmpNullPos default_null_pos() struct ObEnumSetInnerValue { OB_UNIS_VERSION_V(1); - public: +public: ObEnumSetInnerValue() : numberic_value_(0), string_value_() {} ObEnumSetInnerValue(uint64_t numberic_value, common::ObString& string_value) @@ -111,7 +111,7 @@ struct ObLobScale { }; class ObObjMeta { - public: +public: ObObjMeta() : type_(ObNullType), cs_level_(CS_LEVEL_INVALID), cs_type_(CS_TYPE_INVALID), scale_(-1) {} @@ -855,7 +855,7 @@ class ObObjMeta { return offsetof(ObObjMeta, scale_) * 8; } - protected: +protected: uint8_t type_; uint8_t cs_level_; // collation level uint8_t cs_type_; // collation type @@ -1081,7 +1081,7 @@ union ObObjValue { class ObBatchChecksum; class ObObj { - public: +public: // min, max extend value static const int64_t MIN_OBJECT_VALUE = UINT64_MAX - 2; static const int64_t MAX_OBJECT_VALUE = UINT64_MAX - 1; @@ -1091,7 +1091,7 @@ class ObObj { static const char* MAX_OBJECT_VALUE_STR; static const char* NOP_VALUE_STR; - public: +public: ObObj(); ObObj(const ObObj& other); explicit ObObj(bool val); @@ -2137,12 +2137,12 @@ class ObObj { int get_char_length(const ObAccuracy accuracy, int32_t& char_len, bool is_oracle_mode) const; int convert_string_value_charset(ObCharsetType charset_type, ObIAllocator& allocator); - private: +private: friend class tests::common::ObjTest; friend class ObCompactCellWriter; friend class ObCompactCellIterator; - public: +public: ObObjMeta meta_; // sizeof = 4 union { int32_t val_len_; @@ -3773,13 +3773,13 @@ struct ParamFlag { }; class ObObjParam : public ObObj { - public: +public: ObObjParam() : ObObj(), accuracy_(), res_flags_(0), raw_text_pos_(-1), raw_text_len_(-1) {} ObObjParam(const ObObj& other) : ObObj(other), accuracy_(), res_flags_(0), raw_text_pos_(-1), raw_text_len_(-1) {} - public: +public: void reset(); // accuracy. OB_INLINE void set_accuracy(const common::ObAccuracy& accuracy) @@ -3940,7 +3940,7 @@ class ObObjParam : public ObObj { return offsetof(ObObjParam, flag_) * 8; } - private: +private: ObAccuracy accuracy_; uint32_t res_flags_; // BINARY, NUM, NOT_NULL, TIMESTAMP, etc // reference: src/lib/regex/include/mysql_com.h @@ -3953,7 +3953,7 @@ class ObObjParam : public ObObj { struct ObDataType { OB_UNIS_VERSION(1); - public: +public: ObDataType() : meta_(), accuracy_(), charset_(CHARSET_UTF8MB4), is_binary_collation_(false), is_zero_fill_(false) {} TO_STRING_KV(K_(meta), K_(accuracy), K_(charset), K_(is_binary_collation), K_(is_zero_fill)); @@ -4115,7 +4115,7 @@ typedef int64_t (*ob_obj_value_get_serialize_size)(const ObObj& obj); typedef uint64_t (*ob_obj_crc64_v3)(const ObObj& obj, const uint64_t hash); class ObObjUtil { - public: +public: static ob_obj_hash get_murmurhash_v3(ObObjType type); static ob_obj_hash get_murmurhash_v2(ObObjType type); static ob_obj_crc64_v3 get_crc64_v3(ObObjType type); @@ -4124,7 +4124,7 @@ class ObObjUtil { }; class ObHexEscapeSqlStr { - public: +public: ObHexEscapeSqlStr(const common::ObString& str) : str_(str) {} ObString str() const @@ -4134,7 +4134,7 @@ class ObHexEscapeSqlStr { int64_t get_extra_length() const; DECLARE_TO_STRING; - private: +private: ObString str_; }; diff --git a/deps/oblib/src/common/row/ob_row.h b/deps/oblib/src/common/row/ob_row.h index d5c1759a7..49f8c2608 100644 --- a/deps/oblib/src/common/row/ob_row.h +++ b/deps/oblib/src/common/row/ob_row.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace common { class ObColumnInfo { - public: +public: int64_t index_; common::ObCollationType cs_type_; ObColumnInfo() : index_(common::OB_INVALID_INDEX), cs_type_(common::CS_TYPE_INVALID) @@ -42,7 +42,7 @@ class ObColumnInfo { * @brief: wrap row pointer(an ObObj array) and row size */ class ObNewRow final { - public: +public: ObNewRow() : cells_(NULL), count_(0), projector_size_(0), projector_(NULL) {} ObNewRow(ObObj* cells, int64_t count) : cells_(cells), count_(count), projector_size_(0), projector_(NULL) @@ -144,7 +144,7 @@ class ObNewRow final { return pos; } - public: +public: ObObj* cells_; int64_t count_; // cells count int64_t projector_size_; diff --git a/deps/oblib/src/common/row/ob_row_desc.h b/deps/oblib/src/common/row/ob_row_desc.h index b40e6331c..8937ba05c 100644 --- a/deps/oblib/src/common/row/ob_row_desc.h +++ b/deps/oblib/src/common/row/ob_row_desc.h @@ -21,7 +21,7 @@ namespace common { /// Line description class ObRowDesc { - public: +public: struct Desc { uint64_t table_id_; uint64_t column_id_; @@ -42,7 +42,7 @@ class ObRowDesc { }; }; - public: +public: ObRowDesc(); ~ObRowDesc(); /** @@ -83,13 +83,13 @@ class ObRowDesc { int assign(const ObRowDesc& other); - private: +private: struct DescIndex { Desc desc_; int64_t idx_; }; - private: +private: static const int64_t MAX_COLUMNS_COUNT = common::OB_ROW_MAX_COLUMNS_COUNT; // 512 static uint64_t HASH_COLLISIONS_COUNT; // data members diff --git a/deps/oblib/src/common/row/ob_row_iterator.h b/deps/oblib/src/common/row/ob_row_iterator.h index f49c3d1db..ae5658e86 100644 --- a/deps/oblib/src/common/row/ob_row_iterator.h +++ b/deps/oblib/src/common/row/ob_row_iterator.h @@ -19,13 +19,13 @@ namespace oceanbase { namespace common { class ObNewRowIterator { - public: +public: enum IterType { Other = 0, ObTableScanIterator = 1, }; - public: +public: ObNewRowIterator() : type_(Other) {} explicit ObNewRowIterator(const IterType type) : type_(type) @@ -69,18 +69,18 @@ class ObNewRowIterator { return type_; } - private: +private: const IterType type_; }; class ObNewIterIterator { - public: +public: enum IterType { Other = 0, ObTableScanIterIterator = 1, }; - public: +public: ObNewIterIterator() : type_(Other) {} explicit ObNewIterIterator(const IterType type) : type_(type) @@ -95,13 +95,13 @@ class ObNewIterIterator { return type_; } - private: +private: const IterType type_; }; /// wrap one row as an iterator class ObSingleRowIteratorWrapper : public ObNewRowIterator { - public: +public: ObSingleRowIteratorWrapper(); ObSingleRowIteratorWrapper(ObNewRow* row); virtual ~ObSingleRowIteratorWrapper() @@ -117,11 +117,11 @@ class ObSingleRowIteratorWrapper : public ObNewRowIterator { iter_end_ = false; } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSingleRowIteratorWrapper); - private: +private: // data members ObNewRow* row_; bool iter_end_; @@ -148,7 +148,7 @@ inline int ObSingleRowIteratorWrapper::get_next_row(ObNewRow*& row) } class ObOuterRowIterator { - public: +public: ObOuterRowIterator() {} virtual ~ObOuterRowIterator() diff --git a/deps/oblib/src/common/row/ob_row_store.cpp b/deps/oblib/src/common/row/ob_row_store.cpp index 51dcef407..489d0dd49 100644 --- a/deps/oblib/src/common/row/ob_row_store.cpp +++ b/deps/oblib/src/common/row/ob_row_store.cpp @@ -85,7 +85,7 @@ struct ObRowStore::BlockInfo { const ObIArray& reserved_columns, const ObNewRow& row, int64_t payload, StoredRow*& stored_row); friend class ObRowStore::BlockList; - private: +private: #ifdef __clang__ int64_t magic_ [[gnu::unused]]; #else diff --git a/deps/oblib/src/common/row/ob_row_store.h b/deps/oblib/src/common/row/ob_row_store.h index d394e890d..487c34db5 100644 --- a/deps/oblib/src/common/row/ob_row_store.h +++ b/deps/oblib/src/common/row/ob_row_store.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace common { class ObRowStore { - public: +public: struct BlockInfo; // What is reserved_cells_ for? // In order by c1 and other calculations, not only must all the columns be written to the ObRowStore, but also need to @@ -41,7 +41,7 @@ class ObRowStore { TO_STRING_KV(N_PAYLOAD, payload_, N_CELLS, ObArrayWrap(reserved_cells_, reserved_cells_count_)); }; class Iterator : public ObOuterRowIterator { - public: + public: friend class ObRowStore; Iterator(); /// @param row [in/out] row.size_ is used to verify the data @@ -58,17 +58,17 @@ class ObRowStore { // @pre is_valid bool has_next() const; - private: + private: explicit Iterator(const ObRowStore* row_store); int next_iter_pos(const BlockInfo*& iter_block, int64_t& iter_pos); - protected: + protected: const ObRowStore* row_store_; const BlockInfo* cur_iter_block_; int64_t cur_iter_pos_; }; - public: +public: ObRowStore(ObIAllocator& alloc, const lib::ObLabel& label = ObModIds::OB_SQL_ROW_STORE, const uint64_t tenant_id = common::OB_SERVER_TENANT_ID, bool use_compact_row = true); ObRowStore(const lib::ObLabel& label = ObModIds::OB_SQL_ROW_STORE, @@ -239,7 +239,7 @@ class ObRowStore { TO_STRING_KV(N_BLOCK_SIZE, block_size_, N_DATA_SIZE, data_size_, N_BLOCK_NUM, blocks_.get_block_count(), N_ROW_COUNT, row_count_, N_COLUMN_COUNT, col_count_, N_READ_ONLY, is_read_only_); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRowStore); static const int64_t BIG_BLOCK_SIZE = OB_MALLOC_BIG_BLOCK_SIZE; @@ -247,7 +247,7 @@ class ObRowStore { // non-circular doubly linked list class BlockList { - public: + public: BlockList(); void reset(); int add_last(BlockInfo* block); @@ -281,14 +281,14 @@ class ObRowStore { return 0 == count_; } - private: + private: BlockInfo* first_; BlockInfo* last_; int64_t count_; int64_t used_mem_size_; // bytes of all blocks }; - private: +private: static int64_t get_reserved_cells_size(const int64_t reserved_columns_count); int add_row_by_projector(const ObNewRow& row, const StoredRow*& stored_row, int64_t payload); int init_pre_project_row(int64_t count); @@ -304,7 +304,7 @@ class ObRowStore { void del_block_list(BlockInfo* del_block); int adjust_row_cells_reference(); - private: +private: // @TODO: add control for tenant_id DefaultPageAllocator inner_alloc_; ObFixedArray reserved_columns_; diff --git a/deps/oblib/src/common/row/ob_row_util.h b/deps/oblib/src/common/row/ob_row_util.h index 77a6fc715..1c1941e86 100644 --- a/deps/oblib/src/common/row/ob_row_util.h +++ b/deps/oblib/src/common/row/ob_row_util.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObRowUtil { - public: +public: static int convert(const common::ObString& compact_row, ObNewRow& row); static int convert(const char* compact_row, int64_t buf_len, ObNewRow& row); static int compare_row(const ObNewRow& lrow, const ObNewRow& rrow, int& cmp); diff --git a/deps/oblib/src/common/rowkey/ob_rowkey.h b/deps/oblib/src/common/rowkey/ob_rowkey.h index 162588adb..12cc1dab8 100644 --- a/deps/oblib/src/common/rowkey/ob_rowkey.h +++ b/deps/oblib/src/common/rowkey/ob_rowkey.h @@ -30,7 +30,7 @@ class ObRowkeyInfo; class ObStoreRowkey; class ObRowkey { - public: +public: ObRowkey() : obj_ptr_(NULL), obj_cnt_(0) {} ObRowkey(ObObj* ptr, const int64_t cnt) : obj_ptr_(ptr), obj_cnt_(cnt) @@ -38,7 +38,7 @@ class ObRowkey { ~ObRowkey() {} - public: +public: int to_store_rowkey(ObStoreRowkey& store_rowkey) const; void reset() { @@ -164,7 +164,7 @@ class ObRowkey { } static int get_common_prefix_length(const ObRowkey& lhs, const ObRowkey& rhs, int64_t& prefix_len); - public: +public: int equal(const ObRowkey& rhs, bool& is_equal) const; bool simple_equal(const ObRowkey& rhs) const; // FIXME temporarily, rowkey compare with column order use seperate func @@ -286,11 +286,11 @@ class ObRowkey { return compare(rhs) != 0; } - private: +private: ObObj* obj_ptr_; int64_t obj_cnt_; - public: +public: static ObObj MIN_OBJECT; static ObObj MAX_OBJECT; static ObRowkey MIN_ROWKEY; diff --git a/deps/oblib/src/common/rowkey/ob_rowkey_info.h b/deps/oblib/src/common/rowkey/ob_rowkey_info.h index b64ad4b4d..411d86006 100644 --- a/deps/oblib/src/common/rowkey/ob_rowkey_info.h +++ b/deps/oblib/src/common/rowkey/ob_rowkey_info.h @@ -52,7 +52,7 @@ struct ObRowkeyColumn { }; class ObRowkeyInfo { - public: +public: ObRowkeyInfo(); explicit ObRowkeyInfo(ObIAllocator* allocator); ~ObRowkeyInfo(); @@ -107,7 +107,7 @@ class ObRowkeyInfo { int get_column_ids(ObBitSet<>& column_ids) const; NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: int expand(const int64_t size); static const int64_t DEFAULT_ROWKEY_COLUMN_ARRAY_CAPACITY = 8; ObRowkeyColumn* columns_; diff --git a/deps/oblib/src/common/rowkey/ob_store_rowkey.h b/deps/oblib/src/common/rowkey/ob_store_rowkey.h index cdc5b5dec..a1999d12f 100644 --- a/deps/oblib/src/common/rowkey/ob_store_rowkey.h +++ b/deps/oblib/src/common/rowkey/ob_store_rowkey.h @@ -26,7 +26,7 @@ namespace common { * FIXME-: reduce some of the log levels once the code stablizes */ class ObStoreRowkey { - public: +public: ObStoreRowkey() : key_(), hash_(0) {} ObStoreRowkey(ObObj* ptr, const int64_t cnt) @@ -224,7 +224,7 @@ class ObStoreRowkey { return key_.compare_prefix(rhs.key_, cmp); } - public: +public: inline bool operator==(const ObStoreRowkey& rhs) const { return simple_equal(rhs); @@ -274,13 +274,13 @@ class ObStoreRowkey { static ObStoreRowkey MIN_STORE_ROWKEY; static ObStoreRowkey MAX_STORE_ROWKEY; - private: +private: enum MinMaxFlag { MIN, MAX }; int set_min_max(const ObIArray& column_orders, ObIAllocator& allocator, MinMaxFlag min_or_max); int is_min_max(const ObIArrayWrap& column_orders, const int64_t rowkey_cnt, bool& is_min_max, MinMaxFlag min_or_max) const; - private: +private: ObRowkey key_; // only used as a container for ObObjs mutable uint64_t hash_; }; @@ -289,7 +289,7 @@ class ObStoreRowkey { // (no need to convert to collation_free multiple times) // Only used in the storage layer. class ObExtStoreRowkey { - public: +public: ObExtStoreRowkey(); explicit ObExtStoreRowkey(const ObStoreRowkey& store_rowkey); ObExtStoreRowkey(const ObStoreRowkey& store_rowkey, const ObStoreRowkey& collation_free_store_rowkey); @@ -363,7 +363,7 @@ class ObExtStoreRowkey { TO_STRING_KV( K_(store_rowkey), K_(collation_free_store_rowkey), K_(range_cut_pos), K_(range_check_min), K_(range_array_idx)); - private: +private: ObStoreRowkey store_rowkey_; ObStoreRowkey collation_free_store_rowkey_; int16_t range_cut_pos_; // cut-off from min/max object diff --git a/deps/oblib/src/common/server_framework/ob_priority_scheduler.h b/deps/oblib/src/common/server_framework/ob_priority_scheduler.h index da0b31f81..a6ddeed4b 100644 --- a/deps/oblib/src/common/server_framework/ob_priority_scheduler.h +++ b/deps/oblib/src/common/server_framework/ob_priority_scheduler.h @@ -38,7 +38,7 @@ inline v4si v4si_gt0(v4si x_) return is_gt0; } class ObPriorityScheduler { - public: +public: ObPriorityScheduler() { v4si quota = {1, 1, 1, 1}; @@ -50,7 +50,7 @@ class ObPriorityScheduler { ~ObPriorityScheduler() {} - public: +public: void set_quota(v4si quota) __attribute__((always_inline)) { quota_ = quota; diff --git a/deps/oblib/src/lib/alloc/abit_set.h b/deps/oblib/src/lib/alloc/abit_set.h index ab2a3c3b8..dea3dba97 100644 --- a/deps/oblib/src/lib/alloc/abit_set.h +++ b/deps/oblib/src/lib/alloc/abit_set.h @@ -24,7 +24,7 @@ namespace lib { // Thread unsafe, three level BitSet class ABitSet { - public: +public: ABitSet(int nbits, char* buf) : nbits_(nbits), use_zero_level_(nbits_ >= (1 << 6 << 6)), @@ -115,13 +115,13 @@ class ABitSet { return ret; } - private: +private: int myffsl(uint64_t v, int pos) const { return ffsl(v & ~((1UL << pos) - 1)); } - private: +private: const int nbits_; const bool use_zero_level_; uint64_t zero_level_; diff --git a/deps/oblib/src/lib/alloc/alloc_failed_reason.h b/deps/oblib/src/lib/alloc/alloc_failed_reason.h index 9c28dbe1f..bb28e5ba7 100644 --- a/deps/oblib/src/lib/alloc/alloc_failed_reason.h +++ b/deps/oblib/src/lib/alloc/alloc_failed_reason.h @@ -27,7 +27,7 @@ enum AllocFailedReason { }; struct AllocFailedCtx { - public: +public: int reason_; int64_t alloc_size_; union { diff --git a/deps/oblib/src/lib/alloc/alloc_interface.h b/deps/oblib/src/lib/alloc/alloc_interface.h index 63129b531..3f6201f44 100644 --- a/deps/oblib/src/lib/alloc/alloc_interface.h +++ b/deps/oblib/src/lib/alloc/alloc_interface.h @@ -24,21 +24,21 @@ namespace oceanbase { namespace lib { class ObTenantCtxAllocator; class IBlockMgr { - public: +public: virtual ABlock* alloc_block(uint64_t size, const ObMemAttr& attr) = 0; virtual void free_block(ABlock* block) = 0; virtual ObTenantCtxAllocator& get_tenant_ctx_allocator() = 0; }; // end of class IBlockMgr class ISetLocker { - public: +public: virtual void lock() = 0; virtual void unlock() = 0; virtual bool trylock() = 0; }; class SetDoNothingLocker : public ISetLocker { - public: +public: void lock() override {} void unlock() override @@ -50,7 +50,7 @@ class SetDoNothingLocker : public ISetLocker { }; class SetLocker : public ISetLocker { - public: +public: SetLocker(lib::ObMutex& mutex) : mutex_(mutex) {} void lock() override @@ -66,12 +66,12 @@ class SetLocker : public ISetLocker { return 0 == mutex_.trylock(); } - private: +private: lib::ObMutex& mutex_; }; class SetLockerForLogger : public ISetLocker { - public: +public: SetLockerForLogger(lib::ObMutex& mutex) : mutex_(mutex), is_disable_(false) {} void lock() override @@ -95,7 +95,7 @@ class SetLockerForLogger : public ISetLocker { return succ; } - private: +private: lib::ObMutex& mutex_; bool is_disable_; }; diff --git a/deps/oblib/src/lib/alloc/alloc_struct.h b/deps/oblib/src/lib/alloc/alloc_struct.h index f9e9d5db1..d23ac8ddd 100644 --- a/deps/oblib/src/lib/alloc/alloc_struct.h +++ b/deps/oblib/src/lib/alloc/alloc_struct.h @@ -385,7 +385,7 @@ ObLabel AObject::label() const class Label { constexpr static int MAX_LEN = AOBJECT_LABEL_SIZE; - public: +public: Label() : label_(nullptr) {} Label(const char* str) : label_(str) @@ -403,11 +403,11 @@ class Label { } const char* label_; - private: +private: static void fmt(char* buf, int64_t buf_len, int64_t& pos, const char* str); static void fmt(char* buf, int64_t buf_len, int64_t& pos, int64_t digit); - private: +private: char buf_[MAX_LEN + 1]; }; diff --git a/deps/oblib/src/lib/alloc/block_set.h b/deps/oblib/src/lib/alloc/block_set.h index 6d76ed0b6..c4a84d8f9 100644 --- a/deps/oblib/src/lib/alloc/block_set.h +++ b/deps/oblib/src/lib/alloc/block_set.h @@ -26,7 +26,7 @@ class ISetLocker; class BlockSet { friend class ObTenantCtxAllocator; - public: +public: BlockSet(); ~BlockSet(); @@ -52,7 +52,7 @@ class BlockSet { locker_ = locker; } - private: +private: DISALLOW_COPY_AND_ASSIGN(BlockSet); void add_free_block(ABlock* block); @@ -63,7 +63,7 @@ class BlockSet { void free_chunk(AChunk* const chunk); void check_block(ABlock* block); - private: +private: lib::ObMutex mutex_; // block_list_ can not be initialized, the state is maintained by avail_bm_ union { diff --git a/deps/oblib/src/lib/alloc/memory_dump.h b/deps/oblib/src/lib/alloc/memory_dump.h index d991a2925..c406ecc51 100644 --- a/deps/oblib/src/lib/alloc/memory_dump.h +++ b/deps/oblib/src/lib/alloc/memory_dump.h @@ -36,7 +36,7 @@ namespace common { enum DumpType { DUMP_CONTEXT, DUMP_CHUNK, STAT_LABEL }; class ObMemoryDumpTask { - public: +public: TO_STRING_KV(K(type_), K(dump_all_), KP(p_context_), K(slot_idx_), K(dump_tenant_ctx_), K(tenant_id_), K(ctx_id_), KP(p_chunk_)); DumpType type_; @@ -79,7 +79,7 @@ struct LabelItem { }; class LabelMap : public common::hash::ObHashMap { - public: +public: common::ObLocalModSet* mod_set_ = nullptr; }; @@ -87,10 +87,10 @@ using lib::ABlock; using lib::AChunk; using lib::AObject; class ObMemoryDump : public lib::TGRunnable { - public: +public: static constexpr const char* LOG_FILE = "log/memory_meta"; - private: +private: friend class observer::ObAllVirtualMemoryInfo; friend class lib::ObTenantCtxAllocator; @@ -130,7 +130,7 @@ class ObMemoryDump : public lib::TGRunnable { char log_buf_[LOG_BUF_LEN]; }; - public: +public: ObMemoryDump(); ~ObMemoryDump(); static ObMemoryDump& get_instance(); @@ -162,14 +162,14 @@ class ObMemoryDump : public lib::TGRunnable { avaliable_task_set_ |= (1 << pos); } - private: +private: void run1() override; void handle(void* task); - private: +private: AChunk* find_chunk(void* ptr); - private: +private: ObLightyQueue queue_; lib::ObMutex task_mutex_; ObMemoryDumpTask tasks_[TASK_NUM]; diff --git a/deps/oblib/src/lib/alloc/ob_malloc_allocator.h b/deps/oblib/src/lib/alloc/ob_malloc_allocator.h index c884500ab..132593a3d 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_allocator.h +++ b/deps/oblib/src/lib/alloc/ob_malloc_allocator.h @@ -28,7 +28,7 @@ class ObMallocAllocator : public common::ObIAllocator { friend class ObMemoryCutter; static const uint64_t PRESERVED_TENANT_COUNT = 10000; - public: +public: ObMallocAllocator(); virtual ~ObMallocAllocator(); @@ -67,14 +67,14 @@ class ObMallocAllocator : public common::ObIAllocator { const uint64_t tenant_id, const uint64_t ctx_id, const int64_t size, const bool reserve = false); int get_chunks(AChunk** chunks, int cap, int& cnt); - private: +private: using InvokeFunc = std::function; static int with_resource_handle_invoke(uint64_t tenant_id, InvokeFunc func); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMallocAllocator); - private: +private: obsys::CRWLock locks_[PRESERVED_TENANT_COUNT]; ObTenantCtxAllocator* allocators_[PRESERVED_TENANT_COUNT][common::ObCtxIds::MAX_CTX_ID]; int64_t reserved_; diff --git a/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h b/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h index 921acab11..dfc8110cb 100644 --- a/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h +++ b/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h @@ -45,7 +45,7 @@ class ObTenantCtxAllocator : public common::ObIAllocator, private common::ObLink }; using InvokeFunc = std::function; - public: +public: explicit ObTenantCtxAllocator(uint64_t tenant_id, uint64_t ctx_id = 0) : resource_handle_(), tenant_id_(tenant_id), @@ -268,7 +268,7 @@ class ObTenantCtxAllocator : public common::ObIAllocator, private common::ObLink return &w_mod_set_; } - private: +private: void print_usage() const; AChunk* pop_chunk(); void push_chunk(AChunk* chunk); @@ -284,7 +284,7 @@ class ObTenantCtxAllocator : public common::ObIAllocator, private common::ObLink return ret; } - private: +private: ObTenantResourceMgrHandle resource_handle_; uint64_t tenant_id_; uint64_t ctx_id_; diff --git a/deps/oblib/src/lib/alloc/object_mgr.h b/deps/oblib/src/lib/alloc/object_mgr.h index cee2d3d6c..f7fe4a30b 100644 --- a/deps/oblib/src/lib/alloc/object_mgr.h +++ b/deps/oblib/src/lib/alloc/object_mgr.h @@ -27,7 +27,7 @@ namespace lib { class SubObjectMgr : public IBlockMgr { friend class ObTenantCtxAllocator; - public: +public: SubObjectMgr(const bool for_logger) : mutex_(common::ObLatchIds::ALLOC_OBJECT_LOCK), mod_set_(), @@ -85,7 +85,7 @@ class SubObjectMgr : public IBlockMgr { return bs_.get_tenant_ctx_allocator(); } - private: +private: lib::ObMutex mutex_; common::ObLocalModSet mod_set_; SetLocker normal_locker_; @@ -97,7 +97,7 @@ class SubObjectMgr : public IBlockMgr { template class ObjectMgr : public IBlockMgr { - public: +public: ObjectMgr(ObTenantCtxAllocator& allocator, uint64_t tenant_id, uint64_t ctx_id); ~ObjectMgr(); @@ -113,11 +113,11 @@ class ObjectMgr : public IBlockMgr { common::ObModItem get_mod_usage(int mod_id) const; void print_usage() const; - private: +private: SubObjectMgr* create_sub_mgr(); void destroy_sub_mgr(SubObjectMgr* sub_mgr); - public: +public: ObTenantCtxAllocator& ta_; const ObMemAttr attr_; const int sub_cnt_; diff --git a/deps/oblib/src/lib/alloc/object_set.h b/deps/oblib/src/lib/alloc/object_set.h index 72585e6b0..809244d24 100644 --- a/deps/oblib/src/lib/alloc/object_set.h +++ b/deps/oblib/src/lib/alloc/object_set.h @@ -39,7 +39,7 @@ class ObjectSet { typedef AObject* FreeList; typedef ABitSet BitMap; - public: +public: ObjectSet(MemoryContext* mem_context = nullptr, const uint32_t ablock_size = INTACT_NORMAL_AOBJECT_SIZE); ~ObjectSet(); @@ -78,7 +78,7 @@ class ObjectSet { inline int64_t get_normal_used() const; inline int64_t get_normal_alloc() const; - private: +private: AObject* alloc_normal_object(const uint32_t cls, const ObMemAttr& attr); AObject* alloc_big_object(const uint64_t size, const ObMemAttr& attr); @@ -100,7 +100,7 @@ class ObjectSet { void do_free_object(AObject* obj); void do_free_dirty_list(); - private: +private: MemoryContext* mem_context_; ISetLocker* locker_; common::ObLocalModSet* mod_set_; diff --git a/deps/oblib/src/lib/allocator/ob_adapter_allocator.h b/deps/oblib/src/lib/allocator/ob_adapter_allocator.h index cd85f90a2..ed6475cc7 100644 --- a/deps/oblib/src/lib/allocator/ob_adapter_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_adapter_allocator.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace common { class AdapterAllocator { - public: +public: AdapterAllocator() : buffer_(NULL), pos_(0) {} ~AdapterAllocator() @@ -38,7 +38,7 @@ class AdapterAllocator { UNUSED(buf); } - private: +private: char* buffer_; int64_t pos_; }; diff --git a/deps/oblib/src/lib/allocator/ob_allocator.h b/deps/oblib/src/lib/allocator/ob_allocator.h index 4fd05ef1e..795f85e6f 100644 --- a/deps/oblib/src/lib/allocator/ob_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_allocator.h @@ -25,10 +25,10 @@ namespace common { using lib::ObMemAttr; extern ObMemAttr default_memattr; class ObIAllocator { - public: +public: virtual ~ObIAllocator(){}; - public: +public: /************************************************************************/ /* New Interface (Under construction) */ /************************************************************************/ @@ -95,7 +95,7 @@ class ObIAllocator { extern ObIAllocator* global_default_allocator; class ObWrapperAllocator : public ObIAllocator { - public: +public: explicit ObWrapperAllocator(ObIAllocator* alloc) : alloc_(alloc){}; explicit ObWrapperAllocator(const lib::ObLabel& label) : alloc_(NULL) { @@ -140,13 +140,13 @@ class ObWrapperAllocator : public ObIAllocator { return offsetof(ObWrapperAllocator, alloc_) * 8; } - private: +private: // data members ObIAllocator* alloc_; }; class ObWrapperAllocatorWithAttr : public ObWrapperAllocator { - public: +public: explicit ObWrapperAllocatorWithAttr(ObIAllocator* alloc, ObMemAttr attr = ObMemAttr()) : ObWrapperAllocator(alloc), mem_attr_(attr){}; explicit ObWrapperAllocatorWithAttr(const lib::ObLabel& label) : ObWrapperAllocator(NULL), mem_attr_() @@ -163,7 +163,7 @@ class ObWrapperAllocatorWithAttr : public ObWrapperAllocator { return ObWrapperAllocator::alloc(sz, mem_attr_); }; - private: +private: ObMemAttr mem_attr_; }; } // namespace common diff --git a/deps/oblib/src/lib/allocator/ob_allocator_v2.h b/deps/oblib/src/lib/allocator/ob_allocator_v2.h index 543553bc4..eec6383c8 100644 --- a/deps/oblib/src/lib/allocator/ob_allocator_v2.h +++ b/deps/oblib/src/lib/allocator/ob_allocator_v2.h @@ -35,7 +35,7 @@ class ObAllocator : public ObIAllocator { friend class lib::MemoryContext; friend class ObParallelAllocator; - public: +public: ObAllocator(MemoryContext* mem_context, const ObMemAttr& attr = default_memattr, const bool use_pm = false, const uint32_t ablock_size = lib::INTACT_NORMAL_AOBJECT_SIZE); void* alloc(const int64_t size) override @@ -55,7 +55,7 @@ class ObAllocator : public ObIAllocator { return pm_; } - private: +private: int init(); void lock() { @@ -70,7 +70,7 @@ class ObAllocator : public ObIAllocator { return locker_->trylock(); } - private: +private: MemoryContext* mem_context_; ObMemAttr attr_; const bool use_pm_; @@ -140,7 +140,7 @@ class ObParallelAllocator : public ObIAllocator { // Maximum concurrency static const int N = 8; - public: +public: ObParallelAllocator(ObAllocator& root_allocator, MemoryContext* mem_context, const ObMemAttr& attr = default_memattr, const int parallel = 4, const uint32_t ablock_size = lib::INTACT_NORMAL_AOBJECT_SIZE); virtual ~ObParallelAllocator(); @@ -157,10 +157,10 @@ class ObParallelAllocator : public ObIAllocator { } int64_t used() const override; - private: +private: int init(); - private: +private: ObAllocator& root_allocator_; MemoryContext* mem_context_; ObMemAttr attr_; diff --git a/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.h b/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.h index e991025ad..384369870 100644 --- a/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.h +++ b/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.h @@ -21,7 +21,7 @@ class ObBlockAllocMgr; extern ObBlockAllocMgr default_blk_alloc; class ObBlockAllocMgr { - public: +public: ObBlockAllocMgr(int64_t limit = INT64_MAX) : limit_(limit), hold_(0) {} ~ObBlockAllocMgr() @@ -66,7 +66,7 @@ class ObBlockAllocMgr { return ((limit_ - hold_) > size); } - private: +private: int64_t limit_; int64_t hold_; }; diff --git a/deps/oblib/src/lib/allocator/ob_buddy_allocator.h b/deps/oblib/src/lib/allocator/ob_buddy_allocator.h index 01a742cf9..756a32929 100644 --- a/deps/oblib/src/lib/allocator/ob_buddy_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_buddy_allocator.h @@ -20,7 +20,7 @@ namespace common { class ObBuddyAllocator : public common::ObIAllocator { friend class ::BuddyAllocatorTest; - public: +public: ObBuddyAllocator(ObIAllocator& alloc); ~ObBuddyAllocator(); int32_t init(const int64_t min_block_size); @@ -30,12 +30,12 @@ class ObBuddyAllocator : public common::ObIAllocator { int print_info(char* buf, const int64_t buf_len, int64_t& pos) const; - protected: +protected: int32_t fix_index_array(int32_t order); bool find_buddy(int64_t index, int64_t& buddy_index, int32_t order) const; void* compute_addr_in(int64_t index, int32_t order) const; - private: +private: // uncopyable class ObBuddyAllocator(const ObBuddyAllocator&); ObBuddyAllocator& operator=(const ObBuddyAllocator&); @@ -49,7 +49,7 @@ class ObBuddyAllocator : public common::ObIAllocator { int32_t combine_free(int64_t index, int64_t buddy_index, int32_t current_order); int32_t single_free(void*& ptr, int64_t index, int32_t order); - private: +private: static const int MAX_MEMORY_ORDER = 20; // max alloc 1MB memory static const int MAX_AREA_SIZE = MAX_MEMORY_ORDER + 10; bool inited_; diff --git a/deps/oblib/src/lib/allocator/ob_cached_allocator.h b/deps/oblib/src/lib/allocator/ob_cached_allocator.h index 3ee80a048..48bfa200b 100644 --- a/deps/oblib/src/lib/allocator/ob_cached_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_cached_allocator.h @@ -21,7 +21,7 @@ namespace common { // @note thread-safe template class ObCachedAllocator { - public: +public: ObCachedAllocator(); virtual ~ObCachedAllocator(); @@ -36,11 +36,11 @@ class ObCachedAllocator { return cached_count_; }; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCachedAllocator); - private: +private: // data members ObSpinLock lock_; ObPool<> pool_; diff --git a/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h b/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h index 628514174..467504418 100644 --- a/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h @@ -17,11 +17,11 @@ namespace oceanbase { namespace common { class ObConcurrentFIFOAllocator : public common::ObIAllocator { - public: +public: ObConcurrentFIFOAllocator(); virtual ~ObConcurrentFIFOAllocator(); - public: +public: int init(const int64_t total_limit, const int64_t hold_limit, const int64_t page_size); int init(const int64_t total_limit, const int64_t hold_limit, const int64_t tenant_id, const lib::ObLabel& label, @@ -30,7 +30,7 @@ class ObConcurrentFIFOAllocator : public common::ObIAllocator { int init(const int64_t page_size, const lib::ObLabel& label, const uint64_t tenant_id, const int64_t total_limit); void destroy(); - public: +public: void set_label(const lib::ObLabel& label); void* alloc(const int64_t size); void* alloc(const int64_t size, const ObMemAttr& attr); @@ -43,13 +43,13 @@ class ObConcurrentFIFOAllocator : public common::ObIAllocator { int set_hold_limit(int64_t hold_limit); void set_total_limit(int64_t total_limit); - private: +private: static const int64_t STORAGE_SIZE_TIMES = 2; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObConcurrentFIFOAllocator); - private: +private: ObLfFIFOAllocator inner_allocator_; }; } // namespace common diff --git a/deps/oblib/src/lib/allocator/ob_ctx_parallel_define.h b/deps/oblib/src/lib/allocator/ob_ctx_parallel_define.h index 1a4accd62..599e613e8 100644 --- a/deps/oblib/src/lib/allocator/ob_ctx_parallel_define.h +++ b/deps/oblib/src/lib/allocator/ob_ctx_parallel_define.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { struct ObCtxParallel { - public: +public: ObCtxParallel() { for (int64_t i = 0; i < ObCtxIds::MAX_CTX_ID; i++) { @@ -41,7 +41,7 @@ struct ObCtxParallel { return p; } - private: +private: const static int DEFAULT_CTX_PARALLEL = 8; int parallel_[ObCtxIds::MAX_CTX_ID]; }; diff --git a/deps/oblib/src/lib/allocator/ob_delay_free_allocator.h b/deps/oblib/src/lib/allocator/ob_delay_free_allocator.h index ff54ebadf..612909093 100644 --- a/deps/oblib/src/lib/allocator/ob_delay_free_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_delay_free_allocator.h @@ -27,7 +27,7 @@ namespace common { // obj_count_ sub 1. If the "obj_count_" of a MemBlock become 0 after a free action, this MemBlock // can be recycled. After expire duration time, a recycled MemBlock can be freed. class ObDelayFreeMemBlock : public common::ObDLinkBase { - public: +public: explicit ObDelayFreeMemBlock(char* end); virtual ~ObDelayFreeMemBlock(); inline int64_t remain() const; @@ -40,14 +40,14 @@ class ObDelayFreeMemBlock : public common::ObDLinkBase { inline void free(void* ptr); inline void reuse(); - private: +private: int64_t free_timestamp_; int64_t obj_count_; char* end_; char* current_; char data_[0]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDelayFreeMemBlock); }; @@ -58,7 +58,7 @@ class ObDelayFreeMemBlock : public common::ObDLinkBase { // from free list to working list. If the size of free list exceeds MAX_CACHE_MEMORY_SIZE, the expi- // red memblock will be freed. class ObDelayFreeAllocator : public ObIAllocator { - public: +public: ObDelayFreeAllocator(); virtual ~ObDelayFreeAllocator(); int init(const lib::ObLabel& label, const bool is_thread_safe, const int64_t expire_duration_us); @@ -75,7 +75,7 @@ class ObDelayFreeAllocator : public ObIAllocator { inline int64_t get_memory_fragment_size() const; inline int64_t get_total_size() const; - private: +private: struct DataMeta { int64_t data_len_; ObDelayFreeMemBlock* mem_block_; @@ -84,12 +84,12 @@ class ObDelayFreeAllocator : public ObIAllocator { static const int64_t MEM_BLOCK_DATA_SIZE = MEM_BLOCK_SIZE - sizeof(ObDelayFreeMemBlock); static const int64_t MAX_CACHE_MEMORY_SIZE = OB_MALLOC_BIG_BLOCK_SIZE * 32; - private: +private: ObDelayFreeMemBlock* alloc_block(const int64_t data_size); void free_block(ObDelayFreeMemBlock* block); void free_list(ObDList& list); - private: +private: ObDList working_list_; ObDList free_list_; int64_t cache_memory_size_; @@ -101,7 +101,7 @@ class ObDelayFreeAllocator : public ObIAllocator { lib::ObMutex mutex_; bool inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDelayFreeAllocator); }; diff --git a/deps/oblib/src/lib/allocator/ob_external_ref.h b/deps/oblib/src/lib/allocator/ob_external_ref.h index da2712e1d..f544f49b5 100644 --- a/deps/oblib/src/lib/allocator/ob_external_ref.h +++ b/deps/oblib/src/lib/allocator/ob_external_ref.h @@ -19,10 +19,10 @@ namespace oceanbase { namespace common { class ObExternalRef { - public: +public: enum { REF_LIMIT = OB_MAX_CPU_NUM * 16 }; class IERefPtr { - public: + public: IERefPtr() : next_(NULL) {} virtual ~IERefPtr() @@ -104,7 +104,7 @@ class ObExternalRef { } } - private: +private: void* load_ptr(void** paddr) { return (void*)(((uint64_t)ATOMIC_LOAD(paddr)) & ~1ULL); @@ -143,7 +143,7 @@ class ObExternalRef { return h; } - private: +private: int64_t ref_array_[REF_LIMIT]; }; }; // end namespace common diff --git a/deps/oblib/src/lib/allocator/ob_fifo_allocator.h b/deps/oblib/src/lib/allocator/ob_fifo_allocator.h index 6673ff284..b6f43e768 100644 --- a/deps/oblib/src/lib/allocator/ob_fifo_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_fifo_allocator.h @@ -34,7 +34,7 @@ class ObFIFOAllocator : public common::ObIAllocator { friend class ::ObFIFOAllocatorNormalPageListTest; friend class UsedTotalChecker; - private: +private: static const int32_t PAGE_HEADER = 0xe1fba00c; // Alloc Header Magic Number. f1f0allc for FIFOALLC static const int32_t ALLOC_HEADER = 0xf1f0a11c; @@ -42,7 +42,7 @@ class ObFIFOAllocator : public common::ObIAllocator { static const int32_t ALREADY_FREE = 0xf5eebef0; static const int64_t SPECIAL_FLAG = -1; - public: +public: struct BasePageHeader { using LinkedNode = common::ObDLinkNode; BasePageHeader() : magic_num_(PAGE_HEADER) @@ -77,7 +77,7 @@ class ObFIFOAllocator : public common::ObIAllocator { BasePageHeader* page_header_; } __attribute__((aligned(16))); - public: +public: explicit ObFIFOAllocator(const uint64_t tenant_id = OB_SERVER_TENANT_ID); ~ObFIFOAllocator(); @@ -122,7 +122,7 @@ class ObFIFOAllocator : public common::ObIAllocator { return normal_total() + special_total_; } - private: +private: BasePageHeader* get_page_header(void* p); bool check_param(const int64_t size, const int64_t align); bool check_magic(void* p, int64_t& size); @@ -140,7 +140,7 @@ class ObFIFOAllocator : public common::ObIAllocator { void free_special(SpecialPageHeader* page); int sync_idle(const int64_t idle_size, const int64_t max_size); - private: +private: bool is_inited_; ObIAllocator* allocator_; int64_t page_size_; @@ -155,7 +155,7 @@ class ObFIFOAllocator : public common::ObIAllocator { int64_t special_total_; mutable ObSpinLock lock_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFIFOAllocator); }; diff --git a/deps/oblib/src/lib/allocator/ob_fixed_size_block_allocator.h b/deps/oblib/src/lib/allocator/ob_fixed_size_block_allocator.h index 1ba39f511..1f4a1fa4a 100644 --- a/deps/oblib/src/lib/allocator/ob_fixed_size_block_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_fixed_size_block_allocator.h @@ -34,7 +34,7 @@ struct ObFixedSizeBufAllocInfo { // caller can acquire and release the pre divided block buffer. template class ObFixedSizeBlockAllocator { - public: +public: virtual ~ObFixedSizeBlockAllocator(); int init(const int64_t block_num, const lib::ObLabel& label = ObModIds::OB_FIXED_SIZE_BLOCK_ALLOCATOR); void destroy(); @@ -56,16 +56,16 @@ class ObFixedSizeBlockAllocator { return max_block_num_; } - private: +private: ObFixedSizeBlockAllocator(); int init_max_block_num(); int expand(const int64_t block_num); bool contains_internal(void* ptr) const; - public: +public: static const int64_t MAX_MEMORY_ALLOCATION = OB_MAX_SYS_BKGD_THREAD_NUM * 6 * OB_DEFAULT_MACRO_BLOCK_SIZE; - private: +private: static const int64_t MAX_MEMORY_IN_MINI_MODE = 128 * 1024 * 1024; // 128MB bool is_inited_; @@ -87,7 +87,7 @@ template class ObFixedSizeBlockMemoryContext { static constexpr int INIT_BLOCK_NUM = 8; - public: +public: ObFixedSizeBlockMemoryContext(); virtual ~ObFixedSizeBlockMemoryContext(); @@ -107,7 +107,7 @@ class ObFixedSizeBlockMemoryContext { } int64_t get_used_block_num(); - private: +private: bool is_inited_; int64_t used_block_num_; ObFixedSizeBlockAllocator& fsb_allocator_; diff --git a/deps/oblib/src/lib/allocator/ob_hazard_ref.h b/deps/oblib/src/lib/allocator/ob_hazard_ref.h index d351e950a..8171973cd 100644 --- a/deps/oblib/src/lib/allocator/ob_hazard_ref.h +++ b/deps/oblib/src/lib/allocator/ob_hazard_ref.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class HazardRef { - public: +public: enum { MAX_THREAD_NUM = OB_MAX_THREAD_NUM, THREAD_REF_COUNT_LIMIT = 8, @@ -26,7 +26,7 @@ class HazardRef { }; const static uint64_t INVALID_VERSION = UINT64_MAX; - public: +public: explicit HazardRef(bool debug = false) : cur_ver_(1), debug_(debug) { for (int i = 0; i < TOTAL_REF_COUNT_LIMIT; i++) { @@ -54,13 +54,13 @@ class HazardRef { return min_version; } - private: +private: static uint64_t min(uint64_t x, uint64_t y) { return x < y ? x : y; } - private: +private: uint64_t cur_ver_ CACHE_ALIGNED; bool debug_; uint64_t ref_array_[TOTAL_REF_COUNT_LIMIT]; @@ -81,7 +81,7 @@ struct HazardNode { }; class HazardNodeList { - public: +public: HazardNodeList() : count_(0), tail_(&head_) { head_.next_ = &head_; @@ -137,14 +137,14 @@ class HazardNodeList { } } - private: +private: int64_t count_; HazardNode head_; HazardNode* tail_; }; class RetireList { - public: +public: enum { MAX_THREAD_NUM = OB_MAX_THREAD_NUM }; struct ThreadRetireList { ThreadRetireList() @@ -155,9 +155,9 @@ class RetireList { HazardNodeList prepare_list_; }; - public: +public: class RetireNodeIterator { - public: + public: explicit RetireNodeIterator(RetireList* host) : thread_offset_(0), host_(host) {} ~RetireNodeIterator() @@ -178,12 +178,12 @@ class RetireList { return ret_node; } - private: + private: int64_t thread_offset_; RetireList* host_; }; - public: +public: RetireList() : hazard_version_(0) {} virtual ~RetireList() @@ -215,7 +215,7 @@ class RetireList { } } - private: +private: HazardNode* reclaim_node(ThreadRetireList* retire_list) { HazardNode* p = NULL; @@ -234,13 +234,13 @@ class RetireList { return get_itid() < MAX_THREAD_NUM ? retire_list_ + get_itid() : NULL; } - private: +private: uint64_t hazard_version_ CACHE_ALIGNED; ThreadRetireList retire_list_[MAX_THREAD_NUM]; }; class HazardHandle { - public: +public: explicit HazardHandle(HazardRef& href) : href_(href), ref_(NULL) {} virtual ~HazardHandle() @@ -261,13 +261,13 @@ class HazardHandle { } } - private: +private: HazardRef& href_; uint64_t* ref_; }; class RetireListHandle { - public: +public: typedef HazardNode Node; typedef HazardNodeList NodeList; RetireListHandle(HazardRef& href, RetireList& retire_list) : href_(href), retire_list_(retire_list) @@ -313,7 +313,7 @@ class RetireListHandle { retire_list_.retire(node); } - private: +private: HazardRef& href_; RetireList& retire_list_; NodeList alloc_list_; diff --git a/deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h b/deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h index 3367a4ac6..8f1ce651a 100644 --- a/deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObLfFIFOAllocator : public ObIAllocator, public ObVSliceAlloc { - public: +public: typedef ObBlockAllocMgr BlockAlloc; static const int64_t DEFAULT_CACHE_PAGE_COUNT = 64; ObLfFIFOAllocator() @@ -45,7 +45,7 @@ class ObLfFIFOAllocator : public ObIAllocator, public ObVSliceAlloc { ObVSliceAlloc::purge_extra_cached_block(0); } - public: +public: void* alloc(const int64_t size) { return ObVSliceAlloc::alloc(size); @@ -80,7 +80,7 @@ class ObLfFIFOAllocator : public ObIAllocator, public ObVSliceAlloc { return get_block_using_ratio(ptr) < 0.8; } - private: +private: BlockAlloc block_alloc_; }; }; // namespace common diff --git a/deps/oblib/src/lib/allocator/ob_malloc.h b/deps/oblib/src/lib/allocator/ob_malloc.h index 3c228785d..3d678462f 100644 --- a/deps/oblib/src/lib/allocator/ob_malloc.h +++ b/deps/oblib/src/lib/allocator/ob_malloc.h @@ -74,7 +74,7 @@ void* ob_malloc_align(const int64_t alignment, const int64_t nbyte, const lib::O //////////////////////////////////////////////////////////////// class ObMalloc : public ObIAllocator { - public: +public: ObMalloc(){}; explicit ObMalloc(const lib::ObLabel& label) { @@ -84,7 +84,7 @@ class ObMalloc : public ObIAllocator { {} virtual ~ObMalloc(){}; - public: +public: void set_label(const lib::ObLabel& label) { memattr_.label_ = label; @@ -106,13 +106,13 @@ class ObMalloc : public ObIAllocator { ob_free(ptr); }; - private: +private: ObMemAttr memattr_; }; typedef ObMalloc ObTCMalloc; class ObMemBuf { - public: +public: ObMemBuf() : buf_ptr_(NULL), buf_size_(OB_MALLOC_NORMAL_BLOCK_SIZE), label_(ObModIds::OB_MOD_DO_NOT_USE_ME) {} @@ -140,18 +140,18 @@ class ObMemBuf { int ensure_space(const int64_t size, const lib::ObLabel& label = nullptr); - private: +private: char* buf_ptr_; int64_t buf_size_; lib::ObLabel label_; }; class ObMemBufAllocatorWrapper : public ObIAllocator { - public: +public: ObMemBufAllocatorWrapper(ObMemBuf& mem_buf, const lib::ObLabel& label = nullptr) : mem_buf_(mem_buf), label_(label) {} - public: +public: virtual void* alloc(int64_t sz) { char* ptr = NULL; @@ -170,17 +170,17 @@ class ObMemBufAllocatorWrapper : public ObIAllocator { UNUSED(ptr); } - private: +private: ObMemBuf& mem_buf_; lib::ObLabel label_; }; class ObRawBufAllocatorWrapper : public ObIAllocator { - public: +public: ObRawBufAllocatorWrapper(char* mem_buf, int64_t mem_buf_len) : mem_buf_(mem_buf), mem_buf_len_(mem_buf_len) {} - public: +public: virtual void* alloc(int64_t sz) { char* ptr = NULL; @@ -199,7 +199,7 @@ class ObRawBufAllocatorWrapper : public ObIAllocator { UNUSED(ptr); } - private: +private: char* mem_buf_; int64_t mem_buf_len_; }; diff --git a/deps/oblib/src/lib/allocator/ob_mem_leak_checker.h b/deps/oblib/src/lib/allocator/ob_mem_leak_checker.h index 302e90539..6a00eaf02 100644 --- a/deps/oblib/src/lib/allocator/ob_mem_leak_checker.h +++ b/deps/oblib/src/lib/allocator/ob_mem_leak_checker.h @@ -49,7 +49,7 @@ class ObMemLeakChecker { typedef hash::ObHashMap mod_alloc_info_t; - public: +public: typedef hash::ObHashMap> mod_info_map_t; using TCharArray = char[lib::AOBJECT_LABEL_SIZE + 1]; @@ -254,7 +254,7 @@ class ObMemLeakChecker { return 0 == MEMCMP(&obj.label_[0], label_, len_); } - private: +private: // Limit the memory used by hashmap static constexpr int MEMORY_LIMIT = 128L << 20; static constexpr int MAP_SIZE_LIMIT = MEMORY_LIMIT / sizeof(Info); @@ -264,7 +264,7 @@ class ObMemLeakChecker { CONTEXT_CHECK, }; - private: +private: TCharArray origin_str_; union { struct { @@ -282,7 +282,7 @@ class ObMemLeakChecker { int len_; mod_alloc_info_t malloc_info_; - private: +private: static lib::ObSimpleRateLimiter rl_; }; }; // end namespace common diff --git a/deps/oblib/src/lib/allocator/ob_memfrag_recycle_allocator.h b/deps/oblib/src/lib/allocator/ob_memfrag_recycle_allocator.h index 5b2892865..fd910f500 100644 --- a/deps/oblib/src/lib/allocator/ob_memfrag_recycle_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_memfrag_recycle_allocator.h @@ -23,7 +23,7 @@ namespace common { // The interface of rewritable classes, which provides rewrite_switch methods to rewrite itself to // new memory. class ObIRewritable { - public: +public: ObIRewritable(); virtual ~ObIRewritable(); @@ -50,7 +50,7 @@ class ObIRewritable { // registered rewritable object to rewrite itself to current working allocator, at last free memory of // standby allocator after expire duration time. class ObMemfragRecycleAllocator : public ObIAllocator { - public: +public: ObMemfragRecycleAllocator(); virtual ~ObMemfragRecycleAllocator(); @@ -106,7 +106,7 @@ class ObMemfragRecycleAllocator : public ObIAllocator { int64_t get_all_alloc_size() const; int64_t get_cur_alloc_size() const; - private: +private: enum ObMemfragRecycleAllocatorState { INIT, SWITCHING_PREPARE, SWITCHING, SWITCHING_OVER }; static const int64_t META_MAGIC_NUM = 0x4D455441; @@ -125,7 +125,7 @@ class ObMemfragRecycleAllocator : public ObIAllocator { bool need_switch(ObDelayFreeAllocator& allocator); - private: +private: ObDelayFreeAllocator allocator_[2]; int64_t cur_allocator_pos_; enum ObMemfragRecycleAllocatorState state_; @@ -136,33 +136,33 @@ class ObMemfragRecycleAllocator : public ObIAllocator { lib::ObMutex mutex_; bool inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemfragRecycleAllocator); }; // A singleton which is used for recycling memory of all ObMemfragRecycleAllocator periodically. class ObMRAllocatorRecycler { - public: +public: static ObMRAllocatorRecycler& get_instance(); int register_allocator(ObMemfragRecycleAllocator* allocator); int deregister_allocator(ObMemfragRecycleAllocator* allocator); void recycle(); void set_schedule_interval_us(const int64_t interval_us); - private: +private: class SelfCreator { - public: + public: SelfCreator(); virtual ~SelfCreator(); }; class ObMRAllocatorRecycleTask : public ObTimerTask { - public: + public: ObMRAllocatorRecycleTask(); virtual ~ObMRAllocatorRecycleTask(); void runTimerTask(); }; - private: +private: ObMRAllocatorRecycler(); virtual ~ObMRAllocatorRecycler(); static const int64_t MAX_META_MEMORY_ALLOCATOR_COUNT = 8; @@ -174,7 +174,7 @@ class ObMRAllocatorRecycler { ObMemfragRecycleAllocator* allocators_[MAX_META_MEMORY_ALLOCATOR_COUNT]; bool is_scheduled_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMRAllocatorRecycler); }; diff --git a/deps/oblib/src/lib/allocator/ob_mod_define.h b/deps/oblib/src/lib/allocator/ob_mod_define.h index 4f745338c..50818709f 100644 --- a/deps/oblib/src/lib/allocator/ob_mod_define.h +++ b/deps/oblib/src/lib/allocator/ob_mod_define.h @@ -1248,7 +1248,7 @@ struct ObModItem { class ObLocalModSet { enum { MOD_COUNT_LIMIT = ObNewModIds::OB_MOD_END }; - public: +public: ObLocalModSet() { reset(); @@ -1286,7 +1286,7 @@ class ObLocalModSet { mods_[(mod_id >= 0 && mod_id < MOD_COUNT_LIMIT) ? mod_id : 0].update(hold, used); } - private: +private: ObModItem mods_[MOD_COUNT_LIMIT]; }; @@ -1299,7 +1299,7 @@ struct ObCtxIds { }; class ObCtxInfo { - public: +public: enum { CTX_COUNT_LIMIT = ObCtxIds::MAX_CTX_ID }; ObCtxInfo() : ctx_names_() @@ -1314,7 +1314,7 @@ class ObCtxInfo { return ctx_id < ObCtxIds::MAX_CTX_ID ? ctx_names_[ctx_id] : name; } - private: +private: void set_ctx_name(uint64_t ctx_id, const char* ctx_name) { if (ctx_id < ObCtxIds::MAX_CTX_ID) { @@ -1322,7 +1322,7 @@ class ObCtxInfo { } } - private: +private: const char* ctx_names_[CTX_COUNT_LIMIT]; }; @@ -1332,7 +1332,7 @@ inline bool is_valid_mod_id(int64_t mod_id) } class ObModSet { - public: +public: enum { MOD_COUNT_LIMIT = ObNewModIds::OB_MOD_END }; // You can pass the string uniformly where mod_id is used // No need to modify the ob_mod_define.h file @@ -1361,7 +1361,7 @@ class ObModSet { return t; } - private: +private: void set_mod_name(int64_t mod_id, const char* name) { if (mod_id >= 0 && mod_id < ObModSet::MOD_COUNT_LIMIT) { @@ -1369,7 +1369,7 @@ class ObModSet { } } - private: +private: const char* mod_names_[MOD_COUNT_LIMIT]; }; diff --git a/deps/oblib/src/lib/allocator/ob_page_manager.h b/deps/oblib/src/lib/allocator/ob_page_manager.h index a0d0ba41c..f25f13cb4 100644 --- a/deps/oblib/src/lib/allocator/ob_page_manager.h +++ b/deps/oblib/src/lib/allocator/ob_page_manager.h @@ -32,7 +32,7 @@ using lib::ObTenantCtxAllocator; using oceanbase::common::default_memattr; class ObPageManager : public lib::IBlockMgr { - public: +public: constexpr static int DEFAULT_CHUNK_CACHE_CNT = 2; constexpr static int MINI_MODE_CHUNK_CACHE_CNT = 0; RBNODE(ObPageManager, rblink); @@ -46,11 +46,11 @@ class ObPageManager : public lib::IBlockMgr { return ret; } - private: +private: friend class ObPageManagerCenter; friend class Thread; - public: +public: ObPageManager(); ~ObPageManager(); static ObPageManager* thread_local_instance() @@ -97,12 +97,12 @@ class ObPageManager : public lib::IBlockMgr { tl_instance_ = &instance; } - private: +private: int init(); static __thread ObPageManager* tl_instance_; static int64_t global_id_; - private: +private: int64_t id_; lib::ObMemAttr attr_; lib::BlockSet bs_; @@ -114,18 +114,18 @@ class ObPageManager : public lib::IBlockMgr { }; class ObPageManagerCenter { - public: +public: static ObPageManagerCenter& get_instance(); int register_pm(ObPageManager& pm); void unregister_pm(ObPageManager& pm); bool has_register(ObPageManager& pm) const; int print_tenant_stat(int64_t tenant_id, char* buf, int64_t len, int64_t& pos); - private: +private: ObPageManagerCenter(); int print_tenant_stat(int64_t tenant_id, int64_t& sum_used, int64_t& sum_hold, char* buf, int64_t len, int64_t& pos); - private: +private: lib::ObMutex mutex_; container::ObRbTree> rb_tree_; }; diff --git a/deps/oblib/src/lib/allocator/ob_pcounter.h b/deps/oblib/src/lib/allocator/ob_pcounter.h index 4e663b488..66446ee0c 100644 --- a/deps/oblib/src/lib/allocator/ob_pcounter.h +++ b/deps/oblib/src/lib/allocator/ob_pcounter.h @@ -60,7 +60,7 @@ inline int64_t get_cpu_num() } class PthreadSpinLock { - public: +public: PthreadSpinLock() { IGNORE_RETURN pthread_spin_init(&lock_, false); @@ -82,7 +82,7 @@ class PthreadSpinLock { IGNORE_RETURN pthread_spin_unlock(&lock_); } - private: +private: pthread_spinlock_t lock_; }; @@ -101,7 +101,7 @@ inline const PCounterDesc* get_pcounter_desc(int mod) } class PCounterSet { - public: +public: PCounterSet() { memset(counters_, 0, sizeof(counters_)); @@ -109,7 +109,7 @@ class PCounterSet { ~PCounterSet() {} - public: +public: void set(int mod, int64_t val) { counters_[mod].set(val); @@ -123,12 +123,12 @@ class PCounterSet { return counters_[mod].value(); } - private: +private: ::oceanbase::common::ObPCCounter counters_[PCOUNTER_COUNT]; }; class Printer { - public: +public: enum { MAX_BUF_SIZE = 4096 }; Printer() : limit_(MAX_BUF_SIZE), pos_(0) { @@ -177,14 +177,14 @@ class Printer { return src; } - private: +private: char buf_[MAX_BUF_SIZE]; int64_t limit_; int64_t pos_; }; class PCounterMonitor { - public: +public: typedef PthreadSpinLock Lock; PCounterMonitor(PCounterSet& set, int64_t interval) : pcounter_set_(set), report_interval_(interval), last_report_time_(0), report_seq_(1) @@ -194,7 +194,7 @@ class PCounterMonitor { ~PCounterMonitor() {} - public: +public: void report() { int64_t cur_time = get_us(); @@ -226,7 +226,7 @@ class PCounterMonitor { } } - private: +private: PCounterSet& pcounter_set_; Lock lock_; int64_t report_interval_; diff --git a/deps/oblib/src/lib/allocator/ob_pooled_allocator.h b/deps/oblib/src/lib/allocator/ob_pooled_allocator.h index 2226bc861..be1bb6b97 100644 --- a/deps/oblib/src/lib/allocator/ob_pooled_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_pooled_allocator.h @@ -20,7 +20,7 @@ namespace common { // @note thread-safe depends on LockT template class ObPooledAllocator { - public: +public: ObPooledAllocator(int64_t block_size = common::OB_MALLOC_NORMAL_BLOCK_SIZE, const BlockAllocatorT& alloc = BlockAllocatorT(ObModIds::OB_POOL)); virtual ~ObPooledAllocator(); @@ -35,11 +35,11 @@ class ObPooledAllocator { void inc_ref(){}; void dec_ref(){}; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObPooledAllocator); - private: +private: // data members ObPool the_pool_; }; diff --git a/deps/oblib/src/lib/allocator/ob_qsync.h b/deps/oblib/src/lib/allocator/ob_qsync.h index 084b4579d..c0260014b 100644 --- a/deps/oblib/src/lib/allocator/ob_qsync.h +++ b/deps/oblib/src/lib/allocator/ob_qsync.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class ObQSync { - public: +public: enum { MAX_REF_CNT = 256 }; struct Ref { Ref() : ref_(0) @@ -79,7 +79,7 @@ class ObQSync { return bool_ret; } - private: +private: int64_t add_ref(int64_t idx, int64_t x) { int64_t ret = 0; @@ -92,7 +92,7 @@ class ObQSync { return ret; } - private: +private: Ref ref_array_[MAX_REF_CNT]; }; diff --git a/deps/oblib/src/lib/allocator/ob_retire_station.h b/deps/oblib/src/lib/allocator/ob_retire_station.h index 0e9592aab..c92252421 100644 --- a/deps/oblib/src/lib/allocator/ob_retire_station.h +++ b/deps/oblib/src/lib/allocator/ob_retire_station.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class QClock { - public: +public: enum { MAX_QCLOCK_SLOT_NUM = OB_MAX_CPU_NUM * 32 }; struct ClockSlot { ClockSlot() : clock_(UINT64_MAX) @@ -90,14 +90,14 @@ class QClock { return ret; } - private: +private: bool is_quiescent(uint64_t clock) { uint64_t cur_clock = get_clock(); return clock < cur_clock && (clock < get_qclock() || clock < update_qclock(calc_quiescent_clock(cur_clock))); } - private: +private: uint64_t get_slot_id() { return get_itid(); @@ -135,7 +135,7 @@ class QClock { return qclock; } - private: +private: uint64_t clock_ CACHE_ALIGNED; uint64_t qclock_ CACHE_ALIGNED; ClockSlot clock_array_[MAX_QCLOCK_SLOT_NUM] CACHE_ALIGNED; @@ -148,14 +148,14 @@ inline QClock& get_global_qclock() } class HazardList { - public: +public: typedef ObLink Link; HazardList() : size_(0), head_(NULL), tail_(NULL) {} virtual ~HazardList() {} - public: +public: int64_t size() { return size_; @@ -196,7 +196,7 @@ class HazardList { } } - private: +private: Link* get_head() { return head_; @@ -225,14 +225,14 @@ class HazardList { tail_ = NULL; } - private: +private: int64_t size_; Link* head_; Link* tail_; }; class RetireStation { - public: +public: typedef HazardList List; enum { MAX_RETIRE_SLOT_NUM = OB_MAX_CPU_NUM * 32 }; @@ -301,20 +301,20 @@ class RetireStation { } } - private: +private: RetireList& get_retire_list() { return retire_list_[get_itid() % MAX_RETIRE_SLOT_NUM]; } - private: +private: int64_t retire_limit_; QClock& qclock_; RetireList retire_list_[MAX_RETIRE_SLOT_NUM]; }; class QClockGuard { - public: +public: explicit QClockGuard(QClock& qclock = get_global_qclock()) : qclock_(qclock), slot_id_(qclock_.enter_critical()) {} ~QClockGuard() @@ -322,7 +322,7 @@ class QClockGuard { qclock_.leave_critical(slot_id_); } - private: +private: QClock& qclock_; uint64_t slot_id_; }; diff --git a/deps/oblib/src/lib/allocator/ob_safe_arena.h b/deps/oblib/src/lib/allocator/ob_safe_arena.h index b76f4eb5b..82a69a0ef 100644 --- a/deps/oblib/src/lib/allocator/ob_safe_arena.h +++ b/deps/oblib/src/lib/allocator/ob_safe_arena.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class ObSafeArena : public ObIAllocator { - public: +public: ObSafeArena(const lib::ObLabel& label, const int64_t page_size = OB_MALLOC_NORMAL_BLOCK_SIZE) : arena_alloc_(label, page_size), lock_() {} @@ -27,7 +27,7 @@ class ObSafeArena : public ObIAllocator { virtual ~ObSafeArena() {} - public: +public: virtual void* alloc(const int64_t sz) override { return alloc(sz, default_memattr); @@ -78,11 +78,11 @@ class ObSafeArena : public ObIAllocator { return arena_alloc_.get_arena(); } - private: +private: ObArenaAllocator arena_alloc_; ObSpinLock lock_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSafeArena); }; } // namespace common diff --git a/deps/oblib/src/lib/allocator/ob_simple_fifo_alloc.h b/deps/oblib/src/lib/allocator/ob_simple_fifo_alloc.h index 94a453bae..9bc9f81ae 100644 --- a/deps/oblib/src/lib/allocator/ob_simple_fifo_alloc.h +++ b/deps/oblib/src/lib/allocator/ob_simple_fifo_alloc.h @@ -22,7 +22,7 @@ namespace common { extern ObBlockAllocMgr default_blk_alloc; class ObFifoBlock : public common::ObDLink { - public: +public: typedef ObFifoBlock Host; struct Item { Item(Host* host, int64_t size) : host_(host), size_(size) @@ -72,7 +72,7 @@ class ObFifoBlock : public common::ObDLink { return 0 == ATOMIC_AAF(&ref_, val); } - private: +private: int64_t blk_size_ CACHE_ALIGNED; int64_t bytes_alloc_ CACHE_ALIGNED; int64_t ref_ CACHE_ALIGNED; @@ -85,13 +85,13 @@ class ObSimpleFifoAlloc { typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; - public: +public: enum { MAX_ARENA_NUM = 32, BLOCK_SIZE = OB_MALLOC_BIG_BLOCK_SIZE }; typedef ObBlockAllocMgr BlockAlloc; typedef ObFifoBlock Block; typedef ObSimpleSync Sync; class Arena : public Sync { - public: + public: Arena() : blk_(NULL) {} Block* blk() @@ -107,11 +107,11 @@ class ObSimpleFifoAlloc { return ATOMIC_TAS(&blk_, NULL); } - private: + private: Block* blk_; } CACHE_ALIGNED; - public: +public: ObSimpleFifoAlloc(const ObMemAttr& attr, int block_size = BLOCK_SIZE, BlockAlloc& blk_alloc = default_blk_alloc) : nway_(1), bsize_(block_size), bytes_alloc_(0), mattr_(attr), blk_alloc_(blk_alloc) { @@ -218,7 +218,7 @@ class ObSimpleFifoAlloc { } } - private: +private: Block* prepare_block(int64_t blk_size) { Block* blk = NULL; @@ -253,7 +253,7 @@ class ObSimpleFifoAlloc { return has_reach_limit; } - private: +private: int nway_ CACHE_ALIGNED; int64_t bsize_; int64_t bytes_alloc_; diff --git a/deps/oblib/src/lib/allocator/ob_slice_alloc.h b/deps/oblib/src/lib/allocator/ob_slice_alloc.h index 6d64c7786..eb9e6442c 100644 --- a/deps/oblib/src/lib/allocator/ob_slice_alloc.h +++ b/deps/oblib/src/lib/allocator/ob_slice_alloc.h @@ -24,7 +24,7 @@ namespace common { extern ObBlockAllocMgr default_blk_alloc; class ObSimpleSync { - public: +public: ObSimpleSync() : ref_(0) {} int32_t ref(int32_t x) @@ -38,12 +38,12 @@ class ObSimpleSync { } } - private: +private: int32_t ref_; }; class ObDListWithLock { - public: +public: typedef ObDLink DLink; ObDListWithLock() : lock_() { @@ -68,7 +68,7 @@ class ObDListWithLock { return &head_ == p ? NULL : p; } - private: +private: void add_(DLink* p) { DLink* prev = head_.prev_; @@ -86,13 +86,13 @@ class ObDListWithLock { next->prev_ = prev; } - private: +private: mutable common::ObSpinLock lock_; DLink head_ CACHE_ALIGNED; }; class ObEmbedFixedQueue { - public: +public: ObEmbedFixedQueue() : push_(0), pop_(0), capacity_(0) {} ~ObEmbedFixedQueue() @@ -119,7 +119,7 @@ class ObEmbedFixedQueue { return p; } - private: +private: uint32_t push_ CACHE_ALIGNED; uint32_t pop_ CACHE_ALIGNED; uint32_t capacity_ CACHE_ALIGNED; @@ -135,7 +135,7 @@ class ObEmbedFixedQueue { list. */ class ObStockCtrl { - public: +public: enum { K = INT32_MAX / 2 }; ObStockCtrl() : total_(0), stock_(0) {} @@ -147,7 +147,7 @@ class ObStockCtrl { stock_ = n; } - public: +public: uint32_t total() { return total_; @@ -175,7 +175,7 @@ class ObStockCtrl { return ov == K + total_ - 1; } - private: +private: int32_t faa(int32_t x) { return ATOMIC_FAA(&stock_, x); @@ -213,17 +213,17 @@ class ObStockCtrl { return ov; } - private: +private: int32_t total_ CACHE_ALIGNED; int32_t stock_ CACHE_ALIGNED; }; class ObBlockSlicer : public ObStockCtrl { - public: +public: typedef ObEmbedFixedQueue FList; typedef ObBlockSlicer Host; struct Item { - public: + public: Item(Host* host) : host_(host) {} ~Item() @@ -232,10 +232,10 @@ class ObBlockSlicer : public ObStockCtrl { } __attribute__((aligned(16))); ; - public: +public: ObDLink dlink_ CACHE_ALIGNED; - public: +public: ObBlockSlicer(int32_t limit, int32_t slice_size, void* tmallocator = NULL) : tmallocator_(tmallocator) { int64_t isize = lib::align_up2((int32_t)sizeof(Item) + slice_size, 16); @@ -282,21 +282,21 @@ class ObBlockSlicer : public ObStockCtrl { return tmallocator_; } - private: +private: uint64_t hash_; void* tmallocator_; FList flist_ CACHE_ALIGNED; }; class ObSliceAlloc { - public: +public: enum { MAX_ARENA_NUM = 32, MAX_REF_NUM = 4096, DEFAULT_BLOCK_SIZE = OB_MALLOC_NORMAL_BLOCK_SIZE }; typedef ObSimpleSync Sync; typedef ObBlockSlicer Block; typedef ObBlockAllocMgr BlockAlloc; typedef ObDListWithLock BlockList; class Arena { - public: + public: Arena() : blk_(NULL) {} Block* blk() @@ -312,7 +312,7 @@ class ObSliceAlloc { return ATOMIC_TAS(&blk_, NULL); } - private: + private: Block* blk_; } CACHE_ALIGNED; ObSliceAlloc() : nway_(0), bsize_(0), isize_(0), slice_limit_(0), blk_alloc_(default_blk_alloc), tmallocator_(NULL) @@ -439,7 +439,7 @@ class ObSliceAlloc { to_cstring(attr_)); } - private: +private: void release_block(Block* blk) { if (blk->release()) { @@ -491,7 +491,7 @@ class ObSliceAlloc { // try_purge(); } - protected: +protected: int nway_ CACHE_ALIGNED; int32_t bsize_; int32_t isize_; diff --git a/deps/oblib/src/lib/allocator/ob_small_allocator.h b/deps/oblib/src/lib/allocator/ob_small_allocator.h index fda3981ff..9939c23fe 100644 --- a/deps/oblib/src/lib/allocator/ob_small_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_small_allocator.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace common { class ObSmallAllocator : public ObSliceAlloc { - public: +public: typedef ObBlockAllocMgr BlockAlloc; static const int64_t DEFAULT_MIN_OBJ_COUNT_ON_BLOCK = 1; ObSmallAllocator() @@ -50,7 +50,7 @@ class ObSmallAllocator : public ObSliceAlloc { return OB_SUCCESS; } - private: +private: BlockAlloc block_alloc_; }; }; // end namespace common diff --git a/deps/oblib/src/lib/allocator/ob_sql_arena_allocator.h b/deps/oblib/src/lib/allocator/ob_sql_arena_allocator.h index e83881f4c..e6428a493 100644 --- a/deps/oblib/src/lib/allocator/ob_sql_arena_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_sql_arena_allocator.h @@ -24,7 +24,7 @@ using common::ObArenaAllocator; class ObSQLArenaAllocator : public ObIAllocator { const static int THRESHOLD_SIZE_ONCE = 1 << 20; // 1M const static int DEFAULT_THRESHOLD_SIZE_TOTAL = 10 << 20; // 10M - public: +public: ObSQLArenaAllocator(const int64_t tenant_id = common::OB_SERVER_TENANT_ID); virtual ~ObSQLArenaAllocator(); void set_tenant_id(const uint64_t tenant_id); @@ -38,7 +38,7 @@ class ObSQLArenaAllocator : public ObIAllocator { bool revert_tracer(); void reset_remain_one_page(); - private: +private: // Use normal_application when the single and total size does not exceed the threshold // Apply for the rest with large_ ObArenaAllocator normal_; diff --git a/deps/oblib/src/lib/allocator/ob_thread_mempool.h b/deps/oblib/src/lib/allocator/ob_thread_mempool.h index a57c5b0b5..efde003c3 100644 --- a/deps/oblib/src/lib/allocator/ob_thread_mempool.h +++ b/deps/oblib/src/lib/allocator/ob_thread_mempool.h @@ -42,18 +42,18 @@ class ObMemList { MemBlock* next; }; - public: +public: explicit ObMemList(const int32_t fixed_size); ~ObMemList(); - public: +public: void* get(); void put(void* ptr, const int32_t max_free_num); int64_t inc_ref_cnt(); int64_t dec_ref_cnt(); int64_t get_ref_cnt(); - private: +private: MemAllocator alloc_; MemBlock* header_; int32_t size_; @@ -64,24 +64,24 @@ class ObMemList { class ObThreadMempool { static const pthread_key_t INVALID_THREAD_KEY = INT32_MAX; - public: +public: static const int32_t DEFAULT_MAX_FREE_NUM = 0; - public: +public: ObThreadMempool(); ~ObThreadMempool(); - public: +public: int init(const int32_t fixed_size, const int32_t max_free_num); int destroy(); void* alloc(); void free(void* ptr); void set_max_free_num(const int32_t max_free_num); - private: +private: static void destroy_thread_data_(void* ptr); - private: +private: pthread_key_t key_; int32_t fixed_size_; int32_t max_free_num_; diff --git a/deps/oblib/src/lib/allocator/ob_vslice_alloc.h b/deps/oblib/src/lib/allocator/ob_vslice_alloc.h index 24655a7c7..1d3d01761 100644 --- a/deps/oblib/src/lib/allocator/ob_vslice_alloc.h +++ b/deps/oblib/src/lib/allocator/ob_vslice_alloc.h @@ -23,7 +23,7 @@ namespace common { extern ObBlockAllocMgr default_blk_alloc; class ObBlockVSlicer { - public: +public: typedef ObBlockVSlicer Host; struct Item { Item(Host* host, int64_t size) : host_(host), size_(size) @@ -73,7 +73,7 @@ class ObBlockVSlicer { return 0 == ATOMIC_AAF(&ref_, val); } - private: +private: int64_t blk_size_ CACHE_ALIGNED; int64_t ref_ CACHE_ALIGNED; int64_t pos_ CACHE_ALIGNED; @@ -81,13 +81,13 @@ class ObBlockVSlicer { }; class ObVSliceAlloc { - public: +public: enum { MAX_ARENA_NUM = 32, DEFAULT_BLOCK_SIZE = OB_MALLOC_NORMAL_BLOCK_SIZE }; typedef ObBlockAllocMgr BlockAlloc; typedef ObBlockVSlicer Block; typedef ObSimpleSync Sync; class Arena : public Sync { - public: + public: Arena() : blk_(NULL) {} Block* blk() @@ -103,11 +103,11 @@ class ObVSliceAlloc { return ATOMIC_TAS(&blk_, NULL); } - private: + private: Block* blk_; } CACHE_ALIGNED; - public: +public: ObVSliceAlloc() : nway_(0), bsize_(0), blk_alloc_(default_blk_alloc) {} ObVSliceAlloc(const ObMemAttr& attr, int block_size = DEFAULT_BLOCK_SIZE, BlockAlloc& blk_alloc = default_blk_alloc) @@ -241,7 +241,7 @@ class ObVSliceAlloc { return ratio; } - private: +private: Block* prepare_block() { Block* blk = NULL; @@ -256,7 +256,7 @@ class ObVSliceAlloc { blk_alloc_.free_block(blk, blk->get_blk_size()); } - protected: +protected: int nway_ CACHE_ALIGNED; int64_t bsize_; ObMemAttr mattr_; diff --git a/deps/oblib/src/lib/allocator/page_arena.h b/deps/oblib/src/lib/allocator/page_arena.h index 9313d72bb..0a90435eb 100644 --- a/deps/oblib/src/lib/allocator/page_arena.h +++ b/deps/oblib/src/lib/allocator/page_arena.h @@ -90,7 +90,7 @@ struct DefaultPageAllocator : public ObIAllocator { return ob_malloc(sz, malloc_attr); } - private: +private: lib::ObLabel label_; uint64_t tenant_id_; int64_t ctx_id_; @@ -155,7 +155,7 @@ struct ModulePageAllocator : public ObIAllocator { return *this; } - protected: +protected: ObIAllocator* allocator_; lib::ObLabel label_; uint64_t tenant_id_; @@ -169,7 +169,7 @@ struct ModulePageAllocator : public ObIAllocator { */ template class PageArena { - private: // types +private: // types typedef PageArena Self; struct Page { @@ -293,11 +293,11 @@ class PageArena { int64_t total_; }; - public: +public: static const int64_t DEFAULT_PAGE_SIZE = OB_MALLOC_NORMAL_BLOCK_SIZE - sizeof(Page); // default 8KB static const int64_t DEFAULT_BIG_PAGE_SIZE = OB_MALLOC_BIG_BLOCK_SIZE; // default 2M - private: // data +private: // data Page* cur_page_; Page* header_; Page* tailer_; @@ -309,7 +309,7 @@ class PageArena { PageAllocatorT page_allocator_; TracerContext* tc_; - private: // helpers +private: // helpers Page* insert_head(Page* page) { if (OB_ISNULL(page)) { @@ -488,7 +488,7 @@ class PageArena { return *this; } - public: // API +public: // API /** constructor */ PageArena(const int64_t page_size = DEFAULT_PAGE_SIZE, const PageAllocatorT& alloc = PageAllocatorT()) : cur_page_(NULL), @@ -972,7 +972,7 @@ class PageArena { return total_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(PageArena); }; @@ -980,41 +980,88 @@ typedef PageArena<> CharArena; typedef PageArena ByteArena; typedef PageArena ModuleArena; -class ObArenaAllocator final : public ObIAllocator -{ +class ObArenaAllocator final : public ObIAllocator { public: - ObArenaAllocator(const lib::ObLabel &label = ObModIds::OB_MODULE_PAGE_ALLOCATOR, - const int64_t page_size = OB_MALLOC_NORMAL_BLOCK_SIZE, - int64_t tenant_id = OB_SERVER_TENANT_ID, - int64_t ctx_id = 0) - : arena_(page_size, ModulePageAllocator(label, tenant_id, ctx_id)) {}; - ObArenaAllocator(ObIAllocator &allocator, const int64_t page_size = OB_MALLOC_NORMAL_BLOCK_SIZE) - : arena_(page_size, ModulePageAllocator(allocator)) {}; - virtual ~ObArenaAllocator() {}; + ObArenaAllocator(const lib::ObLabel& label = ObModIds::OB_MODULE_PAGE_ALLOCATOR, + const int64_t page_size = OB_MALLOC_NORMAL_BLOCK_SIZE, int64_t tenant_id = OB_SERVER_TENANT_ID, + int64_t ctx_id = 0) + : arena_(page_size, ModulePageAllocator(label, tenant_id, ctx_id)){}; + ObArenaAllocator(ObIAllocator& allocator, const int64_t page_size = OB_MALLOC_NORMAL_BLOCK_SIZE) + : arena_(page_size, ModulePageAllocator(allocator)){}; + virtual ~ObArenaAllocator(){}; + public: - virtual void *alloc(const int64_t sz) override{ return arena_.alloc_aligned(sz); } - void *alloc(const int64_t size, const ObMemAttr &attr) override + virtual void* alloc(const int64_t sz) override + { + return arena_.alloc_aligned(sz); + } + void* alloc(const int64_t size, const ObMemAttr& attr) override { UNUSED(attr); return alloc(size); } - virtual void *alloc_aligned(const int64_t sz, const int64_t align) - { return arena_.alloc_aligned(sz, align); } - virtual void *realloc(void *ptr, const int64_t oldsz, const int64_t newsz) override { return arena_.realloc(reinterpret_cast(ptr), oldsz, newsz); } - virtual void free(void *ptr) override { arena_.free(reinterpret_cast(ptr)); ptr = NULL; } - virtual void clear() { arena_.free(); } - int64_t used() const override { return arena_.used(); } - int64_t total() const override { return arena_.total(); } - void reset() override { arena_.free(); } - void reset_remain_one_page() { arena_.free_remain_one_page(); } - void reuse() override { arena_.reuse(); } - virtual void set_label(const lib::ObLabel &label) { arena_.set_label(label); } - virtual lib::ObLabel get_label() const { return arena_.get_label(); } - virtual void set_tenant_id(uint64_t tenant_id) { arena_.set_tenant_id(tenant_id); } - bool set_tracer() { return arena_.set_tracer(); } - bool revert_tracer() { return arena_.revert_tracer(); } - void set_ctx_id(int64_t ctx_id) { arena_.set_ctx_id(ctx_id); } - void set_attr(const ObMemAttr &attr) override + virtual void* alloc_aligned(const int64_t sz, const int64_t align) + { + return arena_.alloc_aligned(sz, align); + } + virtual void* realloc(void* ptr, const int64_t oldsz, const int64_t newsz) override + { + return arena_.realloc(reinterpret_cast(ptr), oldsz, newsz); + } + virtual void free(void* ptr) override + { + arena_.free(reinterpret_cast(ptr)); + ptr = NULL; + } + virtual void clear() + { + arena_.free(); + } + int64_t used() const override + { + return arena_.used(); + } + int64_t total() const override + { + return arena_.total(); + } + void reset() override + { + arena_.free(); + } + void reset_remain_one_page() + { + arena_.free_remain_one_page(); + } + void reuse() override + { + arena_.reuse(); + } + virtual void set_label(const lib::ObLabel& label) + { + arena_.set_label(label); + } + virtual lib::ObLabel get_label() const + { + return arena_.get_label(); + } + virtual void set_tenant_id(uint64_t tenant_id) + { + arena_.set_tenant_id(tenant_id); + } + bool set_tracer() + { + return arena_.set_tracer(); + } + bool revert_tracer() + { + return arena_.revert_tracer(); + } + void set_ctx_id(int64_t ctx_id) + { + arena_.set_ctx_id(ctx_id); + } + void set_attr(const ObMemAttr& attr) override { arena_.set_tenant_id(attr.tenant_id_); arena_.set_ctx_id(attr.ctx_id_); @@ -1035,18 +1082,18 @@ public: return arena_.mprotect_page_arena(prot); } - private: +private: ModuleArena arena_; }; class ObSafeArenaAllocator : public ObIAllocator { - public: +public: ObSafeArenaAllocator(ObArenaAllocator& arena) : arena_(arena), lock_() {} virtual ~ObSafeArenaAllocator() {} - public: +public: void* alloc(const int64_t sz) override { return alloc(sz, default_memattr); @@ -1080,7 +1127,7 @@ class ObSafeArenaAllocator : public ObIAllocator { return arena_.used(); } - private: +private: ObArenaAllocator& arena_; ObSpinLock lock_; }; diff --git a/deps/oblib/src/lib/async/event_base.h b/deps/oblib/src/lib/async/event_base.h index 40e0a91e3..5cef27b9f 100644 --- a/deps/oblib/src/lib/async/event_base.h +++ b/deps/oblib/src/lib/async/event_base.h @@ -20,18 +20,18 @@ namespace oceanbase { namespace lib { class EventBase { - public: +public: EventBase(); virtual ~EventBase(); int init(); void destroy(); - protected: +protected: void signal(); void wait4event(int64_t maxwait = 0); - private: +private: std::thread th_; struct ev_loop* loop_; ev_async sched_watcher_; diff --git a/deps/oblib/src/lib/atomic/ob_atomic_reference.h b/deps/oblib/src/lib/atomic/ob_atomic_reference.h index f5d21051d..9c7711bd1 100644 --- a/deps/oblib/src/lib/atomic/ob_atomic_reference.h +++ b/deps/oblib/src/lib/atomic/ob_atomic_reference.h @@ -30,7 +30,7 @@ union AtomicInt64 { }; class ObAtomicReference final { - public: +public: ObAtomicReference(); ~ObAtomicReference(); void reset(); @@ -49,7 +49,7 @@ class ObAtomicReference final { return atomic_num_.ref; } - private: +private: AtomicInt64 atomic_num_; }; diff --git a/deps/oblib/src/lib/bloom_filter/ob_bloomfilter.h b/deps/oblib/src/lib/bloom_filter/ob_bloomfilter.h index 515609ce1..3b4086dff 100644 --- a/deps/oblib/src/lib/bloom_filter/ob_bloomfilter.h +++ b/deps/oblib/src/lib/bloom_filter/ob_bloomfilter.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace common { template class ObBloomFilter { - public: +public: ObBloomFilter(); ~ObBloomFilter(); int init(int64_t element_count, double false_positive_prob = BLOOM_FILTER_FALSE_POSITIVE_PROB); @@ -66,7 +66,7 @@ class ObBloomFilter { TO_STRING_KV(K_(nhash), K_(nbit), KP_(bits)); INLINE_NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBloomFilter); static constexpr double BLOOM_FILTER_FALSE_POSITIVE_PROB = 0.01; mutable HashFunc hash_func_; diff --git a/deps/oblib/src/lib/charset/ob_charset.cpp b/deps/oblib/src/lib/charset/ob_charset.cpp index 83deb5978..4af6dee55 100644 --- a/deps/oblib/src/lib/charset/ob_charset.cpp +++ b/deps/oblib/src/lib/charset/ob_charset.cpp @@ -936,7 +936,7 @@ size_t ObCharset::strlen_char(const ObCollationType collation_type, const char* size_t ret = 0; if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { - LOG_ERROR("unexpected error. invalid argument(s)", K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); if (OB_ISNULL(cs->cset)) { @@ -1092,8 +1092,7 @@ int ObCharset::mb_wc(ObCollationType collation_type, const ObString& mb, int32_t if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); ob_wc_t res_wc; @@ -1122,8 +1121,7 @@ int ObCharset::mb_wc( if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); ob_wc_t res_wc; @@ -1152,8 +1150,7 @@ int ObCharset::display_len(ObCollationType collation_type, const ObString& mb, i if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); if (OB_ISNULL(cs->cset)) { @@ -1197,8 +1194,7 @@ int ObCharset::max_display_width_charpos(ObCollationType collation_type, const c if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); if (OB_ISNULL(cs->cset)) { @@ -1673,8 +1669,7 @@ bool ObCharset::is_bin_sort(ObCollationType collation_type) bool ret = false; if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); ret = (0 != (cs->state & OB_CS_BINSORT)); @@ -1801,8 +1796,7 @@ int ObCharset::first_valid_char( if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else if (OB_UNLIKELY(NULL == buf)) { ret = OB_NOT_INIT; LOG_ERROR("Null buffer passed in", K(ret), K(buf)); @@ -1992,8 +1986,7 @@ bool ObCharset::is_space(const ObCollationType collation_type, char c) bool ret = false; if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); ret = (' ' == c); @@ -2006,8 +1999,7 @@ bool ObCharset::is_graph(const ObCollationType collation_type, char c) bool ret = false; if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); ret = !!(((cs)->ctype + 1)[(unsigned char)(c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR)); @@ -2020,8 +2012,7 @@ bool ObCharset::usemb(const ObCollationType collation_type) bool ret = false; if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); ret = (NULL != cs->cset->ismbchar); @@ -2034,8 +2025,7 @@ int ObCharset::is_mbchar(const ObCollationType collation_type, const char* str, bool ret = false; if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); if (NULL != cs->cset->ismbchar) { @@ -2062,8 +2052,7 @@ int ObCharset::get_mbmaxlen_by_coll(const ObCollationType collation_type, int64_ if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); mbmaxlen = cs->mbmaxlen; @@ -2077,8 +2066,7 @@ int ObCharset::get_mbminlen_by_coll(const ObCollationType collation_type, int64_ if (OB_UNLIKELY(collation_type <= CS_TYPE_INVALID || collation_type >= CS_TYPE_MAX) || OB_ISNULL(ObCharset::charset_arr[collation_type])) { ret = OB_ERR_UNEXPECTED; - LOG_ERROR( - "unexpected error. invalid argument(s)", K(ret), K(collation_type)); + LOG_ERROR("unexpected error. invalid argument(s)", K(ret), K(collation_type)); } else { ObCharsetInfo* cs = static_cast(ObCharset::charset_arr[collation_type]); mbminlen = cs->mbminlen; diff --git a/deps/oblib/src/lib/charset/ob_charset.h b/deps/oblib/src/lib/charset/ob_charset.h index 615de3776..542a0a4ed 100644 --- a/deps/oblib/src/lib/charset/ob_charset.h +++ b/deps/oblib/src/lib/charset/ob_charset.h @@ -88,11 +88,11 @@ struct ObCollationWrapper { const char* ob_collation_type_str(ObCollationType collation_type); class ObCharset { - private: +private: ObCharset(){}; virtual ~ObCharset(){}; - public: +public: static const int64_t CHARSET_WRAPPER_COUNT = 2; static const int64_t COLLATION_WRAPPER_COUNT = 3; @@ -243,19 +243,19 @@ class ObCharset { static bool is_cjk_charset(ObCollationType collation_type); static bool is_valid_connection_collation(ObCollationType collation_type); - public: +public: static const int64_t VALID_COLLATION_TYPES = 3; - private: +private: static bool is_argument_valid(const ObCharsetInfo* charset_info, const char* str, int64_t str_len); static bool is_argument_valid( const ObCollationType collation_type, const char* str1, int64_t str_len1, const char* str2, int64_t str_len2); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCharset); - private: +private: static const ObCharsetWrapper charset_wrap_arr_[CHARSET_WRAPPER_COUNT]; static const ObCollationWrapper collation_wrap_arr_[COLLATION_WRAPPER_COUNT]; static void* charset_arr[CS_TYPE_MAX]; // CHARSET_INFO * @@ -264,7 +264,7 @@ class ObCharset { }; class ObCharsetUtils { - public: +public: static int init(ObIAllocator& allocator); static ObString get_const_str(ObCollationType coll_type, int ascii) { @@ -297,25 +297,25 @@ class ObCharsetUtils { return ret; } - private: +private: static ObString const_str_for_ascii_[CHARSET_MAX][INT8_MAX + 1]; }; class ObStringScanner { - public: +public: ObStringScanner(const ObString& str, common::ObCollationType collation_type) : str_(str), collation_type_(collation_type) {} int next_character(ObString& encoding, int32_t& wchar); TO_STRING_KV(K_(str), K_(collation_type)); - private: +private: const ObString& str_; common::ObCollationType collation_type_; }; class ObCharSetString { - public: +public: ObCharSetString(ObString str, ObCollationType cs_type) : str_(str), cs_type_(cs_type) {} ObString& get_string() @@ -327,7 +327,7 @@ class ObCharSetString { return ObCharset::charset_convert(allocator, str_, cs_type_, target_cs_type, str_); } - protected: +protected: ObString str_; ObCollationType cs_type_; }; diff --git a/deps/oblib/src/lib/charset/ob_ctype_bin.c b/deps/oblib/src/lib/charset/ob_ctype_bin.c index 04fbb35c4..8f725620c 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_bin.c +++ b/deps/oblib/src/lib/charset/ob_ctype_bin.c @@ -547,8 +547,7 @@ size_t ob_max_bytes_charpos_8bit(const ObCharsetInfo* cs __attribute__((unused)) return max_bytes; } -size_t ob_well_formed_len_8bit(const char *str __attribute__((unused)), - size_t len, size_t nchars, int *error) +size_t ob_well_formed_len_8bit(const char* str __attribute__((unused)), size_t len, size_t nchars, int* error) { size_t nbytes = len; *error = 0; @@ -637,11 +636,8 @@ static int ob_strnncollsp_binary(const ObCharsetInfo* cs __attribute__((unused)) return ob_strnncoll_binary(cs, s, slen, t, tlen); } -static size_t -ob_strnxfrm_8bit_bin(const ObCharsetInfo *cs __attribute__((unused)), - unsigned char * dst, size_t dstlen, uint32_t nweights, - const unsigned char *src, size_t srclen, - int *is_valid_unicode) +static size_t ob_strnxfrm_8bit_bin(const ObCharsetInfo* cs __attribute__((unused)), unsigned char* dst, size_t dstlen, + uint32_t nweights, const unsigned char* src, size_t srclen, int* is_valid_unicode) { *is_valid_unicode = 1; srclen = (srclen < dstlen ? srclen : dstlen); diff --git a/deps/oblib/src/lib/checksum/ob_crc64.h b/deps/oblib/src/lib/checksum/ob_crc64.h index 30b44c870..60c3482ab 100644 --- a/deps/oblib/src/lib/checksum/ob_crc64.h +++ b/deps/oblib/src/lib/checksum/ob_crc64.h @@ -78,15 +78,15 @@ const uint64_t* ob_get_crc64_table(); class ObBatchChecksum { OB_UNIS_VERSION(1); - public: +public: // The ob_crc64 function has obvious advantages in calculating integer multiples of 64 bytes static const int64_t BUFFER_SIZE = 64; - public: +public: ObBatchChecksum() : pos_(0), base_(0){}; ~ObBatchChecksum(){}; - public: +public: inline void reset() { pos_ = 0; @@ -131,7 +131,7 @@ class ObBatchChecksum { } TO_STRING_KV(K_(pos), K_(base), K_(buffer)); - private: +private: char buffer_[BUFFER_SIZE]; int64_t pos_; uint64_t base_; diff --git a/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.h b/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.h index a907ad8b9..2e4ff35bf 100644 --- a/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.h +++ b/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.h @@ -20,7 +20,7 @@ namespace common { #define OB_PUBLIC_API __attribute__((visibility("default"))) class OB_PUBLIC_API ObLZ4Compressor : public ObCompressor { - public: +public: int compress(const char* src_buffer, const int64_t src_data_size, char* dst_buffer, const int64_t dst_buffer_size, int64_t& dst_data_size); @@ -31,12 +31,12 @@ class OB_PUBLIC_API ObLZ4Compressor : public ObCompressor { int get_max_overflow_size(const int64_t src_data_size, int64_t& max_overflow_size) const; - private: +private: static const char* compressor_name; }; class OB_PUBLIC_API ObLZ4Compressor191 : public ObCompressor { - public: +public: int compress(const char* src_buffer, const int64_t src_data_size, char* dst_buffer, const int64_t dst_buffer_size, int64_t& dst_data_size); @@ -47,7 +47,7 @@ class OB_PUBLIC_API ObLZ4Compressor191 : public ObCompressor { int get_max_overflow_size(const int64_t src_data_size, int64_t& max_overflow_size) const; - private: +private: static const char* compressor_name; }; diff --git a/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.h b/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.h index cc53315fe..2845647de 100644 --- a/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.h +++ b/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class ObLZ4StreamCompressor : public ObStreamCompressor { - public: +public: //-----start of stream compress ralated interfaces// int create_compress_ctx(void*& ctx); int free_compress_ctx(void* ctx); @@ -38,13 +38,13 @@ class ObLZ4StreamCompressor : public ObStreamCompressor { const char* get_compressor_name() const; - private: +private: bool is_valid_original_data_length(int64_t origin_data_len) const; static const char* compressor_name; }; class ObLZ4StreamCompressor191 : public ObStreamCompressor { - public: +public: //-----start of stream compress ralated interfaces// int create_compress_ctx(void*& ctx); int free_compress_ctx(void* ctx); @@ -63,7 +63,7 @@ class ObLZ4StreamCompressor191 : public ObStreamCompressor { const char* get_compressor_name() const; - private: +private: bool is_valid_original_data_length(int64_t origin_data_len) const; static const char* compressor_name; }; diff --git a/deps/oblib/src/lib/compress/none/ob_none_compressor.h b/deps/oblib/src/lib/compress/none/ob_none_compressor.h index 3425836a8..71c8dc4ce 100644 --- a/deps/oblib/src/lib/compress/none/ob_none_compressor.h +++ b/deps/oblib/src/lib/compress/none/ob_none_compressor.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObNoneCompressor : public ObCompressor { - public: +public: ObNoneCompressor() {} virtual ~ObNoneCompressor() @@ -30,7 +30,7 @@ class ObNoneCompressor : public ObCompressor { virtual const char* get_compressor_name() const; virtual int get_max_overflow_size(const int64_t src_data_size, int64_t& max_overflow_size) const; - private: +private: static const char* compressor_name; }; diff --git a/deps/oblib/src/lib/compress/ob_compressor.h b/deps/oblib/src/lib/compress/ob_compressor.h index 9bbd2a173..b64c0e231 100644 --- a/deps/oblib/src/lib/compress/ob_compressor.h +++ b/deps/oblib/src/lib/compress/ob_compressor.h @@ -18,10 +18,10 @@ namespace oceanbase { namespace common { class ObCompressor { - public: +public: static const char* none_compressor_name; - public: +public: ObCompressor() {} virtual ~ObCompressor() diff --git a/deps/oblib/src/lib/compress/ob_compressor_pool.h b/deps/oblib/src/lib/compress/ob_compressor_pool.h index 1403b446f..b123d327b 100644 --- a/deps/oblib/src/lib/compress/ob_compressor_pool.h +++ b/deps/oblib/src/lib/compress/ob_compressor_pool.h @@ -30,7 +30,7 @@ namespace oceanbase { namespace common { class ObCompressorPool { - public: +public: static ObCompressorPool& get_instance(); int get_compressor(const char* compressor_name, ObCompressor*& compressor); int get_compressor(const ObCompressorType& compressor_type, ObCompressor*& compressor); @@ -54,7 +54,7 @@ class ObCompressorPool { } int get_max_overflow_size(const int64_t src_data_size, int64_t& max_overflow_size); - private: +private: ObCompressorPool(); virtual ~ObCompressorPool() {} diff --git a/deps/oblib/src/lib/compress/ob_stream_compressor.h b/deps/oblib/src/lib/compress/ob_stream_compressor.h index 39a23dcda..10668b267 100644 --- a/deps/oblib/src/lib/compress/ob_stream_compressor.h +++ b/deps/oblib/src/lib/compress/ob_stream_compressor.h @@ -18,10 +18,10 @@ namespace oceanbase { namespace common { class ObStreamCompressor { - public: +public: static const char* none_compressor_name; - public: +public: ObStreamCompressor() {} virtual ~ObStreamCompressor() diff --git a/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.h b/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.h index d36dd5512..024a78202 100644 --- a/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.h +++ b/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace common { class ObSnappyCompressor : public ObCompressor { - public: +public: ObSnappyCompressor() {} virtual ~ObSnappyCompressor() @@ -29,7 +29,7 @@ class ObSnappyCompressor : public ObCompressor { virtual const char* get_compressor_name() const; virtual int get_max_overflow_size(const int64_t src_data_size, int64_t& max_overflow_size) const; - private: +private: static const char* compressor_name; }; diff --git a/deps/oblib/src/lib/compress/snappy/snappy-internal.h b/deps/oblib/src/lib/compress/snappy/snappy-internal.h index ccad2c2df..822b39585 100644 --- a/deps/oblib/src/lib/compress/snappy/snappy-internal.h +++ b/deps/oblib/src/lib/compress/snappy/snappy-internal.h @@ -37,7 +37,7 @@ namespace snappy { namespace internal { class WorkingMemory { - public: +public: WorkingMemory() : large_table_(NULL) {} ~WorkingMemory() @@ -50,7 +50,7 @@ class WorkingMemory { // the base of the hash table. uint16* GetHashTable(size_t input_size, int* table_size); - private: +private: uint16 small_table_[1 << 10]; // 2KB uint16* large_table_; // Allocated only when needed diff --git a/deps/oblib/src/lib/compress/snappy/snappy-sinksource.h b/deps/oblib/src/lib/compress/snappy/snappy-sinksource.h index fde31803a..7b6440477 100644 --- a/deps/oblib/src/lib/compress/snappy/snappy-sinksource.h +++ b/deps/oblib/src/lib/compress/snappy/snappy-sinksource.h @@ -35,7 +35,7 @@ namespace snappy { // A Sink is an interface that consumes a sequence of bytes. class Sink { - public: +public: Sink() {} virtual ~Sink(); @@ -60,7 +60,7 @@ class Sink { // The default implementation always returns the scratch buffer. virtual char* GetAppendBuffer(size_t length, char* scratch); - private: +private: // No copying Sink(const Sink&); void operator=(const Sink&); @@ -68,7 +68,7 @@ class Sink { // A Source is an interface that yields a sequence of bytes class Source { - public: +public: Source() {} virtual ~Source(); @@ -96,7 +96,7 @@ class Source { // REQUIRES: Available() >= n virtual void Skip(size_t n) = 0; - private: +private: // No copying Source(const Source&); void operator=(const Source&); @@ -104,7 +104,7 @@ class Source { // A Source implementation that yields the contents of a flat array class ByteArraySource : public Source { - public: +public: ByteArraySource(const char* p, size_t n) : ptr_(p), left_(n) {} virtual ~ByteArraySource(); @@ -112,14 +112,14 @@ class ByteArraySource : public Source { virtual const char* Peek(size_t* len); virtual void Skip(size_t n); - private: +private: const char* ptr_; size_t left_; }; // A Sink implementation that writes to a flat array without any bound checks. class UncheckedByteArraySink : public Sink { - public: +public: explicit UncheckedByteArraySink(char* dest) : dest_(dest) {} virtual ~UncheckedByteArraySink(); @@ -134,7 +134,7 @@ class UncheckedByteArraySink : public Sink { return dest_; } - private: +private: char* dest_; }; diff --git a/deps/oblib/src/lib/compress/snappy/snappy-stubs-internal.h b/deps/oblib/src/lib/compress/snappy/snappy-stubs-internal.h index a80f9613b..89d77119b 100644 --- a/deps/oblib/src/lib/compress/snappy/snappy-stubs-internal.h +++ b/deps/oblib/src/lib/compress/snappy/snappy-stubs-internal.h @@ -85,7 +85,7 @@ static const int64 kint64max = static_cast(0x7FFFFFFFFFFFFFFFLL); #define VLOG(level) true ? (void)0 : snappy::LogMessageVoidify() & snappy::LogMessage() class LogMessage { - public: +public: LogMessage() {} ~LogMessage() @@ -112,7 +112,7 @@ class LogMessage { PREDICT_TRUE(condition) ? (void)0 : snappy::LogMessageVoidify() & snappy::LogMessageCrash() class LogMessageCrash : public LogMessage { - public: +public: LogMessageCrash() {} ~LogMessageCrash() @@ -127,7 +127,7 @@ class LogMessageCrash : public LogMessage { // is not used" and "statement has no effect". class LogMessageVoidify { - public: +public: LogMessageVoidify() {} // This has to be an operator with a precedence lower than << but @@ -253,7 +253,7 @@ inline void UNALIGNED_STORE64(void* p, uint64 v) // Load unaligned values stored in little endian converting to host order: // x = LittleEndian.Load16(p); class LittleEndian { - public: +public: // Conversion functions. #ifdef WORDS_BIGENDIAN @@ -331,7 +331,7 @@ class LittleEndian { // Some bit-manipulation functions. class Bits { - public: +public: // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. static int Log2Floor(uint32 n); @@ -341,7 +341,7 @@ class Bits { static int FindLSBSetNonZero(uint32 n); static int FindLSBSetNonZero64(uint64 n); - private: +private: DISALLOW_COPY_AND_ASSIGN(Bits); }; @@ -412,7 +412,7 @@ inline int Bits::FindLSBSetNonZero64(uint64 n) // Variable-length integer encoding. class Varint { - public: +public: // Maximum lengths of varint encoding of uint32. static const int kMax32 = 5; diff --git a/deps/oblib/src/lib/compress/snappy/snappy-test.h b/deps/oblib/src/lib/compress/snappy/snappy-test.h index d3c8ba3ff..88e7d9108 100644 --- a/deps/oblib/src/lib/compress/snappy/snappy-test.h +++ b/deps/oblib/src/lib/compress/snappy/snappy-test.h @@ -192,7 +192,7 @@ string StringPrintf(const char* format, ...); // A simple, non-cryptographically-secure random generator. class ACMRandom { - public: +public: explicit ACMRandom(uint32 seed) : seed_(seed) {} @@ -216,7 +216,7 @@ class ACMRandom { // range [0,2^max_log-1] with bias towards smaller numbers. int32 Skewed(int max_log); - private: +private: static const uint32 M = 2147483647L; // 2^31-1 uint32 seed_; }; @@ -251,7 +251,7 @@ inline int32 ACMRandom::Skewed(int max_log) // A wall-time clock. This stub is not super-accurate, nor resistant to the // system time changing. class CycleTimer { - public: +public: CycleTimer() : real_time_us_(0) {} @@ -288,7 +288,7 @@ class CycleTimer { return real_time_us_ * 1e-6; } - private: +private: int64 real_time_us_; #ifdef WIN32 LARGE_INTEGER start_; @@ -302,7 +302,7 @@ class CycleTimer { typedef void (*BenchmarkFunction)(int, int); class Benchmark { - public: +public: Benchmark(const string& name, BenchmarkFunction function) : name_(name), function_(function) {} @@ -315,7 +315,7 @@ class Benchmark { void Run(); - private: +private: const string name_; const BenchmarkFunction function_; int start_, stop_; @@ -337,7 +337,7 @@ void SetBenchmarkBytesProcessed(int64 bytes); // Object-oriented wrapper around zlib. class ZLib { - public: +public: ZLib(); ~ZLib(); @@ -401,7 +401,7 @@ class ZLib { // call are the footer. Returns true iff everything looks ok. bool UncompressChunkDone(); - private: +private: int InflateInit(); // sets up the zlib inflate structure int DeflateInit(); // sets up the zlib deflate structure diff --git a/deps/oblib/src/lib/compress/snappy/snappy.cpp b/deps/oblib/src/lib/compress/snappy/snappy.cpp index b5a09bfac..038c2406c 100644 --- a/deps/oblib/src/lib/compress/snappy/snappy.cpp +++ b/deps/oblib/src/lib/compress/snappy/snappy.cpp @@ -813,7 +813,7 @@ REGISTER_MODULE_INITIALIZER(snappy, ComputeTable()); // Helper class for decompression class SnappyDecompressor { - private: +private: Source* reader_; // Underlying source of bytes to decompress const char* ip_; // Points to next buffered byte const char* ip_limit_; // Points just past buffered bytes @@ -828,7 +828,7 @@ class SnappyDecompressor { // Returns true on success, false on error or end of input. bool RefillTag(); - public: +public: explicit SnappyDecompressor(Source* reader) : reader_(reader), ip_(NULL), ip_limit_(NULL), peeked_(0), eof_(false) {} @@ -1102,12 +1102,12 @@ size_t Compress(Source* reader, Sink* writer) // Note that this is not a "ByteSink", but a type that matches the // Writer template argument to SnappyDecompressor::DecompressAllTags(). class SnappyArrayWriter { - private: +private: char* base_; char* op_; char* op_limit_; - public: +public: inline explicit SnappyArrayWriter(char* dst) : base_(dst), op_(dst) {} @@ -1195,11 +1195,11 @@ bool Uncompress(const char* compressed, size_t n, string* uncompressed) // A Writer that drops everything on the floor and just does validation class SnappyDecompressionValidator { - private: +private: size_t expected_; size_t produced_; - public: +public: inline SnappyDecompressionValidator() : produced_(0) {} inline void SetExpectedLength(size_t len) diff --git a/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.h b/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.h index c0ceb85cf..85ccaaf1c 100644 --- a/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.h +++ b/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace common { class ObZlibCompressor : public ObCompressor { - public: +public: explicit ObZlibCompressor(int64_t compress_level = 6) : compress_level_(compress_level) {} virtual ~ObZlibCompressor() @@ -34,7 +34,7 @@ class ObZlibCompressor : public ObCompressor { int fast_level0_compress( unsigned char* dest, unsigned long* destLen, const unsigned char* source, unsigned long sourceLen); - private: +private: int64_t compress_level_; static const char* compressor_name; }; diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.h b/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.h index 1c2157552..12ca236e4 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.h +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.h @@ -21,19 +21,19 @@ namespace common { namespace zstd { class ObZstdCtxAllocator { - public: +public: ObZstdCtxAllocator(); virtual ~ObZstdCtxAllocator(); void* alloc(size_t size); void free(void* addr); void reuse(); - private: +private: ObArenaAllocator allocator_; }; class ObZstdCompressor : public ObCompressor { - public: +public: explicit ObZstdCompressor() {} virtual ~ObZstdCompressor() @@ -45,7 +45,7 @@ class ObZstdCompressor : public ObCompressor { const char* get_compressor_name() const; int get_max_overflow_size(const int64_t src_data_size, int64_t& max_overflow_size) const; - private: +private: static const char* compressor_name; }; } // namespace zstd diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.h b/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.h index 9fd6d15de..02c630de7 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.h +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.h @@ -21,18 +21,18 @@ namespace common { namespace zstd { class ObZstdStreamCtxAllocator { - public: +public: ObZstdStreamCtxAllocator(); virtual ~ObZstdStreamCtxAllocator(); void* alloc(size_t size); void free(void* addr); - private: +private: ModulePageAllocator allocator_; }; class ObZstdStreamCompressor : public ObStreamCompressor { - public: +public: explicit ObZstdStreamCompressor() {} virtual ~ObZstdStreamCompressor() @@ -58,7 +58,7 @@ class ObZstdStreamCompressor : public ObStreamCompressor { int get_compress_bound_size(const int64_t src_size, int64_t& bound_size) const; int insert_uncompressed_block(void* dctx, const void* block, const int64_t block_size); - private: +private: static const char* compressor_name; }; } // namespace zstd diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.h b/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.h index ffca3a47d..bf3ff622a 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.h +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.h @@ -31,7 +31,7 @@ typedef struct { #define OB_PUBLIC_API __attribute__((visibility("default"))) class OB_PUBLIC_API ObZstdWrapper final { - public: +public: // for normal static int compress(OB_ZSTD_customMem& zstd_mem, const char* src_buffer, const size_t src_data_size, char* dst_buffer, const size_t dst_buffer_size, size_t& compress_ret_size); diff --git a/deps/oblib/src/lib/compress/zstd/zstd_v01.c b/deps/oblib/src/lib/compress/zstd/zstd_v01.c index fccef9904..5dde16ef9 100644 --- a/deps/oblib/src/lib/compress/zstd/zstd_v01.c +++ b/deps/oblib/src/lib/compress/zstd/zstd_v01.c @@ -28,12 +28,12 @@ /****************************************** * Error Management ******************************************/ -#define FSE_LIST_ERRORS(ITEM) \ - ITEM(FSE_OK_NoError) \ - ITEM(FSE_ERROR_GENERIC) \ - ITEM(FSE_ERROR_tableLog_tooLarge) ITEM(FSE_ERROR_maxSymbolValue_tooLarge) ITEM(FSE_ERROR_maxSymbolValue_tooSmall) \ - ITEM(FSE_ERROR_dstSize_tooSmall) ITEM(FSE_ERROR_srcSize_wrong) ITEM(FSE_ERROR_corruptionDetected) \ - ITEM(FSE_ERROR_maxCode) +#define FSE_LIST_ERRORS(ITEM) \ + ITEM(FSE_OK_NoError) \ + ITEM(FSE_ERROR_GENERIC) \ + ITEM(FSE_ERROR_tableLog_tooLarge) \ + ITEM(FSE_ERROR_maxSymbolValue_tooLarge) ITEM(FSE_ERROR_maxSymbolValue_tooSmall) ITEM(FSE_ERROR_dstSize_tooSmall) \ + ITEM(FSE_ERROR_srcSize_wrong) ITEM(FSE_ERROR_corruptionDetected) ITEM(FSE_ERROR_maxCode) #define FSE_GENERATE_ENUM(ENUM) ENUM, typedef enum { diff --git a/deps/oblib/src/lib/compress/zstd/zstd_v02.c b/deps/oblib/src/lib/compress/zstd/zstd_v02.c index 7acb7829d..7d7aebe8b 100644 --- a/deps/oblib/src/lib/compress/zstd/zstd_v02.c +++ b/deps/oblib/src/lib/compress/zstd/zstd_v02.c @@ -639,12 +639,13 @@ extern "C" { #define ERROR(name) (size_t) - PREFIX(name) -#define ERROR_LIST(ITEM) \ - ITEM(PREFIX(No_Error)) \ - ITEM(PREFIX(GENERIC)) \ - ITEM(PREFIX(dstSize_tooSmall)) ITEM(PREFIX(srcSize_wrong)) ITEM(PREFIX(prefix_unknown)) \ - ITEM(PREFIX(corruption_detected)) ITEM(PREFIX(tableLog_tooLarge)) ITEM(PREFIX(maxSymbolValue_tooLarge)) \ - ITEM(PREFIX(maxSymbolValue_tooSmall)) ITEM(PREFIX(maxCode)) +#define ERROR_LIST(ITEM) \ + ITEM(PREFIX(No_Error)) \ + ITEM(PREFIX(GENERIC)) \ + ITEM(PREFIX(dstSize_tooSmall)) \ + ITEM(PREFIX(srcSize_wrong)) ITEM(PREFIX(prefix_unknown)) ITEM(PREFIX(corruption_detected)) \ + ITEM(PREFIX(tableLog_tooLarge)) ITEM(PREFIX(maxSymbolValue_tooLarge)) ITEM(PREFIX(maxSymbolValue_tooSmall)) \ + ITEM(PREFIX(maxCode)) #define ERROR_GENERATE_ENUM(ENUM) ENUM, typedef enum { diff --git a/deps/oblib/src/lib/compress/zstd/zstd_v03.c b/deps/oblib/src/lib/compress/zstd/zstd_v03.c index cf4192693..ca5c8d9ca 100644 --- a/deps/oblib/src/lib/compress/zstd/zstd_v03.c +++ b/deps/oblib/src/lib/compress/zstd/zstd_v03.c @@ -639,12 +639,13 @@ extern "C" { #define ERROR(name) (size_t) - PREFIX(name) -#define ERROR_LIST(ITEM) \ - ITEM(PREFIX(No_Error)) \ - ITEM(PREFIX(GENERIC)) \ - ITEM(PREFIX(dstSize_tooSmall)) ITEM(PREFIX(srcSize_wrong)) ITEM(PREFIX(prefix_unknown)) \ - ITEM(PREFIX(corruption_detected)) ITEM(PREFIX(tableLog_tooLarge)) ITEM(PREFIX(maxSymbolValue_tooLarge)) \ - ITEM(PREFIX(maxSymbolValue_tooSmall)) ITEM(PREFIX(maxCode)) +#define ERROR_LIST(ITEM) \ + ITEM(PREFIX(No_Error)) \ + ITEM(PREFIX(GENERIC)) \ + ITEM(PREFIX(dstSize_tooSmall)) \ + ITEM(PREFIX(srcSize_wrong)) ITEM(PREFIX(prefix_unknown)) ITEM(PREFIX(corruption_detected)) \ + ITEM(PREFIX(tableLog_tooLarge)) ITEM(PREFIX(maxSymbolValue_tooLarge)) ITEM(PREFIX(maxSymbolValue_tooSmall)) \ + ITEM(PREFIX(maxCode)) #define ERROR_GENERATE_ENUM(ENUM) ENUM, typedef enum { diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.h b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.h index ce1b11b7f..2dad0b7bc 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.h +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.h @@ -21,19 +21,19 @@ namespace common { namespace zstd_1_3_8 { class ObZstdCtxAllocator { - public: +public: ObZstdCtxAllocator(); virtual ~ObZstdCtxAllocator(); void* alloc(size_t size); void free(void* addr); void reuse(); - private: +private: ObArenaAllocator allocator_; }; class __attribute__((visibility("default"))) ObZstdCompressor_1_3_8 : public ObCompressor { - public: +public: explicit ObZstdCompressor_1_3_8() {} virtual ~ObZstdCompressor_1_3_8() @@ -45,7 +45,7 @@ class __attribute__((visibility("default"))) ObZstdCompressor_1_3_8 : public ObC const char* get_compressor_name() const; int get_max_overflow_size(const int64_t src_data_size, int64_t& max_overflow_size) const; - private: +private: static const char* compressor_name; }; } // namespace zstd_1_3_8 diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.h b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.h index 109723385..6931c5cc8 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.h +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.h @@ -21,18 +21,18 @@ namespace common { namespace zstd_1_3_8 { class ObZstdStreamCtxAllocator { - public: +public: ObZstdStreamCtxAllocator(); virtual ~ObZstdStreamCtxAllocator(); void* alloc(size_t size); void free(void* addr); - private: +private: ModulePageAllocator allocator_; }; class ObZstdStreamCompressor_1_3_8 : public ObStreamCompressor { - public: +public: explicit ObZstdStreamCompressor_1_3_8() {} virtual ~ObZstdStreamCompressor_1_3_8() @@ -58,7 +58,7 @@ class ObZstdStreamCompressor_1_3_8 : public ObStreamCompressor { int get_compress_bound_size(const int64_t src_size, int64_t& bound_size) const; int insert_uncompressed_block(void* dctx, const void* block, const int64_t block_size); - private: +private: static const char* compressor_name; }; } // namespace zstd_1_3_8 diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.h b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.h index 209526ccc..e4c0937d0 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.h +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.h @@ -31,7 +31,7 @@ typedef struct { #define OB_PUBLIC_API __attribute__((visibility("default"))) class OB_PUBLIC_API ObZstdWrapper final { - public: +public: // for normal static int compress(OB_ZSTD_customMem& zstd_mem, const char* src_buffer, const size_t src_data_size, char* dst_buffer, const size_t dst_buffer_size, size_t& compress_ret_size); diff --git a/deps/oblib/src/lib/container/limit_array.h b/deps/oblib/src/lib/container/limit_array.h index c042e9086..567d48763 100644 --- a/deps/oblib/src/lib/container/limit_array.h +++ b/deps/oblib/src/lib/container/limit_array.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace common { template class LimitArray { - public: +public: LimitArray() : holder_index_(0), size_(0), index_(0), tail_holer_index_(0) {} bool expand(ObArrayHelper& new_array) @@ -122,7 +122,7 @@ class LimitArray { return index_; } - private: +private: ObArrayHelper holder[N]; int64_t holder_index_; int64_t size_; diff --git a/deps/oblib/src/lib/container/ob_2d_array.h b/deps/oblib/src/lib/container/ob_2d_array.h index e99e52244..41610f08f 100644 --- a/deps/oblib/src/lib/container/ob_2d_array.h +++ b/deps/oblib/src/lib/container/ob_2d_array.h @@ -26,7 +26,7 @@ template > class Ob2DArray { - public: +public: Ob2DArray(const BlockAllocatorT& alloc = BlockAllocatorT(ObModIds::OB_2D_ARRAY)); virtual ~Ob2DArray(); @@ -102,7 +102,7 @@ class Ob2DArray { NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: // function members template int inner_assign(const U& other); @@ -128,11 +128,11 @@ class Ob2DArray { return block_alloc_.free(block); } - public: +public: static const int64_t BLOCK_CAPACITY = 1 << (8 * sizeof(int64_t) - __builtin_clzll(static_cast(max_block_size / sizeof(T))) - 1); - private: +private: static const int64_t LOCAL_BLOCK_SIZE = sizeof(T) * BLOCK_CAPACITY; int32_t magic_; BlockAllocatorT block_alloc_; diff --git a/deps/oblib/src/lib/container/ob_array.h b/deps/oblib/src/lib/container/ob_array.h index 174db9d7c..80d0d8e84 100644 --- a/deps/oblib/src/lib/container/ob_array.h +++ b/deps/oblib/src/lib/container/ob_array.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { template class ObArrayDefaultCallBack { - public: +public: void operator()(T* ptr) { UNUSED(ptr); @@ -29,7 +29,7 @@ class ObArrayDefaultCallBack { template class ObArrayExpressionCallBack { - public: +public: void operator()(T* ptr) { ptr->reset(); @@ -80,7 +80,7 @@ template { typedef ObArrayImpl self_t; - public: +public: typedef array::Iterator iterator; typedef array::Iterator const_iterator; typedef T value_type; @@ -88,21 +88,36 @@ class ObArrayImpl : public ObIArray { using ObIArray::count; using ObIArray::at; - public: +public: ObArrayImpl(int64_t block_size = OB_MALLOC_NORMAL_BLOCK_SIZE, const BlockAllocatorT& alloc = BlockAllocatorT(ObNewModIds::OB_COMMON_ARRAY)); virtual ~ObArrayImpl() __attribute__((noinline)); - inline void set_label(const lib::ObLabel &label) { block_allocator_.set_label(label); } - inline void set_block_size(const int64_t block_size) { block_size_ = block_size; } - inline int64_t get_block_size() const {return block_size_; } - inline void set_block_allocator(const BlockAllocatorT &alloc) { block_allocator_ = alloc; } - inline const BlockAllocatorT &get_block_allocator() const {return block_allocator_;} - int push_back(const T &obj) override; + inline void set_label(const lib::ObLabel& label) + { + block_allocator_.set_label(label); + } + inline void set_block_size(const int64_t block_size) + { + block_size_ = block_size; + } + inline int64_t get_block_size() const + { + return block_size_; + } + inline void set_block_allocator(const BlockAllocatorT& alloc) + { + block_allocator_ = alloc; + } + inline const BlockAllocatorT& get_block_allocator() const + { + return block_allocator_; + } + int push_back(const T& obj) override; void pop_back() override; - int pop_back(T &obj) override; + int pop_back(T& obj) override; int remove(const int64_t idx) override; - inline int at(const int64_t idx, T &obj) const override + inline int at(const int64_t idx, T& obj) const override { int ret = OB_SUCCESS; if (OB_UNLIKELY(OB_SUCCESS != error_)) { @@ -123,10 +138,19 @@ class ObArrayImpl : public ObIArray { OB_ASSERT(OB_SUCCESS == error_); } - inline T &operator[](const int64_t idx) {return at(idx);} - inline const T &operator[](const int64_t idx) const {return at(idx);} - T *alloc_place_holder() override; - inline int64_t size() const { return count();} + inline T& operator[](const int64_t idx) + { + return at(idx); + } + inline const T& operator[](const int64_t idx) const + { + return at(idx); + } + T* alloc_place_holder() override; + inline int64_t size() const + { + return count(); + } void reuse() override { CallBack cb; @@ -136,7 +160,10 @@ class ObArrayImpl : public ObIArray { destroy(); } } - inline void reset() override {destroy();} + inline void reset() override + { + destroy(); + } void destroy() override; inline int reserve(int64_t capacity) override { @@ -149,7 +176,7 @@ class ObArrayImpl : public ObIArray { } return ret; } - //prepare allocate can avoid declaring local data + // prepare allocate can avoid declaring local data int prepare_allocate(int64_t capacity) override { int ret = OB_SUCCESS; @@ -166,10 +193,19 @@ class ObArrayImpl : public ObIArray { return ret; } - int64_t to_string(char *buffer, int64_t length) const override; - inline int64_t get_data_size() const {return data_size_;} - inline bool error() const {return error_ != OB_SUCCESS;} - inline int get_copy_assign_ret() const { return error_; } + int64_t to_string(char* buffer, int64_t length) const override; + inline int64_t get_data_size() const + { + return data_size_; + } + inline bool error() const + { + return error_ != OB_SUCCESS; + } + inline int get_copy_assign_ret() const + { + return error_; + } const_iterator begin() const; const_iterator end() const; iterator begin(); @@ -195,9 +231,9 @@ class ObArrayImpl : public ObIArray { return ret; } // deep copy - ObArrayImpl(const ObArrayImpl &other); - ObArrayImpl &operator=(const ObArrayImpl &other); - int assign(const ObIArray &other) override; + ObArrayImpl(const ObArrayImpl& other); + ObArrayImpl& operator=(const ObArrayImpl& other); + int assign(const ObIArray& other) override; NEED_SERIALIZE_AND_DESERIALIZE; static uint32_t data_offset_bits() @@ -229,11 +265,11 @@ class ObArrayImpl : public ObIArray { return offsetof(ObArrayImpl, reserve_) * 8; } - protected: +protected: using ObIArray::data_; using ObIArray::count_; - private: +private: inline int extend_buf() { int64_t new_size = MAX(2 * data_size_, block_size_); @@ -307,7 +343,7 @@ class ObArrayImpl : public ObIArray { error_ = OB_SUCCESS; } - private: +private: int64_t valid_count_; // constructed item count int64_t data_size_; int64_t block_size_; @@ -574,7 +610,7 @@ inline int databuff_encode_element(char* buf, const int64_t buf_len, int64_t& po template , typename ItemEncode = NotImplementItemEncode > class ObArray final : public ObArrayImpl { - public: +public: // use ObArrayImpl constructors using ObArrayImpl::ObArrayImpl; }; diff --git a/deps/oblib/src/lib/container/ob_array_array.h b/deps/oblib/src/lib/container/ob_array_array.h index 12ba7feff..23e13a165 100644 --- a/deps/oblib/src/lib/container/ob_array_array.h +++ b/deps/oblib/src/lib/container/ob_array_array.h @@ -30,7 +30,7 @@ static const int64_t DEFAULT_ARRAY_ARRAY_SIZE = 8; template class ObArrayArray { - public: +public: typedef ObSEArray LocalArrayT; explicit ObArrayArray(const int64_t block_size = OB_MALLOC_NORMAL_BLOCK_SIZE, const BlockAllocatorT& alloc = BlockAllocatorT("ObArrayArray")); @@ -82,11 +82,11 @@ class ObArrayArray { } int64_t to_string(char* buffer, int64_t length) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObArrayArray); - private: +private: LocalArrayT* local_array_buf_[ARRAY_ARRAY_SIZE]; LocalArrayT** array_ptrs_; int64_t count_; diff --git a/deps/oblib/src/lib/container/ob_array_helper.h b/deps/oblib/src/lib/container/ob_array_helper.h index 8aa72f12b..f2178e732 100644 --- a/deps/oblib/src/lib/container/ob_array_helper.h +++ b/deps/oblib/src/lib/container/ob_array_helper.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { template class ObArrayHelper final : public ObIArray { - public: +public: using ObIArray::count; using ObIArray::at; @@ -193,17 +193,17 @@ class ObArrayHelper final : public ObIArray { return *this; } - protected: +protected: using ObIArray::data_; using ObIArray::count_; - private: +private: int64_t capacity_; }; template class ObArrayHelpers { - public: +public: ObArrayHelpers() { memset(arrs_, 0x00, sizeof(arrs_)); @@ -263,7 +263,7 @@ class ObArrayHelpers { return counter; } - private: +private: static const int MAX_ARR_COUNT = 16; ObArrayHelper* arrs_[MAX_ARR_COUNT]; int64_t arr_count_; diff --git a/deps/oblib/src/lib/container/ob_array_iterator.h b/deps/oblib/src/lib/container/ob_array_iterator.h index c4ed8efa1..cd17e2f89 100644 --- a/deps/oblib/src/lib/container/ob_array_iterator.h +++ b/deps/oblib/src/lib/container/ob_array_iterator.h @@ -52,7 +52,7 @@ template class Iterator { typedef Iterator self_t; - public: +public: typedef typename std::random_access_iterator_tag iterator_category; typedef int64_t difference_type; typedef T value_type; @@ -60,7 +60,7 @@ class Iterator { typedef T* pointer; typedef T& reference; - public: +public: Iterator() : value_ptr_(NULL){}; Iterator(const self_t& other) { @@ -76,7 +76,7 @@ class Iterator { value_ptr_ = value_ptr; }; - public: +public: reference operator*() const { return *value_ptr_; @@ -146,7 +146,7 @@ class Iterator { return tmp; }; - private: +private: value_ptr_t value_ptr_; }; diff --git a/deps/oblib/src/lib/container/ob_array_wrap.h b/deps/oblib/src/lib/container/ob_array_wrap.h index 8a880e595..d1be23ad6 100644 --- a/deps/oblib/src/lib/container/ob_array_wrap.h +++ b/deps/oblib/src/lib/container/ob_array_wrap.h @@ -25,7 +25,7 @@ int databuff_print_obj_array( /// Utility tempalte class to adapt C array to an object, which can be used with databuff_print_obj template class ObIArrayWrap { - public: +public: ObIArrayWrap() : data_(NULL), count_(0) {} ObIArrayWrap(T* data, const int64_t count) : data_(data), count_(count) @@ -66,7 +66,7 @@ class ObIArrayWrap { return data_; } - protected: +protected: // Expose %data_ and %count_ here to make at(), count() be inlined, // derived class should set then appropriatly T* data_; @@ -76,7 +76,7 @@ class ObIArrayWrap { template class ObArrayWrap final : public ObIArrayWrap { - public: +public: using ObIArrayWrap::count; using ObIArrayWrap::at; @@ -150,7 +150,7 @@ class ObArrayWrap final : public ObIArrayWrap { return ret; } - protected: +protected: using ObIArrayWrap::data_; using ObIArrayWrap::count_; }; diff --git a/deps/oblib/src/lib/container/ob_bit_set.h b/deps/oblib/src/lib/container/ob_bit_set.h index ca0a5dfa1..da9b39fd8 100644 --- a/deps/oblib/src/lib/container/ob_bit_set.h +++ b/deps/oblib/src/lib/container/ob_bit_set.h @@ -25,7 +25,7 @@ namespace common { template class ObSegmentBitSet { - public: +public: template friend class ObSegmentBitSet; @@ -124,7 +124,7 @@ class ObSegmentBitSet { } NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: static const int64_t PER_BITSETWORD_MOD_BITS = 5; static const int64_t PER_BITSETWORD_BITS = (1 << PER_BITSETWORD_MOD_BITS); static const int64_t PER_BITSETWORD_MASK = PER_BITSETWORD_BITS - 1; @@ -184,7 +184,7 @@ template class ObFixedBitSet { OB_UNIS_VERSION(1); - public: +public: typedef uint32_t BitSetWord; ObFixedBitSet() @@ -225,7 +225,7 @@ class ObFixedBitSet { } } - private: +private: static const int64_t PER_BITSETWORD_MOD_BITS = 5; static const int64_t PER_BITSETWORD_BITS = (1 << PER_BITSETWORD_MOD_BITS); static const int64_t PER_BITSETWORD_MASK = PER_BITSETWORD_BITS - 1; @@ -434,7 +434,7 @@ OB_SERIALIZE_MEMBER_TEMP(template , ObFixedBitSet, bitset_word_arr template class ObBitSet { - public: +public: template friend class ObBitSet; @@ -583,7 +583,7 @@ class ObBitSet { } NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: static const int64_t PER_BITSETWORD_MOD_BITS = 5; static const int64_t PER_BITSETWORD_BITS = (1 << PER_BITSETWORD_MOD_BITS); static const int64_t PER_BITSETWORD_MASK = PER_BITSETWORD_BITS - 1; diff --git a/deps/oblib/src/lib/container/ob_bitmap.h b/deps/oblib/src/lib/container/ob_bitmap.h index 1b7eff792..afef94796 100644 --- a/deps/oblib/src/lib/container/ob_bitmap.h +++ b/deps/oblib/src/lib/container/ob_bitmap.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObBitmap { - public: +public: typedef uint64_t size_type; typedef uint64_t block_type; @@ -30,7 +30,7 @@ class ObBitmap { static const size_type BLOCK_MOD_MASK = BITS_PER_BLOCK - 1; static const size_type BLOCK_MOD_BITS = 6; - public: +public: ObBitmap(ObIAllocator& allocator); virtual ~ObBitmap(); @@ -115,7 +115,7 @@ class ObBitmap { */ int load_blocks_from_array(block_type* block_data, size_type num_bits); - public: +public: inline size_type capacity() const { return num_bits_; @@ -142,7 +142,7 @@ class ObBitmap { } inline int init(const size_type valid_bits, const bool is_all_true = false); - private: +private: struct MemBlock { MemBlock* next_; block_type bits_[BLOCKS_PER_MEM_BLOCK]; @@ -156,7 +156,7 @@ class ObBitmap { } }; - private: +private: inline static size_type block_index(size_type pos) { return pos >> BLOCK_MOD_BITS; @@ -180,7 +180,7 @@ class ObBitmap { DISALLOW_COPY_AND_ASSIGN(ObBitmap); - private: +private: size_type valid_bits_; size_type num_bits_; size_type popcnt_; diff --git a/deps/oblib/src/lib/container/ob_concurrent_bitset.h b/deps/oblib/src/lib/container/ob_concurrent_bitset.h index ad8cb1a7a..5d7d088f3 100644 --- a/deps/oblib/src/lib/container/ob_concurrent_bitset.h +++ b/deps/oblib/src/lib/container/ob_concurrent_bitset.h @@ -19,12 +19,12 @@ namespace oceanbase { namespace common { template class ObConcurrentBitset { - private: +private: static const uint64_t PER_WORD_BIT_NUM = 64; static const uint64_t FULL_WORD_VALUE = UINT64_MAX; static const uint16_t WORD_NUM = (SIZE / PER_WORD_BIT_NUM) + 1; - public: +public: ObConcurrentBitset() : word_array_(), start_pos_(0), mutex_() { memset(word_array_, 0, sizeof(word_array_)); @@ -40,7 +40,7 @@ class ObConcurrentBitset { int set_start_pos(uint64_t pos); uint64_t get_start_pos(); - private: +private: typedef lib::ObLockGuard LockGuard; uint64_t word_array_[WORD_NUM]; uint64_t start_pos_; // to record the start of 0bit diff --git a/deps/oblib/src/lib/container/ob_easy_array.h b/deps/oblib/src/lib/container/ob_easy_array.h index 4a31742ee..6d37ef881 100644 --- a/deps/oblib/src/lib/container/ob_easy_array.h +++ b/deps/oblib/src/lib/container/ob_easy_array.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { template class EasyArray { - public: +public: EasyArray(); EasyArray(T element); @@ -35,7 +35,7 @@ class EasyArray { return exec_status_; } - private: +private: ObArray array_; int exec_status_; }; diff --git a/deps/oblib/src/lib/container/ob_ext_ring_buffer.h b/deps/oblib/src/lib/container/ob_ext_ring_buffer.h index 5e2214a07..89a39211f 100644 --- a/deps/oblib/src/lib/container/ob_ext_ring_buffer.h +++ b/deps/oblib/src/lib/container/ob_ext_ring_buffer.h @@ -45,16 +45,16 @@ namespace common { template class ObExtendibleRingBuffer : protected erb::ObExtendibleRingBufferBase > { - public: +public: ObExtendibleRingBuffer(); virtual ~ObExtendibleRingBuffer(); - public: +public: int init(const int64_t begin_sn); int destroy(); bool is_inited() const; - public: +public: // Get T* at sn. // sn should be in [begin_sn, end_sn) // @@ -115,10 +115,10 @@ class ObExtendibleRingBuffer : protected erb::ObExtendibleRingBufferBase MyType; typedef erb::ObExtendibleRingBufferBase > BaseType; DISALLOW_COPY_AND_ASSIGN(ObExtendibleRingBuffer); diff --git a/deps/oblib/src/lib/container/ob_ext_ring_buffer_impl.h b/deps/oblib/src/lib/container/ob_ext_ring_buffer_impl.h index 3680c94c9..4c6b63659 100644 --- a/deps/oblib/src/lib/container/ob_ext_ring_buffer_impl.h +++ b/deps/oblib/src/lib/container/ob_ext_ring_buffer_impl.h @@ -39,7 +39,7 @@ static inline void on_fatal_error() // alloc class RingBufferAlloc : public ObIAllocator { - public: +public: RingBufferAlloc() : mem_attr_() { mem_attr_.label_ = ObModIds::OB_RING_BUFFER; @@ -64,7 +64,7 @@ class RingBufferAlloc : public ObIAllocator { mem_attr_ = attr; } - private: +private: ObMemAttr mem_attr_; DISALLOW_COPY_AND_ASSIGN(RingBufferAlloc); }; @@ -217,7 +217,7 @@ class ObExtendibleRingBufferBase { static const int64_t MIN_SEG_CNT = 2; static const int64_t INIT_SEG_CNT = MIN_SEG_CNT; typedef std::pair SlotIdx; // - public: +public: // Interface for subclass. ObExtendibleRingBufferBase() : inited_(false), seg_size_(0), seg_capacity_(0), begin_sn_(0), end_sn_(0), dir_(0), es_lock_(), allocator_(NULL) @@ -306,7 +306,7 @@ class ObExtendibleRingBufferBase { update_end_sn_(end_id); } - protected: +protected: typedef common::ObExternalRef::RetireList RetireList; ObExternalRef& get_dir_ref() { @@ -329,7 +329,7 @@ class ObExtendibleRingBufferBase { return retire_list; } - private: +private: // Atomic loader & setter. int64_t load_begin_sn_() { @@ -851,7 +851,7 @@ class ObExtendibleRingBufferBase { return ret; } - private: +private: bool inited_; int64_t seg_size_; int64_t seg_capacity_; diff --git a/deps/oblib/src/lib/container/ob_fast_array.h b/deps/oblib/src/lib/container/ob_fast_array.h index c38464a86..7af323f95 100644 --- a/deps/oblib/src/lib/container/ob_fast_array.h +++ b/deps/oblib/src/lib/container/ob_fast_array.h @@ -25,7 +25,7 @@ class ObFastArrayIterator; template class ObFastArray final { - public: +public: typedef array::ObFastArrayIterator iterator; ObFastArray(common::ObIAllocator* allocator = NULL); ObFastArray(common::ObIAllocator& allocator); @@ -127,7 +127,7 @@ class ObFastArray final { void destroy(); int64_t to_string(char* buf, int64_t buf_len) const; - private: +private: int push_back_when_full(const T& obj); inline T* get_buffer() { @@ -138,7 +138,7 @@ class ObFastArray final { return capacity_ <= LOCAL_ARRAY_SIZE ? stack_ : heap_; } - private: +private: // data members T* stack_; char stack_buf_[LOCAL_ARRAY_SIZE * sizeof(T)]; diff --git a/deps/oblib/src/lib/container/ob_fixed_array.h b/deps/oblib/src/lib/container/ob_fixed_array.h index 12d8a9ba8..4f3f2a90e 100644 --- a/deps/oblib/src/lib/container/ob_fixed_array.h +++ b/deps/oblib/src/lib/container/ob_fixed_array.h @@ -27,7 +27,7 @@ class Iterator; template class ObFixedArrayImpl : public ObIArray { - public: +public: using ObIArray::count; using ObIArray::at; @@ -295,7 +295,7 @@ class ObFixedArrayImpl : public ObIArray { NEED_SERIALIZE_AND_DESERIALIZE; - protected: +protected: using ObIArray::data_; using ObIArray::count_; @@ -303,13 +303,13 @@ class ObFixedArrayImpl : public ObIArray { uint32_t init_cnt_; uint32_t capacity_; - private: +private: int copy_assign_ret_; }; template class ObFixedArray final : public ObFixedArrayImpl { - public: +public: // use ObArrayImpl constructors using ObFixedArrayImpl::ObFixedArrayImpl; }; diff --git a/deps/oblib/src/lib/container/ob_heap.h b/deps/oblib/src/lib/container/ob_heap.h index 016040bed..0e9ecc0e3 100644 --- a/deps/oblib/src/lib/container/ob_heap.h +++ b/deps/oblib/src/lib/container/ob_heap.h @@ -18,7 +18,7 @@ namespace common { template class ObBinaryHeapBase { - public: +public: ObBinaryHeapBase(CompareFunctor& cmp, common::ObIAllocator* allocator = NULL); virtual ~ObBinaryHeapBase() { /* do nothing */ @@ -52,11 +52,11 @@ class ObBinaryHeapBase { } TO_STRING_KV(K_(array)); - protected: +protected: virtual int upheap(int64_t index) = 0; virtual int downheap(int64_t index) = 0; - protected: +protected: virtual void reset_root_cmp_cache() { root_cmp_index_cache_ = INT64_MAX; @@ -79,7 +79,7 @@ class ObBinaryHeapBase { return 2 * index + 2; } - protected: +protected: ObSEArray array_; int64_t root_cmp_index_cache_; CompareFunctor& cmp_; @@ -173,16 +173,16 @@ int ObBinaryHeapBase::replace_top(const T& template class ObBinaryHeap : public ObBinaryHeapBase { - public: +public: ObBinaryHeap(CompareFunctor& cmp, common::ObIAllocator* allocator = NULL); virtual ~ObBinaryHeap() {} - protected: +protected: virtual int upheap(int64_t index); virtual int downheap(int64_t index); - private: +private: using ObBinaryHeapBase::array_; using ObBinaryHeapBase::cmp_; using ObBinaryHeapBase::root_cmp_index_cache_; diff --git a/deps/oblib/src/lib/container/ob_iarray.h b/deps/oblib/src/lib/container/ob_iarray.h index 863338f38..dd50757cc 100644 --- a/deps/oblib/src/lib/container/ob_iarray.h +++ b/deps/oblib/src/lib/container/ob_iarray.h @@ -22,7 +22,7 @@ namespace common { // this interface has three derived classes: ObArray, ObSEArray and Ob2DArray. template class ObIArray : public ObIArrayWrap { - public: +public: using ObIArrayWrap::at; using ObIArrayWrap::count; ObIArray() : ObIArrayWrap() @@ -68,7 +68,7 @@ class ObIArray : public ObIArrayWrap { return pos; } - protected: +protected: using ObIArrayWrap::data_; using ObIArrayWrap::count_; DISALLOW_COPY_AND_ASSIGN(ObIArray); diff --git a/deps/oblib/src/lib/container/ob_id_map.h b/deps/oblib/src/lib/container/ob_id_map.h index 3d3bba4d0..edaf8de13 100644 --- a/deps/oblib/src/lib/container/ob_id_map.h +++ b/deps/oblib/src/lib/container/ob_id_map.h @@ -39,15 +39,15 @@ class ObIDMap { T* data; }; - public: +public: ObIDMap(); ~ObIDMap(); - public: +public: int init(const ID_TYPE num); void destroy(); - public: +public: int assign(T* value, ID_TYPE& id); int get(const ID_TYPE id, T*& value) const; T* fetch(const ID_TYPE id, const FetchMod mod = FM_SHARED); @@ -55,7 +55,7 @@ class ObIDMap { void erase(const ID_TYPE id); int size() const; - public: +public: // callback::operator()(const ID_TYPE id) template void traverse(Callback& cb) const @@ -69,7 +69,7 @@ class ObIDMap { } }; - private: +private: ID_TYPE num_; ID_TYPE overflow_limit_; Node* array_; diff --git a/deps/oblib/src/lib/container/ob_id_set.h b/deps/oblib/src/lib/container/ob_id_set.h index c72069ada..a4a4a9915 100644 --- a/deps/oblib/src/lib/container/ob_id_set.h +++ b/deps/oblib/src/lib/container/ob_id_set.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { // assign each ID an index class ObId2Idx { - public: +public: ObId2Idx(); virtual ~ObId2Idx(); void reset(); @@ -31,28 +31,28 @@ class ObId2Idx { /// @retval -1 id not exist int32_t get_idx(uint64_t id) const; - private: +private: // types and constants typedef common::hash::ObPlacementHashMap Id2IdxMap; - private: +private: // disallow copy ObId2Idx(const ObId2Idx& other); ObId2Idx& operator=(const ObId2Idx& other); // function members - private: +private: // data members Id2IdxMap id2idx_; }; // A set of IDs class ObIdSet { - public: +public: typedef common::hash::ObIteratableHashSet IdSet; typedef ObBitSet BitSet; typedef IdSet::const_iterator_t ConstIterator; - public: +public: ObIdSet(); virtual ~ObIdSet(); void reset(); @@ -76,13 +76,13 @@ class ObIdSet { }; TO_STRING_KV(N_ID_SET, id_set_); - private: - private: +private: +private: // disallow copy ObIdSet(const ObIdSet& other); ObIdSet& operator=(const ObIdSet& other); // function members - private: +private: // data members IdSet id_set_; BitSet bit_set_; diff --git a/deps/oblib/src/lib/container/ob_int_flags.h b/deps/oblib/src/lib/container/ob_int_flags.h index 748cfb154..d84b28a59 100644 --- a/deps/oblib/src/lib/container/ob_int_flags.h +++ b/deps/oblib/src/lib/container/ob_int_flags.h @@ -43,7 +43,7 @@ struct ObInt64Flags { TO_STRING_KV("flags", PHEX(&flags_, sizeof(flags_))); - private: +private: int64_t flags_; }; diff --git a/deps/oblib/src/lib/container/ob_loser_tree.h b/deps/oblib/src/lib/container/ob_loser_tree.h index 9cf75c3eb..815d15f06 100644 --- a/deps/oblib/src/lib/container/ob_loser_tree.h +++ b/deps/oblib/src/lib/container/ob_loser_tree.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { template class ObLoserTree { - public: +public: explicit ObLoserTree(CompareFunctor& cmp); virtual ~ObLoserTree() = default; @@ -45,11 +45,11 @@ class ObLoserTree { return is_unique_champion_; } - protected: +protected: enum class ReplayType { NO_CHANGE = 0, LOSER_CHANGE = 1, WINNER_CHANGE = 2, BOTH_CHANGE = 3 }; struct MatchResult { - public: + public: MatchResult() { reset(); @@ -102,12 +102,12 @@ class ObLoserTree { return 2 * index + 2; } - private: +private: ObLoserTree() = delete; ObLoserTree(const ObLoserTree&) = delete; void operator=(const ObLoserTree&) = delete; - protected: +protected: static const int64_t INVALID_IDX = -1; bool is_inited_; diff --git a/deps/oblib/src/lib/container/ob_mask_set2.h b/deps/oblib/src/lib/container/ob_mask_set2.h index e20ea5f58..736e96e57 100644 --- a/deps/oblib/src/lib/container/ob_mask_set2.h +++ b/deps/oblib/src/lib/container/ob_mask_set2.h @@ -25,7 +25,7 @@ namespace common { template class ObMaskSet2 { - public: +public: ObMaskSet2() : is_inited_(false), array_(NULL), bitset_() {} ~ObMaskSet2() @@ -53,7 +53,7 @@ class ObMaskSet2 { bitset_.reuse(); } - public: +public: int mask(const T& key) { int ret = OB_SUCCESS; @@ -143,7 +143,7 @@ class ObMaskSet2 { return bool_ret; } - private: +private: bool is_inited_; const ObIArray* array_; ObBitSet<> bitset_; diff --git a/deps/oblib/src/lib/container/ob_paringheap.h b/deps/oblib/src/lib/container/ob_paringheap.h index ecd33d210..1187fdf50 100644 --- a/deps/oblib/src/lib/container/ob_paringheap.h +++ b/deps/oblib/src/lib/container/ob_paringheap.h @@ -73,7 +73,7 @@ struct ObParingHeapNodeBase { #define PHNODE(type, phlink) \ class ObParingHeapNode##_##phlink : public ObParingHeapNodeBase { \ - public: \ + public: \ OB_INLINE static type* get_next(const type* n) \ { \ return n->phlink##_.get_next(); \ @@ -115,7 +115,7 @@ struct ObDummyCompHelper { template class ObParingHeap { - public: +public: typedef Compare ObCompHepler; typedef ObParingHeap Paringheap; @@ -533,7 +533,7 @@ class ObParingHeap { L::set_lchild(node_source, node_target); } - private: +private: T* root_; ObCompHepler compare_; }; diff --git a/deps/oblib/src/lib/container/ob_pointer_array.h b/deps/oblib/src/lib/container/ob_pointer_array.h index cf00546c5..af90fc8a7 100644 --- a/deps/oblib/src/lib/container/ob_pointer_array.h +++ b/deps/oblib/src/lib/container/ob_pointer_array.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace common { template class ObPointerArray { - public: +public: ObPointerArray() { memset(array_, 0, sizeof(array_)); @@ -42,7 +42,7 @@ class ObPointerArray { } }; - public: +public: T* operator[](const int64_t index) { T* ret = NULL; @@ -58,7 +58,7 @@ class ObPointerArray { return ret; }; - private: +private: T* array_[SIZE]; PageArena allocator_; }; diff --git a/deps/oblib/src/lib/container/ob_raw_se_array.h b/deps/oblib/src/lib/container/ob_raw_se_array.h index 5813e267a..fc41a4d22 100644 --- a/deps/oblib/src/lib/container/ob_raw_se_array.h +++ b/deps/oblib/src/lib/container/ob_raw_se_array.h @@ -26,7 +26,7 @@ namespace common { static const int64_t OB_DEFAULT_RAW_SE_ARRAY_COUNT = 64; template class ObRawSEArray final { - public: +public: ObRawSEArray(int64_t block_size = OB_MALLOC_NORMAL_BLOCK_SIZE, const BlockAllocatorT& alloc = BlockAllocatorT(ObModIds::OB_SE_ARRAY)); ObRawSEArray(const lib::ObLabel& label, int64_t block_size); @@ -203,11 +203,11 @@ class ObRawSEArray final { return offsetof(ObRawSEArray, block_allocator_) * 8; } - private: +private: // types and constants static const int64_t DEFAULT_MAX_PRINT_COUNT = 32; - private: +private: inline bool is_memcpy_safe() const { // no need to call constructor @@ -242,7 +242,7 @@ class ObRawSEArray final { return block_allocator_.free(p); } - private: +private: // data members T* local_data_; char local_data_buf_[LOCAL_ARRAY_SIZE * sizeof(T)]; diff --git a/deps/oblib/src/lib/container/ob_rbtree.h b/deps/oblib/src/lib/container/ob_rbtree.h index 841ce6630..e1e6a19f2 100644 --- a/deps/oblib/src/lib/container/ob_rbtree.h +++ b/deps/oblib/src/lib/container/ob_rbtree.h @@ -64,7 +64,7 @@ struct ObRbNode { #define RBNODE(type, rblink) \ class ObRbNode##_##rblink : public container::ObRbNode { \ - public: \ + public: \ OB_INLINE static type* get_left(const type* n) \ { \ return n->rblink##_.get_left(); \ @@ -117,7 +117,7 @@ struct ObDummyCompHelper { // Red-black tree structure. template class ObRbTree { - public: +public: struct ObRbPath { T* node_; int cmp_; @@ -882,7 +882,7 @@ class ObRbTree { L::set_right(node_source, node_target); } - private: +private: // Node initializer OB_INLINE void init_node(T* node) { @@ -933,7 +933,7 @@ class ObRbTree { set_right(return_node, node); } - private: +private: T* root_; CompHepler compare_; DISALLOW_COPY_AND_ASSIGN(ObRbTree); diff --git a/deps/oblib/src/lib/container/ob_ring_array.h b/deps/oblib/src/lib/container/ob_ring_array.h index d5d028dd5..0c830426a 100644 --- a/deps/oblib/src/lib/container/ob_ring_array.h +++ b/deps/oblib/src/lib/container/ob_ring_array.h @@ -25,7 +25,7 @@ inline ObQSync& get_rb_qs() } template class ObRingArray { - public: +public: typedef ObLink Link; ObRingArray() : alloc_(NULL) {} @@ -120,7 +120,7 @@ class ObRingArray { return ret; } - private: +private: void try_purge() { Link* del_list = NULL; @@ -135,7 +135,7 @@ class ObRingArray { } } - private: +private: static int64_t get_start_pos(int64_t idx) { return idx * sizeof(T); @@ -145,7 +145,7 @@ class ObRingArray { return (idx + 1) * sizeof(T); } - private: +private: common::ObIAllocator* alloc_; ObRingBuffer rbuffer_; DISALLOW_COPY_AND_ASSIGN(ObRingArray); diff --git a/deps/oblib/src/lib/container/ob_ring_buffer.h b/deps/oblib/src/lib/container/ob_ring_buffer.h index 619b9580d..814106269 100644 --- a/deps/oblib/src/lib/container/ob_ring_buffer.h +++ b/deps/oblib/src/lib/container/ob_ring_buffer.h @@ -21,11 +21,11 @@ namespace oceanbase { namespace common { class ObRingBuffer { - public: +public: typedef ObLink Link; class Node : public Link { - public: + public: static Node* const LOCKED_ADDR; friend class ObRingBuffer; Node(int64_t blk_size, int64_t start, int64_t end) @@ -136,7 +136,7 @@ class ObRingBuffer { purge_list = &retire_link_; } - private: + private: bool is_leaf() { return child_size_ <= (int64_t)sizeof(void*); @@ -293,7 +293,7 @@ class ObRingBuffer { return ret; } - private: +private: bool is_inited() { return NULL != alloc_ && blk_size_ > 0; @@ -345,7 +345,7 @@ class ObRingBuffer { return ol_del(&head_, node, target); } - private: +private: common::ObIAllocator* alloc_; int64_t blk_size_; int64_t start_; diff --git a/deps/oblib/src/lib/container/ob_se_array.h b/deps/oblib/src/lib/container/ob_se_array.h index 8e10fb1ad..0449fc449 100644 --- a/deps/oblib/src/lib/container/ob_se_array.h +++ b/deps/oblib/src/lib/container/ob_se_array.h @@ -28,7 +28,7 @@ class ObSEArrayIterator; // ObNullAllocator cannot alloc buffer class ObNullAllocator : public ObIAllocator { - public: +public: ObNullAllocator(const lib::ObLabel& label = ObModIds::OB_MOD_DO_NOT_USE_ME, int64_t tenant_id = OB_SERVER_TENANT_ID) { UNUSED(label); @@ -69,7 +69,7 @@ static inline void init_block_allocator(lib::MemoryContext& mem_entity, ModulePa static const int64_t OB_DEFAULT_SE_ARRAY_COUNT = 64; template class ObSEArrayImpl : public ObIArray { - public: +public: using ObIArray::count; using ObIArray::at; @@ -285,15 +285,15 @@ class ObSEArrayImpl : public ObIArray { return offsetof(ObSEArrayImpl, mem_context_) * 8; } - public: +public: iterator begin(); iterator end(); - private: +private: // types and constants static const int64_t DEFAULT_MAX_PRINT_COUNT = 32; - private: +private: // if the object has construct but doesn't have virtual function, it cannot memcpy // but it doesn't need to call destructor inline bool is_memcpy_safe() const @@ -330,11 +330,11 @@ class ObSEArrayImpl : public ObIArray { return block_allocator_.free(p); } - protected: +protected: using ObIArray::data_; using ObIArray::count_; - private: +private: char local_data_buf_[LOCAL_ARRAY_SIZE * sizeof(T)]; int64_t block_size_; int64_t capacity_; @@ -703,7 +703,7 @@ ObSEArrayImpl::ObSEArrayImpl( template class ObSEArray final : public ObSEArrayImpl { - public: +public: using ObSEArrayImpl::ObSEArrayImpl; }; diff --git a/deps/oblib/src/lib/container/ob_se_array_iterator.h b/deps/oblib/src/lib/container/ob_se_array_iterator.h index 3e52ab873..021a3d280 100644 --- a/deps/oblib/src/lib/container/ob_se_array_iterator.h +++ b/deps/oblib/src/lib/container/ob_se_array_iterator.h @@ -34,14 +34,14 @@ template ; - public: +public: typedef T value_type; typedef int64_t difference_type; typedef T* pointer; typedef T& reference; typedef std::random_access_iterator_tag iterator_category; - public: +public: ObSEArrayIterator() : arr_(NULL), index_(0) {} explicit ObSEArrayIterator(ObSEArrayImpl* arr, int64_t index) @@ -124,7 +124,7 @@ class ObSEArrayIterator { return (index_ <= rhs.index_); } - private: +private: ObSEArrayImpl* arr_; int64_t index_; }; diff --git a/deps/oblib/src/lib/container/ob_seg_array.h b/deps/oblib/src/lib/container/ob_seg_array.h index f447139e4..484b83968 100644 --- a/deps/oblib/src/lib/container/ob_seg_array.h +++ b/deps/oblib/src/lib/container/ob_seg_array.h @@ -27,7 +27,7 @@ namespace common { // print the item obj or derefer the obj ptr and print template class PrintElementFunctor { - public: +public: PrintElementFunctor() {} int operator()(const T& t) const @@ -39,7 +39,7 @@ class PrintElementFunctor { template class PrintElementFunctor { - public: +public: PrintElementFunctor() {} int operator()(const T* t) const @@ -55,7 +55,7 @@ class PrintElementFunctor { // Support binary search template class ObFixedRingDeque { - public: +public: ObFixedRingDeque() : is_inited_(false), head_(0), tail_(0) {} ~ObFixedRingDeque() @@ -104,7 +104,7 @@ class ObFixedRingDeque { void debug_print() const; - private: +private: inline void advance_(int64_t& v) const { v = (v + 1) % SIZE; @@ -126,7 +126,7 @@ class ObFixedRingDeque { int binary_search_on_range_(const int64_t small, const int64_t large, const SegPtr& target, SegPtr& prev, SegPtr& next, const LessThanEqualtoFunctor& le_functor); - private: +private: bool is_inited_; SegPtr arr_[SIZE]; int64_t head_; @@ -367,7 +367,7 @@ enum SegCreationType { // Order of segments is defined as the order of their first items template class Seg { - public: +public: explicit Seg(const SegCreationType type); explicit Seg(const T& item); ~Seg() @@ -414,7 +414,7 @@ class Seg { DECLARE_VIRTUAL_TO_STRING; - private: +private: T arr_[SIZE]; int64_t start_idx_; // push_front will place item at (start_idx_ - 1) int64_t end_idx_; // push_back will place item at end_idx_ @@ -602,13 +602,13 @@ int Seg::reverse_for_each(Functor& fn) const template class ObISegArray { - public: +public: ObISegArray() {} virtual ~ObISegArray() {} - public: +public: virtual int init(ObSmallAllocator* allocator) = 0; virtual void destroy() = 0; virtual int clear() = 0; @@ -634,16 +634,16 @@ class ObISegArray { // 4. other virtual int search_boundary(const T& item, T& prev_item, T& next_item) = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObISegArray); }; // ---------------------------------------------------------------------- template class ObSegArray : public ObISegArray { - private: +private: class DestroySegFunctor { - public: + public: explicit DestroySegFunctor(ObSmallAllocator* allocator) : allocator_(allocator) {} int operator()(const Seg* seg) @@ -660,13 +660,13 @@ class ObSegArray : public ObISegArray { return ret; } - private: + private: ObSmallAllocator* allocator_; }; // Seg order functor, less than or equal to. class SegLEFunctor { - public: + public: SegLEFunctor() {} bool operator()(const Seg* x, const Seg* y) const @@ -683,7 +683,7 @@ class ObSegArray : public ObISegArray { template class ReverseForEachFunctor { - public: + public: explicit ReverseForEachFunctor(Functor& fn) : fn_(fn) {} int operator()(const Seg* seg) @@ -698,11 +698,11 @@ class ObSegArray : public ObISegArray { return ret; } - private: + private: Functor& fn_; }; - public: +public: ObSegArray() : is_inited_(false), rwlock_(), dir_(), allocator_(NULL), total_count_(0) {} virtual int init(ObSmallAllocator* allocator) override; @@ -751,14 +751,14 @@ class ObSegArray : public ObISegArray { template int reverse_for_each(Functor& fn) const; - private: +private: inline int alloc_seg(Seg*& seg, const SegCreationType type); void free_seg(Seg* seg); int top_front_(T& top_item, const bool pop_it); int top_back_(T& top_item, const bool pop_it); int search_boundary_internal_(const T& item, T*& prev_item, T*& next_item); - private: +private: bool is_inited_; mutable SpinRWLock rwlock_; ObFixedRingDeque*, SEG_COUNT> dir_; diff --git a/deps/oblib/src/lib/container/ob_vector.h b/deps/oblib/src/lib/container/ob_vector.h index 8097fa890..5eeaba5e9 100644 --- a/deps/oblib/src/lib/container/ob_vector.h +++ b/deps/oblib/src/lib/container/ob_vector.h @@ -20,7 +20,7 @@ namespace common { template struct ob_vector_traits { - public: +public: typedef T& pointee_type; typedef T value_type; typedef const T& const_value_type; @@ -31,7 +31,7 @@ struct ob_vector_traits { template struct ob_vector_traits { - public: +public: typedef T pointee_type; typedef T* value_type; typedef const T* const_value_type; @@ -72,7 +72,7 @@ struct ob_vector_traits { template > class ObVector { - public: +public: typedef typename ob_vector_traits::pointee_type pointee_type; typedef typename ob_vector_traits::value_type value_type; typedef typename ob_vector_traits::const_value_type const_value_type; @@ -80,7 +80,7 @@ class ObVector { typedef typename ob_vector_traits::const_iterator const_iterator; typedef typename ob_vector_traits::difference_type difference_type; - public: +public: explicit ObVector(Allocator* alloc = NULL, const lib::ObLabel& label = ObModIds::OB_MOD_DO_NOT_USE_ME); explicit ObVector(int64_t size, Allocator* alloc = NULL, const lib::ObLabel& label = ObModIds::OB_MOD_DO_NOT_USE_ME); virtual ~ObVector(); @@ -88,7 +88,7 @@ class ObVector { ObVector& operator=(const ObVector& other); explicit ObVector(const ObVector& other); - public: +public: int32_t size() const { return static_cast(mem_end_ - mem_begin_); @@ -102,7 +102,7 @@ class ObVector { return static_cast(mem_end_of_storage_ - mem_end_); } - public: +public: iterator begin() const { return mem_begin_; @@ -151,7 +151,7 @@ class ObVector { return at(index); } - public: +public: int push_back(const_value_type value); int insert(iterator pos, const_value_type value); int replace(iterator pos, const_value_type value, value_type& replaced_value); @@ -177,18 +177,18 @@ class ObVector { } int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: void destroy(); int expand(int64_t size); - private: +private: iterator alloc_array(const int64_t size); static iterator fill(iterator ptr, const_value_type value); static iterator copy(iterator dest, const_iterator begin, const_iterator end); static iterator move(iterator dest, const_iterator begin, const_iterator end); - protected: +protected: iterator mem_begin_; iterator mem_end_; iterator mem_end_of_storage_; @@ -198,7 +198,7 @@ class ObVector { template > class ObSortedVector { - public: +public: typedef Allocator allocator_type; typedef ObVector vector_type; typedef typename vector_type::iterator iterator; @@ -207,7 +207,7 @@ class ObSortedVector { typedef typename vector_type::const_value_type const_value_type; typedef typename vector_type::difference_type difference_type; - public: +public: ObSortedVector() {} explicit ObSortedVector( @@ -243,7 +243,7 @@ class ObSortedVector { } } - public: +public: inline int32_t size() const { return vector_.size(); @@ -285,7 +285,7 @@ class ObSortedVector { return vector_.to_string(buf, buf_len); } - public: +public: inline iterator begin() const { return vector_.begin(); @@ -303,7 +303,7 @@ class ObSortedVector { return vector_.get_allocator(); } - public: +public: inline bool at(const int64_t index, value_type& v) const { return vector_.at(index, v); @@ -319,7 +319,7 @@ class ObSortedVector { return at(static_cast(index)); } - public: +public: template int insert(const_value_type value, iterator& insert_pos, Compare compare); /** @@ -350,7 +350,7 @@ class ObSortedVector { template void sort(Compare compare); - private: +private: ObVector vector_; }; diff --git a/deps/oblib/src/lib/core_local/ob_core_local_storage.h b/deps/oblib/src/lib/core_local/ob_core_local_storage.h index 2fdf3a79d..e5d8de8c0 100644 --- a/deps/oblib/src/lib/core_local/ob_core_local_storage.h +++ b/deps/oblib/src/lib/core_local/ob_core_local_storage.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace common { template class ObCoreLocalStorage { - public: +public: ObCoreLocalStorage(); ~ObCoreLocalStorage(); inline int init(int64_t array_len = INT64_MAX); @@ -37,12 +37,12 @@ class ObCoreLocalStorage { inline int set_value(int64_t index, const T& val); inline int64_t get_array_idx() const; - protected: +protected: inline int check_inited() const; DISALLOW_COPY_AND_ASSIGN(ObCoreLocalStorage); - protected: +protected: static const int64_t ITEM_SIZE = sizeof(T) > CACHE_ALIGN_SIZE ? sizeof(T) : CACHE_ALIGN_SIZE; static const int64_t STORAGE_SIZE_TIMES = 2; void* val_array_; @@ -52,7 +52,7 @@ class ObCoreLocalStorage { } CACHE_ALIGNED; class ObCoreLocalPtr : public ObCoreLocalStorage { - public: +public: inline int cas_value(void*& old_val, void*& new_val); } CACHE_ALIGNED; diff --git a/deps/oblib/src/lib/coro/co_base_sched.h b/deps/oblib/src/lib/coro/co_base_sched.h index 25452da10..2b73f28fa 100644 --- a/deps/oblib/src/lib/coro/co_base_sched.h +++ b/deps/oblib/src/lib/coro/co_base_sched.h @@ -36,11 +36,11 @@ class CoBaseSched : public CoThread, public EventBase { using RunFuncT = std::function; using ExitCBFuncT = std::function; - public: +public: class Worker; class Task; - public: +public: CoBaseSched(); virtual ~CoBaseSched(); @@ -57,7 +57,7 @@ class CoBaseSched : public CoThread, public EventBase { int submit(const RunFuncT& func); static int add_exit_cb(const ExitCBFuncT& func); - protected: +protected: using TaskList = common::ObDList; using List = common::ObDList; using LinkedNode = common::ObDLinkNode; @@ -90,13 +90,13 @@ class CoBaseSched : public CoThread, public EventBase { void cancel_timer(CoTimer& timer) override; void store_loop_time(); - protected: +protected: // set if scheduler won't exit unless other stop it. bool keep_alive_; // tasks others submit to this scheduler. TaskList tasks_; - protected: +protected: List routines_; List finished_routines_; LinkedList runnables_; @@ -113,7 +113,7 @@ class CoBaseSched::Worker : public CoRoutine, public common::ObDLinkBase using LinkedNode = CoBaseSched::LinkedNode; using LinkedList = CoBaseSched::LinkedList; - public: +public: Worker(CoBaseSched& sched, Task* task = nullptr) : CoRoutine(sched), sched_(sched), node_(), task_(task) { node_.get_data() = this; @@ -124,27 +124,27 @@ class CoBaseSched::Worker : public CoRoutine, public common::ObDLinkBase void sleep_until(int64_t abs_time) override; void add_to_runnable(LinkedList& list); - protected: +protected: CoBaseSched& get_sched() { return sched_; } - private: +private: virtual void on_status_change(RunStatus prev, RunStatus curr) final; - private: +private: CoBaseSched& sched_; LinkedNode node_; // runnable node. Task* task_; }; class CoBaseSched::Task : public common::ObDLinkBase { - public: +public: Task(const RunFuncT& func) : func_(func) {} - public: +public: RunFuncT func_; }; diff --git a/deps/oblib/src/lib/coro/co_config.h b/deps/oblib/src/lib/coro/co_config.h index 6d82a581c..447415741 100644 --- a/deps/oblib/src/lib/coro/co_config.h +++ b/deps/oblib/src/lib/coro/co_config.h @@ -44,7 +44,7 @@ struct CoConfig { /// whether there are routines waiting to run. int64_t slice_ticks_ = 4 << 20; - private: +private: /// Make \c config() to be the only place where can construct \c /// CoConfig instance. friend CoConfig& config(); diff --git a/deps/oblib/src/lib/coro/co_context.h b/deps/oblib/src/lib/coro/co_context.h index d3c952284..624c30a32 100644 --- a/deps/oblib/src/lib/coro/co_context.h +++ b/deps/oblib/src/lib/coro/co_context.h @@ -24,10 +24,10 @@ namespace lib { using FContext = boost::context::detail::fcontext_t; class CoCtx { - private: +private: static constexpr uint64_t MAX_CO_LOCAL_STORE_SIZE = 512; - public: +public: // Create a new co-routine context // // @param ss_size stack size of created context @@ -42,7 +42,7 @@ class CoCtx { // static void destroy(CoCtx* cc); - public: +public: int init(const uint64_t tenant_id, const size_t ss_size); FContext& get_ctx(); const FContext& get_ctx() const; @@ -56,7 +56,7 @@ class CoCtx { CoCtx() : ctx_(), ss_sp_(nullptr), ss_size_(0) {} - private: +private: FContext ctx_; char* ss_sp_; size_t ss_size_; diff --git a/deps/oblib/src/lib/coro/co_local_storage.h b/deps/oblib/src/lib/coro/co_local_storage.h index 9597b29b2..e87cef529 100644 --- a/deps/oblib/src/lib/coro/co_local_storage.h +++ b/deps/oblib/src/lib/coro/co_local_storage.h @@ -44,7 +44,7 @@ class CoLocalStorage { template class INode; - public: +public: // Allocate `bytes' bytes memory space from co-routine local // storage. There's no free interface because memory allocated by // `alloc' interface would been freed whenever relating routine @@ -56,7 +56,7 @@ class CoLocalStorage { template static typename INode::RETT* get_instance(); - private: +private: // Memory of the allocator object. static CoVar buf_; // Pointer of allocator @@ -70,7 +70,7 @@ inline void* CoLocalStorage::alloc(int64_t bytes) template class CoLocalStorage::INode { - public: +public: using RETT = T; INode() : obj_([this] { this->create(); }, [this] { this->destroy(); }) {} @@ -79,7 +79,7 @@ class CoLocalStorage::INode { return obj_.get(); } - private: +private: void create() { void* ptr = CoLocalStorage::alloc(sizeof(T)); @@ -97,13 +97,13 @@ class CoLocalStorage::INode { } } - private: +private: CoObj obj_; }; template class CoLocalStorage::INode { - public: +public: using RETT = T; INode() : obj_([this] { this->create(); }, [this] { this->destroy(); }) {} @@ -112,7 +112,7 @@ class CoLocalStorage::INode { return obj_.get(); } - private: +private: void create() { void* ptr = CoLocalStorage::alloc(sizeof(T[N])); @@ -131,7 +131,7 @@ class CoLocalStorage::INode { } } - private: +private: CoObj obj_; }; diff --git a/deps/oblib/src/lib/coro/co_protected_stack_allocator.h b/deps/oblib/src/lib/coro/co_protected_stack_allocator.h index b096dd974..b1b99ebff 100644 --- a/deps/oblib/src/lib/coro/co_protected_stack_allocator.h +++ b/deps/oblib/src/lib/coro/co_protected_stack_allocator.h @@ -38,22 +38,22 @@ struct ObStackHeader { }; class CoProtectedStackAllocator { - private: +private: class IMemHoldUpdater { - public: + public: virtual int update_hold(const uint64_t tenant_id, const ssize_t size, bool& updated) = 0; }; class MemHoldUpdater : public IMemHoldUpdater { - public: + public: virtual int update_hold(const uint64_t tenant_id, const ssize_t size, bool& updated); }; - public: +public: void* alloc(const uint64_t tenant_id, const ssize_t size); void dealloc(void* ptr); static ObStackHeader* stack_header(void* ptr); - private: +private: static ssize_t page_size(); void* __alloc(const uint64_t tenant_id, const ssize_t size); static MemHoldUpdater mhu_; @@ -64,7 +64,7 @@ class ObMemoryCutter; class CoStackMgr { friend class ObMemoryCutter; - public: +public: CoStackMgr() { dummy_.prev_ = dummy_.next_ = &dummy_; @@ -72,7 +72,7 @@ class CoStackMgr { void insert(ObStackHeader*); void erase(ObStackHeader*); - private: +private: lib::ObMutex mutex_; ObStackHeader dummy_; }; diff --git a/deps/oblib/src/lib/coro/co_routine.h b/deps/oblib/src/lib/coro/co_routine.h index ff435ecaa..8884e454a 100644 --- a/deps/oblib/src/lib/coro/co_routine.h +++ b/deps/oblib/src/lib/coro/co_routine.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace lib { class Runnable { - public: +public: virtual void run() = 0; }; @@ -34,12 +34,12 @@ class CoSched; class CoRoutine : public Runnable { friend class CoMainRoutine; - public: +public: static constexpr uint64_t DEFAULT_STACK_MEM_TENANT_ID = 500; typedef int (*CoRoutineCBFunc)(CoRoutine&); static CoRoutineCBFunc co_cb_; - public: +public: enum class RunStatus { BORN, RUNNABLE, @@ -177,7 +177,7 @@ class CoRoutine : public Runnable { // \brief Wait for routine finish. void join(); - public: +public: bool operator==(const CoRoutine& rhs) const { return this == &rhs; @@ -187,13 +187,13 @@ class CoRoutine : public Runnable { return !operator==(rhs); } - private: +private: // These functions are called whenever a routine becomes/leaves // corresponding status. virtual void on_status_change(RunStatus /*prev_status*/, RunStatus /*curr_status*/) {} - private: +private: // This constructor is used to create main routine which doesn't // have successor routine so that when it exits from its runnable // function, the thread exits. @@ -203,7 +203,7 @@ class CoRoutine : public Runnable { static void __start(boost::context::detail::transfer_t from); - private: +private: CoIdx idx_; int64_t id_; CoCtx cc_; @@ -225,7 +225,7 @@ class CoRoutine : public Runnable { // routine, Main routine use the thread's context to run itself, such // as stack space, signals and registers. class CoMainRoutine : public CoRoutine { - public: +public: explicit CoMainRoutine(CoSched& sched) : CoRoutine(sched) {} // Caution!!! diff --git a/deps/oblib/src/lib/coro/co_sched.h b/deps/oblib/src/lib/coro/co_sched.h index 8ceaecbcf..72c9effef 100644 --- a/deps/oblib/src/lib/coro/co_sched.h +++ b/deps/oblib/src/lib/coro/co_sched.h @@ -30,15 +30,15 @@ class CoTimer; /// /// CoSched is singleton for each thread. class CoSched : public CoMainRoutine { - public: +public: static CoSched* get_instance(); static CoRoutine* get_active_routine(); static void set_active_routine(CoRoutine& routine); - protected: +protected: using RoutineFunc = std::function; - public: +public: CoSched(); virtual ~CoSched(); @@ -61,7 +61,7 @@ class CoSched : public CoMainRoutine { return common::OB_ERROR; } - public: +public: // Called by normal routine to yield execution resources to others. void co_yield(void); int co_wait(int64_t duration); @@ -82,11 +82,11 @@ class CoSched : public CoMainRoutine { UNUSED(timer); } - protected: +protected: // Called by schedule routine to resume specific routine. void resume_routine(CoRoutine& routine); - public: +public: static __thread CoSched* instance_; static __thread CoRoutine* active_routine_; diff --git a/deps/oblib/src/lib/coro/co_set_sched.h b/deps/oblib/src/lib/coro/co_set_sched.h index 4c746c099..d6eaa6e17 100644 --- a/deps/oblib/src/lib/coro/co_set_sched.h +++ b/deps/oblib/src/lib/coro/co_set_sched.h @@ -51,7 +51,7 @@ using ObIAllocator = common::ObIAllocator; class CoSetSched : public CoBaseSched { static constexpr int MAX_SET_CNT = 32; - public: +public: using PrepFuncT = std::function; using PostFuncT = std::function; using RunFuncT = std::function; @@ -88,14 +88,14 @@ protected: int prepare() override; void postrun() override; - private: +private: void add_runnable(CoBaseSched::Worker& w) override; CoRoutine* get_next_runnable(int64_t& waittime) override; void remove_finished_workers(); void* allocator_alloc(ObIAllocator& allocator, size_t size); - private: +private: using SetArr = Set* [MAX_SET_CNT]; SetArr sets_; @@ -110,7 +110,7 @@ class CoSetSched::Worker : public CoBaseSched::Worker { friend class CoSetSched; using FuncT = std::function; - public: +public: Worker(CoSetSched& sched, FuncT func = nullptr, ObIAllocator* allocator = nullptr); int& get_setid(); @@ -118,10 +118,10 @@ class CoSetSched::Worker : public CoBaseSched::Worker { void check(); - private: +private: void run() override; - private: +private: int setid_; bool owned_; // True if we're responsible delete it. FuncT func_; @@ -130,7 +130,7 @@ class CoSetSched::Worker : public CoBaseSched::Worker { }; class CoSetSched::Set { - public: +public: /// \note \c Set is allocated in local storage and the dctor won't /// be called. Set(); @@ -141,10 +141,10 @@ class CoSetSched::Set { virtual void add_worker(Worker& worker); virtual Worker* get_next_runnable(int64_t& waittime); - protected: +protected: using LinkedList = CoSetSched::LinkedList; - private: +private: int setid_; LinkedList runnables_; }; diff --git a/deps/oblib/src/lib/coro/co_thread.h b/deps/oblib/src/lib/coro/co_thread.h index 643a1339c..3d8f875f8 100644 --- a/deps/oblib/src/lib/coro/co_thread.h +++ b/deps/oblib/src/lib/coro/co_thread.h @@ -22,7 +22,7 @@ namespace lib { // CoThread is a thread with co-routine schedule support. class CoThread : public Thread, public CoSched, public common::ObDLinkBase { - public: +public: CoThread(); // overwrite int start(); diff --git a/deps/oblib/src/lib/coro/co_thread_mgr.h b/deps/oblib/src/lib/coro/co_thread_mgr.h index f56570f28..fe710de39 100644 --- a/deps/oblib/src/lib/coro/co_thread_mgr.h +++ b/deps/oblib/src/lib/coro/co_thread_mgr.h @@ -25,7 +25,7 @@ namespace lib { class CoThreadMgr { constexpr static auto MAX_COTH_COUNT = 1024; - public: +public: CoThreadMgr(); virtual ~CoThreadMgr(); @@ -39,7 +39,7 @@ class CoThreadMgr { int add_thread(CoThread& th); - private: +private: DISALLOW_COPY_AND_ASSIGN(CoThreadMgr); CoThread* th_vec_[MAX_COTH_COUNT]; diff --git a/deps/oblib/src/lib/coro/co_timer.h b/deps/oblib/src/lib/coro/co_timer.h index eb6d0c282..dcf33e576 100644 --- a/deps/oblib/src/lib/coro/co_timer.h +++ b/deps/oblib/src/lib/coro/co_timer.h @@ -20,13 +20,13 @@ namespace oceanbase { namespace lib { class CoTimer : public CoTimerQueue::Node { - public: +public: CoTimer(int64_t expires) : CoTimerQueue::Node(expires) {} }; class CoTimerSleeper : public CoTimer { - public: +public: CoTimerSleeper(CoRoutine& routine, int64_t expires) : CoTimer(expires), routine_(&routine) {} CoRoutine* routine_; diff --git a/deps/oblib/src/lib/coro/co_timer_queue.h b/deps/oblib/src/lib/coro/co_timer_queue.h index 809954c14..368f3532e 100644 --- a/deps/oblib/src/lib/coro/co_timer_queue.h +++ b/deps/oblib/src/lib/coro/co_timer_queue.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace lib { class CoTimerQueue { - public: +public: struct Node { Node(int64_t expires); int compare(const Node* node) const @@ -36,7 +36,7 @@ class CoTimerQueue { int64_t expires_; }; - public: +public: CoTimerQueue(); bool add(Node* node); @@ -44,7 +44,7 @@ class CoTimerQueue { Node* get_next(); - private: +private: container::ObRbTree> rb_tree_; Node* next_; }; diff --git a/deps/oblib/src/lib/coro/co_user_thread.h b/deps/oblib/src/lib/coro/co_user_thread.h index 6d3f02c82..bfac2d8a4 100644 --- a/deps/oblib/src/lib/coro/co_user_thread.h +++ b/deps/oblib/src/lib/coro/co_user_thread.h @@ -36,7 +36,7 @@ template class CoUserThreadTemp : public Sched { using RunFuncT = std::function; - public: +public: explicit CoUserThreadTemp(const RunFuncT& runnable, int64_t stack_size = 0) : worker_(*this, runnable), stack_size_(stack_size), max_tasks_(INT64_MAX), cur_tasks_(0) {} @@ -88,7 +88,7 @@ class CoUserThreadTemp : public Sched { return cur_tasks_; } - private: +private: typename Sched::Worker worker_; int64_t stack_size_; int64_t max_tasks_; @@ -97,7 +97,7 @@ class CoUserThreadTemp : public Sched { template class CoKThreadTemp { - public: +public: using RunFuncT = std::function; explicit CoKThreadTemp(int64_t n_threads = 1) @@ -151,7 +151,7 @@ class CoKThreadTemp { return threads_[0]->get_tid(); } - public: +public: void set_thread_max_tasks(uint64_t cnt); int submit_to(uint64_t idx, RunFuncT& func); @@ -162,7 +162,7 @@ class CoKThreadTemp { int64_t get_cur_tasks() const; - protected: +protected: virtual bool has_set_stop() const { return ATOMIC_LOAD(&stop_); @@ -176,7 +176,7 @@ class CoKThreadTemp { return n_threads_; } - private: +private: virtual void run(int64_t idx) = 0; /// \brief Create thread with start entry \c entry. @@ -185,7 +185,7 @@ class CoKThreadTemp { /// \brief Destroy thread. void destroy_thread(Thread* thread); - private: +private: int64_t n_threads_; Thread** threads_; int64_t stack_size_; diff --git a/deps/oblib/src/lib/coro/co_utils.h b/deps/oblib/src/lib/coro/co_utils.h index ca10cd997..0d2d5c2b7 100644 --- a/deps/oblib/src/lib/coro/co_utils.h +++ b/deps/oblib/src/lib/coro/co_utils.h @@ -33,13 +33,13 @@ CoIdx alloc_coidx(); void free_coidx(CoIdx coidx); class CoSpinLock { - public: +public: CoSpinLock(); void lock(); bool trylock(); void unlock(); - private: +private: volatile int v_; }; diff --git a/deps/oblib/src/lib/coro/co_var.h b/deps/oblib/src/lib/coro/co_var.h index 564c4983a..f2a416a39 100644 --- a/deps/oblib/src/lib/coro/co_var.h +++ b/deps/oblib/src/lib/coro/co_var.h @@ -28,7 +28,7 @@ EXTERN_C_END // Represent basic numeric co-routine local variable. template class CoVarBase { - public: +public: CoVarBase() { eoffset_ = CVC.apply(); @@ -72,7 +72,7 @@ class CoVarBase { return default_value; } - protected: +protected: // co-routine variable can't have initial value. CoVarBase(const T& v) = delete; @@ -106,7 +106,7 @@ class CoVarBase { return *reinterpret_cast(buffer + eoffset_); } - private: +private: char* get_default_crls() const { // @FIXME: free buffer after thread exiting. @@ -124,7 +124,7 @@ class CoVarBase { return DEFAULT_CRLS; } - private: +private: int64_t eoffset_; int64_t voffset_; }; @@ -139,7 +139,7 @@ class CoVar { // Pointer type of variable template class CoVar : public CoVarBase { - public: +public: using CoVarBase::operator=; T* operator->() const { @@ -167,7 +167,7 @@ class CoVar : public CoVarBase { #define DEF_NUM_CO_VAR(T) \ template <> \ class CoVar : public CoVarBase { \ - public: \ + public: \ using CoVarBase::operator=; \ } DEF_NUM_CO_VAR(bool); @@ -188,7 +188,7 @@ using CRV = CoVar; // CoObj is a special CoVar class which support init and deinit hooks. template class CoObj : protected CoVarBase, public CoVarHook { - public: +public: CoObj(CoVarHook::Func init, CoVarHook::Func deinit) : CoVarHook(init, deinit) {} T& get() diff --git a/deps/oblib/src/lib/coro/co_var_center.h b/deps/oblib/src/lib/coro/co_var_center.h index ce3b5bb6d..3adcbffef 100644 --- a/deps/oblib/src/lib/coro/co_var_center.h +++ b/deps/oblib/src/lib/coro/co_var_center.h @@ -33,7 +33,7 @@ extern pthread_key_t default_crls_key; class CoVarHook { friend class CoVarCenter; - protected: +protected: using Func = std::function; CoVarHook(Func init, Func deinit) : init_(init), deinit_(deinit) {} @@ -45,7 +45,7 @@ class CoVarHook { class CoRoutine; class CoVarCenter { - public: +public: /// Apply new co-routine local variable with type of T. Every /// co-routine local variable should use this method to get offset of /// its CRLS buffer. @@ -82,11 +82,11 @@ class CoVarCenter { return cvc_; } - private: +private: CoVarCenter(); ~CoVarCenter(); - private: +private: CoSpinLock lock_; int64_t size_ = 0; }; diff --git a/deps/oblib/src/lib/coro/syscall/co_cond.h b/deps/oblib/src/lib/coro/syscall/co_cond.h index 50a070846..90df4e5cc 100644 --- a/deps/oblib/src/lib/coro/syscall/co_cond.h +++ b/deps/oblib/src/lib/coro/syscall/co_cond.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace lib { class CoCond { - public: +public: CoCond() {} ~CoCond() @@ -64,11 +64,11 @@ class CoCond { return ret; } - private: +private: ObMutex mutex_; CoFutex futex_; - private: +private: DISALLOW_COPY_AND_ASSIGN(CoCond); }; diff --git a/deps/oblib/src/lib/coro/syscall/co_futex.h b/deps/oblib/src/lib/coro/syscall/co_futex.h index db4aca871..ea1ff5778 100644 --- a/deps/oblib/src/lib/coro/syscall/co_futex.h +++ b/deps/oblib/src/lib/coro/syscall/co_futex.h @@ -24,7 +24,7 @@ namespace lib { class TmpSpinLock { std::atomic_flag locked = ATOMIC_FLAG_INIT; - public: +public: void lock() { while (locked.test_and_set(std::memory_order_acquire)) { @@ -41,7 +41,7 @@ class CoFutex { class Node; using Queue = common::ObDList; - public: +public: CoFutex() : spin_(), v_(), q_(), waiters_(), sys_waiters_() {} @@ -63,7 +63,7 @@ class CoFutex { // routines up waiting on the futex. int wake(int64_t n); - public: +public: // Force using syscall futex instead of choosing automatically. This // method is designed for performance tuning or as a global switch // before coroutine getting stable. It must be called at the most @@ -73,7 +73,7 @@ class CoFutex { force_syscall_futex_ = true; } - private: +private: static bool force_syscall_futex_; TmpSpinLock spin_; @@ -86,11 +86,11 @@ class CoFutex { class CoFutex::Node : public common::ObDLinkBase { friend class CoFutex; - public: +public: Node(CoRoutine& routine) : routine_(routine) {} - private: +private: CoRoutine& routine_; }; diff --git a/deps/oblib/src/lib/coro/thread.h b/deps/oblib/src/lib/coro/thread.h index 72d54ad60..19da8e287 100644 --- a/deps/oblib/src/lib/coro/thread.h +++ b/deps/oblib/src/lib/coro/thread.h @@ -24,7 +24,7 @@ namespace lib { class Thread { using Runnable = std::function; - public: +public: Thread(); Thread(int64_t stack_size); Thread(Runnable runnable, int64_t stack_size = 0); @@ -47,18 +47,18 @@ class Thread { bool has_set_stop() const; - public: +public: static __thread bool monopoly_; - private: +private: static void* __th_start(void* th); void destroy_stack(); static __thread Thread* current_thread_; - private: +private: static int64_t total_thread_count_; - private: +private: pthread_t pth_; pid_t pid_; pid_t tid_; diff --git a/deps/oblib/src/lib/cpu/ob_cpu_topology.h b/deps/oblib/src/lib/cpu/ob_cpu_topology.h index dc2e339de..11ac42b50 100644 --- a/deps/oblib/src/lib/cpu/ob_cpu_topology.h +++ b/deps/oblib/src/lib/cpu/ob_cpu_topology.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObCpuTopology { - public: +public: static const int64_t MAX_CORE_NUMBER_PER_NODE = 1024; static const int64_t MAX_NODE_NUMBER = 64; static const int64_t MAX_CORE_NUMBER = MAX_CORE_NUMBER_PER_NODE * MAX_NODE_NUMBER; @@ -29,10 +29,10 @@ class ObCpuTopology { int64_t cores_[MAX_CORE_NUMBER_PER_NODE]; }; - public: +public: ObCpuTopology(); - public: +public: int init(); int64_t get_core_num(); int64_t get_node_num(); @@ -41,7 +41,7 @@ class ObCpuTopology { int64_t get_thread_core_id(); void bind_cpu(uint64_t core_id); - private: +private: struct ThreadLocalInfo { int64_t core_id_; int64_t node_id_; @@ -50,7 +50,7 @@ class ObCpuTopology { ThreadLocalInfo& get_tl_info(); DISALLOW_COPY_AND_ASSIGN(ObCpuTopology); - private: +private: typedef CoreInfo NodeArray[MAX_NODE_NUMBER]; typedef int64_t CoreNodeMapArray[MAX_CORE_NUMBER]; diff --git a/deps/oblib/src/lib/ec/ob_erasure_code_isa.h b/deps/oblib/src/lib/ec/ob_erasure_code_isa.h index 7cf94d88d..12cbba4bd 100644 --- a/deps/oblib/src/lib/ec/ob_erasure_code_isa.h +++ b/deps/oblib/src/lib/ec/ob_erasure_code_isa.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace common { class ObErasureCodeIsa { - public: +public: static int encode(const int64_t data_count, const int64_t parity_count, const int64_t block_size, unsigned char** data_blocks, unsigned char** parity_blocks); @@ -36,7 +36,7 @@ class ObErasureCodeIsa { static int append_encode(const int64_t data_count, const int64_t parity_count, const int64_t block_size, const int64_t block_index, unsigned char* data_block, unsigned char** parity_blocks); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObErasureCodeIsa); }; diff --git a/deps/oblib/src/lib/ec/ob_erasure_code_table_cache.h b/deps/oblib/src/lib/ec/ob_erasure_code_table_cache.h index 498a7fd1d..151153f01 100644 --- a/deps/oblib/src/lib/ec/ob_erasure_code_table_cache.h +++ b/deps/oblib/src/lib/ec/ob_erasure_code_table_cache.h @@ -74,7 +74,7 @@ struct ObErasureCodeDecodeKey { }; class ObECTableCache { - public: +public: ObECTableCache(); virtual ~ObECTableCache(); @@ -100,7 +100,7 @@ class ObECTableCache { int set_decoding_matrix( const ObString& signature, const int64_t data_count, const int64_t parity_count, unsigned char* decoding_matrix); - private: +private: bool is_inited_; hash::ObHashMap encoding_table_map_; @@ -111,7 +111,7 @@ class ObECTableCache { }; class ObECCacheManager { - public: +public: static ObECCacheManager& get_ec_cache_mgr(); int init(const int64_t bucket_size = 1024); @@ -137,7 +137,7 @@ class ObECCacheManager { const common::ObIArray& ready_indexes, const int64_t data_count, const int64_t parity_count, unsigned char* decoding_table); - private: +private: ObECCacheManager(); virtual ~ObECCacheManager(); DISALLOW_COPY_AND_ASSIGN(ObECCacheManager); @@ -160,7 +160,7 @@ class ObECCacheManager { const ObIArray& erase_indexes, const int64_t data_block_count, const int64_t parity_block_count, unsigned char* decode_matrix); - private: +private: bool is_inited_; ObECTableCache cache_; diff --git a/deps/oblib/src/lib/encode/ob_base64_encode.h b/deps/oblib/src/lib/encode/ob_base64_encode.h index 701181c20..5cc3d48a1 100644 --- a/deps/oblib/src/lib/encode/ob_base64_encode.h +++ b/deps/oblib/src/lib/encode/ob_base64_encode.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class ObBase64Encoder { - private: +private: template friend class InitBase64Values; static char BASE64_CHARS[]; @@ -31,7 +31,7 @@ class ObBase64Encoder { return std::isalnum(c) || c == '+' || c == '/'; } - public: +public: static int64_t needed_encoded_length(const int64_t buf_size) { return (buf_size / 3) * 4 + (buf_size % 3 == 0 ? 0 : 4); diff --git a/deps/oblib/src/lib/encrypt/ob_encrypt.h b/deps/oblib/src/lib/encrypt/ob_encrypt.h index 37047d424..a0d39686a 100644 --- a/deps/oblib/src/lib/encrypt/ob_encrypt.h +++ b/deps/oblib/src/lib/encrypt/ob_encrypt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class DES_crypt { - public: +public: DES_crypt(); ~DES_crypt(); @@ -46,7 +46,7 @@ class DES_crypt { const ObString& user_name, const int64_t timestamp, const int64_t skey, char* buffer, int64_t& buffer_length); int des_decrypt(ObString& user_name, int64_t& timestamp, const int64_t skey, char* buffer, int64_t buffer_length); - private: +private: const static int64_t OB_CRYPT_UNIT = 64; const static int64_t OB_BYTE_NUM = 8; const static int32_t OB_OP_MASK = 0x0080; @@ -60,7 +60,7 @@ class DES_crypt { const static int ENCODE_FLAG = 0; const static int DECODE_FLAG = 1; - private: +private: char keybyte_[OB_ENRYPT_KEY_BYTE]; char txtbyte_[OB_ENCRYPT_TXT_BYTE]; char txtptr_[OB_MAX_TOKEN_BUFFER_LENGTH]; diff --git a/deps/oblib/src/lib/encrypt/ob_encrypted_helper.h b/deps/oblib/src/lib/encrypt/ob_encrypted_helper.h index 50121cd2a..d32f8346f 100644 --- a/deps/oblib/src/lib/encrypt/ob_encrypted_helper.h +++ b/deps/oblib/src/lib/encrypt/ob_encrypted_helper.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace common { class ObEncryptedHelper { - public: +public: static int encrypt_passwd_to_stage1(const ObString& password, ObString& stage1); static int encrypt_passwd_to_stage2(const ObString& password, ObString& encrypted_pass); static int encrypt_stage1_to_stage2_hex( @@ -46,7 +46,7 @@ class ObEncryptedHelper { static int my_xor(const unsigned char* s1, const unsigned char* s2, uint32_t len, unsigned char* to); - private: +private: // see RFC 3174 typedef struct SHA1_CONTEXT { unsigned long Length; /* Message length in bits */ diff --git a/deps/oblib/src/lib/file/file_directory_utils.h b/deps/oblib/src/lib/file/file_directory_utils.h index a66d6b41a..0917689be 100644 --- a/deps/oblib/src/lib/file/file_directory_utils.h +++ b/deps/oblib/src/lib/file/file_directory_utils.h @@ -24,7 +24,7 @@ namespace common { #endif class FileDirectoryUtils { - public: +public: static const int MAX_PATH = 512; static int is_exists(const char* file_path, bool& result); static int is_accessible(const char* file_path, bool& result); diff --git a/deps/oblib/src/lib/file/fileutil.h b/deps/oblib/src/lib/file/fileutil.h index 584c905ed..1b5d004c7 100644 --- a/deps/oblib/src/lib/file/fileutil.h +++ b/deps/oblib/src/lib/file/fileutil.h @@ -27,7 +27,7 @@ namespace obsys { #endif class CFileUtil { - public: +public: /** Create a multi-level directory */ static bool mkdirs(char* szDirPath); /** Is it a directory */ diff --git a/deps/oblib/src/lib/file/ob_file.h b/deps/oblib/src/lib/file/ob_file.h index 7c6f3a43b..244919e9b 100644 --- a/deps/oblib/src/lib/file/ob_file.h +++ b/deps/oblib/src/lib/file/ob_file.h @@ -29,11 +29,11 @@ namespace oceanbase { namespace common { class IFileBuffer { - public: +public: IFileBuffer(){}; virtual ~IFileBuffer(){}; - public: +public: virtual char* get_buffer() = 0; virtual int64_t get_base_pos() = 0; virtual void set_base_pos(const int64_t pos) = 0; @@ -42,66 +42,66 @@ class IFileBuffer { }; class IFileAsyncCallback { - public: +public: IFileAsyncCallback(){}; virtual ~IFileAsyncCallback(){}; - public: +public: virtual void callback(const int io_ret, const int io_errno) = 0; }; namespace FileComponent { class IFileReader { - public: +public: IFileReader() : fd_(-1){}; virtual ~IFileReader(){}; - public: +public: virtual int open(const ObString& fname); virtual void close(); virtual bool is_opened() const; virtual void revise(int64_t pos); - public: +public: virtual int pread(void* buf, const int64_t count, const int64_t offset, int64_t& read_size) = 0; virtual int pread(const int64_t count, const int64_t offset, IFileBuffer& file_buf, int64_t& read_size) = 0; - public: +public: virtual int get_open_flags() const = 0; virtual int get_open_mode() const = 0; - public: +public: virtual int pread_by_fd(const int fd, void* buf, const int64_t count, const int64_t offset, int64_t& read_size) = 0; virtual int pread_by_fd( const int fd, const int64_t count, const int64_t offset, IFileBuffer& file_buf, int64_t& read_size) = 0; - protected: +protected: int fd_; }; class IFileAppender { - public: +public: IFileAppender() : fd_(-1){}; virtual ~IFileAppender(){}; - public: +public: virtual int open(const ObString& fname, const bool is_create, const bool is_trunc); virtual int create(const ObString& fname); virtual void close(); virtual bool is_opened() const; virtual int get_fd() const; - public: +public: virtual int append(const void* buf, const int64_t count, const bool is_fsync) = 0; virtual int async_append(const void* buf, const int64_t count, IFileAsyncCallback* callback) = 0; virtual int fsync() = 0; - public: +public: virtual int64_t get_file_pos() const = 0; virtual int get_open_flags() const = 0; virtual int get_open_mode() const = 0; - private: +private: virtual int prepare_buffer_() = 0; virtual void set_normal_flags_() = 0; virtual void add_truncate_flags_() = 0; @@ -109,7 +109,7 @@ class IFileAppender { virtual void add_excl_flags_() = 0; virtual void set_file_pos_(const int64_t file_pos) = 0; - protected: +protected: int fd_; }; @@ -117,17 +117,17 @@ class BufferFileReader : public IFileReader { static const int OPEN_FLAGS = O_RDONLY; static const int OPEN_MODE = S_IRWXU; - public: +public: BufferFileReader(); ~BufferFileReader(); - public: +public: int pread(void* buf, const int64_t count, const int64_t offset, int64_t& read_size); int pread(const int64_t count, const int64_t offset, IFileBuffer& file_buf, int64_t& read_size); int get_open_flags() const; int get_open_mode() const; - public: +public: int pread_by_fd(const int fd, void* buf, const int64_t count, const int64_t offset, int64_t& read_size); int pread_by_fd(const int fd, const int64_t count, const int64_t offset, IFileBuffer& file_buf, int64_t& read_size); }; @@ -136,25 +136,25 @@ class DirectFileReader : public IFileReader { static const int OPEN_FLAGS = O_RDWR | O_DIRECT; static const int OPEN_MODE = S_IRWXU; - public: +public: static const int64_t DEFAULT_ALIGN_SIZE = 4L * 1024L; static const int64_t DEFAULT_BUFFER_SIZE = 1L * 1024L * 1024L; - public: +public: DirectFileReader(const int64_t buffer_size = DEFAULT_BUFFER_SIZE, const int64_t align_size = DEFAULT_ALIGN_SIZE); ~DirectFileReader(); - public: +public: int pread(void* buf, const int64_t count, const int64_t offset, int64_t& read_size); int pread(const int64_t count, const int64_t offset, IFileBuffer& file_buf, int64_t& read_size); int get_open_flags() const; int get_open_mode() const; - public: +public: int pread_by_fd(const int fd, void* buf, const int64_t count, const int64_t offset, int64_t& read_size); int pread_by_fd(const int fd, const int64_t count, const int64_t offset, IFileBuffer& file_buf, int64_t& read_size); - private: +private: const int64_t align_size_; const int64_t buffer_size_; char* buffer_; @@ -167,14 +167,14 @@ class BufferFileAppender : public IFileAppender { static const int EXCL_FLAGS = O_EXCL; static const int OPEN_MODE = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; - public: +public: static const int64_t DEFAULT_BUFFER_SIZE = 2L * 1024L * 1024L; - public: +public: explicit BufferFileAppender(const int64_t buffer_size = DEFAULT_BUFFER_SIZE); ~BufferFileAppender(); - public: +public: void close(); int append(const void* buf, const int64_t count, const bool is_fsync); int async_append(const void* buf, const int64_t count, IFileAsyncCallback* callback); @@ -186,10 +186,10 @@ class BufferFileAppender : public IFileAppender { return file_pos_; } - private: +private: int buffer_sync_(); - private: +private: int prepare_buffer_(); void set_normal_flags_(); void add_truncate_flags_(); @@ -197,7 +197,7 @@ class BufferFileAppender : public IFileAppender { void add_excl_flags_(); void set_file_pos_(const int64_t file_pos); - private: +private: int open_flags_; const int64_t buffer_size_; int64_t buffer_pos_; @@ -213,15 +213,15 @@ class DirectFileAppender : public IFileAppender { static const int EXCL_FLAGS = O_EXCL; static const int OPEN_MODE = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; - public: +public: static const int64_t DEFAULT_ALIGN_SIZE = 4L * 1024L; static const int64_t DEFAULT_BUFFER_SIZE = 2L * 1024L * 1024L; - public: +public: DirectFileAppender(const int64_t buffer_size = DEFAULT_BUFFER_SIZE, const int64_t align_size = DEFAULT_ALIGN_SIZE); ~DirectFileAppender(); - public: +public: void close(); int append(const void* buf, const int64_t count, const bool is_fsync); int async_append(const void* buf, const int64_t count, IFileAsyncCallback* callback); @@ -234,10 +234,10 @@ class DirectFileAppender : public IFileAppender { } int set_align_size(const int64_t align_size); - private: +private: int buffer_sync_(bool* need_truncate = NULL); - private: +private: int prepare_buffer_(); void set_normal_flags_(); void add_truncate_flags_(); @@ -245,7 +245,7 @@ class DirectFileAppender : public IFileAppender { void add_excl_flags_(); void set_file_pos_(const int64_t file_pos); - private: +private: int open_flags_; int64_t align_size_; const int64_t buffer_size_; @@ -292,21 +292,21 @@ extern int64_t get_file_size(const char* fname); class ObFileBuffer : public IFileBuffer { static const int64_t MIN_BUFFER_SIZE = 1L * 1024L * 1024L; - public: +public: ObFileBuffer(); ~ObFileBuffer(); - public: +public: char* get_buffer(); int64_t get_base_pos(); void set_base_pos(const int64_t pos); int assign(const int64_t size, const int64_t align); int assign(const int64_t size); - public: +public: void release(); - protected: +protected: char* buffer_; int64_t base_pos_; int64_t buffer_size_; @@ -314,40 +314,40 @@ class ObFileBuffer : public IFileBuffer { // File reader thread is not safe and only allows one thread to call at the same time class ObFileReader { - public: +public: ObFileReader(); ~ObFileReader(); - public: +public: int open(const ObString& fname, const bool dio, const int64_t align_size = FileComponent::DirectFileReader::DEFAULT_ALIGN_SIZE); void close(); bool is_opened() const; void revise(int64_t pos); - public: +public: int pread(void* buf, const int64_t count, const int64_t offset, int64_t& read_size); int pread(const int64_t count, const int64_t offset, IFileBuffer& file_buf, int64_t& read_size); - public: +public: static int read_record(common::IFileInfoMgr& fileinfo_mgr, const uint64_t file_id, const int64_t offset, const int64_t size, IFileBuffer& file_buf); static int read_record( const common::IFileInfo& file_info, const int64_t offset, const int64_t size, IFileBuffer& file_buf); static int read_record(const int fd, const int64_t offset, const int64_t size, IFileBuffer& file_buf); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFileReader); - private: +private: FileComponent::IFileReader* file_; }; class ObIFileAppender { - public: +public: virtual ~ObIFileAppender(){}; - public: +public: virtual int open(const ObString& fname, const bool dio, const bool is_create, const bool is_trunc = false, const int64_t align_size = FileComponent::DirectFileAppender::DEFAULT_ALIGN_SIZE) = 0; virtual int create(const ObString& fname, const bool dio, @@ -361,11 +361,11 @@ class ObIFileAppender { // File appender thread is not safe and only allows one thread to call at the same time // Turn off the implementation of ordinary io, temporarily only support dio class ObFileAppender : public ObIFileAppender { - public: +public: ObFileAppender(); ~ObFileAppender(); - public: +public: // Subclasses can overload open close get_file_pos int open(const ObString& fname, const bool dio, const bool is_create, const bool is_trunc = false, const int64_t align_size = FileComponent::DirectFileAppender::DEFAULT_ALIGN_SIZE); @@ -379,26 +379,26 @@ class ObFileAppender : public ObIFileAppender { return file_->get_fd(); } - public: +public: int create(const ObString& fname, const bool dio, const int64_t align_size = FileComponent::DirectFileAppender::DEFAULT_ALIGN_SIZE); bool is_opened() const; - public: +public: // Subclasses can overload append fsync // If is_fsync is not set, the internal buffer is used to cache data by default, and the disk is flushed until the // buffer is full. int append(const void* buf, const int64_t count, const bool is_fsync); int fsync(); - public: +public: // Temporarily not realized int async_append(const void* buf, const int64_t count, IFileAsyncCallback* callback); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFileAppender); - private: +private: FileComponent::IFileAppender* file_; FileComponent::DirectFileAppender direct_file_; FileComponent::BufferFileAppender buffer_file_; @@ -409,7 +409,7 @@ class ObFileAppender : public ObIFileAppender { #define __USE_AIO_FILE #ifdef __USE_AIO_FILE class ObIWaiter { - public: +public: virtual ~ObIWaiter(){}; virtual void wait() = 0; }; @@ -421,11 +421,11 @@ class ObWaitablePool { Node* next; }; - public: +public: ObWaitablePool(); ~ObWaitablePool(); - public: +public: int alloc_obj(T*& obj, ObIWaiter& waiter); void free_obj(T* obj); int64_t used() const @@ -433,7 +433,7 @@ class ObWaitablePool { return used_; }; - private: +private: Node* objs_; Node* list_; int64_t used_; @@ -549,11 +549,11 @@ class ObFileAsyncAppender : public ObIFileAppender, ObIWaiter { static const int64_t AIO_WAIT_TIME_US = 1000000; typedef ObWaitablePool Pool; - public: +public: ObFileAsyncAppender(); ~ObFileAsyncAppender(); - public: +public: int open(const ObString& fname, const bool dio, const bool is_create, const bool is_trunc = false, const int64_t align_size = FileComponent::DirectFileAppender::DEFAULT_ALIGN_SIZE); int create(const ObString& fname, const bool dio, @@ -563,14 +563,14 @@ class ObFileAsyncAppender : public ObIFileAppender, ObIWaiter { int append(const void* buf, const int64_t count, const bool is_fsync); int fsync(); - public: +public: void wait(); - private: +private: int submit_iocb_(AIOCB* iocb); AIOCB* get_iocb_(); - private: +private: Pool pool_; int fd_; int64_t file_pos_; diff --git a/deps/oblib/src/lib/file/ob_fileinfo_manager.h b/deps/oblib/src/lib/file/ob_fileinfo_manager.h index c3e9aa85f..576fe377b 100644 --- a/deps/oblib/src/lib/file/ob_fileinfo_manager.h +++ b/deps/oblib/src/lib/file/ob_fileinfo_manager.h @@ -27,18 +27,18 @@ namespace oceanbase { namespace common { class IFileInfo { - public: +public: virtual ~IFileInfo(){}; - public: +public: virtual int get_fd() const = 0; }; class IFileInfoMgr { - public: +public: virtual ~IFileInfoMgr(){}; - public: +public: virtual const IFileInfo* get_fileinfo(const uint64_t key_id) = 0; virtual int revert_fileinfo(const IFileInfo* file_info) = 0; virtual int erase_fileinfo(const uint64_t key_id) diff --git a/deps/oblib/src/lib/hash/ob_array_hash_map.h b/deps/oblib/src/lib/hash/ob_array_hash_map.h index 58ecc774f..e79a181c7 100644 --- a/deps/oblib/src/lib/hash/ob_array_hash_map.h +++ b/deps/oblib/src/lib/hash/ob_array_hash_map.h @@ -20,11 +20,11 @@ namespace oceanbase { namespace common { template class ObArrayHashMap { - public: +public: typedef ObSpinLock Lock; typedef ObSpinLockGuard LockGuard; class Item { - public: + public: Item() : is_valid_(false), key_(), val_() {} Item(key_t& key, val_t& val) : is_valid_(true), key_(key), val_(val) @@ -54,7 +54,7 @@ class ObArrayHashMap { return val_; } - private: + private: bool is_valid_; key_t key_; val_t val_; @@ -246,7 +246,7 @@ class ObArrayHashMap { return ret; } - private: +private: bool is_inited() const { return capacity_ > 0 && NULL != items_; @@ -257,7 +257,7 @@ class ObArrayHashMap { return NULL != buf && buf_len > 0 && pos >= 0 && pos <= buf_len; } - private: +private: Lock lock_; int64_t size_; int64_t capacity_; diff --git a/deps/oblib/src/lib/hash/ob_array_index_hash_set.h b/deps/oblib/src/lib/hash/ob_array_index_hash_set.h index d182976e7..d5f256f13 100644 --- a/deps/oblib/src/lib/hash/ob_array_index_hash_set.h +++ b/deps/oblib/src/lib/hash/ob_array_index_hash_set.h @@ -26,11 +26,11 @@ namespace hash { template class ObArrayIndexHashSet { - public: +public: typedef uint32_t IndexType; static const IndexType INVALID_INDEX = UINT32_MAX; - public: +public: ObArrayIndexHashSet() : array_(NULL), collision_count_(0), index_base_(INVALID_INDEX) {} explicit ObArrayIndexHashSet(const ItemArray& array) : array_(&array), index_base_(INVALID_INDEX) @@ -128,7 +128,7 @@ class ObArrayIndexHashSet { return (index >= index_base_ && index < index_base_ + N); } - private: +private: STATIC_ASSERT(N < UINT32_MAX, "unsupport N more than UINT32_MAX"); const ItemArray* array_; diff --git a/deps/oblib/src/lib/hash/ob_build_in_hashmap.h b/deps/oblib/src/lib/hash/ob_build_in_hashmap.h index 6d7c8f768..90941d619 100644 --- a/deps/oblib/src/lib/hash/ob_build_in_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_build_in_hashmap.h @@ -22,7 +22,7 @@ namespace common { namespace hash { template class ObBuildInHashMap { - public: +public: // Make embedded types easier to use by importing them to the class namespace. typedef H Hasher; // Rename and promote. typedef typename Hasher::Key Key; // Key type. @@ -94,14 +94,14 @@ class ObBuildInHashMap { return !(*this == that); } - protected: + protected: // Internal iterator constructor. iterator(ObBuildInBucket* b, Value* v) : value_(v), bucket_(b) {} friend class ObBuildInHashMap; }; - public: +public: ObBuildInHashMap() : count_(0) {} @@ -211,7 +211,7 @@ class ObBuildInHashMap { return ret; } - private: +private: ObBuildInBucket buckets_[bucket_num]; int64_t count_; // of elements stored in the map. BucketChain bucket_chain_; diff --git a/deps/oblib/src/lib/hash/ob_concurrent_hash_map.h b/deps/oblib/src/lib/hash/ob_concurrent_hash_map.h index 7d524101e..8e10439e8 100644 --- a/deps/oblib/src/lib/hash/ob_concurrent_hash_map.h +++ b/deps/oblib/src/lib/hash/ob_concurrent_hash_map.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class HashAlloc : public IAlloc { - public: +public: HashAlloc() : is_inited_(false), label_(ObModIds::OB_CONCURRENT_HASH_MAP), tenant_id_(OB_SERVER_TENANT_ID), size_(0) {} virtual ~HashAlloc() @@ -30,10 +30,10 @@ class HashAlloc : public IAlloc { void* alloc(const int64_t sz); void free(void* p); - private: +private: DISALLOW_COPY_AND_ASSIGN(HashAlloc); - private: +private: bool is_inited_; lib::ObLabel label_; uint64_t tenant_id_; @@ -42,7 +42,7 @@ class HashAlloc : public IAlloc { }; class ArrayAlloc : public IAlloc { - public: +public: ArrayAlloc() : label_(ObModIds::OB_CONCURRENT_HASH_MAP), tenant_id_(OB_SERVER_TENANT_ID) {} virtual ~ArrayAlloc() @@ -51,17 +51,17 @@ class ArrayAlloc : public IAlloc { void* alloc(const int64_t sz); void free(void* p); - private: +private: DISALLOW_COPY_AND_ASSIGN(ArrayAlloc); - private: +private: lib::ObLabel label_; uint64_t tenant_id_; }; template class ObConcurrentHashMap { - private: +private: typedef HashRoot SHashRoot; typedef HashBase SHash; typedef typename SHash::Iterator SScanIterator; @@ -69,7 +69,7 @@ class ObConcurrentHashMap { typedef typename SHash::Handle SGetHandle; typedef typename SHash::Handle SPutHandle; - public: +public: ObConcurrentHashMap(); ObConcurrentHashMap(IHashAlloc& hash_alloc, IArrayAlloc& array_alloc); int init( @@ -90,13 +90,13 @@ class ObConcurrentHashMap { template int remove_if(Function& fn); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObConcurrentHashMap); int err_code_map(int err) const; - private: +private: class ReclaimCallback : public SHash::IKVRCallback { - public: + public: virtual void reclaim_key_value(Key& key, Value& value) { UNUSED(key); @@ -105,12 +105,12 @@ class ObConcurrentHashMap { }; template class RemoveIf { - public: + public: RemoveIf(ObConcurrentHashMap& hash, Function& fn) : hash_(hash), predicate_(fn) {} bool operator()(Key& key, Value& value); - private: + private: ObConcurrentHashMap& hash_; Function& predicate_; }; @@ -121,7 +121,7 @@ class ObConcurrentHashMap { return true; } - private: +private: HashAlloc hash_alloc_; ArrayAlloc array_alloc_; ReclaimCallback relaim_callback_; diff --git a/deps/oblib/src/lib/hash/ob_concurrent_hash_map_with_hazard_value.h b/deps/oblib/src/lib/hash/ob_concurrent_hash_map_with_hazard_value.h index a82de335b..5517b9d27 100644 --- a/deps/oblib/src/lib/hash/ob_concurrent_hash_map_with_hazard_value.h +++ b/deps/oblib/src/lib/hash/ob_concurrent_hash_map_with_hazard_value.h @@ -49,18 +49,18 @@ class ObConcurrentHashMapWithHazardValue {}; template class ObConcurrentHashMapWithHazardValue { - public: +public: class IValueAlloc { - public: + public: virtual Value* alloc() = 0; virtual void free(Value* value) = 0; }; class IValueReclaimCallback { - public: + public: virtual void reclaim_value(Value* value) = 0; }; - public: +public: ObConcurrentHashMapWithHazardValue(); ObConcurrentHashMapWithHazardValue(IHashAlloc& hash_alloc, IArrayAlloc& array_alloc); int init(); @@ -89,10 +89,10 @@ class ObConcurrentHashMapWithHazardValue { // return OB_SUCCESS for success, other for errors. int get_count(int64_t& cnt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObConcurrentHashMapWithHazardValue); - private: +private: typedef HashRoot SHashRoot; typedef HashBase SHash; typedef typename SHash::Iterator SScanIterator; @@ -100,10 +100,10 @@ class ObConcurrentHashMapWithHazardValue { typedef typename SHash::Handle SGetHandle; typedef typename SHash::Handle SPutHandle; - protected: +protected: /// this class is for ObConcurrentHashMapWithHazardValue class DefaultValueAlloc : public IValueAlloc { - public: + public: Value* alloc() { return op_alloc(Value); @@ -116,52 +116,52 @@ class ObConcurrentHashMapWithHazardValue { }; /// this class is for ObConcurrentHashMapWithHazardValue class DefaultValueReclaimCallback : public IValueReclaimCallback { - public: + public: DefaultValueReclaimCallback() : alloc_(NULL) {} int init(IValueAlloc* alloc); virtual void reclaim_value(Value* value); - private: + private: DISALLOW_COPY_AND_ASSIGN(DefaultValueReclaimCallback); - private: + private: IValueAlloc* alloc_; }; /// this class is for ObHazardPointer class HazardPtrReclaimCallback : public ObHazardPointer::ReclaimCallback { - public: + public: HazardPtrReclaimCallback() : value_reclaim_callback_(NULL) {} int init(IValueReclaimCallback* value_reclaim_callback); virtual void reclaim_ptr(uintptr_t ptr); - private: + private: DISALLOW_COPY_AND_ASSIGN(HazardPtrReclaimCallback); - private: + private: IValueReclaimCallback* value_reclaim_callback_; }; /// this class is for HashBase class HashReclaimCallback : public SHash::IKVRCallback { - public: + public: HashReclaimCallback() : hazard_ptr_(NULL) {} int init(ObHazardPointer* hazard_ptr); virtual void reclaim_key_value(Key& key, Value*& value); - private: + private: DISALLOW_COPY_AND_ASSIGN(HashReclaimCallback); - private: + private: ObHazardPointer* hazard_ptr_; }; - private: +private: int err_code_map(int err) const; int check_init() const; - private: +private: ObHazardPointer hazard_pointer_; HazardPtrReclaimCallback hazard_ptr_reclaim_callback_; IValueAlloc* value_alloc_; diff --git a/deps/oblib/src/lib/hash/ob_cuckoo_hashmap.h b/deps/oblib/src/lib/hash/ob_cuckoo_hashmap.h index 7f9d6ae15..200c6c4ca 100644 --- a/deps/oblib/src/lib/hash/ob_cuckoo_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_cuckoo_hashmap.h @@ -25,14 +25,14 @@ class ObCuckooHashMap; template class ObCuckooHashMapIterator { - private: +private: typedef ObCuckooHashMap<_key_type, _value_type, _hashfunc, _equal> HashMap; typedef ObCuckooHashMapIterator<_key_type, _value_type, _hashfunc, _equal> HashMapIterator; typedef HashMapPair<_key_type, _value_type> pair_type; typedef pair_type& reference; typedef pair_type* pointer; - public: +public: ObCuckooHashMapIterator( const HashMap& map, const int64_t bucket_pos, const int64_t slot_pos, const int64_t slot_count) : map_(&map), bucket_pos_(bucket_pos), slot_pos_(slot_pos), slot_count_(slot_count) @@ -95,7 +95,7 @@ class ObCuckooHashMapIterator { return iter; } - private: +private: const HashMap* map_; int64_t bucket_pos_; int64_t slot_pos_; @@ -108,7 +108,7 @@ class ObCuckooHashMapIterator; template , typename _equal = equal_to<_key_type>> class ObCuckooHashMap { - public: +public: typedef ObCuckooHashMapIterator<_key_type, _value_type, _hashfunc, _equal> iterator; ObCuckooHashMap(); ~ObCuckooHashMap(); @@ -126,7 +126,7 @@ class ObCuckooHashMap { return is_inited_; } - private: +private: friend class ObCuckooHashMapIterator<_key_type, _value_type, _hashfunc, _equal>; static const int64_t MAX_CUCKOO_INSERT_DEPTH = 40; static const int64_t BUCKET_SLOT_COUNT = 4; @@ -159,7 +159,7 @@ class ObCuckooHashMap { int64_t slot_pos_; }; - private: +private: uint64_t hash1(const _key_type& key) const; uint64_t hash2(const uint64_t hash_val) const; int get_impl(const uint64_t hash_val, const bool is_first_hash, const _key_type& key, SlotPos& pos) const; @@ -179,7 +179,7 @@ class ObCuckooHashMap { int rehash(); int64_t advised_bucket_num(const int64_t elem_count); - private: +private: bool is_inited_; Bucket* buckets_; int64_t bucket_num_; diff --git a/deps/oblib/src/lib/hash/ob_darray.h b/deps/oblib/src/lib/hash/ob_darray.h index 5e877a961..e6dd2e82e 100644 --- a/deps/oblib/src/lib/hash/ob_darray.h +++ b/deps/oblib/src/lib/hash/ob_darray.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class IAlloc { - public: +public: IAlloc() {} virtual ~IAlloc() @@ -73,7 +73,7 @@ struct EstimateCounter { // thread cached ref_cnt class TcRef { - public: +public: typedef ObSpinLock Lock; typedef ObSpinLockGuard LockGuard; struct Item { @@ -128,18 +128,18 @@ class TcRef { return ret; } - private: +private: static int64_t min(int64_t x, int64_t y) { return x < y ? x : y; } - private: +private: Item ref_[MAX_THREAD_NUM]; }; class ReadRef { - public: +public: ReadRef() {} ~ReadRef() @@ -183,7 +183,7 @@ class ReadRef { } } - private: +private: static int64_t min(int64_t x, int64_t y) { return x < y ? x : y; @@ -202,7 +202,7 @@ class ReadRef { } } - private: +private: struct RefMarker { RefMarker() : value_(NULL) {} @@ -214,14 +214,14 @@ class ReadRef { }; struct NestLessRWLockHandler { - private: +private: enum { UNLOCKED = 0, WR_LOCKING = 1, WR_LOCKED = 2, }; - public: +public: static bool try_rdlock(ReadRef& ref, uint32_t* write_uid) { bool lock_succ = false; @@ -296,7 +296,7 @@ struct NestLessRWLockHandler { }; class ArrayHeadHandler { - public: +public: typedef NestLessRWLockHandler LockHandler; bool try_rdlock(uint32_t* lock) { @@ -334,13 +334,13 @@ class ArrayHeadHandler { return tc_ref_.get_ref(addr); } - private: +private: ReadRef read_ref_; TcRef tc_ref_; }; class ArrayHead : public HazardNode { - public: +public: typedef void* val_t; ArrayHead(uint64_t limit, int level, ArrayHeadHandler& head_handler) : HazardNode(), @@ -463,7 +463,7 @@ class ArrayHead : public HazardNode { return err; } - private: +private: uint32_t capacity_; int32_t level_; uint32_t lock_; @@ -473,11 +473,11 @@ class ArrayHead : public HazardNode { }; class ArrayBase { - public: +public: typedef void* val_t; typedef ArrayHead Node; class Path { - public: + public: enum { MAX_LEVEL = 32 }; // record position of this level @@ -559,7 +559,7 @@ class ArrayBase { return err; } - private: + private: Node* root_node_; int root_level_; int pop_idx_; @@ -568,7 +568,7 @@ class ArrayBase { }; class BaseHandle { - public: + public: explicit BaseHandle(ArrayBase& host) : node_size_(host.get_node_size()), alloc_(host.get_alloc()), @@ -616,7 +616,7 @@ class ArrayBase { retire_list_handle_.add_del(node); } - private: + private: void free_node(Node* p) { if (NULL != p) { @@ -626,7 +626,7 @@ class ArrayBase { } } - private: + private: int64_t node_size_; IArrayAlloc& alloc_; ArrayHeadHandler& array_head_handler_; @@ -635,7 +635,7 @@ class ArrayBase { }; class Handle : public BaseHandle { - public: + public: explicit Handle(ArrayBase& host) : BaseHandle(host), handler_(host.get_array_handler()) {} ~Handle() @@ -753,12 +753,12 @@ class ArrayBase { } } - private: + private: Path path_; ArrayHeadHandler& handler_; }; - public: +public: ArrayBase(IArrayAlloc& alloc, int64_t node_size) : alloc_(alloc), node_size_(node_size), hazard_ref_(false) {} ~ArrayBase() @@ -834,7 +834,7 @@ class ArrayBase { return err; } - private: +private: IArrayAlloc& alloc_; int64_t node_size_; HazardRef hazard_ref_; diff --git a/deps/oblib/src/lib/hash/ob_dchash.h b/deps/oblib/src/lib/hash/ob_dchash.h index cb95c8ba5..ed8a33887 100644 --- a/deps/oblib/src/lib/hash/ob_dchash.h +++ b/deps/oblib/src/lib/hash/ob_dchash.h @@ -66,7 +66,7 @@ struct HashNode : public ObLink { }; class DCArray { - public: +public: DCArray(DCArray* parent, uint64_t capacity) : parent_(parent), capacity_(capacity), shift_(calc_shift(capacity_)), fill_idx_(0) { @@ -135,7 +135,7 @@ class DCArray { return retired_array; } - private: +private: static uint64_t calc_shift(uint64_t capacity) { return __builtin_clzll(capacity) + 1; @@ -191,7 +191,7 @@ class DCArray { return err; } - private: +private: DCArray* parent_; uint64_t capacity_; uint64_t shift_; @@ -234,7 +234,7 @@ struct KeyHashNode : public HashNode { template class DCHash { - public: +public: typedef ObSpinLock Lock; typedef ObSpinLockGuard LockGuard; typedef ObQSync QSync; @@ -244,7 +244,7 @@ class DCHash { typedef KeyHashNode Node; enum { BATCH_SIZE = 64 }; class Handle { - public: + public: Handle(DCHash& host, int& err, int node_change_count) : host_(host), qsync_(host.get_qsync()), @@ -269,7 +269,7 @@ class DCHash { return err; } - private: + private: void retire(int err, int64_t x) { if (0 == err) { @@ -293,7 +293,7 @@ class DCHash { qsync_.release_ref(ref_); } - private: + private: DCHash& host_; QSync& qsync_; int64_t ref_; @@ -303,7 +303,7 @@ class DCHash { }; friend class Handle; - public: +public: DCHash(IArrayAlloc& alloc, int64_t min_size) : alloc_(alloc), root_(0), tail_(UINT64_MAX), cur_array_(NULL), min_size_(min_size), target_size_(min_size) { @@ -371,7 +371,7 @@ class DCHash { return node; } - private: +private: static uint64_t next2n(const uint64_t x) { return x <= 2 ? x : (1UL << 63) >> (__builtin_clzll(x - 1) - 1); @@ -494,7 +494,7 @@ class DCHash { return qsync; } - private: +private: Lock lock_; IArrayAlloc& alloc_; HashNode root_ CACHE_ALIGNED; diff --git a/deps/oblib/src/lib/hash/ob_ext_iter_hashset.h b/deps/oblib/src/lib/hash/ob_ext_iter_hashset.h index 6940a4f17..32aaff1c0 100644 --- a/deps/oblib/src/lib/hash/ob_ext_iter_hashset.h +++ b/deps/oblib/src/lib/hash/ob_ext_iter_hashset.h @@ -25,13 +25,13 @@ class ObExtIterHashSet; ///////////////////////////////////// ObExtIterHashSet Iterator ///////////////////////////////////// template class ObExtIterHashSetConstIterator { - public: +public: typedef typename HashSet::const_key_ref_t const_key_ref_t; typedef ObExtIterHashSetConstIterator SelfType; typedef typename HashSet::HashSetBucket BucketType; typedef typename HashSet::InnerHashSetIter InnerIter; - public: +public: ObExtIterHashSetConstIterator(const HashSet* set, const BucketType* bucket, const InnerIter& iter) : hash_set_(set), bucket_(bucket), iter_(iter) {} @@ -43,7 +43,7 @@ class ObExtIterHashSetConstIterator { ~ObExtIterHashSetConstIterator() {} - public: +public: ObExtIterHashSetConstIterator& operator=(const SelfType& other) { if (this != &other) { @@ -94,7 +94,7 @@ class ObExtIterHashSetConstIterator { return *iter_; } - private: +private: const HashSet* hash_set_; const BucketType* bucket_; InnerIter iter_; @@ -104,7 +104,7 @@ class ObExtIterHashSetConstIterator { template class ObExtIterHashSet { - public: +public: typedef const K& const_key_ref_t; typedef ObIteratableHashSet BaseHashSet; typedef ObExtIterHashSet SelfType; @@ -126,11 +126,11 @@ class ObExtIterHashSet { } }; - public: +public: explicit ObExtIterHashSet(Allocator& allocator); virtual ~ObExtIterHashSet(); - public: +public: /** * @retval OB_SUCCESS insert successfully * @retval OB_HASH_EXIST key exists @@ -167,10 +167,10 @@ class ObExtIterHashSet { return count_; } - public: +public: DECLARE_TO_STRING; - private: +private: bool is_exist_(const K& key) const; bool is_full_() const { @@ -178,18 +178,18 @@ class ObExtIterHashSet { } int add_bucket_(); - private: +private: int64_t count_; // count of object int64_t bucket_num_; // count of bucket Allocator& allocator_; // allocator HashSetBucket buckets_; // bucket lists HashSetBucket* buckets_tail_; // bucket lists tail - private: +private: template friend class ObExtIterHashSetConstIterator; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExtIterHashSet); }; diff --git a/deps/oblib/src/lib/hash/ob_fixed_hash.h b/deps/oblib/src/lib/hash/ob_fixed_hash.h index a4513d445..8a4b320eb 100644 --- a/deps/oblib/src/lib/hash/ob_fixed_hash.h +++ b/deps/oblib/src/lib/hash/ob_fixed_hash.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { template class FixedHash { - public: +public: typedef ObLink Link; struct node_t : public Link { node_t() : hash_(0), key_() @@ -110,7 +110,7 @@ class FixedHash { return node; } - private: +private: node_t* next_node(node_t* node) { node_t* next = NULL; @@ -165,7 +165,7 @@ class FixedHash { return err; } - private: +private: node_t* nodes_; int64_t limit_; }; diff --git a/deps/oblib/src/lib/hash/ob_fixed_hash2.h b/deps/oblib/src/lib/hash/ob_fixed_hash2.h index 83fe3ee00..07d7fa44d 100644 --- a/deps/oblib/src/lib/hash/ob_fixed_hash2.h +++ b/deps/oblib/src/lib/hash/ob_fixed_hash2.h @@ -38,7 +38,7 @@ struct SpHashNode : public ObLink { template class FixedHash2 { - public: +public: typedef SpHashNode BaseNode; FixedHash2(void* buf, int64_t size) : nodes_((Node*)buf), limit_(last2n(size / sizeof(BaseNode))), shift_(__builtin_clzll(limit_) + 1) @@ -98,7 +98,7 @@ class FixedHash2 { return node; } - private: +private: Node* quick_next_node(Node* node) { Node* next = NULL; @@ -136,7 +136,7 @@ class FixedHash2 { } } - private: +private: BaseNode* nodes_; int64_t limit_; int64_t shift_; diff --git a/deps/oblib/src/lib/hash/ob_hash.h b/deps/oblib/src/lib/hash/ob_hash.h index ea321f605..d44682517 100644 --- a/deps/oblib/src/lib/hash/ob_hash.h +++ b/deps/oblib/src/lib/hash/ob_hash.h @@ -142,9 +142,9 @@ struct HashRoot { template class HashBase { - public: +public: class IKVRCallback { - public: + public: IKVRCallback() {} virtual ~IKVRCallback() @@ -271,7 +271,7 @@ class HashBase { }; // end struct Node class Iterator { - public: + public: Iterator() : head_(NULL) {} ~Iterator() @@ -298,11 +298,11 @@ class HashBase { return err; } - private: + private: Node* head_; }; class BaseHandle { - public: + public: explicit BaseHandle(HashBase& host) : alloc_(host.get_alloc()), kvr_callback_(host.get_kvr_callback()), @@ -355,7 +355,7 @@ class HashBase { retire_list_handle_.add_del(node); } - private: + private: int acquire_ref() { return (NULL == hazard_handle_.acquire_ref()) ? -EOVERFLOW : 0; @@ -365,7 +365,7 @@ class HashBase { hazard_handle_.release_ref(); } - private: + private: IHashAlloc& alloc_; IKVRCallback& kvr_callback_; HazardHandle hazard_handle_; @@ -373,7 +373,7 @@ class HashBase { }; class Handle : public BaseHandle { - public: + public: Handle(HashBase& host, HashRoot& root) : BaseHandle(host), array_(host.get_array_base()), root_(root) {} ~Handle() @@ -460,7 +460,7 @@ class HashBase { return ret; } - private: + private: int get_pre(key_t key, Node*& pre, bool need_add_bucket = true) { int err = 0; @@ -708,12 +708,12 @@ class HashBase { return err; } - private: + private: ArrayBase& array_; HashRoot& root_; }; - public: +public: HashBase(IHashAlloc& hash_alloc, IArrayAlloc& array_alloc, IKVRCallback& kvr_callback, int64_t array_node_size) : alloc_(hash_alloc), kvr_callback_(kvr_callback), array_base_(array_alloc, array_node_size) {} @@ -794,7 +794,7 @@ class HashBase { return err; } - private: +private: void clean_retire_list() { LIB_LOG(INFO, "clean retire list"); @@ -810,7 +810,7 @@ class HashBase { } } - private: +private: IHashAlloc& alloc_; IKVRCallback& kvr_callback_; HazardRef hazard_ref_; diff --git a/deps/oblib/src/lib/hash/ob_hashmap.h b/deps/oblib/src/lib/hash/ob_hashmap.h index 9efc14586..809480126 100644 --- a/deps/oblib/src/lib/hash/ob_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_hashmap.h @@ -51,7 +51,7 @@ class ObHashMap { hashmap; typedef hashmap_preproc<_key_type, _value_type> preproc; - public: +public: typedef ObHashTable<_key_type, pair_type, _hashfunc, _equal, pair_first, _allocer, _defendmode, _bucket_array, _bucket_allocer> hashtable; @@ -59,7 +59,7 @@ class ObHashMap { typedef typename hashtable::iterator iterator; typedef typename hashtable::const_iterator const_iterator; - public: +public: ObHashMap() : ht_() { // default @@ -68,7 +68,7 @@ class ObHashMap { }; ~ObHashMap(){}; - public: +public: bucket_iterator bucket_begin() { return ht_.bucket_begin(); @@ -235,7 +235,7 @@ class ObHashMap { return ht_.deserialization(archive, &allocer_); }; - private: +private: preproc preproc_; _allocer allocer_; _bucket_allocer bucket_allocer_; diff --git a/deps/oblib/src/lib/hash/ob_hashset.h b/deps/oblib/src/lib/hash/ob_hashset.h index 493c37b40..a8187380e 100644 --- a/deps/oblib/src/lib/hash/ob_hashset.h +++ b/deps/oblib/src/lib/hash/ob_hashset.h @@ -42,11 +42,11 @@ class ObHashSet { _bucket_array, _bucket_allocer, EXTEND_RATIO> hashtable; - public: +public: typedef typename hashtable::iterator iterator; typedef typename hashtable::const_iterator const_iterator; - public: +public: ObHashSet() : bucket_allocer_(ObModIds::OB_HASH_BUCKET), ht_() { static_assert(((EXTEND_RATIO <= 1) || (EXTEND_RATIO > 1 && std::is_same<_defendmode, NoPthreadDefendMode>::value)), @@ -54,7 +54,7 @@ class ObHashSet { }; ~ObHashSet(){}; - public: +public: iterator begin() { return ht_.begin(); @@ -183,7 +183,7 @@ class ObHashSet { return ht_.deserialization(archive, &allocer_); }; - private: +private: _allocer allocer_; _bucket_allocer bucket_allocer_; hashtable ht_; diff --git a/deps/oblib/src/lib/hash/ob_hashtable.h b/deps/oblib/src/lib/hash/ob_hashtable.h index de5e96ab9..7244abbcc 100644 --- a/deps/oblib/src/lib/hash/ob_hashtable.h +++ b/deps/oblib/src/lib/hash/ob_hashtable.h @@ -57,7 +57,7 @@ struct ObHashTableNode { template class ObHashTableBucketNodeIterator { - private: +private: typedef ObHashTableNode<_value_type> hashnode; typedef ObHashTableBucketNodeIterator<_value_type, _lock_type, _cond_type> iterator; typedef ObHashTableBucketNodeConstIterator<_value_type, _lock_type, _cond_type> const_iterator; @@ -65,7 +65,7 @@ class ObHashTableBucketNodeIterator { typedef _value_type* pointer; friend class ObHashTableBucketNodeConstIterator<_value_type, _lock_type, _cond_type>; - public: +public: ObHashTableBucketNodeIterator() : node_(0) {} @@ -116,13 +116,13 @@ class ObHashTableBucketNodeIterator { return iter; } - private: +private: hashnode* node_; }; template class ObHashTableBucketNodeConstIterator { - private: +private: typedef ObHashTableNode<_value_type> hashnode; typedef ObHashTableBucketNodeIterator<_value_type, _lock_type, _cond_type> iterator; typedef ObHashTableBucketNodeConstIterator<_value_type, _lock_type, _cond_type> const_iterator; @@ -130,7 +130,7 @@ class ObHashTableBucketNodeConstIterator { typedef const _value_type* const_pointer; friend class ObHashTableBucketNodeIterator<_value_type, _lock_type, _cond_type>; - public: +public: ObHashTableBucketNodeConstIterator() : node_(0) {} @@ -184,7 +184,7 @@ class ObHashTableBucketNodeConstIterator { return iter; } - private: +private: hashnode* node_; }; @@ -233,7 +233,7 @@ struct ObBucketLockCond { return bucket_.cond; } - private: +private: bucket_type& bucket_; }; @@ -253,7 +253,7 @@ struct ObBucketLockCond<_value_type, NoPthreadDefendMode> { return cond_; } - private: +private: NoPthreadDefendMode::lock_type lock_; NoPthreadDefendMode::cond_type cond_; }; @@ -261,7 +261,7 @@ struct ObBucketLockCond<_value_type, NoPthreadDefendMode> { template class _bucket_array, class _bucket_allocer, int64_t EXTEND_RATIO> class ObHashTableBucketIterator { - private: +private: typedef ObHashTable<_key_type, _value_type, _hashfunc, _equal, _getkey, _allocer, _defendmode, _bucket_array, _bucket_allocer, EXTEND_RATIO> hashtable; @@ -271,7 +271,7 @@ class ObHashTableBucketIterator { typedef typename hashtable::hashbucket& reference; typedef typename hashtable::hashbucket* pointer; - public: +public: ObHashTableBucketIterator() : ht_(NULL), bucket_pos_(-1), bucket_(NULL) {} @@ -322,7 +322,7 @@ class ObHashTableBucketIterator { return iter; } - private: +private: const hashtable* ht_; int64_t bucket_pos_; pointer bucket_; @@ -331,7 +331,7 @@ class ObHashTableBucketIterator { template class _bucket_array, class _bucket_allocer, int64_t EXTEND_RATIO> class ObHashTableIterator { - private: +private: typedef ObHashTableNode<_value_type> hashnode; typedef ObHashTable<_key_type, _value_type, _hashfunc, _equal, _getkey, _allocer, _defendmode, _bucket_array, _bucket_allocer, EXTEND_RATIO> @@ -347,7 +347,7 @@ class ObHashTableIterator { friend class ObHashTableConstIterator<_key_type, _value_type, _hashfunc, _equal, _getkey, _allocer, _defendmode, _bucket_array, _bucket_allocer, EXTEND_RATIO>; - public: +public: ObHashTableIterator() : ht_(NULL), bucket_pos_(0), node_(0) {} @@ -411,7 +411,7 @@ class ObHashTableIterator { return iter; } - private: +private: const hashtable* ht_; int64_t bucket_pos_; hashnode* node_; @@ -420,7 +420,7 @@ class ObHashTableIterator { template class _bucket_array, class _bucket_allocer, int64_t EXTEND_RATIO> class ObHashTableConstIterator { - private: +private: typedef ObHashTableNode<_value_type> hashnode; typedef ObHashTable<_key_type, _value_type, _hashfunc, _equal, _getkey, _allocer, _defendmode, _bucket_array, _bucket_allocer, EXTEND_RATIO> @@ -436,7 +436,7 @@ class ObHashTableConstIterator { friend class ObHashTableIterator<_key_type, _value_type, _hashfunc, _equal, _getkey, _allocer, _defendmode, _bucket_array, _bucket_allocer, EXTEND_RATIO>; - public: +public: ObHashTableConstIterator() : ht_(NULL), bucket_pos_(0), node_(0) {} @@ -498,7 +498,7 @@ class ObHashTableConstIterator { return iter; } - private: +private: const hashtable* ht_; int64_t bucket_pos_; hashnode* node_; @@ -515,7 +515,7 @@ template class _bucket_array, class _bucket_allocer = oceanbase::common::ObMalloc, int64_t EXTEND_RATIO = 1> class ObHashTable { - public: +public: typedef ObHashTableBucketIterator<_key_type, _value_type, _hashfunc, _equal, _getkey, _allocer, _defendmode, _bucket_array, _bucket_allocer, EXTEND_RATIO> bucket_iterator; @@ -533,7 +533,7 @@ class ObHashTable { typedef typename _defendmode::readlocker readlocker; typedef typename _defendmode::writelocker writelocker; - private: +private: // ARRAY_SIZE * hashbucket is approximately equal to 1M, must be 2 << N. static const int64_t ARRAY_SIZE = 1024 * 16; @@ -551,10 +551,10 @@ class ObHashTable { friend class ObHashTableConstIterator<_key_type, _value_type, _hashfunc, _equal, _getkey, _allocer, _defendmode, _bucket_array, _bucket_allocer, EXTEND_RATIO>; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHashTable); - public: +public: ObHashTable() : allocer_(NULL), bucket_allocer_(&default_bucket_allocer_), bucket_num_(0), size_(0) { static_assert(((EXTEND_RATIO <= 1) || (EXTEND_RATIO > 1 && std::is_same<_defendmode, NoPthreadDefendMode>::value)), @@ -569,7 +569,7 @@ class ObHashTable { } } - public: +public: inline bool created() const { return inited(buckets_); @@ -722,7 +722,7 @@ class ObHashTable { return const_iterator(this, bucket_num_, NULL); } - private: +private: inline int internal_get(const hashbucket& bucket, const _key_type& key, _value_type& value, bool& is_fake) const { int ret = OB_SUCCESS; @@ -822,7 +822,7 @@ class ObHashTable { return ret; } - public: +public: // 4 functions below are thread-safe. // // if fake node is existent, also return OB_HASH_NOT_EXIST @@ -1076,13 +1076,13 @@ class ObHashTable { return ret; } - public: +public: int64_t size() const { return size_; } - public: +public: template int serialization(_archive& archive) { @@ -1200,7 +1200,7 @@ class ObHashTable { return ret; } - private: +private: _bucket_allocer default_bucket_allocer_; _allocer* allocer_; _bucket_allocer* bucket_allocer_; diff --git a/deps/oblib/src/lib/hash/ob_hashutils.h b/deps/oblib/src/lib/hash/ob_hashutils.h index f53524791..be4b337c6 100644 --- a/deps/oblib/src/lib/hash/ob_hashutils.h +++ b/deps/oblib/src/lib/hash/ob_hashutils.h @@ -83,7 +83,7 @@ enum **/ class SpinLocker { - public: +public: explicit SpinLocker(pthread_spinlock_t& spin) : succ_(false), spin_(NULL) { if (0 != pthread_spin_lock(&spin)) { @@ -106,17 +106,17 @@ class SpinLocker { return succ_; } - private: +private: SpinLocker() {} - private: +private: bool succ_; pthread_spinlock_t* spin_; }; class MutexLocker { - public: +public: explicit MutexLocker(pthread_mutex_t& mutex) : succ_(false), mutex_(NULL) { if (0 != pthread_mutex_lock(&mutex)) { @@ -139,17 +139,17 @@ class MutexLocker { return succ_; } - private: +private: MutexLocker() {} - private: +private: bool succ_; pthread_mutex_t* mutex_; }; class MutexWaiter { - public: +public: MutexWaiter() {} ~MutexWaiter() @@ -161,7 +161,7 @@ class MutexWaiter { }; class MutexBroadCaster { - public: +public: MutexBroadCaster() {} ~MutexBroadCaster() @@ -173,7 +173,7 @@ class MutexBroadCaster { }; class ReadLocker { - public: +public: explicit ReadLocker(pthread_rwlock_t& rwlock) : succ_(false), rwlock_(NULL) { if (0 != pthread_rwlock_rdlock(&rwlock)) { @@ -196,17 +196,17 @@ class ReadLocker { return succ_; } - private: +private: ReadLocker() {} - private: +private: bool succ_; pthread_rwlock_t* rwlock_; }; class WriteLocker { - public: +public: explicit WriteLocker(pthread_rwlock_t& rwlock) : succ_(false), rwlock_(NULL) { if (0 != pthread_rwlock_wrlock(&rwlock)) { @@ -229,17 +229,17 @@ class WriteLocker { return succ_; } - private: +private: WriteLocker() {} - private: +private: bool succ_; pthread_rwlock_t* rwlock_; }; class RWLockIniter { - public: +public: explicit RWLockIniter(pthread_rwlock_t& rwlock) : succ_(false) { if (0 != pthread_rwlock_init(&rwlock, NULL)) { @@ -253,15 +253,15 @@ class RWLockIniter { return succ_; } - private: +private: RWLockIniter(); - private: +private: bool succ_; }; class LatchReadLocker { - public: +public: explicit LatchReadLocker(common::ObLatch& rwlock) : succ_(false), rwlock_(NULL) { int ret = common::OB_SUCCESS; @@ -283,17 +283,17 @@ class LatchReadLocker { return succ_; } - private: +private: LatchReadLocker() {} - private: +private: bool succ_; common::ObLatch* rwlock_; }; class LatchWriteLocker { - public: +public: explicit LatchWriteLocker(common::ObLatch& rwlock) : succ_(false), rwlock_(NULL) { int ret = common::OB_SUCCESS; @@ -315,11 +315,11 @@ class LatchWriteLocker { return succ_; } - private: +private: LatchWriteLocker() {} - private: +private: bool succ_; common::ObLatch* rwlock_; }; @@ -327,7 +327,7 @@ class LatchWriteLocker { /// class SpinReadLocker { - public: +public: explicit SpinReadLocker(SpinRWLock& rwlock) : succ_(false), rwlock_(NULL) { if (0 != rwlock.rdlock()) { @@ -348,17 +348,17 @@ class SpinReadLocker { return succ_; } - private: +private: SpinReadLocker() {} - private: +private: bool succ_; SpinRWLock* rwlock_; }; class SpinWriteLocker { - public: +public: explicit SpinWriteLocker(SpinRWLock& rwlock) : succ_(false), rwlock_(NULL) { if (0 != rwlock.wrlock()) { @@ -379,17 +379,17 @@ class SpinWriteLocker { return succ_; } - private: +private: SpinWriteLocker() {} - private: +private: bool succ_; SpinRWLock* rwlock_; }; class SpinIniter { - public: +public: explicit SpinIniter(pthread_spinlock_t& spin) : succ_(false) { if (0 != pthread_spin_init(&spin, PTHREAD_PROCESS_PRIVATE)) { @@ -403,15 +403,15 @@ class SpinIniter { return succ_; } - private: +private: SpinIniter(); - private: +private: bool succ_; }; class MutexIniter { - public: +public: explicit MutexIniter(pthread_mutex_t& mutex) : succ_(false) { if (0 != pthread_mutex_init(&mutex, NULL)) { @@ -425,15 +425,15 @@ class MutexIniter { return succ_; } - private: +private: MutexIniter(); - private: +private: bool succ_; }; class NLock { - public: +public: NLock() {} ~NLock() @@ -441,7 +441,7 @@ class NLock { }; class NCond { - public: +public: NCond() {} ~NCond() @@ -449,7 +449,7 @@ class NCond { }; class NullIniter { - public: +public: explicit NullIniter(NLock& nlock) { NLock* usr = NULL; @@ -457,12 +457,12 @@ class NullIniter { UNUSED(usr); } - private: +private: NullIniter(); }; class NullLocker { - public: +public: explicit NullLocker(pthread_mutex_t& mutex) { pthread_mutex_t* usr = NULL; @@ -486,14 +486,14 @@ class NullLocker { return true; } - private: +private: NullLocker() {} }; template class NWaiter { - public: +public: NWaiter() {} ~NWaiter() @@ -508,7 +508,7 @@ class NWaiter { }; class NBroadCaster { - public: +public: NBroadCaster() {} ~NBroadCaster() @@ -803,7 +803,7 @@ struct HashMapPair { } TO_STRING_KV(K(first), K(second)); - private: +private: DISALLOW_COPY_AND_ASSIGN(HashMapPair); }; @@ -891,7 +891,7 @@ struct DefaultBigArrayAllocator { template class BigArrayTemp { class Block { - public: + public: Block() : array_(NULL), allocer_(NULL) {} ~Block() @@ -899,7 +899,7 @@ class BigArrayTemp { destroy(); } - public: + public: int create(const int64_t array_size, Allocer* allocer) { int ret = 0; @@ -925,7 +925,7 @@ class BigArrayTemp { allocer_ = NULL; } - public: + public: T& operator[](const int64_t pos) { T& ret = array_[pos]; @@ -937,16 +937,16 @@ class BigArrayTemp { return ret; } - private: + private: T* array_; Allocer* allocer_; }; - public: +public: typedef BigArrayTag ArrayTag; typedef BigArrayTemp array_type; - public: +public: BigArrayTemp() : blocks_(NULL), array_size_(0), blocks_num_(0) {} ~BigArrayTemp() @@ -954,7 +954,7 @@ class BigArrayTemp { destroy(); } - public: +public: bool inited() const { return (NULL != blocks_); @@ -1020,7 +1020,7 @@ class BigArrayTemp { return blocks_[block_pos][array_pos]; } - public: +public: static int64_t upper_align(const int64_t input, const int64_t align) { int64_t ret = input; @@ -1036,7 +1036,7 @@ class BigArrayTemp { return input & (align - 1); } - private: +private: Block* blocks_; Allocer allocer_; int64_t array_size_; @@ -1158,7 +1158,7 @@ void do_destroy(Array& array, NormalPointerTag, BucketAllocator& alloc) //////////////////////////////////////////////////////////////////////////////////////////////////// struct DefaultSimpleAllocerAllocator { - public: +public: explicit DefaultSimpleAllocerAllocator( uint64_t tenant_id = OB_SERVER_TENANT_ID, const lib::ObLabel& label = ObModIds::OB_HASH_NODE) { @@ -1189,7 +1189,7 @@ struct DefaultSimpleAllocerAllocator { attr_.label_ = label; } - private: +private: ObMemAttr attr_; }; @@ -1249,7 +1249,7 @@ class SimpleAllocer { typedef typename DefendMode::lock_type lock_type; typedef typename DefendMode::lock_initer lock_initer; - public: +public: SimpleAllocer() : block_list_head_(NULL), free_list_head_(NULL) { lock_initer initer(lock_); @@ -1399,7 +1399,7 @@ class SimpleAllocer { } } - private: +private: Block* block_list_head_; Node* free_list_head_; lock_type lock_; diff --git a/deps/oblib/src/lib/hash/ob_hazard_pointer.h b/deps/oblib/src/lib/hash/ob_hazard_pointer.h index 63b097454..00e554378 100644 --- a/deps/oblib/src/lib/hash/ob_hazard_pointer.h +++ b/deps/oblib/src/lib/hash/ob_hazard_pointer.h @@ -21,9 +21,9 @@ namespace oceanbase { namespace common { class ObHazardPointer { - public: +public: class ReclaimCallback { - public: + public: ReclaimCallback() {} virtual ~ReclaimCallback() @@ -31,7 +31,7 @@ class ObHazardPointer { virtual void reclaim_ptr(uintptr_t ptr) = 0; }; - public: +public: inline ObHazardPointer() : hazard_list_(NULL), retire_list_(NULL), reclaim_callback_(NULL), is_inited_(false) {} inline ~ObHazardPointer(); @@ -41,10 +41,10 @@ class ObHazardPointer { inline int release(uintptr_t ptr); inline int retire(uintptr_t ptr); - private: +private: inline int reclaim(); - private: +private: struct Node { Node() : ptr(0), next(NULL) {} @@ -62,13 +62,13 @@ class ObHazardPointer { Node head[OB_MAX_THREAD_NUM] CACHE_ALIGNED; }; - private: +private: ThreadLocalNodeList* hazard_list_; ThreadLocalNodeList* retire_list_; ReclaimCallback* reclaim_callback_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHazardPointer); }; diff --git a/deps/oblib/src/lib/hash/ob_iteratable_hashmap.h b/deps/oblib/src/lib/hash/ob_iteratable_hashmap.h index dbf238089..35f7d9d63 100644 --- a/deps/oblib/src/lib/hash/ob_iteratable_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_iteratable_hashmap.h @@ -21,7 +21,7 @@ namespace common { namespace hash { template class ObIteratableHashMapConstIterator { - public: +public: typedef typename HashMap::const_key_pointer_t const_key_pointer_t; typedef typename HashMap::const_value_pointer_t const_value_pointer_t; typedef typename HashMap::const_key_t const_key_t; @@ -32,7 +32,7 @@ class ObIteratableHashMapConstIterator { typedef ObIteratableHashMapConstIterator self_t; typedef typename HashMap::inner_key_t inner_key_t; - public: +public: ObIteratableHashMapConstIterator() : map_(NULL), cur_(NULL) {} ObIteratableHashMapConstIterator(const HashMap* map, const inner_key_t* cur) : map_(map), cur_(cur) @@ -68,7 +68,7 @@ class ObIteratableHashMapConstIterator { return const_iter_value_t(cur_->get_data(), map_->values_[pos]); } - private: +private: // data members const HashMap* map_; const inner_key_t* cur_; @@ -76,7 +76,7 @@ class ObIteratableHashMapConstIterator { template class ObIteratableHashMap { - public: +public: typedef K key_t; typedef const K const_key_t; typedef K* key_pointer_t; @@ -92,7 +92,7 @@ class ObIteratableHashMap { typedef ObIteratableHashMapConstIterator const_iterator_t; typedef common::ObDLinkNode inner_key_t; - public: +public: ObIteratableHashMap() : flags_(), keys_(), values_(), count_(0), list_() {} ~ObIteratableHashMap() @@ -155,16 +155,16 @@ class ObIteratableHashMap { } DECLARE_TO_STRING; - private: +private: // types and constants template friend class ObIteratableHashMapConstIterator; - private: +private: // disallow copy ObIteratableHashMap(const ObIteratableHashMap& other); // function members - private: +private: // data members ObBitSet flags_; inner_key_t keys_[N]; diff --git a/deps/oblib/src/lib/hash/ob_iteratable_hashset.h b/deps/oblib/src/lib/hash/ob_iteratable_hashset.h index b183ec7c2..793a09d39 100644 --- a/deps/oblib/src/lib/hash/ob_iteratable_hashset.h +++ b/deps/oblib/src/lib/hash/ob_iteratable_hashset.h @@ -28,7 +28,7 @@ class ObIteratableHashSetConstIterator { typedef typename HashSet::inner_key_t inner_key_t; typedef ObIteratableHashSetConstIterator self_t; - public: +public: ObIteratableHashSetConstIterator(const HashSet* set, const inner_key_t* cur) : set_(set), cur_(cur) {} virtual ~ObIteratableHashSetConstIterator() @@ -61,7 +61,7 @@ class ObIteratableHashSetConstIterator { return cur_->get_data(); } - private: +private: // data members const HashSet* set_; const inner_key_t* cur_; @@ -69,7 +69,7 @@ class ObIteratableHashSetConstIterator { template class ObIteratableHashSet : protected ObPlacementHashSet, N> { - public: +public: typedef K* key_pointer_t; typedef const K* const_key_pointer_t; typedef K& key_ref_t; @@ -79,7 +79,7 @@ class ObIteratableHashSet : protected ObPlacementHashSet, N> { typedef ObIteratableHashSet self_t; typedef ObIteratableHashSetConstIterator const_iterator_t; - public: +public: ObIteratableHashSet() : parent_t(), list_() {} virtual ~ObIteratableHashSet() @@ -151,16 +151,16 @@ class ObIteratableHashSet : protected ObPlacementHashSet, N> { } DECLARE_TO_STRING; - private: +private: // types and constants template friend class ObIteratableHashSetConstIterator; - private: +private: // disallow copy ObIteratableHashSet(const ObIteratableHashSet& other); // function members - protected: +protected: // data members ObDList list_; }; diff --git a/deps/oblib/src/lib/hash/ob_linear_hash_map.h b/deps/oblib/src/lib/hash/ob_linear_hash_map.h index 8d2012f99..9e837a556 100644 --- a/deps/oblib/src/lib/hash/ob_linear_hash_map.h +++ b/deps/oblib/src/lib/hash/ob_linear_hash_map.h @@ -188,7 +188,7 @@ struct UniqueMemMgrTag {}; template class ObLinearHashMap { - private: +private: /* Entry. */ struct Node { Key key_; @@ -208,7 +208,7 @@ class ObLinearHashMap { /* Memory alloc here uses mod id: LINEAR_HASH_MAP. */ /* One combination of Key, Value and MemMgrTag corresponds to one Core class. */ class HashMapMemMgrCore { - public: + public: HashMapMemMgrCore(); ~HashMapMemMgrCore(); static HashMapMemMgrCore& get_instance(); @@ -219,7 +219,7 @@ class ObLinearHashMap { void add_map(void* ptr); void rm_map(void* ptr); - private: + private: ObExternalRef hash_ref_; ObMemAttr attr_; ObSmallAllocator node_alloc_; @@ -233,7 +233,7 @@ class ObLinearHashMap { /* Mem Mgr uses template in order to specialize an unique mem mgr class. */ template class HashMapMemMgr { - public: + public: typedef HashMapMemMgrCore Core; HashMapMemMgr() {} @@ -252,14 +252,14 @@ class ObLinearHashMap { Core::get_instance().rm_map(ptr); } - private: + private: DISALLOW_COPY_AND_ASSIGN(HashMapMemMgr); }; /* Specialization. */ /* Dummy helps partially specialize HashMapMemMgr in this non-specialized class. */ template class HashMapMemMgr { - public: + public: HashMapMemMgr() : core_() {} virtual ~HashMapMemMgr() @@ -278,7 +278,7 @@ class ObLinearHashMap { Core::get_instance().rm_map(ptr); } - private: + private: Core core_; }; /* A fast counter. Several threads share one counter. */ @@ -292,7 +292,7 @@ class ObLinearHashMap { int64_t padding_[6]; } CACHE_ALIGNED; - public: + public: Cnter(); virtual ~Cnter() {} @@ -302,12 +302,12 @@ class ObLinearHashMap { int64_t count() const; bool op_and_test_lmt(const int64_t lmt, const int64_t th_id = 0); - private: + private: HashMapMemMgr* mem_mgr_; Counter* cnter_; }; - public: +public: /* BlurredIterator. * CAUTION: it's not a C++ STL style iterator. * @@ -318,7 +318,7 @@ class ObLinearHashMap { * Use for_each(fn) to iterate on every element of this hashmap. */ class BlurredIterator { - public: + public: explicit BlurredIterator(ObLinearHashMap& map) : map_(&map) { rewind(); @@ -328,13 +328,13 @@ class ObLinearHashMap { int next(Key& key, Value& value); void rewind(); - private: + private: ObLinearHashMap* map_; uint64_t bkt_idx_; uint64_t key_idx_; }; - private: +private: /* Parameters L & P. High-order 8 bits for L, low-order 56 bits for p. */ static const uint64_t LP_P_BIT_NUM = 56; static const uint64_t LP_L_BIT_NUM = 8; @@ -372,7 +372,7 @@ class ObLinearHashMap { static const int TENANT_ID = OB_SERVER_TENANT_ID; static constexpr const char* LABEL = ObModIds::OB_LINEAR_HASH_MAP; - public: +public: ObLinearHashMap() : init_(false), load_factor_(0.0), @@ -466,7 +466,7 @@ class ObLinearHashMap { return init_; } - private: +private: // Parameters L & P. void load_Lp_(uint64_t& L, uint64_t& p) const; void set_Lp_(uint64_t L, uint64_t p); @@ -545,7 +545,7 @@ class ObLinearHashMap { template int do_operate_(const Key& key, Function& fn); - private: +private: bool init_; double load_factor_; double load_factor_u_limit_; @@ -581,7 +581,7 @@ class ObLinearHashMap { // Memory attr. ObMemAttr memattr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLinearHashMap); // For unit test. OB_LINEAR_HASH_MAP_UNITTEST_FRIEND; diff --git a/deps/oblib/src/lib/hash/ob_link_hashmap.h b/deps/oblib/src/lib/hash/ob_link_hashmap.h index e9dee408d..506c50336 100644 --- a/deps/oblib/src/lib/hash/ob_link_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_link_hashmap.h @@ -32,7 +32,7 @@ inline int32_t faa_if_positive(int32_t* addr, int32_t x) // DO NOT use me class BaseRefHandle { - public: +public: typedef RefNode Node; enum { BORN_REF = INT32_MAX / 2 }; explicit BaseRefHandle(RetireStation& retire_station) @@ -59,7 +59,7 @@ class BaseRefHandle { retire_station_.purge(reclaim_list); } - protected: +protected: QClock& qclock_; RetireStation& retire_station_; uint64_t qc_slot_; @@ -67,7 +67,7 @@ class BaseRefHandle { // fast read, slow del, delay reclaim Value/Node class TCRefHandle final : public BaseRefHandle { - public: +public: typedef RefNode Node; explicit TCRefHandle(RetireStation& retire_station) : BaseRefHandle(retire_station) {} @@ -93,7 +93,7 @@ class TCRefHandle final : public BaseRefHandle { return get_tcref().dec_ref(&node->uref_); } - private: +private: static TCRef& get_tcref() { static TCRef tcref; @@ -103,7 +103,7 @@ class TCRefHandle final : public BaseRefHandle { // balanced read/del performance, realtime reclaim Value, batch/delay reclaim Node. class RefHandle final : public BaseRefHandle { - public: +public: typedef RefNode Node; explicit RefHandle(RetireStation& retire_station) : BaseRefHandle(retire_station) {} @@ -126,7 +126,7 @@ class RefHandle final : public BaseRefHandle { }; class DummyRefHandle final : public BaseRefHandle { - public: +public: typedef RefNode Node; enum { BORN_REF = 1 }; explicit DummyRefHandle(RetireStation& retire_station) : BaseRefHandle(retire_station) @@ -167,7 +167,7 @@ class DummyRefHandle final : public BaseRefHandle { template , typename RefHandle = RefHandle, int64_t SHRINK_THRESHOLD = 8> class ObLinkHashMap { - protected: +protected: typedef DCArrayAlloc ArrayAlloc; typedef DCHash Hash; typedef typename Hash::Node Node; @@ -186,9 +186,9 @@ class ObLinkHashMap { }; enum { RETIRE_LIMIT = 1024 }; - public: +public: class Iterator { - public: + public: explicit Iterator(ObLinkHashMap& hash) : hash_(hash), next_(hash_.next(nullptr)) {} ~Iterator() @@ -219,12 +219,12 @@ class ObLinkHashMap { } } - private: + private: ObLinkHashMap& hash_; HashNode* next_; }; - public: +public: explicit ObLinkHashMap(int64_t min_size = 1 << 16) : ref_handle_(get_retire_station()), hash_(array_alloc_, min_size) {} ObLinkHashMap(AllocHandle alloc_handle, int64_t min_size = 1 << 16) @@ -434,7 +434,7 @@ class ObLinkHashMap { return map(remove_if); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLinkHashMap); static int err_code_map(int err) { @@ -539,10 +539,10 @@ class ObLinkHashMap { return OB_ISNULL(iter) ? nullptr : next_node; } - protected: +protected: template class HandleOn { - public: + public: HandleOn(ObLinkHashMap& hash, Function& fn) : hash_(hash), handle_(fn) {} bool operator()(Key& key, Value* value) @@ -552,13 +552,13 @@ class ObLinkHashMap { return need_continue; } - private: + private: ObLinkHashMap& hash_; Function& handle_; }; template class RemoveIf { - public: + public: RemoveIf(ObLinkHashMap& hash, Function& fn) : hash_(hash), predicate_(fn) {} bool operator()(Key& key, Value* value) @@ -572,7 +572,7 @@ class ObLinkHashMap { return true; } - private: + private: ObLinkHashMap& hash_; Function& predicate_; }; @@ -583,14 +583,14 @@ class ObLinkHashMap { return true; } - protected: +protected: static RetireStation& get_retire_station() { static RetireStation retire_station(get_global_qclock(), RETIRE_LIMIT); return retire_station; } - protected: +protected: CountHandle count_handle_; AllocHandle alloc_handle_; RefHandle ref_handle_; @@ -600,7 +600,7 @@ class ObLinkHashMap { template class ObTenantLinkHashMap : public ObLinkHashMap { - public: +public: int create(uint64_t tenant_id, const Key& key, Value*& value) { int ret = OB_SUCCESS; diff --git a/deps/oblib/src/lib/hash/ob_link_hashmap_deps.h b/deps/oblib/src/lib/hash/ob_link_hashmap_deps.h index 32a32327e..57c5ad077 100644 --- a/deps/oblib/src/lib/hash/ob_link_hashmap_deps.h +++ b/deps/oblib/src/lib/hash/ob_link_hashmap_deps.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class DCArrayAlloc : public IAlloc { - public: +public: DCArrayAlloc() : label_(ObModIds::OB_CONCURRENT_HASH_MAP), tenant_id_(OB_SERVER_TENANT_ID) {} virtual ~DCArrayAlloc() @@ -58,10 +58,10 @@ class DCArrayAlloc : public IAlloc { } } - private: +private: DISALLOW_COPY_AND_ASSIGN(DCArrayAlloc); - private: +private: lib::ObLabel label_; uint64_t tenant_id_; }; @@ -79,7 +79,7 @@ struct RefNode { int32_t uref_; int32_t href_; - private: +private: DISALLOW_COPY_AND_ASSIGN(RefNode); }; @@ -92,7 +92,7 @@ struct LinkHashNode final : RefNode { KeyHashNode hash_link_; void* hash_val_; - private: +private: DISALLOW_COPY_AND_ASSIGN(LinkHashNode); }; @@ -112,14 +112,14 @@ struct LinkHashValue { } LinkHashNode* hash_node_; - private: +private: DISALLOW_COPY_AND_ASSIGN(LinkHashValue); }; // alloc must return constructed Node/Value. template class AllocHandle { - public: +public: typedef LinkHashNode Node; static Value* alloc_value() { @@ -143,7 +143,7 @@ class AllocHandle { }; class CountHandle { - public: +public: CountHandle() : count_(0) {} ~CountHandle() @@ -157,7 +157,7 @@ class CountHandle { return ATOMIC_FAA(&count_, x); } - private: +private: int64_t count_; }; } // namespace common diff --git a/deps/oblib/src/lib/hash/ob_link_hashmap_with_hazard_value.h b/deps/oblib/src/lib/hash/ob_link_hashmap_with_hazard_value.h index e0123fbc3..0f5837463 100644 --- a/deps/oblib/src/lib/hash/ob_link_hashmap_with_hazard_value.h +++ b/deps/oblib/src/lib/hash/ob_link_hashmap_with_hazard_value.h @@ -25,13 +25,13 @@ template Hash; typedef typename Hash::Node Node; typedef LinkHashNode HashNode; class Iterator { - public: + public: explicit Iterator(ObLinkHashMapWithHazardValue& hash) : hash_(hash), next_(hash_.next(NULL)) {} ~Iterator() @@ -47,12 +47,12 @@ class ObLinkHashMapWithHazardValue { return ret; } - private: + private: ObLinkHashMapWithHazardValue& hash_; HashNode* next_; }; - public: +public: explicit ObLinkHashMapWithHazardValue(int64_t min_size = 1 << 16) : alloc_handle_(), hash_(array_alloc_, min_size) {} explicit ObLinkHashMapWithHazardValue(AllocHandle& alloc_handle, int64_t min_size = 1 << 16) @@ -270,7 +270,7 @@ class ObLinkHashMapWithHazardValue { return map(remove_if); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLinkHashMapWithHazardValue); static int err_code_map(int err) { @@ -324,10 +324,10 @@ class ObLinkHashMapWithHazardValue { return OB_ISNULL(iter) ? nullptr : next_node; } - private: +private: template class HandleOn { - public: + public: HandleOn(ObLinkHashMapWithHazardValue& hash, Function& fn) : hash_(hash), handle_(fn) {} bool operator()(Key& key, Value* value) @@ -337,13 +337,13 @@ class ObLinkHashMapWithHazardValue { return need_continue; } - private: + private: ObLinkHashMapWithHazardValue& hash_; Function& handle_; }; template class RemoveIf { - public: + public: RemoveIf(ObLinkHashMapWithHazardValue& hash, Function& fn) : hash_(hash), predicate_(fn) {} bool operator()(Key& key, Value* value) @@ -357,7 +357,7 @@ class ObLinkHashMapWithHazardValue { return true; } - private: + private: ObLinkHashMapWithHazardValue& hash_; Function& predicate_; }; @@ -420,7 +420,7 @@ class ObLinkHashMapWithHazardValue { return retire_station; } - private: +private: CountHandle count_handle_; AllocHandle alloc_handle_; ArrayAlloc array_alloc_; diff --git a/deps/oblib/src/lib/hash/ob_placement_hashmap.h b/deps/oblib/src/lib/hash/ob_placement_hashmap.h index f8cb17a1e..0c43a10c6 100644 --- a/deps/oblib/src/lib/hash/ob_placement_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_placement_hashmap.h @@ -22,7 +22,7 @@ namespace common { namespace hash { template class ObPlacementHashMap { - public: +public: ObPlacementHashMap() : count_(0), keys_(reinterpret_cast(keys_buf_)), values_(reinterpret_cast(values_buf_)) {} @@ -58,14 +58,14 @@ class ObPlacementHashMap { return count(); } - protected: +protected: template friend class ObIteratableHashMap; typedef K KeyArray[N]; typedef K KType; typedef V ValueArray[N]; - protected: +protected: int64_t count_; ObBitSet flags_; char keys_buf_[sizeof(K) * N]; diff --git a/deps/oblib/src/lib/hash/ob_placement_hashset.h b/deps/oblib/src/lib/hash/ob_placement_hashset.h index 7605c8f23..bea520db4 100644 --- a/deps/oblib/src/lib/hash/ob_placement_hashset.h +++ b/deps/oblib/src/lib/hash/ob_placement_hashset.h @@ -20,7 +20,7 @@ namespace common { namespace hash { template class ObPlacementHashSet { - public: +public: ObPlacementHashSet() : count_(0) {} ~ObPlacementHashSet() @@ -44,7 +44,7 @@ class ObPlacementHashSet { return count_; }; - protected: +protected: ObBitSet flags_; K keys_[N]; int64_t count_; diff --git a/deps/oblib/src/lib/hash/ob_pointer_hashmap.h b/deps/oblib/src/lib/hash/ob_pointer_hashmap.h index 265ec8b75..c4537d21c 100644 --- a/deps/oblib/src/lib/hash/ob_pointer_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_pointer_hashmap.h @@ -26,7 +26,7 @@ namespace hash { */ template class GetKey> class ObPointerHashArray { - public: +public: struct Iterator { Iterator() : ha_(NULL), pos_(NULL), end_(NULL) {} @@ -75,7 +75,7 @@ class ObPointerHashArray { const V* end_; }; - public: +public: explicit ObPointerHashArray(const int64_t array_mem_size, const double load_factor = 0.7) : capacity_((array_mem_size - sizeof(ObPointerHashArray)) / sizeof(V)), max_entries_((int64_t)((double)capacity_ * load_factor)), @@ -364,7 +364,7 @@ class ObPointerHashArray { return *it == erased_v_; } - private: +private: uint64_t key_to_anchor_idx(const K& key) const { uint64_t hash_val = do_hash(key); @@ -453,10 +453,10 @@ class ObPointerHashArray { return ret; } - public: +public: static const int64_t MIN_HASH_ARRAY_ITEM_COUNT = 16; - private: +private: int64_t capacity_; int64_t max_entries_; int64_t anchor_mask_; @@ -476,7 +476,7 @@ template class GetKey, int64_t defaul class ObPointerHashMap { typedef ObPointerHashArray SubMap; - public: +public: typedef typename SubMap::Iterator iterator; explicit ObPointerHashMap(const lib::ObLabel& label = ObModIds::OB_HASH_NODE) @@ -800,7 +800,7 @@ class ObPointerHashMap { return sub_map_mem_size_; } - private: +private: ObPointerHashMap(const ObPointerHashMap& other, const int64_t resize_to) : sub_map_count_(0), sub_map_mem_size_(resize_to) { @@ -977,10 +977,10 @@ class ObPointerHashMap { } } - private: +private: static const int64_t MAX_SUB_MAP_COUNT = 4; - private: +private: SubMap* sub_maps_[MAX_SUB_MAP_COUNT]; int64_t sub_map_count_; int64_t sub_map_mem_size_; diff --git a/deps/oblib/src/lib/hash/ob_pre_alloc_link_hashmap.h b/deps/oblib/src/lib/hash/ob_pre_alloc_link_hashmap.h index d015cb0de..109fc3f04 100644 --- a/deps/oblib/src/lib/hash/ob_pre_alloc_link_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_pre_alloc_link_hashmap.h @@ -52,24 +52,24 @@ struct ObPreAllocLinkHashNode { template class ObPreAllocLinkHashMap { - public: +public: class ForeachFunctor { - public: + public: virtual int operator()(ITEM& item, bool& is_full) = 0; }; class EraseChecker { - public: + public: virtual int operator()(ITEM& item) = 0; }; class GetFunctor { - public: + public: virtual int operator()(ITEM& item) = 0; }; class Iterator { - public: + public: explicit Iterator(ObPreAllocLinkHashMap& map) : items_(), item_idx_(0), bucket_pos_(0), map_(map) {} virtual ~Iterator() @@ -110,7 +110,7 @@ class ObPreAllocLinkHashMap { return ret; } - private: + private: void release_items() { for (int64_t i = 0; i < items_.count(); ++i) { @@ -366,7 +366,7 @@ class ObPreAllocLinkHashMap { return ret; } - private: +private: bool is_inited_; mutable common::ObBucketLock buckets_lock_; uint64_t count_; diff --git a/deps/oblib/src/lib/hash/ob_ptr_array_map.h b/deps/oblib/src/lib/hash/ob_ptr_array_map.h index b6c9a02f3..0d3e1533b 100644 --- a/deps/oblib/src/lib/hash/ob_ptr_array_map.h +++ b/deps/oblib/src/lib/hash/ob_ptr_array_map.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class ObLinkArray { - public: +public: typedef ObLink Link; struct Seg : public Link { Seg(int64_t start, int64_t size) : start_(start), end_(start + size) @@ -87,7 +87,7 @@ class ObLinkArray { return NULL != s ? s->base_ + (idx - s->start_) : NULL; } - private: +private: Seg* locate_seg(int64_t idx, bool force_alloc) { Seg* s = NULL; @@ -130,7 +130,7 @@ class ObLinkArray { ob_free(s); } - private: +private: lib::ObLabel label_; int tenant_id_; int64_t seg_size_; @@ -141,7 +141,7 @@ class ObLinkArray { // package LinkArray template class ObPtrArrayWrapper { - public: +public: typedef ObLinkArray Array; typedef Array::Seg Seg; typedef hash::HashMapPair Pair; @@ -266,7 +266,7 @@ class ObPtrArrayWrapper { return ret; } - public: +public: ObLinkArray array_; char lock_[N_LOCK]; }; diff --git a/deps/oblib/src/lib/hash/ob_refered_map.h b/deps/oblib/src/lib/hash/ob_refered_map.h index 6db65ee79..3aabc3667 100644 --- a/deps/oblib/src/lib/hash/ob_refered_map.h +++ b/deps/oblib/src/lib/hash/ob_refered_map.h @@ -23,9 +23,9 @@ namespace hash { template class ObReferedMap { - public: +public: struct Item { - public: + public: struct GetKey { const K& operator()(const Item& item) { @@ -52,11 +52,11 @@ class ObReferedMap { TO_STRING_KV(K_(ref_cnt), K_(map), K_(v)); - private: + private: int64_t ref_cnt_; ObReferedMap* map_; - public: + public: V v_; }; typedef common::hash::ObHashTable, common::hash::equal_to, @@ -94,7 +94,7 @@ class ObReferedMap { TO_STRING_EMPTY(); - private: +private: bool inited_; common::hash::SimpleAllocer::AllocType> allocator_; common::ObMalloc bucket_allocator_; diff --git a/deps/oblib/src/lib/hash/ob_serialization.h b/deps/oblib/src/lib/hash/ob_serialization.h index 3f0ffb9af..42a2fd1cc 100644 --- a/deps/oblib/src/lib/hash/ob_serialization.h +++ b/deps/oblib/src/lib/hash/ob_serialization.h @@ -36,7 +36,7 @@ int deserialization(_archive& ar, _value& value) } class SimpleArchive { - public: +public: SimpleArchive() : fd_(-1) {} ~SimpleArchive() @@ -46,7 +46,7 @@ class SimpleArchive { } }; - public: +public: int init(const char* filename, int flag) { int ret = OB_SUCCESS; @@ -108,17 +108,17 @@ class SimpleArchive { return ret; }; - private: +private: DISALLOW_COPY_AND_ASSIGN(SimpleArchive); - public: +public: static const int FILE_OPEN_RFLAG = O_CREAT | O_RDONLY; static const int FILE_OPEN_WFLAG = O_CREAT | O_TRUNC | O_WRONLY; - private: +private: static const mode_t FILE_OPEN_MODE = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; - private: +private: int fd_; }; diff --git a/deps/oblib/src/lib/io/ob_io_benchmark.h b/deps/oblib/src/lib/io/ob_io_benchmark.h index 10fe97293..74ca64f17 100644 --- a/deps/oblib/src/lib/io/ob_io_benchmark.h +++ b/deps/oblib/src/lib/io/ob_io_benchmark.h @@ -64,7 +64,7 @@ struct ObIOBenchResult { }; class ObIOBenchResultSet { - public: +public: ObIOBenchResultSet(); virtual ~ObIOBenchResultSet(); @@ -110,7 +110,7 @@ class ObIOBenchResultSet { } int64_t to_string(char* buf, const int64_t length) const; - private: +private: /* * find index of benchmark result of given size */ @@ -127,14 +127,14 @@ class ObIOBenchResultSet { }; class ObIORunner : lib::ThreadPool { - public: +public: ObIORunner(); virtual ~ObIORunner(); int init(const ObDiskFd& fd, int64_t file_size, const int max_thread_cnt); virtual int run_test(const int thread_cnt, const ObIOWorkload& workload, ObIOBenchResult& result); void run1(); - private: +private: void destroy(); void reuse(); /* @@ -144,12 +144,12 @@ class ObIORunner : lib::ThreadPool { void cal_result(ObIOBenchResult& result); DISALLOW_COPY_AND_ASSIGN(ObIORunner); - private: +private: static const int64_t BENCH_TIME_US = 4 * 1000 * 1000; // us static const int64_t CHUNK_ALIGN_SIZE = 2 * 1024 * 1024; static const int64_t WAIT_MS = 100; - private: +private: bool is_inited_; bool start_work_; bool is_finish_; @@ -167,7 +167,7 @@ class ObIORunner : lib::ThreadPool { }; class ObDecompressTester { - public: +public: ObDecompressTester(); virtual ~ObDecompressTester(); @@ -175,7 +175,7 @@ class ObDecompressTester { // throughtput calculated based on compressed data size int get_decompress_throughtput(int64_t& throughtput); - private: +private: int prepare_data(const int64_t total_size, const int64_t block_size); int fill_buffer(char* buf, const int64_t buf_size, int64_t& data_size); bool inited_; @@ -199,7 +199,7 @@ class ObIOBenchmark { uint64_t aveq_; /* Average queue length */ }; - public: +public: static ObIOBenchmark& get_instance(); /** * If data_dir is NULL, will only load conf from configure file. @@ -221,7 +221,7 @@ class ObIOBenchmark { return disk_type_; } - private: +private: ObIOBenchmark(); virtual ~ObIOBenchmark(); int benchmark(const char* data_dir, const int64_t file_size, const int32_t max_thread_cnt); @@ -240,7 +240,7 @@ class ObIOBenchmark { int cal_disk_type(); DISALLOW_COPY_AND_ASSIGN(ObIOBenchmark); - private: +private: static const int64_t DEFAULT_BENCHMARK_FILE_SIZE = 1024 * 1024 * 1024; static const int32_t START_THREAD_CNT = 2; static const int32_t FILL_FILE_THREAD_CNT = 4; diff --git a/deps/oblib/src/lib/io/ob_io_common.h b/deps/oblib/src/lib/io/ob_io_common.h index 1dfe0e9bd..24ae1dbaf 100644 --- a/deps/oblib/src/lib/io/ob_io_common.h +++ b/deps/oblib/src/lib/io/ob_io_common.h @@ -91,7 +91,7 @@ struct ObDiskFd final { }; struct ObIOConfig { - public: +public: static const int64_t DEFAULT_SYS_IO_LOW_PERCENT = 10; static const int64_t DEFAULT_SYS_IO_HIGH_PERCENT = 90; static const int64_t DEFAULT_USER_IO_UP_PERCENT = 50; @@ -104,7 +104,7 @@ struct ObIOConfig { static const int64_t DEFAULT_IO_CALLBACK_THREAD_COUNT = 8; static const int64_t DEFAULT_LARGE_QUERY_IO_PERCENT = 0; // 0 means unlimited static const int64_t DEFAULT_DATA_STORAGE_IO_TIMEOUT_MS = 120L * 1000L; // 120s - public: +public: ObIOConfig() { set_default_value(); @@ -117,7 +117,7 @@ struct ObIOConfig { K_(retry_error_limit), K_(disk_io_thread_count), K_(callback_thread_count), K_(large_query_io_percent), K_(data_storage_io_timeout_ms)); - public: +public: int64_t sys_io_low_percent_; int64_t sys_io_high_percent_; int64_t user_iort_up_percent_; @@ -133,7 +133,7 @@ struct ObIOConfig { }; struct ObIODesc { - public: +public: ObIODesc() : category_(USER_IO), mode_(IO_MODE_READ), wait_event_no_(0), req_deadline_time_(0) {} bool is_valid() const @@ -151,7 +151,7 @@ struct ObIODesc { } TO_STRING_KV(K_(category), K_(mode), K_(wait_event_no), K_(req_deadline_time)); - public: +public: ObIOCategory category_; ObIOMode mode_; int64_t wait_event_no_; @@ -159,7 +159,7 @@ struct ObIODesc { }; struct ObIOPoint { - public: +public: ObIOPoint() : fd_(), size_(0), offset_(0), write_buf_(NULL) {} ~ObIOPoint() @@ -178,7 +178,7 @@ struct ObIOPoint { } TO_STRING_KV(K_(fd), K_(offset), K_(size), KP_(write_buf)); - public: +public: ObDiskFd fd_; int32_t size_; int64_t offset_; @@ -187,7 +187,7 @@ struct ObIOPoint { // pure virtual interface of io callback, any not sub class of ObIOCallback should add it to get_io_master_buf_size class ObIOCallback { - public: +public: static const int64_t CALLBACK_BUF_SIZE = 1024; ObIOCallback() : compat_mode_(static_cast(lib::get_compat_mode())) {} @@ -216,27 +216,27 @@ class ObIOCallback { }; class ObIOWriteFinishCallback { - public: +public: virtual ~ObIOWriteFinishCallback() {} virtual int notice_finish(const int64_t finish_id) = 0; }; struct ObIORetCode { - public: +public: ObIORetCode() : io_ret_(0), sys_errno_(0) {} virtual ~ObIORetCode() {} TO_STRING_KV(K_(io_ret), K_(sys_errno)); - public: +public: int io_ret_; // ob ret code, for example: OB_SUCCESS, OB_TIME_OUT, OB_IO_ERROR int sys_errno_; // system error number, get error message via strerror(). }; struct ObIOStat { - public: +public: ObIOStat() : io_cnt_(0), io_bytes_(0), io_rt_us_(0) {} virtual ~ObIOStat() @@ -248,14 +248,14 @@ struct ObIOStat { }; TO_STRING_KV(K_(io_cnt), K_(io_bytes), K_(io_rt_us)); - public: +public: uint64_t io_cnt_; uint64_t io_bytes_; uint64_t io_rt_us_; }; class ObIOStatDiff { - public: +public: ObIOStatDiff(); virtual ~ObIOStatDiff() {} @@ -274,7 +274,7 @@ class ObIOStatDiff { } TO_STRING_KV(K_(average_size), K_(average_rt_us), K_(old_stat), K_(new_stat)); - private: +private: int64_t average_size_; double average_rt_us_; ObIOStat old_stat_; @@ -283,7 +283,7 @@ class ObIOStatDiff { }; class ObCpuStatDiff { - public: +public: ObCpuStatDiff(); virtual ~ObCpuStatDiff() {} @@ -294,7 +294,7 @@ class ObCpuStatDiff { } TO_STRING_KV(K_(avg_usage)); - private: +private: struct rusage old_usage_; struct rusage new_usage_; int64_t old_time_; @@ -303,7 +303,7 @@ class ObCpuStatDiff { }; class ObIOQueue { - public: +public: ObIOQueue(); virtual ~ObIOQueue(); int init(const int32_t queue_depth); @@ -321,7 +321,7 @@ class ObIOQueue { return req_cnt_; } - private: +private: struct ObIORequestCmp { bool operator()(const ObIORequest* a, const ObIORequest* b) const; }; @@ -334,7 +334,7 @@ class ObIOQueue { }; class ObIOChannel { - public: +public: ObIOChannel(); virtual ~ObIOChannel(); int init(const int32_t queue_depth); @@ -351,12 +351,12 @@ class ObIOChannel { } TO_STRING_KV(K_(inited), K_(submit_cnt), K_(can_submit_request)); - private: +private: int inner_submit(ObIORequest& req, int& sys_ret); void finish_flying_req(ObIORequest& req, int io_ret, int system_errno); int64_t get_pop_wait_timeout(const int64_t queue_deadline); - private: +private: static const int32_t MAX_AIO_EVENT_CNT = 512; static const int64_t DISK_WAIT_PERIOD_US = 1000; static const int64_t AIO_TIMEOUT_NS = 1000L * 10000L; // 10ms @@ -370,7 +370,7 @@ class ObIOChannel { }; struct ObIOInfo final { - public: +public: ObIOInfo(); ~ObIOInfo() {} @@ -383,7 +383,7 @@ struct ObIOInfo final { common::ObArrayWrap(io_points_, batch_count_), K_(fail_disk_count), "fail_disk_ids", common::ObArrayWrap(fail_disk_ids_, fail_disk_count_)); - public: +public: int32_t size_; ObIODesc io_desc_; int32_t batch_count_; // number of io_points_, 0 if not using batch io @@ -398,7 +398,7 @@ struct ObIOInfo final { template class ObPointerHolder { - public: +public: explicit ObPointerHolder() : ptr_(NULL) {} explicit ObPointerHolder(T* ptr) : ptr_(NULL) @@ -430,13 +430,13 @@ class ObPointerHolder { } TO_STRING_KV(KP_(ptr)); - private: +private: T* ptr_; }; // default io callback, only used to alloc memory, process do nothing class ObDefaultIOCallback : public ObIOCallback { - public: +public: ObDefaultIOCallback(); virtual ~ObDefaultIOCallback(); int init(common::ObIOAllocator* allocator, const int64_t offset, const int64_t buf_size); @@ -447,7 +447,7 @@ class ObDefaultIOCallback : public ObIOCallback { virtual const char* get_data(); TO_STRING_KV(KP_(data_buf)); - private: +private: bool is_inited_; common::ObIOAllocator* allocator_; int64_t offset_; diff --git a/deps/oblib/src/lib/io/ob_io_disk.h b/deps/oblib/src/lib/io/ob_io_disk.h index 343b1343b..4dc4923e9 100644 --- a/deps/oblib/src/lib/io/ob_io_disk.h +++ b/deps/oblib/src/lib/io/ob_io_disk.h @@ -31,7 +31,7 @@ enum ObDiskAdminStatus { }; struct ObDiskMemoryStat { - public: +public: ObDiskMemoryStat() : used_request_cnt_(0), used_buf_size_(0), used_cache_block_cnt_(0) {} virtual ~ObDiskMemoryStat() @@ -46,14 +46,14 @@ struct ObDiskMemoryStat { } TO_STRING_KV(K_(used_request_cnt), K_(used_buf_size), K_(used_cache_block_cnt)); - public: +public: int64_t used_request_cnt_; int64_t used_buf_size_; int64_t used_cache_block_cnt_; }; class ObDiskDiagnose { - public: +public: ObDiskDiagnose(); virtual ~ObDiskDiagnose(); void record_read_fail(const int64_t retry_cnt); @@ -72,7 +72,7 @@ class ObDiskDiagnose { TO_STRING_KV(K_(is_disk_error), K_(disk_error_begin_ts), K_(disk_error_last_ts), K_(last_read_failure_warn_ts), K_(write_failure_cnt)); - private: +private: // more than 100 times of write failure per second, the disk is considered broken static const int64_t WRITE_FAILURE_DETECT_EVENT_CNT = 100; ObSpinLock lock_; @@ -85,7 +85,7 @@ class ObDiskDiagnose { }; class ObDisk : public lib::TGRunnable { - public: +public: static const int64_t DEFAULT_SYS_IO_PERCENT = 10; static const int64_t DEFAULT_SYS_IOPS = 1000; static const int64_t DEFAULT_SYS_LOWER_IO_BANDWIDTH = 128 * 1024 * 1024; @@ -155,10 +155,10 @@ class ObDisk : public lib::TGRunnable { TO_STRING_KV(K_(fd), K_(ref_cnt), K_(admin_status)); - private: +private: int update_request_deadline(ObIORequest& req); - private: +private: bool inited_; ObDiskFd fd_; int64_t ref_cnt_; @@ -191,7 +191,7 @@ class ObDisk : public lib::TGRunnable { typedef ObPointerHolder DiskHolder; class ObIOFaultDetector : public lib::TGTaskHandler { - public: +public: ObIOFaultDetector(); virtual ~ObIOFaultDetector(); int init(); @@ -199,7 +199,7 @@ class ObIOFaultDetector : public lib::TGTaskHandler { void submit_retry_task(const ObIOInfo& info, const uint64_t timeout_ms); void handle(void* task); - private: +private: static const int64_t TASK_NUM = 100; static const int64_t THREAD_NUM = 1; @@ -210,12 +210,12 @@ class ObIOFaultDetector : public lib::TGTaskHandler { bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIOFaultDetector); }; class ObDiskGuard { - public: +public: ObDiskGuard() : disk_(NULL) {} virtual ~ObDiskGuard(); @@ -228,13 +228,13 @@ class ObDiskGuard { void reset(); TO_STRING_KV(KP_(disk)); - private: +private: ObDisk* disk_; DISALLOW_COPY_AND_ASSIGN(ObDiskGuard); }; class ObDiskManager { - public: +public: static const int64_t MAX_DISK_NUM = common::OB_MAX_DISK_NUMBER; // replace MAX_DISK_NUM with disk_number_limit_ in cpp ObDiskManager(); @@ -264,11 +264,11 @@ class ObDiskManager { // simple get int get_disk_with_guard(const ObDiskFd& fd, ObDiskGuard& guard); - private: +private: ObDisk* get_disk(const ObDiskFd& fd); bool is_disk_exist(const ObDiskFd& fd); - private: +private: bool inited_; int32_t disk_count_; int32_t disk_number_limit_; diff --git a/deps/oblib/src/lib/io/ob_io_manager.h b/deps/oblib/src/lib/io/ob_io_manager.h index fdcb1d794..17ebee1fa 100644 --- a/deps/oblib/src/lib/io/ob_io_manager.h +++ b/deps/oblib/src/lib/io/ob_io_manager.h @@ -38,7 +38,7 @@ struct ObIOPointRetCode { * */ class ObIOHandle { - public: +public: ObIOHandle(); virtual ~ObIOHandle(); ObIOHandle(const ObIOHandle& other); @@ -64,13 +64,13 @@ class ObIOHandle { } int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: static const int64_t LONG_IO_PRINT_TRIGGER_US = 3000 * 1000; ObIOMaster* master_; }; class ObIOCallbackRunner { - public: +public: ObIOCallbackRunner(); virtual ~ObIOCallbackRunner(); int init(const int32_t queue_depth); @@ -80,7 +80,7 @@ class ObIOCallbackRunner { int dequeue_callback(int64_t queue_idx, ObIOMaster*& master); void do_callback(const int64_t queue_idx); - private: +private: static const int64_t CALLBACK_WAIT_PERIOD_US = 1000 * 1000; bool inited_; int64_t callback_thread_cnt_; @@ -90,7 +90,7 @@ class ObIOCallbackRunner { }; class ObIOManager : public lib::TGRunnable { - public: +public: static const int64_t DEFAULT_IO_MANAGER_MEMORY_LIMIT = 10L * 1024L * 1024L * 1024L; static const int64_t MAX_MEMORY_PERCENT_PER_DISK = 50; static const int64_t MAX_CALLBACK_THREAD_CNT = 64; @@ -186,14 +186,14 @@ class ObIOManager : public lib::TGRunnable { return callback_mgr_; } - private: +private: ObIOManager(); virtual ~ObIOManager(); int inner_aio( const ObIOMode mode, const ObIOInfo& info, ObIOCallback* callback, ObIOMaster* master, ObIOHandle& handle); int check_disk_error(); - private: +private: bool inited_; bool is_working_; bool is_disk_error_; diff --git a/deps/oblib/src/lib/io/ob_io_request.h b/deps/oblib/src/lib/io/ob_io_request.h index c1a054b34..7f62d6a59 100644 --- a/deps/oblib/src/lib/io/ob_io_request.h +++ b/deps/oblib/src/lib/io/ob_io_request.h @@ -28,7 +28,7 @@ class ObIOResourceManager; class ObIIOErrorHandler; struct ObIORequestDesc { - public: +public: ObIORequestDesc() : fd_(), io_size_(0), io_buf_(NULL), io_offset_(0) {} ~ObIORequestDesc() @@ -40,7 +40,7 @@ struct ObIORequestDesc { bool is_valid() const; TO_STRING_KV(K_(desc), K_(fd), K_(io_size), KP_(io_buf), K_(io_offset)); - public: +public: ObIODesc desc_; ObDiskFd fd_; int32_t io_size_; @@ -49,7 +49,7 @@ struct ObIORequestDesc { }; class ObIORequest : public ObDLinkBase { - public: +public: ObIORequest() { destroy(); @@ -72,9 +72,9 @@ class ObIORequest : public ObDLinkBase { TO_STRING_KV(K_(inited), K_(need_submit), K_(finished), K_(desc), K_(fd), KP_(io_buf), K_(io_offset), K_(io_size), K_(deadline_time), K_(io_time), K_(ret_code), KP_(master), K_(disk_guard), KP_(channel), K_(retry_cnt)); - public: +public: struct TimeLog { - public: + public: TimeLog() : begin_time_(0), enqueue_time_(0), dequeue_time_(0), os_submit_time_(0), os_return_time_(0), end_time_(0) {} void reset() @@ -84,7 +84,7 @@ class ObIORequest : public ObDLinkBase { TO_STRING_KV( K_(begin_time), K_(enqueue_time), K_(dequeue_time), K_(os_submit_time), K_(os_return_time), K_(end_time)); - public: + public: int64_t begin_time_; int64_t enqueue_time_; int64_t dequeue_time_; @@ -93,7 +93,7 @@ class ObIORequest : public ObDLinkBase { int64_t end_time_; }; - public: +public: bool inited_; bool need_submit_; bool finished_; @@ -115,7 +115,7 @@ class ObIORequest : public ObDLinkBase { // general control class ObIOMaster { - public: +public: ObIOMaster(); virtual ~ObIOMaster(); int init(); @@ -145,7 +145,7 @@ class ObIOMaster { K_(ref_cnt), K_(out_ref_cnt), KP_(resource_mgr), KP_(io_error_handler), K_(parent_io_master_holder), K_(recover_io_master_holder), K_(callback), K(ObArrayWrap(requests_, MAX_IO_BATCH_NUM))); - private: +private: int alloc_read_buf(ObIOCallback* callback); int alloc_write_buf(); int alloc_write_buf(ObIOCallback* callback); @@ -153,9 +153,9 @@ class ObIOMaster { int alloc_io_error_handler(const ObIIOErrorHandler* io_error_handler); int init_recover_io_master(); - public: +public: struct TimeLog { - public: + public: TimeLog() : begin_time_(0), prepare_delay_(0), @@ -173,7 +173,7 @@ class ObIOMaster { TO_STRING_KV(K_(begin_time), K_(prepare_delay), K_(send_time), K_(recv_time), K_(callback_enqueue_time), K_(callback_dequeue_time), K_(callback_delay), K_(end_time)); - public: + public: int64_t begin_time_; int64_t prepare_delay_; int64_t send_time_; @@ -184,7 +184,7 @@ class ObIOMaster { int64_t end_time_; }; - public: +public: bool inited_; bool need_callback_; bool has_finished_; @@ -214,7 +214,7 @@ class ObIOMaster { typedef ObPointerHolder MasterHolder; class ObIIOErrorHandler { - public: +public: virtual ~ObIIOErrorHandler() {} virtual int64_t get_deep_copy_size() const = 0; diff --git a/deps/oblib/src/lib/io/ob_io_resource.h b/deps/oblib/src/lib/io/ob_io_resource.h index f0746c60c..1e824b0f6 100644 --- a/deps/oblib/src/lib/io/ob_io_resource.h +++ b/deps/oblib/src/lib/io/ob_io_resource.h @@ -25,7 +25,7 @@ class ObIOMaster; template class ObIOMemoryPool { - public: +public: ObIOMemoryPool() : is_inited_(false), capacity_(0), free_count_(0), allocator_(nullptr), begin_ptr_(nullptr), bitmap_(nullptr) {} @@ -43,13 +43,13 @@ class ObIOMemoryPool { return SIZE; } - private: +private: int init_bitmap(const int64_t block_count, ObIAllocator& allocator); void bitmap_unset(const int64_t idx); void bitmap_set(const int64_t idx); bool bitmap_test(const int64_t idx); - private: +private: bool is_inited_; int64_t capacity_; int64_t free_count_; @@ -60,7 +60,7 @@ class ObIOMemoryPool { }; class ObIOAllocator final { - public: +public: ObIOAllocator(); virtual ~ObIOAllocator(); int init(const int64_t mem_limit, const int64_t page_size); @@ -69,7 +69,7 @@ class ObIOAllocator final { void free(void* ptr); int64_t allocated(); - private: +private: static const int64_t MICRO_POOL_BLOCK_SIZE = 16L * 1024L + 2 * DIO_READ_ALIGN_SIZE; static const int64_t MACRO_POOL_BLOCK_SIZE = 2L * 1024L * 1024L + DIO_READ_ALIGN_SIZE; static const int64_t DEFAULT_MICRO_POOL_COUNT = 10L * 1000L; @@ -88,7 +88,7 @@ class ObIOAllocator final { template class ObIOPool { - public: +public: int init(const int64_t count, ObIAllocator& allocator); void destroy(); int push(T* ptr) @@ -104,12 +104,12 @@ class ObIOPool { return pool_.capacity(); } - private: +private: ObFixedQueue pool_; }; class ObIOResourceManager { - public: +public: static const int64_t MAX_CHANNEL_CNT = common::OB_MAX_DISK_NUMBER; ObIOResourceManager(); virtual ~ObIOResourceManager(); @@ -127,7 +127,7 @@ class ObIOResourceManager { return &io_allocator_; } - private: +private: bool inited_; ObIOAllocator io_allocator_; // for limit memory of ObDisk ObConcurrentFIFOAllocator master_allocator_; diff --git a/deps/oblib/src/lib/json/ob_json.h b/deps/oblib/src/lib/json/ob_json.h index ceb7dda2e..0a46ee201 100644 --- a/deps/oblib/src/lib/json/ob_json.h +++ b/deps/oblib/src/lib/json/ob_json.h @@ -50,7 +50,7 @@ struct Pair : public ::oceanbase::common::ObDLinkBase { {} }; struct Value : public common::ObDLinkBase { - public: +public: Value() : type_(JT_NULL), int_(0), str_(), obj_(), arr_() {} virtual ~Value() @@ -106,7 +106,7 @@ struct Value : public common::ObDLinkBase { arr_.add_last(v); } - private: +private: Type type_; int64_t int_; String str_; @@ -116,13 +116,13 @@ struct Value : public common::ObDLinkBase { //////////////////////////////////////////////////////////////// // callback utility of Parser class JsonProcessor { - public: +public: virtual ~JsonProcessor() {} virtual void process_value(String& key, Value* value) = 0; }; class ToStringJsonProcessor : public json::JsonProcessor { - public: +public: virtual void process_value(json::String& key, json::Value* value) { if ((key == N_TID) && (value->get_type() == JT_NUMBER) && (value->get_number() <= 0)) { @@ -132,7 +132,7 @@ class ToStringJsonProcessor : public json::JsonProcessor { }; class Parser { - public: +public: Parser() : cur_token_(), allocator_(NULL), json_processor_(NULL) {} virtual ~Parser() @@ -149,7 +149,7 @@ class Parser { int parse(const char* buf, const int64_t buf_len, Value*& root); - private: +private: // types and constants enum TokenType { TK_INVALID = -1, @@ -178,7 +178,7 @@ class Parser { } value_; }; - private: +private: friend class ::ObJsonTest_token_test_Test; friend class ::ObJsonTest_basic_test_Test; // function members @@ -192,18 +192,18 @@ class Parser { int alloc_value(Type t, Value*& value); int alloc_pair(Pair*& pair); - private: +private: // data members Token cur_token_; common::ObArenaAllocator* allocator_; JsonProcessor* json_processor_; - private: +private: DISALLOW_COPY_AND_ASSIGN(Parser); }; //////////////////////////////////////////////////////////////// class Walker { - public: +public: explicit Walker(const Value* root) : root_(root), step_in_(true) {} virtual ~Walker() @@ -216,7 +216,7 @@ class Walker { int go(); - protected: +protected: virtual int on_null(int level, Type parent) = 0; virtual int on_true(int level, Type parent) = 0; virtual int on_false(int level, Type parent) = 0; @@ -233,16 +233,16 @@ class Walker { virtual int on_walk_start() = 0; virtual int on_walk_end() = 0; - private: +private: // function members int step(int level, const Value* node, Type parent); - protected: +protected: // data members const Value* root_; bool step_in_; - private: +private: DISALLOW_COPY_AND_ASSIGN(Walker); }; @@ -261,7 +261,7 @@ struct Tidy : public Walker { int64_t to_string(char* buf, const int64_t buf_len) const; static const int64_t MAX_PRINTABLE_SIZE = 2 * 1024 * 1024; - protected: +protected: virtual int on_null(int level, Type parent); virtual int on_true(int level, Type parent); virtual int on_false(int level, Type parent); @@ -286,43 +286,43 @@ struct Tidy : public Walker { int print_indent(int level); - protected: +protected: mutable common::ObDataBuffer print_buffer_; }; class RegexFilter : public Tidy { typedef common::ObList RegexList; - public: +public: RegexFilter(); virtual ~RegexFilter(); void reset(); - public: +public: virtual int on_obj_name(common::ObDataBuffer& path_buffer, bool& is_match) const; - public: +public: void register_regex(const char* pattern); void set_root(const Value* root) { root_ = root; } - protected: +protected: virtual int on_walk_start(); virtual int on_object_member_start(int level, Type parent, const Pair* kv); virtual int on_object_member_end(int level, Type parent, const Pair* kv, bool is_last); - private: +private: int mark_need_print(Value* node, common::ObDataBuffer path_buffer, bool& is_need_print) const; - private: +private: common::ObArenaAllocator allocator_; RegexList regex_list_; }; class JsonFilter { - public: +public: JsonFilter(const char** regexs, const int64_t regexn) : allocator_(common::ObModIds::OB_SQL_PHY_PLAN_STRING), parser_(), filter_(), root_(NULL) { @@ -336,7 +336,7 @@ class JsonFilter { virtual ~JsonFilter() {} - public: +public: void reset() { allocator_.reuse(); // FIXME ? @@ -354,7 +354,7 @@ class JsonFilter { return filter_.to_string(buf, buf_len); }; - private: +private: common::ObArenaAllocator allocator_; json::Parser parser_; json::RegexFilter filter_; @@ -362,7 +362,7 @@ class JsonFilter { }; class Path { - public: +public: explicit Path(Value* root) : root_(root) {} virtual ~Path() @@ -370,15 +370,15 @@ class Path { int for_all_path(); virtual int on_path(String& path, Pair* kv) = 0; - private: +private: // function members int iterate(Value* node, common::ObDataBuffer path_buffer); - private: +private: // data members Value* root_; - private: +private: DISALLOW_COPY_AND_ASSIGN(Path); }; /* diff --git a/deps/oblib/src/lib/json/ob_json_print_utils.h b/deps/oblib/src/lib/json/ob_json_print_utils.h index 78aa61892..626b2a00a 100644 --- a/deps/oblib/src/lib/json/ob_json_print_utils.h +++ b/deps/oblib/src/lib/json/ob_json_print_utils.h @@ -27,7 +27,7 @@ namespace json { // {"name1":123, "name2":"string1", "name3":[]} // class ObStdJsonConvertor { - public: +public: ObStdJsonConvertor() : backslash_escape_(true), json_(NULL), buf_(NULL), buf_size_(0), pos_(0) {} virtual ~ObStdJsonConvertor() @@ -46,13 +46,13 @@ class ObStdJsonConvertor { int convert(int64_t& out_len); - private: +private: // output [begin, p] int output(const char* p, const char*& begin, int64_t& out_len); int quoted_output(const char* p, const char*& begin, int64_t& out_len); int add_quote_mark(int64_t& out_len); - private: +private: bool backslash_escape_; const char* json_; char* buf_; @@ -118,7 +118,7 @@ struct ObFormatedJsonPrinter { return common::to_cstring(*this); } - private: +private: const T* obj_; }; diff --git a/deps/oblib/src/lib/json/ob_yson.h b/deps/oblib/src/lib/json/ob_yson.h index debca83ff..ba2fefc89 100644 --- a/deps/oblib/src/lib/json/ob_yson.h +++ b/deps/oblib/src/lib/json/ob_yson.h @@ -41,7 +41,7 @@ struct ObYsonToString { return pos; } - private: +private: char* yson_buf_; int64_t yson_buf_len_; }; diff --git a/deps/oblib/src/lib/list/ob_dlink_node.h b/deps/oblib/src/lib/list/ob_dlink_node.h index d73a3129c..cab687af8 100644 --- a/deps/oblib/src/lib/list/ob_dlink_node.h +++ b/deps/oblib/src/lib/list/ob_dlink_node.h @@ -26,7 +26,7 @@ class ObDList; // The concrete node class B should inherit ObDLinkNode template class ObDLinkBase { - public: +public: ObDLinkBase(); virtual ~ObDLinkBase() {} @@ -75,12 +75,12 @@ class ObDLinkBase { return 0; }; - protected: +protected: void add(Derived* prev, Derived* e, Derived* next); template friend class ObDList; - protected: +protected: Derived* prev_; Derived* next_; }; @@ -171,7 +171,7 @@ struct ObDLinkNode : public ObDLinkBase > { return do_hash(data_); }; - private: +private: T data_; }; diff --git a/deps/oblib/src/lib/list/ob_dlist.h b/deps/oblib/src/lib/list/ob_dlist.h index 14fbdc1e6..4e69889fe 100644 --- a/deps/oblib/src/lib/list/ob_dlist.h +++ b/deps/oblib/src/lib/list/ob_dlist.h @@ -48,7 +48,7 @@ namespace common { // DLinkNode should be a derived class of ObDLinkBase. See also ObDLinkNode and ObDLinkDerived template class ObDList { - public: +public: typedef DLinkNode node_t; ObDList(); @@ -146,10 +146,10 @@ class ObDList { } int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDList); - private: +private: ObDLinkBase header_; int32_t size_; }; @@ -383,7 +383,7 @@ class ObDlistDeserialzeHelper; template <> class ObDlistDeserialzeHelper { - public: +public: template int operator()(DLinkNode& node, ALLOCATOR& allocator, const char* buf, const int64_t data_len, int64_t& pos) { @@ -401,7 +401,7 @@ class ObDlistDeserialzeHelper { }; template <> class ObDlistDeserialzeHelper { - public: +public: template int operator()(DLinkNode& node, ALLOCATOR& allocator, const char* buf, const int64_t data_len, int64_t& pos) { @@ -423,7 +423,7 @@ class ObDlistNodeDestoryHelper; template <> class ObDlistNodeDestoryHelper { - public: +public: template int operator()(DLinkNode& node, ALLOCATOR& allocator) { @@ -437,7 +437,7 @@ class ObDlistNodeDestoryHelper { template <> class ObDlistNodeDestoryHelper { - public: +public: template int operator()(DLinkNode& node, ALLOCATOR& allocator) { diff --git a/deps/oblib/src/lib/list/ob_intrusive_list.h b/deps/oblib/src/lib/list/ob_intrusive_list.h index 30a11c0a9..2228594ab 100644 --- a/deps/oblib/src/lib/list/ob_intrusive_list.h +++ b/deps/oblib/src/lib/list/ob_intrusive_list.h @@ -22,13 +22,13 @@ namespace common { // Link cell for singly-linked list of objects of type T. template class SLink { - public: +public: T* next_; SLink() : next_(NULL){}; }; #define SLINK(c, f) \ class Link##_##f : public oceanbase::common::SLink { \ - public: \ + public: \ static c*& next_link(c* e) \ { \ return e->f.next_; \ @@ -41,7 +41,7 @@ class SLink { oceanbase::common::SLink f #define SLINKM(c, m, f) \ class Link##_##m##f : public oceanbase::common::SLink { \ - public: \ + public: \ static c*& next_link(c* e) \ { \ return e->m.f.next_; \ @@ -57,7 +57,7 @@ struct Link : public SLink { }; #define LINK(c, f) \ class Link##_##f : public oceanbase::common::Link { \ - public: \ + public: \ static c*& next_link(c* e) \ { \ return e->f.next_; \ @@ -78,7 +78,7 @@ struct Link : public SLink { oceanbase::common::Link f #define LINKM(c, m, f) \ class Link##_##m##f : public oceanbase::common::Link { \ - public: \ + public: \ static c*& next_link(c* e) \ { \ return e->m.f.next_; \ @@ -90,7 +90,7 @@ struct Link : public SLink { }; #define LINK_FORWARD_DECLARATION(c, f) \ class Link##_##c##_##f : public oceanbase::common::Link { \ - public: \ + public: \ static c*& next_link(c* e); \ static c*& prev_link(c* e); \ }; @@ -107,7 +107,7 @@ struct Link : public SLink { // List descriptor for singly-linked list of objects of type T. template class SLL { - public: +public: T* head_; bool empty() const { @@ -260,7 +260,7 @@ inline void DLL::insert(T* e, T* after) // List descriptor for queue of objects of type T. template class Queue : public DLL { - public: +public: using DLL::head_; T* tail_; void push(T* e); diff --git a/deps/oblib/src/lib/list/ob_link.h b/deps/oblib/src/lib/list/ob_link.h index 287b297e8..d2a0e3364 100644 --- a/deps/oblib/src/lib/list/ob_link.h +++ b/deps/oblib/src/lib/list/ob_link.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace common { /// @class single link item class ObSLink { - public: +public: /// @fn constructor inline ObSLink() { @@ -52,7 +52,7 @@ class ObSLink { return result; } - private: +private: /// @fn initialize inline void initialize() { @@ -64,7 +64,7 @@ class ObSLink { /// @class double link list item class ObDLink { - public: +public: /// @fn constructor inline ObDLink() { @@ -168,7 +168,7 @@ class ObDLink { return prev_; } - private: +private: /// @fn initialize inline void initialize() { diff --git a/deps/oblib/src/lib/list/ob_list.h b/deps/oblib/src/lib/list/ob_list.h index 1916c1e23..35fb55b72 100644 --- a/deps/oblib/src/lib/list/ob_list.h +++ b/deps/oblib/src/lib/list/ob_list.h @@ -39,20 +39,20 @@ template class ConstIterator { typedef ConstIterator self_t; - public: +public: typedef std::bidirectional_iterator_tag iterator_category; typedef typename List::value_type value_type; typedef typename List::const_pointer pointer; typedef typename List::const_reference reference; - private: +private: typedef typename List::iterator iterator; typedef Node node_t; typedef typename node_t::ptr_t node_ptr_t; typedef typename node_t::const_ptr_t node_const_ptr_t; friend class ObList; - public: +public: ConstIterator() : node_(NULL){}; ConstIterator(const self_t& other) { @@ -81,7 +81,7 @@ class ConstIterator { node_ = const_cast(node); }; - public: +public: reference operator*() const { // the access of end is undefined @@ -125,7 +125,7 @@ class ConstIterator { }; TO_STRING_KV(K_(node)); - private: +private: node_ptr_t node_; }; @@ -133,13 +133,13 @@ template class Iterator { typedef Iterator self_t; - public: +public: typedef std::bidirectional_iterator_tag iterator_category; typedef typename List::value_type value_type; typedef typename List::pointer pointer; typedef typename List::reference reference; - private: +private: typedef typename List::const_iterator const_iterator; typedef Node node_t; typedef typename node_t::ptr_t node_ptr_t; @@ -147,7 +147,7 @@ class Iterator { friend class ConstIterator; friend class ObList; - public: +public: Iterator() : node_(NULL){}; Iterator(const self_t& other) { @@ -167,7 +167,7 @@ class Iterator { node_ = const_cast(node); }; - public: +public: reference operator*() const { // the access of end is undefined @@ -211,7 +211,7 @@ class Iterator { }; TO_STRING_KV(K_(node)); - private: +private: node_ptr_t node_; }; } // namespace list @@ -225,7 +225,7 @@ template class ObList { typedef ObList self_t; - public: +public: typedef T value_type; typedef value_type* pointer; typedef value_type& reference; @@ -235,7 +235,7 @@ class ObList { typedef list::ConstIterator const_iterator; typedef Allocator allocator_t; - private: +private: typedef list::Node node_t; typedef typename node_t::ptr_t node_ptr_t; typedef typename node_t::const_ptr_t node_const_ptr_t; @@ -252,11 +252,11 @@ class ObList { }; } node_holder_t; - private: +private: ObList(const self_t& other); self_t& operator=(const self_t& other); - public: +public: ObList(Allocator& allocator) : size_(0), allocator_(allocator) { root_.next = root_; @@ -267,7 +267,7 @@ class ObList { reset(); }; - public: +public: int push_back(const value_type& value) { int ret = OB_SUCCESS; @@ -548,7 +548,7 @@ class ObList { return ret; } - private: +private: node_holder_t root_; int64_t size_; Allocator& allocator_; diff --git a/deps/oblib/src/lib/list/ob_obj_store.h b/deps/oblib/src/lib/list/ob_obj_store.h index e97ea8da5..b7b21289d 100644 --- a/deps/oblib/src/lib/list/ob_obj_store.h +++ b/deps/oblib/src/lib/list/ob_obj_store.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { template class ObObjNode : public ObDLinkBase > { - public: +public: ObObjNode() : obj_() {} explicit ObObjNode(const T& obj) : obj_(obj) @@ -42,16 +42,16 @@ class ObObjNode : public ObDLinkBase > { return obj_; } - private: +private: T obj_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObObjNode); }; template class ObObjStore { - public: +public: explicit ObObjStore(const BlockAllocatorT& alloc = BlockAllocatorT(ObModIds::OB_OBJ_STORE)); ~ObObjStore() { @@ -73,7 +73,7 @@ class ObObjStore { allocator_ = alloc; } - private: +private: ObDList > obj_list_; BlockAllocatorT allocator_; }; diff --git a/deps/oblib/src/lib/lock/Cond.h b/deps/oblib/src/lib/lock/Cond.h index 7a509230b..5e3bd4198 100644 --- a/deps/oblib/src/lib/lock/Cond.h +++ b/deps/oblib/src/lib/lock/Cond.h @@ -24,7 +24,7 @@ class RecMutex; * @brief Condition variable of linux-thread */ class Cond { - public: +public: Cond(); ~Cond(); @@ -73,10 +73,10 @@ class Cond { return timedWaitImpl(lock._mutex, timeout); } - private: +private: DISALLOW_COPY_AND_ASSIGN(Cond); - private: +private: friend class Monitor; friend class Monitor; diff --git a/deps/oblib/src/lib/lock/Lock.h b/deps/oblib/src/lib/lock/Lock.h index 24184aa81..635a267fa 100644 --- a/deps/oblib/src/lib/lock/Lock.h +++ b/deps/oblib/src/lib/lock/Lock.h @@ -21,7 +21,7 @@ namespace tbutil { */ template class LockT { - public: +public: explicit LockT(const T& mutex) : _mutex(mutex) { _mutex.lock(); @@ -79,13 +79,13 @@ class LockT { return _acquired; } - protected: +protected: LockT(const T& mutex, bool) : _mutex(mutex) { _acquired = _mutex.tryLock(); } - private: +private: LockT(const LockT&); LockT& operator=(const LockT&); @@ -102,7 +102,7 @@ class LockT { */ template class TryLockT : public LockT { - public: +public: TryLockT(const T& mutex) : LockT(mutex, true) {} }; diff --git a/deps/oblib/src/lib/lock/Monitor.h b/deps/oblib/src/lib/lock/Monitor.h index 21ad4519b..a8988f956 100644 --- a/deps/oblib/src/lib/lock/Monitor.h +++ b/deps/oblib/src/lib/lock/Monitor.h @@ -30,7 +30,7 @@ namespace tbutil { */ template class Monitor { - public: +public: typedef LockT > Lock; typedef TryLockT > TryLock; @@ -86,7 +86,7 @@ class Monitor { */ void notifyAll(); - private: +private: Monitor(const Monitor&); Monitor& operator=(const Monitor&); diff --git a/deps/oblib/src/lib/lock/Mutex.h b/deps/oblib/src/lib/lock/Mutex.h index f1d1ad67e..7d13b652b 100644 --- a/deps/oblib/src/lib/lock/Mutex.h +++ b/deps/oblib/src/lib/lock/Mutex.h @@ -24,7 +24,7 @@ Mutex non-recursive lock, you need to pay attention to the following points when 2.Unless the calling thread holds a certain mutex, do not call unlock for the mutex */ class Mutex { - public: +public: typedef LockT Lock; typedef TryLockT TryLock; @@ -59,7 +59,7 @@ class Mutex { */ bool willUnlock() const; - private: +private: Mutex(const Mutex&); Mutex& operator=(const Mutex&); diff --git a/deps/oblib/src/lib/lock/RecMutex.h b/deps/oblib/src/lib/lock/RecMutex.h index 09dc6be21..255bbda07 100644 --- a/deps/oblib/src/lib/lock/RecMutex.h +++ b/deps/oblib/src/lib/lock/RecMutex.h @@ -27,7 +27,7 @@ class Cond; * the counter will decrease by one; when the counter returns to zero, another thread can acquire the mutex) */ class RecMutex { - public: +public: typedef LockT Lock; typedef TryLockT TryLock; @@ -57,7 +57,7 @@ class RecMutex { bool willUnlock() const; - private: +private: // noncopyable RecMutex(const RecMutex&); RecMutex& operator=(const RecMutex&); diff --git a/deps/oblib/src/lib/lock/ob_bucket_lock.h b/deps/oblib/src/lib/lock/ob_bucket_lock.h index e3d1f9f41..31e0d13f5 100644 --- a/deps/oblib/src/lib/lock/ob_bucket_lock.h +++ b/deps/oblib/src/lib/lock/ob_bucket_lock.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObBucketLock { - public: +public: ObBucketLock(); virtual ~ObBucketLock(); int init(const uint64_t bucket_cnt, const uint32_t latch_id = ObLatchIds::DEFAULT_BUCKET_LOCK, @@ -37,7 +37,7 @@ class ObBucketLock { int unlock_all(); TO_STRING_KV(K_(bucket_cnt), K_(latch_cnt), K_(latch_id)); - private: +private: friend class ObMultiBucketLockGuard; friend class ObBucketHashRLockGuard; friend class ObBucketHashWLockGuard; @@ -57,19 +57,19 @@ class ObBucketLock { OB_INLINE uint64_t bucket_to_latch_idx(const uint64_t bucket_idx) const; int try_lock_all(const bool is_write_lock); - private: +private: uint64_t bucket_cnt_; uint64_t latch_cnt_; ObLatch* latches_; uint32_t latch_id_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBucketLock); }; class ObBucketRLockGuard final { - public: +public: ObBucketRLockGuard(ObBucketLock& lock, const uint64_t bucket_index) : lock_(lock), index_(bucket_index), ret_(OB_SUCCESS), lock_start_ts_(0) { @@ -102,18 +102,18 @@ class ObBucketRLockGuard final { return ret_; } - private: +private: ObBucketLock& lock_; const uint64_t index_; int ret_; int64_t lock_start_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBucketRLockGuard); }; class ObBucketWLockGuard final { - public: +public: ObBucketWLockGuard(ObBucketLock& lock, const uint64_t bucket_index) : lock_(lock), index_(bucket_index), ret_(OB_SUCCESS), lock_start_ts_(0) { @@ -146,18 +146,18 @@ class ObBucketWLockGuard final { return ret_; } - private: +private: ObBucketLock& lock_; const uint64_t index_; int ret_; int64_t lock_start_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBucketWLockGuard); }; class ObBucketWLockAllGuard final { - public: +public: ObBucketWLockAllGuard(ObBucketLock& lock) : lock_(lock), ret_(OB_SUCCESS), lock_start_ts_(0) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.wrlock_all()))) { @@ -189,17 +189,17 @@ class ObBucketWLockAllGuard final { return ret_; } - private: +private: ObBucketLock& lock_; int ret_; int64_t lock_start_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBucketWLockAllGuard); }; class ObBucketTryWLockAllGuard final { - public: +public: ObBucketTryWLockAllGuard(ObBucketLock& lock) : lock_(lock), ret_(OB_SUCCESS), lock_start_ts_(0) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.try_wrlock_all()))) { @@ -231,17 +231,17 @@ class ObBucketTryWLockAllGuard final { return ret_; } - private: +private: ObBucketLock& lock_; int ret_; int64_t lock_start_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBucketTryWLockAllGuard); }; class ObBucketTryRLockAllGuard final { - public: +public: ObBucketTryRLockAllGuard(ObBucketLock& lock) : lock_(lock), ret_(OB_SUCCESS), lock_start_ts_(0) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.try_rdlock_all()))) { @@ -273,32 +273,32 @@ class ObBucketTryRLockAllGuard final { return ret_; } - private: +private: ObBucketLock& lock_; int ret_; int64_t lock_start_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBucketTryRLockAllGuard); }; class ObMultiBucketLockGuard final { - public: +public: ObMultiBucketLockGuard(ObBucketLock& lock, const bool is_write_lock); ~ObMultiBucketLockGuard(); int lock_multi_buckets(ObIArray& hash_array); - private: +private: ObBucketLock& lock_; bool is_write_lock_; ObArray latch_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultiBucketLockGuard); }; class ObBucketHashRLockGuard final { - public: +public: ObBucketHashRLockGuard(ObBucketLock& lock, const uint64_t hash_value) : guard_(lock, lock.get_bucket_idx(hash_value)) {} ~ObBucketHashRLockGuard() @@ -308,13 +308,13 @@ class ObBucketHashRLockGuard final { return guard_.get_ret(); } - private: +private: ObBucketRLockGuard guard_; DISALLOW_COPY_AND_ASSIGN(ObBucketHashRLockGuard); }; class ObBucketHashWLockGuard final { - public: +public: ObBucketHashWLockGuard(ObBucketLock& lock, const uint64_t hash_value) : guard_(lock, lock.get_bucket_idx(hash_value)) {} ~ObBucketHashWLockGuard() @@ -324,7 +324,7 @@ class ObBucketHashWLockGuard final { return guard_.get_ret(); } - private: +private: ObBucketWLockGuard guard_; DISALLOW_COPY_AND_ASSIGN(ObBucketHashWLockGuard); }; diff --git a/deps/oblib/src/lib/lock/ob_drw_lock.h b/deps/oblib/src/lib/lock/ob_drw_lock.h index 06416f17e..1727ba935 100644 --- a/deps/oblib/src/lib/lock/ob_drw_lock.h +++ b/deps/oblib/src/lib/lock/ob_drw_lock.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class DRWLock { - public: +public: explicit DRWLock(const uint32_t latch_id = ObLatchIds::DEFAULT_DRW_LOCK) : latches_(), latch_id_(latch_id) {} ~DRWLock() @@ -33,7 +33,7 @@ class DRWLock { inline int wrunlock(); inline int try_wrlock(); class RDLockGuard { - public: + public: explicit RDLockGuard(DRWLock& rwlock) : rwlock_(rwlock), ret_(OB_SUCCESS) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = rwlock_.rdlock()))) { @@ -53,15 +53,15 @@ class DRWLock { return ret_; } - private: + private: DRWLock& rwlock_; int ret_; - private: + private: DISALLOW_COPY_AND_ASSIGN(RDLockGuard); }; class WRLockGuard { - public: + public: explicit WRLockGuard(DRWLock& rwlock) : rwlock_(rwlock), ret_(OB_SUCCESS) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = rwlock_.wrlock()))) { @@ -81,15 +81,15 @@ class DRWLock { return ret_; } - private: + private: DRWLock& rwlock_; int ret_; - private: + private: DISALLOW_COPY_AND_ASSIGN(WRLockGuard); }; class WRRetryLockGuard { - public: + public: WRRetryLockGuard(DRWLock& rwlock) : rwlock_(rwlock), ret_(OB_SUCCESS) { const int64_t start_us = ObTimeUtility::current_time(); @@ -116,25 +116,25 @@ class DRWLock { return ret_; } - private: + private: static const int64_t BASE_US = 100 * 1000; // 100 ms static const int64_t UPPER_US = 3 * 1000 * 1000; // 3s - private: + private: DRWLock& rwlock_; int ret_; - private: + private: DISALLOW_COPY_AND_ASSIGN(WRRetryLockGuard); }; - private: +private: struct AlignedLatch { ObLatch latch_; } CACHE_ALIGNED; AlignedLatch latches_[OB_MAX_CPU_NUM]; uint32_t latch_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(DRWLock); }; diff --git a/deps/oblib/src/lib/lock/ob_fcond.h b/deps/oblib/src/lib/lock/ob_fcond.h index c0bd54923..511feb207 100644 --- a/deps/oblib/src/lib/lock/ob_fcond.h +++ b/deps/oblib/src/lib/lock/ob_fcond.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { struct ObFCond { - public: +public: ObFCond() : seq_(0), n_waiters_(0) {} ~ObFCond() @@ -43,7 +43,7 @@ struct ObFCond { return err; } - private: +private: lib::CoFutex futex_; uint32_t seq_; uint32_t n_waiters_; diff --git a/deps/oblib/src/lib/lock/ob_latch.h b/deps/oblib/src/lib/lock/ob_latch.h index a026cac8b..40fcc1068 100644 --- a/deps/oblib/src/lib/lock/ob_latch.h +++ b/deps/oblib/src/lib/lock/ob_latch.h @@ -84,7 +84,7 @@ struct ObLatchWaitMode { }; class ObLatchMutex { - public: +public: ObLatchMutex(); ~ObLatchMutex(); int lock(const uint32_t latch_id, const int64_t abs_timeout_us = INT64_MAX); @@ -95,10 +95,10 @@ class ObLatchMutex { inline uint32_t get_wid(); int64_t to_string(char* buf, const int64_t buf_len); - private: +private: OB_INLINE uint64_t low_try_lock(const int64_t max_spin_cnt, const uint32_t lock_value); - private: +private: static const int64_t MAX_SPIN_CNT_AFTER_WAIT = 1; static const uint32_t WRITE_MASK = 1 << 30; static const uint32_t WAIT_MASK = 1 << 31; @@ -126,19 +126,19 @@ struct ObWaitProc : public ObDLinkBase { int32_t mode_; volatile int32_t wait_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObWaitProc); }; class ObLatchWaitQueue { - public: +public: static ObLatchWaitQueue& get_instance(); template int wait(ObWaitProc& proc, const uint32_t latch_id, const uint32_t uid, LowTryLock& lock_func, LowTryLock& lock_func_ignore, const int64_t abs_timeout_us); int wake_up(ObLatch& latch, const bool only_rd_wait = false); - private: +private: struct ObLatchBucket { ObDList wait_list_; ObLatchMutex lock_; @@ -163,16 +163,16 @@ class ObLatchWaitQueue { int try_lock( ObLatchBucket& bucket, ObWaitProc& proc, const uint32_t latch_id, const uint32_t uid, LowTryLock& lock_func); - private: +private: static const uint64_t LATCH_MAP_BUCKET_CNT = 3079; ObLatchBucket wait_map_[LATCH_MAP_BUCKET_CNT]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLatchWaitQueue); }; class ObLatch { - public: +public: ObLatch(); ~ObLatch(); int try_rdlock(const uint32_t latch_id); @@ -188,7 +188,7 @@ class ObLatch { inline uint32_t get_wid() const; int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: template OB_INLINE int low_lock(const uint32_t latch_id, const int64_t abs_timeout_us, const uint32_t uid, const uint32_t wait_mode, LowTryLock& lock_func, LowTryLock& lock_func_ignore); @@ -198,7 +198,7 @@ class ObLatch { {} inline int operator()(volatile uint32_t* latch, const uint32_t lock, const uint32_t uid, bool& conflict); - private: + private: const bool ignore_; }; @@ -207,7 +207,7 @@ class ObLatch { {} inline int operator()(volatile uint32_t* latch, const uint32_t lock, const uint32_t uid, bool& conflict); - private: + private: const bool ignore_; }; @@ -224,7 +224,7 @@ struct ObLDLockType { #ifndef ENABLE_LATCH_DIAGNOSE class ObLDHandle { - public: +public: ObLDHandle() {} ~ObLDHandle() @@ -234,13 +234,13 @@ class ObLDHandle { return 0; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLDHandle); }; #else class ObLDHandleNode; class ObLDSlot { - public: +public: void add(ObLDHandleNode* node); void remove(ObLDHandleNode* node); std::mutex mutex_; @@ -248,19 +248,19 @@ class ObLDSlot { }; class ObLDHandleNode : public common::ObDLinkBase { - public: +public: ObLDHandleNode(); ObLDSlot* slot_; int tid_; ObLDLockType::Type type_; char lbt_[512]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLDHandleNode); }; class ObLDHandle { - public: +public: ObLDHandle() : node_(nullptr) {} void reset(); @@ -270,14 +270,14 @@ class ObLDHandle { } ObLDHandleNode* node_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLDHandle); }; #endif #ifndef ENABLE_LATCH_DIAGNOSE class ObLockDiagnose { - public: +public: void lock(const ObLDLockType::Type, ObLDHandle&) {} void print() @@ -285,7 +285,7 @@ class ObLockDiagnose { }; #else class ObLockDiagnose { - public: +public: ~ObLockDiagnose(); void lock(const ObLDLockType::Type type, ObLDHandle& handle); void print(); @@ -294,7 +294,7 @@ class ObLockDiagnose { #endif class ObLDLatch : public ObLatch { - public: +public: ObLDLatch(); void set_diagnose(bool diagnose) { @@ -309,12 +309,12 @@ class ObLDLatch : public ObLatch { bool diagnose_; ObLockDiagnose ld_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLDLatch); }; class ObLatchMutexGuard { - public: +public: ObLatchMutexGuard(ObLatchMutex& lock, const uint32_t latch_id) : lock_(lock), ret_(OB_SUCCESS) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.lock(latch_id)))) { @@ -334,14 +334,14 @@ class ObLatchMutexGuard { return ret_; } - private: +private: ObLatchMutex& lock_; int ret_; DISALLOW_COPY_AND_ASSIGN(ObLatchMutexGuard); }; class ObLatchRGuard { - public: +public: ObLatchRGuard(ObLatch& lock, const uint32_t latch_id) : lock_(lock), ret_(OB_SUCCESS) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.rdlock(latch_id)))) { @@ -361,16 +361,16 @@ class ObLatchRGuard { return ret_; } - private: +private: ObLatch& lock_; int ret_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLatchRGuard); }; class ObLatchWGuard { - public: +public: ObLatchWGuard(ObLatch& lock, const uint32_t latch_id) : lock_(lock), ret_(OB_SUCCESS) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.wrlock(latch_id)))) { @@ -390,11 +390,11 @@ class ObLatchWGuard { return ret_; } - private: +private: ObLatch& lock_; int ret_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLatchWGuard); }; diff --git a/deps/oblib/src/lib/lock/ob_lock_guard.h b/deps/oblib/src/lib/lock/ob_lock_guard.h index debeb88ee..1e8aa8861 100644 --- a/deps/oblib/src/lib/lock/ob_lock_guard.h +++ b/deps/oblib/src/lib/lock/ob_lock_guard.h @@ -21,7 +21,7 @@ namespace lib { template class ObLockGuard { - public: +public: explicit ObLockGuard(LockT& lock); ~ObLockGuard(); inline int get_ret() const @@ -29,7 +29,7 @@ class ObLockGuard { return ret_; } - private: +private: // disallow copy ObLockGuard(const ObLockGuard& other); ObLockGuard& operator=(const ObLockGuard& other); @@ -38,7 +38,7 @@ class ObLockGuard { void* operator new(std::size_t size, const std::nothrow_t& nothrow_constant) throw(); void* operator new(std::size_t size, void* ptr) throw(); - private: +private: // data members LockT& lock_; int ret_; diff --git a/deps/oblib/src/lib/lock/ob_mutex.h b/deps/oblib/src/lib/lock/ob_mutex.h index 789ec6b94..0be4f0f8c 100644 --- a/deps/oblib/src/lib/lock/ob_mutex.h +++ b/deps/oblib/src/lib/lock/ob_mutex.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace lib { class ObMutex { - public: +public: explicit ObMutex(uint32_t latch_id = common::ObLatchIds::DEFAULT_MUTEX) : latch_(), latch_id_(latch_id) {} ~ObMutex() @@ -39,11 +39,11 @@ class ObMutex { return latch_.unlock(); } - private: +private: common::ObLatchMutex latch_; uint32_t latch_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMutex); }; diff --git a/deps/oblib/src/lib/lock/ob_recursive_mutex.h b/deps/oblib/src/lib/lock/ob_recursive_mutex.h index 5cf8e45be..8acf46111 100644 --- a/deps/oblib/src/lib/lock/ob_recursive_mutex.h +++ b/deps/oblib/src/lib/lock/ob_recursive_mutex.h @@ -18,19 +18,19 @@ namespace oceanbase { namespace common { class ObRecursiveMutex { - public: +public: explicit ObRecursiveMutex(const uint32_t latch_id = ObLatchIds::DEFAULT_RECURSIVE_MUTEX); ~ObRecursiveMutex(); int lock(); int unlock(); int trylock(); - private: +private: ObLatch latch_; uint32_t latch_id_; uint32_t lock_cnt_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRecursiveMutex); }; diff --git a/deps/oblib/src/lib/lock/ob_scond.h b/deps/oblib/src/lib/lock/ob_scond.h index 96d18fadd..2660f8f15 100644 --- a/deps/oblib/src/lib/lock/ob_scond.h +++ b/deps/oblib/src/lib/lock/ob_scond.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { struct SimpleCond { - public: +public: SimpleCond() : n_waiters_(0) {} ~SimpleCond() @@ -48,13 +48,13 @@ struct SimpleCond { return n2wakeup; } - private: +private: lib::CoFutex futex_; uint32_t n_waiters_; }; struct SCondReadyFlag { - public: +public: SCondReadyFlag() : ready_(0), lock_(0) {} ~SCondReadyFlag() @@ -75,13 +75,13 @@ struct SCondReadyFlag { ATOMIC_STORE(&lock_, 0); } - private: +private: int ready_; int lock_; } CACHE_ALIGNED; class SCondSimpleCounter { - public: +public: SCondSimpleCounter() : count_(0) {} void add(uint32_t x) @@ -94,12 +94,12 @@ class SCondSimpleCounter { return (uint32_t)std::min(sum, 65536L); } - private: +private: int64_t count_; } CACHE_ALIGNED; class SCondCounter { - public: +public: enum { CPU_COUNT = OB_MAX_CPU_NUM }; struct Item { Item() : count_(0) @@ -121,12 +121,12 @@ class SCondCounter { return (uint32_t)std::min(sum, 65536L); } - private: +private: Item count_[CPU_COUNT]; }; class SCondSimpleIdGen { - public: +public: uint32_t next() { return (uint32_t)icpu_id(); @@ -138,7 +138,7 @@ class SCondSimpleIdGen { }; struct SCond { - public: +public: typedef SimpleCond CondPerCpu; typedef SCondReadyFlag Lock; typedef SCondCounter Counter; @@ -176,7 +176,7 @@ struct SCond { wait((uint32_t)(wait_key >> 32), (uint32_t)wait_key, timeout); } - protected: +protected: uint32_t get_key(uint32_t& id) { return conds_[id = (id_gen_.next() % COND_COUNT)].get_key(); @@ -186,7 +186,7 @@ struct SCond { conds_[id % COND_COUNT].wait(key, timeout); } - private: +private: static uint64_t& get_wait_key() { static RLOCAL(uint64_t, key); @@ -200,7 +200,7 @@ struct SCond { } } - private: +private: Lock lock_ CACHE_ALIGNED; CondPerCpu conds_[COND_COUNT]; Counter n2wakeup_; diff --git a/deps/oblib/src/lib/lock/ob_seq_sem.h b/deps/oblib/src/lib/lock/ob_seq_sem.h index 1693062d8..597502ff1 100644 --- a/deps/oblib/src/lib/lock/ob_seq_sem.h +++ b/deps/oblib/src/lib/lock/ob_seq_sem.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class ObSeqSem { - public: +public: enum { MAX_SEM_COUNT = 4096 }; static int64_t get_us() @@ -137,7 +137,7 @@ class ObSeqSem { return (int64_t)(push - pop); } - private: +private: uint64_t idx(int64_t x) { return x & (MAX_SEM_COUNT - 1); @@ -153,7 +153,7 @@ class ObSeqSem { } } - private: +private: uint64_t push_ CACHE_ALIGNED; uint64_t pop_ CACHE_ALIGNED; Sem sems_[MAX_SEM_COUNT]; diff --git a/deps/oblib/src/lib/lock/ob_small_spin_lock.h b/deps/oblib/src/lib/lock/ob_small_spin_lock.h index 26d091abc..5928ea5db 100644 --- a/deps/oblib/src/lib/lock/ob_small_spin_lock.h +++ b/deps/oblib/src/lib/lock/ob_small_spin_lock.h @@ -62,11 +62,11 @@ class ObSmallSpinLockGuard; template class ObSmallSpinLock { - public: +public: typedef ObSmallSpinLock MyType; typedef ObSmallSpinLockGuard Guard; typedef ObSmallSpinLockGuard guard; // Adapt to old code. - public: +public: // Constructor. // Usage I: To build a lock from nothing. // Non-lock bits are init to default value. @@ -86,7 +86,7 @@ class ObSmallSpinLock { return reinterpret_cast(val); } - public: +public: // Init. // Init lock bit. Other bits of IntType unchanged. void init() @@ -156,7 +156,7 @@ class ObSmallSpinLock { lock_ = static_cast((val & (~LOCK_MASK)) | (lock_ & (LOCK_MASK))); } - private: +private: static const IntType LOCK_MASK = static_cast(1) << LockBit; IntType lock_; }; @@ -164,7 +164,7 @@ class ObSmallSpinLock { // Lock guard. template class ObSmallSpinLockGuard { - public: +public: explicit ObSmallSpinLockGuard(LockType& lock) : lock_(&lock) { lock_->lock(); @@ -174,7 +174,7 @@ class ObSmallSpinLockGuard { lock_->unlock(); } - private: +private: LockType* lock_; DISALLOW_COPY_AND_ASSIGN(ObSmallSpinLockGuard); }; @@ -233,7 +233,7 @@ struct ObPtrSpinLock { // Lock guard. template class ObPtrSpinLockGuard { - public: +public: explicit ObPtrSpinLockGuard(LockType& lock) : lock_(&lock) { lock_->lock(); @@ -243,7 +243,7 @@ class ObPtrSpinLockGuard { lock_->unlock(); } - private: +private: LockType* lock_; DISALLOW_COPY_AND_ASSIGN(ObPtrSpinLockGuard); }; diff --git a/deps/oblib/src/lib/lock/ob_spin_lock.h b/deps/oblib/src/lib/lock/ob_spin_lock.h index ff12ef70a..09c11df15 100644 --- a/deps/oblib/src/lib/lock/ob_spin_lock.h +++ b/deps/oblib/src/lib/lock/ob_spin_lock.h @@ -27,7 +27,7 @@ namespace common { * */ class ObSpinLock { - public: +public: explicit ObSpinLock(uint32_t latch_id = ObLatchIds::DEFAULT_SPIN_LOCK); ~ObSpinLock(); int lock(); @@ -35,12 +35,12 @@ class ObSpinLock { int trylock(); int unlock(); - private: +private: // data members ObLatchMutex latch_; uint32_t latch_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSpinLock); }; @@ -73,7 +73,7 @@ inline int ObSpinLock::unlock() //////////////////////////////////////////////////////////////// // A lock class that do nothing, used as template argument class ObNullLock { - public: +public: ObNullLock(){}; ~ObNullLock(){}; int lock() @@ -85,7 +85,7 @@ class ObNullLock { return OB_SUCCESS; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNullLock); }; diff --git a/deps/oblib/src/lib/lock/ob_spin_rwlock.h b/deps/oblib/src/lib/lock/ob_spin_rwlock.h index 065af1c5e..3ab1fc3a4 100644 --- a/deps/oblib/src/lib/lock/ob_spin_rwlock.h +++ b/deps/oblib/src/lib/lock/ob_spin_rwlock.h @@ -23,13 +23,13 @@ namespace oceanbase { namespace common { class SpinRWLock { - public: +public: explicit SpinRWLock(uint32_t latch_id = ObLatchIds::DEFAULT_SPIN_RWLOCK) : latch_(), latch_id_(latch_id) {} ~SpinRWLock() {} - public: +public: void set_latch_id(const uint32_t latch_id) { latch_id_ = latch_id; @@ -55,16 +55,16 @@ class SpinRWLock { return latch_.unlock(); } - private: +private: ObLatch latch_; uint32_t latch_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(SpinRWLock); }; class SpinRLockGuard { - public: +public: explicit SpinRLockGuard(const SpinRWLock& lock) : lock_(const_cast(lock)), ret_(OB_SUCCESS) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.rdlock()))) { @@ -84,16 +84,16 @@ class SpinRLockGuard { return ret_; } - private: +private: SpinRWLock& lock_; int ret_; - private: +private: DISALLOW_COPY_AND_ASSIGN(SpinRLockGuard); }; class SpinWLockGuard { - public: +public: explicit SpinWLockGuard(const SpinRWLock& lock) : lock_(const_cast(lock)), ret_(OB_SUCCESS) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.wrlock()))) { @@ -113,11 +113,11 @@ class SpinWLockGuard { return ret_; } - private: +private: SpinRWLock& lock_; int ret_; - private: +private: DISALLOW_COPY_AND_ASSIGN(SpinWLockGuard); }; } // namespace common diff --git a/deps/oblib/src/lib/lock/ob_tc_ref.h b/deps/oblib/src/lib/lock/ob_tc_ref.h index f27c77d64..f0eb68956 100644 --- a/deps/oblib/src/lib/lock/ob_tc_ref.h +++ b/deps/oblib/src/lib/lock/ob_tc_ref.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class TCRef { - public: +public: enum { REF_LIMIT = INT32_MAX / 2 }; TCRef(int32_t ref_count_per_thread = 8) : ref_count_per_thread_(ref_count_per_thread) { @@ -129,7 +129,7 @@ class TCRef { return ref_cnt; } - private: +private: int32_t xref_(int32_t* p, int32_t x) { return ATOMIC_AAF(p, x); @@ -140,7 +140,7 @@ class TCRef { return qsync; } - private: +private: int32_t ref_count_per_thread_; int32_t total_ref_count_; int32_t** ref_; diff --git a/deps/oblib/src/lib/lock/ob_tc_rwlock.h b/deps/oblib/src/lib/lock/ob_tc_rwlock.h index f1e0fed19..d315035a2 100644 --- a/deps/oblib/src/lib/lock/ob_tc_rwlock.h +++ b/deps/oblib/src/lib/lock/ob_tc_rwlock.h @@ -24,7 +24,7 @@ namespace common { #if USE_TCRWLOCK class LWaitCond { - public: +public: LWaitCond() : futex_() {} ~LWaitCond() @@ -47,12 +47,12 @@ class LWaitCond { return ready; } - private: +private: lib::CoFutex futex_; }; class TCRWLock { - public: +public: enum { WRITE_MASK = 1 << 31 }; struct RLockGuard { explicit RLockGuard(TCRWLock& lock) : lock_(lock) @@ -274,7 +274,7 @@ class TCRWLock { return tcref_; } - private: +private: ObLatch latch_; uint32_t latch_id_; TCRef& tcref_; @@ -284,7 +284,7 @@ class TCRWLock { }; class TCWLockGuard { - public: +public: explicit TCWLockGuard(const TCRWLock& lock) : lock_(const_cast(lock)), ret_(OB_SUCCESS) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.wrlock()))) { @@ -304,16 +304,16 @@ class TCWLockGuard { return ret_; } - private: +private: TCRWLock& lock_; int ret_; - private: +private: DISALLOW_COPY_AND_ASSIGN(TCWLockGuard); }; class TCRLockGuard { - public: +public: explicit TCRLockGuard(const TCRWLock& lock) : lock_(const_cast(lock)), ret_(OB_SUCCESS), slot_id_(0) { if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.rdlock(INT64_MAX, slot_id_)))) { @@ -333,19 +333,19 @@ class TCRLockGuard { return ret_; } - private: +private: TCRWLock& lock_; int ret_; int64_t slot_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(TCRLockGuard); }; typedef TCRWLock RWLock; #else class RWLock { - public: +public: struct RLockGuard { explicit RLockGuard(RWLock& lock) : lock_(lock) { @@ -469,7 +469,7 @@ class RWLock { return OB_LIKELY(latch_.try_wrlock(latch_id_) == OB_SUCCESS); } - private: +private: ObLatch latch_; uint32_t latch_id_; }; diff --git a/deps/oblib/src/lib/lock/ob_thread_cond.h b/deps/oblib/src/lib/lock/ob_thread_cond.h index b464a59c7..152dc3c2d 100644 --- a/deps/oblib/src/lib/lock/ob_thread_cond.h +++ b/deps/oblib/src/lib/lock/ob_thread_cond.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class ObThreadCond { - public: +public: ObThreadCond(); virtual ~ObThreadCond(); int init(const int32_t event_no); @@ -33,7 +33,7 @@ class ObThreadCond { int signal(); int broadcast(); - private: +private: pthread_mutex_t mutex_; pthread_cond_t cond_; int32_t event_no_; @@ -41,7 +41,7 @@ class ObThreadCond { bool mutex_inited_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObThreadCond); }; diff --git a/deps/oblib/src/lib/lock/tbrwlock.h b/deps/oblib/src/lib/lock/tbrwlock.h index a1257a08c..4626c7c6a 100644 --- a/deps/oblib/src/lib/lock/tbrwlock.h +++ b/deps/oblib/src/lib/lock/tbrwlock.h @@ -23,7 +23,7 @@ enum ELockMode { NO_PRIORITY, WRITE_PRIORITY, READ_PRIORITY }; * @brief Encapsulation of read lock in linux-thread read-write lock */ class CRLock { - public: +public: explicit CRLock(pthread_rwlock_t* lock) : _rlock(lock) {} ~CRLock() @@ -33,7 +33,7 @@ class CRLock { int tryLock() const; int unlock() const; - private: +private: mutable pthread_rwlock_t* _rlock; }; @@ -41,7 +41,7 @@ class CRLock { * @brief Encapsulation of write lock in linux-thread read-write lock */ class CWLock { - public: +public: explicit CWLock(pthread_rwlock_t* lock) : _wlock(lock) {} ~CWLock() @@ -51,12 +51,12 @@ class CWLock { int tryLock() const; int unlock() const; - private: +private: mutable pthread_rwlock_t* _wlock; }; class CRWLock { - public: +public: CRWLock(ELockMode lockMode = NO_PRIORITY); ~CRWLock(); @@ -69,7 +69,7 @@ class CRWLock { return _wlock; } - private: +private: CRLock* _rlock; CWLock* _wlock; pthread_rwlock_t _rwlock; @@ -77,7 +77,7 @@ class CRWLock { template class CLockGuard { - public: +public: CLockGuard(const T& lock, bool block = true) : _lock(lock) { _acquired = !(block ? _lock.lock() : _lock.tryLock()); @@ -94,7 +94,7 @@ class CLockGuard { return _acquired; } - private: +private: const T& _lock; mutable bool _acquired; }; @@ -102,7 +102,7 @@ class CLockGuard { * @brief Helper class for read lock in linux thread lock */ class CRLockGuard { - public: +public: CRLockGuard(const CRWLock& rwlock, bool block = true) : _guard((*rwlock.rlock()), block) {} ~CRLockGuard() @@ -113,7 +113,7 @@ class CRLockGuard { return _guard.acquired(); } - private: +private: CLockGuard _guard; }; @@ -121,7 +121,7 @@ class CRLockGuard { * @brief Helper class for write lock in linux thread lock */ class CWLockGuard { - public: +public: CWLockGuard(const CRWLock& rwlock, bool block = true) : _guard((*rwlock.wlock()), block) {} ~CWLockGuard() @@ -132,7 +132,7 @@ class CWLockGuard { return _guard.acquired(); } - private: +private: CLockGuard _guard; }; } // namespace obsys diff --git a/deps/oblib/src/lib/lock/threadcond.h b/deps/oblib/src/lib/lock/threadcond.h index f236c851e..34d0c9d69 100644 --- a/deps/oblib/src/lib/lock/threadcond.h +++ b/deps/oblib/src/lib/lock/threadcond.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace obsys { class CThreadCond { - public: +public: CThreadCond() { cond_.init(); @@ -54,12 +54,12 @@ class CThreadCond { cond_.broadcast(); } - private: +private: oceanbase::common::ObThreadCond cond_; }; class CCondGuard { - public: +public: explicit CCondGuard(CThreadCond* cond) { cond_ = NULL; @@ -76,7 +76,7 @@ class CCondGuard { } } - private: +private: CThreadCond* cond_; }; diff --git a/deps/oblib/src/lib/lock/threadmutex.h b/deps/oblib/src/lib/lock/threadmutex.h index e29216b34..d462699d5 100644 --- a/deps/oblib/src/lib/lock/threadmutex.h +++ b/deps/oblib/src/lib/lock/threadmutex.h @@ -29,7 +29,7 @@ namespace obsys { */ class CThreadMutex { - public: +public: /* * Constructor */ @@ -75,7 +75,7 @@ class CThreadMutex { pthread_mutex_unlock(&_mutex); } - protected: +protected: pthread_mutex_t _mutex; }; @@ -83,7 +83,7 @@ class CThreadMutex { * @brief Thread guard */ class CThreadGuard { - public: +public: CThreadGuard(CThreadMutex* mutex) { _mutex = NULL; @@ -99,7 +99,7 @@ class CThreadGuard { } } - private: +private: CThreadMutex* _mutex; }; diff --git a/deps/oblib/src/lib/metrics/ob_accumulator.h b/deps/oblib/src/lib/metrics/ob_accumulator.h index 15d8dfb40..4de0ea7d2 100644 --- a/deps/oblib/src/lib/metrics/ob_accumulator.h +++ b/deps/oblib/src/lib/metrics/ob_accumulator.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObAccumulator { - public: +public: ObAccumulator() : freeze_value_(0), tmp_value_(0) {} ~ObAccumulator() @@ -38,7 +38,7 @@ class ObAccumulator { return ATOMIC_LOAD(&freeze_value_); } - private: +private: int64_t freeze_value_; int64_t tmp_value_; }; diff --git a/deps/oblib/src/lib/metrics/ob_counter.h b/deps/oblib/src/lib/metrics/ob_counter.h index 7fd9b1307..6816dd73c 100644 --- a/deps/oblib/src/lib/metrics/ob_counter.h +++ b/deps/oblib/src/lib/metrics/ob_counter.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class ObSimpleCounter { - public: +public: ObSimpleCounter() : value_(0) {} ~ObSimpleCounter() = default; @@ -45,13 +45,13 @@ class ObSimpleCounter { cur_value = ATOMIC_AAF(&value_, delta); return true; } // for DCHash - private: +private: int64_t value_; }; template class ObCounter { - public: +public: ObCounter() { memset(items_, 0, sizeof(items_)); @@ -87,7 +87,7 @@ class ObCounter { return sum; } - private: +private: struct Item { int64_t value_; } __attribute__((aligned(16))); diff --git a/deps/oblib/src/lib/metrics/ob_ema.h b/deps/oblib/src/lib/metrics/ob_ema.h index 783b2fe1e..72324b05f 100644 --- a/deps/oblib/src/lib/metrics/ob_ema.h +++ b/deps/oblib/src/lib/metrics/ob_ema.h @@ -20,7 +20,7 @@ namespace common { // See https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average template class ObExponentialMovingAverage { - public: +public: ObExponentialMovingAverage() : inited_(false), ema_(0.0), uncounted_(0) {} ~ObExponentialMovingAverage() @@ -61,13 +61,13 @@ class ObExponentialMovingAverage { return ATOMIC_LOAD64(&ema_) * static_cast(rate_unit); } - private: +private: // TICK_INTERVAL_IN_USEC is microsecond. // if need per_sec, set rate_unit = PER_SECOND when get_rate static const int64_t TICK_INTERVAL_IN_USEC = TICK_INTERVAL_IN_SEC * 1000000LL; static const double ALPHA; - private: +private: bool inited_; // atomic double ema_; // atomic uint64_t uncounted_; // atomic diff --git a/deps/oblib/src/lib/metrics/ob_ema_v2.h b/deps/oblib/src/lib/metrics/ob_ema_v2.h index 814a38582..98ab74951 100644 --- a/deps/oblib/src/lib/metrics/ob_ema_v2.h +++ b/deps/oblib/src/lib/metrics/ob_ema_v2.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { // See https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average class ObExponentialMovingAverageV2 { - public: +public: ObExponentialMovingAverageV2(const double alpha) : inited_(false), ema_(0.0), alpha_(alpha) {} ~ObExponentialMovingAverageV2() @@ -42,7 +42,7 @@ class ObExponentialMovingAverageV2 { return ATOMIC_LOAD64(&ema_); } - private: +private: bool inited_; // atomic double ema_; // atomic const double alpha_; // const diff --git a/deps/oblib/src/lib/metrics/ob_gauge.h b/deps/oblib/src/lib/metrics/ob_gauge.h index 4fda617e2..1c509ae79 100644 --- a/deps/oblib/src/lib/metrics/ob_gauge.h +++ b/deps/oblib/src/lib/metrics/ob_gauge.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace common { // A gauge just returns a value. class ObGauge { - public: +public: virtual ~ObGauge(){}; virtual int64_t get_value() const = 0; }; diff --git a/deps/oblib/src/lib/metrics/ob_meter.h b/deps/oblib/src/lib/metrics/ob_meter.h index 09de7c18e..f14443766 100644 --- a/deps/oblib/src/lib/metrics/ob_meter.h +++ b/deps/oblib/src/lib/metrics/ob_meter.h @@ -19,10 +19,10 @@ namespace oceanbase { namespace common { // thread-safe class ObMeter { - public: +public: static const int64_t PER_SEC = 1000000LL; // PER SECOND static const int64_t PER_USEC = 1LL; // PER uSECOND - public: +public: ObMeter(); ~ObMeter() {} @@ -32,11 +32,11 @@ class ObMeter { double get_rate(int64_t rate_unit = PER_SEC); uint64_t get_value() const; - private: +private: void tick_if_necessary(); void legacy_tick_if_necessary(); - private: +private: // types and constants // parameters reference http://blog.csdn.net/maray/article/details/73104923 static const int64_t TICK_INTERVAL_IN_SEC = 10 * 60; @@ -46,7 +46,7 @@ class ObMeter { static const int64_t LEGACY_TICK_INTERVAL_IN_SEC = 5; static const int64_t LEGACY_TICK_INTERVAL_IN_USEC = LEGACY_TICK_INTERVAL_IN_SEC * 1000000LL; static const int64_t LEGACY_WINDOW_IN_SEC = 15 * 60; // 15 min - private: +private: uint64_t value_; // atomic int64_t start_ts_; int64_t last_tick_; // atomic diff --git a/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h b/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h index 54b6e6dfe..1768ddeb9 100644 --- a/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h +++ b/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { namespace sqlclient { class MySQLResultWrapper { - public: +public: // see this for template virtual function // http://cxh.me/2014/07/01/nvi-usage-of-virtual-template/ DEFINE_ALLOCATOR_WRAPPER diff --git a/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h b/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h index d5c8dd675..c96715a88 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h +++ b/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h @@ -22,7 +22,7 @@ namespace common { // @note thread-safe template class ObConnectionAllocator { - public: +public: ObConnectionAllocator(); virtual ~ObConnectionAllocator(); @@ -31,12 +31,12 @@ class ObConnectionAllocator { T* get_cached(); int put_cached(T* obj); - private: +private: // disallow copy ObConnectionAllocator(const ObConnectionAllocator& other); ObConnectionAllocator& operator=(const ObConnectionAllocator& other); - private: +private: // data members ObSpinLock lock_; ObPool<> pool_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_client.h b/deps/oblib/src/lib/mysqlclient/ob_isql_client.h index 2807fe1b8..e8a51e83b 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_client.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_client.h @@ -39,7 +39,7 @@ inline bool is_double_row(const int64_t row_count) } class ObISQLClient { - public: +public: class ReadResult; ObISQLClient() : active_(true) @@ -79,7 +79,7 @@ class ObISQLClient { virtual bool is_oracle_mode() const = 0; class ReadResult { - public: + public: const static int64_t BUF_SIZE = 64 * 1024; friend class ObISQLClient; @@ -108,7 +108,7 @@ class ObISQLClient { return common::OB_SUCCESS; } - private: + private: sqlclient::ObISQLResultHandler* result_handler_; char buf_[BUF_SIZE]; }; @@ -123,7 +123,7 @@ class ObISQLClient { } void set_inactive(); - protected: +protected: volatile bool active_; }; diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h b/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h index f75abd537..10b4050ba 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h @@ -32,7 +32,7 @@ class ObISQLResultHandler; // execute in sql engine class ObIExecutor { - public: +public: ObIExecutor() {} virtual ~ObIExecutor() @@ -57,7 +57,7 @@ class ObIExecutor { // SQL client connection interface class ObISQLConnection { - public: +public: ObISQLConnection() : did_no_retry_on_rpc_error_(false), oracle_mode_(false) {} virtual ~ObISQLConnection() @@ -111,7 +111,7 @@ class ObISQLConnection { return common::OB_INVALID_ID; } - protected: +protected: bool did_no_retry_on_rpc_error_; bool oracle_mode_; }; diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_isql_connection_pool.h index 9980dacaf..caf3576f0 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_connection_pool.h @@ -29,7 +29,7 @@ enum ObSQLConnPoolType { }; class ObISQLConnectionPool { - public: +public: ObISQLConnectionPool(){}; virtual ~ObISQLConnectionPool(){}; diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_result_handler.h b/deps/oblib/src/lib/mysqlclient/ob_isql_result_handler.h index ec85f608d..a65949e7c 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_result_handler.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_result_handler.h @@ -20,7 +20,7 @@ namespace sqlclient { class ObMySQLResult; class ObISQLResultHandler { - public: +public: ObISQLResultHandler() {} virtual ~ObISQLResultHandler() diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h index 798fdf21c..4480459e1 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h @@ -29,7 +29,7 @@ class ObMySQLPreparedStatement; class ObMySQLConnection : public ObISQLConnection { friend class ObServerConnectionPool; - public: +public: enum { OB_MYSQL_CONNECTION_ERROR = 1, // OB_MYSQL_CONNECTION_WARN = 2, @@ -37,7 +37,7 @@ class ObMySQLConnection : public ObISQLConnection { }; enum Mode { DEBUG_MODE = 0, MYSQL_MODE = 1, OCEANBASE_MODE = 2 }; - public: +public: ObMySQLConnection(); ~ObMySQLConnection(); int connect(const char* user, const char* pass, const char* db); @@ -103,11 +103,11 @@ class ObMySQLConnection : public ObISQLConnection { // dblink. int connect_dblink(); - private: +private: int switch_tenant(const uint64_t tenant_id); int reset_read_consistency(); - private: +private: ObServerConnectionPool* root_; // each connection belongs to ONE pool MYSQL mysql_; int last_error_code_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h index b14562b16..b74194145 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h @@ -52,7 +52,7 @@ namespace sqlclient { class ObServerConnectionPool; class ObMySQLServerProvider; class ObMySQLConnectionPool : public common::ObTimerTask, public ObISQLConnectionPool { - public: +public: friend class common::ObMySQLProxy; friend class common::ObMySQLProxyUtil; friend class common::ObMySQLTransaction; @@ -63,7 +63,7 @@ class ObMySQLConnectionPool : public common::ObTimerTask, public ObISQLConnectio static const int64_t DEFAULT_TRANSACTION_TIMEOUT_US = 100 * 1000 * 1000; typedef common::ObList ServerList; class ClusterServerList { - public: + public: ClusterServerList() = delete; ClusterServerList(common::ObArenaAllocator& allocator) : cluster_id_(common::OB_INVALID_ID), server_list_(allocator) {} @@ -82,14 +82,14 @@ class ObMySQLConnectionPool : public common::ObTimerTask, public ObISQLConnectio return server_list_; } - private: + private: int64_t cluster_id_; ServerList server_list_; DISALLOW_COPY_AND_ASSIGN(ClusterServerList); }; typedef common::ObList ClusterList; - public: +public: ObMySQLConnectionPool(); ~ObMySQLConnectionPool(); @@ -154,7 +154,7 @@ class ObMySQLConnectionPool : public common::ObTimerTask, public ObISQLConnectio return db_user_; } - protected: +protected: // update interval. // update ms list in backgroud thread and // recycle not-in-use unavaliable ms connections @@ -173,7 +173,7 @@ class ObMySQLConnectionPool : public common::ObTimerTask, public ObISQLConnectio int renew_server_connection_pool(const int64_t cluster_id, common::ObAddr& server); int get_cluster_server_list_(const int64_t cluster_id, ClusterServerList*& cluster_server_list) const; - protected: +protected: static const int64_t OB_MAX_PASS_WORD_LENGTH = 64; static const int MAX_SERVER_GONE_INTERVAL = 1000 * 1000 * 1; // 1 sec @@ -198,13 +198,13 @@ class ObMySQLConnectionPool : public common::ObTimerTask, public ObISQLConnectio class ObDbLinkConnectionPool : public ObMySQLConnectionPool { // dblink. - public: +public: int create_dblink_pool(uint64_t dblink_id, const ObAddr& server, const ObString& db_tenant, const ObString& db_user, const ObString& db_pass, const ObString& db_name); int acquire_dblink(uint64_t dblink_id, ObMySQLConnection*& dblink_conn); int release_dblink(ObMySQLConnection* dblink_conn); - private: +private: int get_dblink_pool(uint64_t dblink_id, ObServerConnectionPool*& dblink_pool); int do_acquire_dblink(uint64_t dblink_id, ObMySQLConnection*& dblink_conn); int try_connect_dblink(ObMySQLConnection* dblink_conn); diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.h index 41e89e32b..43e9d1ebf 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.h @@ -24,7 +24,7 @@ class ObIAllocator; namespace sqlclient { class ObMySQLPreparedStatement; class ObMySQLPreparedParam { - public: +public: explicit ObMySQLPreparedParam(ObMySQLPreparedStatement& stmt); ~ObMySQLPreparedParam(); int init(); @@ -37,7 +37,7 @@ class ObMySQLPreparedParam { int bind_param( const int64_t col_idx, enum_field_types buf_type, char* out_buf, const int64_t buf_len, unsigned long& res_len); - private: +private: ObMySQLPreparedStatement& stmt_; common::ObIAllocator& alloc_; int64_t param_count_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.h index 8165b0192..ff24d4bde 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.h @@ -24,7 +24,7 @@ class ObIAllocator; namespace sqlclient { class ObMySQLPreparedStatement; class ObMySQLPreparedResult { - public: +public: explicit ObMySQLPreparedResult(ObMySQLPreparedStatement& stmt); ~ObMySQLPreparedResult(); int init(); @@ -50,7 +50,7 @@ class ObMySQLPreparedResult { int bind_result( const int64_t col_idx, enum_field_types buf_type, char* out_buf, const int64_t buf_len, unsigned long& res_len); - private: +private: ObMySQLPreparedStatement& stmt_; common::ObIAllocator& alloc_; int64_t result_column_count_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.h index 661e30b1d..7be1f68e5 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace common { namespace sqlclient { class ObMySQLPreparedStatement { - public: +public: ObMySQLPreparedStatement(); ~ObMySQLPreparedStatement(); ObIAllocator& get_allocator(); @@ -65,7 +65,7 @@ class ObMySQLPreparedStatement { */ ObMySQLPreparedResult* execute_query(); - private: +private: ObMySQLConnection* conn_; ObArenaAllocator arena_allocator_; // TODO: used right allocator? ObIAllocator* alloc_; // bind to arena_allocator_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.h index e9c117a5b..d6108ecb3 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.h @@ -28,7 +28,7 @@ class ObISQLConnectionPool; // thread safe sql proxy // TODO : implement retry logic by general method (macros e.t.) class ObCommonSqlProxy : public ObISQLClient { - public: +public: // FIXME : remove this typedef? typedef ReadResult MySQLResult; @@ -71,7 +71,7 @@ class ObCommonSqlProxy : public ObISQLClient { int execute(const uint64_t tenant_id, sqlclient::ObIExecutor& executor); - protected: +protected: int acquire(sqlclient::ObISQLConnection*& conn); int read(sqlclient::ObISQLConnection* conn, ReadResult& result, const uint64_t tenant_id, const char* sql); @@ -81,7 +81,7 @@ class ObCommonSqlProxy : public ObISQLClient { }; class ObMySQLProxy : public ObCommonSqlProxy { - public: +public: virtual bool is_oracle_mode() const override { return false; @@ -89,7 +89,7 @@ class ObMySQLProxy : public ObCommonSqlProxy { }; class ObOracleSqlProxy : public ObCommonSqlProxy { - public: +public: virtual bool is_oracle_mode() const override { return true; @@ -105,7 +105,7 @@ class ObOracleSqlProxy : public ObCommonSqlProxy { }; class ObDbLinkProxy : public ObMySQLProxy { - public: +public: virtual int init(sqlclient::ObDbLinkConnectionPool* pool); int create_dblink_pool(uint64_t dblink_id, const ObAddr& server, const ObString& db_tenant, const ObString& db_user, const ObString& db_pass, const ObString& db_name); @@ -115,7 +115,7 @@ class ObDbLinkProxy : public ObMySQLProxy { int dblink_read(sqlclient::ObMySQLConnection* dblink_conn, ReadResult& result, const char* sql); int rollback(sqlclient::ObMySQLConnection* dblink_conn); - private: +private: int prepare_enviroment(sqlclient::ObMySQLConnection* dblink_conn, int link_type); int execute_init_sql(sqlclient::ObMySQLConnection* dblink_conn); bool is_prepare_env; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.h index d973013f9..bf0f51d95 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.h @@ -20,17 +20,17 @@ class ObISQLConnectionPool; } // mysql lib function utility class class ObMySQLProxyUtil { - public: +public: ObMySQLProxyUtil(); virtual ~ObMySQLProxyUtil(); - public: +public: // init the connection pool int init(sqlclient::ObISQLConnectionPool* pool); // escape the old string convert from to to int escape(const char* from, const uint64_t length, char* to, const uint64_t size); - private: +private: sqlclient::ObISQLConnectionPool* pool_; }; } // namespace common diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_read_context.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_read_context.h index 159ce0c0f..df41e7f62 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_read_context.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_read_context.h @@ -22,7 +22,7 @@ namespace sqlclient { class ObMySQLResult; class ObMySQLReadContext : public ObISQLResultHandler { - public: +public: ObMySQLReadContext() : result_(NULL), stmt_() {} virtual ~ObMySQLReadContext() @@ -33,7 +33,7 @@ class ObMySQLReadContext : public ObISQLResultHandler { return result_; } - public: +public: ObMySQLResult* result_; ObMySQLStatement stmt_; }; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h index ee4850078..64a3f1626 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h @@ -890,7 +890,7 @@ class ObIntervalYMValue; class ObIntervalDSValue; namespace sqlclient { class ObMySQLResult { - public: +public: // see this for template virtual function // http://cxh.me/2014/07/01/nvi-usage-of-virtual-template/ DEFINE_ALLOCATOR_WRAPPER @@ -1032,11 +1032,11 @@ class ObMySQLResult { return NULL; } - protected: +protected: static const int64_t FAKE_TABLE_ID = 1; int varchar2datetime(const ObString& varchar, int64_t& datetime) const; - private: +private: virtual int inner_get_number( const int64_t col_idx, common::number::ObNumber& nmb_val, IAllocator& allocator) const = 0; virtual int inner_get_number( diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.h index 209bee417..7f5769238 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.h @@ -24,7 +24,7 @@ class ObMySQLResultImpl : public ObMySQLResult { friend class ObMySQLResultWriter; friend class ObMySQLResultHeader; - public: +public: explicit ObMySQLResultImpl(ObMySQLStatement& stmt); ~ObMySQLResultImpl(); int init(); @@ -111,7 +111,7 @@ class ObMySQLResultImpl : public ObMySQLResult { int print_info() const; int64_t get_column_count() const; - private: +private: int get_column_index(const char* col_name, int64_t& index) const; int get_special_value(const common::ObString& varchar_val) const; int inner_get_number(const int64_t col_idx, common::number::ObNumber& nmb_val, IAllocator& allocator) const; @@ -125,7 +125,7 @@ class ObMySQLResultImpl : public ObMySQLResult { int inner_get_lob_locator( const char* col_name, common::ObLobLocator*& lob_locator, common::ObIAllocator& allocator) const; - private: +private: ObMySQLStatement& stmt_; MYSQL_RES* result_; MYSQL_ROW cur_row_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_server_provider.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_server_provider.h index efbe8a975..265ad6e7d 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_server_provider.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_server_provider.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { namespace sqlclient { class ObMySQLServerProvider { - public: +public: ObMySQLServerProvider(){}; virtual ~ObMySQLServerProvider(){}; virtual int get_cluster_list(common::ObIArray& cluster_list) = 0; @@ -34,7 +34,7 @@ class ObMySQLServerProvider { return true; } - private: +private: ObMySQLServerProvider(const ObMySQLServerProvider&); ObMySQLServerProvider& operator=(const ObMySQLServerProvider&); }; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.h index 003fa52eb..b106b3683 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.h @@ -21,7 +21,7 @@ namespace sqlclient { class ObMySQLConnection; class ObMySQLStatement { - public: +public: ObMySQLStatement(); ~ObMySQLStatement(); ObMySQLConnection* get_connection(); @@ -54,7 +54,7 @@ class ObMySQLStatement { */ ObMySQLResult* execute_query(); - private: +private: ObMySQLConnection* conn_; ObMySQLResultImpl result_; MYSQL* stmt_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.h index 81e59a01d..fb2cb2078 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.h @@ -28,11 +28,11 @@ class ObISQLConnectionPool; // not thread safe sql transaction execution // use one connection class ObMySQLTransaction : public ObSingleConnectionProxy { - public: +public: ObMySQLTransaction(); virtual ~ObMySQLTransaction(); - public: +public: // start transaction virtual int start(ObISQLClient* proxy, bool with_snapshot = false); // end the transaction @@ -42,11 +42,11 @@ class ObMySQLTransaction : public ObSingleConnectionProxy { return in_trans_; } - protected: +protected: int start_transaction(bool with_snap_shot); int end_transaction(const bool commit); - protected: +protected: int64_t start_time_; bool in_trans_; }; diff --git a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.h index e61d739a5..182a6dfb0 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.h @@ -23,14 +23,14 @@ namespace common { namespace sqlclient { class ObMySQLConnectionPool; class ObServerConnectionPool { - public: +public: ObServerConnectionPool(); ~ObServerConnectionPool(); int acquire(ObMySQLConnection*& connection); int release(ObMySQLConnection* connection, const bool succ); uint64_t get_busy_count(void) const; - public: +public: int init(ObMySQLConnectionPool* root, const common::ObAddr& server, int64_t max_allowed_conn_count); int destroy(); void reset(); @@ -50,7 +50,7 @@ class ObServerConnectionPool { const ObString& db_pass, const ObString& db_name, ObMySQLConnectionPool* root, int64_t max_allowed_conn_count); uint64_t get_dblink_id() const; - private: +private: volatile uint64_t free_conn_count_; volatile uint64_t busy_conn_count_; ObConnectionAllocator connection_pool_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.h b/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.h index e5a053d10..7e92a6714 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.h +++ b/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.h @@ -25,11 +25,11 @@ class ObISQLConnectionPool; // use one connection to execute multiple statements // @note not thread safe class ObSingleConnectionProxy : public ObISQLClient { - public: +public: ObSingleConnectionProxy(); virtual ~ObSingleConnectionProxy(); - public: +public: virtual int escape( const char* from, const int64_t from_size, char* to, const int64_t to_size, int64_t& out_size) override; // %res should be destructed before execute other sql @@ -59,7 +59,7 @@ class ObSingleConnectionProxy : public ObISQLClient { errno_ = common::OB_SUCCESS; } - protected: +protected: void close(); void set_errno(int err) { @@ -70,10 +70,10 @@ class ObSingleConnectionProxy : public ObISQLClient { return errno_; } - public: +public: bool check_inner_stat() const; - private: +private: int errno_; int64_t statement_count_; sqlclient::ObISQLConnection* conn_; diff --git a/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.h index 72cfa9878..80a4faa06 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.h @@ -24,28 +24,28 @@ namespace oceanbase { namespace common { namespace sqlclient { class ObSingleMySQLServerProvider : public ObMySQLServerProvider { - public: +public: ObSingleMySQLServerProvider(); - void init(const ObAddr &server); - virtual int get_cluster_list(common::ObIArray &cluster_list) override; - virtual int get_server(const int64_t cluster_id, const int64_t svr_idx, common::ObAddr &server) override; + void init(const ObAddr& server); + virtual int get_cluster_list(common::ObIArray& cluster_list) override; + virtual int get_server(const int64_t cluster_id, const int64_t svr_idx, common::ObAddr& server) override; virtual int64_t get_cluster_count() const override; virtual int64_t get_server_count() const override; virtual int64_t get_server_count(const int64_t cluster_id) const override; int refresh_server_list(void) override; int prepare_refresh() override; - private: +private: ObAddr server_; }; class ObSingleMySQLConnectionPool : public ObMySQLConnectionPool { - public: +public: ObSingleMySQLConnectionPool(); ~ObSingleMySQLConnectionPool(); int init(const ObAddr& server, const ObConnPoolConfigParam& config); - private: +private: ObSingleMySQLServerProvider provider_; }; } // namespace sqlclient diff --git a/deps/oblib/src/lib/net/ob_addr.h b/deps/oblib/src/lib/net/ob_addr.h index dbd94cb72..5dda5d7b7 100644 --- a/deps/oblib/src/lib/net/ob_addr.h +++ b/deps/oblib/src/lib/net/ob_addr.h @@ -25,7 +25,7 @@ namespace common { class ObAddr { OB_UNIS_VERSION(1); - public: +public: static constexpr int IPV6_LEN = 16; enum VER { IPV4 = 4, IPV6 = 6 }; @@ -119,13 +119,13 @@ class ObAddr { void reset_ipv4_10(int ip = 10); - private: +private: int convert_ipv4_addr(const char* ip); int convert_ipv6_addr(const char* ip); bool set_ipv4_addr(const char* ip, const int32_t port); bool set_ipv6_addr(const char* ip, const int32_t port); - private: +private: VER version_; union { uint32_t v4_; diff --git a/deps/oblib/src/lib/net/tbnetutil.h b/deps/oblib/src/lib/net/tbnetutil.h index b2bfd48a7..a4c3c2aae 100644 --- a/deps/oblib/src/lib/net/tbnetutil.h +++ b/deps/oblib/src/lib/net/tbnetutil.h @@ -47,7 +47,7 @@ struct ipaddr_less { }; class CNetUtil { - public: +public: static int getLocalAddr6(const char* dev_name, char* ipv6, int len); static uint32_t getLocalAddr(const char* dev_name); static bool isLocalAddr(uint32_t ip, bool loopSkip = true); diff --git a/deps/oblib/src/lib/number/ob_number_v2.h b/deps/oblib/src/lib/number/ob_number_v2.h index 6ad38bbf5..46a678c75 100644 --- a/deps/oblib/src/lib/number/ob_number_v2.h +++ b/deps/oblib/src/lib/number/ob_number_v2.h @@ -98,14 +98,14 @@ static_assert(sizeof(ObCompactNumber) == sizeof(uint32_t), "wrong compact number class ObCalcVector; class ObNumber final { class IAllocator { - public: + public: virtual ~IAllocator(){}; virtual uint32_t* alloc(const int64_t num) = 0; virtual uint32_t* alloc(const int64_t num, const lib::ObMemAttr& attr) = 0; }; template class TAllocator : public IAllocator { - public: + public: explicit TAllocator(T& allocator) : allocator_(allocator){}; uint32_t* alloc(const int64_t num) { @@ -116,11 +116,11 @@ class ObNumber final { return (uint32_t*)allocator_.alloc(num, attr); } - private: + private: T& allocator_; }; - public: +public: typedef ObNumberDesc Desc; static const uint64_t BASE = 1000000000; static const uint64_t MAX_VALUED_DIGIT = BASE - 1; @@ -167,7 +167,7 @@ class ObNumber final { static const ObNumber& get_zero(); static const ObNumber& get_pi(); - public: +public: ObNumber() : d_(), digits_(0) { d_.sign_ = POSITIVE; @@ -179,7 +179,7 @@ class ObNumber final { NEED_SERIALIZE_AND_DESERIALIZE; - public: +public: // v1: original edition // v2: algorithmic optimization edition // v3: engineering optimization edition @@ -436,7 +436,7 @@ class ObNumber final { int round_even_number(); int64_t get_scale() const; - protected: +protected: int find_point_range_(const char* str, const int64_t length, int64_t& start_idx, int64_t& floating_point, int64_t& end_idx, bool& negative, int32_t& warning, int16_t* precision, int16_t* scale); int construct_digits_(const char* str, const int64_t start_idx, const int64_t floating_point, const int64_t end_idx, @@ -508,7 +508,7 @@ class ObNumber final { int get_npi_(double n, ObNumber& out, ObIAllocator& alloc, const bool do_rounding = true) const; int simple_factorial_for_sincos_(int64_t start, ObIAllocator& allocator, ObNumber& result) const; - protected: +protected: uint32_t* alloc_(IAllocator& allocator, const int64_t num, const lib::ObMemAttr* attr = NULL); int check_precision_(const int64_t precision, const int64_t scale); int round_scale_(const int64_t scale, const bool using_floating_scale); @@ -543,7 +543,7 @@ class ObNumber final { inline static int exp_check_(const ObNumber::Desc& desc, const bool is_oracle_mode = false) __attribute__((always_inline)); - public: +public: bool is_int64() const; int cast_to_int64(int64_t& value) const; inline int cast_from_int64(const int64_t value, IAllocator& allocator) @@ -551,23 +551,23 @@ class ObNumber final { return from_integer_(value, allocator); } - public: +public: Desc d_; - protected: +protected: uint32_t* digits_; - private: +private: int check_range(bool* is_valid_uint64, bool* is_valid_int64, uint64_t& int_parts, uint64_t& decimal_parts) const; }; //////////////////////////////////////////////////////////////////////////////////////////////////// class StackAllocator { - public: +public: StackAllocator() : is_using_(false){}; - public: +public: uint32_t* alloc(const int64_t num) { uint32_t* ret = NULL; @@ -583,17 +583,17 @@ class StackAllocator { return alloc(num); }; - private: +private: uint32_t buffer_[ObNumber::MAX_STORE_LEN]; bool is_using_; }; class ObIntegerBuilder { - public: +public: ObIntegerBuilder(); ~ObIntegerBuilder(); - public: +public: inline int push(const uint8_t d, const bool reduce_zero); inline int push_digit(const uint32_t d, const bool reduce_zero); inline int64_t get_exp() const; @@ -602,7 +602,7 @@ class ObIntegerBuilder { inline int64_t length() const; inline void reset(); - private: +private: int64_t exp_; int64_t digit_pos_; int64_t digit_idx_; @@ -610,11 +610,11 @@ class ObIntegerBuilder { }; class ObDecimalBuilder { - public: +public: ObDecimalBuilder(); ~ObDecimalBuilder(); - public: +public: inline int push(const uint8_t d, const bool reduce_zero); inline int push_digit(const uint32_t d, const bool reduce_zero); inline int64_t get_exp() const; @@ -623,7 +623,7 @@ class ObDecimalBuilder { inline int64_t length() const; inline void reset(); - private: +private: int64_t exp_; int64_t digit_pos_; int64_t digit_idx_; @@ -636,13 +636,13 @@ enum FmtPosition { }; class ObNumberBuilder { - public: +public: ObNumberBuilder() : number_(), ib_(), db_() {} ~ObNumberBuilder() {} - public: +public: int build(const char* str, int64_t length, int& warning, ObNumberFmtModel* fmt = NULL, int16_t* precision = NULL, int16_t* scale = NULL); int build_v2(const char* str, int64_t length, int& warning, ObNumberFmtModel* fmt = NULL, int16_t* precision = NULL, @@ -651,7 +651,7 @@ class ObNumberBuilder { int64_t get_length() const; void reset(); - private: +private: int find_point_(const char* str, int64_t& length, int64_t& integer_start, int64_t& integer_end, int64_t& decimal_start, bool& negative, bool& integer_zero, bool& decimal_zero, int& warning); int find_point_v2_(const char* str, int64_t& length, int64_t& integer_start, int64_t& integer_end, @@ -695,16 +695,16 @@ class ObNumberBuilder { // @return OB_SUCCESS if succeed, other error code if error occurs. int hex_to_dec_(const char* hex_str, int32_t hex_len, char* dec_str, int32_t& dec_len) const; - public: +public: ObNumber number_; - private: +private: ObIntegerBuilder ib_; ObDecimalBuilder db_; }; class ObDigitIterator final { - public: +public: // A,B.C,D // A--head integer // B--body integer @@ -720,7 +720,7 @@ class ObDigitIterator final { int get_next_digit(uint32_t& digit, bool& from_integer, bool& last_decimal); NextDigitEnum get_next_digit(uint32_t& digit); - private: +private: int64_t iter_idx_; int64_t iter_len_; int64_t iter_exp_; @@ -767,16 +767,16 @@ int ObDigitIterator::get_digit(const int64_t idx, uint32_t& ret_digit) const } class ObCalcVector { - public: +public: ObCalcVector(); ~ObCalcVector(); ObCalcVector(const ObCalcVector& other); ObCalcVector& operator=(const ObCalcVector& other); - public: +public: int init(const uint32_t desc, uint32_t* digits); - public: +public: uint64_t at(const int64_t idx) const; uint64_t base() const; void set_base(const uint64_t base); @@ -790,7 +790,7 @@ class ObCalcVector { int64_t to_string(char* buffer, const int64_t length) const; int normalize(); - private: +private: uint64_t base_; int64_t length_; uint32_t* digits_; @@ -798,7 +798,7 @@ class ObCalcVector { }; class ObTRecover { - public: +public: ObTRecover(ObNumber& orig, int cond, int& observer) : orig_(orig), recover_(orig), cond_(cond), observer_(observer) { memcpy(digits_, orig_.get_digits(), orig_.get_length() * sizeof(uint32_t)); @@ -811,7 +811,7 @@ class ObTRecover { } }; - private: +private: const ObNumber orig_; ObNumber& recover_; uint32_t digits_[ObNumber::MAX_CALC_BYTE_LEN]; @@ -824,7 +824,7 @@ class ObTRecover { class ObDivArray final // small-eidian storage { - public: +public: ObDivArray() : len_(0), zero_cnt_(0) {} @@ -1268,7 +1268,7 @@ class ObDivArray final // small-eidian storage r.div(d, r); } - public: +public: static const int64_t BASE = 1000000000; int32_t len_; @@ -2945,7 +2945,7 @@ class ObNumberCalc { } */ - public: +public: ObNumberCalc(const ObNumber& init_v, common::ObIAllocator& allocator) : last_ret_(common::OB_SUCCESS), allocator_(allocator) { @@ -3012,7 +3012,7 @@ class ObNumberCalc { return last_ret_; } - private: +private: int last_ret_; ObNumber res_; common::ObIAllocator& allocator_; diff --git a/deps/oblib/src/lib/ob_define.h b/deps/oblib/src/lib/ob_define.h index d57498b32..664fde7f8 100644 --- a/deps/oblib/src/lib/ob_define.h +++ b/deps/oblib/src/lib/ob_define.h @@ -1655,7 +1655,7 @@ enum ObModifyQuorumType { }; class ObModifyQuorumTypeChecker { - public: +public: static bool is_valid_type(const ObModifyQuorumType modify_quorum_type) { return modify_quorum_type >= WITH_MODIFY_QUORUM && modify_quorum_type < MAX_MODIFY_QUORUM_TYPE; @@ -1705,7 +1705,7 @@ enum ObReplicaType { }; class ObReplicaTypeCheck { - public: +public: static bool is_replica_type_valid(const int32_t replica_type) { return REPLICA_TYPE_FULL == replica_type || REPLICA_TYPE_LOGONLY == replica_type || @@ -1780,7 +1780,7 @@ class ObReplicaTypeCheck { }; class ObMemstorePercentCheck { - public: +public: static bool is_memstore_percent_valid(const int64_t memstore_percent) { return 0 == memstore_percent || 100 == memstore_percent; @@ -1937,14 +1937,14 @@ struct ObNumberDesc { #define DEFINE_ALLOCATOR_WRAPPER \ class IAllocator { \ - public: \ + public: \ virtual ~IAllocator(){}; \ virtual void* alloc(const int64_t size) = 0; \ virtual void* alloc(const int64_t size, const lib::ObMemAttr& attr) = 0; \ }; \ template \ class TAllocator : public IAllocator { \ - public: \ + public: \ explicit TAllocator(T& allocator) : allocator_(allocator){}; \ void* alloc(const int64_t size) \ { \ @@ -1956,7 +1956,7 @@ struct ObNumberDesc { return alloc(size); \ }; \ \ - private: \ + private: \ T& allocator_; \ }; diff --git a/deps/oblib/src/lib/ob_lib_config.h b/deps/oblib/src/lib/ob_lib_config.h index 6c8c79ab0..47da38c86 100644 --- a/deps/oblib/src/lib/ob_lib_config.h +++ b/deps/oblib/src/lib/ob_lib_config.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace lib { class ObLibConfig { - public: +public: static ObLibConfig& get_instance(); void reload_diagnose_info_config(const bool enable_diagnose_info); void reload_trace_log_config(const bool enable_trace_log); @@ -32,7 +32,7 @@ class ObLibConfig { return enable_trace_log_; } - private: +private: ObLibConfig(); virtual ~ObLibConfig() = default; volatile bool enable_diagnose_info_; diff --git a/deps/oblib/src/lib/ob_replica_define.h b/deps/oblib/src/lib/ob_replica_define.h index 6c8ac5f99..bcd9c2778 100644 --- a/deps/oblib/src/lib/ob_replica_define.h +++ b/deps/oblib/src/lib/ob_replica_define.h @@ -24,7 +24,7 @@ namespace common { class ObReplicaProperty { OB_UNIS_VERSION(1); - public: +public: ObReplicaProperty() : memstore_percent_(100), reserved_(0) {} @@ -59,7 +59,7 @@ class ObReplicaProperty { TO_STRING_KV(K(memstore_percent_)); - private: +private: union { struct { uint64_t memstore_percent_ : 7; // 0-100 diff --git a/deps/oblib/src/lib/ob_running_mode.h b/deps/oblib/src/lib/ob_running_mode.h index f5841a9d4..a77141880 100644 --- a/deps/oblib/src/lib/ob_running_mode.h +++ b/deps/oblib/src/lib/ob_running_mode.h @@ -22,7 +22,7 @@ struct ObRunningModeConfig { bool mini_mode_ = false; static ObRunningModeConfig& instance(); - private: +private: ObRunningModeConfig() = default; }; diff --git a/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h b/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h index bc08c6052..0fd2f57cb 100644 --- a/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h +++ b/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h @@ -115,7 +115,7 @@ class ObObjFreeList { friend class ObObjFreeListList; friend struct ObThreadCache; - public: +public: ObObjFreeList(); ~ObObjFreeList() { @@ -168,7 +168,7 @@ class ObObjFreeList { SLINK(ObObjFreeList, link_); - private: +private: void show_info(const char* file, const int line, const char* tag, ObThreadCache* thread_cache); ObChunkInfo*& get_chunk_info(void* item); #ifdef DOUBLE_FREE_CHECK @@ -242,7 +242,7 @@ class ObObjFreeList { return ret; } - private: +private: static const int64_t THREAD_CACHE_TOTAL_SIZE; static const int64_t THREAD_CACHE_LOW_MARK; @@ -295,7 +295,7 @@ class ObObjFreeList { // Allocator for fixed size memory blocks. class ObFixedMemAllocator { - public: +public: ObFixedMemAllocator() { fl_ = NULL; @@ -338,7 +338,7 @@ class ObFixedMemAllocator { } } - protected: +protected: ObObjFreeList* fl_; DISALLOW_COPY_AND_ASSIGN(ObFixedMemAllocator); @@ -349,7 +349,7 @@ struct __is_default_constructible__; template <> struct __is_default_constructible__ { - protected: +protected: // Put base typedefs here to avoid pollution struct twoc { char a, b; @@ -359,7 +359,7 @@ struct __is_default_constructible__ { typedef char type; }; - public: +public: static bool const value = false; }; @@ -370,13 +370,13 @@ struct __is_default_constructible__<>::test { template struct __is_default_constructible__ : __is_default_constructible__<> { - private: +private: template static typename test::type sfinae(U*); template static char sfinae(...); - public: +public: static bool const value = sizeof(sfinae(0)) > 1; }; @@ -415,7 +415,7 @@ struct ObClassConstructor { // copied onto the new objects. This is done for performance reasons. template class ObClassAllocator : public ObFixedMemAllocator { - public: +public: ObClassAllocator() { fl_ = NULL; @@ -488,11 +488,11 @@ class ObClassAllocator : public ObFixedMemAllocator { free(reinterpret_cast(ptr)); } - protected: +protected: static volatile int64_t once_; // for creating singleton instance static volatile ObClassAllocator* instance_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObClassAllocator); }; @@ -503,7 +503,7 @@ class ObClassAllocator : public ObFixedMemAllocator { // need an especial allocator to allocate themself. template class ObMetaAllocator : public ObFixedMemAllocator { - public: +public: // Create a new class specific ClassAllocator. // @param mod allocate mode. explicit ObMetaAllocator(const lib::ObLabel& label) @@ -569,7 +569,7 @@ class ObMetaAllocator : public ObFixedMemAllocator { free(reinterpret_cast(ptr)); } - private: +private: void* free_list_; PageArena allocator_; ::ObMutex0 allocator_lock_; @@ -580,7 +580,7 @@ class ObMetaAllocator : public ObFixedMemAllocator { class ObObjFreeListList { friend class ObObjFreeList; - public: +public: static const int64_t MAX_NUM_FREELIST; static pthread_key_t objpool_key_; @@ -630,7 +630,7 @@ class ObObjFreeListList { void snap_baseline(); int64_t to_string(char* buf, const int64_t len) const; - private: +private: int init() { int ret = OB_SUCCESS; @@ -651,7 +651,7 @@ class ObObjFreeListList { return ret; } - private: +private: static volatile int64_t once_; // for creating singleton instance ObObjFreeListList(); diff --git a/deps/oblib/src/lib/objectpool/ob_global_factory.h b/deps/oblib/src/lib/objectpool/ob_global_factory.h index c2e7dd377..4071bb555 100644 --- a/deps/oblib/src/lib/objectpool/ob_global_factory.h +++ b/deps/oblib/src/lib/objectpool/ob_global_factory.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObTCBlock; class ObTCBlock : public common::ObDLinkBase { - public: +public: static ObTCBlock* new_block(int32_t obj_size, const lib::ObLabel& label); static void delete_block(ObTCBlock* blk); static ObTCBlock* get_block_by_obj(void* obj); @@ -44,7 +44,7 @@ class ObTCBlock : public common::ObDLinkBase { } static int32_t get_obj_num_by_obj_size(int32_t obj_size); - private: +private: explicit ObTCBlock(int32_t obj_size); ~ObTCBlock(){}; struct FreeNode { @@ -55,12 +55,12 @@ class ObTCBlock : public common::ObDLinkBase { static int32_t get_obj_num_by_aligned_obj_size(int32_t aligned_obj_size); static int32_t get_aligned_obj_size(int32_t obj_size); - private: +private: static const int64_t BLOCK_SIZE = OB_MALLOC_BIG_BLOCK_SIZE; // ~2MB static const uint32_t OBJ_SIZE_ALIGN_SHIFT = sizeof(void*); static const uint32_t OBJ_SIZE_ALIGN_MASK = (~0U) << OBJ_SIZE_ALIGN_SHIFT; - private: +private: int32_t obj_size_; int32_t in_use_count_; FreeNode* freelist_; @@ -206,7 +206,7 @@ template class ObGlobalFreeList { typedef typename ObGlobalFactory::create_method_t create_method_t; - public: +public: ObGlobalFreeList() : lock_(), next_cache_line_(0), objs_cache_(), empty_blocks_(), nonempty_blocks_() {} virtual ~ObGlobalFreeList() @@ -280,11 +280,11 @@ class ObGlobalFreeList { } } - private: +private: // types and constants static const int64_t CACHE_SIZE = 64; - private: +private: // function members void release_objs(common::ObDList& range) { @@ -382,7 +382,7 @@ class ObGlobalFreeList { return ret; } - private: +private: // data members ObRecursiveMutex lock_; int32_t next_cache_line_; @@ -391,13 +391,13 @@ class ObGlobalFreeList { common::ObDList empty_blocks_; common::ObDList nonempty_blocks_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGlobalFreeList); }; //////////////////////////////////////////////////////////////// template class ObGlobalFactory { - public: +public: typedef T* (*create_method_t)(void* ptr); static ObGlobalFactory* get_instance(); @@ -419,12 +419,12 @@ class ObGlobalFactory { void stat(); - private: +private: // types and constants typedef ObGlobalFactory self_t; typedef ObGlobalFreeList freelist_t; - private: +private: // function members ObGlobalFactory() { @@ -434,7 +434,7 @@ class ObGlobalFactory { }; virtual ~ObGlobalFactory(){}; - private: +private: // static members static self_t* INSTANCE; // data members @@ -443,7 +443,7 @@ class ObGlobalFactory { int32_t obj_size_[MAX_CLASS_NUM]; int32_t batch_count_[MAX_CLASS_NUM]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGlobalFactory); }; diff --git a/deps/oblib/src/lib/objectpool/ob_pool.h b/deps/oblib/src/lib/objectpool/ob_pool.h index b80d5fc20..efcda4521 100644 --- a/deps/oblib/src/lib/objectpool/ob_pool.h +++ b/deps/oblib/src/lib/objectpool/ob_pool.h @@ -28,7 +28,7 @@ namespace common { */ template class ObPool { - public: +public: ObPool(int64_t obj_size, int64_t block_size = common::OB_MALLOC_NORMAL_BLOCK_SIZE, const BlockAllocatorT& alloc = BlockAllocatorT(ObModIds::OB_POOL)); virtual ~ObPool(); @@ -53,12 +53,12 @@ class ObPool { } int mprotect_mem_pool(int prot); - private: +private: void* freelist_pop(); void freelist_push(void* obj); void alloc_new_block(); - private: +private: struct FreeNode { FreeNode* next_; }; @@ -66,7 +66,7 @@ class ObPool { BlockHeader* next_; }; - private: +private: // data members int64_t obj_size_; int64_t block_size_; @@ -78,7 +78,7 @@ class ObPool { BlockAllocatorT block_allocator_; LockT lock_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPool); }; @@ -108,7 +108,7 @@ typedef ObPool ObLockedPool; // A small block allocator which split the block allocated by the BlockAllocator into small blocks template class ObSmallBlockAllocator : public ObIAllocator { - public: +public: ObSmallBlockAllocator( int64_t small_block_size, int64_t block_size, const BlockAllocatorT& alloc = BlockAllocatorT(ObModIds::OB_POOL)) : block_pool_(small_block_size, block_size, alloc) @@ -156,11 +156,11 @@ class ObSmallBlockAllocator : public ObIAllocator { block_pool_.reset(); } - private: +private: // data members ObPool block_pool_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSmallBlockAllocator); }; diff --git a/deps/oblib/src/lib/objectpool/ob_resource_pool.h b/deps/oblib/src/lib/objectpool/ob_resource_pool.h index c13f1fc74..2ba677ad8 100644 --- a/deps/oblib/src/lib/objectpool/ob_resource_pool.h +++ b/deps/oblib/src/lib/objectpool/ob_resource_pool.h @@ -74,7 +74,7 @@ class ObResourcePool { }; typedef common::ObFixedQueue NodeQueue; - public: +public: ObResourcePool() : inner_allocated_num_(0), inner_used_num_(0), @@ -115,7 +115,7 @@ class ObResourcePool { } }; - public: +public: T* alloc() { T* ret = NULL; @@ -165,7 +165,7 @@ class ObResourcePool { return free_list_.get_total(); } - private: +private: Node* alloc_node_() { Node* ret = NULL; @@ -233,7 +233,7 @@ class ObResourcePool { } } - private: +private: common::ObFIFOAllocator allocator_; volatile int64_t inner_allocated_num_; volatile int64_t inner_used_num_; diff --git a/deps/oblib/src/lib/objectpool/ob_server_object_pool.h b/deps/oblib/src/lib/objectpool/ob_server_object_pool.h index 4530f11cd..3057ea07d 100644 --- a/deps/oblib/src/lib/objectpool/ob_server_object_pool.h +++ b/deps/oblib/src/lib/objectpool/ob_server_object_pool.h @@ -76,9 +76,9 @@ struct ObPoolArenaHead { typedef ObCacheLineSegregatedArray ObPoolArenaArray; class ObServerObjectPoolRegistry { - public: +public: class ArenaIterator { - public: + public: bool is_end() { return pool_idx_ >= ObServerObjectPoolRegistry::pool_num_; @@ -139,15 +139,15 @@ class ObServerObjectPoolRegistry { return ret; } - public: + public: TO_STRING_KV(K_(pool_idx), K_(arena_idx)); - private: + private: int64_t pool_idx_; int64_t arena_idx_; }; - public: +public: static int alloc_iterator(ArenaIterator& iter) { int ret = OB_SUCCESS; @@ -180,7 +180,7 @@ class ObServerObjectPoolRegistry { return ret; } - private: +private: struct PoolPair { const char* type_name; ObPoolArenaArray* array; @@ -197,7 +197,7 @@ class ObServerObjectPoolRegistry { */ template class ObServerObjectPool { - public: +public: static ObServerObjectPool& get_instance() { static ObServerObjectPool instance_; @@ -280,7 +280,7 @@ class ObServerObjectPool { } } - private: +private: /** * Roughly allocate 16 available objects to each entry during Pool construction * The memory is directly ob_malloc out of the total size at one time @@ -346,7 +346,7 @@ class ObServerObjectPool { ~ObServerObjectPool() {} - private: +private: struct Meta { Meta* next; int64_t arena_id; diff --git a/deps/oblib/src/lib/objectpool/ob_small_obj_pool.h b/deps/oblib/src/lib/objectpool/ob_small_obj_pool.h index 9484a5f3d..0a41f9024 100644 --- a/deps/oblib/src/lib/objectpool/ob_small_obj_pool.h +++ b/deps/oblib/src/lib/objectpool/ob_small_obj_pool.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { template class ObSmallObjPool { - public: +public: struct ObjItem { enum { SRC_UNKNOWN = 0, // Fixed allocation of elements, not released @@ -41,11 +41,11 @@ class ObSmallObjPool { static const int64_t DEFAULT_FIXED_COUNT = 1024; - public: +public: ObSmallObjPool(); virtual ~ObSmallObjPool(); - public: +public: int alloc(T*& obj); int free(T* obj); int64_t get_free_count() const @@ -61,15 +61,15 @@ class ObSmallObjPool { return fixed_count_; } - public: +public: int init(const int64_t fixed_count = DEFAULT_FIXED_COUNT, const lib::ObLabel& label = ObModIds::OB_SMALL_OBJ_POOL, const uint64_t tenant_id = OB_SERVER_TENANT_ID, const int64_t block_size = OB_MALLOC_NORMAL_BLOCK_SIZE); void destroy(); - private: +private: int alloc_obj_(T*& obj); - private: +private: bool inited_; int64_t fixed_count_; int64_t free_count_; @@ -77,7 +77,7 @@ class ObSmallObjPool { ObFixedQueue free_list_; ObSmallAllocator allocator_; // Obj allocator - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSmallObjPool); }; diff --git a/deps/oblib/src/lib/objectpool/ob_tc_factory.h b/deps/oblib/src/lib/objectpool/ob_tc_factory.h index 6928af275..7c99ada03 100644 --- a/deps/oblib/src/lib/objectpool/ob_tc_factory.h +++ b/deps/oblib/src/lib/objectpool/ob_tc_factory.h @@ -21,7 +21,7 @@ namespace common { // T should be a derived class of common::DLink template class ObTCFreeList { - public: +public: ObTCFreeList() : magic_(0xFBEE1127), max_length_(1), low_water_(0), overlimit_times_(0), list_() {} virtual ~ObTCFreeList() @@ -99,7 +99,7 @@ class ObTCFreeList { ++overlimit_times_; } - private: +private: // data members int32_t magic_; int32_t max_length_; @@ -107,7 +107,7 @@ class ObTCFreeList { int32_t overlimit_times_; common::ObDList list_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTCFreeList); }; @@ -131,7 +131,7 @@ void ob_tc_factory_callback_on_put(T* obj, BoolType) template class ObTCFactory { - public: +public: static ObTCFactory* get_instance(); T* get(int32_t type_id, const uint64_t tenant_id = OB_SERVER_TENANT_ID); @@ -143,28 +143,28 @@ class ObTCFactory { mem_limit_ = mem_limit; } - public: +public: // function members ObTCFactory(); virtual ~ObTCFactory() {} - private: +private: // types and constants typedef ObTCFactory self_t; typedef ObGlobalFactory global_factory_t; typedef ObTCFreeList freelist_t; static const int32_t MAX_OVERLIMIT_TIMES = 3; - private: +private: T* get_from_global_factory(int32_t type_id, int32_t obj_size); void list_too_long(freelist_t& list, int32_t type_id, int32_t obj_size); void garbage_collect(); - private: +private: static volatile self_t* TC_FACTORY_LIST_HEAD; - private: +private: // data members freelist_t freelists_[MAX_CLASS_NUM]; int64_t mem_size_; @@ -173,7 +173,7 @@ class ObTCFactory { volatile self_t* next_; int64_t mem_limit_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTCFactory); }; diff --git a/deps/oblib/src/lib/oblog/ob_async_log_struct.h b/deps/oblib/src/lib/oblog/ob_async_log_struct.h index f341aeace..6ff2f86f4 100644 --- a/deps/oblib/src/lib/oblog/ob_async_log_struct.h +++ b/deps/oblib/src/lib/oblog/ob_async_log_struct.h @@ -37,7 +37,7 @@ enum ObPLogFDType { // program log class ObPLogItem : public ObIBaseLogItem { - public: +public: ObPLogItem(); virtual ~ObPLogItem() {} @@ -141,7 +141,7 @@ class ObPLogItem : public ObIBaseLogItem { } void deep_copy_header_only(const ObPLogItem& other); - private: +private: ObPLogFDType fd_type_; int32_t log_level_; int32_t tl_type_; @@ -153,12 +153,12 @@ class ObPLogItem : public ObIBaseLogItem { int64_t pos_; char buf_[0]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPLogItem); }; class ObPLogFileStruct { - public: +public: ObPLogFileStruct(); virtual ~ObPLogFileStruct() { @@ -177,7 +177,7 @@ class ObPLogFileStruct { return write_size_; } - public: +public: static const int32_t MAX_LOG_FILE_NAME_SIZE = 256; static const mode_t LOG_FILE_MODE = 0644; diff --git a/deps/oblib/src/lib/oblog/ob_base_log_buffer.h b/deps/oblib/src/lib/oblog/ob_base_log_buffer.h index 11f0bb761..2ea2d280d 100644 --- a/deps/oblib/src/lib/oblog/ob_base_log_buffer.h +++ b/deps/oblib/src/lib/oblog/ob_base_log_buffer.h @@ -84,7 +84,7 @@ struct ObBaseLogBufferCtrl { }; class ObBaseLogBufferMgr { - public: +public: static ObBaseLogBufferMgr& get_instance(); void destroy(); /** @@ -94,7 +94,7 @@ class ObBaseLogBufferMgr { */ int get_buffer(const char* buf_file_path, ObBaseLogBufferCtrl*& log_ctrl); - private: +private: ObBaseLogBufferMgr(); virtual ~ObBaseLogBufferMgr(); int get_abs_dir(const char* log_dir, const char*& abs_log_dir); diff --git a/deps/oblib/src/lib/oblog/ob_base_log_writer.h b/deps/oblib/src/lib/oblog/ob_base_log_writer.h index 3d46365bb..b387daac5 100644 --- a/deps/oblib/src/lib/oblog/ob_base_log_writer.h +++ b/deps/oblib/src/lib/oblog/ob_base_log_writer.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class ObIBaseLogItem { - public: +public: ObIBaseLogItem() {} virtual ~ObIBaseLogItem() @@ -59,7 +59,7 @@ struct ObBaseLogWriterCfg { }; class ObBaseLogWriter { - public: +public: ObBaseLogWriter(); virtual ~ObBaseLogWriter(); virtual int init(const ObBaseLogWriterCfg& log_cfg); @@ -89,16 +89,16 @@ class ObBaseLogWriter { return log_item_push_idx_ - log_item_pop_idx_; } - protected: +protected: virtual void process_log_items(ObIBaseLogItem** items, const int64_t item_cnt, int64_t& finish_cnt) = 0; - private: +private: static void* flush_log_thread(void* arg); void flush_log(); bool need_flush(); - private: +private: static const uint64_t DEFAULT_LOG_APPEND_TIMEOUT_US = 100; static const uint64_t MAX_STOP_WAIT_TIME_US = 1000000; bool is_inited_; @@ -106,7 +106,7 @@ class ObBaseLogWriter { ObBaseLogWriterCfg log_cfg_; pthread_t flush_tid_; - protected: +protected: // async log queue ObIBaseLogItem** log_items_; ObIBaseLogItem** process_items_; diff --git a/deps/oblib/src/lib/oblog/ob_log.h b/deps/oblib/src/lib/oblog/ob_log.h index 00f541df4..1e1c2b2b6 100644 --- a/deps/oblib/src/lib/oblog/ob_log.h +++ b/deps/oblib/src/lib/oblog/ob_log.h @@ -255,7 +255,7 @@ struct ObLogIdLevelMap { //@class ObLogIdLevelMap //@brief stroe the ID of each par-module and sub-module. The key is module's name. class ObLogNameIdMap { - public: +public: static const uint64_t MAX_PAR_MOD_SIZE = OB_LOG_MAX_PAR_MOD_SIZE; static const uint64_t MAX_SUB_MOD_SIZE = OB_LOG_MAX_SUB_MOD_SIZE; @@ -276,7 +276,7 @@ class ObLogNameIdMap { //@brief Get sub-module's name by module's ID. int get_sub_mod_name(const uint64_t par_mod_id, const uint64_t sub_mod_id, const char*& mod_name) const; - private: +private: // name_id_map_[i][0] par-module's name, name_id_map_[i][i](i>1) sub-module's name const char* name_id_map_[MAX_PAR_MOD_SIZE][MAX_SUB_MOD_SIZE + 1]; }; @@ -289,7 +289,7 @@ int process_thread_log_id_level_map(const char* str, const int32_t str_length); //@class ObThreadLogLevelUtils class ObThreadLogLevelUtils { - public: +public: //@brief Set pointer to default value NULL. static void init(); //@brief Set the pointer to the session's id_level_map. @@ -312,7 +312,7 @@ class ObThreadLogLevelUtils { }; class ObThreadFlags { - public: +public: enum { RS_FLAG = 0, }; @@ -362,7 +362,7 @@ class ObThreadFlags { }; class ObRSThreadFlag { - public: +public: ObRSThreadFlag() { ObThreadFlags::set_rs_flag(); @@ -385,7 +385,7 @@ struct ObPLogWriterCfg : public ObBaseLogWriterCfg { }; class ObBasebLogPrint { - public: +public: ObBasebLogPrint() {} virtual ~ObBasebLogPrint() @@ -402,10 +402,10 @@ class ObBasebLogPrint { // This class is changed from the class 'CLogger' in tblog.h which was written by the God // named DuoLong. class ObLogger : public ObBaseLogWriter { - private: +private: static constexpr int LOG_ITEM_SIZE = sizeof(ObPLogItem); - public: +public: static const int64_t DEFAULT_MAX_FILE_SIZE = 256 * 1024 * 1024; // default max log file size // check whether disk storing log-file has no space every 2s // Only max_file_size_ > 0, this is effective. @@ -457,7 +457,7 @@ class ObLogger : public ObBaseLogWriter { char file_name_[ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE]; }; - private: +private: struct LogBuffer { LogBuffer() : pos_(0), trace_mode_(false) { @@ -517,16 +517,16 @@ class ObLogger : public ObBaseLogWriter { int8_t level_; }; - public: +public: ObLogger(); virtual ~ObLogger(); virtual int init(const ObBaseLogWriterCfg& log_cfg); virtual void destroy(); - protected: +protected: virtual void process_log_items(ObIBaseLogItem** items, const int64_t item_cnt, int64_t& finish_cnt); - public: +public: bool is_async_log_used() const { return (enable_async_log() && OB_LIKELY(is_inited()) && !has_stoped()); @@ -897,7 +897,7 @@ class ObLogger : public ObBaseLogWriter { return guard; } - private: +private: //@brief If version <= 0, return true. // If version > 0, return version > level_version_ and if true, update level_version_. bool check_and_set_level_version(int64_t version); @@ -964,7 +964,7 @@ class ObLogger : public ObBaseLogWriter { void free_log_item(ObPLogItem* log_item); void inc_dropped_log_count(const int32_t level); - private: +private: static const char* const errstr_[]; // default log rate limiter if there's no tl_log_limiter static ::oceanbase::lib::ObRateLimiter* default_log_limiter_; @@ -1031,7 +1031,7 @@ inline ObLogger& ObLogger::get_logger() } class ObLoggerTraceMode { - public: +public: ObLoggerTraceMode() { OB_LOGGER.set_trace_mode(true); diff --git a/deps/oblib/src/lib/oblog/ob_trace_log.h b/deps/oblib/src/lib/oblog/ob_trace_log.h index a71f757bd..190698f67 100644 --- a/deps/oblib/src/lib/oblog/ob_trace_log.h +++ b/deps/oblib/src/lib/oblog/ob_trace_log.h @@ -88,7 +88,7 @@ namespace common { class ObTraceLogConfig { static const char* const LOG_LEVEL_ENV_KEY; - public: +public: static int32_t set_log_level(const char* log_level_str); static int32_t set_log_level(const char* log_level_str, volatile int& log_level_); inline static int32_t get_log_level() @@ -103,7 +103,7 @@ class ObTraceLogConfig { static int32_t up_log_level(); static int32_t down_log_level(); - private: +private: static const char* const level_strs_[]; static volatile int log_level_; static bool got_env_; diff --git a/deps/oblib/src/lib/oblog/ob_warning_buffer.h b/deps/oblib/src/lib/oblog/ob_warning_buffer.h index 04df29dda..0bc0defd4 100644 --- a/deps/oblib/src/lib/oblog/ob_warning_buffer.h +++ b/deps/oblib/src/lib/oblog/ob_warning_buffer.h @@ -30,11 +30,11 @@ namespace oceanbase { namespace common { // one global error message buffer and multi global warning buffers class ObWarningBuffer { - public: +public: struct WarningItem final { OB_UNIS_VERSION(1); - public: + public: WarningItem() : timestamp_(0), log_level_(ObLogger::USER_WARN), line_no_(0), code_(OB_MAX_ERROR_CODE), column_no_(0) { msg_[0] = '\0'; @@ -94,10 +94,10 @@ class ObWarningBuffer { TO_STRING_KV(K_(msg), K_(code)); }; - private: +private: static constexpr int64_t ARRAY_BLOCK_SIZE = sizeof(WarningItem) * 2; - public: +public: ObWarningBuffer() : item_(ARRAY_BLOCK_SIZE), append_idx_(0), total_warning_count_(0), error_ret_(OB_SUCCESS) { item_.set_label(ObModIds::OB_SQL_SESSION_WARNING_BUFFER); @@ -180,10 +180,10 @@ class ObWarningBuffer { */ inline const ObWarningBuffer::WarningItem* get_warning_item(const uint32_t idx) const; - private: +private: inline void append_msg(ObLogger::UserMsgLevel msg_level, const char* str, int code); - private: +private: // const define static const uint32_t MAX_BUFFER_SIZE = 64; static const uint32_t DEFAULT_BUFFER_SIZE = 4; diff --git a/deps/oblib/src/lib/profile/ob_atomic_event.h b/deps/oblib/src/lib/profile/ob_atomic_event.h index fa2d7e47f..6bcf0a19b 100644 --- a/deps/oblib/src/lib/profile/ob_atomic_event.h +++ b/deps/oblib/src/lib/profile/ob_atomic_event.h @@ -56,7 +56,7 @@ struct ObAtomicOpEvent { }; class ObAtomicOpEventRecorder : public ObSeqEventRecorder { - public: +public: ObAtomicOpEventRecorder() : sampling_counter_(0), cat_id_(0) { STATIC_ASSERT(sizeof(ObAtomicOpEvent) == 24, "sizeof(ObAtomicOpEvent)=24"); @@ -88,14 +88,14 @@ class ObAtomicOpEventRecorder : public ObSeqEventRecorder { - public: +public: ObPerfEventRecorder() : sampling_counter_(0), cat_id_(0) { STATIC_ASSERT(sizeof(ObTimestampEvent) == 16, "sizeof(ObTimestampEvent)=16"); @@ -78,7 +78,7 @@ class ObPerfEventRecorder : public ObSeqEventRecorder return cat_id_; } - private: +private: int64_t sampling_counter_; uint64_t cat_id_; // category id }; @@ -90,7 +90,7 @@ inline ObPerfEventRecorder* get_perf_recorder() // binary output of perf data class ObPerfWriter { - public: +public: ObPerfWriter() : fd_(-1) {} ~ObPerfWriter() @@ -106,10 +106,10 @@ class ObPerfWriter { return fd_ != -1; } - public: +public: static char PERF_MAGIC[8]; - private: +private: int fd_; }; // get the global perf_writer @@ -125,7 +125,7 @@ inline ObPerfWriter* get_perf_writer() // binary input of perf data class ObPerfReader { - public: +public: ObPerfReader() : fd_(-1) {} ~ObPerfReader() @@ -137,7 +137,7 @@ class ObPerfReader { int close(); int read(ObPerfEventRecorder& rec); - private: +private: int fd_; }; diff --git a/deps/oblib/src/lib/profile/ob_profile_log.h b/deps/oblib/src/lib/profile/ob_profile_log.h index e64534640..d3c944313 100644 --- a/deps/oblib/src/lib/profile/ob_profile_log.h +++ b/deps/oblib/src/lib/profile/ob_profile_log.h @@ -52,7 +52,7 @@ inline uint32_t& get_chid() // Print ip, port, seq, chid, default class ObProfileLogger { - public: +public: enum LogLevel { INFO = 0, DEBUG }; ~ObProfileLogger(); int printlog(LogLevel level, const char* file, int line, const char* function, pthread_t tid, const char* fmt, ...); @@ -68,7 +68,7 @@ class ObProfileLogger { void setFileName(const char* log_filename); int init(); - private: +private: static const char* const errmsg_[2]; static LogLevel log_levels_[2]; static ObProfileLogger* logger_; @@ -77,7 +77,7 @@ class ObProfileLogger { LogLevel log_level_; int log_fd_; - private: +private: ObProfileLogger(); DISALLOW_COPY_AND_ASSIGN(ObProfileLogger); }; diff --git a/deps/oblib/src/lib/profile/ob_trace_id.h b/deps/oblib/src/lib/profile/ob_trace_id.h index 995c59ca5..040210df5 100644 --- a/deps/oblib/src/lib/profile/ob_trace_id.h +++ b/deps/oblib/src/lib/profile/ob_trace_id.h @@ -21,15 +21,15 @@ namespace common { #define TRACE_ID_FORMAT "Y%lX-%016lX" struct ObCurTraceId { class Guard { - public: + public: explicit Guard(const ObAddr& addr); ~Guard(); - private: + private: bool need_reset_; }; class SeqGenerator { - public: + public: enum { BATCH = 1 << 20 }; static uint64_t gen_seq() { @@ -44,7 +44,7 @@ struct ObCurTraceId { class TraceId { OB_UNIS_VERSION(1); - public: + public: inline TraceId() { uval_[0] = 0; @@ -130,7 +130,7 @@ struct ObCurTraceId { return 0 != id_.is_user_request_; } - private: + private: union { struct { uint32_t ip_ : 32; diff --git a/deps/oblib/src/lib/profile/ob_trace_id_adaptor.h b/deps/oblib/src/lib/profile/ob_trace_id_adaptor.h index 2f0357d55..ffeee36d8 100644 --- a/deps/oblib/src/lib/profile/ob_trace_id_adaptor.h +++ b/deps/oblib/src/lib/profile/ob_trace_id_adaptor.h @@ -22,7 +22,7 @@ namespace common { class ObTraceIdAdaptor { OB_UNIS_VERSION(1); - public: +public: ObTraceIdAdaptor() { reset(); @@ -41,7 +41,7 @@ class ObTraceIdAdaptor { bool operator==(const ObTraceIdAdaptor& other) const; ObTraceIdAdaptor& operator=(const ObTraceIdAdaptor& other); - private: +private: uint64_t uval_[2]; }; diff --git a/deps/oblib/src/lib/ptr/ob_ptr.h b/deps/oblib/src/lib/ptr/ob_ptr.h index 0b145349b..8827eadd6 100644 --- a/deps/oblib/src/lib/ptr/ob_ptr.h +++ b/deps/oblib/src/lib/ptr/ob_ptr.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObRefCount { - public: +public: ObRefCount() : ref_count_(0) {} virtual ~ObRefCount() @@ -44,7 +44,7 @@ class ObRefCount { }; class ObForceVFPTToTop { - public: +public: ObForceVFPTToTop() {} virtual ~ObForceVFPTToTop() @@ -54,7 +54,7 @@ class ObForceVFPTToTop { // class ObRefCountObj // prototypical class for reference counting class ObRefCountObj : public ObForceVFPTToTop { - public: +public: ObRefCountObj() : refcount_(0) {} virtual ~ObRefCountObj() @@ -103,7 +103,7 @@ inline int64_t ObRefCountObj::refcount() const // class ObPtr template class ObPtr { - public: +public: explicit ObPtr(T* p = NULL); ObPtr(const ObPtr&); ~ObPtr(); diff --git a/deps/oblib/src/lib/queue/ob_co_seq_queue.h b/deps/oblib/src/lib/queue/ob_co_seq_queue.h index 0d86e33ea..338a15118 100644 --- a/deps/oblib/src/lib/queue/ob_co_seq_queue.h +++ b/deps/oblib/src/lib/queue/ob_co_seq_queue.h @@ -23,7 +23,7 @@ namespace common { class ObCoSeqQueue { enum { MIN_QUEUE_SIZE = 4, READY = 1 }; - public: +public: ObCoSeqQueue() : next_(0), len_(0), items_(NULL), allocator_(NULL) {} ~ObCoSeqQueue() @@ -31,7 +31,7 @@ class ObCoSeqQueue { destroy(); } - public: +public: int init(const int64_t limit, ObIAllocator* allocator) { int ret = common::OB_SUCCESS; @@ -127,7 +127,7 @@ class ObCoSeqQueue { return last_got >= next_ ? last_got : 0; } - private: +private: volatile int64_t next_ CACHE_ALIGNED; int64_t len_ CACHE_ALIGNED; volatile int64_t* items_; diff --git a/deps/oblib/src/lib/queue/ob_dedup_queue.h b/deps/oblib/src/lib/queue/ob_dedup_queue.h index 2b707a92b..8b87ed320 100644 --- a/deps/oblib/src/lib/queue/ob_dedup_queue.h +++ b/deps/oblib/src/lib/queue/ob_dedup_queue.h @@ -66,13 +66,13 @@ class ObDedupQueue; class IObDedupTask { friend class ObDedupQueue; - public: +public: explicit IObDedupTask(const int type) : type_(type), stat_(ST_WAITING), memory_(NULL), prev_(NULL), next_(NULL) {} virtual ~IObDedupTask() {} - public: +public: virtual int64_t hash() const = 0; virtual bool operator==(const IObDedupTask& other) const = 0; virtual int64_t get_deep_copy_size() const = 0; @@ -84,11 +84,11 @@ class IObDedupTask { return type_; } - private: +private: static const int ST_WAITING = 0; static const int ST_DONE = 1; - private: +private: void set_prev(IObDedupTask* prev) { prev_ = prev; @@ -134,7 +134,7 @@ class IObDedupTask { memory_ = memory; } - private: +private: const int type_; int stat_; ObSpinLock sync_; @@ -142,13 +142,13 @@ class IObDedupTask { IObDedupTask* prev_; IObDedupTask* next_; - private: +private: DISALLOW_COPY_AND_ASSIGN(IObDedupTask); }; template class AllocatorWrapper { - public: +public: AllocatorWrapper() : allocator_(NULL) {} explicit AllocatorWrapper(Host& allocator) : allocator_(&allocator) @@ -156,7 +156,7 @@ class AllocatorWrapper { ~AllocatorWrapper() {} - public: +public: T* alloc() { T* ret = nullptr; @@ -185,33 +185,33 @@ class AllocatorWrapper { void clear() {} - private: +private: Host* allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(AllocatorWrapper); }; class ObDedupQueue : public lib::ThreadPool { - public: +public: static const int64_t TOTAL_LIMIT = 1024L * 1024L * 1024L; static const int64_t HOLD_LIMIT = 512L * 1024L * 1024L; static const int64_t PAGE_SIZE = common::OB_MALLOC_BIG_BLOCK_SIZE; static const int64_t TASK_MAP_SIZE = 20L * 1000; static const int64_t TASK_QUEUE_SIZE = 20L * 1000; - public: +public: ObDedupQueue(); virtual ~ObDedupQueue(); - public: +public: int init(int32_t thread_num = DEFAULT_THREAD_NUM, const char* thread_name = nullptr, const int64_t queue_size = TASK_QUEUE_SIZE, const int64_t task_map_size = TASK_MAP_SIZE, const int64_t total_mem_limit = TOTAL_LIMIT, const int64_t hold_mem_limit = HOLD_LIMIT, const int64_t page_size = PAGE_SIZE); void destroy(); - public: +public: int add_task(const IObDedupTask& task); int64_t task_count() const { @@ -224,10 +224,10 @@ class ObDedupQueue : public lib::ThreadPool { int set_thread_dead_threshold(const int64_t thread_dead_threshold); int set_work_thread_num(const int32_t work_thread_num); - public: +public: void run1() override; - private: +private: typedef ObFixedQueue TaskQueue; typedef AllocatorWrapper::AllocType, ObConcurrentFIFOAllocator> HashAllocator; @@ -259,7 +259,7 @@ class ObDedupQueue : public lib::ThreadPool { TH_GC = 2, }; struct ThreadMeta { - public: + public: int stat_; int task_type_; const IObDedupTask* running_task_; @@ -327,14 +327,14 @@ class ObDedupQueue : public lib::ThreadPool { }; }; - private: +private: int map_callback_(const IObDedupTask& task, TaskMapKVPair& kvpair); int add_task_(const IObDedupTask& task); IObDedupTask* copy_task_(const IObDedupTask& task); void destroy_task_(IObDedupTask* task); bool gc_(); - private: +private: bool is_inited_; ThreadMeta thread_metas_[MAX_THREAD_NUM]; int32_t thread_num_; @@ -351,7 +351,7 @@ class ObDedupQueue : public lib::ThreadPool { ObThreadCond work_thread_sync_; const char* thread_name_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDedupQueue); }; } // namespace common diff --git a/deps/oblib/src/lib/queue/ob_ext_ms_queue.h b/deps/oblib/src/lib/queue/ob_ext_ms_queue.h index 21efbad5f..98f8f6723 100644 --- a/deps/oblib/src/lib/queue/ob_ext_ms_queue.h +++ b/deps/oblib/src/lib/queue/ob_ext_ms_queue.h @@ -26,10 +26,10 @@ namespace oceanbase { namespace common { template class ObExtMsQueue { - public: +public: static const int64_t DEFAULT_MS_QUEUE_ITEM_COUNT = 1024; - public: +public: typedef ObLink Task; enum QueueFlag { IDLE = 0, // There is no output data in the queue @@ -109,11 +109,11 @@ class ObExtMsQueue { typedef ObLinearHashMap MsQueueMap; typedef ObSmallObjPool MsQueuePool; - public: +public: ObExtMsQueue(); virtual ~ObExtMsQueue(); - public: +public: /// Initialization function /// /// @param max_cached_ms_queue_item_count Maximum number of cached MsQueue @@ -123,7 +123,7 @@ class ObExtMsQueue { const int64_t queue_len_of_ms_queue, const lib::ObLabel& label = ObModIds::OB_EXT_MS_QUEUE); void destroy(); - public: +public: /// Add key-value pair /// @note The same key assumes single-threaded operation /// @@ -194,13 +194,13 @@ class ObExtMsQueue { return ms_queue_item_count_; } - private: +private: int get_task_ctx_(TaskCtx*& ctx, const int64_t timeout); int push_msg_task_(TaskCtx* ctx); int get_task_(Task*& task, TaskCtx* ctx); int handle_end_task_(TaskCtx* ctx); - private: +private: bool inited_; Task end_task_; // Terminate task ObLinkQueue task_ctx_queue_; // Task context queue @@ -211,7 +211,7 @@ class ObExtMsQueue { MsQueuePool ms_queue_pool_; // Queue resource pool MsQueueMap ms_queue_map_; // Queue Map structure - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExtMsQueue); }; diff --git a/deps/oblib/src/lib/queue/ob_fake_priority_queue.h b/deps/oblib/src/lib/queue/ob_fake_priority_queue.h index e698145af..7509b5ff2 100644 --- a/deps/oblib/src/lib/queue/ob_fake_priority_queue.h +++ b/deps/oblib/src/lib/queue/ob_fake_priority_queue.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObFakePriorityQueue { - public: +public: typedef ObLink Link; enum { Q_CAPACITY = 1 << 16, PRIO_CNT = 2 }; @@ -46,7 +46,7 @@ class ObFakePriorityQueue { return queue_.pop((void*&)data, timeout_us); } - private: +private: ObFutexQueue queue_; }; diff --git a/deps/oblib/src/lib/queue/ob_fixed_queue.h b/deps/oblib/src/lib/queue/ob_fixed_queue.h index 4eb6bf18b..a037c383a 100644 --- a/deps/oblib/src/lib/queue/ob_fixed_queue.h +++ b/deps/oblib/src/lib/queue/ob_fixed_queue.h @@ -22,17 +22,17 @@ namespace oceanbase { namespace common { template class ObFixedQueue { - public: +public: ObFixedQueue(); ~ObFixedQueue(); - public: +public: int init(const int64_t max_num, char* buf); int init(const int64_t max_num, ObIAllocator* allocator = global_default_allocator, const lib::ObLabel& label = ObModIds::OB_FIXED_QUEUE); void destroy(); - public: +public: int push(T* ptr); int pop(T*& ptr); inline int64_t get_total() const; @@ -47,16 +47,16 @@ class ObFixedQueue { return max_num_; } - private: +private: struct ArrayItem { T* data; }; - private: +private: inline int64_t get_total_(const uint64_t consumer, const uint64_t producer) const; inline int64_t get_free_(const uint64_t consumer, const uint64_t producer) const; - private: +private: bool is_inited_; int64_t max_num_; ArrayItem* array_; @@ -64,7 +64,7 @@ class ObFixedQueue { uint64_t consumer_ CACHE_ALIGNED; uint64_t producer_ CACHE_ALIGNED; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFixedQueue); }; diff --git a/deps/oblib/src/lib/queue/ob_futex_queue.h b/deps/oblib/src/lib/queue/ob_futex_queue.h index 817163fa4..3605dd821 100644 --- a/deps/oblib/src/lib/queue/ob_futex_queue.h +++ b/deps/oblib/src/lib/queue/ob_futex_queue.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace common { class ObFutexQueue { - public: +public: static bool is2n(uint64_t n) { return 0 == (n & (n - 1)); @@ -39,7 +39,7 @@ class ObFutexQueue { } struct Cond { - public: + public: Cond() : n_waiters_(0) {} ~Cond() @@ -65,7 +65,7 @@ class ObFutexQueue { } } - private: + private: lib::CoFutex futex_; uint32_t n_waiters_; }; @@ -102,7 +102,7 @@ class ObFutexQueue { void* data_; }; - public: +public: const static uint64_t WAKE_ID = ~(0LL); ObFutexQueue() : push_(0), pop_(0), capacity_(0), allocated_(NULL), items_(NULL) {} @@ -193,7 +193,7 @@ class ObFutexQueue { return (int64_t)(push - pop); } - private: +private: uint64_t idx(uint64_t x) { return x & (capacity_ - 1); @@ -228,7 +228,7 @@ class ObFutexQueue { return err; } - private: +private: uint64_t push_ CACHE_ALIGNED; uint64_t pop_ CACHE_ALIGNED; uint64_t capacity_ CACHE_ALIGNED; diff --git a/deps/oblib/src/lib/queue/ob_lighty_queue.h b/deps/oblib/src/lib/queue/ob_lighty_queue.h index 2e4e7471d..540160ae6 100644 --- a/deps/oblib/src/lib/queue/ob_lighty_queue.h +++ b/deps/oblib/src/lib/queue/ob_lighty_queue.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace common { struct ObLightyCond { - public: +public: ObLightyCond() : n_waiters_(0) {} ~ObLightyCond() @@ -50,16 +50,16 @@ struct ObLightyCond { } } - private: +private: lib::CoFutex futex_; uint32_t n_waiters_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLightyCond); }; class ObLightyQueue { - public: +public: typedef ObLightyCond Cond; ObLightyQueue() : capacity_(0), n_cond_(0), data_(NULL), cond_(NULL), push_(0), pop_(0) {} @@ -160,7 +160,7 @@ class ObLightyQueue { return ret; } - private: +private: static uint64_t calc_n_cond(uint64_t capacity) { return std::min(1024ULL, 1ULL << (63 - __builtin_clzll(capacity))); @@ -221,7 +221,7 @@ class ObLightyQueue { } } - private: +private: uint64_t capacity_; uint64_t n_cond_; void** data_; @@ -231,7 +231,7 @@ class ObLightyQueue { }; class LightyQueue { - public: +public: typedef ObLightyCond Cond; LightyQueue() {} @@ -240,7 +240,7 @@ class LightyQueue { destroy(); } - public: +public: int init(const uint64_t capacity, const lib::ObLabel& label = ObModIds::OB_LIGHTY_QUEUE); void destroy() { @@ -267,12 +267,12 @@ class LightyQueue { int pop(void*& data, const int64_t timeout = 0); int multi_pop(void** data, const int64_t data_count, int64_t& avail_count, const int64_t timeout = 0); - private: +private: typedef ObFixedQueue Queue; Queue queue_; Cond cond_; - private: +private: DISALLOW_COPY_AND_ASSIGN(LightyQueue); }; }; // end namespace common diff --git a/deps/oblib/src/lib/queue/ob_link_queue.h b/deps/oblib/src/lib/queue/ob_link_queue.h index 55222581c..b460f5896 100644 --- a/deps/oblib/src/lib/queue/ob_link_queue.h +++ b/deps/oblib/src/lib/queue/ob_link_queue.h @@ -20,7 +20,7 @@ namespace common { typedef ObLink QLink; class ObSpScLinkQueue { - public: +public: typedef QLink Link; ObSpScLinkQueue() : tail_(&head_) {} @@ -62,40 +62,40 @@ class ObSpScLinkQueue { return ret; } - private: +private: Link head_; Link* tail_; }; class ObSpLinkQueue { - public: +public: typedef QLink Link; ObSpLinkQueue() : head_(&dummy_), tail_(&dummy_), dummy_() {} ~ObSpLinkQueue() {} - public: +public: int top(Link*& p); int pop(Link*& p); int push(Link* p); int push_front(Link* p); bool is_empty() const; - private: +private: int do_pop(Link*& p); - private: +private: Link* head_ CACHE_ALIGNED; Link* tail_ CACHE_ALIGNED; Link dummy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSpLinkQueue); }; class ObLinkQueue { - public: +public: typedef QLink Link; enum { QUEUE_COUNT = 256 }; ObLinkQueue() : queue_(), push_(0), pop_(0) @@ -107,30 +107,30 @@ class ObLinkQueue { int pop(Link*& p); int64_t size() const; - private: +private: static int64_t idx(int64_t x) { return x & (QUEUE_COUNT - 1); } - private: +private: ObSpLinkQueue queue_[QUEUE_COUNT]; uint64_t push_ CACHE_ALIGNED; uint64_t pop_ CACHE_ALIGNED; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLinkQueue); }; class ObSimpleLinkQueue { - public: +public: typedef QLink Link; ObSimpleLinkQueue() : head_(&dummy_), tail_(&dummy_), dummy_() {} ~ObSimpleLinkQueue() {} - public: +public: int top(Link*& p); int pop(Link*& p); int push(Link* p); @@ -139,15 +139,15 @@ class ObSimpleLinkQueue { return head_ == tail_; } - private: +private: int do_pop(Link*& p); - private: +private: Link* head_ CACHE_ALIGNED; Link* tail_ CACHE_ALIGNED; Link dummy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSimpleLinkQueue); }; diff --git a/deps/oblib/src/lib/queue/ob_mpmc_queue.h b/deps/oblib/src/lib/queue/ob_mpmc_queue.h index 2e5aa761a..9c00ae77d 100644 --- a/deps/oblib/src/lib/queue/ob_mpmc_queue.h +++ b/deps/oblib/src/lib/queue/ob_mpmc_queue.h @@ -200,7 +200,7 @@ struct ObTurnSequencer { return static_cast(ATOMIC_LOAD(&state_) >> TURN_SHIFT_NUM); } - private: +private: // Returns the bitmask to pass futex_wait or futex_wake when communicating // about the specified turn int futex_channel(uint32_t turn) const @@ -230,7 +230,7 @@ struct ObTurnSequencer { return ts; } - private: +private: // TURN_SHIFT_NUM counts the bits that are stolen to record the delta // between the current turn and the maximum waiter. It needs to be big // enough to record wait deltas of 0 to 32 inclusive. Waiters more @@ -302,7 +302,7 @@ struct ObSingleElementQueue { return sequencer_.is_turn(turn * 2 + 1); } - private: +private: // Even turns are pushes, odd turns are pops ObTurnSequencer sequencer_; void* data_; @@ -310,7 +310,7 @@ struct ObSingleElementQueue { template class ObMPMCQueueBase { - public: +public: typedef ObSingleElementQueue Slot; ObMPMCQueueBase() @@ -598,7 +598,7 @@ class ObMPMCQueueBase { return ret; } - protected: +protected: // We assign tickets in increasing order, but we don't want to // access neighboring elements of slots_ because that will lead to // false sharing (multiple cores accessing the same cache line even @@ -829,7 +829,7 @@ class ObMPMCQueueBase { slots[idx(ticket, cap, stride)].dequeue(turn(ticket, cap), pop_spin_cutoff_, 0 == (ticket % ADAPTATION_FREQ), elem); } - protected: +protected: // Once every ADAPTATION_FREQ we will spin longer, to try to estimate // the proper spin backoff static const int64_t ADAPTATION_FREQ = INT64_MAX; @@ -945,7 +945,7 @@ class ObMPMCQueueBase { // two sentinels after it receives it (by requeuing 2 the shutdown can // complete in O(log P) time instead of O(P)). class ObFixedMPMCQueue : public ObMPMCQueueBase { - public: +public: typedef ObSingleElementQueue Slot; ObFixedMPMCQueue() : ObMPMCQueueBase() {} @@ -974,7 +974,7 @@ class ObFixedMPMCQueue : public ObMPMCQueueBase { return ret; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFixedMPMCQueue); }; @@ -1040,7 +1040,7 @@ class ObDynamicMPMCQueue : public ObMPMCQueueBase { int64_t stride_; }; - public: +public: explicit ObDynamicMPMCQueue() : ObMPMCQueueBase(), dmult_(0), closed_(NULL), label_(nullptr) {} @@ -1152,7 +1152,7 @@ class ObDynamicMPMCQueue : public ObMPMCQueueBase { dequeue_with_ticket_base(ticket - offset, slots, cap, stride, elem); } - private: +private: bool try_obtain_ready_push_ticket(uint64_t& ticket, Slot*& slots, int64_t& cap, int64_t& stride) { bool ret = false; @@ -1412,7 +1412,7 @@ class ObDynamicMPMCQueue : public ObMPMCQueueBase { // A closed array with offset <= ticket should have been found } - private: +private: static const int64_t SEQLOCK_BITS = 6; static const int64_t DEFAULT_MIN_DYNAMIC_CAPACITY = 1024; static const int64_t DEFAULT_EXPANSION_MULTIPLIER = 2; diff --git a/deps/oblib/src/lib/queue/ob_ms_queue.h b/deps/oblib/src/lib/queue/ob_ms_queue.h index b039d7314..2281e3c00 100644 --- a/deps/oblib/src/lib/queue/ob_ms_queue.h +++ b/deps/oblib/src/lib/queue/ob_ms_queue.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class ObIAllocator; class ObMsQueue { - public: +public: typedef ObLink Task; struct TaskHead { Task* head_; @@ -55,7 +55,7 @@ class ObMsQueue { bool next_is_ready(const int64_t ready_seq) const; }; - public: +public: ObMsQueue(); ~ObMsQueue(); int init(const int64_t n_queue, const int64_t queue_len, ObIAllocator* allocator); @@ -71,7 +71,7 @@ class ObMsQueue { TO_STRING_KV(K_(inited), K_(qlen), K_(qcount)); - private: +private: bool inited_; int64_t qlen_; int64_t qcount_; diff --git a/deps/oblib/src/lib/queue/ob_multi_fixed_queue.h b/deps/oblib/src/lib/queue/ob_multi_fixed_queue.h index 777779fde..a74470805 100644 --- a/deps/oblib/src/lib/queue/ob_multi_fixed_queue.h +++ b/deps/oblib/src/lib/queue/ob_multi_fixed_queue.h @@ -22,7 +22,7 @@ const int64_t DefaultMaxQueueNum = 32; const int64_t DefaultQueueNum = 0; template class ObMultiFixedQueue { - public: +public: ObMultiFixedQueue() : inited_(false), queue_num_(DefaultQueueNum) {} virtual ~ObMultiFixedQueue() @@ -33,7 +33,7 @@ class ObMultiFixedQueue { } } - public: +public: int init(const int64_t queue_size, const int64_t queue_num); int destroy(); @@ -42,17 +42,17 @@ class ObMultiFixedQueue { int get_task_count(const int64_t queue_index, int64_t& task_count); - private: +private: int init_queue_(const int64_t queue_num, const int64_t queue_size); void destroy_queue_(const int64_t queue_num); - private: +private: bool inited_; ObFixedQueue queue_[MAX_QUEUE_NUM]; ObCond queue_conds_[MAX_QUEUE_NUM]; int64_t queue_num_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultiFixedQueue); }; diff --git a/deps/oblib/src/lib/queue/ob_priority_queue.h b/deps/oblib/src/lib/queue/ob_priority_queue.h index 238ad3128..e7ada5751 100644 --- a/deps/oblib/src/lib/queue/ob_priority_queue.h +++ b/deps/oblib/src/lib/queue/ob_priority_queue.h @@ -22,7 +22,7 @@ namespace common { template class ObPriorityQueue { - public: +public: enum { PRIO_CNT = PRIOS }; ObPriorityQueue() : sem_(), queue_(), size_(0), limit_(INT64_MAX) @@ -99,7 +99,7 @@ class ObPriorityQueue { return ret; } - private: +private: ObSeqSem sem_; ObLinkQueue queue_[PRIO_CNT]; int64_t size_ CACHE_ALIGNED; @@ -109,7 +109,7 @@ class ObPriorityQueue { template class ObPriorityQueue2 { - public: +public: enum { PRIO_CNT = HIGH_PRIOS + LOW_PRIOS }; ObPriorityQueue2() : queue_(), size_(0), limit_(INT64_MAX) @@ -195,7 +195,7 @@ class ObPriorityQueue2 { return do_pop(data, HIGH_PRIOS, timeout_us); } - private: +private: SCond cond_; ObLinkQueue queue_[PRIO_CNT]; int64_t size_ CACHE_ALIGNED; diff --git a/deps/oblib/src/lib/queue/ob_seq_queue.h b/deps/oblib/src/lib/queue/ob_seq_queue.h index b5b5fcd7b..43c814b2e 100644 --- a/deps/oblib/src/lib/queue/ob_seq_queue.h +++ b/deps/oblib/src/lib/queue/ob_seq_queue.h @@ -54,11 +54,11 @@ class ObSeqQueue { void* volatile data_; }; - public: +public: ObSeqQueue(); ~ObSeqQueue(); - public: +public: int init(const int64_t limit, SeqItem* buf = NULL); int start(const int64_t seq); int add(const int64_t seq, void* data); @@ -67,11 +67,11 @@ class ObSeqQueue { bool next_is_ready() const; int64_t get_seq(); - protected: +protected: bool is_inited() const; ObThreadCond* get_cond(const int64_t seq); - private: +private: BufHolder buf_holder_; volatile int64_t seq_; SeqItem* items_ CACHE_ALIGNED; diff --git a/deps/oblib/src/lib/queue/spin_queue.h b/deps/oblib/src/lib/queue/spin_queue.h index b17afc342..cfd6d994e 100644 --- a/deps/oblib/src/lib/queue/spin_queue.h +++ b/deps/oblib/src/lib/queue/spin_queue.h @@ -16,10 +16,10 @@ namespace oceanbase { namespace common { class SpinQueue { - public: +public: enum { MIN_QLEN = 4 }; - public: +public: SpinQueue() : push_(0), pop_(0), pos_mask_(0), items_(NULL) {} ~SpinQueue() @@ -79,7 +79,7 @@ class SpinQueue { return pop_ + pos_mask_ + 1 - push_; } - private: +private: volatile uint64_t push_ CACHE_ALIGNED; volatile uint64_t pop_ CACHE_ALIGNED; uint64_t pos_mask_ CACHE_ALIGNED; diff --git a/deps/oblib/src/lib/random/ob_mysql_random.h b/deps/oblib/src/lib/random/ob_mysql_random.h index 3df3872f6..a0b9d4ada 100644 --- a/deps/oblib/src/lib/random/ob_mysql_random.h +++ b/deps/oblib/src/lib/random/ob_mysql_random.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class ObMysqlRandom { - public: +public: ObMysqlRandom() { MEMSET(this, 0, sizeof(*this)); @@ -36,14 +36,14 @@ class ObMysqlRandom { return is_inited_; } - public: +public: bool is_inited_; uint64_t seed1_; uint64_t seed2_; uint64_t max_value_; double max_value_double_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMysqlRandom); }; diff --git a/deps/oblib/src/lib/random/ob_random.h b/deps/oblib/src/lib/random/ob_random.h index 350b109b3..2b087a64f 100644 --- a/deps/oblib/src/lib/random/ob_random.h +++ b/deps/oblib/src/lib/random/ob_random.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObRandom { - public: +public: ObRandom(); virtual ~ObRandom(); // get a random int64_t number in [min(a,b), max(a,b)] @@ -34,10 +34,10 @@ class ObRandom { // get a random int32_t number in [min(a,b), max(a,b)] int32_t get_int32(const int32_t a, const int32_t b); - private: +private: uint16_t seed_[3]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRandom); }; diff --git a/deps/oblib/src/lib/rc/context.h b/deps/oblib/src/lib/rc/context.h index ba5ed0b04..5dc37c5e3 100644 --- a/deps/oblib/src/lib/rc/context.h +++ b/deps/oblib/src/lib/rc/context.h @@ -68,7 +68,7 @@ class ContextTLOptGuard { friend class MemoryContext; static RLOCAL(bool, enable_tl_opt); - public: +public: ContextTLOptGuard(const bool enable_flag) : enable_flag_bak_(enable_tl_opt) { enable_tl_opt = enable_flag; @@ -78,7 +78,7 @@ class ContextTLOptGuard { enable_tl_opt = enable_flag_bak_; } - private: +private: const bool enable_flag_bak_; }; @@ -93,7 +93,7 @@ enum ContextPropertyEnum { }; class TreeNode { - public: +public: TreeNode(TreeNode* parent, const bool with_lock) : parent_(parent), child_(nullptr), prev_(nullptr), next_(nullptr), with_lock_(with_lock), lock_(0) {} @@ -178,7 +178,7 @@ class TreeNode { class ContextParam { friend class MemoryContext; - public: +public: ContextParam() : properties_(DEFAULT_PROPERTIES), attr_(), @@ -218,7 +218,7 @@ class ContextParam { return *this; } - private: +private: int64_t properties_; ObMemAttr attr_; int64_t page_size_; @@ -234,7 +234,7 @@ struct StaticInfo { }; class StaticInfos { - public: +public: StaticInfos() : cnt_(0) {} static StaticInfos& get_instance() @@ -260,7 +260,7 @@ class StaticInfos { return infos_[static_id]; } - private: +private: static const int MAX_NUM = 128; StaticInfo infos_[MAX_NUM]; int cnt_; @@ -279,7 +279,7 @@ struct DynamicInfo { class MemoryContext { friend class TreeNode; - public: +public: MemoryContext( const bool need_free, const DynamicInfo& di, MemoryContext* parent, ContextParam& param, const int static_id) : need_free_(need_free), @@ -379,13 +379,13 @@ class MemoryContext { TO_STRING_KV(KP(this), "static_id", static_id_, "static_info", StaticInfos::get_instance().get(static_id_), "dynamic info", di_, K(properties_), K(attr_)); - private: +private: static MemoryContext* node2context(TreeNode* node) { return reinterpret_cast((char*)node - offsetof(MemoryContext, tree_node_)); } - public: +public: int init() { tree_node_.init(); @@ -526,7 +526,7 @@ class MemoryContext { } } - public: +public: // Assignment is not in the constructor, record who assigns const bool need_free_; TreeNode tree_node_; @@ -558,7 +558,7 @@ class MemoryContext { }; class Flow final { - public: +public: Flow(MemoryContext& ref_context) : ref_context_(ref_context), prev_(nullptr), next_(nullptr), is_inited_(false) {} MemoryContext& context() @@ -618,14 +618,14 @@ class Flow final { return *prev_; } - private: +private: static Flow*& g_flow() { static CoVar g_flow; return g_flow; } - private: +private: MemoryContext& ref_context_; Flow* prev_; Flow* next_; @@ -648,7 +648,7 @@ inline void ctxfree(void* ptr) } class _SBase { - public: +public: int get_ret() const { return ret_; @@ -670,7 +670,7 @@ class _S {}; template <> class _S : public _SBase { - public: +public: _S(const bool condition, MemoryContext* context) : _SBase(), flow_(nullptr) { int ret = common::OB_SUCCESS; @@ -698,7 +698,7 @@ class _S : public _SBase { template <> class _S : public _SBase { - public: +public: template _S(const bool condition, Args&&... args) : _SBase(), context_(nullptr), flow_(nullptr) { diff --git a/deps/oblib/src/lib/regex/ob_regex.h b/deps/oblib/src/lib/regex/ob_regex.h index b0ab9c95e..9a4292097 100644 --- a/deps/oblib/src/lib/regex/ob_regex.h +++ b/deps/oblib/src/lib/regex/ob_regex.h @@ -19,11 +19,11 @@ namespace oceanbase { namespace common { class ObRegex { - public: +public: ObRegex(); virtual ~ObRegex(); - public: +public: int init(const char* pattern, int flags); int match(const char* text, int flags, bool& is_match); void destroy(); @@ -36,13 +36,13 @@ class ObRegex { return static_cast(nmatch_); } - private: +private: bool init_; regmatch_t* match_; regex_t reg_; size_t nmatch_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRegex); }; } // namespace common diff --git a/deps/oblib/src/lib/regex/regex/regc_nfa.cpp b/deps/oblib/src/lib/regex/regex/regc_nfa.cpp index ad0ac3f88..255484667 100644 --- a/deps/oblib/src/lib/regex/regex/regc_nfa.cpp +++ b/deps/oblib/src/lib/regex/regex/regc_nfa.cpp @@ -276,10 +276,7 @@ static void freestate(struct nfa* nfa, struct state* s) - destroystate - really get rid of an already-freed state ^ static void destroystate(struct nfa *, struct state *); */ -static void -destroystate( - struct nfa *nfa __attribute__((unused)), - struct state *s) +static void destroystate(struct nfa* nfa __attribute__((unused)), struct state* s) { struct arcbatch* ab; struct arcbatch* abnext; diff --git a/deps/oblib/src/lib/regex/regex/regexec.cpp b/deps/oblib/src/lib/regex/regex/regexec.cpp index aaf8cf822..2a2427e3e 100644 --- a/deps/oblib/src/lib/regex/regex/regexec.cpp +++ b/deps/oblib/src/lib/regex/regex/regexec.cpp @@ -441,14 +441,9 @@ static int cfind(struct vars* v, struct cnfa* cnfa, struct colormap* cm) ^ static int cfindloop(struct vars *, struct cnfa *, struct colormap *, ^ struct dfa *, struct dfa *, chr **); */ -static int -cfindloop( - struct vars *v, - struct cnfa *cnfa __attribute__((unused)), - struct colormap *cm __attribute__((unused)), - struct dfa *d, - struct dfa *s, - chr **coldp) /* where to put coldstart pointer */ +static int cfindloop(struct vars* v, struct cnfa* cnfa __attribute__((unused)), + struct colormap* cm __attribute__((unused)), struct dfa* d, struct dfa* s, + chr** coldp) /* where to put coldstart pointer */ { chr* begin; chr* end; diff --git a/deps/oblib/src/lib/resource/achunk_mgr.h b/deps/oblib/src/lib/resource/achunk_mgr.h index f3fdf330c..8922edcec 100644 --- a/deps/oblib/src/lib/resource/achunk_mgr.h +++ b/deps/oblib/src/lib/resource/achunk_mgr.h @@ -37,7 +37,7 @@ class AChunkList { friend class ObMemoryCutter; DISALLOW_COPY_AND_ASSIGN(AChunkList); - public: +public: static const int DEFAULT_MAX_CHUNK_CACHE_CNT = 500; AChunkList(const bool with_mutex = true) : max_chunk_cache_cnt_(DEFAULT_MAX_CHUNK_CACHE_CNT), @@ -108,7 +108,7 @@ class AChunkList { return pops_; } - private: +private: int32_t max_chunk_cache_cnt_; ObMutex mutex_; AChunk* header_; @@ -120,28 +120,28 @@ class AChunkList { const char* const use_large_pages_confs[] = {"true", "false", "only"}; class ObLargePageHelper { - public: +public: static const int INVALID_LARGE_PAGE_TYPE = -1; static const int NO_LARGE_PAGE = 0; static const int PREFER_LARGE_PAGE = 1; static const int ONLY_LARGE_PAGE = 2; - public: +public: static void set_param(const char* param); static int get_type(); - private: +private: static int large_page_type_; }; class AChunkMgr { friend class ObMemoryCutter; - private: +private: static const int64_t DEFAULT_LIMIT = 4L << 30; // 4GB static const int64_t LARGE_CHUNK_FREE_SPACE = 2L << 30; // 2GB - public: +public: #if MEMCHK_LEVEL >= 1 static const uint64_t ALIGN_SIZE = MEMCHK_CHUNK_ALIGN; #else @@ -150,7 +150,7 @@ class AChunkMgr { static AChunkMgr& instance(); - public: +public: AChunkMgr(); AChunk* alloc_chunk(const uint64_t size = ACHUNK_SIZE, bool high_prio = false); @@ -192,10 +192,10 @@ class AChunkMgr { return large_unmaps_; } - private: +private: typedef ABitSet ChunkBitMap; - private: +private: void* direct_alloc(const uint64_t size); void direct_free(const void* ptr, const uint64_t size); // wrap for mmap @@ -204,7 +204,7 @@ class AChunkMgr { bool update_hold(int64_t bytes, bool high_prio); - protected: +protected: AChunkList free_list_; ChunkBitMap* chunk_bitmap_; diff --git a/deps/oblib/src/lib/resource/ob_cache_washer.h b/deps/oblib/src/lib/resource/ob_cache_washer.h index 6a2dd2669..7fa3bcc54 100644 --- a/deps/oblib/src/lib/resource/ob_cache_washer.h +++ b/deps/oblib/src/lib/resource/ob_cache_washer.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace lib { class ObICacheWasher { - public: +public: struct ObCacheMemBlock { ObCacheMemBlock() : next_(NULL) {} diff --git a/deps/oblib/src/lib/resource/ob_resource_mgr.h b/deps/oblib/src/lib/resource/ob_resource_mgr.h index c21ec8a7e..2d8d987c8 100644 --- a/deps/oblib/src/lib/resource/ob_resource_mgr.h +++ b/deps/oblib/src/lib/resource/ob_resource_mgr.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace lib { class ObTenantMemoryMgr { - public: +public: static const int64_t LARGE_REQUEST_EXTRA_MB_COUNT = 2; static const int64_t ALIGN_SIZE = static_cast(AChunkMgr::ALIGN_SIZE); @@ -96,7 +96,7 @@ class ObTenantMemoryMgr { return update_hold(size, common::ObCtxIds::CO_STACK, common::ObModIds::OB_CORO, reach_ctx_limit); } - private: +private: void update_cache_hold(const int64_t size); bool update_hold(const int64_t size, const uint64_t ctx_id, const lib::ObLabel& label, bool& reach_ctx_limit); bool update_ctx_hold(const uint64_t ctx_id, const int64_t size); @@ -125,7 +125,7 @@ struct ObTenantResourceMgr : public common::ObLink { class ObResourceMgr; class ObTenantResourceMgrHandle { - public: +public: ObTenantResourceMgrHandle(); virtual ~ObTenantResourceMgrHandle(); @@ -137,13 +137,13 @@ class ObTenantResourceMgrHandle { const ObTenantResourceMgr* get_mgr() const; const ObTenantMemoryMgr* get_memory_mgr() const; - private: +private: ObResourceMgr* resource_mgr_; ObTenantResourceMgr* tenant_resource_mgr_; }; class ObTenantResourceMgrList { - public: +public: ObTenantResourceMgrList() : inited_(false), mutex_(), header_(NULL), chunk_(NULL) {} virtual ~ObTenantResourceMgrList() @@ -154,7 +154,7 @@ class ObTenantResourceMgrList { int push(ObTenantResourceMgr* tenant_resource_mgr); int pop(ObTenantResourceMgr*& tenant_resource_mgr); - private: +private: bool inited_; ObMutex mutex_; ObTenantResourceMgr* header_; @@ -164,7 +164,7 @@ class ObTenantResourceMgrList { class ObResourceMgr { friend class ObTenantResourceMgrHandle; - public: +public: ObResourceMgr(); virtual ~ObResourceMgr(); @@ -176,7 +176,7 @@ class ObResourceMgr { // will create resource mgr if not exist int get_tenant_resource_mgr(const uint64_t tenant_id, ObTenantResourceMgrHandle& handle); - private: +private: static const int64_t MAX_TENANT_COUNT = 12289; // prime number void inc_ref(ObTenantResourceMgr* tenant_resource_mgr); void dec_ref(ObTenantResourceMgr* tenant_resource_mgr); diff --git a/deps/oblib/src/lib/restore/ob_i_storage.h b/deps/oblib/src/lib/restore/ob_i_storage.h index 1c3d25e0e..8d509be0f 100644 --- a/deps/oblib/src/lib/restore/ob_i_storage.h +++ b/deps/oblib/src/lib/restore/ob_i_storage.h @@ -26,7 +26,7 @@ enum StorageOpenMode { ONLY_OPEN_UNLOCK = 2, // only open }; class ObIStorageUtil { - public: +public: virtual int is_exist(const common::ObString& uri, const common::ObString& storage_info, bool& exist) = 0; virtual int get_file_length( const common::ObString& uri, const common::ObString& storage_info, int64_t& file_length) = 0; @@ -44,7 +44,7 @@ class ObIStorageUtil { }; class ObIStorageReader { - public: +public: virtual int open(const common::ObString& uri, const common::ObString& storage_info) = 0; virtual int pread(char* buf, const int64_t buf_size, int64_t offset, int64_t& read_size) = 0; virtual int close() = 0; @@ -53,7 +53,7 @@ class ObIStorageReader { }; class ObIStorageWriter { - public: +public: virtual int open(const common::ObString& uri, const common::ObString& storage_info) = 0; virtual int write(const char* buf, const int64_t size) = 0; virtual int close() = 0; @@ -62,7 +62,7 @@ class ObIStorageWriter { }; class ObIStorageMetaWrapper { - public: +public: virtual int get(const common::ObString& uri, const common::ObString& storage_info, char* buf, const int64_t buf_size, int64_t& read_size) = 0; virtual int set( diff --git a/deps/oblib/src/lib/restore/ob_storage.h b/deps/oblib/src/lib/restore/ob_storage.h index c659bd6ad..50b24a4a3 100644 --- a/deps/oblib/src/lib/restore/ob_storage.h +++ b/deps/oblib/src/lib/restore/ob_storage.h @@ -58,7 +58,7 @@ struct ObStorageObjectVersionParam { }; class ObStorageUtil { - public: +public: static const int64_t OB_AGENT_MAX_RETRY_TIME = 5 * 60 * 1000 * 1000; // 300s static const int64_t OB_AGENT_SINGLE_SLEEP_US = 5 * 1000 * 1000; // 5s // should not use retry during physical backup @@ -93,7 +93,7 @@ class ObStorageUtil { // uri is directory int delete_tmp_files(const common::ObString& uri, const common::ObString& storage_info); - private: +private: int get_util(const common::ObString& uri, ObIStorageUtil*& util); int do_read_single_file(const common::ObString& uri, const common::ObString& storage_info, char* buf, @@ -110,7 +110,7 @@ class ObStorageUtil { }; class ObStorageReader { - public: +public: ObStorageReader(); virtual ~ObStorageReader(); int open(const common::ObString& uri, const common::ObString& storage_info); @@ -121,7 +121,7 @@ class ObStorageReader { return file_length_; } - private: +private: int64_t file_length_; ObIStorageReader* reader_; ObStorageFileReader file_reader_; @@ -134,14 +134,14 @@ class ObStorageReader { }; class ObStorageWriter { - public: +public: ObStorageWriter(); virtual ~ObStorageWriter(); int open(const common::ObString& uri, const common::ObString& storage_info); int write(const char* buf, const int64_t size); int close(); - private: +private: ObIStorageWriter* writer_; ObStorageFileWriter file_writer_; #ifdef _WITH_OSS @@ -153,7 +153,7 @@ class ObStorageWriter { }; class ObStorageAppender { - public: +public: ObStorageAppender(StorageOpenMode mode); ObStorageAppender(); virtual ~ObStorageAppender(); @@ -176,7 +176,7 @@ class ObStorageAppender { int64_t get_length(); TO_STRING_KV(KP(appender_), K_(start_ts), K_(is_opened), K_(uri)); - private: +private: ObIStorageWriter* appender_; ObStorageFileAppender file_appender_; #ifdef _WITH_OSS @@ -189,14 +189,14 @@ class ObStorageAppender { }; class ObStorageMetaWrapper { - public: +public: ObStorageMetaWrapper(); virtual ~ObStorageMetaWrapper(); int get(const common::ObString& uri, const common::ObString& storage_info, char* buf, const int64_t buf_size, int64_t& read_size); int set(const common::ObString& uri, const common::ObString& storage_info, const char* buf, const int64_t size); - private: +private: int get_meta(const common::ObString& uri, ObIStorageMetaWrapper*& meta); ObStorageFileMetaWrapper file_meta_; #ifdef _WITH_OSS diff --git a/deps/oblib/src/lib/restore/ob_storage_file.h b/deps/oblib/src/lib/restore/ob_storage_file.h index 91ba4bbd9..d24fc4938 100644 --- a/deps/oblib/src/lib/restore/ob_storage_file.h +++ b/deps/oblib/src/lib/restore/ob_storage_file.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObStorageFileUtil : public ObIStorageUtil { - public: +public: ObStorageFileUtil(); virtual ~ObStorageFileUtil(); virtual int is_exist(const common::ObString& uri, const common::ObString& storage_info, bool& exist); @@ -35,16 +35,16 @@ class ObStorageFileUtil : public ObIStorageUtil { common::ObIArray& pkeys); virtual int delete_tmp_files(const common::ObString& dir_path, const common::ObString& storage_info); - private: +private: int get_partition_ids_from_dir(const char* dir_path, common::ObIArray& partition_ids); int get_tmp_file_format_timestamp(const char* file_name, bool& is_tmp_file, int64_t& timestamp); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStorageFileUtil); }; class ObStorageFileReader : public ObIStorageReader { - public: +public: ObStorageFileReader(); virtual ~ObStorageFileReader(); virtual int open(const common::ObString& uri, const common::ObString& storage_info); @@ -59,7 +59,7 @@ class ObStorageFileReader : public ObIStorageReader { return is_opened_; } - private: +private: int fd_; bool is_opened_; char path_[OB_MAX_URI_LENGTH]; @@ -69,7 +69,7 @@ class ObStorageFileReader : public ObIStorageReader { // Only used for NFS file systems mounted in direct form, so there is no fsync class ObStorageFileBaseWriter : public ObIStorageWriter { - public: +public: ObStorageFileBaseWriter(); virtual ~ObStorageFileBaseWriter(); virtual int open(const common::ObString& uri, const common::ObString& storage_info) = 0; @@ -85,26 +85,26 @@ class ObStorageFileBaseWriter : public ObIStorageWriter { return is_opened_; } - protected: +protected: int fd_; bool is_opened_; char path_[OB_MAX_URI_LENGTH]; int64_t file_length_; bool has_error_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStorageFileBaseWriter); }; // Only used for NFS file systems mounted in direct form, so there is no fsync class ObStorageFileWriter : public ObStorageFileBaseWriter { - public: +public: ObStorageFileWriter(); virtual ~ObStorageFileWriter(); virtual int open(const common::ObString& uri, const common::ObString& storage_info); virtual int close() override; - private: +private: char real_path_[OB_MAX_URI_LENGTH]; DISALLOW_COPY_AND_ASSIGN(ObStorageFileWriter); }; @@ -112,17 +112,17 @@ class ObStorageFileWriter : public ObStorageFileBaseWriter { // Only used for NFS file systems mounted in direct form, so there is no fsync // use file lock to gurantee one process appendding this file class ObStorageFileAppender : public ObStorageFileBaseWriter { - public: +public: ObStorageFileAppender(); ObStorageFileAppender(StorageOpenMode mode); virtual ~ObStorageFileAppender(); virtual int open(const common::ObString& uri, const common::ObString& storage_info); virtual int close() override; - private: +private: int get_open_flag_and_mode_(int& flag, bool& need_lock); - private: +private: bool need_unlock_; StorageOpenMode open_mode_; DISALLOW_COPY_AND_ASSIGN(ObStorageFileAppender); @@ -130,7 +130,7 @@ class ObStorageFileAppender : public ObStorageFileBaseWriter { // Only used for NFS file systems mounted in direct form, so there is no fsync class ObStorageFileMetaWrapper : public ObIStorageMetaWrapper { - public: +public: ObStorageFileMetaWrapper(); virtual ~ObStorageFileMetaWrapper(); @@ -139,7 +139,7 @@ class ObStorageFileMetaWrapper : public ObIStorageMetaWrapper { virtual int set( const common::ObString& uri, const common::ObString& storage_info, const char* buf, const int64_t buf_size); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStorageFileMetaWrapper); }; diff --git a/deps/oblib/src/lib/restore/ob_storage_oss_base.h b/deps/oblib/src/lib/restore/ob_storage_oss_base.h index 5f1a89c49..23e70fa41 100644 --- a/deps/oblib/src/lib/restore/ob_storage_oss_base.h +++ b/deps/oblib/src/lib/restore/ob_storage_oss_base.h @@ -51,7 +51,7 @@ const static int64_t MAX_ELEMENT_COUNT = 10000; // oss limit e const static int64_t MULTI_BASE_BUFFER_SIZE = 16 * 1024 * 1024L; // the buf size of upload data class ObStorageOssStaticVar { - public: +public: ObStorageOssStaticVar(); virtual ~ObStorageOssStaticVar(); static ObStorageOssStaticVar& get_instance(); @@ -59,7 +59,7 @@ class ObStorageOssStaticVar { common::ObCompressor* get_oss_compressor(); common::ObCompressorType get_compressor_type(); - private: +private: common::ObCompressor* compressor_; common::ObCompressorType compress_type_; }; @@ -70,20 +70,20 @@ struct FrozenInfo { }; class ObOssEnvIniter { - public: +public: static ObOssEnvIniter& get_instance(); int global_init(); void global_destroy(); - private: +private: ObOssEnvIniter(); common::SpinRWLock lock_; bool is_global_inited_; }; class ObStorageOssBase { - public: +public: ObStorageOssBase(); virtual ~ObStorageOssBase(); @@ -97,15 +97,15 @@ class ObStorageOssBase { int get_oss_file_length(const common::ObString& name, int64_t& file_length); void print_oss_info(aos_status_s* aos_ret); - protected: +protected: aos_pool_t* aos_pool_; oss_request_options_t* oss_option_; - private: +private: int parse_oss_arg(const common::ObString& uri); static int set_oss_field(const char* info, char* field, const int64_t length); - private: +private: bool is_inited_; char oss_domain_[OB_MAX_URI_LENGTH]; char oss_endpoint_[MAX_OSS_ENDPOINT_LENGTH]; @@ -117,7 +117,7 @@ class ObStorageOssBase { class ObStorageOssMultiPartWriter : public ObStorageOssBase, public ObIStorageWriter { - public: +public: ObStorageOssMultiPartWriter(); virtual ~ObStorageOssMultiPartWriter(); int open(const common::ObString& uri, const common::ObString& storage_info); @@ -133,11 +133,11 @@ class ObStorageOssMultiPartWriter : public ObStorageOssBase, public ObIStorageWr return is_opened_; } - private: +private: int write_single_part(); int upload_data(const char* buf, const int64_t size, char*& upload_buf, int64_t& upload_size); - private: +private: common::ModulePageAllocator mod_; common::ModuleArena allocator_; char* base_buf_; @@ -155,7 +155,7 @@ class ObStorageOssMultiPartWriter : public ObStorageOssBase, public ObIStorageWr class ObStorageOssReader : public ObStorageOssBase, public ObIStorageReader { // TODO: buf reuse - public: +public: ObStorageOssReader(); virtual ~ObStorageOssReader(); int open(const common::ObString& uri, const common::ObString& storage_info); @@ -170,7 +170,7 @@ class ObStorageOssReader : public ObStorageOssBase, public ObIStorageReader { return is_opened_; } - private: +private: common::ObString bucket_; common::ObString object_; int64_t file_length_; @@ -181,7 +181,7 @@ class ObStorageOssReader : public ObStorageOssBase, public ObIStorageReader { }; class ObStorageOssUtil : public ObStorageOssBase, public ObIStorageUtil { - public: +public: ObStorageOssUtil(); virtual ~ObStorageOssUtil(); virtual int is_exist(const common::ObString& uri, const common::ObString& storage_info, bool& exist); @@ -200,16 +200,16 @@ class ObStorageOssUtil : public ObStorageOssBase, public ObIStorageUtil { common::ObIArray& pkeys); virtual int delete_tmp_files(const common::ObString& dir_path, const common::ObString& storage_info); - private: +private: int strtotime(const char* date_time, int64_t& time); }; class ObStorageOssAppendWriter : public ObStorageOssBase, public ObIStorageWriter { - public: +public: ObStorageOssAppendWriter(); virtual ~ObStorageOssAppendWriter(); - public: +public: int open(const common::ObString& uri, const common::ObString& storage_info); int write(const char* buf, const int64_t size); int close(); @@ -222,7 +222,7 @@ class ObStorageOssAppendWriter : public ObStorageOssBase, public ObIStorageWrite return is_opened_; } - private: +private: bool is_opened_; int64_t file_length_; common::ObArenaAllocator allocator_; @@ -233,22 +233,22 @@ class ObStorageOssAppendWriter : public ObStorageOssBase, public ObIStorageWrite }; class ObStorageOssMetaMgr : public ObStorageOssBase, public ObIStorageMetaWrapper { - public: +public: ObStorageOssMetaMgr(); virtual ~ObStorageOssMetaMgr(); - public: +public: int get(const common::ObString& uri, const common::ObString& storage_info, char* buf, const int64_t buf_size, int64_t& read_size); int set(const common::ObString& uri, const common::ObString& storage_info, const char* buf, const int64_t buf_size); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStorageOssMetaMgr); }; // TODO qiaxi remove, compat to old version class ObStorageOssMetaMgrOld : public ObStorageOssBase { - public: +public: ObStorageOssMetaMgrOld(); virtual ~ObStorageOssMetaMgrOld(); @@ -257,7 +257,7 @@ class ObStorageOssMetaMgrOld : public ObStorageOssBase { int str_to_int64(const char* nptr, int64_t& value); - private: +private: common::ModulePageAllocator mod_; common::ModuleArena allocator_; common::ObString bucket_; diff --git a/deps/oblib/src/lib/restore/ob_storage_path.h b/deps/oblib/src/lib/restore/ob_storage_path.h index 30329ad07..a8c1f7faa 100644 --- a/deps/oblib/src/lib/restore/ob_storage_path.h +++ b/deps/oblib/src/lib/restore/ob_storage_path.h @@ -26,7 +26,7 @@ static const char* const BACKUP_BASE_DATA = "base_data"; static const char* const BACKUP_ALL_TENANT_ID_LIST = "all_tenant_id_list"; class ObStoragePath { - public: +public: ObStoragePath(); virtual ~ObStoragePath(); int init(const common::ObString& uri); @@ -67,7 +67,7 @@ class ObStoragePath { return cur_pos_ > 0; } - private: +private: int trim_right_delim(); int trim_left_delim(const common::ObString& path, int64_t& delim_pos); char path_[common::OB_MAX_URI_LENGTH]; @@ -75,7 +75,7 @@ class ObStoragePath { }; class ObStoragePathUtil { - public: +public: // example: oss://runiu1/ob1.XX/all_tenant_id_list static int generate_all_tenant_id_list_file_path( const common::ObString& header_uri, const common::ObString& cluster_name, ObStoragePath& path); diff --git a/deps/oblib/src/lib/rowid/ob_urowid.h b/deps/oblib/src/lib/rowid/ob_urowid.h index ac721cbe5..979cba507 100644 --- a/deps/oblib/src/lib/rowid/ob_urowid.h +++ b/deps/oblib/src/lib/rowid/ob_urowid.h @@ -29,13 +29,13 @@ struct ObURowIDData { OB_UNIS_VERSION(1); friend class TestURowID; - private: +private: typedef int (*get_pk_val_func)(const uint8_t*, const int64_t, int64_t&, ObObj&); typedef int (*set_pk_val_func)(const ObObj&, uint8_t*, const int64_t, int64_t&); static get_pk_val_func inner_get_funcs_[ObMaxType]; static set_pk_val_func inner_set_funcs_[ObMaxType]; - public: +public: constexpr static int64_t INVALID_ROWID_VERSION = 0; constexpr static int64_t PK_ROWID_VERSION = 1; constexpr static int64_t NO_PK_ROWID_VERSION = 2; @@ -151,7 +151,7 @@ struct ObURowIDData { static int64_t needed_content_buf_size(const common::ObIArray& pk_vals); DECLARE_TO_STRING; - private: +private: static int decode_base64_str( const char* input, const int64_t input_len, uint8_t* output, const int64_t output_len, int64_t& pos); diff --git a/deps/oblib/src/lib/runtime.h b/deps/oblib/src/lib/runtime.h index 6660c335f..f02b203be 100644 --- a/deps/oblib/src/lib/runtime.h +++ b/deps/oblib/src/lib/runtime.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace lib { class RuntimeContext { - public: +public: PURE_VIRTUAL_NEED_SERIALIZE_AND_DESERIALIZE; }; diff --git a/deps/oblib/src/lib/signal/ob_memory_cutter.h b/deps/oblib/src/lib/signal/ob_memory_cutter.h index 93aa798d7..a11b7dd7b 100644 --- a/deps/oblib/src/lib/signal/ob_memory_cutter.h +++ b/deps/oblib/src/lib/signal/ob_memory_cutter.h @@ -18,17 +18,17 @@ namespace oceanbase { namespace lib { class AChunk; class ObIMemoryCutter { - public: +public: virtual void cut(int64_t& total_size) = 0; }; class ObMemoryCutter : public ObIMemoryCutter { - public: +public: virtual void cut(int64_t& total_size) override; static void free_chunk(const void* ptr, const uint64_t size); static uint64_t chunk_size(AChunk* chunk); - private: +private: void free_chunk(int64_t& total_size); void free_stack(int64_t& total_size); void free_memstore(int64_t& total_size); diff --git a/deps/oblib/src/lib/signal/ob_signal_processor.h b/deps/oblib/src/lib/signal/ob_signal_processor.h index f05193b25..3c515f332 100644 --- a/deps/oblib/src/lib/signal/ob_signal_processor.h +++ b/deps/oblib/src/lib/signal/ob_signal_processor.h @@ -34,7 +34,7 @@ namespace common { worker_thread: end() */ class ObSigProcessor { - public: +public: virtual int start() { return OB_SUCCESS; @@ -51,13 +51,13 @@ inline ObSigProcessor::~ObSigProcessor() {} class ObSigBTOnlyProcessor : public ObSigProcessor { - public: +public: ObSigBTOnlyProcessor(); ~ObSigBTOnlyProcessor(); int prepare() override; int process() override; - protected: +protected: int fd_; char filename_[128]; char buf_[1024]; @@ -65,13 +65,13 @@ class ObSigBTOnlyProcessor : public ObSigProcessor { }; class ObSigBTSQLProcessor : public ObSigBTOnlyProcessor { - public: +public: ObSigBTSQLProcessor() : sql_(nullptr) {} virtual int prepare() override; virtual int process() override; - private: +private: char* sql_; }; diff --git a/deps/oblib/src/lib/signal/ob_signal_struct.h b/deps/oblib/src/lib/signal/ob_signal_struct.h index 77234069b..9d6e2c7c3 100644 --- a/deps/oblib/src/lib/signal/ob_signal_struct.h +++ b/deps/oblib/src/lib/signal/ob_signal_struct.h @@ -28,7 +28,7 @@ extern const int MP_SIG; // MP means MULTI-PURPOSE extern const int SIG_STACK_SIZE; class DTraceId { - public: +public: DTraceId() : v_(0) {} int64_t value() @@ -37,7 +37,7 @@ class DTraceId { } static DTraceId gen_trace_id(); - private: +private: int64_t v_; }; extern __thread char tl_trace_id_buf[sizeof(DTraceId)]; @@ -45,7 +45,7 @@ extern __thread DTraceId* tl_trace_id; extern DTraceId& get_tl_trace_id(); extern DTraceId set_tl_trace_id(DTraceId& id); class DTraceIdGuard { - public: +public: DTraceIdGuard(DTraceId& id) : bak_(set_tl_trace_id(id)) {} ~DTraceIdGuard() @@ -53,14 +53,14 @@ class DTraceIdGuard { set_tl_trace_id(bak_); } - private: +private: DTraceId bak_; }; extern int install_ob_signal_handler(); class ObISigHandler { - public: +public: virtual void handle() = 0; virtual ~ObISigHandler() = 0; }; diff --git a/deps/oblib/src/lib/signal/ob_signal_utils.h b/deps/oblib/src/lib/signal/ob_signal_utils.h index 8f35c83af..bb9cd8367 100644 --- a/deps/oblib/src/lib/signal/ob_signal_utils.h +++ b/deps/oblib/src/lib/signal/ob_signal_utils.h @@ -43,7 +43,7 @@ struct DLogLevel { extern int g_log_level_; class LoggerSwitchGuard { - public: +public: static __thread bool g_logger_open_; LoggerSwitchGuard(bool open) : bak_(g_logger_open_) { @@ -54,7 +54,7 @@ class LoggerSwitchGuard { g_logger_open_ = bak_; } - private: +private: bool bak_; }; diff --git a/deps/oblib/src/lib/signal/ob_signal_worker.h b/deps/oblib/src/lib/signal/ob_signal_worker.h index 37289544c..d6783fc29 100644 --- a/deps/oblib/src/lib/signal/ob_signal_worker.h +++ b/deps/oblib/src/lib/signal/ob_signal_worker.h @@ -52,7 +52,7 @@ struct ObSigRequest { }; class ObSignalWorker : public lib::ThreadPool { - public: +public: ObSignalWorker(); ~ObSignalWorker(); void run1() override; @@ -72,12 +72,12 @@ struct MPHandlerCtx { }; class ObMPSigHandler : public ObISigHandler { - public: +public: ObMPSigHandler(MPHandlerCtx& ctx) : ctx_(ctx) {} void handle() override; - private: +private: MPHandlerCtx& ctx_; }; diff --git a/deps/oblib/src/lib/stat/ob_di_cache.h b/deps/oblib/src/lib/stat/ob_di_cache.h index 0b507f416..dd496deea 100644 --- a/deps/oblib/src/lib/stat/ob_di_cache.h +++ b/deps/oblib/src/lib/stat/ob_di_cache.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace common { class ObDISessionCollect : public ObDINode { - public: +public: ObDISessionCollect(); virtual ~ObDISessionCollect(); void clean(); @@ -37,7 +37,7 @@ class ObDISessionCollect : public ObDINode { }; class ObDITenantCollect : public ObDINode { - public: +public: ObDITenantCollect(); virtual ~ObDITenantCollect(); void clean(); @@ -47,7 +47,7 @@ class ObDITenantCollect : public ObDINode { }; class ObDISessionCache { - public: +public: static ObDISessionCache& get_instance(); void destroy(); @@ -56,7 +56,7 @@ class ObDISessionCache { int get_the_diag_info(uint64_t session_id, ObDISessionCollect*& diag_infos); int get_node(uint64_t session_id, ObDISessionCollect*& session_collect); - private: +private: struct ObSessionBucket { ObSessionBucket() : list_(), lock_() {} @@ -139,7 +139,7 @@ class ObDIBaseTenantCacheIterator; template class ObDIBaseTenantCache { - public: +public: ObDIBaseTenantCache(); virtual ~ObDIBaseTenantCache(); void get_the_diag_info(uint64_t tenant_id, ObDiagnoseTenantInfo& diag_infos); @@ -149,7 +149,7 @@ class ObDIBaseTenantCache { return &collects_[0]; } - private: +private: friend class ObDIBaseTenantCacheIterator; int add_node(uint64_t tenant_id, ObDITenantCollect*& tenant_collect); int del_node(uint64_t tenant_id); @@ -160,19 +160,19 @@ class ObDIBaseTenantCache { template class ObDIBaseTenantCacheIterator { - public: +public: ObDIBaseTenantCacheIterator(const ObDIBaseTenantCache& tenant_cache); virtual ~ObDIBaseTenantCacheIterator(); int get_next(const ObDITenantCollect*& collect); - private: +private: const ObDIBaseTenantCache& tenant_cache_; int64_t collect_idx_; DISALLOW_COPY_AND_ASSIGN(ObDIBaseTenantCacheIterator); }; class ObDIThreadTenantCache : public ObDINode { - public: +public: static const int64_t DEFAULT_TENANT_NODE_NUM = 32; ObDIThreadTenantCache(); @@ -188,12 +188,12 @@ class ObDIThreadTenantCache : public ObDINode { return tenant_cache_; } - private: +private: ObDIBaseTenantCache tenant_cache_; }; class ObDIGlobalTenantCache { - public: +public: static ObDIGlobalTenantCache& get_instance(); void link(ObDIThreadTenantCache* node); @@ -203,7 +203,7 @@ class ObDIGlobalTenantCache { int get_all_latch_stat(ObIAllocator& allocator, ObIArray >& diag_infos); int get_the_diag_info(uint64_t tenant_id, ObDiagnoseTenantInfo& diag_infos); - private: +private: ObDIGlobalTenantCache(); virtual ~ObDIGlobalTenantCache(); template @@ -214,7 +214,7 @@ class ObDIGlobalTenantCache { CALLBACK_FUNC& callback, ObTenantBucket* di_map, const int64_t di_map_bucket_num); int add_tenant_stat(ObDIThreadTenantCache& node); - private: +private: ObDIList list_; int64_t cnt_; DIRWLock lock_; diff --git a/deps/oblib/src/lib/stat/ob_di_tls.h b/deps/oblib/src/lib/stat/ob_di_tls.h index 18bdf2915..bb9db82ce 100644 --- a/deps/oblib/src/lib/stat/ob_di_tls.h +++ b/deps/oblib/src/lib/stat/ob_di_tls.h @@ -24,13 +24,13 @@ namespace common { template class ObDITls { - public: +public: static ObDITls& get_di_tls(); void destroy(); T* new_instance(); static T* get_instance(); - private: +private: ObDITls() : key_(INT32_MAX) { if (0 != pthread_key_create(&key_, destroy_thread_data_)) {} @@ -41,7 +41,7 @@ class ObDITls { } static void destroy_thread_data_(void* ptr); - private: +private: pthread_key_t key_; static __thread T* instance_; }; diff --git a/deps/oblib/src/lib/stat/ob_diagnose_info.h b/deps/oblib/src/lib/stat/ob_diagnose_info.h index 24a5893c5..2cbdf0cb4 100644 --- a/deps/oblib/src/lib/stat/ob_diagnose_info.h +++ b/deps/oblib/src/lib/stat/ob_diagnose_info.h @@ -53,14 +53,14 @@ struct ObLatchStatArray { }; class ObWaitEventHistoryIter { - public: +public: ObWaitEventHistoryIter(); virtual ~ObWaitEventHistoryIter(); int init(ObWaitEventDesc* items, const int64_t start_pos, int64_t item_cnt); int get_next(ObWaitEventDesc*& item); void reset(); - private: +private: ObWaitEventDesc* items_; int64_t curr_; int64_t start_pos_; @@ -68,7 +68,7 @@ class ObWaitEventHistoryIter { }; class ObWaitEventHistory { - public: +public: ObWaitEventHistory(); virtual ~ObWaitEventHistory(); int push(const int64_t event_no, const uint64_t timeout_ms, const uint64_t p1, const uint64_t p2, const uint64_t p3); @@ -80,7 +80,7 @@ class ObWaitEventHistory { int calc_wait_time(ObWaitEventDesc*& event_desc); void reset(); - private: +private: int get_next_and_compare( int64_t& iter_1, int64_t& iter_2, int64_t& cnt, const ObWaitEventHistory& other, ObWaitEventDesc* tmp); int64_t curr_pos_; @@ -92,7 +92,7 @@ class ObWaitEventHistory { class ObDiagnoseTenantInfo; class ObDiagnoseSessionInfo { - public: +public: ObDiagnoseSessionInfo(); virtual ~ObDiagnoseSessionInfo(); int add(ObDiagnoseSessionInfo& other); @@ -145,7 +145,7 @@ class ObDiagnoseSessionInfo { } TO_STRING_EMPTY(); - private: +private: ObWaitEventDesc curr_wait_; ObWaitEventDesc* max_wait_; ObWaitEventStat* total_wait_; @@ -157,7 +157,7 @@ class ObDiagnoseSessionInfo { }; class ObDiagnoseTenantInfo final { - public: +public: ObDiagnoseTenantInfo(); ~ObDiagnoseTenantInfo(); void add(const ObDiagnoseTenantInfo& other); @@ -187,7 +187,7 @@ class ObDiagnoseTenantInfo final { } TO_STRING_EMPTY(); - private: +private: ObWaitEventStatArray event_stats_; ObStatEventAddStatArray stat_add_stats_; ObStatEventSetStatArray stat_set_stats_; @@ -195,12 +195,12 @@ class ObDiagnoseTenantInfo final { }; class ObWaitEventGuard { - public: +public: explicit ObWaitEventGuard(const int64_t event_no, const uint64_t timeout_ms = 0, const int64_t p1 = 0, const int64_t p2 = 0, const int64_t p3 = 0, const bool is_atomic = false); ~ObWaitEventGuard(); - private: +private: int64_t event_no_; uint64_t wait_begin_time_; uint64_t timeout_ms_; @@ -209,21 +209,21 @@ class ObWaitEventGuard { }; class ObMaxWaitGuard { - public: +public: explicit ObMaxWaitGuard(ObWaitEventDesc* max_wait, ObDiagnoseSessionInfo* di = NULL); ~ObMaxWaitGuard(); - private: +private: ObWaitEventDesc* prev_wait_; ObDiagnoseSessionInfo* di_; }; class ObTotalWaitGuard { - public: +public: explicit ObTotalWaitGuard(ObWaitEventStat* total_wait, ObDiagnoseSessionInfo* di = NULL); ~ObTotalWaitGuard(); - private: +private: ObWaitEventStat* prev_wait_; ObDiagnoseSessionInfo* di_; }; diff --git a/deps/oblib/src/lib/stat/ob_session_stat.h b/deps/oblib/src/lib/stat/ob_session_stat.h index e4de334e0..985f67f70 100644 --- a/deps/oblib/src/lib/stat/ob_session_stat.h +++ b/deps/oblib/src/lib/stat/ob_session_stat.h @@ -23,7 +23,7 @@ struct ObSysSessionIds { }; class ObSessionDIBuffer { - public: +public: ObSessionDIBuffer(); virtual ~ObSessionDIBuffer(); int switch_both(const uint64_t tenant_id, const uint64_t session_id, const bool is_multi_thread_plan); @@ -44,7 +44,7 @@ class ObSessionDIBuffer { return tenant_cache_; } - private: +private: ObDIThreadTenantCache tenant_cache_; ObDISessionCollect local_session_collect_; ObDISessionCollect* session_collect_; @@ -54,23 +54,23 @@ class ObSessionDIBuffer { }; class ObSessionStatEstGuard { - public: +public: ObSessionStatEstGuard(const uint64_t tenant_id = OB_SYS_TENANT_ID, const uint64_t session_id = ObSysSessionIds::DEFAULT, const bool is_multi_thread_plan = false); virtual ~ObSessionStatEstGuard(); - private: +private: uint64_t prev_tenant_id_; uint64_t prev_session_id_; ObSessionDIBuffer* buffer_; }; class ObTenantStatEstGuard { - public: +public: explicit ObTenantStatEstGuard(uint64_t tenant_id = OB_SYS_TENANT_ID); virtual ~ObTenantStatEstGuard(); - private: +private: uint64_t prev_tenant_id_; ObSessionDIBuffer* buffer_; }; diff --git a/deps/oblib/src/lib/stat/ob_stat_template.h b/deps/oblib/src/lib/stat/ob_stat_template.h index 42e52dc00..bd1b4af20 100644 --- a/deps/oblib/src/lib/stat/ob_stat_template.h +++ b/deps/oblib/src/lib/stat/ob_stat_template.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class DIRWLock { - public: +public: DIRWLock(); ~DIRWLock(); int try_rdlock(); @@ -34,7 +34,7 @@ class DIRWLock { return lock_; } - private: +private: static const uint32_t WRITE_MASK = 1 << 30; volatile uint32_t lock_; }; @@ -45,12 +45,12 @@ class DIRWLock { // NOTE the class T must be a POD type template class ObStatArrayIter { - public: +public: ObStatArrayIter(); int init(T* item, const int64_t curr_idx, int64_t max_item_idx); int get_next(const T*& item); - private: +private: T* items_; int64_t curr_idx_; int64_t max_item_idx_; @@ -59,17 +59,17 @@ class ObStatArrayIter { // NOTE the class T must be a POD type template class ObStatArray { - public: +public: typedef ObStatArrayIter Iterator; - public: +public: ObStatArray(); int add(const ObStatArray& other); T* get(const int64_t idx); int get_iter(Iterator& iter); void reset(); - private: +private: T items_[N]; int64_t min_item_idx_; int64_t max_item_idx_; @@ -78,13 +78,13 @@ class ObStatArray { // NOTE the class T must be a POD type template class ObStatHistoryIter { - public: +public: ObStatHistoryIter(); int init(T* items, const int64_t start_pos, int64_t item_cnt); int get_next(T*& item); void reset(); - private: +private: T* items_; int64_t curr_; int64_t start_pos_; @@ -94,10 +94,10 @@ class ObStatHistoryIter { // NOTE the class T must be a POD type template class ObStatHistory { - public: +public: typedef ObStatHistoryIter Iterator; - public: +public: ObStatHistory(); int push(const T& item); int add(const ObStatHistory& other); @@ -105,7 +105,7 @@ class ObStatHistory { int get_last(T*& item); void reset(); - private: +private: T items_[N]; int64_t curr_pos_; int64_t item_cnt_; diff --git a/deps/oblib/src/lib/string/ob_fixed_length_string.h b/deps/oblib/src/lib/string/ob_fixed_length_string.h index d63b5904f..d4a8dec1f 100644 --- a/deps/oblib/src/lib/string/ob_fixed_length_string.h +++ b/deps/oblib/src/lib/string/ob_fixed_length_string.h @@ -23,7 +23,7 @@ template class ObFixedLengthString { OB_UNIS_VERSION(1); - public: +public: ObFixedLengthString(); ObFixedLengthString(const char* str); ObFixedLengthString(const ObString& str); @@ -77,7 +77,7 @@ class ObFixedLengthString { int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: char buf_[N]; }; diff --git a/deps/oblib/src/lib/string/ob_hex_utils_base.h b/deps/oblib/src/lib/string/ob_hex_utils_base.h index 6d79d0079..f02af5656 100644 --- a/deps/oblib/src/lib/string/ob_hex_utils_base.h +++ b/deps/oblib/src/lib/string/ob_hex_utils_base.h @@ -25,7 +25,7 @@ namespace common { * deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.cpp for raw type. */ class ObHexUtilsBase { - public: +public: static int unhex(const ObString& text, ObIAllocator& alloc, ObObj& result); static int hex(const ObString& text, ObIAllocator& alloc, ObObj& result); }; diff --git a/deps/oblib/src/lib/string/ob_sql_string.h b/deps/oblib/src/lib/string/ob_sql_string.h index 3d780c930..781beeee6 100644 --- a/deps/oblib/src/lib/string/ob_sql_string.h +++ b/deps/oblib/src/lib/string/ob_sql_string.h @@ -29,7 +29,7 @@ namespace common { // class ObSqlString { - public: +public: explicit ObSqlString(const lib::ObLabel& label = ObModIds::OB_SQL_STRING); virtual ~ObSqlString(); @@ -90,10 +90,10 @@ class ObSqlString { int extend(const int64_t size); - private: +private: int vappend(const char* fmt, va_list ap); - private: +private: static const int64_t MAX_SQL_STRING_LEN = 512; char* data_; int64_t data_size_; diff --git a/deps/oblib/src/lib/string/ob_string.h b/deps/oblib/src/lib/string/ob_string.h index af22c0999..bc9c1c716 100644 --- a/deps/oblib/src/lib/string/ob_string.h +++ b/deps/oblib/src/lib/string/ob_string.h @@ -32,10 +32,10 @@ extern uint64_t murmurhash(const void* data, int32_t len, uint64_t hash); * @data_length_ : actual data length of %ptr_ */ class ObString final { - public: +public: typedef int32_t obstr_size_t; - public: +public: ObString() : buffer_size_(0), data_length_(0), ptr_(NULL) {} @@ -633,7 +633,7 @@ class ObString final { return offsetof(ObString, ptr_) * 8; } - private: +private: obstr_size_t buffer_size_; obstr_size_t data_length_; char* ptr_; diff --git a/deps/oblib/src/lib/string/ob_strings.h b/deps/oblib/src/lib/string/ob_strings.h index 4c75f0244..4672e1040 100644 --- a/deps/oblib/src/lib/string/ob_strings.h +++ b/deps/oblib/src/lib/string/ob_strings.h @@ -24,7 +24,7 @@ namespace common { * */ class ObStrings { - public: +public: ObStrings(); virtual ~ObStrings(); int add_string(const ObString& str, int64_t* idx = NULL); @@ -35,7 +35,7 @@ class ObStrings { int64_t to_string(char* buf, const int64_t buf_len) const; NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: ObStringBuf buf_; ObArray strs_; diff --git a/deps/oblib/src/lib/task/ob_timer.h b/deps/oblib/src/lib/task/ob_timer.h index 435cd8b44..b113e59a2 100644 --- a/deps/oblib/src/lib/task/ob_timer.h +++ b/deps/oblib/src/lib/task/ob_timer.h @@ -31,7 +31,7 @@ class FakeTabletManager; namespace common { class ObTimerTask { - public: +public: ObTimerTask() : timeout_check_(true) {} virtual ~ObTimerTask(){}; @@ -64,12 +64,12 @@ class ObTimerTask { return true; } - private: +private: bool timeout_check_; }; class ObTimer : public lib::ThreadPool { - public: +public: friend class oceanbase::tests::blocksstable::FakeTabletManager; ObTimer() : tasks_num_(0), @@ -91,7 +91,7 @@ class ObTimer : public lib::ThreadPool { void wait(); // wait all running task finish void destroy(); - public: +public: int schedule(ObTimerTask& task, const int64_t delay, bool repeate = false); int schedule_repeate_task_immediately(ObTimerTask& task, const int64_t delay); bool task_exist(const common::ObTimerTask& task); @@ -108,7 +108,7 @@ class ObTimer : public lib::ThreadPool { } void dump() const; - private: +private: struct Token { Token() : scheduled_time(0), delay(0), task(NULL) {} @@ -125,7 +125,7 @@ class ObTimer : public lib::ThreadPool { int schedule_task(ObTimerTask& task, const int64_t delay, const bool repeate, const bool is_scheduled_immediately); DISALLOW_COPY_AND_ASSIGN(ObTimer); - private: +private: int32_t tasks_num_; int64_t wakeup_time_; bool is_inited_; diff --git a/deps/oblib/src/lib/task/ob_timer_monitor.h b/deps/oblib/src/lib/task/ob_timer_monitor.h index 310938b1d..05483528d 100644 --- a/deps/oblib/src/lib/task/ob_timer_monitor.h +++ b/deps/oblib/src/lib/task/ob_timer_monitor.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class ObTimerMonitor { - public: +public: static ObTimerMonitor& get_instance(); int init(); @@ -37,7 +37,7 @@ class ObTimerMonitor { ObTimerMonitor(const ObTimerMonitor&) = delete; ObTimerMonitor& operator=(const ObTimerMonitor&) = delete; - private: +private: ObTimerMonitor(); ~ObTimerMonitor(); @@ -48,12 +48,12 @@ class ObTimerMonitor { static const int64_t CHECK_INTERVAL = 10L * 1000L * 1000L; class ObTimerMonitorTask : public ObTimerTask { - public: + public: ObTimerMonitorTask(ObTimerMonitor& monitor); virtual ~ObTimerMonitorTask(); virtual void runTimerTask() override; - private: + private: ObTimerMonitor& monitor_; int64_t running_cnt_; }; diff --git a/deps/oblib/src/lib/thread/launcher.h b/deps/oblib/src/lib/thread/launcher.h index 8e731909d..e150fd879 100644 --- a/deps/oblib/src/lib/thread/launcher.h +++ b/deps/oblib/src/lib/thread/launcher.h @@ -76,7 +76,7 @@ namespace lib { // 6. All self-contained thread classes should inherit and follow this set of rules. // class ILauncher { - public: +public: virtual ~ILauncher() {} diff --git a/deps/oblib/src/lib/thread/ob_async_task_queue.h b/deps/oblib/src/lib/thread/ob_async_task_queue.h index 76339a36d..6ba0b86a4 100644 --- a/deps/oblib/src/lib/thread/ob_async_task_queue.h +++ b/deps/oblib/src/lib/thread/ob_async_task_queue.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace share { class ObAsyncTask { - public: +public: ObAsyncTask() : retry_interval_(RETRY_INTERVAL), retry_times_(INFINITE_RETRY_TIMES), last_execute_time_(0) {} @@ -46,7 +46,7 @@ class ObAsyncTask { inline int64_t get_last_execute_time() const; inline void set_last_execute_time(const int64_t execute_time); - private: +private: static const int64_t RETRY_INTERVAL = 1000 * 1000L; // 1s static const int64_t INFINITE_RETRY_TIMES = INT64_MAX; int64_t retry_interval_; // us @@ -95,7 +95,7 @@ inline void ObAsyncTask::set_last_execute_time(const int64_t execute_time) } class ObAsyncTaskQueue : public ObReentrantThread { - public: +public: // if thread_cnt > 1, be sure the task can be processed in different order // with push order ObAsyncTaskQueue(); @@ -107,7 +107,7 @@ class ObAsyncTaskQueue : public ObReentrantThread { int push(ObAsyncTask& task); - protected: +protected: static const int64_t TOTAL_LIMIT = 1024L * 1024L * 1024L; static const int64_t HOLD_LIMIT = 512L * 1024L * 1024L; static const int64_t PAGE_SIZE = common::OB_MALLOC_BIG_BLOCK_SIZE; @@ -119,12 +119,12 @@ class ObAsyncTaskQueue : public ObReentrantThread { } int pop(ObAsyncTask*& task); - protected: +protected: bool is_inited_; common::ObLightyQueue queue_; common::ObConcurrentFIFOAllocator allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAsyncTaskQueue); }; } // end namespace share diff --git a/deps/oblib/src/lib/thread/ob_cache_line_segregated_array.h b/deps/oblib/src/lib/thread/ob_cache_line_segregated_array.h index 8ddda39be..43e39364a 100644 --- a/deps/oblib/src/lib/thread/ob_cache_line_segregated_array.h +++ b/deps/oblib/src/lib/thread/ob_cache_line_segregated_array.h @@ -41,15 +41,15 @@ namespace common { */ template class ObCacheLineSegregatedArray { - private: +private: void* array_; int64_t step_len_; int64_t arena_num_; - public: +public: TO_STRING_KV(KP(this), K_(array), K_(step_len), K_(arena_num)); - public: +public: int init(void* array, int64_t step_len, int64_t arena_num) { int ret = OB_SUCCESS; @@ -123,12 +123,12 @@ class ObCacheLineSegregatedArray { * +---------------------------------------+ */ class ObCacheLineSegregatedArrayBase { - public: +public: static const int64_t ALLOC_SIZE = OB_MALLOC_BIG_BLOCK_SIZE; static const int64_t CHUNK_SIZE = ALLOC_SIZE - 16; static const int64_t CHUNK_MAGIC = 0xFFEEE000000EEEFF; - public: +public: static ObCacheLineSegregatedArrayBase& get_instance() { static ObCacheLineSegregatedArrayBase instance_; @@ -159,10 +159,10 @@ class ObCacheLineSegregatedArrayBase { return ret; } - public: +public: TO_STRING_KV(KP(this), K_(chunk), K_(arena_num), K_(arena_size), K_(alloc_pos), K_(mutex)); - private: +private: ObCacheLineSegregatedArrayBase() : chunk_(0), arena_num_(0), arena_size_(0), alloc_pos_(0) { arena_num_ = get_cpu_count(); @@ -185,7 +185,7 @@ class ObCacheLineSegregatedArrayBase { return ret; } - private: +private: void* chunk_; int64_t arena_num_; int64_t arena_size_; diff --git a/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.h b/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.h index 36f6970ef..6660deb6b 100644 --- a/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.h +++ b/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.h @@ -35,14 +35,14 @@ struct ObDynamicThreadInfo { }; class ObDynamicThreadTask { - public: +public: virtual ~ObDynamicThreadTask() {} virtual int process(const bool& is_stop) = 0; }; class ObDynamicThreadPool : public lib::ThreadPool { - public: +public: static const int64_t MAX_THREAD_NUM = 512; static const int64_t MAX_TASK_NUM = 1024 * 1024; static const int64_t DEFAULT_CHECK_TIME_MS = 1000; // 1s @@ -64,7 +64,7 @@ class ObDynamicThreadPool : public lib::ThreadPool { TO_STRING_KV(K_(is_inited), K_(is_stop), K_(thread_num), K_(need_idle), K_(start_thread_num), K_(stop_thread_num), "left_task", task_queue_.get_total()); - private: +private: int check_thread_status(); int stop_all_threads(); void wakeup(); @@ -74,7 +74,7 @@ class ObDynamicThreadPool : public lib::ThreadPool { int pop_task(ObDynamicThreadTask*& task); static void* task_thread_func(void* data); - private: +private: bool is_inited_; volatile bool is_stop_; int64_t thread_num_; diff --git a/deps/oblib/src/lib/thread/ob_multi_fixed_queue_thread.h b/deps/oblib/src/lib/thread/ob_multi_fixed_queue_thread.h index b5b9eca28..dde3ec454 100644 --- a/deps/oblib/src/lib/thread/ob_multi_fixed_queue_thread.h +++ b/deps/oblib/src/lib/thread/ob_multi_fixed_queue_thread.h @@ -26,18 +26,18 @@ class ObMQThread { typedef ObMultiFixedQueue MQueue; - public: +public: ObMQThread(); virtual ~ObMQThread(); - public: +public: virtual int handle(void* data, const int64_t thread_index, volatile bool& stop_flag) = 0; - public: +public: virtual int thread_begin(); virtual void thread_end(); - public: +public: int init(const int64_t thread_num, const int64_t queue_size); void destroy(); int start(); @@ -66,11 +66,11 @@ class ObMQThread { // Get number of tasks in the queue corresponding to thread with thread_idx int get_task_num(const int64_t thread_idx, int64_t& task_count); - private: +private: static void* thread_func_(void* arg); int next_task_(int64_t queue_index, void*& task); - private: +private: bool inited_; int64_t thread_num_; int64_t thread_counter_; @@ -80,7 +80,7 @@ class ObMQThread { pthread_t tids_[MAX_THREAD_NUM]; MQueue queue_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMQThread); }; diff --git a/deps/oblib/src/lib/thread/ob_reentrant_thread.h b/deps/oblib/src/lib/thread/ob_reentrant_thread.h index 8cf0180f9..2ba2b0c1c 100644 --- a/deps/oblib/src/lib/thread/ob_reentrant_thread.h +++ b/deps/oblib/src/lib/thread/ob_reentrant_thread.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace share { class ObReentrantThread : public lib::ThreadPool { - public: +public: ObReentrantThread(); virtual ~ObReentrantThread(); @@ -46,7 +46,7 @@ class ObReentrantThread : public lib::ThreadPool { return thread_name_; } - protected: +protected: // run thread interface, return void virtual void run2() = 0; @@ -74,13 +74,13 @@ class ObReentrantThread : public lib::ThreadPool { return cond_; } - private: +private: void run1() final; - protected: +protected: volatile bool stop_; - private: +private: volatile bool created_; int64_t running_cnt_; int64_t blocking_runnign_cnt_; diff --git a/deps/oblib/src/lib/thread/ob_simple_thread_pool.h b/deps/oblib/src/lib/thread/ob_simple_thread_pool.h index 743e16130..11e49cd5f 100644 --- a/deps/oblib/src/lib/thread/ob_simple_thread_pool.h +++ b/deps/oblib/src/lib/thread/ob_simple_thread_pool.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class ObAdaptiveStrategy { - public: +public: ObAdaptiveStrategy() : least_thread_num_(0), estimate_ts_(0), expand_rate_(0), shrink_rate_(0) {} ObAdaptiveStrategy( @@ -34,7 +34,7 @@ class ObAdaptiveStrategy { ~ObAdaptiveStrategy() {} - public: +public: int64_t get_least_thread_num() const { return least_thread_num_; @@ -57,10 +57,10 @@ class ObAdaptiveStrategy { expand_rate_ > shrink_rate_; } - public: +public: TO_STRING_KV(K_(least_thread_num), K_(estimate_ts), K_(expand_rate), K_(shrink_rate)); - private: +private: int64_t least_thread_num_; int64_t estimate_ts_; int64_t expand_rate_; @@ -71,7 +71,7 @@ class ObSimpleThreadPool : public lib::ThreadPool { static const int64_t QUEUE_WAIT_TIME = 100 * 1000; static const int64_t MAX_THREAD_NUM = 256; - public: +public: ObSimpleThreadPool(); virtual ~ObSimpleThreadPool(); @@ -84,19 +84,19 @@ class ObSimpleThreadPool : public lib::ThreadPool { } int set_adaptive_strategy(const ObAdaptiveStrategy& strategy); - protected: +protected: int64_t get_total_thread_num() const { return total_thread_num_; } - private: +private: virtual void handle(void* task) = 0; - protected: +protected: void run1(); - private: +private: const char* name_; bool is_inited_; ObLightyQueue queue_; diff --git a/deps/oblib/src/lib/thread/ob_thread_lease.h b/deps/oblib/src/lib/thread/ob_thread_lease.h index b530eb177..3989a5422 100644 --- a/deps/oblib/src/lib/thread/ob_thread_lease.h +++ b/deps/oblib/src/lib/thread/ob_thread_lease.h @@ -29,10 +29,10 @@ namespace common { * 4. HANDLING -> IDLE: thread succ to revoke lease **/ class ObThreadLease { - public: +public: typedef enum { IDLE = 0, READY = 1, HANDLING = 2 } StatusType; - public: +public: ObThreadLease() : status_(IDLE) {} ~ObThreadLease() @@ -51,7 +51,7 @@ class ObThreadLease { status_ = IDLE; } - public: +public: bool acquire() { bool bool_ret = false; @@ -117,7 +117,7 @@ class ObThreadLease { return bool_ret; } - private: +private: StatusType status_; }; diff --git a/deps/oblib/src/lib/thread/ob_work_queue.h b/deps/oblib/src/lib/thread/ob_work_queue.h index 0cf85c21b..7e152b01f 100644 --- a/deps/oblib/src/lib/thread/ob_work_queue.h +++ b/deps/oblib/src/lib/thread/ob_work_queue.h @@ -23,7 +23,7 @@ class ObWorkQueue; // 1. whether the timer task is repeat // 2. whether the async task need retry when failed class ObAsyncTimerTask : public share::ObAsyncTask, public common::ObTimerTask { - public: +public: ObAsyncTimerTask(ObWorkQueue& work_queue) : work_queue_(work_queue) { set_retry_times(0); // don't retry when process failed by default @@ -37,19 +37,19 @@ class ObAsyncTimerTask : public share::ObAsyncTask, public common::ObTimerTask { virtual int64_t get_deep_copy_size() const override = 0; virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override = 0; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAsyncTimerTask); // function members - protected: +protected: // data members ObWorkQueue& work_queue_; }; class ObWorkQueue { - public: +public: ObWorkQueue(); virtual ~ObWorkQueue(); @@ -69,7 +69,7 @@ class ObWorkQueue { int stop(); int wait(); - private: +private: bool inited_; common::ObTimer timer_; share::ObAsyncTaskQueue task_queue_; diff --git a/deps/oblib/src/lib/thread/runnable.h b/deps/oblib/src/lib/thread/runnable.h index a646a71bd..c1bd0f214 100644 --- a/deps/oblib/src/lib/thread/runnable.h +++ b/deps/oblib/src/lib/thread/runnable.h @@ -22,7 +22,7 @@ class CThread; */ class Runnable { - public: +public: /* * Destructor */ diff --git a/deps/oblib/src/lib/thread/thread_mgr.h b/deps/oblib/src/lib/thread/thread_mgr.h index 824113420..264350b86 100644 --- a/deps/oblib/src/lib/thread/thread_mgr.h +++ b/deps/oblib/src/lib/thread/thread_mgr.h @@ -30,7 +30,7 @@ namespace lib { using common::ObDedupQueue; class ThreadCountPair { - public: +public: ThreadCountPair(int64_t cnt, int64_t mini_mode_cnt) : cnt_(cnt), mini_mode_cnt_(mini_mode_cnt) {} int64_t get_thread_cnt() const @@ -38,7 +38,7 @@ class ThreadCountPair { return !is_mini_mode() ? cnt_ : mini_mode_cnt_; } - private: +private: int64_t cnt_; int64_t mini_mode_cnt_; }; @@ -72,7 +72,7 @@ enum class TGType { }; class TGCommonAttr { - public: +public: const char* name_; const char* desc_; enum TGScope scope_; @@ -88,7 +88,7 @@ extern void lib_init_create_func(); extern bool create_func_inited_; class ITG { - public: +public: virtual ~ITG() {} virtual int64_t thread_cnt() = 0; @@ -162,7 +162,7 @@ template class TG; class MyThreadPool : public lib::ThreadPool { - public: +public: void run1() override { runnable_->set_thread_idx(get_thread_idx()); @@ -173,7 +173,7 @@ class MyThreadPool : public lib::ThreadPool { template <> class TG : public ITG { - public: +public: TG(ThreadCountPair pair) : thread_cnt_(pair.get_thread_cnt()) {} ~TG() @@ -232,14 +232,14 @@ class TG : public ITG { } } - private: +private: char buf_[sizeof(MyThreadPool)]; MyThreadPool* th_ = nullptr; int thread_cnt_; }; class MySimpleThreadPool : public common::ObSimpleThreadPool { - public: +public: void run1() override { handler_->set_thread_cnt(get_thread_count()); @@ -255,7 +255,7 @@ class MySimpleThreadPool : public common::ObSimpleThreadPool { template <> class TG : public ITG { - public: +public: TG(ThreadCountPair pair, const int64_t task_num_limit) : thread_num_(pair.get_thread_cnt()), task_num_limit_(task_num_limit) {} @@ -334,7 +334,7 @@ class TG : public ITG { } } - private: +private: char buf_[sizeof(MySimpleThreadPool)]; MySimpleThreadPool* qth_ = nullptr; int64_t thread_num_; @@ -343,7 +343,7 @@ class TG : public ITG { template <> class TG : public ITG { - public: +public: TG(ThreadCountPair pair, const int64_t queue_size = ObDedupQueue::TASK_QUEUE_SIZE, const int64_t task_map_size = ObDedupQueue::TASK_MAP_SIZE, const int64_t total_mem_limit = ObDedupQueue::TOTAL_LIMIT, @@ -420,7 +420,7 @@ class TG : public ITG { } } - private: +private: char buf_[sizeof(common::ObDedupQueue)]; common::ObDedupQueue* qth_ = nullptr; int32_t thread_num_; @@ -434,7 +434,7 @@ class TG : public ITG { template <> class TG : public ITG { - public: +public: ~TG() { destroy(); @@ -518,14 +518,14 @@ class TG : public ITG { } } - private: +private: char buf_[sizeof(common::ObTimer)]; common::ObTimer* timer_ = nullptr; }; template <> class TG : public ITG { - public: +public: TG(lib::ThreadCountPair pair, const int64_t queue_size) : thread_cnt_(pair.get_thread_cnt()), queue_size_(queue_size) {} ~TG() @@ -582,7 +582,7 @@ class TG : public ITG { } } - private: +private: char buf_[sizeof(share::ObAsyncTaskQueue)]; share::ObAsyncTaskQueue* qth_ = nullptr; int thread_cnt_; @@ -594,7 +594,7 @@ class TG : public ITG { static constexpr int MAX_CNT = 32; using TimerType = TG; - public: +public: TG(ThreadCountPair pair) : cnt_(pair.get_thread_cnt()) {} ~TG() @@ -674,7 +674,7 @@ class TG : public ITG { } } - private: +private: char buf_[sizeof(TimerType) * MAX_CNT]; TimerType* timers_[MAX_CNT] = {nullptr}; const int cnt_ = 0; @@ -687,7 +687,7 @@ class TGCLSMap; namespace lib { \ template <> \ class TGCLSMap { \ - public: \ + public: \ using CLS = CLS_; \ }; \ } @@ -703,11 +703,11 @@ BIND_TG_CLS(TGType::ASYNC_TASK_QUEUE, TG); namespace lib { class TGMgr { - private: +private: TGMgr(); ~TGMgr(); - public: +public: static TGMgr& instance() { static TGMgr mgr; @@ -740,20 +740,20 @@ class TGMgr { } void destroy_tg(int tg_id); - private: +private: static constexpr int MAX_ID = 1024; common::ObLatchMutex lock_; ABitSet bs_; char bs_buf_[ABitSet::buf_len(MAX_ID)]; - public: +public: ITG* tgs_[MAX_ID] = {nullptr}; int default_tg_id_map_[TGDefIDs::END] = {-1}; }; template class FWrap { - public: +public: int operator()(Func func) { return func(); @@ -762,7 +762,7 @@ class FWrap { template class FWrap { - public: +public: int operator()(Func func) { func(); diff --git a/deps/oblib/src/lib/thread/thread_mgr_interface.h b/deps/oblib/src/lib/thread/thread_mgr_interface.h index b4ce0dbef..05ea60a35 100644 --- a/deps/oblib/src/lib/thread/thread_mgr_interface.h +++ b/deps/oblib/src/lib/thread/thread_mgr_interface.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace lib { class TGRunnable { - public: +public: virtual void run1() = 0; bool has_set_stop() const { @@ -38,13 +38,13 @@ class TGRunnable { thread_idx_ = thread_idx; } - private: +private: bool stop_ = true; static __thread uint64_t thread_idx_; }; class TGTaskHandler { - public: +public: virtual void handle(void* task) = 0; uint64_t get_thread_idx() const { @@ -63,7 +63,7 @@ class TGTaskHandler { return n_threads_; } - private: +private: int64_t n_threads_ = 0; static __thread uint64_t thread_idx_; }; diff --git a/deps/oblib/src/lib/thread/thread_pool.h b/deps/oblib/src/lib/thread/thread_pool.h index 71e573186..4a3b270b1 100644 --- a/deps/oblib/src/lib/thread/thread_pool.h +++ b/deps/oblib/src/lib/thread/thread_pool.h @@ -24,7 +24,7 @@ namespace lib { // lib/coro/co_user_thread.h using CoUserThread = CoUserThreadTemp; class ThreadPool : public lib::CoKThread /* CoKThreadTemp */ { - public: +public: void run(int64_t idx) final { thread_idx_ = static_cast(idx); @@ -46,13 +46,13 @@ class ThreadPool : public lib::CoKThread /* CoKThreadTemp */ virtual void run1() = 0; - protected: +protected: uint64_t get_thread_idx() const { return thread_idx_; } - private: +private: static __thread uint64_t thread_idx_; }; diff --git a/deps/oblib/src/lib/thread_local/ob_tsi_factory.h b/deps/oblib/src/lib/thread_local/ob_tsi_factory.h index bff10db1b..58a488561 100644 --- a/deps/oblib/src/lib/thread_local/ob_tsi_factory.h +++ b/deps/oblib/src/lib/thread_local/ob_tsi_factory.h @@ -233,7 +233,7 @@ enum TSITransType {}; template class Wrapper { - public: +public: Wrapper() : instance_(NULL) {} ~Wrapper() @@ -244,13 +244,13 @@ class Wrapper { } } - public: +public: T*& get_instance() { return instance_; } - private: +private: T* instance_; }; @@ -271,7 +271,7 @@ class Wrapper { // (GET_TSI(Wrapper)->get_instance() = new(std::nothrow) type(args))) : NULL class TSINodeBase { - public: +public: TSINodeBase() : next(NULL) {} virtual ~TSINodeBase() @@ -283,7 +283,7 @@ class TSINodeBase { template class TSINode : public TSINodeBase { - public: +public: explicit TSINode(T* instance) : instance_(instance) {} virtual ~TSINode() @@ -300,13 +300,13 @@ class TSINode : public TSINodeBase { } } - private: +private: T* instance_; }; template class TSINode : public TSINodeBase { - public: +public: explicit TSINode(T (*instance)[N]) : instance_(*instance) {} virtual ~TSINode() @@ -319,14 +319,14 @@ class TSINode : public TSINodeBase { } } - private: +private: T* instance_; }; class ThreadSpecInfo { static const int64_t PAGE_SIZE = common::ModuleArena::DEFAULT_PAGE_SIZE; - public: +public: ThreadSpecInfo() : list_(NULL), mod_(ObModIds::OB_TSI_FACTORY), alloc_(PAGE_SIZE, mod_) {} ~ThreadSpecInfo() @@ -340,7 +340,7 @@ class ThreadSpecInfo { list_ = NULL; } - public: +public: template T* get_instance() { @@ -376,7 +376,7 @@ class ThreadSpecInfo { return instance; }; - private: +private: TSINodeBase* list_; common::ModulePageAllocator mod_; common::ModuleArena alloc_; @@ -390,13 +390,13 @@ extern void tsi_factory_destroy(); class TSIFactory { static const pthread_key_t INVALID_THREAD_KEY = INT32_MAX; - public: +public: TSIFactory() : key_(INVALID_THREAD_KEY) {} ~TSIFactory() {} - public: +public: int init() { int ret = OB_SUCCESS; @@ -457,7 +457,7 @@ class TSIFactory { return instance; } - private: +private: static void destroy_thread_data_(void* ptr) { if (NULL != ptr) { @@ -466,7 +466,7 @@ class TSIFactory { } } - private: +private: pthread_key_t key_; }; diff --git a/deps/oblib/src/lib/thread_local/ob_tsi_utils.cpp b/deps/oblib/src/lib/thread_local/ob_tsi_utils.cpp index e77cb2ab5..ec0bde0f6 100644 --- a/deps/oblib/src/lib/thread_local/ob_tsi_utils.cpp +++ b/deps/oblib/src/lib/thread_local/ob_tsi_utils.cpp @@ -23,7 +23,7 @@ volatile int64_t max_used_itid = INVALID_ITID; class FreeItid { static pthread_key_t the_key; - public: +public: FreeItid() { int ret = pthread_key_create(&the_key, [](void* arg) { diff --git a/deps/oblib/src/lib/thread_local/ob_tsi_utils.h b/deps/oblib/src/lib/thread_local/ob_tsi_utils.h index ead160d85..ed8dd7f18 100644 --- a/deps/oblib/src/lib/thread_local/ob_tsi_utils.h +++ b/deps/oblib/src/lib/thread_local/ob_tsi_utils.h @@ -83,7 +83,7 @@ inline int icore_id() } class SimpleItem { - public: +public: SimpleItem() : value_(0) {} ~SimpleItem() diff --git a/deps/oblib/src/lib/thread_local/thread_buffer.h b/deps/oblib/src/lib/thread_local/thread_buffer.h index 68c7874dd..88fff14a4 100644 --- a/deps/oblib/src/lib/thread_local/thread_buffer.h +++ b/deps/oblib/src/lib/thread_local/thread_buffer.h @@ -25,11 +25,11 @@ namespace common { * and free when thread exit. */ class ThreadSpecificBuffer { - public: +public: explicit ThreadSpecificBuffer(const int32_t size = MAX_THREAD_BUFFER_SIZE); ~ThreadSpecificBuffer(); class Buffer { - public: + public: Buffer(char* start, const int32_t size) : end_of_storage_(start + size), end_(start) {} char* ptr(); @@ -53,23 +53,23 @@ class ThreadSpecificBuffer { return end_; } - private: + private: char* end_of_storage_; char* end_; char start_[0]; }; Buffer* get_buffer() const; - private: +private: int create_thread_key(); int delete_thread_key(); static void destroy_thread_key(void* ptr); DISALLOW_COPY_AND_ASSIGN(ThreadSpecificBuffer); - private: +private: static const int32_t MAX_THREAD_BUFFER_SIZE = OB_MALLOC_BIG_BLOCK_SIZE; - private: +private: pthread_key_t key_; int32_t size_; }; diff --git a/deps/oblib/src/lib/time/Time.h b/deps/oblib/src/lib/time/Time.h index 9e8df2aef..20dfa286e 100644 --- a/deps/oblib/src/lib/time/Time.h +++ b/deps/oblib/src/lib/time/Time.h @@ -16,7 +16,7 @@ namespace tbutil { * @brief Time class provide interface for time operation */ class Time { - public: +public: Time(); enum Clock { Realtime, Monotonic }; @@ -238,7 +238,7 @@ class Time { Time(int64_t); - private: +private: int64_t _usec; }; } // namespace tbutil diff --git a/deps/oblib/src/lib/time/ob_cur_time.h b/deps/oblib/src/lib/time/ob_cur_time.h index e628c3964..842b11a67 100644 --- a/deps/oblib/src/lib/time/ob_cur_time.h +++ b/deps/oblib/src/lib/time/ob_cur_time.h @@ -20,7 +20,7 @@ namespace common { extern volatile int64_t g_cur_time; class TimeUpdateDuty : public common::ObTimerTask { - public: +public: static const int64_t SCHEDULE_PERIOD = 2000; TimeUpdateDuty(){}; virtual ~TimeUpdateDuty(){}; diff --git a/deps/oblib/src/lib/time/ob_time_utility.h b/deps/oblib/src/lib/time/ob_time_utility.h index 1f4f2c28f..17f9ee1aa 100644 --- a/deps/oblib/src/lib/time/ob_time_utility.h +++ b/deps/oblib/src/lib/time/ob_time_utility.h @@ -23,14 +23,14 @@ namespace oceanbase { namespace common { class ObTimeUtility { - public: +public: static int64_t current_time(); static int64_t fast_current_time(); static int64_t current_monotonic_time(); static int64_t current_time_coarse(); static int64_t current_monotonic_raw_time(); - private: +private: static int64_t current_monotonic_time_(); ObTimeUtility() = delete; }; diff --git a/deps/oblib/src/lib/time/ob_tsc_timestamp.h b/deps/oblib/src/lib/time/ob_tsc_timestamp.h index 1c9729c53..b5bed12ac 100644 --- a/deps/oblib/src/lib/time/ob_tsc_timestamp.h +++ b/deps/oblib/src/lib/time/ob_tsc_timestamp.h @@ -106,7 +106,7 @@ namespace oceanbase { namespace common { class ObTscBase { - public: +public: ObTscBase() : start_us_(0), tsc_count_(0) {} ~ObTscBase() @@ -124,7 +124,7 @@ class ObTscBase { }; class ObTscTimestamp { - public: +public: ObTscTimestamp() : is_init_(false), start_us_(0), tsc_count_(0), scale_(0) {} ~ObTscTimestamp() @@ -139,7 +139,7 @@ class ObTscTimestamp { return instance; } - private: +private: static const int64_t MAX_CPU_COUNT = 1024; #if defined(__x86_64__) uint64_t get_cpufreq_khz_(); @@ -162,7 +162,7 @@ class ObTscTimestamp { return false; } #endif - private: +private: bool is_init_; int64_t start_us_; uint64_t tsc_count_; diff --git a/deps/oblib/src/lib/time/tbtimeutil.h b/deps/oblib/src/lib/time/tbtimeutil.h index a91551949..c67280b36 100644 --- a/deps/oblib/src/lib/time/tbtimeutil.h +++ b/deps/oblib/src/lib/time/tbtimeutil.h @@ -26,7 +26,7 @@ namespace obsys { * @brief Simple encapsulation of linux time operation */ class CTimeUtil { - public: +public: /** * ms timestamp */ diff --git a/deps/oblib/src/lib/timezone/ob_oracle_format_models.h b/deps/oblib/src/lib/timezone/ob_oracle_format_models.h index 38f670529..10f476c79 100644 --- a/deps/oblib/src/lib/timezone/ob_oracle_format_models.h +++ b/deps/oblib/src/lib/timezone/ob_oracle_format_models.h @@ -56,7 +56,7 @@ struct ObDFMLimit { }; class ObDFMFlag { - public: +public: // ElementFlag are defined according to oracle doc // see Format Models: https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#i34924 // Note: FF1-FF9 and FF should be together @@ -302,7 +302,7 @@ class ObDFMFlag { return is_flag_valid(flag) && (EXPECTED_MATCHING_LENGTH[flag] > 0); } - private: +private: static int64_t calc_max_len_of_patterns(); }; @@ -381,7 +381,7 @@ struct ObDFMElem { typedef ObIArray ObDFMElemArr; class ObDFMUtil { - public: +public: static const int64_t UNKNOWN_LENGTH_OF_ELEMENT = 20; static const int64_t COMMON_ELEMENT_NUMBER = 10; static int parse_datetime_format_string(const ObString& fmt_str, ObDFMElemArr& elements); @@ -426,7 +426,7 @@ class ObDFMUtil { return '-' == ch || '+' == ch; } - private: +private: static inline bool is_uppercase_char(const char ch) { return (0 == (ch & (1 << 5))); diff --git a/deps/oblib/src/lib/timezone/ob_time_convert.h b/deps/oblib/src/lib/timezone/ob_time_convert.h index 7a0932252..12349171c 100644 --- a/deps/oblib/src/lib/timezone/ob_time_convert.h +++ b/deps/oblib/src/lib/timezone/ob_time_convert.h @@ -160,7 +160,7 @@ struct ObIntervalLimit { }; class ObIntervalParts { - public: +public: ObIntervalParts() { reset(); @@ -193,7 +193,7 @@ class ObIntervalParts { }; class ObTime { - public: +public: ObTime() : mode_(0), time_zone_id_(common::OB_INVALID_INDEX), @@ -280,7 +280,7 @@ struct ObTimeConvertCtx { bool is_timestamp_; // means mysql timestamp? }; class ObTimeConverter { - public: +public: // ZERO_DATETIME is the minimal value that satisfied: 0 == value % USECS_PER_DAY. static const int64_t ZERO_DATETIME = static_cast(-9223372022400000000); @@ -295,7 +295,7 @@ class ObTimeConverter { static const ObString COMPAT_OLD_NLS_TIMESTAMP_FORMAT; static const ObString COMPAT_OLD_NLS_TIMESTAMP_TZ_FORMAT; - public: +public: // int / double / string -> datetime(timestamp) / interval / date / time / year. static int int_to_datetime(int64_t int_part, int64_t dec_part, const ObTimeConvertCtx& cvrt_ctx, int64_t& value); static int int_to_date(int64_t int64, int32_t& value); @@ -391,7 +391,7 @@ class ObTimeConverter { static int calc_days_and_months_between_dates( const int64_t date_value1, const int64_t date_value2, int64_t& months_diff, int64_t& rest_utc_diff); - public: +public: // int / string -> ObTime / ObInterval <- datetime(timestamp) / date / time / year. static int int_to_ob_time_with_date(int64_t int64, ObTime& ob_time, bool is_dayofmonth = false); static int int_to_ob_time_without_date(int64_t int64, ObTime& ob_time); @@ -462,7 +462,7 @@ class ObTimeConverter { static int encode_interval_ds( char* buf, const int64_t len, int64_t& pos, const ObIntervalDSValue& value, const ObScale scale); - public: +public: // other functions. static int set_ob_time_part_directly( ObTime& ob_time, int64_t& conflict_bitset, const int64_t part_offset, const int32_t part_value); @@ -499,7 +499,7 @@ class ObTimeConverter { }; enum ObHourFlag { HOUR_UNUSE, HOUR_AM, HOUR_PM }; - private: +private: // date add / sub / diff. static int merge_date_interval( int64_t base_value, const ObString& interval_str, ObDateUnitType unit_type, int64_t& value, bool is_add); @@ -552,7 +552,7 @@ class ObTimeConverter { static int set_ob_time_year_may_conflict( ObTime& ob_time, int32_t& julian_year_value, int32_t check_year, int32_t set_year, bool overwrite); - private: +private: ObTimeConverter(); virtual ~ObTimeConverter(); DISALLOW_COPY_AND_ASSIGN(ObTimeConverter); diff --git a/deps/oblib/src/lib/timezone/ob_timezone_info.h b/deps/oblib/src/lib/timezone/ob_timezone_info.h index 362450ca5..a973b245d 100644 --- a/deps/oblib/src/lib/timezone/ob_timezone_info.h +++ b/deps/oblib/src/lib/timezone/ob_timezone_info.h @@ -28,7 +28,7 @@ class ObIntervalScaleUtil; // timestamp ltz store utc time // sizeof()=12 class ObOTimestampData { - public: +public: static const int32_t MIN_OFFSET_MINUTES = -15 * 60 - 59; static const int32_t MAX_OFFSET_MINUTES = 15 * 60 + 59; static const int32_t MAX_OFFSET_MINUTES_STRICT = 15 * 60; @@ -104,7 +104,7 @@ class ObOTimestampData { }; } __attribute__((packed)); - public: +public: ObOTimestampData() : time_ctx_(), time_us_(0) {} ObOTimestampData(const int64_t time_us, const UnionTZCtx tz_ctx) : time_ctx_(tz_ctx), time_us_(time_us) @@ -188,7 +188,7 @@ class ObOTimestampData { DECLARE_TO_STRING; - public: +public: UnionTZCtx time_ctx_; // time ctx, such as version, tail_ns, tz_id... int64_t time_us_; // full time with usec, same as timestamp } __attribute__((packed)); @@ -233,7 +233,7 @@ class ObTenantTimezone; // wrap ObTZInfoMap with ref count class ObTZMapWrap { - public: +public: ObTZMapWrap() : tz_info_map_(nullptr) {} ~ObTZMapWrap(); @@ -243,14 +243,14 @@ class ObTZMapWrap { } void set_tz_map(const common::ObTZInfoMap* tz_info_map); - private: +private: ObTZInfoMap* tz_info_map_; }; class ObTimeZoneInfo { OB_UNIS_VERSION(1); - public: +public: ObTimeZoneInfo() : error_on_overlap_time_(false), tz_map_wrap_(), tz_id_(common::OB_INVALID_TZ_ID), offset_(0) {} virtual ~ObTimeZoneInfo() @@ -304,17 +304,17 @@ class ObTimeZoneInfo { } TO_STRING_KV(N_ID, tz_id_, N_OFFSET, offset_, N_ERROR_ON_OVERLAP_TIME, error_on_overlap_time_); - private: +private: static ObTimeZoneName TIME_ZONE_NAMES[]; static ObTimeZoneTrans TIME_ZONE_TRANS[]; - protected: +protected: bool error_on_overlap_time_; // do not serialize it ObTZMapWrap tz_map_wrap_; - private: +private: int32_t tz_id_; int32_t offset_; }; @@ -370,7 +370,7 @@ struct ObTZTransitionStruct { class ObTZTransitionTypeInfo { OB_UNIS_VERSION(1); - public: +public: ObTZTransitionTypeInfo() : lower_time_(common::OB_INVALID_TZ_TRAN_TIME), info_() {} virtual ~ObTZTransitionTypeInfo() @@ -398,10 +398,10 @@ class ObTZTransitionTypeInfo { const common::ObString& tz_abbr_str, int32_t& offset_sec, int32_t& tran_type_id) const; VIRTUAL_TO_STRING_KV(K_(lower_time), K_(info)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTZTransitionTypeInfo); - public: +public: int64_t lower_time_; ObTZTransitionStruct info_; }; @@ -409,10 +409,10 @@ class ObTZTransitionTypeInfo { class ObTZRevertTypeInfo : public ObTZTransitionTypeInfo { OB_UNIS_VERSION(1); - public: +public: enum TypeInfoClass { NONE = 0, NORMAL, OVERLAP, GAP }; - public: +public: ObTZRevertTypeInfo() : ObTZTransitionTypeInfo(), type_class_(NONE), extra_info_() {} virtual ~ObTZRevertTypeInfo() @@ -446,16 +446,16 @@ class ObTZRevertTypeInfo : public ObTZTransitionTypeInfo { VIRTUAL_TO_STRING_KV(K_(lower_time), K_(info), K_(type_class), K_(extra_info)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTZRevertTypeInfo); - public: +public: TypeInfoClass type_class_; ObTZTransitionStruct extra_info_; }; class ObTZIDKey { - public: +public: ObTZIDKey() : tz_id_(0) {} ObTZIDKey(const int64_t tz_id) : tz_id_(tz_id) @@ -478,12 +478,12 @@ class ObTZIDKey { } TO_STRING_KV(K_(tz_id)); - public: +public: int64_t tz_id_; }; class ObTZNameKey { - public: +public: ObTZNameKey(const common::ObString& tz_key_str); ObTZNameKey(const ObTZNameKey& key); ObTZNameKey() @@ -508,7 +508,7 @@ class ObTZNameKey { uint64_t hash(uint64_t seed = 0) const; TO_STRING_KV("tz_name", common::ObString(common::OB_MAX_TZ_NAME_LEN, tz_name_)); - private: +private: char tz_name_[common::OB_MAX_TZ_NAME_LEN]; }; @@ -521,7 +521,7 @@ class ObTimeZoneInfo; class ObTimeZoneInfoPos : public ObTimeZoneInfo, public ObTZIDHashValue { OB_UNIS_VERSION(1); - public: +public: ObTimeZoneInfoPos() : tz_id_(common::OB_INVALID_TZ_ID), default_type_(), tz_tran_types_(), tz_revt_types_(), curr_idx_(0) { @@ -607,7 +607,7 @@ class ObTimeZoneInfoPos : public ObTimeZoneInfo, public ObTZIDHashValue { get_tz_revt_types(), K_(curr_idx), "next_tz_transition_types", get_next_tz_tran_types(), "next_tz_revert_types", get_next_tz_revt_types()); - private: +private: int find_time_range( int64_t value, const common::ObIArray& tz_tran_types, int64_t& type_idx) const; int find_offset_range(const int32_t tran_type_id, const common::ObIArray& tz_tran_types, @@ -615,7 +615,7 @@ class ObTimeZoneInfoPos : public ObTimeZoneInfo, public ObTZIDHashValue { int find_revt_time_range( int64_t value, const common::ObIArray& tz_revt_types, int64_t& type_idx) const; - private: +private: int64_t tz_id_; /*default_type_ is used for times smaller than first transition or if there are no transitions at all.*/ @@ -629,7 +629,7 @@ class ObTimeZoneInfoPos : public ObTimeZoneInfo, public ObTZIDHashValue { }; class ObTZNameIDInfo : public ObTZNameHashValue { - public: +public: ObTZNameIDInfo() : tz_id_(common::OB_INVALID_TZ_ID) { MEMSET(tz_name_, 0, common::OB_MAX_TZ_NAME_LEN); @@ -654,13 +654,13 @@ class ObTZNameIDInfo : public ObTZNameHashValue { {} TO_STRING_KV(K_(tz_id), K_(tz_name)); - public: +public: int64_t tz_id_; char tz_name_[common::OB_MAX_TZ_NAME_LEN]; }; class ObTZIDPosAlloc { - public: +public: ObTZIDPosAlloc() {} ~ObTZIDPosAlloc() @@ -673,7 +673,7 @@ class ObTZIDPosAlloc { }; class ObTZNameIDAlloc { - public: +public: ObTZNameIDAlloc() {} ~ObTZNameIDAlloc() @@ -689,7 +689,7 @@ typedef common::ObLinkHashMap ObTZ typedef common::ObLinkHashMap ObTZInfoNameIDMap; class ObTZInfoMap { - public: +public: ObTZInfoMap() : inited_(false), id_map_(), name_map_(), ref_count_(0) {} ~ObTZInfoMap() @@ -721,12 +721,12 @@ class ObTZInfoMap { return ATOMIC_LOAD64(&ref_count_); } - public: +public: bool inited_; ObTZInfoIDPosMap id_map_; ObTZInfoNameIDMap name_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTZInfoMap); int64_t ref_count_; }; @@ -735,7 +735,7 @@ class ObTimeZoneInfoWrap { enum ObTZInfoClass { NONE = 0, POSITION = 1, OFFSET = 2 }; OB_UNIS_VERSION(1); - public: +public: ObTimeZoneInfoWrap() : tz_info_pos_(), tz_info_offset_(), tz_info_(NULL), class_(NONE), cur_version_(0), error_on_overlap_time_(false) {} @@ -794,7 +794,7 @@ class ObTimeZoneInfoWrap { VIRTUAL_TO_STRING_KV( K_(cur_version), "class", class_, KP_(tz_info), K_(error_on_overlap_time), K_(tz_info_pos), K_(tz_info_offset)); - private: +private: common::ObTimeZoneInfoPos tz_info_pos_; common::ObTimeZoneInfo tz_info_offset_; common::ObTimeZoneInfo* tz_info_; diff --git a/deps/oblib/src/lib/timezone/ob_timezone_util.h b/deps/oblib/src/lib/timezone/ob_timezone_util.h index c698a29f9..1e104f959 100644 --- a/deps/oblib/src/lib/timezone/ob_timezone_util.h +++ b/deps/oblib/src/lib/timezone/ob_timezone_util.h @@ -65,7 +65,7 @@ typedef struct st_time_zone_info { } TIME_ZONE_INFO; class ObTimezoneUtils { - public: +public: ObTimezoneUtils(); virtual ~ObTimezoneUtils(); @@ -79,7 +79,7 @@ class ObTimezoneUtils { virtual int parse_timezone_file(const ObString& timezone_file_name); virtual int print_tz_to_sql(const char* tz_name); - private: +private: ObTimezoneUtils(const ObTimezoneUtils& other); ObTimezoneUtils& operator=(const ObTimezoneUtils& other); diff --git a/deps/oblib/src/lib/trace/ob_seq_event_recorder.h b/deps/oblib/src/lib/trace/ob_seq_event_recorder.h index aa54b58a6..f4c667908 100644 --- a/deps/oblib/src/lib/trace/ob_seq_event_recorder.h +++ b/deps/oblib/src/lib/trace/ob_seq_event_recorder.h @@ -102,18 +102,18 @@ struct ObSeqEventRecorder { next_idx_ = count; } - public: +public: static const int64_t MAX_EVENT_COUNT = EVENT_COUNT; static const int64_t MAX_INFO_BUFFER_SIZE = INFO_BUFFER_SIZE; - protected: +protected: EventType events_[EVENT_COUNT]; int64_t next_idx_; char buffer_[INFO_BUFFER_SIZE]; int64_t buffer_pos_; int64_t dropped_events_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSeqEventRecorder); }; } // end namespace common diff --git a/deps/oblib/src/lib/trace/ob_trace_event.h b/deps/oblib/src/lib/trace/ob_trace_event.h index 60397bf22..e548c6ecc 100644 --- a/deps/oblib/src/lib/trace/ob_trace_event.h +++ b/deps/oblib/src/lib/trace/ob_trace_event.h @@ -48,7 +48,7 @@ struct ObTraceEvent { template class ObTraceEventRecorderBase : public ObSeqEventRecorder { - public: +public: ObTraceEventRecorderBase(bool need_lock = false, uint32_t latch_id = ObLatchIds::TRACE_RECORDER_LOCK) : lock_(latch_id), need_lock_(need_lock) { @@ -102,7 +102,7 @@ class ObTraceEventRecorderBase : public ObSeqEventRecorder class ScopedLambda { - public: +public: explicit ScopedLambda(FnType fn) : fn_(std::move(fn)), active_(true) {} // Default movable. @@ -50,7 +50,7 @@ class ScopedLambda { active_ = false; } - private: +private: FnType fn_; bool active_ = true; }; diff --git a/deps/oblib/src/lib/utility/ob_fast_convert.h b/deps/oblib/src/lib/utility/ob_fast_convert.h index f2b79a023..3def35df6 100644 --- a/deps/oblib/src/lib/utility/ob_fast_convert.h +++ b/deps/oblib/src/lib/utility/ob_fast_convert.h @@ -84,7 +84,7 @@ inline uint32_t ob_fast_digits10(uint64_t v) * ObFastFormatInt::format_unsigned(num, buf); */ class ObFastFormatInt { - public: +public: explicit ObFastFormatInt(const int8_t value) { format_signed(value); @@ -183,7 +183,7 @@ class ObFastFormatInt { // Buffer should be large enough to hold all digits (digits10 + 1), a sign and a null character. static const int64_t MAX_DIGITS10_STR_SIZE = std::numeric_limits::digits10 + 3; - private: +private: /* * Formats value in reverse and returns a pointer to the beginning * @@ -205,7 +205,7 @@ class ObFastFormatInt { */ void format_signed(int64_t value); - private: +private: static const char DIGITS[]; mutable char buf_[MAX_DIGITS10_STR_SIZE]; @@ -216,7 +216,7 @@ class ObFastFormatInt { // ref: https://github.com/jsteemann/atoi template class ObFastAtoi { - public: +public: static inline T atoi_negative_unchecked(char const* p, char const* e) { T result = 0; diff --git a/deps/oblib/src/lib/utility/ob_print_utils.h b/deps/oblib/src/lib/utility/ob_print_utils.h index 55c2330bc..3864b8868 100644 --- a/deps/oblib/src/lib/utility/ob_print_utils.h +++ b/deps/oblib/src/lib/utility/ob_print_utils.h @@ -85,7 +85,7 @@ struct ObHexStringWrap { {} int64_t to_string(char* buf, const int64_t len) const; - private: +private: const common::ObString& str_; }; @@ -115,7 +115,7 @@ template <> int64_t to_string(const double& obj, char* buffer, const int64_t buffer_size); class ToStringAdaptor { - public: +public: virtual ~ToStringAdaptor() {} virtual int64_t to_string(char* buffer, const int64_t length) const = 0; diff --git a/deps/oblib/src/lib/utility/ob_query_rate_limiter.h b/deps/oblib/src/lib/utility/ob_query_rate_limiter.h index 4651c21f3..88ff040d2 100644 --- a/deps/oblib/src/lib/utility/ob_query_rate_limiter.h +++ b/deps/oblib/src/lib/utility/ob_query_rate_limiter.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace lib { class ObQueryRateLimiter : public lib::ObRateLimiter { - public: +public: ObQueryRateLimiter() : last_ship_time_(0) {} @@ -37,10 +37,10 @@ class ObQueryRateLimiter : public lib::ObRateLimiter { int acquire(int64_t permits = 1) override; int try_acquire(int64_t permits = 1) override; - private: +private: static int64_t current_time(); - private: +private: int64_t last_ship_time_; }; diff --git a/deps/oblib/src/lib/utility/ob_rate_limiter.h b/deps/oblib/src/lib/utility/ob_rate_limiter.h index 16e3c8816..1e300202a 100644 --- a/deps/oblib/src/lib/utility/ob_rate_limiter.h +++ b/deps/oblib/src/lib/utility/ob_rate_limiter.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace lib { class ObRateLimiter { - public: +public: ObRateLimiter(); virtual ~ObRateLimiter(); @@ -34,7 +34,7 @@ class ObRateLimiter { virtual int try_acquire(int64_t permits = 1) = 0; virtual int acquire(int64_t permits = 1) = 0; - protected: +protected: int64_t rate_; const char* name_; }; diff --git a/deps/oblib/src/lib/utility/ob_sample_rate_limiter.h b/deps/oblib/src/lib/utility/ob_sample_rate_limiter.h index e823fc9ca..5107dcec3 100644 --- a/deps/oblib/src/lib/utility/ob_sample_rate_limiter.h +++ b/deps/oblib/src/lib/utility/ob_sample_rate_limiter.h @@ -27,7 +27,7 @@ namespace lib { it will be allowed every thereafter number */ class ObSampleRateLimiter : public lib::ObRateLimiter { - public: +public: ObSampleRateLimiter() : ObSampleRateLimiter(0, 0) {} ObSampleRateLimiter(int64_t initial, int64_t thereafter, int64_t duration = 1000L * 1000L /*1s*/) @@ -41,12 +41,12 @@ class ObSampleRateLimiter : public lib::ObRateLimiter { int acquire(int64_t permits = 1) override; int try_acquire(int64_t permits = 1) override; - public: +public: // This is a copy of ObTimeUtility::current_time() that depends on // nothing other than system library. static int64_t current_time(); - private: +private: int64_t initial_; int64_t thereafter_; int64_t duration_; diff --git a/deps/oblib/src/lib/utility/ob_serialization_helper.h b/deps/oblib/src/lib/utility/ob_serialization_helper.h index 55b2dbe24..864dc7f0b 100644 --- a/deps/oblib/src/lib/utility/ob_serialization_helper.h +++ b/deps/oblib/src/lib/utility/ob_serialization_helper.h @@ -49,7 +49,7 @@ struct DefaultItemEncode { return encoded_length_item_enum(item, BoolType<__is_enum(T)>()); } - private: +private: // for class, struct, union static int encode_item_enum(char* buf, const int64_t buf_len, int64_t& pos, const T& item, FalseType) { diff --git a/deps/oblib/src/lib/utility/ob_simple_rate_limiter.h b/deps/oblib/src/lib/utility/ob_simple_rate_limiter.h index 7432462d0..fa54db9ef 100644 --- a/deps/oblib/src/lib/utility/ob_simple_rate_limiter.h +++ b/deps/oblib/src/lib/utility/ob_simple_rate_limiter.h @@ -26,7 +26,7 @@ namespace lib { class ObSimpleRateLimiter : public lib::ObRateLimiter { static constexpr int64_t DEFAULT_RATE = 100; - public: +public: ObSimpleRateLimiter(int64_t rate = DEFAULT_RATE) : last_ts_(0), permits_(rate) { last_ts_ = current_time(); @@ -41,12 +41,12 @@ class ObSimpleRateLimiter : public lib::ObRateLimiter { int acquire(int64_t permits = 1) override; int try_acquire(int64_t permits = 1) override; - public: +public: // This is a copy of ObTimeUtility::current_time() that depends on // nothing other than system library. static int64_t current_time(); - private: +private: int64_t last_ts_; int64_t permits_; }; diff --git a/deps/oblib/src/lib/utility/ob_test_util.h b/deps/oblib/src/lib/utility/ob_test_util.h index 27d24f9e9..6224eff2d 100644 --- a/deps/oblib/src/lib/utility/ob_test_util.h +++ b/deps/oblib/src/lib/utility/ob_test_util.h @@ -27,7 +27,7 @@ */ #define BEGIN_THREAD_CODE(class_name, thread_count) \ class _##class_name : public oceanbase::lib::ThreadPool { \ - public: \ + public: \ _##class_name() \ { \ set_thread_count(thread_count); \ diff --git a/deps/oblib/src/lib/utility/ob_tracepoint.h b/deps/oblib/src/lib/utility/ob_tracepoint.h index 49c27264f..0aff5e453 100644 --- a/deps/oblib/src/lib/utility/ob_tracepoint.h +++ b/deps/oblib/src/lib/utility/ob_tracepoint.h @@ -87,7 +87,7 @@ using GetSwitchFunc = bool&(); template class ObSwitchGuard { - public: +public: ObSwitchGuard(bool newval) { oldval_ = fn(); @@ -98,7 +98,7 @@ class ObSwitchGuard { fn() = oldval_; } - private: +private: bool oldval_; }; } // namespace lib @@ -163,7 +163,7 @@ int tp_const_error() } class TPSymbolTable { - public: +public: TPSymbolTable() {} ~TPSymbolTable() @@ -173,7 +173,7 @@ class TPSymbolTable { return (NULL != name) ? do_get(name) : NULL; } - private: +private: static uint64_t BKDRHash(const char* str); enum { SYMBOL_SIZE_LIMIT = 128, SYMBOL_COUNT_LIMIT = 64 * 1024 }; @@ -248,7 +248,7 @@ struct NamedEventItem : public ObDLinkBase { class EventTable { static const int SIZE_OF_EVENT_TABLE = 100000; // max number of tracepoints supported - public: +public: EventTable() { for (int64_t i = 0; i < SIZE_OF_EVENT_TABLE; ++i) { @@ -518,7 +518,7 @@ class EventTable { return et; } - private: +private: /* Array of error codes for all tracepoints. For normal error code generation, the value should be the error code itself. diff --git a/deps/oblib/src/lib/utility/ob_unify_serialize.h b/deps/oblib/src/lib/utility/ob_unify_serialize.h index fcfd3739e..af7a522e8 100644 --- a/deps/oblib/src/lib/utility/ob_unify_serialize.h +++ b/deps/oblib/src/lib/utility/ob_unify_serialize.h @@ -41,7 +41,7 @@ inline uint64_t& get_unis_compat_version() } class UnisCompatVersionGuard { - public: +public: UnisCompatVersionGuard(uint64_t version) : version_(get_unis_compat_version()) { get_unis_compat_version() = version; @@ -51,7 +51,7 @@ class UnisCompatVersionGuard { get_unis_compat_version() = version_; } - private: +private: uint64_t version_; }; } // namespace lib @@ -345,24 +345,24 @@ class UnisCompatVersionGuard { // public entries, define interfaces of manual serialization //----------------------------------------------------------------------- #define OB_UNIS_VERSION(VER) \ - public: \ +public: \ OB_DECLARE_UNIS(, ); \ \ - private: \ +private: \ const static int64_t UNIS_VERSION = VER #define OB_UNIS_VERSION_V(VER) \ - public: \ +public: \ OB_DECLARE_UNIS(virtual, ); \ \ - private: \ +private: \ const static int64_t UNIS_VERSION = VER #define OB_UNIS_VERSION_PV() \ - public: \ +public: \ OB_DECLARE_UNIS(virtual, = 0); \ \ - private: +private: #define OB_DEF_SERIALIZE(CLS, TEMP...) \ TEMP OB_UNIS_SERIALIZE(CLS); \ @@ -524,7 +524,7 @@ class UnisCompatVersionGuard { #define UNIS_VER(major, minor, patch) (((uint64_t)major << 32L) + ((uint64_t)minor << 16L) + (uint64_t)patch) #define OB_UNIS_COMPAT(V) \ - private: \ +private: \ const static uint64_t compat_ver_ = UNIS_##V; \ OB_DECLARE_UNIS_COMPAT() diff --git a/deps/oblib/src/lib/utility/utility.h b/deps/oblib/src/lib/utility/utility.h index 0b088b090..77a703348 100644 --- a/deps/oblib/src/lib/utility/utility.h +++ b/deps/oblib/src/lib/utility/utility.h @@ -682,7 +682,7 @@ int add_var_to_array_no_dup(T* array, const int64_t size, int64_t& num, const T& template class ObPtrGuard { - public: +public: explicit ObPtrGuard(ObIAllocator& allocator) : ptr_(NULL), allocator_(allocator) {} ~ObPtrGuard() @@ -722,16 +722,16 @@ class ObPtrGuard { return ptr_; } - private: +private: T* ptr_; ObIAllocator& allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPtrGuard); }; class ObTimeGuard { - public: +public: explicit ObTimeGuard(const char* owner = "unknown", const int64_t warn_threshold = INT64_MAX) { start_ts_ = common::ObTimeUtility::fast_current_time(); @@ -764,10 +764,10 @@ class ObTimeGuard { int64_t to_string(char* buf, const int64_t buf_len) const; DECLARE_TO_YSON_KV; - private: +private: static const int64_t MAX_CLICK_COUNT = 16; - private: +private: int64_t start_ts_; int64_t last_ts_; int64_t click_count_; @@ -778,7 +778,7 @@ class ObTimeGuard { }; class ObTimeInterval { - public: +public: explicit ObTimeInterval(const int64_t interval, const bool first_reach = true) : last_ts_(0), interval_(interval) { if (!first_reach) { @@ -802,13 +802,13 @@ class ObTimeInterval { return bool_ret; } - private: +private: mutable int64_t last_ts_; const int64_t interval_; }; class ObBandwidthThrottle { - public: +public: ObBandwidthThrottle(); ~ObBandwidthThrottle(); int init(const int64_t rate, const char* comment = "unknown"); @@ -817,12 +817,12 @@ class ObBandwidthThrottle { const int64_t bytes, const int64_t last_active_time, const int64_t max_idle_time, int64_t& sleep_us); void destroy(); - private: +private: int cal_limit(const int64_t bytes, int64_t& avaliable_timestamp); static int do_sleep( const int64_t next_avaliable_ts, const int64_t last_active_time, const int64_t max_idle_time, int64_t& sleep_us); - private: +private: common::ObSpinLock lock_; int64_t rate_; // bandwidth limit bytes/s. int64_t next_avaliable_timestamp_; @@ -837,7 +837,7 @@ class ObBandwidthThrottle { }; class ObInOutBandwidthThrottle { - public: +public: ObInOutBandwidthThrottle(); ~ObInOutBandwidthThrottle(); @@ -847,7 +847,7 @@ class ObInOutBandwidthThrottle { int limit_out_and_sleep(const int64_t bytes, const int64_t last_active_time, const int64_t max_idle_time); void destroy(); - private: +private: ObBandwidthThrottle in_throttle_; ObBandwidthThrottle out_throttle_; }; @@ -996,16 +996,16 @@ inline int objects_copy(T* dest, const T* src, int64_t count) } class ObMiniStat { - public: +public: class ObStatItem { - public: + public: ObStatItem(const char* item, const int64_t stat_interval) : item_(item), stat_interval_(stat_interval), last_ts_(0), stat_count_(0) {} ~ObStatItem() {} - public: + public: void stat() { const int64_t cur_ts = ::oceanbase::common::ObTimeUtility::fast_current_time(); @@ -1017,14 +1017,14 @@ class ObMiniStat { } } - private: + private: const char* const item_; const int64_t stat_interval_; int64_t last_ts_; int64_t stat_count_; }; - public: +public: static void stat(ObStatItem& item) { item.stat(); @@ -1032,7 +1032,7 @@ class ObMiniStat { }; class ObIntWarp { - public: +public: ObIntWarp() : v_(0) {} explicit ObIntWarp(const uint64_t v) : v_(v) @@ -1075,18 +1075,18 @@ class ObIntWarp { } TO_STRING_KV(K_(v)); - private: +private: uint64_t v_; }; class ObTsWindows { - public: +public: ObTsWindows() : start_(0), base_(0), end_(0) {} ~ObTsWindows() {} - public: +public: void set(const int64_t start, const int64_t base, const int64_t end) { start_ = start; @@ -1116,10 +1116,10 @@ class ObTsWindows { return end_; } - public: +public: TO_STRING_KV(K_(start), K_(base), K_(end)); - private: +private: int64_t start_; int64_t base_; int64_t end_; diff --git a/deps/oblib/src/lib/word_segment/ob_i_word_segment_impl.h b/deps/oblib/src/lib/word_segment/ob_i_word_segment_impl.h index 7d85cb0c5..710ee319f 100644 --- a/deps/oblib/src/lib/word_segment/ob_i_word_segment_impl.h +++ b/deps/oblib/src/lib/word_segment/ob_i_word_segment_impl.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace common { class ObIWordSegmentImpl { - public: +public: ObIWordSegmentImpl(){}; virtual ~ObIWordSegmentImpl() {} diff --git a/deps/oblib/src/lib/word_segment/ob_word_segment.h b/deps/oblib/src/lib/word_segment/ob_word_segment.h index f54cb7ab7..3efc4160c 100644 --- a/deps/oblib/src/lib/word_segment/ob_word_segment.h +++ b/deps/oblib/src/lib/word_segment/ob_word_segment.h @@ -31,7 +31,7 @@ enum ObTokenizer { }; class ObWordSegment { - public: +public: ObWordSegment() : inner_allocator_(), segmenter_(NULL){}; virtual ~ObWordSegment() { @@ -44,16 +44,16 @@ class ObWordSegment { int reset(); int destory(); - private: +private: bool is_inited() { return NULL != segmenter_; } - private: +private: static const char* TokenizerName[WS_MAX + 1]; - private: +private: common::ObArenaAllocator inner_allocator_; ObIWordSegmentImpl* segmenter_; }; diff --git a/deps/oblib/src/lib/worker.h b/deps/oblib/src/lib/worker.h index aff8c0b3f..2915a811e 100644 --- a/deps/oblib/src/lib/worker.h +++ b/deps/oblib/src/lib/worker.h @@ -27,7 +27,7 @@ using common::ObArenaAllocator; using common::ObSQLArenaAllocator; class Worker { - public: +public: enum class CompatMode { INVALID = -1, MYSQL, ORACLE }; Worker(); @@ -90,20 +90,20 @@ class Worker { return group_id_; } - public: +public: // static variables static Worker& self(); - protected: +protected: static RLOCAL(Worker*, self_); - protected: +protected: // Thread runtime-memory is allocated from this allocator // Initial tenant_id=500, when request is processed, it is updated to tenant id of request // Ctx_id can be specified separately, this ctx_id remains unchanged ObIAllocator* allocator_; - private: +private: bool req_flag_; int32_t worker_level_; @@ -154,7 +154,7 @@ inline Worker& this_worker() class ObRuntimeContext : public lib::RuntimeContext { OB_UNIS_VERSION(1); - public: +public: ObRuntimeContext() : compat_mode_(Worker::CompatMode::MYSQL) {} Worker::CompatMode compat_mode_; diff --git a/deps/oblib/src/rpc/frame/ob_net_easy.h b/deps/oblib/src/rpc/frame/ob_net_easy.h index 13e12b5d9..3ca889c5d 100644 --- a/deps/oblib/src/rpc/frame/ob_net_easy.h +++ b/deps/oblib/src/rpc/frame/ob_net_easy.h @@ -53,7 +53,7 @@ struct ObNetOptions { class ObNetEasy { static const int64_t MAX_LISTEN_CNT = 4; - public: +public: ObNetEasy(); virtual ~ObNetEasy(); @@ -84,7 +84,7 @@ class ObNetEasy { void on_ioth_start(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNetEasy); easy_io_t* create_eio_(const int io_cnt); int init_rpc_eio_(easy_io_t* eio, const ObNetOptions& opts); @@ -96,7 +96,7 @@ class ObNetEasy { void update_eio_sql_tcp_keepalive(easy_io_t* eio, int64_t user_timeout, int enable_tcp_keepalive, int64_t tcp_keepidle, int64_t tcp_keepintvl, int64_t tcp_keepcnt); - protected: +protected: ObReqTransport* transports_[MAX_LISTEN_CNT]; int64_t proto_cnt_; easy_io_t* rpc_eio_; diff --git a/deps/oblib/src/rpc/frame/ob_req_deliver.h b/deps/oblib/src/rpc/frame/ob_req_deliver.h index 8d0b580c6..f975dadc0 100644 --- a/deps/oblib/src/rpc/frame/ob_req_deliver.h +++ b/deps/oblib/src/rpc/frame/ob_req_deliver.h @@ -28,7 +28,7 @@ class ObGlobalContext; // from the upper to responding packet queue. The deliver rules is // defined by those macros named class ObReqDeliver { - public: +public: virtual ~ObReqDeliver() {} @@ -40,10 +40,10 @@ class ObReqDeliver { }; // end of class ObPktDeliver class ObReqQDeliver : public ObReqDeliver { - public: +public: explicit ObReqQDeliver(ObiReqQHandler& qhandler); - protected: +protected: ObiReqQHandler& qhandler_; }; // end of class ObReqQDeliver diff --git a/deps/oblib/src/rpc/frame/ob_req_handler.h b/deps/oblib/src/rpc/frame/ob_req_handler.h index 1127aab1d..1deb90685 100644 --- a/deps/oblib/src/rpc/frame/ob_req_handler.h +++ b/deps/oblib/src/rpc/frame/ob_req_handler.h @@ -29,7 +29,7 @@ enum { }; class ObReqHandler : public ObIEasyPacketHandler { - public: +public: ObReqHandler() : ez_handler_() { memset(&ez_handler_, 0, sizeof(ez_handler_)); @@ -60,12 +60,12 @@ class ObReqHandler : public ObIEasyPacketHandler { int on_close(easy_connection_t* c); int cleanup(easy_request_t* r, void* apacket); - public: +public: static const uint8_t API_VERSION = 1; static const uint8_t MAGIC_HEADER_FLAG[4]; static const uint8_t MAGIC_COMPRESS_HEADER_FLAG[4]; - protected: +protected: easy_io_handler_pt ez_handler_; }; // end of class ObReqHandler diff --git a/deps/oblib/src/rpc/frame/ob_req_processor.h b/deps/oblib/src/rpc/frame/ob_req_processor.h index c8a58e97d..4ed4488f8 100644 --- a/deps/oblib/src/rpc/frame/ob_req_processor.h +++ b/deps/oblib/src/rpc/frame/ob_req_processor.h @@ -46,7 +46,7 @@ namespace frame { // after having response. // class ObReqProcessor { - public: +public: ObReqProcessor(); virtual ~ObReqProcessor() {} @@ -103,7 +103,7 @@ class ObReqProcessor { enqueue_timestamp_ = enqueue_timestamp; } - protected: +protected: virtual int check_timeout() { return common::OB_SUCCESS; @@ -137,10 +137,10 @@ class ObReqProcessor { common::OB_TRANS_KILLED == process_ret || common::OB_TRANS_CTX_NOT_EXIST == process_ret)); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObReqProcessor); - protected: +protected: ObRequest* req_; // mark if request has wokenup bool req_has_wokenup_; @@ -153,7 +153,7 @@ class ObReqProcessor { // share by all processors of this thread int process_ret_; - private: +private: int64_t receive_timestamp_; int64_t run_timestamp_; int64_t enqueue_timestamp_; diff --git a/deps/oblib/src/rpc/frame/ob_req_qhandler.h b/deps/oblib/src/rpc/frame/ob_req_qhandler.h index 07bc0e087..dd6e6749b 100644 --- a/deps/oblib/src/rpc/frame/ob_req_qhandler.h +++ b/deps/oblib/src/rpc/frame/ob_req_qhandler.h @@ -22,7 +22,7 @@ namespace frame { class ObReqTranslator; class ObReqQHandler : public ObiReqQHandler { - public: +public: explicit ObReqQHandler(ObReqTranslator& translator_); virtual ~ObReqQHandler(); @@ -34,7 +34,7 @@ class ObReqQHandler : public ObiReqQHandler { bool handlePacketQueue(ObRequest* req, void* args); - private: +private: ObReqTranslator& translator_; }; // end of class ObReqQHandler diff --git a/deps/oblib/src/rpc/frame/ob_req_queue_thread.h b/deps/oblib/src/rpc/frame/ob_req_queue_thread.h index 9302bc706..72b605974 100644 --- a/deps/oblib/src/rpc/frame/ob_req_queue_thread.h +++ b/deps/oblib/src/rpc/frame/ob_req_queue_thread.h @@ -27,7 +27,7 @@ namespace frame { using common::ObAddr; class ObReqQueue { - public: +public: static const int LIGHTY_QUEUE_SIZE = (1 << 18); ObReqQueue(int queue_capacity = LIGHTY_QUEUE_SIZE); @@ -45,12 +45,12 @@ class ObReqQueue { return queue_.size(); } - private: +private: int process_task(void* task); DISALLOW_COPY_AND_ASSIGN(ObReqQueue); - protected: +protected: bool wait_finish_; bool stop_; @@ -63,7 +63,7 @@ class ObReqQueue { }; class ObReqQueueThread : public ObReqQueue { - public: +public: ObReqQueueThread() : thread_(*this) {} lib::ThreadPool& get_thread() @@ -71,9 +71,9 @@ class ObReqQueueThread : public ObReqQueue { return thread_; } - private: +private: class Thread : public lib::ThreadPool { - public: + public: Thread(ObReqQueue& queue) : queue_(queue) {} void run1() diff --git a/deps/oblib/src/rpc/frame/ob_req_translator.h b/deps/oblib/src/rpc/frame/ob_req_translator.h index 49b3b1ba9..538b26286 100644 --- a/deps/oblib/src/rpc/frame/ob_req_translator.h +++ b/deps/oblib/src/rpc/frame/ob_req_translator.h @@ -22,7 +22,7 @@ namespace frame { class ObReqProcessor; class ObReqTranslator { - public: +public: ObReqTranslator() {} virtual ~ObReqTranslator() @@ -37,10 +37,10 @@ class ObReqTranslator { virtual int translate(ObRequest& req, ObReqProcessor*& processor); virtual int release(ObReqProcessor* processor); - protected: +protected: virtual ObReqProcessor* get_processor(ObRequest& req) = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObReqTranslator); }; // end of class ObReqTranslator diff --git a/deps/oblib/src/rpc/frame/ob_req_transport.h b/deps/oblib/src/rpc/frame/ob_req_transport.h index a7861bc90..a13f9e84a 100644 --- a/deps/oblib/src/rpc/frame/ob_req_transport.h +++ b/deps/oblib/src/rpc/frame/ob_req_transport.h @@ -34,7 +34,7 @@ namespace frame { using common::ObAddr; class SPAlloc { - public: +public: explicit SPAlloc(easy_pool_t* pool) : pool_(pool) {} void* operator()(uint32_t size) const @@ -42,18 +42,18 @@ class SPAlloc { return easy_pool_alloc(pool_, size); } - private: +private: easy_pool_t* pool_; }; class ObReqTransport { - public: +public: // asynchronous callback class. // // Every asynchronous request will hold an object of this class that // been called after easy has detected the response packet. class AsyncCB { - public: + public: AsyncCB() : dst_(), timeout_(0), tenant_id_(0), req_(NULL), send_ts_(0), payload_(0) {} virtual ~AsyncCB() @@ -112,9 +112,9 @@ class ObReqTransport { return payload_; } - private: + private: static const int64_t REQUEST_ITEM_COST_RT = 100 * 1000; // 100ms - protected: + protected: ObAddr dst_; int64_t timeout_; uint64_t tenant_id_; @@ -127,7 +127,7 @@ class ObReqTransport { class Request { friend class ObReqTransport; - public: + public: Request() { reset(); @@ -192,12 +192,12 @@ class ObReqTransport { TO_STRING_KV("pkt", *pkt_); - public: + public: easy_session_t* s_; T* pkt_; AsyncCB* cb_; - private: + private: char* buf_; int64_t buf_len_; bool async_; @@ -207,7 +207,7 @@ class ObReqTransport { class Result { friend class ObReqTransport; - public: + public: Result() : pkt_(NULL) {} @@ -216,11 +216,11 @@ class ObReqTransport { return pkt_; } - private: + private: T* pkt_; }; - public: +public: ObReqTransport(easy_io_t* eio, easy_io_handler_pt* handler); void set_sgid(int32_t sgid) { @@ -246,17 +246,17 @@ class ObReqTransport { const ObAddr& local_addr, const common::ObString& ssl_invited_nodes, const AsyncCB* cb = NULL, AsyncCB** newcb = NULL) const; - private: +private: int balance_assign() const; ObPacket* send_session(easy_session_t* s) const; int post_session(easy_session_t* s) const; easy_addr_t to_ez_addr(const ObAddr& addr) const; - private: +private: static const int32_t OB_RPC_CONNECTION_COUNT_PER_THREAD = 1; - private: +private: easy_io_t* eio_; easy_io_handler_pt* handler_; int32_t sgid_; diff --git a/deps/oblib/src/rpc/frame/obi_easy_packet_handler.h b/deps/oblib/src/rpc/frame/obi_easy_packet_handler.h index 8ae7be2aa..95e04fa00 100644 --- a/deps/oblib/src/rpc/frame/obi_easy_packet_handler.h +++ b/deps/oblib/src/rpc/frame/obi_easy_packet_handler.h @@ -20,7 +20,7 @@ namespace rpc { namespace frame { class ObIEasyPacketHandler { - public: +public: virtual ~ObIEasyPacketHandler() {} virtual void* decode(easy_message_t* m) = 0; diff --git a/deps/oblib/src/rpc/frame/obi_req_qhandler.h b/deps/oblib/src/rpc/frame/obi_req_qhandler.h index 264ebbad2..9dfdd8f50 100644 --- a/deps/oblib/src/rpc/frame/obi_req_qhandler.h +++ b/deps/oblib/src/rpc/frame/obi_req_qhandler.h @@ -23,7 +23,7 @@ namespace frame { class ObPacketQueueSessionHandler; class ObiReqQHandler { - public: +public: virtual ~ObiReqQHandler() {} diff --git a/deps/oblib/src/rpc/ob_packet.h b/deps/oblib/src/rpc/ob_packet.h index 488896518..30a37bd25 100644 --- a/deps/oblib/src/rpc/ob_packet.h +++ b/deps/oblib/src/rpc/ob_packet.h @@ -21,7 +21,7 @@ namespace rpc { // This is the base class for oceanbase packets. Contruct directly is // not allowed, so that the its destructor is unaccessible. class ObPacket { - public: +public: ObPacket() {} virtual ~ObPacket() diff --git a/deps/oblib/src/rpc/ob_request.h b/deps/oblib/src/rpc/ob_request.h index cfcabe225..4c12f71a1 100644 --- a/deps/oblib/src/rpc/ob_request.h +++ b/deps/oblib/src/rpc/ob_request.h @@ -32,10 +32,10 @@ using common::ObAddr; typedef common::ObCurTraceId::TraceId TraceId; class ObRequest : public common::ObLink { - public: +public: enum Type { OB_RPC, OB_MYSQL, OB_TASK, OB_GTS_TASK, OB_SQL_TASK }; - public: +public: explicit ObRequest(Type type) : ez_req_(NULL), type_(type), @@ -164,9 +164,9 @@ class ObRequest : public common::ObLink { ObLockWaitNode lock_wait_node_; - public: +public: easy_request_t* ez_req_; // set in ObRequest new - protected: +protected: Type type_; int32_t group_id_; const ObPacket* pkt_; // set in rpc handler @@ -186,7 +186,7 @@ class ObRequest : public common::ObLink { bool large_retry_flag_; int32_t retry_times_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRequest); }; // end of class ObRequest diff --git a/deps/oblib/src/rpc/ob_reusable_mem.h b/deps/oblib/src/rpc/ob_reusable_mem.h index 7cda0b400..bc5b4e726 100644 --- a/deps/oblib/src/rpc/ob_reusable_mem.h +++ b/deps/oblib/src/rpc/ob_reusable_mem.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace rpc { class ObReusableMem { - public: +public: enum { N_PTR = 4 }; struct MemPtr { void set(void* p, int64_t sz) @@ -29,7 +29,7 @@ class ObReusableMem { int64_t size_; }; - public: +public: ObReusableMem() : nptr_(0), mask_(0) {} ~ObReusableMem() @@ -56,7 +56,7 @@ class ObReusableMem { } } - private: +private: int32_t nptr_; uint32_t mask_; MemPtr ptr_[N_PTR]; diff --git a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.h b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.h index c2a0113b5..56b563f43 100644 --- a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.h @@ -23,7 +23,7 @@ namespace obmysql { class Ob20ProtocolHeader; class Ob20ProtocolProcessor : public ObMysqlProtocolProcessor { - public: +public: Ob20ProtocolProcessor(ObMySQLHandler& handler) : ObMysqlProtocolProcessor(handler) {} virtual ~Ob20ProtocolProcessor() @@ -32,13 +32,13 @@ class Ob20ProtocolProcessor : public ObMysqlProtocolProcessor { virtual int decode(easy_message_t* m, rpc::ObPacket*& pkt); virtual int process(easy_request_t* r, bool& need_decode_more); - protected: +protected: int do_header_checksum(char* origin_start, const Ob20ProtocolHeader& hdr); int do_body_checksum(easy_message_t& m, const Ob20ProtocolHeader& hdr); int decode_ob20_body(easy_message_t& m, const Ob20ProtocolHeader& hdr, rpc::ObPacket*& pkt); int process_ob20_packet(easy_connection_t& c, easy_pool_t& pool, void*& ipacket, bool& need_decode_more); - private: +private: DISALLOW_COPY_AND_ASSIGN(Ob20ProtocolProcessor); }; diff --git a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_struct.h b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_struct.h index a1e55f590..1d39790f2 100644 --- a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_struct.h +++ b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_struct.h @@ -48,7 +48,7 @@ union Ob20ProtocolFlags { }; class Ob20ProtocolHeader { - public: +public: ObMySQLCompressedPacketHeader cp_hdr_; uint16_t magic_num_; @@ -61,7 +61,7 @@ class Ob20ProtocolHeader { uint16_t version_; uint16_t reserved_; - public: +public: Ob20ProtocolHeader() : cp_hdr_(), magic_num_(0), @@ -83,13 +83,13 @@ class Ob20ProtocolHeader { }; struct Ob20ExtraInfo { - public: +public: uint32_t extra_len_; // add others, not supoort yet bool exist_trace_info_; ObString trace_info_; - public: +public: Ob20ExtraInfo() : extra_len_(0), exist_trace_info_(false) {} ~Ob20ExtraInfo() @@ -98,7 +98,7 @@ struct Ob20ExtraInfo { }; class Ob20Packet : public rpc::ObPacket { - public: +public: Ob20Packet() : hdr_(), cdata_(NULL) {} virtual ~Ob20Packet() @@ -161,7 +161,7 @@ class Ob20Packet : public rpc::ObPacket { VIRTUAL_TO_STRING_KV("header", hdr_, K_(extra_info)); - protected: +protected: Ob20ProtocolHeader hdr_; Ob20ExtraInfo extra_info_; const char* cdata_; diff --git a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.h b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.h index 25d3e0987..7a1968511 100644 --- a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.h +++ b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.h @@ -52,7 +52,7 @@ inline const char* get_proto20_encode_step_name(const ObProto20EncodeStep step) } class ObProto20Context { - public: +public: ObProto20Context() : comp_seq_(0), proto20_seq_(0), @@ -78,7 +78,7 @@ class ObProto20Context { TO_STRING_KV(K_(comp_seq), K_(request_id), K_(proto20_seq), K_(header_len), K_(tailer_len), K_(next_step), K_(is_proto20_used), K_(is_checksum_off), K_(curr_proto20_packet_start_pos)); - public: +public: uint8_t comp_seq_; uint8_t proto20_seq_; uint32_t request_id_; @@ -89,12 +89,12 @@ class ObProto20Context { bool is_checksum_off_; int64_t curr_proto20_packet_start_pos_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObProto20Context); }; struct ObProtoEncodeParam { - public: +public: ObProto20Context* proto20_context_; easy_buf_t* ez_buf_; ObMySQLPacket* pkt_; @@ -111,7 +111,7 @@ struct ObProtoEncodeParam { const static int64_t MAX_PROTO20_PAYLOAD_LEN; const static int64_t PROTO20_SPLIT_LEN; - public: +public: ObProtoEncodeParam() : proto20_context_(NULL), ez_buf_(NULL), @@ -180,26 +180,26 @@ struct ObProtoEncodeParam { TO_STRING_KV(KP_(proto20_context), KP_(ez_buf), KP_(pkt), K_(seri_size), K_(conn_id), K_(encode_ret), K_(need_flush), K_(is_last), K_(is_pkt_encoded), KP_(large_pkt_buf), K_(large_pkt_buf_len), K_(large_pkt_buf_pos)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObProtoEncodeParam); }; class ObProto20Utils { - public: +public: ObProto20Utils(); virtual ~ObProto20Utils(); static int fill_proto20_header_and_tailer(ObProtoEncodeParam& param); static int do_packet_encode(ObProtoEncodeParam& param); - private: +private: inline static int do_proto20_packet_encode(ObProtoEncodeParam& param); inline static int fill_proto20_payload(ObProtoEncodeParam& param, bool& is_break); inline static int fill_proto20_tailer(ObProtoEncodeParam& param); inline static int fill_proto20_header(ObProtoEncodeParam& param); inline static bool is_the_last_packet(const ObProtoEncodeParam& param); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObProto20Utils); }; diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.h b/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.h index 03e9890d2..f64b2d278 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.h @@ -22,7 +22,7 @@ class ObPacket; namespace obmysql { class ObMysqlCompressProtocolProcessor : public ObMysqlProtocolProcessor { - public: +public: ObMysqlCompressProtocolProcessor(ObMySQLHandler& handler) : ObMysqlProtocolProcessor(handler) {} virtual ~ObMysqlCompressProtocolProcessor() @@ -31,7 +31,7 @@ class ObMysqlCompressProtocolProcessor : public ObMysqlProtocolProcessor { virtual int decode(easy_message_t* m, rpc::ObPacket*& pkt); virtual int process(easy_request_t* r, bool& is_going_on); - private: +private: int decode_compressed_body(easy_message_t& m, const uint32_t comp_pktlen, const uint8_t comp_pktseq, const uint32_t pktlen_before_compress, rpc::ObPacket*& pkt); @@ -40,7 +40,7 @@ class ObMysqlCompressProtocolProcessor : public ObMysqlProtocolProcessor { int process_compressed_packet(easy_connection_t& c, easy_pool_t& pool, void*& ipacket, bool& need_decode_more); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMysqlCompressProtocolProcessor); }; diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_field.h b/deps/oblib/src/rpc/obmysql/ob_mysql_field.h index 706017039..160f56b29 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_field.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_field.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace obmysql { class ObMySQLField { - public: +public: ObMySQLField(); /** * serialize data to the format recognized by MySQL @@ -59,7 +59,7 @@ class ObMySQLField { return ret; } - private: +private: /** * serialize data to the format recognized by MySQL(version 4.1) * @@ -71,11 +71,11 @@ class ObMySQLField { */ int serialize_pro41(char* buf, const int64_t len, int64_t& pos) const; - private: +private: const char* catalog_; /* Catalog for table */ // void *extension; - public: +public: common::ObString dname_; common::ObString tname_; // table name for display common::ObString org_tname_; // original table name diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_handler.h b/deps/oblib/src/rpc/obmysql/ob_mysql_handler.h index 6fb87f93a..e47d7d751 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_handler.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_handler.h @@ -32,7 +32,7 @@ class ObProto20PktContext; class ObVirtualCSProtocolProcessor; class ObMySQLHandler : public rpc::frame::ObReqHandler { - public: +public: explicit ObMySQLHandler(rpc::frame::ObReqDeliver& deliver); virtual ~ObMySQLHandler(); @@ -62,7 +62,7 @@ class ObMySQLHandler : public rpc::frame::ObReqHandler { inline ObVirtualCSProtocolProcessor* get_protocol_processor(easy_connection_t* c); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMySQLHandler); /** * write data through raw socket @@ -74,12 +74,12 @@ class ObMySQLHandler : public rpc::frame::ObReqHandler { int write_data(int fd, char* buffer, size_t length) const; int read_data(int fd, char* buffer, size_t length) const; - protected: +protected: ObMysqlProtocolProcessor mysql_processor_; ObMysqlCompressProtocolProcessor compress_processor_; Ob20ProtocolProcessor ob_2_0_processor_; - private: +private: rpc::frame::ObReqDeliver& deliver_; }; // end of class ObMySQLHandler diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h b/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h index 92087dac7..8cfc046f1 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h @@ -308,7 +308,7 @@ char const* get_info_func_name(const ObInformationFunctions func); template class ObCommonKV { - public: +public: ObCommonKV() : key_(), value_() {} void reset() @@ -326,7 +326,7 @@ typedef ObCommonKV ObStringKV; static const int64_t MAX_STORE_LENGTH = 9; class ObMySQLPacketHeader { - public: +public: ObMySQLPacketHeader() : len_(0), seq_(0) {} @@ -338,7 +338,7 @@ class ObMySQLPacketHeader { TO_STRING_KV("length", len_, "sequence", seq_); - public: +public: uint32_t len_; // MySQL packet length not include packet header uint8_t seq_; // MySQL packet sequence }; @@ -351,21 +351,21 @@ class ObMySQLPacketHeader { * http://imysql.com/mysql-internal-manual/compressed-packet-header.html */ class ObMySQLCompressedPacketHeader { - public: +public: ObMySQLCompressedPacketHeader() : comp_len_(0), comp_seq_(0), uncomp_len(0) {} TO_STRING_KV( "compressed_length", comp_len_, "compressed_sequence", comp_seq_, "length_before_compression", uncomp_len); - public: +public: uint32_t comp_len_; // length of compressed payload, not include packet header uint8_t comp_seq_; // compressed sequence id uint32_t uncomp_len; // length of payload before compressio }; class ObMySQLPacket : public rpc::ObPacket { - public: +public: ObMySQLPacket() : hdr_(), cdata_(NULL) {} virtual ~ObMySQLPacket() @@ -402,13 +402,13 @@ class ObMySQLPacket : public rpc::ObPacket { VIRTUAL_TO_STRING_KV("header", hdr_); - protected: +protected: virtual int serialize(char*, const int64_t, int64_t&) const { return common::OB_NOT_SUPPORTED; } - public: +public: static const int64_t HANDSHAKE_RESPONSE_RESERVED_SIZE = 23; // 4: capability flags // 4: max-packet size @@ -419,13 +419,13 @@ class ObMySQLPacket : public rpc::ObPacket { // 2: capability flags static const int64_t MIN_CAPABILITY_SIZE = 2; - protected: +protected: ObMySQLPacketHeader hdr_; const char* cdata_; }; class ObMySQLRawPacket : public ObMySQLPacket { - public: +public: ObMySQLRawPacket() : ObMySQLPacket(), cmd_(OB_MYSQL_COM_MAX_NUM), can_reroute_pkt_(false), exist_trace_info_(false), trace_info_() {} @@ -485,13 +485,13 @@ class ObMySQLRawPacket : public ObMySQLPacket { TO_STRING_KV("header", hdr_, "can_reroute", can_reroute_pkt_); - protected: +protected: virtual int serialize(char*, const int64_t, int64_t&) const; - private: +private: void set_len(uint32_t len); - private: +private: ObMySQLCmd cmd_; bool can_reroute_pkt_; bool exist_trace_info_; @@ -499,7 +499,7 @@ class ObMySQLRawPacket : public ObMySQLPacket { }; class ObMySQLCompressedPacket : public rpc::ObPacket { - public: +public: ObMySQLCompressedPacket() : hdr_(), cdata_(NULL) {} virtual ~ObMySQLCompressedPacket() @@ -532,7 +532,7 @@ class ObMySQLCompressedPacket : public rpc::ObPacket { VIRTUAL_TO_STRING_KV("header", hdr_); - protected: +protected: ObMySQLCompressedPacketHeader hdr_; const char* cdata_; }; diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.h b/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.h index ec6595c3f..7f37c5c82 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.h @@ -25,7 +25,7 @@ namespace obmysql { class ObMysqlPktContext; class ObMysqlProtocolProcessor : public ObVirtualCSProtocolProcessor { - public: +public: ObMysqlProtocolProcessor(ObMySQLHandler& handler) : ObVirtualCSProtocolProcessor(handler) {} virtual ~ObMysqlProtocolProcessor() @@ -34,7 +34,7 @@ class ObMysqlProtocolProcessor : public ObVirtualCSProtocolProcessor { virtual int decode(easy_message_t* m, rpc::ObPacket*& pkt) override; virtual int process(easy_request_t* r, bool& is_going_on) override; - protected: +protected: int decode_hsr_body(easy_message_t& m, const uint32_t pktlen, const uint8_t pktseq, rpc::ObPacket*& pkt); int decode_sslr_body(easy_message_t& m, const uint32_t pktlen, const uint8_t pktseq, rpc::ObPacket*& pkt); @@ -57,7 +57,7 @@ class ObMysqlProtocolProcessor : public ObVirtualCSProtocolProcessor { int process_mysql_packet(easy_connection_t& c, easy_pool_t& pool, void*& ipacket, bool& need_decode_more); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMysqlProtocolProcessor); }; diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h b/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h index e9994bb40..5c2a8b18f 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h @@ -37,7 +37,7 @@ static const int64_t OB_MAX_COMPRESSED_PACKET_LENGTH = (1L << 20); static const int64_t MAX_COMPRESSED_BUF_SIZE = common::OB_MALLOC_BIG_BLOCK_SIZE; // 2M-1k class ObMysqlPktContext { - public: +public: enum ObMysqlPktReadStep { READ_HEADER = 0, READ_BODY, READ_COMPLETE }; ObMysqlPktContext() : arena_(common::ObModIds::LIB_MULTI_PACKETS) { @@ -83,7 +83,7 @@ class ObMysqlPktContext { get_read_step_str(next_read_step_), K_(raw_pkt), "used", arena_.used(), "total", arena_.total(), K_(is_multi_pkt)); - public: +public: char header_buf_[common::OB_MYSQL_HEADER_LENGTH]; int64_t header_buffered_len_; char* payload_buf_; @@ -98,12 +98,12 @@ class ObMysqlPktContext { bool is_multi_pkt_; common::ObArenaAllocator arena_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMysqlPktContext); }; class ObCompressedPktContext { - public: +public: ObCompressedPktContext() { reset(); @@ -118,16 +118,16 @@ class ObCompressedPktContext { TO_STRING_KV(K_(last_pkt_seq), K_(is_multi_pkt)); - public: +public: uint8_t last_pkt_seq_; bool is_multi_pkt_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCompressedPktContext); }; class ObProto20PktContext { - public: +public: ObProto20PktContext() { reset(); @@ -144,18 +144,18 @@ class ObProto20PktContext { TO_STRING_KV(K_(comp_last_pkt_seq), K_(is_multi_pkt), K_(proto20_last_request_id), K_(proto20_last_pkt_seq)); - public: +public: uint8_t comp_last_pkt_seq_; bool is_multi_pkt_; uint32_t proto20_last_request_id_; uint8_t proto20_last_pkt_seq_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObProto20PktContext); }; class ObEasyBuffer { - public: +public: explicit ObEasyBuffer(easy_buf_t& ezbuf) : buf_(ezbuf), read_pos_(ezbuf.pos) {} ~ObEasyBuffer() @@ -239,11 +239,11 @@ class ObEasyBuffer { TO_STRING_KV(KP_(read_pos), KP(buf_.pos), KP(buf_.last), KP(buf_.end), "orig_buf_size", orig_buf_size(), "orig_data_size", orig_data_size(), "read_avail_size", read_avail_size(), "write_avail_size", write_avail_size()); - public: +public: easy_buf_t& buf_; char* read_pos_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObEasyBuffer); }; @@ -257,7 +257,7 @@ enum ObCompressType { }; class ObCompressionContext { - public: +public: ObCompressionContext() { reset(); @@ -335,7 +335,7 @@ class ObCompressionContext { return pos; } - public: +public: ObCompressType type_; bool is_checksum_off_; uint8_t seq_; // compressed pkt seq @@ -343,12 +343,12 @@ class ObCompressionContext { char* last_pkt_pos_; // proxy last pkt(error+ok, eof+ok, ok)'s pos in orig_ezbuf, default is null uint32_t sessid_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCompressionContext); }; class ObFlushBufferParam { - public: +public: ObFlushBufferParam(easy_buf_t& ez_buf, easy_request_t& ez_req, ObCompressionContext& context, bool& conn_valid, bool& req_has_wokenup, const bool io_thread_mark, const bool pkt_has_completed) : orig_send_buf_(ez_buf), @@ -360,7 +360,7 @@ class ObFlushBufferParam { pkt_has_completed_(pkt_has_completed) {} - public: +public: ObEasyBuffer orig_send_buf_; easy_request_t& ez_req_; ObCompressionContext& comp_context_; @@ -369,12 +369,12 @@ class ObFlushBufferParam { const bool io_thread_mark_; const bool pkt_has_completed_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFlushBufferParam); }; class ObMySQLRequestUtils { - public: +public: ObMySQLRequestUtils(); virtual ~ObMySQLRequestUtils(); static int encode_packet(easy_buf_t* ez_buf, ObMySQLPacket& pkt, const uint8_t packet_seq); @@ -387,7 +387,7 @@ class ObMySQLRequestUtils { static void wakeup_easy_request(easy_request_t& ez_req, bool& req_has_wokenup, const bool io_thread_mark = false); static void disconnect(easy_request_t& ez_req); - private: +private: static int check_flush_param(ObFlushBufferParam& param); static int build_compressed_packet( ObEasyBuffer& src_buf, const int64_t next_compress_size, ObCompressionContext& context); @@ -414,7 +414,7 @@ class ObMySQLRequestUtils { return ret_size; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMySQLRequestUtils); }; diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_row.h b/deps/oblib/src/rpc/obmysql/ob_mysql_row.h index 46c121cc9..9eb9c425b 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_row.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_row.h @@ -19,10 +19,10 @@ namespace oceanbase { namespace obmysql { class ObMySQLRow { - public: +public: explicit ObMySQLRow(MYSQL_PROTOCOL_TYPE type); - public: +public: /** * Serialize the row of data into a format recognized by MySQL, * output position: buf + pos, after execution, @@ -30,11 +30,11 @@ class ObMySQLRow { */ int serialize(char* buf, const int64_t len, int64_t& pos) const; - protected: +protected: virtual int64_t get_cells_cnt() const = 0; virtual int encode_cell(int64_t idx, char* buf, int64_t len, int64_t& pos, char* bitmap) const = 0; - protected: +protected: const MYSQL_PROTOCOL_TYPE type_; }; // end class ObMySQLRow diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_translator.h b/deps/oblib/src/rpc/obmysql/ob_mysql_translator.h index 167cb752b..13a217a5d 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_translator.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_translator.h @@ -22,7 +22,7 @@ namespace obmysql { using rpc::frame::ObReqProcessor; class ObMySQLTranslator : public rpc::frame::ObReqTranslator { - public: +public: ObMySQLTranslator() {} virtual ~ObMySQLTranslator() diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_util.h b/deps/oblib/src/rpc/obmysql/ob_mysql_util.h index 1c0ae2bea..afa2f9ca2 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_util.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_util.h @@ -39,7 +39,7 @@ enum MYSQL_PROTOCOL_TYPE { }; class ObMySQLUtil { - public: +public: /** * update null bitmap for binary protocol * please review http://dev.mysql.com/doc/internals/en/prepared-statements.html#null-bitmap for detail @@ -228,10 +228,10 @@ class ObMySQLUtil { static int urowid_cell_str(char* buf, const int64_t len, const common::ObURowIDData& urowid_data, int64_t& pos); static int lob_locator_cell_str(char* buf, const int64_t len, const common::ObLobLocator& lob_locator, int64_t& pos); - public: +public: static const uint64_t NULL_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMySQLUtil); }; // class ObMySQLUtil diff --git a/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.h b/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.h index 2c287ae22..c2f8c7742 100644 --- a/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.h @@ -24,7 +24,7 @@ class ObPacket; namespace obmysql { class ObMySQLHandler; class ObVirtualCSProtocolProcessor { - public: +public: ObVirtualCSProtocolProcessor(ObMySQLHandler& handler) : handler_(handler) {} virtual ~ObVirtualCSProtocolProcessor() @@ -33,10 +33,10 @@ class ObVirtualCSProtocolProcessor { virtual int decode(easy_message_t* m, rpc::ObPacket*& pkt) = 0; virtual int process(easy_request_t* r, bool& need_read_more) = 0; - protected: +protected: inline int set_next_read_len(easy_message_t* m, const int64_t fallback_len, const int64_t next_read_len); - protected: +protected: ObMySQLHandler& handler_; }; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.h b/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.h index dc9821693..84daf16bd 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.h @@ -22,7 +22,7 @@ using common::ObString; namespace obmysql { class OMPKChangeUser : public ObMySQLRawPacket { - public: +public: OMPKChangeUser(); virtual ~OMPKChangeUser() @@ -90,12 +90,12 @@ class OMPKChangeUser : public ObMySQLRawPacket { } virtual int64_t get_serialize_size() const; - private: +private: uint64_t get_session_vars_len() const; uint64_t get_connect_attrs_len() const; int serialize_session_vars(char* buffer, const int64_t length, int64_t& pos) const; - private: +private: uint8_t cmd_; uint8_t character_set_; ObMySQLCapabilityFlags mysql_cap_; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_eof.h b/deps/oblib/src/rpc/obmysql/packet/ompk_eof.h index 8550d9bb7..8433c215d 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_eof.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_eof.h @@ -24,7 +24,7 @@ namespace obmysql { // OK packet (such as session state tracking), and to avoid repeating the changes // in the EOF packet, the EOF packet is deprecated as of MySQL 5.7.5. class OMPKEOF : public ObMySQLPacket { - public: +public: OMPKEOF(); virtual ~OMPKEOF(); @@ -55,7 +55,7 @@ class OMPKEOF : public ObMySQLPacket { } virtual int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(OMPKEOF); uint8_t field_count_; // always 0xfe diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_error.h b/deps/oblib/src/rpc/obmysql/packet/ompk_error.h index 2f7137233..cc1da2bb4 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_error.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_error.h @@ -20,11 +20,11 @@ namespace oceanbase { namespace obmysql { class OMPKError : public ObMySQLPacket { - public: +public: static const uint64_t SQLSTATE_SIZE = 5; static const uint8_t MARKER = '#'; - public: +public: OMPKError(); virtual ~OMPKError(); @@ -57,8 +57,8 @@ class OMPKError : public ObMySQLPacket { } virtual int64_t to_string(char* buf, const int64_t buf_len) const; - private: - private: +private: +private: DISALLOW_COPY_AND_ASSIGN(OMPKError); uint8_t field_count_; // always 0xff uint16_t errcode_; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_field.h b/deps/oblib/src/rpc/obmysql/packet/ompk_field.h index 66a30d928..63255ac25 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_field.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_field.h @@ -20,14 +20,14 @@ namespace oceanbase { namespace obmysql { class OMPKField : public ObMySQLPacket { - public: +public: explicit OMPKField(ObMySQLField& field); virtual ~OMPKField() {} virtual int serialize(char* buffer, int64_t len, int64_t& pos) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(OMPKField); ObMySQLField& field_; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.h b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.h index f44dcf993..556b7c763 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.h @@ -22,11 +22,11 @@ namespace oceanbase { namespace obmysql { class OMPKHandshake : public ObMySQLPacket { - public: +public: static const int32_t SCRAMBLE_SIZE = 8; static const int64_t SCRAMBLE_TOTAL_SIZE = 20; - public: +public: OMPKHandshake(); // TODO use ob server info to init handshake packet @@ -118,10 +118,10 @@ class OMPKHandshake : public ObMySQLPacket { uint16_t capability_; }; - private: +private: const char* get_handshake_inner_pulgin_name(const common::ObString outer_string) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(OMPKHandshake); static const char* SERVER_VERSION_STR; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.h b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.h index af65c2a73..ecf73acba 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.h @@ -23,7 +23,7 @@ namespace obmysql { using common::ObString; class OMPKHandshakeResponse : public ObMySQLPacket { - public: +public: OMPKHandshakeResponse() : capability_(), max_packet_size_(0), @@ -119,10 +119,10 @@ class OMPKHandshakeResponse : public ObMySQLPacket { VIRTUAL_TO_STRING_KV("header", hdr_, K_(capability_.capability), K_(max_packet_size), K_(character_set), K_(username), K_(database), K_(auth_plugin_name), K_(connect_attrs)); - private: +private: uint64_t get_connect_attrs_len() const; - private: +private: // capability flags of the client as defined in Protocol::CapabilityFlags. ObMySQLCapabilityFlags capability_; // max size of a command packet that the client wants to send to the server. diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_ok.h b/deps/oblib/src/rpc/obmysql/packet/ompk_ok.h index afaef19c5..a5222cabb 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_ok.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_ok.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace obmysql { class OMPKOK : public ObMySQLPacket { - public: +public: OMPKOK(); virtual ~OMPKOK() {} @@ -112,7 +112,7 @@ class OMPKOK : public ObMySQLPacket { virtual int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: int decode_session_state_info(const char*& pos); uint64_t get_state_info_len() const; uint64_t get_track_system_vars_len() const; @@ -121,7 +121,7 @@ class OMPKOK : public ObMySQLPacket { static uint64_t get_kv_encode_len(const ObStringKV& string_kv); static ObStringKV get_separator_kv(); - private: +private: const static int64_t SESSION_TRACK_SYSTEM_VARIABLES = 0x00; const static int64_t SESSION_TRACK_SCHEMA = 0x01; const static int64_t SESSION_TRACK_STATE_CHANGE = 0x02; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.h b/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.h index 47c4a44c1..0d3600964 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.h @@ -33,7 +33,7 @@ namespace obmysql { */ class OMPKPrepare : public ObMySQLPacket { - public: +public: OMPKPrepare() : status_(0), statement_id_(0), column_num_(0), param_num_(0), reserved_(0), warning_count_(0) {} virtual ~OMPKPrepare() @@ -62,7 +62,7 @@ class OMPKPrepare : public ObMySQLPacket { warning_count_ = count; } - private: +private: uint8_t status_; uint32_t statement_id_; uint16_t column_num_; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.h b/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.h index 4a89836b6..cbd3265b9 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace obmysql { class OMPKResheader : public ObMySQLPacket { - public: +public: OMPKResheader(); virtual ~OMPKResheader(); @@ -38,7 +38,7 @@ class OMPKResheader : public ObMySQLPacket { return field_count_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(OMPKResheader); uint64_t field_count_; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_row.h b/deps/oblib/src/rpc/obmysql/packet/ompk_row.h index e302a14e2..2110c1b0e 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_row.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_row.h @@ -20,14 +20,14 @@ namespace oceanbase { namespace obmysql { class OMPKRow : public ObMySQLPacket { - public: +public: explicit OMPKRow(const ObMySQLRow& row); virtual ~OMPKRow() {} virtual int serialize(char* buffer, int64_t len, int64_t& pos) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(OMPKRow); const ObMySQLRow& row_; }; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.h b/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.h index a70ccb43f..05fea3be6 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.h @@ -23,7 +23,7 @@ namespace obmysql { using common::ObString; class OMPKSSLRequest : public ObMySQLPacket { - public: +public: OMPKSSLRequest() : capability_(), max_packet_size_(0), character_set_(0) {} @@ -70,10 +70,10 @@ class OMPKSSLRequest : public ObMySQLPacket { VIRTUAL_TO_STRING_KV("header", hdr_, K_(capability_.capability), K_(max_packet_size), K_(character_set)); - private: +private: uint64_t get_connect_attrs_len() const; - private: +private: // capability flags of the client as defined in Protocol::CapabilityFlags. ObMySQLCapabilityFlags capability_; // max size of a command packet that the client wants to send to the server. diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_string.h b/deps/oblib/src/rpc/obmysql/packet/ompk_string.h index 6c32dc800..8a8d6a7a8 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_string.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_string.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace obmysql { class OMPKString : public ObMySQLPacket { - public: +public: explicit OMPKString(const common::ObString& str) : str_(str) {} @@ -45,7 +45,7 @@ class OMPKString : public ObMySQLPacket { VIRTUAL_TO_STRING_KV("header", hdr_, K_(str)); - private: +private: DISALLOW_COPY_AND_ASSIGN(OMPKString); const common::ObString& str_; }; // end of class OMPKString diff --git a/deps/oblib/src/rpc/obrpc/ob_irpc_extra_payload.h b/deps/oblib/src/rpc/obrpc/ob_irpc_extra_payload.h index 393f69668..d0d987383 100644 --- a/deps/oblib/src/rpc/obrpc/ob_irpc_extra_payload.h +++ b/deps/oblib/src/rpc/obrpc/ob_irpc_extra_payload.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace obrpc { class ObIRpcExtraPayload { - public: +public: virtual ~ObIRpcExtraPayload() {} @@ -37,12 +37,12 @@ class ObIRpcExtraPayload { instance_pointer() = &extra_payload; } - private: +private: static inline ObIRpcExtraPayload*& instance_pointer(); }; class ObEmptyExtraPayload : public ObIRpcExtraPayload { - public: +public: virtual int64_t get_serialize_size() const override { return 0; diff --git a/deps/oblib/src/rpc/obrpc/ob_net_client.h b/deps/oblib/src/rpc/obrpc/ob_net_client.h index ddaf5f30b..7acd50e5c 100644 --- a/deps/oblib/src/rpc/obrpc/ob_net_client.h +++ b/deps/oblib/src/rpc/obrpc/ob_net_client.h @@ -27,7 +27,7 @@ namespace obrpc { class ObRpcProxy; class ObNetClient { - public: +public: ObNetClient(); virtual ~ObNetClient(); @@ -36,16 +36,16 @@ class ObNetClient { void destroy(); int get_proxy(ObRpcProxy& proxy); - private: +private: int init_(const rpc::frame::ObNetOptions opts); - private: +private: bool inited_; rpc::frame::ObNetEasy net_; ObRpcNetHandler pkt_handler_; rpc::frame::ObReqTransport* transport_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNetClient); }; // end of class ObNetClient diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.h b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.h index 9cbbd4fe5..6aa32bf6a 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.h @@ -24,7 +24,7 @@ class ObStreamCompressor; namespace obrpc { class ObRpcCompressProtocolProcessor : public ObVirtualRpcProtocolProcessor { - public: +public: ObRpcCompressProtocolProcessor() {} virtual ~ObRpcCompressProtocolProcessor() @@ -33,7 +33,7 @@ class ObRpcCompressProtocolProcessor : public ObVirtualRpcProtocolProcessor { virtual int encode(easy_request_t* req, ObRpcPacket* pkt); virtual int decode(easy_message_t* ms, ObRpcPacket*& pkt); - private: +private: int reset_compress_ctx_mode(easy_connection_t* conn, ObRpcCompressMode mode, ObRpcPacket*& pkt, ObCmdPacketInCompress::CmdType& cmd_type, bool& is_still_need_compress); diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.h b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.h index 1eef6ba93..a94e9bde3 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.h @@ -28,7 +28,7 @@ enum ObRpcCompressMode { }; struct ObRpcCompressCtx { - public: +public: ObRpcCompressCtx() : is_inited_(false), compress_mode_(RPC_STREAM_COMPRESS_NONE), @@ -109,7 +109,7 @@ struct ObRpcCompressCtx { VIRTUAL_TO_STRING_KV(K(is_inited_), K(compress_mode_), K(block_size_), K(ring_buffer_pos_), K(ring_buffer_size_), KP(ring_buffer_), KP(compressor_)); - public: +public: bool is_inited_; ObRpcCompressMode compress_mode_; int16_t block_size_; @@ -120,7 +120,7 @@ struct ObRpcCompressCtx { }; struct ObRpcCompressCCtx : public ObRpcCompressCtx { - public: +public: ObRpcCompressCCtx() : total_data_size_before_compress_(0), cctx_(NULL) {} ~ObRpcCompressCCtx() @@ -131,13 +131,13 @@ struct ObRpcCompressCCtx : public ObRpcCompressCtx { TO_STRING_KV(K(is_inited_), K(compress_mode_), K(block_size_), K(ring_buffer_pos_), K(ring_buffer_size_), KP(ring_buffer_), K(total_data_size_before_compress_), KP(compressor_), KP(cctx_)); - public: +public: int64_t total_data_size_before_compress_; void* cctx_; }; struct ObRpcCompressDCtx : public ObRpcCompressCtx { - public: +public: ObRpcCompressDCtx() : dctx_(NULL) {} ~ObRpcCompressDCtx() @@ -146,14 +146,14 @@ struct ObRpcCompressDCtx : public ObRpcCompressCtx { int reset_mode(ObRpcCompressMode new_mode); int free_ctx_mem(); - public: +public: TO_STRING_KV(K(is_inited_), K(compress_mode_), K(block_size_), K(ring_buffer_pos_), K(ring_buffer_size_), KP(ring_buffer_), KP(compressor_), KP(dctx_)); void* dctx_; }; struct ObRpcCompressCtxSet { - public: +public: ObRpcCompressCtxSet() {} ~ObRpcCompressCtxSet() @@ -161,13 +161,13 @@ struct ObRpcCompressCtxSet { void free_ctx_memory(); TO_STRING_KV(K(compress_ctx_), K(decompress_ctx_)); - public: +public: ObRpcCompressCCtx compress_ctx_; ObRpcCompressDCtx decompress_ctx_; }; struct ObCompressPacketHeader { - public: +public: ObCompressPacketHeader() : magic_(0x00), full_size_(0) {} ~ObCompressPacketHeader() @@ -185,7 +185,7 @@ struct ObCompressPacketHeader { return 0 != (magic_ & COMPRESS_RESULT_MASK); } - public: +public: // The second and third digits from the bottom of magic_num indicate the compression algorithm, currently 00 means // lz4, 01 means zstd const int8_t COMPRESS_METHOD_MASK = 0x6; @@ -204,7 +204,7 @@ struct ObCompressPacketHeader { // Do not modify this structure, do not add or delete fields at will struct ObCompressHeadPacketHeader : public ObCompressPacketHeader { - public: +public: // The highest bit of Magic HeadPacket is 0 ObCompressHeadPacketHeader() : total_data_len_before_compress_(0), total_data_len_after_compress_(0), compressed_size_(0), origin_size_(0) @@ -221,7 +221,7 @@ struct ObCompressHeadPacketHeader : public ObCompressPacketHeader { TO_STRING_KV(K(magic_), K(full_size_), K(total_data_len_before_compress_), K(total_data_len_after_compress_), K(compressed_size_), K(origin_size_)); - public: +public: int32_t total_data_len_before_compress_; // The size of the entire ObRpcPacket before compression int32_t total_data_len_after_compress_; // The compressed size of the entire ObRpcPacket int16_t compressed_size_; // The size of compressed data in this package @@ -230,7 +230,7 @@ struct ObCompressHeadPacketHeader : public ObCompressPacketHeader { // Do not modify this structure, do not add or delete fields at will struct ObCompressSegmentPacketHeader : public ObCompressPacketHeader { - public: +public: ObCompressSegmentPacketHeader() : origin_size_(0) {} ~ObCompressSegmentPacketHeader() @@ -241,7 +241,7 @@ struct ObCompressSegmentPacketHeader : public ObCompressPacketHeader { virtual int64_t get_encode_size() const; TO_STRING_KV(K(magic_), K(full_size_), K(origin_size_)); - public: +public: int16_t origin_size_; }; @@ -249,7 +249,7 @@ struct ObCompressSegmentPacketHeader : public ObCompressPacketHeader { // payload, determine how many members can be deserialized in the end struct ObCmdPacketInCompress : public ObCompressPacketHeader { // cmd packet post when in compress mode - public: +public: enum CmdType { RPC_CMD_INVALID = 0, RPC_CMD_MODIFY_COMPRESS_MODE = 1, @@ -276,7 +276,7 @@ struct ObCmdPacketInCompress : public ObCompressPacketHeader { return RPC_CMD_RESET_COMPRESS_CTX == cmd_type_; } - public: +public: const int16_t CMD_PAY_LOAD = sizeof(cmd_type_) + sizeof(compress_mode_); const int8_t MAGIC_NUM = (int8_t)0xff; TO_STRING_KV(K(magic_), K(full_size_), K(payload_), K(cmd_type_), K(compress_mode_)); @@ -288,7 +288,7 @@ struct ObCmdPacketInCompress : public ObCompressPacketHeader { // If you want to add or delete members, you need to pay attention to compatibility struct ObCmdPacketInNormal { // cmd packet post when in normal mode - public: +public: ObCmdPacketInNormal() : full_size_(0), payload_(CMD_PAY_LOAD), @@ -317,7 +317,7 @@ struct ObCmdPacketInNormal { int64_t get_decode_size() const; TO_STRING_KV(K(full_size_), K(payload_), K(compress_mode_), K(block_size_), K(ring_buffer_size_)); - public: +public: // 4 bytes magic_num const int16_t CMD_PAY_LOAD = sizeof(compress_mode_) + sizeof(block_size_) + sizeof(ring_buffer_size_); int32_t full_size_; // include following compressed packet diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_handler.h b/deps/oblib/src/rpc/obrpc/ob_rpc_handler.h index a8c511958..76b74353f 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_handler.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_handler.h @@ -21,17 +21,17 @@ namespace obrpc { // Collection of easy callback functions, implement of OceanBase RPC // processing. Pass to deliverer once RPC packet comes. class ObRpcHandler : public ObRpcNetHandler { - public: +public: explicit ObRpcHandler(rpc::frame::ObReqDeliver& deliver); virtual ~ObRpcHandler(); int init(); int process(easy_request_t* r); - private: +private: rpc::frame::ObReqDeliver& deliver_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcHandler); }; // end of class ObRpcHandler diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.h b/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.h index 520773d2c..76f72e55a 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace obrpc { class ObRpcNetHandler : public rpc::frame::ObReqHandler { - public: +public: ObRpcNetHandler() { ez_handler_.decode = oceanbase::easy::decode; @@ -43,13 +43,13 @@ class ObRpcNetHandler : public rpc::frame::ObReqHandler { int on_disconnect(easy_connection_t* c); int on_idle(easy_connection_t* c); - public: +public: static int64_t CLUSTER_ID; - protected: +protected: char* easy_alloc(easy_pool_t* pool, int64_t size) const; - private: +private: ObRpcProtocolProcessor rpc_processor_; ObRpcCompressProtocolProcessor rpc_compress_processor_; diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_packet.h b/deps/oblib/src/rpc/obrpc/ob_rpc_packet.h index 9b14d27f6..25c5b14d5 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_packet.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_packet.h @@ -53,7 +53,7 @@ enum ObRpcPacketCode { }; class ObRpcPacketCodeChecker { - public: +public: ObRpcPacketCodeChecker() {} ~ObRpcPacketCodeChecker() @@ -82,7 +82,7 @@ class ObRpcPacketSet { #undef PCODE_DEF } - public: +public: int64_t idx_of_pcode(ObRpcPacketCode code) const { int64_t index = 0; @@ -115,10 +115,10 @@ class ObRpcPacketSet { return instance_; } - public: +public: static const int64_t THE_PCODE_COUNT = PCODE_COUNT; - private: +private: static ObRpcPacketSet instance_; const char* names_[PCODE_COUNT]; @@ -127,7 +127,7 @@ class ObRpcPacketSet { }; class ObRpcPacketHeader { - public: +public: static const uint8_t HEADER_SIZE = 112; // you should never change this. static const uint16_t RESP_FLAG = 1 << 15; static const uint16_t STREAM_FLAG = 1 << 14; @@ -179,10 +179,10 @@ class ObRpcPacketHeader { class ObRpcPacket : public rpc::ObPacket { friend class ObPacketQueue; - public: +public: static uint32_t global_chid; - public: +public: ObRpcPacket(); virtual ~ObRpcPacket(); @@ -315,20 +315,20 @@ class ObRpcPacket : public rpc::ObPacket { TO_STRING_KV(K(hdr_), K(chid_), K(clen_), K_(assemble), K_(msg_count), K_(payload)); - private: +private: ObRpcPacketHeader hdr_; const char* cdata_; uint32_t clen_; uint32_t chid_; // channel id int64_t receive_ts_; // do not serialize it - public: +public: // for assemble bool assemble_; int32_t msg_count_; int64_t payload_; easy_list_t list_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcPacket); }; diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_processor.h b/deps/oblib/src/rpc/obrpc/ob_rpc_processor.h index cd8074018..51c054606 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_processor.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_processor.h @@ -25,10 +25,10 @@ namespace obrpc { template class ObRpcProcessor : public ObRpcProcessorBase { - public: +public: static constexpr ObRpcPacketCode PCODE = T::PCODE; - public: +public: ObRpcProcessor() {} virtual ~ObRpcProcessor() @@ -38,14 +38,14 @@ class ObRpcProcessor : public ObRpcProcessorBase { return m_check_timeout(); } - protected: +protected: virtual int process() = 0; virtual int preprocess_arg() { return common::OB_SUCCESS; } - protected: +protected: int decode_base(const char* buf, const int64_t len, int64_t& pos) { return common::serialization::decode(buf, len, pos, arg_); @@ -63,11 +63,11 @@ class ObRpcProcessor : public ObRpcProcessorBase { return common::serialization::encoded_length(result_); } - protected: +protected: typename T::Request arg_; typename T::Response result_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcProcessor); }; // end of class ObRpcProcessor diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.h b/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.h index 9fda4cf32..b05b19a74 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.h @@ -26,10 +26,10 @@ namespace obrpc { class ObRpcSessionHandler; class ObRpcStreamCond; class ObRpcProcessorBase : public rpc::frame::ObReqProcessor { - public: +public: static constexpr int64_t DEFAULT_WAIT_NEXT_PACKET_TIMEOUT = 30 * 1000 * 1000L; - public: +public: ObRpcProcessorBase() : rpc_pkt_(NULL), sh_(NULL), @@ -76,7 +76,7 @@ class ObRpcProcessorBase : public rpc::frame::ObReqProcessor { return cluster_id; } - protected: +protected: struct Response { Response(int64_t sessid, bool is_stream, bool is_stream_last, bool bad_routing, ObRpcPacket* pkt) : sessid_(sessid), is_stream_(is_stream), is_stream_last_(is_stream_last), bad_routing_(bad_routing), pkt_(pkt) @@ -113,7 +113,7 @@ class ObRpcProcessorBase : public rpc::frame::ObReqProcessor { result_compress_type_ = t; } - protected: +protected: int part_response(const int retcode, bool is_last); int do_response(const Response& rsp); void compress_result(const char* src_buf, int64_t src_len, char* dst_buf, int64_t dst_len, ObRpcPacket* pkt); @@ -140,13 +140,13 @@ class ObRpcProcessorBase : public rpc::frame::ObReqProcessor { } virtual void cleanup(); - protected: +protected: virtual int decode_base(const char* buf, const int64_t len, int64_t& pos) = 0; virtual int m_get_pcode() = 0; virtual int encode_base(char* buf, const int64_t len, int64_t& pos) = 0; virtual int64_t m_get_encoded_length() = 0; - protected: +protected: const ObRpcPacket* rpc_pkt_; ObRpcSessionHandler* sh_; ObRpcStreamCond* sc_; @@ -180,7 +180,7 @@ class ObRpcProcessorBase : public rpc::frame::ObReqProcessor { common::ObCompressorType result_compress_type_; const uint64_t unis_version_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcProcessorBase); }; // end of class ObRpcProcessorBase diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.h b/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.h index 8f7e38a3f..bf726060d 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.h @@ -24,7 +24,7 @@ class ObTimeGuard; namespace obrpc { class ObRpcProtocolProcessor : public ObVirtualRpcProtocolProcessor { - public: +public: ObRpcProtocolProcessor() {} virtual ~ObRpcProtocolProcessor() @@ -33,7 +33,7 @@ class ObRpcProtocolProcessor : public ObVirtualRpcProtocolProcessor { virtual int encode(easy_request_t* req, ObRpcPacket* pkt); virtual int decode(easy_message_t* ms, ObRpcPacket*& pkt); - private: +private: /* *@param [out] is_demand_data_enough: true if length of received data is enough to decode a packet, or false *@param [out] preceding_data_len: data len need skip when decode packet, when beginnign with a cmdPacket, diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h index b1b3cc89d..95abdee45 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h @@ -54,10 +54,10 @@ struct ObRpcOpts { }; class ObRpcProxy { - public: +public: class PCodeGuard; - public: +public: static const int64_t MAX_RPC_TIMEOUT = 9000 * 1000; static common::ObAddr myaddr_; struct NoneT { @@ -78,18 +78,18 @@ class ObRpcProxy { TO_STRING_EMPTY(); }; - public: +public: template struct ObRpc {}; // asynchronous callback template class AsyncCB : public rpc::frame::ObReqTransport::AsyncCB { - protected: + protected: using Request = typename pcodeStruct::Request; using Response = typename pcodeStruct::Response; - public: + public: int decode(void* pkt); virtual void do_first(); @@ -97,15 +97,15 @@ class ObRpcProxy { virtual void destroy() {} - protected: + protected: void check_request_rt(const bool force_print = false); - protected: + protected: Response result_; ObRpcResultCode rcode_; }; - public: +public: ObRpcProxy(); int init(const rpc::frame::ObReqTransport* transport, const common::ObAddr& dst = common::ObAddr()); @@ -201,7 +201,7 @@ class ObRpcProxy { const common::ObAddr& local_addr, const common::ObString& ssl_invited_nodes, const rpc::frame::ObReqTransport::AsyncCB* cb = NULL); - protected: +protected: // we can definitely judge input or output argument by their // constant specifier since they're only called by our wrapper // function where input argument is always const-qualified whereas @@ -218,13 +218,13 @@ class ObRpcProxy { int rpc_post(const typename pcodeStruct::Request& args, AsyncCB* cb, const ObRpcOpts& opts); int rpc_post(ObRpcPacketCode pcode, rpc::frame::ObReqTransport::AsyncCB* cb, const ObRpcOpts& opts); - private: +private: int send_request(const rpc::frame::ObReqTransport::Request& req, rpc::frame::ObReqTransport::Result& result) const; int log_user_error_and_warn(const ObRpcResultCode& rcode) const; - protected: +protected: const rpc::frame::ObReqTransport* transport_; common::ObAddr dst_; int64_t timeout_; @@ -240,7 +240,7 @@ class ObRpcProxy { }; class ObRpcProxy::PCodeGuard { - public: +public: PCodeGuard(const obrpc::ObRpcPacketCode pcode) { last_pcode_ = obrpc::current_pcode(); @@ -251,7 +251,7 @@ class ObRpcProxy::PCodeGuard { obrpc::set_current_pcode(last_pcode_); } - private: +private: obrpc::ObRpcPacketCode last_pcode_; }; @@ -259,14 +259,14 @@ class ObRpcProxy::PCodeGuard { class Handle { friend class ObRpcProxy; - public: +public: Handle(); const common::ObAddr& get_dst_addr() const { return dst_; } - protected: +protected: bool has_more_; common::ObAddr dst_; int64_t sessid_; @@ -275,7 +275,7 @@ class Handle { ObRpcProxy proxy_; ObRpcPacketCode pcode_; - private: +private: DISALLOW_COPY_AND_ASSIGN(Handle); }; @@ -284,13 +284,13 @@ template class SSHandle : public Handle { friend class ObRpcProxy; - public: +public: bool has_more() const; int get_more(typename pcodeStruct::Response& result); int abort(); const ObRpcResultCode& get_result_code() const; - protected: +protected: ObRpcResultCode rcode_; }; diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_request.h b/deps/oblib/src/rpc/obrpc/ob_rpc_request.h index 69dbf59ec..7634e93ba 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_request.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_request.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace obrpc { class ObRpcRequest : public rpc::ObRequest { - public: +public: ObRpcRequest(Type type) : ObRequest(type) {} @@ -31,7 +31,7 @@ class ObRpcRequest : public rpc::ObRequest { inline int response_fail(common::ObDataBuffer* buffer, const ObRpcResultCode& res_code, const int64_t& sessid); - protected: +protected: template int do_serilize_result(common::ObDataBuffer* buffer, const T& result, const ObRpcResultCode& res_code); @@ -39,7 +39,7 @@ class ObRpcRequest : public rpc::ObRequest { inline int do_serilize_fail(common::ObDataBuffer* buffer, const ObRpcResultCode& res_code); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcRequest); }; diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.h b/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.h index 8037fc47a..a6074065e 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.h @@ -24,7 +24,7 @@ namespace obrpc { struct ObRpcResultCode { OB_UNIS_VERSION(1); - public: +public: ObRpcResultCode() : rcode_(0) { msg_[0] = '\0'; diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.h b/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.h index 2e9fa5494..b9b28a8fc 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.h @@ -28,7 +28,7 @@ class ObRequest; namespace obrpc { class ObRpcSessionHandler { - public: +public: ObRpcSessionHandler(); virtual ~ObRpcSessionHandler(){}; @@ -60,7 +60,7 @@ class ObRpcSessionHandler { max_waiting_thread_count_ = max_wait_count; } - private: +private: enum { MAX_COND_COUNT = common::OB_MAX_CPU_NUM * 32 }; struct WaitObject { int64_t thid_; @@ -77,12 +77,12 @@ class ObRpcSessionHandler { return next_cond_[id % MAX_COND_COUNT]; } - private: +private: static const int32_t DEFAULT_WAIT_TIMEOUT_MS = 1000; static const int32_t MAX_WAIT_TIMEOUT_MS = 30000; static const int64_t MAX_WAIT_THREAD_COUNT = 100; - private: +private: common::hash::ObHashMap next_wait_map_; common::ObThreadCond next_cond_[MAX_COND_COUNT]; @@ -90,7 +90,7 @@ class ObRpcSessionHandler { volatile uint64_t waiting_thread_count_; uint64_t max_waiting_thread_count_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcSessionHandler); }; diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_stat.h b/deps/oblib/src/rpc/obrpc/ob_rpc_stat.h index 52b372bd0..01247446a 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_stat.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_stat.h @@ -111,34 +111,34 @@ struct RpcStatItem { template class RpcStatBulk { - public: +public: void add_piece(const RpcStatPiece& piece); void get_item(RpcStatItem& item) const; - private: +private: RpcStatItem items_[N]; common::ObRandom rand_; }; class RpcStatEntry { - public: +public: void add_piece(const RpcStatPiece& piece); void get_item(RpcStatItem& item) const; - private: +private: RpcStatBulk<10> bulk_; }; class RpcStatService { static const int64_t MAX_PCODE_COUNT = obrpc::ObRpcPacketSet::THE_PCODE_COUNT; - public: +public: int add(int64_t pidx, const RpcStatPiece& piece); int get(int64_t pidx, RpcStatItem& item) const; static RpcStatService* instance(); - private: +private: RpcStatEntry entries_[MAX_PCODE_COUNT]; }; diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.h b/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.h index 2848982f4..6f0aee828 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.h @@ -24,7 +24,7 @@ namespace obrpc { class ObRpcPacket; class ObRpcSessionHandler; class ObRpcStreamCond { - public: +public: explicit ObRpcStreamCond(ObRpcSessionHandler& handle); virtual ~ObRpcStreamCond(); @@ -39,11 +39,11 @@ class ObRpcStreamCond { return sessid_; } - private: +private: int64_t sessid_; ObRpcSessionHandler& handler_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcStreamCond); }; // end of class ObRpcStreamCond diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_time.h b/deps/oblib/src/rpc/obrpc/ob_rpc_time.h index 1767dd5ee..cdcaea456 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_time.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_time.h @@ -16,10 +16,10 @@ namespace oceanbase { namespace obrpc { struct ObRpcCostTime { - public: +public: static const uint8_t RPC_COST_TIME_SIZE = 40; - public: +public: ObRpcCostTime() { memset(this, 0, sizeof(*this)); diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_translator.h b/deps/oblib/src/rpc/obrpc/ob_rpc_translator.h index e9005e73d..be02e45b4 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_translator.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_translator.h @@ -33,16 +33,16 @@ namespace obrpc { class ObRpcStreamCond; class ObRpcTranslator : public rpc::frame::ObReqTranslator { - public: +public: int th_init(); int th_destroy(); inline ObRpcSessionHandler& get_session_handler(); - protected: +protected: rpc::frame::ObReqProcessor* get_processor(rpc::ObRequest& req) = 0; - protected: +protected: ObRpcSessionHandler session_handler_; }; // end of class ObRpcTranslator diff --git a/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.h b/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.h index 0040976e1..120b6ea52 100644 --- a/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.h +++ b/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.h @@ -27,7 +27,7 @@ class ObTimeGuard; namespace obrpc { class ObVirtualRpcProtocolProcessor { - public: +public: ObVirtualRpcProtocolProcessor() {} virtual ~ObVirtualRpcProtocolProcessor() @@ -36,7 +36,7 @@ class ObVirtualRpcProtocolProcessor { virtual int encode(easy_request_t* req, ObRpcPacket* pkt) = 0; virtual int decode(easy_message_t* m, ObRpcPacket*& pkt) = 0; - protected: +protected: /* *@param [in] timeguard: *@param [in] req: @@ -98,7 +98,7 @@ class ObVirtualRpcProtocolProcessor { bool is_data_compressed, int16_t compressed_size, int16_t original_size, int64_t& pos, int64_t& net_packet_buf_pos); - protected: +protected: // const int16_t COMPRESS_BLOCK_SIZE = 1024; const int64_t MAX_COMPRESS_DATA_SIZE = (1UL << 32) - 1024; // 4G - 1K const int16_t COMPRESS_BLOCK_SIZE = (1 << 15) - 1024; // 31K diff --git a/deps/oblib/unittest/common/rowkey/test_store_rowkey.cpp b/deps/oblib/unittest/common/rowkey/test_store_rowkey.cpp index 9c5599b63..5fd43decc 100644 --- a/deps/oblib/unittest/common/rowkey/test_store_rowkey.cpp +++ b/deps/oblib/unittest/common/rowkey/test_store_rowkey.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; class TestStoreRowkey : public ::testing::Test { - public: +public: static const int OBJ_CNT = 5; TestStoreRowkey() @@ -28,12 +28,12 @@ class TestStoreRowkey : public ::testing::Test { virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestStoreRowkey(const TestStoreRowkey& other); TestStoreRowkey& operator=(const TestStoreRowkey& other); - protected: +protected: // data memebers ObObj obj_array_[OBJ_CNT]; ObArenaAllocator allocator_; diff --git a/deps/oblib/unittest/common/test_cell_reader.cpp b/deps/oblib/unittest/common/test_cell_reader.cpp index dfc4dcf97..3db5aedd8 100644 --- a/deps/oblib/unittest/common/test_cell_reader.cpp +++ b/deps/oblib/unittest/common/test_cell_reader.cpp @@ -20,7 +20,7 @@ using namespace common; using namespace number; namespace unittest { class TestCellReader : public ::testing::Test { - public: +public: TestCellReader(); virtual void SetUp() {} @@ -36,7 +36,7 @@ class TestCellReader : public ::testing::Test { return &arena_; } - private: +private: ModulePageAllocator alloc_; ModuleArena arena_; }; diff --git a/deps/oblib/unittest/common/test_cell_writer.cpp b/deps/oblib/unittest/common/test_cell_writer.cpp index 93a1b0d6e..b343e8b95 100644 --- a/deps/oblib/unittest/common/test_cell_writer.cpp +++ b/deps/oblib/unittest/common/test_cell_writer.cpp @@ -19,7 +19,7 @@ using namespace common; using namespace number; namespace unittest { class TestCellWriter : public ::testing::Test { - public: +public: TestCellWriter(); virtual void SetUp() {} @@ -46,7 +46,7 @@ class TestCellWriter : public ::testing::Test { return &arena_; } - private: +private: ModulePageAllocator alloc_; ModuleArena arena_; }; diff --git a/deps/oblib/unittest/common/test_memfrag_recycle_allocator.cpp b/deps/oblib/unittest/common/test_memfrag_recycle_allocator.cpp index 3289a8be8..cfdd5555d 100644 --- a/deps/oblib/unittest/common/test_memfrag_recycle_allocator.cpp +++ b/deps/oblib/unittest/common/test_memfrag_recycle_allocator.cpp @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class TestObMetaImage : public ObIRewritable, public lib::ThreadPool { - public: +public: TestObMetaImage(); virtual ~TestObMetaImage(); int init(const int64_t expire_duration); @@ -29,7 +29,7 @@ class TestObMetaImage : public ObIRewritable, public lib::ThreadPool { virtual int rewrite_switch(); void run1() final; - private: +private: static const int64_t MAX_META_COUNT = 1024L * 1024L * 2L; struct TestObMeta { int64_t size_; diff --git a/deps/oblib/unittest/common/test_ob_easy_log.cpp b/deps/oblib/unittest/common/test_ob_easy_log.cpp index 58d7adce2..d32fa02d5 100644 --- a/deps/oblib/unittest/common/test_ob_easy_log.cpp +++ b/deps/oblib/unittest/common/test_ob_easy_log.cpp @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class TestEasyLog : public ::testing::Test { - public: +public: TestEasyLog() {} virtual ~TestEasyLog() @@ -28,7 +28,7 @@ class TestEasyLog : public ::testing::Test { virtual void TearDown() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(TestEasyLog); }; diff --git a/deps/oblib/unittest/common/test_ob_object.cpp b/deps/oblib/unittest/common/test_ob_object.cpp index 420fc0f44..4a1fc6433 100644 --- a/deps/oblib/unittest/common/test_ob_object.cpp +++ b/deps/oblib/unittest/common/test_ob_object.cpp @@ -20,17 +20,17 @@ using namespace oceanbase::common; class TestObObj : public ::testing::Test { - public: +public: TestObObj(); virtual ~TestObObj(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestObObj); - protected: +protected: // function members void test_obj_serialize(ObObj& obj1, ObObj& obj2, char* buff, int64_t buff_len); void parse_line(const char* line, char* res, int& res_len); @@ -42,7 +42,7 @@ class TestObObj : public ::testing::Test { int random_range(const int low, const int high); void print_obj(const ObObj& obj); - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/common/test_ob_partition_key.cpp b/deps/oblib/unittest/common/test_ob_partition_key.cpp index ae46df028..6bc2f785c 100644 --- a/deps/oblib/unittest/common/test_ob_partition_key.cpp +++ b/deps/oblib/unittest/common/test_ob_partition_key.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; namespace oceanbase { namespace unittest { class TestObPartitionKey : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/deps/oblib/unittest/common/test_profile_utils.h b/deps/oblib/unittest/common/test_profile_utils.h index 3e5c528cf..372cb5fdb 100644 --- a/deps/oblib/unittest/common/test_profile_utils.h +++ b/deps/oblib/unittest/common/test_profile_utils.h @@ -19,7 +19,7 @@ const char* const FMT_STR = "%s%ld"; const char* const MODEL_STR = "Copyright 2014 Alibaba Inc. All Rights Reserved. "; class TestProfileUtils { - public: +public: TestProfileUtils() {} ~TestProfileUtils() @@ -48,7 +48,7 @@ class TestProfileUtils { return ret; } - private: +private: DISALLOW_COPY_AND_ASSIGN(TestProfileUtils); }; } // namespace common diff --git a/deps/oblib/unittest/common/test_row_store.cpp b/deps/oblib/unittest/common/test_row_store.cpp index c76bc81a2..ca61acbd7 100644 --- a/deps/oblib/unittest/common/test_row_store.cpp +++ b/deps/oblib/unittest/common/test_row_store.cpp @@ -16,18 +16,18 @@ using namespace oceanbase::common; class TestRowStore : public ::testing::Test { - public: +public: TestRowStore(); virtual ~TestRowStore(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestRowStore(const TestRowStore& other); TestRowStore& operator=(const TestRowStore& other); - protected: +protected: void add_row(int32_t i, int64_t COL_NUM, ObRowStore& store, int expect_ret = OB_SUCCESS); void add_rows(int64_t COL_NUM, int64_t ROW_NUM, ObRowStore& store); void verify_rows(int64_t COL_NUM, int64_t ROW_NUM, ObRowStore& store); diff --git a/deps/oblib/unittest/common/test_serialization_helper.cpp b/deps/oblib/unittest/common/test_serialization_helper.cpp index b02c8fa39..2510519df 100644 --- a/deps/oblib/unittest/common/test_serialization_helper.cpp +++ b/deps/oblib/unittest/common/test_serialization_helper.cpp @@ -23,18 +23,18 @@ using namespace common; #define OK(value) ASSERT_EQ(OB_SUCCESS, (value)) class ObSerialzationHelper : public ::testing::Test { - public: +public: ObSerialzationHelper(); virtual ~ObSerialzationHelper(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObSerialzationHelper(const ObSerialzationHelper& other); ObSerialzationHelper& operator=(const ObSerialzationHelper& other); - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/common/test_small_allocator.cpp b/deps/oblib/unittest/common/test_small_allocator.cpp index 5c04948d8..cebcc5720 100644 --- a/deps/oblib/unittest/common/test_small_allocator.cpp +++ b/deps/oblib/unittest/common/test_small_allocator.cpp @@ -25,7 +25,7 @@ using namespace common; /* Simple stopwatch */ class StopWatch { - public: +public: StopWatch() : run_(false) {} void start() @@ -63,7 +63,7 @@ class StopWatch { return (long int)(T.tv_sec - S_.tv_sec) * 1000000 + (long int)(T.tv_usec - S_.tv_usec); } - private: +private: bool run_; timeval S_, E_; }; diff --git a/deps/oblib/unittest/common/test_smart_call.cpp b/deps/oblib/unittest/common/test_smart_call.cpp index 9abf43dbe..0a6f70203 100644 --- a/deps/oblib/unittest/common/test_smart_call.cpp +++ b/deps/oblib/unittest/common/test_smart_call.cpp @@ -44,7 +44,7 @@ TEST(sc, usability) // member function { class Foo { - public: + public: int dec() { if (i_ <= 0) { diff --git a/deps/oblib/unittest/common/test_smart_var.cpp b/deps/oblib/unittest/common/test_smart_var.cpp index 9955e185d..521bfa591 100644 --- a/deps/oblib/unittest/common/test_smart_var.cpp +++ b/deps/oblib/unittest/common/test_smart_var.cpp @@ -93,7 +93,7 @@ void* test(void*) { // scalar class S { - public: + public: S(int& k) : k_(k) { k_ += 1; @@ -115,7 +115,7 @@ void* test(void*) // array class V { - public: + public: V() : self_k_(2), k_(nullptr) {} ~V() diff --git a/deps/oblib/unittest/common/test_store_range.cpp b/deps/oblib/unittest/common/test_store_range.cpp index 89982e9ba..02f793b4f 100644 --- a/deps/oblib/unittest/common/test_store_range.cpp +++ b/deps/oblib/unittest/common/test_store_range.cpp @@ -16,7 +16,7 @@ using namespace oceanbase::common; class TestStoreRange : public ::testing::Test { - public: +public: TestStoreRange() {} ~TestStoreRange() @@ -24,12 +24,12 @@ class TestStoreRange : public ::testing::Test { virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestStoreRange(const TestStoreRange& other); TestStoreRange& operator=(const TestStoreRange& other); - protected: +protected: ObObj start_cells_[2]; ObObj end_cells_[2]; const char* start_var_ = "key1"; diff --git a/deps/oblib/unittest/lib/alloc/test_block_set.cpp b/deps/oblib/unittest/lib/alloc/test_block_set.cpp index 0afc8a2cc..857972f7e 100644 --- a/deps/oblib/unittest/lib/alloc/test_block_set.cpp +++ b/deps/oblib/unittest/lib/alloc/test_block_set.cpp @@ -22,7 +22,7 @@ using namespace oceanbase::common; ObMemAttr attr; class TestBlockSet : public ::testing::Test { - public: +public: TestBlockSet() : tallocator_(500) {} virtual void SetUp() @@ -53,7 +53,7 @@ class TestBlockSet : public ::testing::Test { // ASSERT_EQ(56, (uint64_t)p & 0xFF) << ((uint64_t)p & 0xFF); } - protected: +protected: ObTenantCtxAllocator tallocator_; BlockSet cs_; }; diff --git a/deps/oblib/unittest/lib/alloc/test_chunk_mgr.cpp b/deps/oblib/unittest/lib/alloc/test_chunk_mgr.cpp index 6c8d4d25a..4da87e1e6 100644 --- a/deps/oblib/unittest/lib/alloc/test_chunk_mgr.cpp +++ b/deps/oblib/unittest/lib/alloc/test_chunk_mgr.cpp @@ -27,7 +27,7 @@ int main(int argc, char* argv[]) } class TestChunkMgr : public ::testing::Test, public AChunkMgr { - public: +public: virtual void SetUp() {} diff --git a/deps/oblib/unittest/lib/alloc/test_malloc_hook.cpp b/deps/oblib/unittest/lib/alloc/test_malloc_hook.cpp index 49d7604b3..a3ecaba92 100644 --- a/deps/oblib/unittest/lib/alloc/test_malloc_hook.cpp +++ b/deps/oblib/unittest/lib/alloc/test_malloc_hook.cpp @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) } class TestMallocHook : public ::testing::Test { - public: +public: virtual void SetUp() {} diff --git a/deps/oblib/unittest/lib/alloc/test_object_mgr.cpp b/deps/oblib/unittest/lib/alloc/test_object_mgr.cpp index 3d9890d97..cdda39053 100644 --- a/deps/oblib/unittest/lib/alloc/test_object_mgr.cpp +++ b/deps/oblib/unittest/lib/alloc/test_object_mgr.cpp @@ -27,7 +27,7 @@ int main(int argc, char* argv[]) } class TestObjectMgr : public ::testing::Test { - public: +public: void* Malloc(uint64_t size) { // void *p = NULL; diff --git a/deps/oblib/unittest/lib/alloc/test_object_set.cpp b/deps/oblib/unittest/lib/alloc/test_object_set.cpp index 3c1d3d145..b027367c7 100644 --- a/deps/oblib/unittest/lib/alloc/test_object_set.cpp +++ b/deps/oblib/unittest/lib/alloc/test_object_set.cpp @@ -24,7 +24,7 @@ ObMemAttr attr; class TestObjectSet : public ::testing::Test { class ObjecSetLocker : public ISetLocker { - public: + public: ObjecSetLocker() {} void lock() override @@ -37,7 +37,7 @@ class TestObjectSet : public ::testing::Test { } }; - public: +public: TestObjectSet() : tallocator_(500), os_locker_(), bs_(), os_() {} @@ -96,7 +96,7 @@ class TestObjectSet : public ::testing::Test { UNUSED(ptr); } - protected: +protected: ObTenantCtxAllocator tallocator_; ObjecSetLocker os_locker_; BlockSet bs_; diff --git a/deps/oblib/unittest/lib/allocator/test_allocator.cpp b/deps/oblib/unittest/lib/allocator/test_allocator.cpp index c8aed4e08..cc8a8530c 100644 --- a/deps/oblib/unittest/lib/allocator/test_allocator.cpp +++ b/deps/oblib/unittest/lib/allocator/test_allocator.cpp @@ -34,7 +34,7 @@ void has_unfree_callback() has_unfree = true; } class TestAllocator : public ::testing::Test { - public: +public: virtual void SetUp() { ObMallocAllocator* ma = ObMallocAllocator::get_instance(); diff --git a/deps/oblib/unittest/lib/allocator/test_buddy_allocator.cpp b/deps/oblib/unittest/lib/allocator/test_buddy_allocator.cpp index ce5d581c2..b6fa47a71 100644 --- a/deps/oblib/unittest/lib/allocator/test_buddy_allocator.cpp +++ b/deps/oblib/unittest/lib/allocator/test_buddy_allocator.cpp @@ -23,7 +23,7 @@ using namespace oceanbase::common; class BuddyAllocatorTest : public ::testing::Test { - public: +public: BuddyAllocatorTest(); virtual ~BuddyAllocatorTest(); virtual void SetUp(); @@ -32,12 +32,12 @@ class BuddyAllocatorTest : public ::testing::Test { void assign_ptr(char* ptr, int64_t ptr_len, int64_t seed); bool is_valid_ptr(const char* ptr, int64_t ptr_len, int64_t seed); - private: +private: // disallow copy BuddyAllocatorTest(const BuddyAllocatorTest& other); BuddyAllocatorTest& operator=(const BuddyAllocatorTest& other); - private: +private: // data members }; BuddyAllocatorTest::BuddyAllocatorTest() @@ -179,7 +179,7 @@ TEST_F(BuddyAllocatorTest, basic_test) } class ObPtrStore { - public: +public: int64_t seed_; int64_t ptr_len_; char* ptr_; diff --git a/deps/oblib/unittest/lib/allocator/test_concurrent_fifo_allocator.cpp b/deps/oblib/unittest/lib/allocator/test_concurrent_fifo_allocator.cpp index 138b4280c..1d44f3d16 100644 --- a/deps/oblib/unittest/lib/allocator/test_concurrent_fifo_allocator.cpp +++ b/deps/oblib/unittest/lib/allocator/test_concurrent_fifo_allocator.cpp @@ -23,13 +23,13 @@ static const int64_t TOTAL_SIZE = 1024l * 1024l * 1024l * 8l; static const int64_t PAGE_SIZE = 64 * 1024; class TestC { - public: +public: TestC() {} virtual ~TestC() {} - public: +public: // a successful virtual function invoking represents a good vtable virtual void set_mem_a(int64_t value) { @@ -48,7 +48,7 @@ class TestC { return mem_b_; } - private: +private: int64_t mem_a_; int64_t mem_b_; }; diff --git a/deps/oblib/unittest/lib/allocator/test_fifo.cpp b/deps/oblib/unittest/lib/allocator/test_fifo.cpp index 0ce105df1..52a044b21 100644 --- a/deps/oblib/unittest/lib/allocator/test_fifo.cpp +++ b/deps/oblib/unittest/lib/allocator/test_fifo.cpp @@ -37,7 +37,7 @@ int64_t glibc_free_count = 0; #define MOCK_ALLOC_ALIGN 1 class MockAllocator : public ObIAllocator { - public: +public: MockAllocator() : alloc_count_(0), free_count_(0), page_size_(page_size), last_alloc_addr_(NULL), status_(true) {} @@ -151,7 +151,7 @@ class MockAllocator : public ObIAllocator { }; class ObFIFOAllocatorTest : public ::testing::Test { - public: +public: ObFIFOAllocatorTest(); virtual ~ObFIFOAllocatorTest(); virtual void SetUp(); @@ -237,7 +237,7 @@ TEST(ObFIFOAllocator, invalid_free) // [4] test alignment class ObFIFOAllocatorAlignParamTest : public ::testing::TestWithParam { - public: +public: ObFIFOAllocatorAlignParamTest() { mock_allocator_ = new MockAllocator(); @@ -251,10 +251,10 @@ class ObFIFOAllocatorAlignParamTest : public ::testing::TestWithParam void for_each_utf8(func handle); - protected: +protected: void gen_random_unicode_string(const int len, char* res, int& real_len); int random_range(const int low, const int high); }; diff --git a/deps/oblib/unittest/lib/charset/test_charset_random.cpp b/deps/oblib/unittest/lib/charset/test_charset_random.cpp index cfe43ba8c..2325d04d3 100644 --- a/deps/oblib/unittest/lib/charset/test_charset_random.cpp +++ b/deps/oblib/unittest/lib/charset/test_charset_random.cpp @@ -28,7 +28,7 @@ using namespace oceanbase::common; #define STD_RESULT_FILE_SUFFIX ".result" class TestCharsetRandom : public ::testing::Test { - public: +public: TestCharsetRandom(); virtual ~TestCharsetRandom(); virtual void SetUp(); @@ -36,7 +36,7 @@ class TestCharsetRandom : public ::testing::Test { template void for_each_utf8(func handle); - protected: +protected: void gen_random_unicode_string(const int len, char* res, int& real_len); int random_range(const int low, const int high); }; diff --git a/deps/oblib/unittest/lib/container/ob_2d_array_test.cpp b/deps/oblib/unittest/lib/container/ob_2d_array_test.cpp index 9ccbaffcc..31ce3cd8f 100644 --- a/deps/oblib/unittest/lib/container/ob_2d_array_test.cpp +++ b/deps/oblib/unittest/lib/container/ob_2d_array_test.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; class Ob2DArrayTest : public ::testing::Test { - public: +public: Ob2DArrayTest(); virtual ~Ob2DArrayTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy Ob2DArrayTest(const Ob2DArrayTest& other); Ob2DArrayTest& operator=(const Ob2DArrayTest& other); - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/container/ob_array_test.cpp b/deps/oblib/unittest/lib/container/ob_array_test.cpp index a33bc2c93..e7a108dcd 100644 --- a/deps/oblib/unittest/lib/container/ob_array_test.cpp +++ b/deps/oblib/unittest/lib/container/ob_array_test.cpp @@ -81,7 +81,7 @@ TEST(ObArrayTest, serialize) } class TestItem { - public: +public: static int64_t construct_cnt_; static int64_t copy_construct_cnt_; static int64_t destruct_cnt_; diff --git a/deps/oblib/unittest/lib/container/ob_heap_test.cpp b/deps/oblib/unittest/lib/container/ob_heap_test.cpp index ff3c12e51..9eca9bb88 100644 --- a/deps/oblib/unittest/lib/container/ob_heap_test.cpp +++ b/deps/oblib/unittest/lib/container/ob_heap_test.cpp @@ -15,7 +15,7 @@ using namespace oceanbase::common; class TestComp { - public: +public: int get_error_code() { return OB_SUCCESS; @@ -27,18 +27,18 @@ class TestComp { }; class ObHeapTest : public ::testing::Test { - public: +public: ObHeapTest(); virtual ~ObHeapTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObHeapTest(const ObHeapTest& other); ObHeapTest& operator=(const ObHeapTest& other); - private: +private: // data members }; diff --git a/deps/oblib/unittest/lib/container/ob_se_array_test.cpp b/deps/oblib/unittest/lib/container/ob_se_array_test.cpp index caf1b0d1f..4259e5bb6 100644 --- a/deps/oblib/unittest/lib/container/ob_se_array_test.cpp +++ b/deps/oblib/unittest/lib/container/ob_se_array_test.cpp @@ -15,18 +15,18 @@ using namespace oceanbase::common; class ObSEArrayTest : public ::testing::Test { - public: +public: ObSEArrayTest(); virtual ~ObSEArrayTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObSEArrayTest(const ObSEArrayTest& other); ObSEArrayTest& operator=(const ObSEArrayTest& other); - private: +private: // data members }; diff --git a/deps/oblib/unittest/lib/container/test_array_array.cpp b/deps/oblib/unittest/lib/container/test_array_array.cpp index 0d80c68ca..d0dd883bc 100644 --- a/deps/oblib/unittest/lib/container/test_array_array.cpp +++ b/deps/oblib/unittest/lib/container/test_array_array.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; class TestObj { - public: +public: TestObj(int64_t val) : value_(val) {} TestObj() : value_(0) @@ -44,24 +44,24 @@ class TestObj { }; class TestArrayArray : public ::testing::Test { - public: +public: TestArrayArray(); virtual ~TestArrayArray(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestArrayArray); - protected: +protected: // function members void setup(int64_t N, ObIArray& arr); void verify(int64_t N, const ObIArray& arr); void verify(const ObIArray& arr1, const ObIArray& arr2); void extend_to(const int64_t N, ObIArray& arr); - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/container/test_array_helper.cpp b/deps/oblib/unittest/lib/container/test_array_helper.cpp index b3a32c8a8..b4ce92a56 100644 --- a/deps/oblib/unittest/lib/container/test_array_helper.cpp +++ b/deps/oblib/unittest/lib/container/test_array_helper.cpp @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class TestArrayHelper : public ::testing::Test { - public: +public: TestArrayHelper() {} virtual ~TestArrayHelper() diff --git a/deps/oblib/unittest/lib/container/test_bit_set.cpp b/deps/oblib/unittest/lib/container/test_bit_set.cpp index 9c451df73..2e6ccc854 100644 --- a/deps/oblib/unittest/lib/container/test_bit_set.cpp +++ b/deps/oblib/unittest/lib/container/test_bit_set.cpp @@ -17,19 +17,19 @@ #include "lib/container/ob_array.h" using namespace oceanbase::common; class TestBitSet : public ::testing::Test { - public: +public: TestBitSet(); virtual ~TestBitSet(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestBitSet); - protected: +protected: // function members - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/container/test_bitmap.cpp b/deps/oblib/unittest/lib/container/test_bitmap.cpp index 9c5707f7b..9a905e21e 100644 --- a/deps/oblib/unittest/lib/container/test_bitmap.cpp +++ b/deps/oblib/unittest/lib/container/test_bitmap.cpp @@ -21,7 +21,7 @@ using namespace common; namespace unittest { class TestObBitmap : public ::testing::Test { - public: +public: static constexpr uint64_t bits_per_memblock() { return ObBitmap::BITS_PER_BLOCK * ObBitmap::BLOCKS_PER_MEM_BLOCK; @@ -38,10 +38,10 @@ class TestObBitmap : public ::testing::Test { static void TearDownTestCase() {} - protected: +protected: ModulePageAllocator allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(TestObBitmap); }; diff --git a/deps/oblib/unittest/lib/container/test_concurrent_bitset.cpp b/deps/oblib/unittest/lib/container/test_concurrent_bitset.cpp index 38ae8a502..51247b3db 100644 --- a/deps/oblib/unittest/lib/container/test_concurrent_bitset.cpp +++ b/deps/oblib/unittest/lib/container/test_concurrent_bitset.cpp @@ -16,7 +16,7 @@ #include "lib/atomic/ob_atomic.h" using namespace oceanbase::common; class TestConcurrentBitset : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() @@ -42,7 +42,7 @@ class TestConcurrentBitset : public ::testing::Test { template void concurrent_set_find_first_zero_bit(bitset_type& bitset); - protected: +protected: ObConcurrentBitset bitset_; ObConcurrentBitset bitset_lock_; }; diff --git a/deps/oblib/unittest/lib/container/test_ext_ring_buffer.cpp b/deps/oblib/unittest/lib/container/test_ext_ring_buffer.cpp index ec7cec525..a3f88ab62 100644 --- a/deps/oblib/unittest/lib/container/test_ext_ring_buffer.cpp +++ b/deps/oblib/unittest/lib/container/test_ext_ring_buffer.cpp @@ -152,7 +152,7 @@ TEST(RINGBUFFER_BASE, debug2) typedef ValSlot SlotT; typedef ObExtendibleRingBufferBase I64RBBASE; class SetRunnable : public cotesting::DefaultRunnable { - public: +public: void run1() final { for (int64_t idx = 0; idx < cnt_; ++idx) { @@ -165,7 +165,7 @@ class SetRunnable : public cotesting::DefaultRunnable { int64_t cnt_; }; class PopRunnable : public cotesting::DefaultRunnable { - public: +public: struct PopCond { int64_t expect_; /* @@ -292,7 +292,7 @@ TEST(RingBuffer, debug) // Hazrd Ptr Tests. struct TypeA : public erb::HazardBase { - public: +public: virtual int purge() { return 0; @@ -324,7 +324,7 @@ TEST(HazPtr, Basic0) } struct TypeB : public erb::HazardBase { - public: +public: virtual int purge() { if (!alloc_) { @@ -336,7 +336,7 @@ struct TypeB : public erb::HazardBase { bool alloc_; }; class PurgeTestA : public cotesting::DefaultRunnable { - public: +public: void run1() final { while (!ATOMIC_LOAD(&acquire_)) { diff --git a/deps/oblib/unittest/lib/container/test_iarray.cpp b/deps/oblib/unittest/lib/container/test_iarray.cpp index 739be3716..288ae2dbe 100644 --- a/deps/oblib/unittest/lib/container/test_iarray.cpp +++ b/deps/oblib/unittest/lib/container/test_iarray.cpp @@ -18,23 +18,23 @@ using namespace oceanbase::common; class TestIArray : public ::testing::Test { - public: +public: TestIArray(); virtual ~TestIArray(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestIArray); - protected: +protected: // function members template void setup(int32_t N, T& arr); void verify(int32_t N, const ObIArray& arr); - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/container/test_loser_tree.cpp b/deps/oblib/unittest/lib/container/test_loser_tree.cpp index 215d1443f..b59d09caa 100644 --- a/deps/oblib/unittest/lib/container/test_loser_tree.cpp +++ b/deps/oblib/unittest/lib/container/test_loser_tree.cpp @@ -16,23 +16,23 @@ using namespace oceanbase::common; class ObLoserTreeTest : public ::testing::Test { - public: +public: ObLoserTreeTest(){}; virtual ~ObLoserTreeTest(){}; virtual void SetUp(){}; virtual void TearDown(){}; - private: +private: // disallow copy ObLoserTreeTest(const ObLoserTreeTest& other); ObLoserTreeTest& operator=(const ObLoserTreeTest& other); - private: +private: // data members }; class TestMaxComp { - public: +public: int get_error_code() { return OB_SUCCESS; diff --git a/deps/oblib/unittest/lib/container/test_ring_buffer.cpp b/deps/oblib/unittest/lib/container/test_ring_buffer.cpp index 66bc503ce..b5d02d9f1 100644 --- a/deps/oblib/unittest/lib/container/test_ring_buffer.cpp +++ b/deps/oblib/unittest/lib/container/test_ring_buffer.cpp @@ -21,7 +21,7 @@ using obsys::CThread; using oceanbase::lib::ThreadPool; class TestRingBuffer : public ::testing::Test, public ThreadPool { - public: +public: struct RBData { RBData() : valid_(0), val_(0) {} @@ -117,7 +117,7 @@ class TestRingBuffer : public ::testing::Test, public ThreadPool { mix(); } - private: +private: int64_t seq_ CACHE_ALIGNED; int64_t limit_; RingArray rbuffer_; diff --git a/deps/oblib/unittest/lib/coro/test_co_all.cpp b/deps/oblib/unittest/lib/coro/test_co_all.cpp index 880563197..a56bb2395 100644 --- a/deps/oblib/unittest/lib/coro/test_co_all.cpp +++ b/deps/oblib/unittest/lib/coro/test_co_all.cpp @@ -95,7 +95,7 @@ TEST(TestCoAll, Statistics) } class CoThreadExit : public ThreadPool { - public: +public: CoThreadExit() {} virtual ~CoThreadExit() diff --git a/deps/oblib/unittest/lib/coro/test_co_latch.cpp b/deps/oblib/unittest/lib/coro/test_co_latch.cpp index 5dafb4480..539fa8605 100644 --- a/deps/oblib/unittest/lib/coro/test_co_latch.cpp +++ b/deps/oblib/unittest/lib/coro/test_co_latch.cpp @@ -87,7 +87,7 @@ TEST(TestCoLatch, wrlock) CoLatchTester g_tester; class LatchStress : public ThreadPool { - public: +public: LatchStress() {} virtual ~LatchStress() @@ -166,7 +166,7 @@ TEST(TestCoLatch, timeout) ObLatch g_latch; class LatchTimeout : public ThreadPool { - public: +public: LatchTimeout() {} virtual ~LatchTimeout() diff --git a/deps/oblib/unittest/lib/coro/test_co_protected_stack_allocator.cpp b/deps/oblib/unittest/lib/coro/test_co_protected_stack_allocator.cpp index 8ba2ff4e5..d160bd801 100644 --- a/deps/oblib/unittest/lib/coro/test_co_protected_stack_allocator.cpp +++ b/deps/oblib/unittest/lib/coro/test_co_protected_stack_allocator.cpp @@ -45,7 +45,7 @@ struct MhuGuard { }; class DoNothingMhu : public CPSA::IMemHoldUpdater { - public: +public: virtual int update_hold(const uint64_t tenant_id, const ssize_t size, bool& updated) { UNUSED(tenant_id); @@ -56,7 +56,7 @@ class DoNothingMhu : public CPSA::IMemHoldUpdater { }; class TestHoldMhu : public CPSA::IMemHoldUpdater { - public: +public: TestHoldMhu() : hold_(0), limit_(0) {} void reset() diff --git a/deps/oblib/unittest/lib/coro/test_co_sched.cpp b/deps/oblib/unittest/lib/coro/test_co_sched.cpp index c67222ee0..043758778 100644 --- a/deps/oblib/unittest/lib/coro/test_co_sched.cpp +++ b/deps/oblib/unittest/lib/coro/test_co_sched.cpp @@ -25,7 +25,7 @@ class MyCoRoutine; static MyCoRoutine* wait_routine = nullptr; class MyCoSched : public CoSched { - public: +public: void on_runnable(MyCoRoutine& routine) { runnables_.add_last(&routine); @@ -40,17 +40,17 @@ class MyCoSched : public CoSched { waitings_.remove(&routine); } - private: +private: void alloc_routine(string name); void run() override; - protected: +protected: ObDList runnables_; ObDList waitings_; }; class MyCoRoutine : public CoRoutine, public ObDLinkBase { - public: +public: MyCoRoutine(string name, CoRoutine& succ, MyCoSched& sched) : CoRoutine(succ), name_(name), sched_(sched) {} @@ -64,7 +64,7 @@ class MyCoRoutine : public CoRoutine, public ObDLinkBase { void sleep_until(int64_t) override {} - private: +private: void run() override { CO_YIELD(); diff --git a/deps/oblib/unittest/lib/coro/test_co_thread.cpp b/deps/oblib/unittest/lib/coro/test_co_thread.cpp index eff4799ca..5f5661656 100644 --- a/deps/oblib/unittest/lib/coro/test_co_thread.cpp +++ b/deps/oblib/unittest/lib/coro/test_co_thread.cpp @@ -21,11 +21,11 @@ using namespace oceanbase::lib; using namespace oceanbase::common; class MyCoRoutine : public CoRoutine { - public: +public: MyCoRoutine(string name, CoRoutine& main_routine) : CoRoutine(main_routine), name_(name) {} - private: +private: void run() override { cout << name_ << ", begin run" << endl; @@ -45,8 +45,8 @@ class MyCoRoutine : public CoRoutine { }; class MyCoThread : public CoThread { - public: - private: +public: +private: CoRoutine* alloc_routine(string name) { return new MyCoRoutine(name, *this); diff --git a/deps/oblib/unittest/lib/coro/test_co_thread_mgr.cpp b/deps/oblib/unittest/lib/coro/test_co_thread_mgr.cpp index 1e7791d51..0aa2963ba 100644 --- a/deps/oblib/unittest/lib/coro/test_co_thread_mgr.cpp +++ b/deps/oblib/unittest/lib/coro/test_co_thread_mgr.cpp @@ -28,7 +28,7 @@ class Add1 : public CoThread { } } - public: +public: Add1(int& v) : v_(v) {} int& v_; diff --git a/deps/oblib/unittest/lib/coro/test_co_user_thread.cpp b/deps/oblib/unittest/lib/coro/test_co_user_thread.cpp index c0417afe1..1efd49005 100644 --- a/deps/oblib/unittest/lib/coro/test_co_user_thread.cpp +++ b/deps/oblib/unittest/lib/coro/test_co_user_thread.cpp @@ -55,7 +55,7 @@ TEST(TestCoKThread, DynamicThread) class : public CoXThread { std::atomic n_threads_; - public: + public: int set_thread_count(int64_t n_threads) { n_threads_ = n_threads; diff --git a/deps/oblib/unittest/lib/coro/test_interruptable.cpp b/deps/oblib/unittest/lib/coro/test_interruptable.cpp index b64694bdb..305fc9d38 100644 --- a/deps/oblib/unittest/lib/coro/test_interruptable.cpp +++ b/deps/oblib/unittest/lib/coro/test_interruptable.cpp @@ -19,7 +19,7 @@ using namespace oceanbase::lib; TEST(TestInterruptable, Main) { class : public EventBase { - public: + public: using EventBase::signal; using EventBase::wait4event; } eb; diff --git a/deps/oblib/unittest/lib/coro/testing.h b/deps/oblib/unittest/lib/coro/testing.h index 75de8a7a2..14a9b79b5 100644 --- a/deps/oblib/unittest/lib/coro/testing.h +++ b/deps/oblib/unittest/lib/coro/testing.h @@ -47,7 +47,7 @@ struct WorkerIndex { }; class SimpleWorker : public CoSetSched::Worker { - public: +public: SimpleWorker(CoSetSched& sched, VoidFuncT func) : CoSetSched::Worker(sched, func) {} SimpleWorker(CoSetSched& sched, Idx1FuncT func) : CoSetSched::Worker(sched, [this, func] { func(wi_.grp_co_idx_); }) @@ -56,7 +56,7 @@ class SimpleWorker : public CoSetSched::Worker { : CoSetSched::Worker(sched, [this, func] { func(wi_.grp_th_idx_, wi_.grp_co_idx_); }) {} - public: +public: WorkerIndex wi_; }; @@ -65,7 +65,7 @@ class SimpleWorker : public CoSetSched::Worker { class SimpleSched : public CoSetSched { using WorkerT = SimpleWorker; - public: +public: template SimpleSched(FuncT func, int cnt, WorkerIndex& wi) : cnt_(cnt), workers_(), wi_(wi) { @@ -96,7 +96,7 @@ class SimpleSched : public CoSetSched { return ret; } - private: +private: int prepare() final { int ret = CoSetSched::create_set(0); @@ -106,7 +106,7 @@ class SimpleSched : public CoSetSched { return ret; } - private: +private: int cnt_; std::vector workers_; WorkerIndex& wi_; @@ -117,7 +117,7 @@ class SimpleSched : public CoSetSched { class FlexPool { using Sched = SimpleSched; - public: +public: FlexPool() {} @@ -165,7 +165,7 @@ class FlexPool { } } - private: +private: std::vector th_pools_; WorkerIndex wi_; }; diff --git a/deps/oblib/unittest/lib/ec/test_ec_table_cache.cpp b/deps/oblib/unittest/lib/ec/test_ec_table_cache.cpp index 034550e51..02fb636f2 100644 --- a/deps/oblib/unittest/lib/ec/test_ec_table_cache.cpp +++ b/deps/oblib/unittest/lib/ec/test_ec_table_cache.cpp @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObECTableCacheTest : public testing::Test { - public: +public: static void SetUpTestCase() { ASSERT_EQ(ObECCacheManager::get_ec_cache_mgr().init(1024 /*bucket num*/), OB_SUCCESS); diff --git a/deps/oblib/unittest/lib/ec/test_isal_erasure_code.cpp b/deps/oblib/unittest/lib/ec/test_isal_erasure_code.cpp index 809ed6506..c942d70c5 100644 --- a/deps/oblib/unittest/lib/ec/test_isal_erasure_code.cpp +++ b/deps/oblib/unittest/lib/ec/test_isal_erasure_code.cpp @@ -24,7 +24,7 @@ namespace oceanbase { namespace common { class ObErasureCodeTest : public testing::Test { - public: +public: const static int64_t BUFFER_TEST_LEN = DATA_BLOCK_SIZE; const static int64_t SMALL_BUFFER_TEST_LEN = BUFFER_TEST_LEN / 8; diff --git a/deps/oblib/unittest/lib/hash/hash_benz.cpp b/deps/oblib/unittest/lib/hash/hash_benz.cpp index fa66cc34b..cd830018e 100644 --- a/deps/oblib/unittest/lib/hash/hash_benz.cpp +++ b/deps/oblib/unittest/lib/hash/hash_benz.cpp @@ -48,7 +48,7 @@ struct value_t { class allocer_t { const static uint32_t BLOCK_SIZE = 1024 * 1024; - public: +public: allocer_t() { cur_buffer_pos_ = 0; @@ -81,13 +81,13 @@ class allocer_t { void inc_ref(){}; void dec_ref(){}; - private: +private: uint32_t cur_buffer_pos_; char* cur_buffer_; }; class hashfunc_t { - public: +public: uint64_t operator()(uint64_t key) { return key; @@ -95,7 +95,7 @@ class hashfunc_t { }; class getkey_t { - public: +public: uint64_t operator()(const value_t& v) { return v.key; @@ -103,7 +103,7 @@ class getkey_t { }; class equal_t { - public: +public: bool operator()(uint64_t k1, uint64_t k2) { return (k1 == k2); diff --git a/deps/oblib/unittest/lib/hash/test_concurrent_hash_map.cpp b/deps/oblib/unittest/lib/hash/test_concurrent_hash_map.cpp index 2717fc778..6cc8902f5 100644 --- a/deps/oblib/unittest/lib/hash/test_concurrent_hash_map.cpp +++ b/deps/oblib/unittest/lib/hash/test_concurrent_hash_map.cpp @@ -50,7 +50,7 @@ typedef ObConcurrentHashMap HashMap; int64_t create_num = 0; class ObStressThread : public lib::ThreadPool { - public: +public: ObStressThread() {} void run1() @@ -66,7 +66,7 @@ class ObStressThread : public lib::ThreadPool { } HashMap* hashmap; - private: +private: obsys::CThreadMutex mutex; }; diff --git a/deps/oblib/unittest/lib/hash/test_concurrent_hash_map_with_hazard_value.cpp b/deps/oblib/unittest/lib/hash/test_concurrent_hash_map_with_hazard_value.cpp index b9d09994f..ed8e9c73f 100644 --- a/deps/oblib/unittest/lib/hash/test_concurrent_hash_map_with_hazard_value.cpp +++ b/deps/oblib/unittest/lib/hash/test_concurrent_hash_map_with_hazard_value.cpp @@ -50,7 +50,7 @@ struct Adder { typedef ObConcurrentHashMapWithHazardValue HashMap; class ValueAlloc : public HashMap::IValueAlloc { - public: +public: int64_t* alloc() { return op_alloc(int64_t); @@ -61,7 +61,7 @@ class ValueAlloc : public HashMap::IValueAlloc { } }; class ValueReclaim : public HashMap::IValueReclaimCallback { - public: +public: ValueReclaim() : reclaimed_num(0) {} void reclaim_value(int64_t* value) @@ -126,7 +126,7 @@ TEST(TestObConcurrentHashMapWithHazardValue, hazard_value) int64_t create_num = 0; class ObStressThread : public cotesting::DefaultRunnable { - public: +public: ObStressThread() : finished_count(0) {} void run1() final @@ -174,7 +174,7 @@ class ObStressThread : public cotesting::DefaultRunnable { } HashMap* hashmap; - private: +private: obsys::CThreadMutex mutex; int finished_count; }; diff --git a/deps/oblib/unittest/lib/hash/test_cuckoo_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_cuckoo_hashmap.cpp index 8577b536f..465872393 100644 --- a/deps/oblib/unittest/lib/hash/test_cuckoo_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_cuckoo_hashmap.cpp @@ -18,7 +18,7 @@ using namespace oceanbase; using namespace oceanbase::common; struct Key { - public: +public: Key() : key_(0) {} explicit Key(int64_t k) : key_(k) @@ -36,7 +36,7 @@ struct Key { }; struct MacroKey { - public: +public: static const uint64_t HASH_MAGIC_NUM = 2654435761; MacroKey() : key_(0) {} @@ -55,7 +55,7 @@ struct MacroKey { }; struct BadKey { - public: +public: BadKey() : key_(0) {} explicit BadKey(int64_t k) : key_(k) @@ -73,7 +73,7 @@ struct BadKey { }; struct ModKey { - public: +public: ModKey() : key_(0) {} explicit ModKey(int64_t k) : key_(k) @@ -91,7 +91,7 @@ struct ModKey { }; struct Value { - public: +public: Value() : value_(0) {} explicit Value(int64_t v) : value_(v) @@ -109,7 +109,7 @@ struct Value { }; class TestCuckooHashMap : public ::testing::Test { - public: +public: TestCuckooHashMap(); virtual ~TestCuckooHashMap(); }; diff --git a/deps/oblib/unittest/lib/hash/test_ext_iter_hashset.cpp b/deps/oblib/unittest/lib/hash/test_ext_iter_hashset.cpp index aa0bc11b0..6fb259395 100644 --- a/deps/oblib/unittest/lib/hash/test_ext_iter_hashset.cpp +++ b/deps/oblib/unittest/lib/hash/test_ext_iter_hashset.cpp @@ -17,21 +17,21 @@ using namespace oceanbase::common; using namespace oceanbase::common::hash; class ObExtIterHashSetTest : public ::testing::Test { - public: +public: ObExtIterHashSetTest(); virtual ~ObExtIterHashSetTest(); virtual void SetUp(); virtual void TearDown(); - public: +public: ObArenaAllocator allocator_; - private: +private: // disallow copy ObExtIterHashSetTest(const ObExtIterHashSetTest& other); ObExtIterHashSetTest& operator=(const ObExtIterHashSetTest& other); - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/hash/test_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_hashmap.cpp index fb3ece9bf..211651fd6 100644 --- a/deps/oblib/unittest/lib/hash/test_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_hashmap.cpp @@ -31,7 +31,7 @@ typedef uint64_t HashKey; typedef uint64_t HashValue; class CallBack { - public: +public: void operator()(HashMapPair& v) { v.second = v_; @@ -41,7 +41,7 @@ class CallBack { v_ = v; }; - private: +private: HashValue v_; }; diff --git a/deps/oblib/unittest/lib/hash/test_iteratable_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_iteratable_hashmap.cpp index 323b0eb54..30abf9bb6 100644 --- a/deps/oblib/unittest/lib/hash/test_iteratable_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_iteratable_hashmap.cpp @@ -15,18 +15,18 @@ using namespace oceanbase::common; using namespace oceanbase::common::hash; class TestIteratableHashMap : public ::testing::Test { - public: +public: TestIteratableHashMap(); virtual ~TestIteratableHashMap(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestIteratableHashMap(const TestIteratableHashMap& other); TestIteratableHashMap& operator=(const TestIteratableHashMap& other); - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/hash/test_iteratable_hashset.cpp b/deps/oblib/unittest/lib/hash/test_iteratable_hashset.cpp index 4c63d692b..3fa2d2985 100644 --- a/deps/oblib/unittest/lib/hash/test_iteratable_hashset.cpp +++ b/deps/oblib/unittest/lib/hash/test_iteratable_hashset.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; using namespace oceanbase::common::hash; class ObIteratableHashSetTest : public ::testing::Test { - public: +public: ObIteratableHashSetTest(); virtual ~ObIteratableHashSetTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObIteratableHashSetTest(const ObIteratableHashSetTest& other); ObIteratableHashSetTest& operator=(const ObIteratableHashSetTest& other); - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/hash/test_linear_hash_map.cpp b/deps/oblib/unittest/lib/hash/test_linear_hash_map.cpp index 5cbe3deda..cdd46ffb0 100644 --- a/deps/oblib/unittest/lib/hash/test_linear_hash_map.cpp +++ b/deps/oblib/unittest/lib/hash/test_linear_hash_map.cpp @@ -79,7 +79,7 @@ namespace unittest { // Test Key type. // 8B Key, 8B Value. class UnitTestKey { - public: +public: uint64_t key; uint64_t hash() const { @@ -92,7 +92,7 @@ class UnitTestKey { }; class UnitTestValue { - public: +public: uint64_t val; bool operator==(const UnitTestValue& other) const { @@ -577,7 +577,7 @@ TEST(ObLinearHashMap, ACCSStest5) // Performance tests. // Test Key type. class PerfTestKey { - public: +public: uint64_t key; uint64_t data; uint64_t hash() const @@ -591,7 +591,7 @@ class PerfTestKey { }; class PerfTestValue { - public: +public: uint64_t val; }; diff --git a/deps/oblib/unittest/lib/hash/test_link_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_link_hashmap.cpp index b30d1c00c..917b910c4 100644 --- a/deps/oblib/unittest/lib/hash/test_link_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_link_hashmap.cpp @@ -24,7 +24,7 @@ using namespace common; using namespace hash; class HashKey { - public: +public: HashKey() : v_(0) {} HashKey(uint64_t v) : v_(v) @@ -49,7 +49,7 @@ class HashKey { }; class HashValue : public LinkHashValue { - public: +public: HashValue() : v_(0) {} HashValue(uint64_t v) : v_(v) @@ -69,7 +69,7 @@ ObMemAttr attr(1001, ObNewModIds::OB_MEMSTORE); class TestAllocHandle { typedef LinkHashNode Node; - public: +public: HashValue* alloc_value() { ATOMIC_INC(&value_alloc); @@ -100,7 +100,7 @@ class TestAllocHandle { }; class AtomicGetFunctor { - public: +public: explicit AtomicGetFunctor() : ret_val_(0) {} void operator()(const HashKey& key, HashValue* value) diff --git a/deps/oblib/unittest/lib/hash/test_pre_alloc_link_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_pre_alloc_link_hashmap.cpp index 0c27b2a12..3f5ae3708 100644 --- a/deps/oblib/unittest/lib/hash/test_pre_alloc_link_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_pre_alloc_link_hashmap.cpp @@ -58,7 +58,7 @@ struct Node : public ObPreAllocLinkHashNode { }; class ItemProtector { - public: +public: static void hold(Item& item) { ++item.ref_; @@ -116,7 +116,7 @@ struct TestForeachCheckRef : public TestMap::ForeachFunctor { class TestEraseChecker : public TestMap::EraseChecker { - public: +public: virtual ~TestEraseChecker() {} virtual int operator()(Item& item) @@ -130,7 +130,7 @@ class TestEraseChecker : public TestMap::EraseChecker }; class TestGetFunctor : public TestMap::GetFunctor { - public: +public: TestGetFunctor() : item_(NULL) {} virtual ~TestGetFunctor() @@ -148,7 +148,7 @@ class TestGetFunctor : public TestMap::GetFunctor { } Item* item_; - private: +private: DISALLOW_COPY_AND_ASSIGN(TestGetFunctor); }; diff --git a/deps/oblib/unittest/lib/io/ob_io_stress.h b/deps/oblib/unittest/lib/io/ob_io_stress.h index 3990c0a9e..662553856 100644 --- a/deps/oblib/unittest/lib/io/ob_io_stress.h +++ b/deps/oblib/unittest/lib/io/ob_io_stress.h @@ -22,7 +22,7 @@ using namespace oceanbase::lib; namespace oceanbase { namespace common { class TestIOStress : public lib::ThreadPool { - public: +public: TestIOStress(); virtual ~TestIOStress(); int init(const ObDiskFd& fd, const int64_t file_size, const int32_t user_thread_cnt, const int32_t sys_thread_cnt, @@ -60,7 +60,7 @@ class TestIOStress : public lib::ThreadPool { K(sys_iops_), K(user_io_size_), K(sys_io_size_), K(no_wait_), K(fail_count_), K(succeed_count_), K(user_io_cnt_), K(user_io_rt_), K(sys_io_cnt_), K(sys_io_rt_)); - private: +private: ObDiskFd fd_; int64_t file_size_; int32_t user_thread_cnt_; @@ -74,7 +74,7 @@ class TestIOStress : public lib::ThreadPool { int64_t succeed_count_; bool no_wait_; - public: +public: int64_t user_io_cnt_; int64_t user_io_rt_; int64_t sys_io_cnt_; diff --git a/deps/oblib/unittest/lib/io/test_disk_error.cpp b/deps/oblib/unittest/lib/io/test_disk_error.cpp index a09bf4e02..f16e0eb6f 100644 --- a/deps/oblib/unittest/lib/io/test_disk_error.cpp +++ b/deps/oblib/unittest/lib/io/test_disk_error.cpp @@ -26,7 +26,7 @@ using namespace ::testing; namespace oceanbase { namespace common { class TestDiskError : public ::testing::Test { - public: +public: TestDiskError() {} virtual ~TestDiskError() @@ -41,7 +41,7 @@ class TestDiskError : public ::testing::Test { virtual void set_no_wait(); virtual void set_io_size(const int64_t disk_index, const int64_t io_size); - protected: +protected: static const int64_t DISK_CNT = 2; int64_t file_size_; char file_names_[DISK_CNT][128]; diff --git a/deps/oblib/unittest/lib/io/test_io_benchmark.cpp b/deps/oblib/unittest/lib/io/test_io_benchmark.cpp index 449710fd7..81ce6c79b 100644 --- a/deps/oblib/unittest/lib/io/test_io_benchmark.cpp +++ b/deps/oblib/unittest/lib/io/test_io_benchmark.cpp @@ -44,7 +44,7 @@ using namespace oceanbase::lib; namespace oceanbase { namespace unittest { class TestIOBenchmark : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown(); }; diff --git a/deps/oblib/unittest/lib/io/test_io_manager.cpp b/deps/oblib/unittest/lib/io/test_io_manager.cpp index 501dadf23..7f60811f6 100644 --- a/deps/oblib/unittest/lib/io/test_io_manager.cpp +++ b/deps/oblib/unittest/lib/io/test_io_manager.cpp @@ -30,7 +30,7 @@ using namespace ::testing; namespace oceanbase { namespace common { class MockIOCallback : public ObIOCallback { - public: +public: MockIOCallback() {} virtual ~MockIOCallback() @@ -44,14 +44,14 @@ class MockIOCallback : public ObIOCallback { }; class TestIOManager : public ::testing::Test { - public: +public: TestIOManager(); virtual ~TestIOManager(); virtual void SetUp(); virtual void TearDown(); virtual void do_multi_disk_test(const bool remove_disk_during_io_ongoing, const bool disk_hang = false); - protected: +protected: ObDiskFd fd_; char filename_[128]; int64_t file_size_; @@ -318,7 +318,7 @@ TEST(ObIOAllocator, simple) } class MyThreadPool : public lib::ThreadPool { - public: +public: static MyThreadPool& get_ins() { static MyThreadPool ins; @@ -786,7 +786,7 @@ TEST_F(TestIOManager, add_delete) } class TestMemLeakIOCallback : public ObIOCallback { - public: +public: TestMemLeakIOCallback() : buf_(NULL), allocator_(nullptr), buf_size_(0) {} virtual ~TestMemLeakIOCallback() @@ -835,7 +835,7 @@ class TestMemLeakIOCallback : public ObIOCallback { } TO_STRING_KV(KP_(buf)); - public: +public: char* buf_; ObIAllocator* allocator_; int64_t buf_size_; @@ -916,7 +916,7 @@ TEST_F(TestIOManager, enqueue_failed) #endif class TestIOCallback : public ObIOCallback { - public: +public: TestIOCallback() : buf_(NULL), buf_size_(OB_MALLOC_NORMAL_BLOCK_SIZE + DIO_READ_ALIGN_SIZE), allocator_(NULL) {} virtual ~TestIOCallback() @@ -969,7 +969,7 @@ class TestIOCallback : public ObIOCallback { } TO_STRING_KV(KP_(buf)); - public: +public: char* buf_; int64_t buf_size_; ObArenaAllocator* allocator_; diff --git a/deps/oblib/unittest/lib/io/test_io_performance.cpp b/deps/oblib/unittest/lib/io/test_io_performance.cpp index a241d543d..3fe909e9e 100644 --- a/deps/oblib/unittest/lib/io/test_io_performance.cpp +++ b/deps/oblib/unittest/lib/io/test_io_performance.cpp @@ -20,7 +20,7 @@ namespace oceanbase { namespace unittest { class TestIOPerformance : public ::testing::Test { - public: +public: virtual void SetUp() { COMMON_LOG(INFO, "start set up"); @@ -44,7 +44,7 @@ TEST_F(TestIOPerformance, single) } class MPSC_ThreadPool : public lib::ThreadPool { - public: +public: MPSC_ThreadPool() : inited_(false), is_lighty_(true) {} virtual ~MPSC_ThreadPool() @@ -55,11 +55,11 @@ class MPSC_ThreadPool : public lib::ThreadPool { static const int64_t CONSUMER_COUNT = 1; static const int64_t PRODUCE_INTERVAL_US = 100; - private: +private: int produce(); int consume(); - private: +private: bool inited_; ObLightyQueue lighty_queue_; ObFixedQueue fixed_queue_; diff --git a/deps/oblib/unittest/lib/io/test_io_performance.h b/deps/oblib/unittest/lib/io/test_io_performance.h index 8be47e03a..7895531ee 100644 --- a/deps/oblib/unittest/lib/io/test_io_performance.h +++ b/deps/oblib/unittest/lib/io/test_io_performance.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { struct IOWorkload { - public: +public: IOWorkload() : category_(USER_IO), size_(0), iops_(0), depth_(0), is_sequence_(0) {} bool is_valid() const @@ -29,7 +29,7 @@ struct IOWorkload { } TO_STRING_KV(K_(category), K_(size), K_(iops), K_(depth), K_(is_sequence)) - public: +public: ObIOCategory category_; int32_t size_; int64_t iops_; @@ -40,7 +40,7 @@ struct IOWorkload { class IOInfoGenerator { friend struct IORunContext; - public: +public: IOInfoGenerator() : inited_(false), mode_(IO_MODE_READ), io_category_(USER_IO), io_size_(0), is_sequence_(false) {} virtual ~IOInfoGenerator() @@ -52,7 +52,7 @@ class IOInfoGenerator { virtual int get_io_info(const char* buf, ObIOInfo& info) = 0; TO_STRING_KV(K_(inited), K_(mode), K_(io_category), K_(io_size), K_(is_sequence)); - protected: +protected: bool inited_; ObIOMode mode_; ObIOCategory io_category_; @@ -61,7 +61,7 @@ class IOInfoGenerator { }; struct IORunContext { - public: +public: IORunContext() : thread_cnt_(0), generator_(NULL), succ_cnt_(0), fail_cnt_(0), sum_rt_(0) {} TO_STRING_KV(K_(thread_cnt), K_(workload), K_(succ_cnt), K_(fail_cnt), KP_(generator), K_(sum_rt)); @@ -73,7 +73,7 @@ struct IORunContext { return bret; } - public: +public: int64_t thread_cnt_; IOWorkload workload_; IOInfoGenerator* generator_; @@ -83,7 +83,7 @@ struct IORunContext { }; class IORunner : public lib::ThreadPool { - public: +public: IORunner() : inited_(0), duration_ms_(0), begin_time_(0), end_time_(0){}; ~IORunner() {} @@ -95,14 +95,14 @@ class IORunner : public lib::ThreadPool { } TO_STRING_KV(K_(inited), K_(duration_ms), K_(read_ctx), K_(write_ctx), K_(begin_time), K_(end_time)); - private: +private: void run1() override; int run_read(); int run_write(const char* data); void print_result(); inline int64_t get_wait_interval(const int64_t iops, const int64_t thread_cnt, const int32_t io_depth); - private: +private: bool inited_; int64_t duration_ms_; IORunContext read_ctx_; @@ -112,7 +112,7 @@ class IORunner : public lib::ThreadPool { }; class SingleIOInfoGenerator : public IOInfoGenerator { - public: +public: SingleIOInfoGenerator() : fd_(), file_size_(0), last_offset_(0) {} virtual ~SingleIOInfoGenerator() @@ -120,14 +120,14 @@ class SingleIOInfoGenerator : public IOInfoGenerator { int init(const ObIOMode mode, const IOWorkload& workload, const ObDiskFd& fd, const int64_t file_size); virtual int get_io_info(const char* buf, ObIOInfo& info) override; - private: +private: ObDiskFd fd_; int64_t file_size_; int64_t last_offset_; }; class MultiIOInfoGenerator : public IOInfoGenerator { - public: +public: MultiIOInfoGenerator() : file_size_(0), last_offset_(0) {} virtual ~MultiIOInfoGenerator() @@ -135,14 +135,14 @@ class MultiIOInfoGenerator : public IOInfoGenerator { int init(const ObIOMode mode, const IOWorkload& workload, const ObArray& fds, const int64_t file_size); virtual int get_io_info(const char* buf, ObIOInfo& info) override; - private: +private: ObArray fds_; int64_t file_size_; int64_t last_offset_; }; class IOStress { - public: +public: IOStress() : inited_(false), file_ready_(false), file_size_(0) {} ~IOStress(); @@ -151,14 +151,14 @@ class IOStress { int run(); int prepare_files(const int64_t file_num, const int64_t file_size); - private: +private: int prepare_one_file(const char* file_path, const int64_t file_size, int& fd); void destroy_files(); int load_io_runner(FILE* config_file, IORunner& runner); int get_info_generator( const ObIOMode mode, const bool multi_disk, const IOWorkload& workload, IOInfoGenerator*& generator); - private: +private: bool inited_; bool file_ready_; int64_t file_size_; diff --git a/deps/oblib/unittest/lib/json/test_yson.cpp b/deps/oblib/unittest/lib/json/test_yson.cpp index 4e262594f..898d891f2 100644 --- a/deps/oblib/unittest/lib/json/test_yson.cpp +++ b/deps/oblib/unittest/lib/json/test_yson.cpp @@ -19,19 +19,19 @@ using namespace oceanbase::common; using namespace oceanbase::yson; class TestYson : public ::testing::Test { - public: +public: TestYson(); virtual ~TestYson(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestYson); - protected: +protected: // function members - protected: +protected: // data members }; @@ -52,7 +52,7 @@ struct ClassWithToYson { TO_STRING_KV("0", val1_, "1", val2_, "2", val3_, "3", val4_, "4", val5_); OB_UNIS_VERSION(1); - public: +public: int64_t val1_; int32_t val2_; bool val3_; diff --git a/deps/oblib/unittest/lib/list/test_dlist.cpp b/deps/oblib/unittest/lib/list/test_dlist.cpp index 0bc2ccb18..2abcea315 100644 --- a/deps/oblib/unittest/lib/list/test_dlist.cpp +++ b/deps/oblib/unittest/lib/list/test_dlist.cpp @@ -27,7 +27,7 @@ namespace oceanbase { namespace common { class TestObDList : public ::testing::Test { - public: +public: TestObDList() {} diff --git a/deps/oblib/unittest/lib/lock/test_latch.cpp b/deps/oblib/unittest/lib/lock/test_latch.cpp index 66e8ff046..833133fad 100644 --- a/deps/oblib/unittest/lib/lock/test_latch.cpp +++ b/deps/oblib/unittest/lib/lock/test_latch.cpp @@ -30,7 +30,7 @@ const int max_cnt = 1000; template class TestLatchContend : public lib::ThreadPool { - public: +public: TestLatchContend() {} virtual ~TestLatchContend() @@ -55,7 +55,7 @@ class TestLatchContend : public lib::ThreadPool { mutex_.unlock(); } - private: +private: MUTEX mutex_; }; @@ -86,14 +86,14 @@ struct RWLockTestParam { }; class RWLockWithTimeout { - public: +public: RWLockWithTimeout(bool has_timeout, uint32_t latch_id = ObLatchIds::DEFAULT_SPIN_RWLOCK) : latch_(), has_timeout_(has_timeout), latch_id_(latch_id) {} ~RWLockWithTimeout() {} - public: +public: int rdlock() { return latch_.rdlock(latch_id_); @@ -113,7 +113,7 @@ class RWLockWithTimeout { return latch_.unlock(); } - private: +private: ObLatch latch_; bool has_timeout_; uint32_t latch_id_; @@ -124,7 +124,7 @@ DEFINE_HAS_MEMBER(wr2rdlock) int64_t k_rd = 0; template class TestRWLockContend : public lib::ThreadPool { - public: +public: explicit TestRWLockContend(const bool has_timeout = false) : lock_(has_timeout) {} virtual ~TestRWLockContend() @@ -174,7 +174,7 @@ class TestRWLockContend : public lib::ThreadPool { param_ = param; } - private: +private: RWLOCK lock_; ObRandom rand_; RWLockTestParam param_; @@ -212,7 +212,7 @@ struct CriticalSec { static const int64_t core_test_th_cnt = 4; class ObLatchTestRun : public lib::ThreadPool { - public: +public: ObLatchTestRun() { buf_ = (char*)malloc(sizeof(CriticalSec) * 2); @@ -235,7 +235,7 @@ class ObLatchTestRun : public lib::ThreadPool { return out_; } - private: +private: char* buf_; CriticalSec* cs_; char out_[10] = "Great!"; diff --git a/deps/oblib/unittest/lib/lock/test_thread_cond.cpp b/deps/oblib/unittest/lib/lock/test_thread_cond.cpp index 0e4c2667f..fd4884981 100644 --- a/deps/oblib/unittest/lib/lock/test_thread_cond.cpp +++ b/deps/oblib/unittest/lib/lock/test_thread_cond.cpp @@ -19,12 +19,12 @@ namespace oceanbase { namespace common { class TestThreadCondStress : public lib::ThreadPool { - public: +public: TestThreadCondStress(ObThreadCond& cond, const bool is_wait); virtual ~TestThreadCondStress(); void run1() final; - private: +private: ObThreadCond& cond_; bool is_wait_; }; diff --git a/deps/oblib/unittest/lib/number/test_number_v2.cpp b/deps/oblib/unittest/lib/number/test_number_v2.cpp index 18be60bd4..34ca21bab 100644 --- a/deps/oblib/unittest/lib/number/test_number_v2.cpp +++ b/deps/oblib/unittest/lib/number/test_number_v2.cpp @@ -38,11 +38,11 @@ const char* format(const T& obj, int16_t scale) } class LimitedAllocator : public ObIAllocator { - public: +public: LimitedAllocator(){}; ~LimitedAllocator(){}; - public: +public: void* alloc(const int64_t size) { return alloc(size, default_memattr); @@ -56,22 +56,22 @@ class LimitedAllocator : public ObIAllocator { return ret; }; - private: +private: uint32_t buffer_[number::ObNumber::MAX_STORE_LEN + 1]; }; class MockPoly : public number::ObCalcVector { - public: +public: MockPoly() : idx_(0){}; - public: +public: template MockPoly(const uint64_t base, const Args&... args) { fill(base, args...); }; - public: +public: template void fill(const uint64_t base, const Args&... args) { @@ -89,7 +89,7 @@ class MockPoly : public number::ObCalcVector { }; void fill_(void){}; - public: +public: MockPoly ref(const int64_t start, const int64_t end) const { MockPoly ret; @@ -110,7 +110,7 @@ class MockPoly : public number::ObCalcVector { return pos; }; - public: +public: int64_t idx_; }; @@ -471,11 +471,11 @@ TEST(ObNumber, poly_poly_div) } class ParseHelperTester : public ObNumberBuilder { - public: +public: ParseHelperTester(){}; ~ParseHelperTester(){}; - public: +public: int fill(const char* str) { return number_.from(str, allocator_); @@ -489,7 +489,7 @@ class ParseHelperTester : public ObNumberBuilder { return number_.from(desc, vector, allocator_); }; - private: +private: CharArena allocator_; }; diff --git a/deps/oblib/unittest/lib/oblog/test_base_log_writer.cpp b/deps/oblib/unittest/lib/oblog/test_base_log_writer.cpp index 91b6dacdb..2f5d39ecb 100644 --- a/deps/oblib/unittest/lib/oblog/test_base_log_writer.cpp +++ b/deps/oblib/unittest/lib/oblog/test_base_log_writer.cpp @@ -19,7 +19,7 @@ using namespace ::oblib; namespace oceanbase { namespace common { class ObTLogItem : public ObIBaseLogItem { - public: +public: ObTLogItem() {} virtual ~ObTLogItem() @@ -43,14 +43,14 @@ class ObTLogItem : public ObIBaseLogItem { }; class ObTLogWriter : public ObBaseLogWriter { - public: +public: ObTLogWriter() : process_cnt_(0) {} virtual ~ObTLogWriter() {} int64_t process_cnt_; - protected: +protected: virtual void process_log_items(ObIBaseLogItem** items, const int64_t item_cnt, int64_t& finish_cnt); }; diff --git a/deps/oblib/unittest/lib/oblog/test_ob_log_obj.cpp b/deps/oblib/unittest/lib/oblog/test_ob_log_obj.cpp index 9c00658e6..9b42768f2 100644 --- a/deps/oblib/unittest/lib/oblog/test_ob_log_obj.cpp +++ b/deps/oblib/unittest/lib/oblog/test_ob_log_obj.cpp @@ -23,7 +23,7 @@ enum ObLogTestLevel { third = 2, }; class ObLogTest { - public: +public: ObLogTest() : num_(10), name_("hello"), lever_(first) {} virtual ~ObLogTest(){}; diff --git a/deps/oblib/unittest/lib/oblog/test_ob_log_performance.cpp b/deps/oblib/unittest/lib/oblog/test_ob_log_performance.cpp index 410624267..d0ccd2295 100644 --- a/deps/oblib/unittest/lib/oblog/test_ob_log_performance.cpp +++ b/deps/oblib/unittest/lib/oblog/test_ob_log_performance.cpp @@ -24,18 +24,18 @@ using namespace common; namespace test { class ObLogTestThread : public lib::ThreadPool { - public: +public: static const int64_t NUM_OF_LOG = 500; void run1() final; }; class ObLogTestThreadT : public lib::ThreadPool { - public: +public: static const int64_t NUM_OF_LOG = 500; void run1() final; }; class ObLoggerTest : public ::testing::Test { - public: +public: static const int64_t BIG_LOG_FILE_SIZE = 256 * 1024 * 1024; static const int64_t S_LOG_FILE_SIZE = 16 * 1024; ObLoggerTest(); @@ -46,7 +46,7 @@ class ObLoggerTest : public ::testing::Test { void run_test_t_async(); void run_test_t_async_multi(); - protected: +protected: ObLogTestThread thread_pool_; ObLogTestThreadT thread_pool_t_; }; diff --git a/deps/oblib/unittest/lib/profile/test_ob_trace_id.cpp b/deps/oblib/unittest/lib/profile/test_ob_trace_id.cpp index b28710fc9..22adbd3c9 100644 --- a/deps/oblib/unittest/lib/profile/test_ob_trace_id.cpp +++ b/deps/oblib/unittest/lib/profile/test_ob_trace_id.cpp @@ -16,7 +16,7 @@ using namespace oceanbase::common; class TestTraceID : public ::testing::Test { - public: +public: TestTraceID() {} virtual ~TestTraceID() @@ -26,13 +26,13 @@ class TestTraceID : public ::testing::Test { virtual void TearDown() {} - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestTraceID); - protected: +protected: // function members - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/profile/test_perf_event.cpp b/deps/oblib/unittest/lib/profile/test_perf_event.cpp index 39e108260..efd57d31b 100644 --- a/deps/oblib/unittest/lib/profile/test_perf_event.cpp +++ b/deps/oblib/unittest/lib/profile/test_perf_event.cpp @@ -16,19 +16,19 @@ using namespace oceanbase::common; class TestPerfEvent : public ::testing::Test { - public: +public: TestPerfEvent(); virtual ~TestPerfEvent(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestPerfEvent); - protected: +protected: // function members - protected: +protected: // data members }; diff --git a/deps/oblib/unittest/lib/queue/test_ext_ms_queue.cpp b/deps/oblib/unittest/lib/queue/test_ext_ms_queue.cpp index f663d0a20..9587536ad 100644 --- a/deps/oblib/unittest/lib/queue/test_ext_ms_queue.cpp +++ b/deps/oblib/unittest/lib/queue/test_ext_ms_queue.cpp @@ -20,7 +20,7 @@ using namespace oceanbase::common; class ExtMsQueueTest : public ::testing::Test { - public: +public: static const int64_t KEY_COUNT = 10; static const int64_t MAX_CACHED_MS_QUEUE_ITEM_COUNT = KEY_COUNT; static const int64_t MSQ_QUEUE_COUNT = 4; @@ -31,7 +31,7 @@ class ExtMsQueueTest : public ::testing::Test { static const int64_t OP_TIMEOUT = 100 * 1000; static const int64_t WAIT_TIME = 100; - public: +public: typedef ObPartitionKey KeyType; typedef ObLink TaskType; @@ -60,13 +60,13 @@ class ExtMsQueueTest : public ::testing::Test { void wait_consumers_(); int terminate_all_ms_queue_(); - public: +public: ExtMsQueueTest(); virtual ~ExtMsQueueTest(); virtual void SetUp(); virtual void TearDown(); - public: +public: int64_t end_time_; KeyValue kv_[KEY_COUNT]; TaskType task_[MSQ_QUEUE_COUNT]; // every Queue in MsQueue corresponds to a Task @@ -76,7 +76,7 @@ class ExtMsQueueTest : public ::testing::Test { int64_t producer_thread_index_counter_; ObExtMsQueue ext_ms_queue_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ExtMsQueueTest); }; diff --git a/deps/oblib/unittest/lib/queue/test_lighty_queue.h b/deps/oblib/unittest/lib/queue/test_lighty_queue.h index 7862df62f..7834d92ec 100644 --- a/deps/oblib/unittest/lib/queue/test_lighty_queue.h +++ b/deps/oblib/unittest/lib/queue/test_lighty_queue.h @@ -17,21 +17,21 @@ using oceanbase::common::LightyQueue; using oceanbase::lib::ThreadPool; class Productor : public ThreadPool { - public: +public: Productor(LightyQueue& q, int th_cnt) : q_(q) { set_thread_count(th_cnt); } - private: +private: void run1() override; - private: +private: LightyQueue& q_; }; // end of class Productor class Consumer : public ThreadPool { - public: +public: Consumer(LightyQueue& q, int th_cnt) : q_(q), cnt_(0) { set_thread_count(th_cnt); @@ -42,10 +42,10 @@ class Consumer : public ThreadPool { return cnt_; } - private: +private: void run1() override; - private: +private: LightyQueue& q_; uint64_t cnt_; }; // end of class Consumer diff --git a/deps/oblib/unittest/lib/queue/test_priority_queue.cpp b/deps/oblib/unittest/lib/queue/test_priority_queue.cpp index dfa950194..ac24dc813 100644 --- a/deps/oblib/unittest/lib/queue/test_priority_queue.cpp +++ b/deps/oblib/unittest/lib/queue/test_priority_queue.cpp @@ -20,7 +20,7 @@ using namespace oceanbase::lib; using namespace oceanbase::common; class TestQueue : public ThreadPool { - public: +public: enum { BATCH = 64 }; struct QData : public ObLink { QData() : val_(0) @@ -101,7 +101,7 @@ class TestQueue : public ThreadPool { } } - private: +private: int64_t seq_ CACHE_ALIGNED; int64_t limit_; Queue queue_; diff --git a/deps/oblib/unittest/lib/random/test_mysql_random.cpp b/deps/oblib/unittest/lib/random/test_mysql_random.cpp index 03a55d12e..f15fa5ea3 100644 --- a/deps/oblib/unittest/lib/random/test_mysql_random.cpp +++ b/deps/oblib/unittest/lib/random/test_mysql_random.cpp @@ -17,7 +17,7 @@ namespace oceanbase { namespace common { class TestMysqlRandom : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/deps/oblib/unittest/lib/rc/test_context.cpp b/deps/oblib/unittest/lib/rc/test_context.cpp index 6a20bc08f..3e00f7461 100644 --- a/deps/oblib/unittest/lib/rc/test_context.cpp +++ b/deps/oblib/unittest/lib/rc/test_context.cpp @@ -34,7 +34,7 @@ void has_unfree_callback(char*) } class TestContext : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/deps/oblib/unittest/lib/regex/test_regex.cpp b/deps/oblib/unittest/lib/regex/test_regex.cpp index d3edb16d0..1c99593b3 100644 --- a/deps/oblib/unittest/lib/regex/test_regex.cpp +++ b/deps/oblib/unittest/lib/regex/test_regex.cpp @@ -533,18 +533,18 @@ static int efind(char* name) } class ObRegexTest : public ::testing::Test { - public: +public: ObRegexTest(); virtual ~ObRegexTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObRegexTest(const ObRegexTest& other); ObRegexTest& operator=(const ObRegexTest& other); - private: +private: // data members }; ObRegexTest::ObRegexTest() diff --git a/deps/oblib/unittest/lib/resource/test_resource_mgr.cpp b/deps/oblib/unittest/lib/resource/test_resource_mgr.cpp index 5bab4f4df..195fb2557 100644 --- a/deps/oblib/unittest/lib/resource/test_resource_mgr.cpp +++ b/deps/oblib/unittest/lib/resource/test_resource_mgr.cpp @@ -122,7 +122,7 @@ TEST(TestTenantMemoryMgr, basic) } class FakeCacheWasher : public ObICacheWasher { - public: +public: FakeCacheWasher(const uint64_t tenant_id, const int64_t mb_size) : tenant_id_(tenant_id), mb_size_(mb_size), mb_blocks_(NULL) {} @@ -192,7 +192,7 @@ class FakeCacheWasher : public ObICacheWasher { } } - private: +private: uint64_t tenant_id_; int64_t mb_size_; ObCacheMemBlock* mb_blocks_; diff --git a/deps/oblib/unittest/lib/restore/test_storage_file.cpp b/deps/oblib/unittest/lib/restore/test_storage_file.cpp index f05f313ff..15b6c7db9 100644 --- a/deps/oblib/unittest/lib/restore/test_storage_file.cpp +++ b/deps/oblib/unittest/lib/restore/test_storage_file.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; class TestStorageFile : public ::testing::Test { - public: +public: TestStorageFile() {} virtual ~TestStorageFile() @@ -42,13 +42,13 @@ class TestStorageFile : public ::testing::Test { static void TearDownTestCase() {} - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestStorageFile); - protected: +protected: // function members - protected: +protected: char test_dir_[OB_MAX_URI_LENGTH]; char test_dir_uri_[OB_MAX_URI_LENGTH]; }; @@ -218,7 +218,7 @@ TEST_F(TestStorageFile, test_mkdir) TEST_F(TestStorageFile, test_parallel_mkdir) { class MakedirTask : public ObDynamicThreadTask { - public: + public: int init(const char* dir) { EXPECT_FALSE(NULL == dir); @@ -240,7 +240,7 @@ TEST_F(TestStorageFile, test_parallel_mkdir) return OB_SUCCESS; } - private: + private: char uri_[OB_MAX_URI_LENGTH]; }; diff --git a/deps/oblib/unittest/lib/stat/test_di_cache.cpp b/deps/oblib/unittest/lib/stat/test_di_cache.cpp index c7cc02fd7..cc03d6c08 100644 --- a/deps/oblib/unittest/lib/stat/test_di_cache.cpp +++ b/deps/oblib/unittest/lib/stat/test_di_cache.cpp @@ -26,7 +26,7 @@ using namespace oceanbase::common; const int64_t update_cnt = 100000; class TestSessionMultiThread : public CoKThread { - public: +public: TestSessionMultiThread() {} virtual ~TestSessionMultiThread() diff --git a/deps/oblib/unittest/lib/stat/test_diagnose_info.cpp b/deps/oblib/unittest/lib/stat/test_diagnose_info.cpp index dc4cf1df6..7abdb737b 100644 --- a/deps/oblib/unittest/lib/stat/test_diagnose_info.cpp +++ b/deps/oblib/unittest/lib/stat/test_diagnose_info.cpp @@ -217,7 +217,7 @@ TEST(ObDiagnoseSessionInfo, normal) } class AtomicWaitEventTestRun : public cotesting::DefaultRunnable { - public: +public: AtomicWaitEventTestRun() {} ~AtomicWaitEventTestRun() @@ -230,7 +230,7 @@ class AtomicWaitEventTestRun : public cotesting::DefaultRunnable { lock_.unlock(); } - private: +private: SpinRWLock lock_; }; diff --git a/deps/oblib/unittest/lib/task/test_timer.cpp b/deps/oblib/unittest/lib/task/test_timer.cpp index 368d2432d..e495b713e 100644 --- a/deps/oblib/unittest/lib/task/test_timer.cpp +++ b/deps/oblib/unittest/lib/task/test_timer.cpp @@ -17,7 +17,7 @@ namespace oceanbase { namespace common { class TestTimerTask : public ObTimerTask { - public: +public: TestTimerTask() : running_(false), task_run_count_(0) {} diff --git a/deps/oblib/unittest/lib/test_fixed_array.cpp b/deps/oblib/unittest/lib/test_fixed_array.cpp index f17361c88..0126b432b 100644 --- a/deps/oblib/unittest/lib/test_fixed_array.cpp +++ b/deps/oblib/unittest/lib/test_fixed_array.cpp @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObTestFiexedArray : public ::testing::Test { - public: +public: ObTestFiexedArray() {} ~ObTestFiexedArray() @@ -30,11 +30,11 @@ class ObTestFiexedArray : public ::testing::Test { virtual void TearDown() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTestFiexedArray); }; class Testfun { - public: +public: Testfun(ObIArray& array) { UNUSED(array); @@ -42,7 +42,7 @@ class Testfun { ~Testfun() {} - private: +private: common::ObSEArray data_; }; diff --git a/deps/oblib/unittest/lib/test_work_queue.cpp b/deps/oblib/unittest/lib/test_work_queue.cpp index c73c6707e..c0767dee7 100644 --- a/deps/oblib/unittest/lib/test_work_queue.cpp +++ b/deps/oblib/unittest/lib/test_work_queue.cpp @@ -15,19 +15,19 @@ #include "lib/utility/ob_test_util.h" using namespace oceanbase::common; class TestWorkQueue : public ::testing::Test { - public: +public: TestWorkQueue(); virtual ~TestWorkQueue(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestWorkQueue); - protected: +protected: // function members - protected: +protected: // data members }; @@ -55,7 +55,7 @@ TEST_F(TestWorkQueue, init) } class ATimerTask : public ObAsyncTimerTask { - public: +public: ATimerTask(ObWorkQueue& queue, bool fail_it = false) : ObAsyncTimerTask(queue), fail_it_(fail_it) { set_retry_interval(0); @@ -99,13 +99,13 @@ class ATimerTask : public ObAsyncTimerTask { process_count_ = 0; } - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ATimerTask); // function members - private: +private: // data members static int64_t process_count_; bool fail_it_; diff --git a/deps/oblib/unittest/lib/thread/test_dynamic_thread_pool.cpp b/deps/oblib/unittest/lib/thread/test_dynamic_thread_pool.cpp index b65ed6fc2..3678f608b 100644 --- a/deps/oblib/unittest/lib/thread/test_dynamic_thread_pool.cpp +++ b/deps/oblib/unittest/lib/thread/test_dynamic_thread_pool.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; class TestObDynamicThreadPool : public ::testing::Test { - public: +public: TestObDynamicThreadPool() {} virtual ~TestObDynamicThreadPool() @@ -34,17 +34,17 @@ class TestObDynamicThreadPool : public ::testing::Test { static void TearDownTestCase() {} - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestObDynamicThreadPool); - protected: +protected: // function members - protected: +protected: }; class SimpleTask : public ObDynamicThreadTask { - public: +public: int process(const bool& is_stop) { UNUSED(is_stop); diff --git a/deps/oblib/unittest/lib/thread/test_simple_thread_pool.cpp b/deps/oblib/unittest/lib/thread/test_simple_thread_pool.cpp index 549c9796f..1989bf6ea 100644 --- a/deps/oblib/unittest/lib/thread/test_simple_thread_pool.cpp +++ b/deps/oblib/unittest/lib/thread/test_simple_thread_pool.cpp @@ -25,7 +25,7 @@ TEST(DISABLED_TestSimpleThreadPool, Basic) ATOMIC_INC(&handle_cnt_); } - public: + public: int handle_cnt_ = 0; } pool; EXPECT_NE(OB_SUCCESS, pool.init(0, 10)); diff --git a/deps/oblib/unittest/lib/thread/test_tg_mgr.cpp b/deps/oblib/unittest/lib/thread/test_tg_mgr.cpp index 49aa524ff..5926f092b 100644 --- a/deps/oblib/unittest/lib/thread/test_tg_mgr.cpp +++ b/deps/oblib/unittest/lib/thread/test_tg_mgr.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; using namespace oceanbase::lib; class TestTimerTask : public ObTimerTask { - public: +public: TestTimerTask() : running_(false), task_run_count_(0) {} @@ -64,7 +64,7 @@ TEST(TG, timer) } class Handler : public TGTaskHandler { - public: +public: void handle(void* task) override { UNUSED(task); @@ -103,7 +103,7 @@ TEST(TG, queue_thread) } class MyDTask : public common::IObDedupTask { - public: +public: MyDTask() : common::IObDedupTask(common::T_BLOOMFILTER) {} virtual int64_t hash() const @@ -163,7 +163,7 @@ TEST(TG, dedup_queue) } class MyRunnable : public TGRunnable { - public: +public: void run1() override { run_count_++; @@ -200,7 +200,7 @@ TEST(TG, thread_pool) } class MyTask : public share::ObAsyncTask { - public: +public: virtual int process() override { handle_count_++; diff --git a/deps/oblib/unittest/lib/thread/test_thread_lease.cpp b/deps/oblib/unittest/lib/thread/test_thread_lease.cpp index 9daafbe75..a921c9587 100644 --- a/deps/oblib/unittest/lib/thread/test_thread_lease.cpp +++ b/deps/oblib/unittest/lib/thread/test_thread_lease.cpp @@ -15,7 +15,7 @@ using namespace oceanbase::common; class TestObThreadLease : public ::testing::Test { - public: +public: TestObThreadLease() {} virtual ~TestObThreadLease() @@ -31,13 +31,13 @@ class TestObThreadLease : public ::testing::Test { static void TearDownTestCase() {} - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestObThreadLease); - protected: +protected: // function members - protected: +protected: }; TEST_F(TestObThreadLease, smoke_test) diff --git a/deps/oblib/unittest/lib/timezone/test_ob_time_convert.cpp b/deps/oblib/unittest/lib/timezone/test_ob_time_convert.cpp index 9d37aa971..0dcb47764 100644 --- a/deps/oblib/unittest/lib/timezone/test_ob_time_convert.cpp +++ b/deps/oblib/unittest/lib/timezone/test_ob_time_convert.cpp @@ -22,13 +22,13 @@ using namespace oceanbase; using namespace oceanbase::common; class ObTimeConvertTest : public ::testing::Test { - public: +public: ObTimeConvertTest(); virtual ~ObTimeConvertTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObTimeConvertTest(const ObTimeConvertTest& other); ObTimeConvertTest& operator=(const ObTimeConvertTest& other); diff --git a/deps/oblib/unittest/lib/timezone/test_ob_timezone_utils.cpp b/deps/oblib/unittest/lib/timezone/test_ob_timezone_utils.cpp index 3da954f02..e95da3365 100644 --- a/deps/oblib/unittest/lib/timezone/test_ob_timezone_utils.cpp +++ b/deps/oblib/unittest/lib/timezone/test_ob_timezone_utils.cpp @@ -20,13 +20,13 @@ using namespace oceanbase; using namespace oceanbase::common; class ObTimezoneUtilsTest : public ::testing::Test { - public: +public: ObTimezoneUtilsTest(); virtual ~ObTimezoneUtilsTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObTimezoneUtilsTest(const ObTimezoneUtilsTest& other); ObTimezoneUtilsTest& operator=(const ObTimezoneUtilsTest& other); diff --git a/deps/oblib/unittest/lib/trace/test_trace_event.cpp b/deps/oblib/unittest/lib/trace/test_trace_event.cpp index 5909cfd16..e2f104d8a 100644 --- a/deps/oblib/unittest/lib/trace/test_trace_event.cpp +++ b/deps/oblib/unittest/lib/trace/test_trace_event.cpp @@ -19,19 +19,19 @@ using namespace oceanbase::common; class TestTraceEvent : public ::testing::Test { - public: +public: TestTraceEvent(); virtual ~TestTraceEvent(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestTraceEvent); - protected: +protected: // function members - protected: +protected: // data members }; @@ -89,7 +89,7 @@ struct ClassWithToYson { TO_YSON_KV(0, val1_, 1, val2_, 2, val3_, 3, val4_, 4, val5_); TO_STRING_KV("0", val1_, "1", val2_, "2", val3_, "3", val4_, "4", val5_); - public: +public: int64_t val1_; int32_t val2_; bool val3_; diff --git a/deps/oblib/unittest/lib/utility/test_ob_unify_serialize.cpp b/deps/oblib/unittest/lib/utility/test_ob_unify_serialize.cpp index c34145296..b3bf45643 100644 --- a/deps/oblib/unittest/lib/utility/test_ob_unify_serialize.cpp +++ b/deps/oblib/unittest/lib/utility/test_ob_unify_serialize.cpp @@ -27,14 +27,14 @@ using namespace oceanbase::common::serialization; ObRandom Random; class TestObUnifySerialize : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - protected: +protected: template int64_t do_test(const T& t) { @@ -49,7 +49,7 @@ class TestObUnifySerialize : public ::testing::Test { return len; } - protected: +protected: const static int64_t LEN = 1024; char buf_[LEN]; }; @@ -77,7 +77,7 @@ OB_SERIALIZE_MEMBER(CEmptyTest); struct CIntTest : public CPureTest { OB_UNIS_VERSION(1); - public: +public: CIntTest() { b_ = false; @@ -142,7 +142,7 @@ struct CIntTest : public CPureTest { return t1; } - public: +public: bool b_; int8_t vi8_; uint8_t vu8_; @@ -159,7 +159,7 @@ OB_SERIALIZE_MEMBER(CIntTest, b_, vi8_, vu8_, vi16_, vu16_, vi32_, vu32_, vi64_, struct CDerived : public CIntTest { OB_UNIS_VERSION(1); - public: +public: CDerived() { i64_ = 0; @@ -173,7 +173,7 @@ struct CDerived : public CIntTest { return n; } - private: +private: int64_t i64_; }; @@ -182,7 +182,7 @@ OB_SERIALIZE_MEMBER((CDerived, CIntTest), i64_); struct CCharTest : public CPureTest { OB_UNIS_VERSION(1); - public: +public: CCharTest() { memset(buf_, 0, 8); @@ -204,7 +204,7 @@ struct CCharTest : public CPureTest { return n; } - private: +private: char buf_[32]; }; @@ -213,7 +213,7 @@ OB_SERIALIZE_MEMBER(CCharTest, buf_); struct CArrayTest : public CPureTest { OB_UNIS_VERSION(1); - public: +public: CArrayTest() { memset(ia_, 0, sizeof(int32_t) * SIZE); @@ -264,10 +264,10 @@ struct CArrayTest : public CPureTest { return n; } - private: +private: static const int SIZE = 32; - private: +private: int32_t ia_[SIZE]; uint32_t uia_[SIZE]; int64_t i64a_[SIZE]; @@ -280,7 +280,7 @@ OB_SERIALIZE_MEMBER(CArrayTest, ia_, uia_, i64a_, ui64a_, ita_); struct CEnumTest : public CPureTest { OB_UNIS_VERSION(1); - public: +public: CEnumTest() { eval = E0; @@ -300,7 +300,7 @@ struct CEnumTest : public CPureTest { return et; } - private: +private: enum Eval { E0, E1, E2, E3, EMAX } eval; }; @@ -309,7 +309,7 @@ OB_SERIALIZE_MEMBER(CEnumTest, eval); struct CNested { OB_UNIS_VERSION(1); - public: +public: bool operator==(const CNested& other) const { return t1_ == other.t1_ && t2_ == other.t2_ && ct_ == other.ct_ && at_ == other.at_ && et_ == other.et_ && @@ -328,7 +328,7 @@ struct CNested { return n; } - public: +public: CIntTest t1_; CIntTest t2_; CCharTest ct_; @@ -342,7 +342,7 @@ OB_SERIALIZE_MEMBER(CNested, t1_, t2_, ct_, at_, et_, t3_); struct CNestedAddOne { OB_UNIS_VERSION(1); - public: +public: bool operator==(const CNestedAddOne& other) const { return t1_ == other.t1_ && t2_ == other.t2_ && ct_ == other.ct_ && at_ == other.at_ && et_ == other.et_ && @@ -362,7 +362,7 @@ struct CNestedAddOne { return n; } - public: +public: CIntTest t1_; CIntTest t2_; CCharTest ct_; @@ -377,7 +377,7 @@ OB_SERIALIZE_MEMBER(CNestedAddOne, t1_, t2_, ct_, at_, et_, t3_, t4_); struct CNestedStub { OB_UNIS_VERSION(1); - public: +public: bool operator==(const CNestedStub&) const { return true; @@ -388,7 +388,7 @@ struct CNestedStub { return CNestedStub(); } - public: +public: CEmptyTest t1_; CEmptyTest t2_; CCharTest ct_; @@ -556,7 +556,7 @@ TEST_F(TestObUnifySerialize, Dummy) struct COptInt { OB_UNIS_VERSION(1); - public: +public: COptInt() : valid_(true), value_(0) {} @@ -565,7 +565,7 @@ struct COptInt { return valid_ == rhs.valid_ && value_ == rhs.value_; } - public: +public: bool valid_; int value_; }; @@ -618,13 +618,13 @@ class CCompat { OB_UNIS_VERSION(1); OB_UNIS_COMPAT(VER(2, 2, 3)); - public: +public: bool operator==(const CCompat& rhs) const { return i1_ == rhs.i1_ && i2_ == rhs.i2_; } - public: +public: int i1_; int i2_; }; @@ -636,7 +636,7 @@ class CCompat2 : public CCompat { OB_UNIS_VERSION(1); OB_UNIS_COMPAT(VER(2, 2, 3)); - public: +public: CCompat2() { at_ = CArrayTest::RAND(); @@ -651,7 +651,7 @@ class CCompat2 : public CCompat { return !operator==(rhs); } - public: +public: CArrayTest at_; long l1_; long l2_; @@ -663,7 +663,7 @@ OB_SERIALIZE_MEMBER_COMPAT(VER(2, 2, 3), CCompat2, i1_, i2_, at_, l1_, l2_); class CNoCompat : public CCompat { OB_UNIS_VERSION(1); - public: +public: CNoCompat() { v_ = (int)Random.get(0, 127); @@ -673,7 +673,7 @@ class CNoCompat : public CCompat { return v_ == rhs.v_ && static_cast(*this) == static_cast(rhs); } - private: +private: int v_; }; diff --git a/deps/oblib/unittest/pub/mock_server.h b/deps/oblib/unittest/pub/mock_server.h index 9a98a5be0..fe0197466 100644 --- a/deps/oblib/unittest/pub/mock_server.h +++ b/deps/oblib/unittest/pub/mock_server.h @@ -26,7 +26,7 @@ namespace pub { template class MockP : public ObRpcProcessor { - public: +public: int process() { return ObRpcProcessor::response_result(); @@ -34,7 +34,7 @@ class MockP : public ObRpcProcessor { }; class MockPacketHandler : public ObNetRpcHandler { - public: +public: int process(easy_request_t* r) { int ret = EASY_OK; @@ -70,7 +70,7 @@ class MockPacketHandler : public ObNetRpcHandler { return ret; } - private: +private: #define REG_PKT(pcode) \ case pcode: { \ p = new MockP(); \ @@ -115,7 +115,7 @@ class MockPacketHandler : public ObNetRpcHandler { }; // end of class MockPacketHandler class MockServer : public ObNetEasy { - public: +public: int init(int port) { int ret = OB_SUCCESS; @@ -129,7 +129,7 @@ class MockServer : public ObNetEasy { return ret; } - private: +private: MockPacketHandler phandler_; }; // end of class MockServer diff --git a/deps/oblib/unittest/rpc/mock_ob_common_rpc_proxy.h b/deps/oblib/unittest/rpc/mock_ob_common_rpc_proxy.h index efbaf981a..9ce9e02bb 100644 --- a/deps/oblib/unittest/rpc/mock_ob_common_rpc_proxy.h +++ b/deps/oblib/unittest/rpc/mock_ob_common_rpc_proxy.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace obrpc { class MockObCommonRpcProxy : public ObCommonRpcProxy { - public: +public: MockObCommonRpcProxy() : ObCommonRpcProxy(this) {} MOCK_METHOD3( diff --git a/deps/oblib/unittest/rpc/mock_ob_srv_rpc_proxy.h b/deps/oblib/unittest/rpc/mock_ob_srv_rpc_proxy.h index 7c3a18d0f..379559a90 100644 --- a/deps/oblib/unittest/rpc/mock_ob_srv_rpc_proxy.h +++ b/deps/oblib/unittest/rpc/mock_ob_srv_rpc_proxy.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace obrpc { class MockObSrvRpcProxy : public ObSrvRpcProxy { - public: +public: MockObSrvRpcProxy() : ObSrvRpcProxy(this) {} diff --git a/deps/oblib/unittest/rpc/rpc_bench.cpp b/deps/oblib/unittest/rpc/rpc_bench.cpp index 4c26ce6ab..f9372f0cd 100644 --- a/deps/oblib/unittest/rpc/rpc_bench.cpp +++ b/deps/oblib/unittest/rpc/rpc_bench.cpp @@ -40,7 +40,7 @@ int io_count = 1; int worker_count = 1; class TestProxy : public ObRpcProxy { - public: +public: DEFINE_TO(TestProxy); RPC_S(@PR5 test, OB_TEST_PCODE); @@ -53,7 +53,7 @@ int64_t total_count = 0; int64_t total_send_count = 0; class MyProcessor : public TestProxy::Processor { - public: +public: int process() { int ret = OB_SUCCESS; @@ -69,7 +69,7 @@ class MyProcessor : public TestProxy::Processor { }; class QHandler : public ObiReqQHandler { - public: +public: bool handlePacketQueue(ObRequest* req, void* args) { UNUSED(args); @@ -91,7 +91,7 @@ class QHandler : public ObiReqQHandler { }; class ObTestDeliver : public rpc::frame::ObReqQDeliver { - public: +public: ObTestDeliver() : ObReqQDeliver(qhandler_) {} @@ -130,13 +130,13 @@ class ObTestDeliver : public rpc::frame::ObReqQDeliver { void stop(){}; - private: +private: ObReqQueueThread queue_; QHandler qhandler_; }; class Client : public CoKThread { - public: +public: Client(const TestProxy& proxy, int th_cnt, ObAddr dst, uint32_t sleep_time) : CoKThread(th_cnt), proxy_(proxy), dst_(dst), sleep_time_(sleep_time) {} @@ -150,7 +150,7 @@ class Client : public CoKThread { } } - private: +private: const TestProxy& proxy_; const ObAddr dst_; const uint32_t sleep_time_; diff --git a/deps/oblib/unittest/rpc/test_co_rpc_server.cpp b/deps/oblib/unittest/rpc/test_co_rpc_server.cpp index e54f27140..d31f42892 100644 --- a/deps/oblib/unittest/rpc/test_co_rpc_server.cpp +++ b/deps/oblib/unittest/rpc/test_co_rpc_server.cpp @@ -36,7 +36,7 @@ using namespace std; #define ERROR_MSG "Common error" class TestProxy : public ObRpcProxy { - public: +public: DEFINE_TO(TestProxy); RPC_S(@PR5 test, OB_TEST_PCODE); @@ -44,7 +44,7 @@ class TestProxy : public ObRpcProxy { }; class MyProcessor : public TestProxy::Processor { - protected: +protected: int process() { static int64_t rpc_count_ = 0; @@ -67,7 +67,7 @@ class MyProcessor : public TestProxy::Processor { }; class ObTestDeliver : public rpc::frame::ObReqDeliver { - public: +public: int init() { return 0; @@ -97,7 +97,7 @@ class ObTestDeliver : public rpc::frame::ObReqDeliver { }; class TestRpcServer : public ::testing::Test { - public: +public: TestRpcServer() : handler_(server_), transport_(NULL) {} @@ -118,7 +118,7 @@ class TestRpcServer : public ::testing::Test { net_.stop(); } - protected: +protected: rpc::frame::ObNetEasy net_; obrpc::ObRpcHandler handler_; ObTestDeliver server_; diff --git a/deps/oblib/unittest/rpc/test_mysql_packet.cpp b/deps/oblib/unittest/rpc/test_mysql_packet.cpp index 356134099..9f7dc5640 100644 --- a/deps/oblib/unittest/rpc/test_mysql_packet.cpp +++ b/deps/oblib/unittest/rpc/test_mysql_packet.cpp @@ -18,12 +18,12 @@ using namespace oceanbase::rpc; using namespace oceanbase::obmysql; class ObFakeMySQLPacket : public ObMySQLPacket { - public: +public: ObFakeMySQLPacket() : content_len_(0) {} int64_t content_len_; - protected: +protected: virtual int serialize(char* start, const int64_t len, int64_t& pos) const { int ret = OB_SUCCESS; @@ -42,7 +42,7 @@ class ObFakeMySQLPacket : public ObMySQLPacket { }; class TestMySQLPacket : public ::testing::Test { - public: +public: TestMySQLPacket() {} diff --git a/deps/oblib/unittest/rpc/test_mysql_util.cpp b/deps/oblib/unittest/rpc/test_mysql_util.cpp index 4811c3957..8b7580d04 100644 --- a/deps/oblib/unittest/rpc/test_mysql_util.cpp +++ b/deps/oblib/unittest/rpc/test_mysql_util.cpp @@ -22,7 +22,7 @@ using namespace oceanbase::common; using namespace oceanbase::obmysql; class TestObMySQLUtil : public ::testing::Test { - public: +public: TestObMySQLUtil() {} @@ -32,7 +32,7 @@ class TestObMySQLUtil : public ::testing::Test { virtual void TearDown() {} - protected: +protected: }; #define PREPEND_ZEROS(char_size, offset, src_str, result_str) \ diff --git a/deps/oblib/unittest/rpc/test_net_client.cpp b/deps/oblib/unittest/rpc/test_net_client.cpp index 8ed2e8c5d..ae2e169ed 100644 --- a/deps/oblib/unittest/rpc/test_net_client.cpp +++ b/deps/oblib/unittest/rpc/test_net_client.cpp @@ -17,7 +17,7 @@ using namespace oceanbase::obrpc; using namespace oceanbase::common; class TestNetClient : public ::testing::Test { - public: +public: virtual void SetUp() { client_.init(); @@ -28,7 +28,7 @@ class TestNetClient : public ::testing::Test { client_.destroy(); } - protected: +protected: ObNetClient client_; }; diff --git a/deps/oblib/unittest/rpc/test_obrpc_packet.cpp b/deps/oblib/unittest/rpc/test_obrpc_packet.cpp index ce74e26f2..add82163f 100644 --- a/deps/oblib/unittest/rpc/test_obrpc_packet.cpp +++ b/deps/oblib/unittest/rpc/test_obrpc_packet.cpp @@ -17,7 +17,7 @@ using namespace oceanbase::rpc; using namespace oceanbase::obrpc; class TestObrpcPacket : public ::testing::Test { - public: +public: virtual void SetUp() {} diff --git a/deps/oblib/unittest/rpc/test_obrpc_stat.cpp b/deps/oblib/unittest/rpc/test_obrpc_stat.cpp index 4e787b7f5..3c002b935 100644 --- a/deps/oblib/unittest/rpc/test_obrpc_stat.cpp +++ b/deps/oblib/unittest/rpc/test_obrpc_stat.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::rpc; using namespace oceanbase::obrpc; class TestObrpcStat : public ::testing::Test { - public: +public: virtual void SetUp() {} diff --git a/deps/oblib/unittest/rpc/test_rpc_proxy.cpp b/deps/oblib/unittest/rpc/test_rpc_proxy.cpp index 5b085d50e..e0635ba30 100644 --- a/deps/oblib/unittest/rpc/test_rpc_proxy.cpp +++ b/deps/oblib/unittest/rpc/test_rpc_proxy.cpp @@ -20,7 +20,7 @@ using namespace oceanbase::rpc::frame; template struct ArgT { - public: +public: int64_t sz_ = SZ; int serialize(char* buf, const int64_t buf_len, int64_t& pos) const { @@ -47,7 +47,7 @@ static Arg_succ arg_succ; static Arg arg; class TestProxy : public ObRpcProxy { - public: +public: DEFINE_TO(TestProxy); RPC_AP(@PR5 test, OB_TEST_PCODE, (uint64_t)); @@ -60,7 +60,7 @@ class TestProxy : public ObRpcProxy { }; class TestCB : public TestProxy::AsyncCB { - public: +public: TestCB() : processed_(false) {} @@ -85,7 +85,7 @@ class TestCB : public TestProxy::AsyncCB { }; class TestRpcProxy : public ::testing::Test { - public: +public: virtual void SetUp() { r_.user_data = &cb_; @@ -96,7 +96,7 @@ class TestRpcProxy : public ::testing::Test { virtual void TearDown() {} - protected: +protected: void serialize_rcode(const ObRpcResultCode& rc) { int64_t pos = 0; @@ -104,7 +104,7 @@ class TestRpcProxy : public ::testing::Test { pkt_.set_content(buf_, pos); } - protected: +protected: TestCB cb_; ObRpcPacket pkt_; easy_request_t r_; diff --git a/deps/oblib/unittest/rpc/test_rpc_server.cpp b/deps/oblib/unittest/rpc/test_rpc_server.cpp index 0555b50f7..8cbc428a7 100644 --- a/deps/oblib/unittest/rpc/test_rpc_server.cpp +++ b/deps/oblib/unittest/rpc/test_rpc_server.cpp @@ -40,7 +40,7 @@ static constexpr int64_t cluster_id = 1000; static bool change_src_cluster_id = false; class TestProxy : public ObRpcProxy { - public: +public: DEFINE_TO(TestProxy); RPC_S(@PR5 test, OB_TEST_PCODE); @@ -50,7 +50,7 @@ class TestProxy : public ObRpcProxy { }; class MyProcessor : public TestProxy::Processor { - protected: +protected: int process() { static int64_t rpc_count_ = 0; @@ -73,7 +73,7 @@ class MyProcessor : public TestProxy::Processor { }; class MyProcessor2 : public TestProxy::Processor { - protected: +protected: int process() { const ObRpcPacket& pkt = dynamic_cast(req_->get_packet()); @@ -83,7 +83,7 @@ class MyProcessor2 : public TestProxy::Processor { }; class MyProcessor3 : public TestProxy::Processor { - protected: +protected: int process() { const ObRpcPacket& pkt = dynamic_cast(req_->get_packet()); @@ -99,7 +99,7 @@ class MyProcessor3 : public TestProxy::Processor { }; class ObTestDeliver : public rpc::frame::ObReqDeliver { - public: +public: int init() { return 0; @@ -163,7 +163,7 @@ class ObTestDeliver : public rpc::frame::ObReqDeliver { }; class TestRpcServer : public ::testing::Test { - public: +public: TestRpcServer() : handler_(server_), transport_(NULL) {} @@ -185,7 +185,7 @@ class TestRpcServer : public ::testing::Test { net_.stop(); } - protected: +protected: rpc::frame::ObNetEasy net_; obrpc::ObRpcHandler handler_; ObTestDeliver server_; diff --git a/deps/oblib/unittest/rpc/test_stream_rpc.cpp b/deps/oblib/unittest/rpc/test_stream_rpc.cpp index f73bf9450..e29bdea15 100644 --- a/deps/oblib/unittest/rpc/test_stream_rpc.cpp +++ b/deps/oblib/unittest/rpc/test_stream_rpc.cpp @@ -37,14 +37,14 @@ using namespace std; #define MAX_NUM 1000 class TestProxy : public ObRpcProxy { - public: +public: DEFINE_TO(TestProxy); RPC_SS(@PR5 test, OB_TEST_PCODE, (int64_t), int64_t); }; class MyProcessor : public TestProxy::Processor { - protected: +protected: int process() { int ret = OB_SUCCESS; @@ -66,7 +66,7 @@ class MyProcessor : public TestProxy::Processor { }; class QHandler : public ObiReqQHandler { - public: +public: QHandler() { mp_.init(); @@ -97,14 +97,14 @@ class QHandler : public ObiReqQHandler { return true; } - private: +private: MyProcessor mp_; ObRpcSessionHandler shandler_; ObRpcReqContext ctx_; }; class ObTestDeliver : public rpc::frame::ObReqDeliver { - public: +public: int init() { queue_.set_qhandler(&handler_); @@ -125,13 +125,13 @@ class ObTestDeliver : public rpc::frame::ObReqDeliver { queue_.get_thread().wait(); } - protected: +protected: ObReqQueueThread queue_; QHandler handler_; }; class TestRpcServer : public ::testing::Test { - public: +public: TestRpcServer() : port_(3100), handler_(server_), transport_(NULL) {} @@ -167,7 +167,7 @@ class TestRpcServer : public ::testing::Test { return transport_->send(req, res); } - protected: +protected: int port_; rpc::frame::ObNetEasy net_; obrpc::ObRpcHandler handler_; @@ -177,7 +177,7 @@ class TestRpcServer : public ::testing::Test { }; class MySSHandle : public TestProxy::SSHandle { - public: +public: void inc_sessid() { sessid_++; diff --git a/deps/oblib/unittest/rpc/test_testing.cpp b/deps/oblib/unittest/rpc/test_testing.cpp index f9c15ec4d..cc11d388a 100644 --- a/deps/oblib/unittest/rpc/test_testing.cpp +++ b/deps/oblib/unittest/rpc/test_testing.cpp @@ -17,14 +17,14 @@ using namespace oceanbase::common; using namespace oceanbase::obrpc; class TestProxy : public ObRpcProxy { - public: +public: DEFINE_TO(TestProxy); RPC_S(PR5 test, OB_TEST_PCODE, (int)); }; class Processor : public TestProxy::Processor { - public: +public: int process() { return arg_; diff --git a/deps/oblib/unittest/rpc/testing.h b/deps/oblib/unittest/rpc/testing.h index da5f4457b..82a99ad7e 100644 --- a/deps/oblib/unittest/rpc/testing.h +++ b/deps/oblib/unittest/rpc/testing.h @@ -34,7 +34,7 @@ class Service { // Deliver is the class that transfers the result of unpacking RpcHandler to the corresponding queue. Here will be // countered The deliver method of Service facilitates the integration of logic into the Service class. class Deliver : public ObReqQDeliver { - public: + public: Deliver(ObiReqQHandler& qhandler, Service& service) : ObReqQDeliver(qhandler), service_(service) {} int init() override @@ -45,24 +45,24 @@ class Service { {} int deliver(rpc::ObRequest& req) override; - private: + private: Service& service_; }; // Translator is responsible for translating an ObRequest request into the corresponding Processor. Here will // Reverse the translate method of Service, so that the logic is concentrated in the Service. class Translator : public ObReqTranslator { - public: + public: Translator(Service& service) : service_(service) {} - protected: + protected: ObReqProcessor* get_processor(ObRequest& req) override; - private: + private: Service& service_; }; - public: +public: Service(int listen_port = 33244) : easy_(), translator_(*this), @@ -95,11 +95,11 @@ class Service { template int reg_processor(Proc* p); - protected: +protected: ObReqProcessor* translate(ObRequest& req); int deliver(ObRequest& req); - private: +private: ObNetEasy easy_; Translator translator_; ObReqQHandler qhandler_; diff --git a/src/archive/ob_archive_allocator.h b/src/archive/ob_archive_allocator.h index 05c10bc5e..24e8f19ee 100644 --- a/src/archive/ob_archive_allocator.h +++ b/src/archive/ob_archive_allocator.h @@ -23,12 +23,12 @@ class ObArchiveSendTask; class ObArchiveSendTaskStatus; class ObArchiveCLogTaskStatus; class ObArchiveAllocator { - public: +public: ObArchiveAllocator(); ~ObArchiveAllocator(); int init(); - public: +public: ObPGArchiveCLogTask* alloc_clog_split_task(); void free_clog_split_task(ObPGArchiveCLogTask* task); @@ -44,7 +44,7 @@ class ObArchiveAllocator { int set_archive_batch_buffer_limit(); - private: +private: bool inited_; common::ObSmallAllocator clog_task_allocator_; common::ObConcurrentFIFOAllocator send_task_allocator_; diff --git a/src/archive/ob_archive_block.h b/src/archive/ob_archive_block.h index 73cb0e8f4..547994575 100644 --- a/src/archive/ob_archive_block.h +++ b/src/archive/ob_archive_block.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace archive { class ObArchiveBlockMeta { - public: +public: ObArchiveBlockMeta(); ~ObArchiveBlockMeta(); @@ -83,7 +83,7 @@ class ObArchiveBlockMeta { K(min_log_ts_in_file_), K(max_log_id_), K(max_checkpoint_ts_), K(max_log_submit_ts_), K(input_bytes_), K(output_bytes_), K(data_checksum_), K(meta_checksum_)); - private: +private: int generate_block_(const char* buf, const int64_t data_len); int64_t calc_data_checksum_(const char* buf, const int64_t data_len) const; int64_t calc_meta_checksum_() const; @@ -91,7 +91,7 @@ class ObArchiveBlockMeta { // 0x4142 AB means ARCHIVE BLOCK static const int16_t META_MAGIC = oceanbase::share::ObBackupFileType::BACKUP_ARCHIVE_BLOCK_META; - public: +public: static const int16_t ARCHIVE_BLOCK_VERSION = 1; //!!!!attention: remember to modify RESERVED_FOR_BLOCK when sizeof(*this) exceeds 200 int16_t magic_; diff --git a/src/archive/ob_archive_clear.h b/src/archive/ob_archive_clear.h index 0fc32225f..9d55d16c2 100644 --- a/src/archive/ob_archive_clear.h +++ b/src/archive/ob_archive_clear.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace archive { class ObArchiveClear { - public: +public: int get_clean_max_clog_file_id_by_log_id(const share::ObClusterBackupDest& dest, const int64_t archive_round, const common::ObPGKey& pg_key, const uint64_t log_id, uint64_t& index_file_id, uint64_t& data_file_id); diff --git a/src/archive/ob_archive_clog_split_engine.h b/src/archive/ob_archive_clog_split_engine.h index 2555cde33..4c0adfada 100644 --- a/src/archive/ob_archive_clog_split_engine.h +++ b/src/archive/ob_archive_clog_split_engine.h @@ -30,12 +30,12 @@ class ObArchiveSender; struct ObArchiveSendTaskStatus; class ObArCLogSplitEngine : public ObArchiveThreadPool // share::ObThreadPool { - public: +public: typedef common::SpinRWLock RWLock; typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; - public: +public: ObArCLogSplitEngine(); virtual ~ObArCLogSplitEngine(); int init(logservice::ObExtLogService* ext_log_service, ObArchiveAllocator* allocator, ObArchiveSender* archive_sender, @@ -55,12 +55,12 @@ class ObArCLogSplitEngine : public ObArchiveThreadPool // share::ObThreadPool void set_thread_name_str(char* str); int handle_task_list(ObArchiveTaskStatus* task_status); - public: +public: int submit_split_task(ObPGArchiveCLogTask* task); - private: +private: struct ObArchiveSplitStat { - public: + public: ObArchiveSplitStat() { reset(); @@ -71,7 +71,7 @@ class ObArCLogSplitEngine : public ObArchiveThreadPool // share::ObThreadPool } void reset(); - public: + public: int64_t send_task_count_; int64_t read_log_used_; int64_t read_log_size_; @@ -118,12 +118,12 @@ class ObArCLogSplitEngine : public ObArchiveThreadPool // share::ObThreadPool const int64_t compressed_data_len, ObArchiveSendTask* send_task); void statistic(const ObArchiveSplitStat& stat); - private: +private: // maybe replace these three with parameters later static const int64_t WAIT_TIME_AFTER_EAGAIN = DEFAULT_ARCHIVE_WAIT_TIME_AFTER_EAGAIN; static const int64_t MINI_MODE_SPLITER_THREAD_NUM = 1; - private: +private: RWLock rwlock_; // for log_archive_round, incarnation_ and current_round_stopped_ int64_t log_archive_round_; int64_t incarnation_; diff --git a/src/archive/ob_archive_destination_mgr.h b/src/archive/ob_archive_destination_mgr.h index a6585b584..13c3834f3 100644 --- a/src/archive/ob_archive_destination_mgr.h +++ b/src/archive/ob_archive_destination_mgr.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace archive { // simultaneous unsafe class ObArchiveDestination { - public: +public: ObArchiveDestination() { reset(); @@ -38,7 +38,7 @@ class ObArchiveDestination { const uint64_t cur_data_file_id, const int64_t data_file_offset, const uint64_t min_log_id, const int64_t min_log_ts); - public: +public: // switch file when the previous file is full or IO error occur // file id: N -> N+1 int switch_file(const common::ObPGKey& pg_key, const LogArchiveFileType file_type, const int64_t incarnation, @@ -65,10 +65,10 @@ class ObArchiveDestination { K(data_file_offset_), K(data_file_min_log_id_), K(data_file_min_log_ts_), K(force_switch_data_file_), K(force_switch_index_file_), K(is_data_file_valid_)); - private: +private: int update_file_meta_info_(const LogArchiveFileType file_type); - public: +public: bool is_inited_; bool compatible_; uint64_t cur_index_file_id_; diff --git a/src/archive/ob_archive_entry_iterator.h b/src/archive/ob_archive_entry_iterator.h index 4242fcd04..f4fa03daf 100644 --- a/src/archive/ob_archive_entry_iterator.h +++ b/src/archive/ob_archive_entry_iterator.h @@ -55,7 +55,7 @@ struct LogBufPackage { * single archive data file per iterator, start from start_offset */ class ObArchiveEntryIterator { - public: +public: ObArchiveEntryIterator(); ~ObArchiveEntryIterator() { @@ -64,7 +64,7 @@ class ObArchiveEntryIterator { void reset(); static int parse_archive_item_type(const char* buf, const int64_t len, ObArchiveItemType& type); - public: +public: int init(ObIArchiveLogFileStore* file_store, const common::ObPGKey& pg_key, const uint64_t file_id, const int64_t start_offset, const int64_t timeout, const bool need_limit_bandwidth, const uint64_t real_tenant_id = common::OB_INVALID_TENANT_ID); @@ -98,7 +98,7 @@ class ObArchiveEntryIterator { K(rbuf_), K(dd_buf_), K(origin_buf_), K(timeout_), K(io_cost_), K(io_count_), K(limit_bandwidth_cost_), K(has_load_entire_file_)); - private: +private: int prepare_buffer_(); void advance_(const int64_t step); int get_entry_type_(ObArchiveItemType& type) const; @@ -118,7 +118,7 @@ class ObArchiveEntryIterator { void fill_log_package_(char* buf, const int64_t buf_len); int fill_origin_buf_(ObArchiveBlockMeta& block_meta); - private: +private: static const int64_t MAGIC_NUM_LEN = 2; const int64_t MAX_IDLE_TIME = 10 * 1000LL * 1000LL; // 10s const int64_t MAX_READ_BUF_SIZE = MAX_ARCHIVE_BLOCK_SIZE; @@ -167,7 +167,7 @@ class ObArchiveEntryIterator { bool has_load_entire_file_; ObArchiveBlockMeta last_block_meta_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObArchiveEntryIterator); }; diff --git a/src/archive/ob_archive_file_utils.h b/src/archive/ob_archive_file_utils.h index d7498835d..ff26fb114 100644 --- a/src/archive/ob_archive_file_utils.h +++ b/src/archive/ob_archive_file_utils.h @@ -27,7 +27,7 @@ class ObIArchiveLogFileStore; class ObArchiveFileUtils { static const int64_t MAX_PATH_LENGTH = OB_MAX_ARCHIVE_PATH_LENGTH; - public: +public: // parameter below: // uri: pg archive absolute path // storage_info: authentication info @@ -86,7 +86,7 @@ class ObArchiveFileUtils { int get_max_safe_data_file_id(const ObString& uri, const ObString& storage_info, const uint64_t log_id, const int64_t log_ts, const bool by_log_id, uint64_t& data_file_id); - private: +private: int extract_file_id_(const ObString& file_name, uint64_t& file_id, bool& match); int locate_log_in_single_index_file_(const uint64_t log_id, char* data, const int64_t data_len, uint64_t& file_id, diff --git a/src/archive/ob_archive_io.h b/src/archive/ob_archive_io.h index 27b98d58c..1b8ccdb59 100644 --- a/src/archive/ob_archive_io.h +++ b/src/archive/ob_archive_io.h @@ -24,12 +24,12 @@ using namespace oceanbase::common; class ObArchiveIO { static const int64_t MAX_PATH_LENGTH = OB_MAX_ARCHIVE_PATH_LENGTH; - public: +public: ObArchiveIO(const common::ObString& storage_info); ~ObArchiveIO() {} - public: +public: int push_log(const char* path, const int64_t data_len, char* data, const bool new_file, const bool compatible, const bool is_data_file, const int64_t epoch); @@ -46,13 +46,13 @@ class ObArchiveIO { int get_max_archived_index_info(const ObPGKey& pg_key, const int64_t incarnation, const int64_t round, const uint64_t min_index_file_id, const uint64_t max_index_file_id, MaxArchivedIndexInfo& info); - private: +private: int get_file_range_(const ObPGKey& pg_key, const LogArchiveFileType file_type, const int64_t incarnation, const int64_t round, uint64_t& min_file_id, uint64_t& max_file_id); int get_append_param_(const bool is_data_file, const int64_t epoch, ObStorageAppender::AppenderParam& param); - private: +private: common::ObString storage_info_; }; diff --git a/src/archive/ob_archive_log_file_store.h b/src/archive/ob_archive_log_file_store.h index a64967a3d..1d5400771 100644 --- a/src/archive/ob_archive_log_file_store.h +++ b/src/archive/ob_archive_log_file_store.h @@ -36,11 +36,11 @@ struct ObArchiveReadParam; // used for ob_admin class ObIArchiveLogFileStore { - public: +public: ObIArchiveLogFileStore(){}; virtual ~ObIArchiveLogFileStore(){}; - public: +public: virtual int read_data_direct(const ObArchiveReadParam& param, clog::ObReadBuf& rbuf, clog::ObReadRes& res) = 0; }; @@ -48,16 +48,16 @@ class ObArchiveLogFileStore : public ObIArchiveLogFileStore { static const int64_t MAX_STORAGE_INFO_LENGTH = OB_MAX_ARCHIVE_STORAGE_INFO_LENGTH; static const int64_t MAX_PATH_LENGTH = OB_MAX_ARCHIVE_PATH_LENGTH; - public: +public: ObArchiveLogFileStore(); ~ObArchiveLogFileStore(); - public: +public: virtual int init_by_restore_info(const share::ObPhysicalRestoreInfo& restore_info); virtual int init(const char* root_path, const char* storage_info, const char* cluster_name, const int64_t cluster_id, const uint64_t tenant_id, const int64_t incarnation, const int64_t archive_round); - public: +public: // locate archive data file id by log id virtual int locate_file_by_log_id(const common::ObPGKey& pg_key, const uint64_t log_id, uint64_t& file_id); @@ -75,7 +75,7 @@ class ObArchiveLogFileStore : public ObIArchiveLogFileStore { TO_STRING_KV(K(inited_), K(storage_info_), K(restore_info_)); - private: +private: int get_file_id_range_( const common::ObPGKey& pg_key, const LogArchiveFileType file_type, uint64_t& min_file_id, uint64_t& max_file_id); @@ -112,7 +112,7 @@ class ObArchiveLogFileStore : public ObIArchiveLogFileStore { int iterate_max_archived_info_( const common::ObPGKey& pg_key, const uint64_t file_id, uint64_t& max_log_id, int64_t& max_checkpoint_ts); - private: +private: bool inited_; char storage_info_[MAX_STORAGE_INFO_LENGTH]; char base_path_[MAX_PATH_LENGTH]; diff --git a/src/archive/ob_archive_log_wrapper.h b/src/archive/ob_archive_log_wrapper.h index d55e1785c..536256baf 100644 --- a/src/archive/ob_archive_log_wrapper.h +++ b/src/archive/ob_archive_log_wrapper.h @@ -32,15 +32,15 @@ using namespace oceanbase::storage; using namespace oceanbase::clog; class ObArchiveLogWrapper { - public: +public: static const int64_t MAX_LOCATE_RETRY_TIMES = 3; - public: +public: ObArchiveLogWrapper() : inited_(false), partition_service_(NULL), log_engine_(NULL), next_ilog_file_id_(common::OB_INVALID_FILE_ID) {} - public: +public: int init(ObPartitionService* partition_service, ObILogEngine* log_engine); int query_max_ilog_file_id(file_id_t& max_ilog_id); int locate_ilog_by_log_id(const common::ObPGKey& pg_key, const uint64_t start_log_id, uint64_t& end_log_id, @@ -51,10 +51,10 @@ class ObArchiveLogWrapper { int get_pg_log_archive_status(const common::ObPGKey& pg_key, ObPGLogArchiveStatus& status); int get_pg_first_log_submit_ts(const common::ObPGKey& pg_key, int64_t& submit_ts); - private: +private: void refresh_next_ilog_file_id_(); - private: +private: bool inited_; ObPartitionService* partition_service_; ObILogEngine* log_engine_; diff --git a/src/archive/ob_archive_mgr.h b/src/archive/ob_archive_mgr.h index e2f84a638..d97cc8463 100644 --- a/src/archive/ob_archive_mgr.h +++ b/src/archive/ob_archive_mgr.h @@ -47,7 +47,7 @@ class ObArchiveMgr : public share::ObThreadPool { static const int64_t THREAD_INTERVAL = 50 * 1000L; static const int64_t CHECK_ARCHIVE_STOP_INTERVAL = 1000 * 1000L; - private: +private: // 1. archive inital status is 0 // 2. archive_mgr start archive if necessary, put all pg leader into pre_queue of pg_mgr, // then set archive status 1 @@ -75,7 +75,7 @@ class ObArchiveMgr : public share::ObThreadPool { LOG_ARCHIVE_MAX }; */ - public: +public: // status 1, 2 // pg_mgr dispatch_pg / clog_split / sender / leader_takeover add task bool is_in_archive_status() const; @@ -92,11 +92,11 @@ class ObArchiveMgr : public share::ObThreadPool { bool is_server_archive_stop(const int64_t incarnation, const int64_t round); - public: +public: ObArchiveMgr(); virtual ~ObArchiveMgr(); - public: +public: int init(clog::ObILogEngine* log_engine, logservice::ObExtLogService* ext_log_service, storage::ObPartitionService* partition_service, const common::ObAddr& addr); void destroy(); @@ -104,7 +104,7 @@ class ObArchiveMgr : public share::ObThreadPool { void stop(); void wait(); - public: +public: // interface for outer call int add_pg_log_archive_task(ObIPartitionGroup* partition); int delete_pg_log_archive_task(ObIPartitionGroup* partition); @@ -115,7 +115,7 @@ class ObArchiveMgr : public share::ObThreadPool { // occur fatal error, notify all archive modules stop int mark_encounter_fatal_err(const common::ObPartitionKey& pg_key, const int64_t incarnation, const int64_t round); - public: +public: // interface for inner call void notify_all_archive_round_started(); bool has_encounter_fatal_err(const int64_t incarnation, const int64_t round); @@ -132,7 +132,7 @@ class ObArchiveMgr : public share::ObThreadPool { return &archive_sender_; } - private: +private: int handle_start_archive_(const int64_t incarnation, const int64_t archive_round); void run1(); int init_components_(); @@ -150,7 +150,7 @@ class ObArchiveMgr : public share::ObThreadPool { int start_archive_(share::ObLogArchiveBackupInfo& info); int stop_archive_(); - private: +private: void do_thread_task_(); bool need_check_switch_archive_(); @@ -165,13 +165,13 @@ class ObArchiveMgr : public share::ObThreadPool { share::ObLogArchiveBackupInfo& info, bool& need_stop, bool& need_start, bool& need_force_stop); int check_and_set_start_archive_ts_(const int64_t incarnation, const int64_t round, int64_t& start_ts); - private: +private: bool inited_; int64_t last_check_stop_ts_; int64_t server_start_archive_tstamp_; // server start archive time - public: +public: common::ObAddr self_; ObArchiveAllocator allocator_; ObArchiveScheduler archive_scheduler_; @@ -188,7 +188,7 @@ class ObArchiveMgr : public share::ObThreadPool { logservice::ObExtLogService* ext_log_service_; storage::ObPartitionService* partition_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObArchiveMgr); }; diff --git a/src/archive/ob_archive_path.h b/src/archive/ob_archive_path.h index b58f4c009..f62f096ae 100644 --- a/src/archive/ob_archive_path.h +++ b/src/archive/ob_archive_path.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace archive { class ObArchivePathUtil { - public: +public: // oss:/backup/cluster_name/cluster_id/incarnation_1/tenant_id/clog/round/ int build_base_path(const char* root_path, const char* cluster_name, const int64_t cluster_id, const uint64_t tenant_id, const int64_t incarnantion, const int64_t archive_round, const int64_t path_buf_len, @@ -58,7 +58,7 @@ class ObArchivePathUtil { int build_server_start_archive_path(const int64_t incarnation, const int64_t round, const int64_t path_buf_len, char* dest_path, const int64_t storage_info_len, char* info); - private: +private: int build_archive_file_prefix_(const common::ObPGKey& pg_key, const LogArchiveFileType file_type, const int64_t incarnation, const int64_t round, const int64_t path_buf_len, char* dest_path, int64_t& pos); int build_file_prefix_(const common::ObPGKey& pg_key, const char* base_path, const LogArchiveFileType file_type, diff --git a/src/archive/ob_archive_pg_mgr.cpp b/src/archive/ob_archive_pg_mgr.cpp index 5e4cd919c..c5ad0c043 100644 --- a/src/archive/ob_archive_pg_mgr.cpp +++ b/src/archive/ob_archive_pg_mgr.cpp @@ -28,7 +28,7 @@ namespace oceanbase { using namespace oceanbase::common; namespace archive { class ObArchivePGMgr::CheckArchiveRoundStartFunctor { - public: +public: CheckArchiveRoundStartFunctor(const int64_t archive_round, const int64_t incarnation) : start_flag_(true), archive_round_(archive_round), incarnation_(incarnation) {} @@ -57,14 +57,14 @@ class ObArchivePGMgr::CheckArchiveRoundStartFunctor { return start_flag_; } - private: +private: bool start_flag_; int64_t archive_round_; int64_t incarnation_; }; class ObArchivePGMgr::CheckDeletePGFunctor { - public: +public: CheckDeletePGFunctor(ObArchivePGMgr* pg_mgr) : pg_mgr_(pg_mgr) {} @@ -102,7 +102,7 @@ class ObArchivePGMgr::CheckDeletePGFunctor { return true; } - private: +private: ObArchivePGMgr* pg_mgr_; }; diff --git a/src/archive/ob_archive_pg_mgr.h b/src/archive/ob_archive_pg_mgr.h index a5d272a1f..c217c519e 100644 --- a/src/archive/ob_archive_pg_mgr.h +++ b/src/archive/ob_archive_pg_mgr.h @@ -39,17 +39,17 @@ class ObArchiveMgr; class ObArchiveRoundMgr; class StartArchiveHelper; class ObArchivePGMgr : public share::ObThreadPool { - public: +public: static const int64_t THREAD_RUN_INTERVAL = 1 * 1000 * 1000L; static const int64_t RECONFIRM_PG_INTERVAL = 30 * 1000 * 1000L; static const int64_t PG_MGR_QUEUE_SIZE = 5; static const int64_t PG_MGR_THREAD_COUNT = PG_MGR_QUEUE_SIZE; - public: +public: ObArchivePGMgr(); virtual ~ObArchivePGMgr(); - public: +public: int init(ObArchiveAllocator* allocator, ObArchiveLogWrapper* log_wrapper, ObPartitionService* partition_service, ObArchiveRoundMgr* archive_round_mgr, ObArchiveMgr* archive_mgr); void destroy(); @@ -59,10 +59,10 @@ class ObArchivePGMgr : public share::ObThreadPool { int reset_tasks(); void clear_archive_info(); - private: +private: void run1(); - public: +public: int add_pg_archive_task(ObIPartitionGroup* partition, bool& is_added); int add_all_pg_on_start_archive_task(const int64_t incarnation, const int64_t archive_round); int delete_pg_archive_task(ObIPartitionGroup* partition); @@ -88,7 +88,7 @@ class ObArchivePGMgr : public share::ObThreadPool { return pg_map_.count(); } - private: +private: void do_thread_task_(); bool need_dispatch_pg_(); bool need_confirm_pg_(); @@ -121,11 +121,11 @@ class ObArchivePGMgr : public share::ObThreadPool { int push_pre_task_(const ObPGKey& pg_key, ObLink* link); int64_t thread_index_(); - private: +private: class CheckDeletePGFunctor; class CheckArchiveRoundStartFunctor; - private: +private: bool inited_; int64_t thread_counter_; int64_t log_archive_round_; @@ -144,12 +144,12 @@ class ObArchivePGMgr : public share::ObThreadPool { ObArchiveMgr* archive_mgr_; ObPartitionService* partition_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObArchivePGMgr); }; class PreArchiveLinkedPGKey : public common::ObLink { - public: +public: PreArchiveLinkedPGKey() { reset(); @@ -163,7 +163,7 @@ class PreArchiveLinkedPGKey : public common::ObLink { void reset(); TO_STRING_KV(K(pg_key_), K(type_), K(epoch_), K(takeover_ts_), K(create_timestamp_), K(retry_times_)); - public: +public: ObPGKey pg_key_; bool type_; // add task true, del task false int64_t epoch_; @@ -171,7 +171,7 @@ class PreArchiveLinkedPGKey : public common::ObLink { int64_t create_timestamp_; uint64_t retry_times_; - private: +private: DISALLOW_COPY_AND_ASSIGN(PreArchiveLinkedPGKey); }; diff --git a/src/archive/ob_archive_restore_engine.h b/src/archive/ob_archive_restore_engine.h index cb499c8e7..e876df775 100644 --- a/src/archive/ob_archive_restore_engine.h +++ b/src/archive/ob_archive_restore_engine.h @@ -40,7 +40,7 @@ class ObPartitionService; namespace archive { class ObPGArchiveRestoreTask : public common::ObLink { - public: +public: ObPGArchiveRestoreTask() { reset(); @@ -55,7 +55,7 @@ class ObPGArchiveRestoreTask : public common::ObLink { void reset(); void switch_file(); - public: +public: int locate_file_range(); bool is_finished() const; bool is_expired() const @@ -156,7 +156,7 @@ class ObPGArchiveRestoreTask : public common::ObLink { }; int reconfirm_fetch_log_result(); - public: +public: TO_STRING_KV(K(restore_pg_key_), K(archive_pg_key_), K(is_expired_), K(has_located_file_range_), K(start_log_id_), K(start_log_ts_), K(end_snapshot_version_), K(leader_takeover_ts_), K(last_fetched_log_id_), K(last_checkpoint_ts_), K(last_fetched_log_submit_ts_), K(cur_offset_), K(cur_log_file_id_), K(end_log_file_id_), @@ -164,10 +164,10 @@ class ObPGArchiveRestoreTask : public common::ObLink { K(io_fail_cnt_), // Number of consecutive IO failures K(fetch_log_result_)); - private: +private: int locate_start_file_id_(uint64_t& start_file_id); - private: +private: common::ObPGKey restore_pg_key_; // restore partition pkey common::ObPGKey archive_pg_key_; // archive partition pkey, pure key same as restore partition and tenant_id is // different @@ -190,7 +190,7 @@ class ObPGArchiveRestoreTask : public common::ObLink { }; class ObArchiveRestoreEngine : public common::ObSimpleThreadPool { - public: +public: ObArchiveRestoreEngine() : is_inited_(false), is_stopped_(true), @@ -208,23 +208,23 @@ class ObArchiveRestoreEngine : public common::ObSimpleThreadPool { } virtual int init(storage::ObPartitionService* partition_service); - public: +public: virtual void stop(); virtual void wait(); virtual void destroy(); virtual void handle(void* task); - public: +public: int submit_restore_task( common::ObPartitionKey& pg_key, uint64_t start_log_id, int64_t start_log_ts, int64_t leader_takeover_ts); int try_advance_restoring_clog(); - public: +public: typedef common::ObIntWarp ObTenantID; typedef common::LinkHashNode RestoreMetaNode; typedef common::LinkHashValue RestoreMetaValue; class TenantRestoreMeta : public RestoreMetaValue { - public: + public: TenantRestoreMeta() : is_inited_(false), cur_restore_concurrency_(0), @@ -276,10 +276,10 @@ class ObArchiveRestoreEngine : public common::ObSimpleThreadPool { } TO_STRING_KV(K_(restore_info), K_(file_store), K(cur_restore_concurrency_), K(restore_concurrency_threshold_)); - public: + public: static const int64_t DEFAULT_RESTORE_CONCURRENCY_THRESHOLD = 4; - private: + private: bool is_inited_; int64_t cur_restore_concurrency_; // concurrency of pg restore tasks int64_t restore_concurrency_threshold_; // the upper limit of the concurrency of pg restore tasks @@ -316,7 +316,7 @@ class ObArchiveRestoreEngine : public common::ObSimpleThreadPool { } struct ObPhysicalRestoreCLogStat { - public: + public: ObPhysicalRestoreCLogStat() { reset(); @@ -327,7 +327,7 @@ class ObArchiveRestoreEngine : public common::ObSimpleThreadPool { } void reset(); - public: + public: int64_t retry_sleep_interval_; // sleep time before retry int64_t fetch_log_entry_count_; // fetch log entry count int64_t fetch_log_entry_cost_; // fetch log entry time cost @@ -337,7 +337,7 @@ class ObArchiveRestoreEngine : public common::ObSimpleThreadPool { int64_t total_cost_; // total time cost }; - private: +private: bool need_retry_ret_code_(const int ret); bool is_io_fail_ret_code_(const int ret); int get_tenant_restore_meta_(const uint64_t tenant_id, TenantRestoreMeta*& restore_meta); @@ -354,7 +354,7 @@ class ObArchiveRestoreEngine : public common::ObSimpleThreadPool { void revert_tenant_restore_meta_(TenantRestoreMeta*& restore_meta); void statistic_(const ObPhysicalRestoreCLogStat& inc_stat); - private: +private: typedef common::ObLinkHashMap TenantRestoreMetaMap; const int64_t MAX_FETCH_LOG_IO_FAIL_CNT = 5; const int64_t TASK_NUM_LIMIT = 1000000; diff --git a/src/archive/ob_archive_round_mgr.h b/src/archive/ob_archive_round_mgr.h index 9d95b0dfe..5019d973f 100644 --- a/src/archive/ob_archive_round_mgr.h +++ b/src/archive/ob_archive_round_mgr.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace archive { class ObArchiveRoundMgr { - public: +public: ObArchiveRoundMgr(); ~ObArchiveRoundMgr(); @@ -35,7 +35,7 @@ class ObArchiveRoundMgr { LOG_ARCHIVE_MAX }; - public: +public: int init(); void destroy(); int64_t get_current_archive_round() @@ -87,7 +87,7 @@ class ObArchiveRoundMgr { typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; - public: +public: // true afterall partitions archive kickoff log, then archive data bool add_pg_finish_; @@ -108,7 +108,7 @@ class ObArchiveRoundMgr { LogArchiveStatus log_archive_status_; RWLock rwlock_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObArchiveRoundMgr); }; } // namespace archive diff --git a/src/archive/ob_archive_scheduler.h b/src/archive/ob_archive_scheduler.h index 026129e3c..00f332503 100644 --- a/src/archive/ob_archive_scheduler.h +++ b/src/archive/ob_archive_scheduler.h @@ -21,22 +21,22 @@ class ObArCLogSplitEngine; class ObArchiveSender; class ObArchiveAllocator; class ObArchiveScheduler : public share::ObThreadPool { - public: +public: ObArchiveScheduler(); ~ObArchiveScheduler(); - public: +public: int init(ObArchiveAllocator* archive_allocator, ObArCLogSplitEngine* clog_split_eg, ObArchiveSender* sender); void destroy(); int start(); void stop(); void wait(); - private: +private: void run1(); void do_thread_task_(); - private: +private: bool inited_; bool stop_flag_; diff --git a/src/archive/ob_archive_sender.h b/src/archive/ob_archive_sender.h index 2185642ba..e5e7764a4 100644 --- a/src/archive/ob_archive_sender.h +++ b/src/archive/ob_archive_sender.h @@ -27,7 +27,7 @@ class ObArchiveMgr; struct ObArchiveSendTaskStatus; typedef common::ObSEArray SendTaskArray; class ObArchiveSender : public ObArchiveThreadPool { - public: +public: // Thread num in mini mode static const int64_t MINI_MODE_SENDER_THREAD_NUM = 1; @@ -43,11 +43,11 @@ class ObArchiveSender : public ObArchiveThreadPool { static const int64_t MAX_CONVERGE_TASK_COUNT = 20 * 1000; static const int64_t MAX_CONVERGE_TASK_SIZE = 8 * 1024 * 1024L; - public: +public: ObArchiveSender(); ~ObArchiveSender(); - public: +public: int start(); void stop(); void wait(); @@ -70,7 +70,7 @@ class ObArchiveSender : public ObArchiveThreadPool { void set_thread_name_str(char* str); int handle_task_list(ObArchiveTaskStatus* task_status); - private: +private: bool is_io_error_(const int ret_code); bool is_not_leader_error_(const int ret_code); @@ -119,7 +119,7 @@ class ObArchiveSender : public ObArchiveThreadPool { typedef common::SpinRWLock RWLock; typedef common::SpinWLockGuard WLockGuard; - private: +private: int64_t log_archive_round_; int64_t incarnation_; diff --git a/src/archive/ob_archive_task_queue.h b/src/archive/ob_archive_task_queue.h index 7e05d289e..1a5b16a37 100644 --- a/src/archive/ob_archive_task_queue.h +++ b/src/archive/ob_archive_task_queue.h @@ -28,7 +28,7 @@ class ObArchiveThreadPool; // partition archive task management // single consumer model struct ObArchiveTaskStatus : common::ObLink { - public: +public: ObArchiveTaskStatus(); virtual ~ObArchiveTaskStatus(); int64_t count(); @@ -42,10 +42,10 @@ struct ObArchiveTaskStatus : common::ObLink { VIRTUAL_TO_STRING_KV(K(issue_), K(ref_), K(num_), K(pg_key_)); - private: +private: int retire_unlock(bool& is_discarded); - protected: +protected: bool issue_; // flag of task status in global queue or not int64_t ref_; int64_t num_; // num of this pg's total tasks @@ -57,7 +57,7 @@ struct ObArchiveTaskStatus : common::ObLink { // Partition Send Task Status // clog_splitter produce, sender consume struct ObArchiveSendTaskStatus : public ObArchiveTaskStatus { - public: +public: ObArchiveSendTaskStatus(const common::ObPGKey& pg_key); ~ObArchiveSendTaskStatus(); @@ -70,7 +70,7 @@ struct ObArchiveSendTaskStatus : public ObArchiveTaskStatus { void clear_error_info(); INHERIT_TO_STRING_KV("ObArchiveTaskStatus", ObArchiveTaskStatus, K(error_occur_timestamp_)); - private: +private: // first IO error occur timestamp when adjoint IO errors occur, reset when success int64_t error_occur_timestamp_; // IO error count when adjoint IO errors occur, reset when success @@ -80,11 +80,11 @@ struct ObArchiveSendTaskStatus : public ObArchiveTaskStatus { // Partition Clog Split Task Status // ilog_fetcher produce, clog_splitter consume struct ObArchiveCLogTaskStatus : public ObArchiveTaskStatus { - public: +public: ObArchiveCLogTaskStatus(const common::ObPGKey& pg_key); ~ObArchiveCLogTaskStatus(); - public: +public: int push(ObPGArchiveCLogTask& task, ObArchiveThreadPool& worker); }; diff --git a/src/archive/ob_archive_thread_pool.h b/src/archive/ob_archive_thread_pool.h index 500cccb9d..52a450e22 100644 --- a/src/archive/ob_archive_thread_pool.h +++ b/src/archive/ob_archive_thread_pool.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace archive { class ObArchiveTaskStatus; class ObArchiveThreadPool : public share::ObThreadPool { - public: +public: ObArchiveThreadPool(); ~ObArchiveThreadPool(); @@ -31,16 +31,16 @@ class ObArchiveThreadPool : public share::ObThreadPool { int push_task_status(ObArchiveTaskStatus* task_status); void destroy(); - public: +public: virtual int64_t cal_work_thread_num() = 0; virtual void set_thread_name_str(char* str) = 0; virtual int handle_task_list(ObArchiveTaskStatus* status) = 0; - private: +private: void run1(); void do_thread_task_(); - protected: +protected: bool inited_; bool round_stop_flag_; int64_t total_task_count_; diff --git a/src/archive/ob_archive_util.h b/src/archive/ob_archive_util.h index 31fad77a2..fb481d842 100644 --- a/src/archive/ob_archive_util.h +++ b/src/archive/ob_archive_util.h @@ -92,7 +92,7 @@ struct SimpleQueue { common::ObLink* head_; common::ObLink* tail_; - public: +public: SimpleQueue() : head_(NULL), tail_(NULL) {} ~SimpleQueue() @@ -101,7 +101,7 @@ struct SimpleQueue { tail_ = NULL; } - public: +public: bool is_empty() { return NULL == head_ && NULL == tail_; diff --git a/src/archive/ob_ilog_fetch_task_mgr.h b/src/archive/ob_ilog_fetch_task_mgr.h index 437283878..b0322e2ce 100644 --- a/src/archive/ob_ilog_fetch_task_mgr.h +++ b/src/archive/ob_ilog_fetch_task_mgr.h @@ -24,7 +24,7 @@ namespace archive { using oceanbase::clog::file_id_t; class ObArchiveAllocator; struct PGFetchTask { - public: +public: explicit PGFetchTask(); ~PGFetchTask(); bool is_valid(); @@ -34,7 +34,7 @@ struct PGFetchTask { TO_STRING_KV(K(pg_key_), K(incarnation_), K(archive_round_), K(epoch_), K(start_log_id_), K(ilog_file_id_), K(clog_task_), K(clog_size_), K(clog_count_), K(first_log_gen_tstamp_)); - public: +public: // start_log_id = max_log_id + 1, this log maybe not exist common::ObPGKey pg_key_; int64_t incarnation_; @@ -50,11 +50,11 @@ struct PGFetchTask { }; class IlogPGFetchQueue { - public: +public: IlogPGFetchQueue(ObArchiveAllocator& allocator); ~IlogPGFetchQueue(); - public: +public: int push_task(PGFetchTask& task); int pop_task(PGFetchTask& task); void set_ilog_file_id(const file_id_t ilog_file_id); @@ -66,7 +66,7 @@ class IlogPGFetchQueue { TO_STRING_KV(K(ilog_file_id_), K(next_), K(pg_array_)); typedef common::ObSEArray PGArray; - private: +private: file_id_t ilog_file_id_; IlogPGFetchQueue* next_; ObArchiveAllocator& allocator_; @@ -74,30 +74,30 @@ class IlogPGFetchQueue { }; class ObArchiveIlogFetchTaskMgr { - public: +public: static const int64_t ILOG_FETCH_WAIT_INTERVAL = 100 * 1000L; typedef SimpleSortList IlogPGFetchQueueList; typedef common::SpinRWLock RWLock; typedef common::SpinWLockGuard WLockGuard; typedef common::SpinRLockGuard RLockGuard; - public: +public: ObArchiveIlogFetchTaskMgr(); ~ObArchiveIlogFetchTaskMgr(); - public: +public: int init(ObArchiveAllocator* allocator); void reset(); int destroy(); - public: +public: int add_ilog_fetch_task(PGFetchTask& task); int pop_ilog_fetch_task(PGFetchTask& task, bool& exist_task); int64_t get_alloc_size(); - private: +private: int generate_cur_ilog_fetch_mgr_(); void destroy_task_list_(); // locate ilog pg queue, return the pre one if the queue not exist @@ -106,7 +106,7 @@ class ObArchiveIlogFetchTaskMgr { int handle_add_task_with_ilog_not_exist_(PGFetchTask& task, IlogPGFetchQueue* location); int pop_ilog_fetch_task_(PGFetchTask& task, bool& exist_task, bool& new_ilog_file); - private: +private: bool stop_flag_; int64_t ilog_count_; IlogPGFetchQueue* cur_ilog_fetch_queue_; diff --git a/src/archive/ob_ilog_fetcher.h b/src/archive/ob_ilog_fetcher.h index cbdd6aae7..b2ec89d41 100644 --- a/src/archive/ob_ilog_fetcher.h +++ b/src/archive/ob_ilog_fetcher.h @@ -35,11 +35,11 @@ class ObArchiveIlogFetcher : public share::ObThreadPool { static const int64_t ARCHIVE_ILOG_FETCHER_NUM = 1; static const int64_t WAIT_TIME_AFTER_EAGAIN = 100; - public: +public: ObArchiveIlogFetcher(); virtual ~ObArchiveIlogFetcher(); - public: +public: int start(); void stop(); void wait(); @@ -47,7 +47,7 @@ class ObArchiveIlogFetcher : public share::ObThreadPool { ObArchivePGMgr* pg_mgr, ObArCLogSplitEngine* clog_split_engine, ObArchiveIlogFetchTaskMgr* ilog_fetch_mgr); void destroy(); - public: +public: int build_archive_clog_task(const uint64_t start_log_id, ObGetCursorResult& cursor_result, ObPGArchiveCLogTask& task, PGFetchTask& fetch_task); void notify_start_archive_round(); @@ -61,7 +61,7 @@ class ObArchiveIlogFetcher : public share::ObThreadPool { int set_archive_round_info(const int64_t round, const int64_t incarnation); void clear_archive_info(); - private: +private: struct IlogPGClogTask; void run1(); void do_thread_task_(); @@ -97,7 +97,7 @@ class ObArchiveIlogFetcher : public share::ObThreadPool { void mark_fatal_error_( const ObPGKey& pg_key, const int64_t epoch, const int64_t incarnation, const int64_t round, const int ret_code); - private: +private: bool inited_; bool start_flag_; int64_t log_archive_round_; @@ -112,7 +112,7 @@ class ObArchiveIlogFetcher : public share::ObThreadPool { ObArchiveAllocator* allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObArchiveIlogFetcher); }; diff --git a/src/archive/ob_log_archive_struct.h b/src/archive/ob_log_archive_struct.h index 116f09c36..21d9ebf4e 100644 --- a/src/archive/ob_log_archive_struct.h +++ b/src/archive/ob_log_archive_struct.h @@ -28,7 +28,7 @@ namespace archive { //================ start of structs for backup============// struct ObArchiveReadBuf { - public: +public: ObArchiveReadBuf() { reset(); @@ -48,14 +48,14 @@ struct ObArchiveReadBuf { } TO_STRING_KV(K(data_len_)); - public: +public: static const int64_t CLOG_BUF_SIZE = common::OB_MAX_LOG_BUFFER_SIZE; int64_t data_len_; char buf_[CLOG_BUF_SIZE]; }; struct ObArchiveLogCursor { - public: +public: ObArchiveLogCursor() { reset(); @@ -115,7 +115,7 @@ struct ObArchiveLogCursor { TO_STRING_KV( K_(file_id), K_(offset), K_(size), K_(is_batch_committed), K_(log_id), K_(log_submit_ts), K_(accum_checksum)); - public: +public: file_id_t file_id_; offset_t offset_; int32_t size_; @@ -126,7 +126,7 @@ struct ObArchiveLogCursor { }; struct ObArchiveRoundStartInfo { - public: +public: ObArchiveRoundStartInfo() { reset(); @@ -138,11 +138,11 @@ struct ObArchiveRoundStartInfo { void reset(); bool is_valid() const; - public: +public: TO_STRING_KV( K(start_ts_), K(start_log_id_), K(snapshot_version_), K(log_submit_ts_), K(clog_epoch_id_), K(accum_checksum_)); - public: +public: int64_t start_ts_; // round_start_ts_ uint64_t start_log_id_; // round_start_log_id_ int64_t snapshot_version_; @@ -152,7 +152,7 @@ struct ObArchiveRoundStartInfo { }; struct ObPGArchiveCLogTask : public common::ObLink { - public: +public: ObPGArchiveCLogTask() : read_buf_(NULL) { reset(); @@ -173,7 +173,7 @@ struct ObPGArchiveCLogTask : public common::ObLink { ; } - public: +public: clog::ObLogType get_log_type() const; int64_t get_clog_count() const { @@ -221,7 +221,7 @@ struct ObPGArchiveCLogTask : public common::ObLink { K_(log_submit_ts), K_(clog_epoch_id), K_(accum_checksum), K_(processed_log_count), K_(incarnation), K_(log_archive_round), K_(task_type), K_(compressor_type), K_(pg_key), K_(clog_pos_list)); - public: +public: int64_t epoch_id_; bool need_update_log_ts_; union { @@ -258,7 +258,7 @@ struct ObPGArchiveCLogTask : public common::ObLink { }; struct ObArchiveSendTaskMeta { - public: +public: ObArchiveSendTaskMeta() { reset(); @@ -270,7 +270,7 @@ struct ObArchiveSendTaskMeta { virtual void reset(); int assign(const ObArchiveSendTaskMeta& other); - public: +public: virtual bool is_valid() const; int64_t get_data_len() const { @@ -289,7 +289,7 @@ struct ObArchiveSendTaskMeta { K_(log_archive_round), K_(start_log_id), K_(start_log_ts), K_(end_log_id), K_(end_log_submit_ts), K_(checkpoint_ts), K_(pos), K_(block_meta)); - public: +public: // attention!!!!:do not forget to modify assign() when adding new members common::ObPGKey pg_key_; ObLogArchiveContentType task_type_; @@ -311,7 +311,7 @@ struct ObArchiveSendTaskMeta { }; struct ObTSIArchiveReadBuf : public ObArchiveSendTaskMeta { - public: +public: ObTSIArchiveReadBuf() { reset(); @@ -322,7 +322,7 @@ struct ObTSIArchiveReadBuf : public ObArchiveSendTaskMeta { } void reset_log_related_info(); - public: +public: int64_t get_buf_len() const { return READ_BUF_SIZE; @@ -336,14 +336,14 @@ struct ObTSIArchiveReadBuf : public ObArchiveSendTaskMeta { return buf_; } - private: +private: // max size of each clog read static const int64_t READ_BUF_SIZE = common::OB_MAX_LOG_BUFFER_SIZE; char buf_[READ_BUF_SIZE]; }; struct ObTSIArchiveCompressBuf { - public: +public: ObTSIArchiveCompressBuf() { reset(); @@ -357,7 +357,7 @@ struct ObTSIArchiveCompressBuf { pos_ = 0; } - public: +public: int64_t get_buf_len() const { return COMPRESSED_BUF_SIZE; @@ -375,7 +375,7 @@ struct ObTSIArchiveCompressBuf { return pos_; } - public: +public: static const int64_t MAX_COMPRESS_OVERFLOW_SIZE = 20 * 1024L; // 20K reserved static const int64_t COMPRESSED_BUF_SIZE = common::OB_MAX_LOG_BUFFER_SIZE + MAX_COMPRESS_OVERFLOW_SIZE; int64_t pos_; @@ -383,7 +383,7 @@ struct ObTSIArchiveCompressBuf { }; struct ObArchiveSendTask : public ObArchiveSendTaskMeta, public common::ObLink { - public: +public: ObArchiveSendTask() { reset(); @@ -394,7 +394,7 @@ struct ObArchiveSendTask : public ObArchiveSendTaskMeta, public common::ObLink { } void reset(); - public: +public: bool has_enough_space(const int64_t data_size) const; int assign_meta(const ObTSIArchiveReadBuf& send_buf); bool is_valid() const @@ -419,14 +419,14 @@ struct ObArchiveSendTask : public ObArchiveSendTaskMeta, public common::ObLink { } INHERIT_TO_STRING_KV("ObArchiveSendTaskMeta", ObArchiveSendTaskMeta, K_(archive_data_len), K_(buf_len), KP(buf_)); - public: +public: int64_t buf_len_; int64_t archive_data_len_; // data len if archive block char* buf_; }; struct ObArchiveIndexFileInfo { - public: +public: ObArchiveIndexFileInfo() { reset(); @@ -447,14 +447,14 @@ struct ObArchiveIndexFileInfo { K(round_snapshot_version_), K(round_log_submit_ts_), K(round_clog_epoch_id_), K(round_accum_checksum_), K(checksum_)); - private: +private: int64_t calc_checksum_() const; - public: +public: static const int16_t MAGIC_NUM = share::ObBackupFileType::BACKUP_ARCHIVE_INDEX_FILE; // AI means ARCHIVE INDEX static const int16_t INDEX_FILE_VERSION = 1; - public: +public: int16_t magic_; int16_t record_len_; int16_t version_; @@ -486,7 +486,7 @@ struct ObArchiveIndexFileInfo { }; struct MaxArchivedIndexInfo { - public: +public: MaxArchivedIndexInfo(); ~MaxArchivedIndexInfo(); void reset(); @@ -515,7 +515,7 @@ struct MaxArchivedIndexInfo { }; struct ObArchiveStartTimestamp { - public: +public: ObArchiveStartTimestamp() : archive_round_(-1), timestamp_(-1), checksum_(0) {} int set(const int64_t archive_round, const int64_t timestamp); @@ -523,17 +523,17 @@ struct ObArchiveStartTimestamp { NEED_SERIALIZE_AND_DESERIALIZE; TO_STRING_KV(K(archive_round_), K(timestamp_), K(checksum_)); - private: +private: int64_t calc_checksum_() const; - public: +public: int64_t archive_round_; int64_t timestamp_; int64_t checksum_; }; class ObArchiveCompressedChunkHeader { - public: +public: ObArchiveCompressedChunkHeader() { reset(); @@ -544,7 +544,7 @@ class ObArchiveCompressedChunkHeader { } void reset(); - public: +public: bool is_valid() const; int generate_header( const common::ObCompressorType compressor_type, const int32_t orig_data_len, const int32_t compress_data_len); @@ -580,10 +580,10 @@ class ObArchiveCompressedChunkHeader { return ARCHIVE_COMPRESSED_CHUNK_MAGIC == magic_number; } - private: +private: static const int16_t ARCHIVE_COMPRESSED_CHUNK_MAGIC = 0x4343; // CC means compressed chunk static const int16_t ARCHIVE_COMPRESSED_CHUNK_VERSION = 1; // for compat - private: +private: int16_t magic_; // COMPRESSED_LOG_CHUNK_MAGIC int16_t version_; // for compactibility common::ObCompressorType compressor_type_; @@ -593,12 +593,12 @@ class ObArchiveCompressedChunkHeader { }; class ObArchiveCompressedChunk { - public: +public: ObArchiveCompressedChunk() : header_(), buf_(NULL) {} virtual ~ObArchiveCompressedChunk(); - public: +public: const ObArchiveCompressedChunkHeader& get_header() const { return header_; @@ -610,10 +610,10 @@ class ObArchiveCompressedChunk { TO_STRING_KV(K(header_)); NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObArchiveCompressedChunk); - private: +private: ObArchiveCompressedChunkHeader header_; const char* buf_; }; @@ -639,7 +639,7 @@ struct ObArchiveReadParam { void reset(); TO_STRING_KV(K(pg_key_), K(file_id_), K(offset_), K(read_len_), K(timeout_)); - private: +private: static const int64_t OB_ARCHIVE_READ_TIMEOUT = 5000000; // 5s }; diff --git a/src/archive/ob_pg_archive_task.h b/src/archive/ob_pg_archive_task.h index 51b1cdb0d..fedf21fdd 100644 --- a/src/archive/ob_pg_archive_task.h +++ b/src/archive/ob_pg_archive_task.h @@ -34,7 +34,7 @@ class StartArchiveHelper; class ObArchiveThreadPool; typedef common::LinkHashValue PGArchiveTaskValue; class ObPGArchiveTask : public PGArchiveTaskValue { - public: +public: ObPGArchiveTask(); ~ObPGArchiveTask(); @@ -42,10 +42,10 @@ class ObPGArchiveTask : public PGArchiveTaskValue { typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; - public: +public: int init(StartArchiveHelper& helper, ObArchiveAllocator* allocator); - public: +public: ObPGKey get_pg_key() { return pg_key_; @@ -126,12 +126,12 @@ class ObPGArchiveTask : public PGArchiveTaskValue { K(fetcher_max_split_log_id_), K(last_split_log_id_), K(last_split_log_submit_ts_), K(last_split_checkpoint_ts_), K(mandatory_), K(archive_destination_), K(pg_key_)); - private: +private: void destroy(); void update_unlock_(StartArchiveHelper& helper); void free_task_status_(); - private: +private: bool pg_been_deleted_; bool is_first_record_finish_; bool has_encount_error_; @@ -167,29 +167,29 @@ class ObPGArchiveTask : public PGArchiveTaskValue { ObArchiveAllocator* allocator_; mutable RWLock rwlock_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPGArchiveTask); }; class ObPGArchiveTaskGuard final { - public: +public: explicit ObPGArchiveTaskGuard(ObArchivePGMgr* pg_mgr); ~ObPGArchiveTaskGuard(); - public: +public: void set_pg_archive_task(ObPGArchiveTask* pg_archive_task); ObPGArchiveTask* get_pg_archive_task(); TO_STRING_KV(KPC(pg_archive_task_)); - private: +private: void revert_pg_archive_task_(); - private: +private: ObPGArchiveTask* pg_archive_task_; ObArchivePGMgr* pg_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPGArchiveTaskGuard); }; diff --git a/src/archive/ob_start_archive_helper.h b/src/archive/ob_start_archive_helper.h index ba1356dd1..8bf732be4 100644 --- a/src/archive/ob_start_archive_helper.h +++ b/src/archive/ob_start_archive_helper.h @@ -27,7 +27,7 @@ namespace archive { class ObArchiveLogWrapper; class ObArchiveMgr; struct ObMaxArchivedLogInfo { - public: +public: ObMaxArchivedLogInfo() { reset(); @@ -40,7 +40,7 @@ struct ObMaxArchivedLogInfo { TO_STRING_KV(K_(max_log_id_archived), K_(max_checkpoint_ts_archived), K_(max_log_submit_ts_archived), K_(clog_epoch_id), K_(accum_checksum)); - public: +public: uint64_t max_log_id_archived_; // max archived log id int64_t max_checkpoint_ts_archived_; // max archived checkpoint ts int64_t max_log_submit_ts_archived_; // max archived log ts @@ -51,14 +51,14 @@ struct ObMaxArchivedLogInfo { class StartArchiveHelper { static const int64_t MAX_FILE_PATH = OB_MAX_ARCHIVE_PATH_LENGTH; - public: +public: StartArchiveHelper(const common::ObPGKey& pg_key, const int64_t timestamp, const int64_t incarnation, const int64_t archive_round, const int64_t epoch, const int64_t takeover_ts, const bool compatible, const int64_t start_archive_ts, common::ObString& uri, common::ObString& storage_info, ObArchiveLogWrapper& log_wrapper, ObArchiveMgr& archive_mgr); ~StartArchiveHelper(); - public: +public: bool is_valid(); int handle(); bool check_query_info_ready(); @@ -68,7 +68,7 @@ class StartArchiveHelper { K(min_log_id_unrecorded_), K(min_log_ts_unrecorded_), K(max_log_id_unrecorded_), K(max_checkpoint_ts_unrecorded_), K(max_log_submit_ts_unrecorded_), K(exist_log_)); - private: +private: int handle_pg_start_archive_(); int confirm_start_log_exist_(); int locate_pg_start_ilog_id_(); @@ -100,7 +100,7 @@ class StartArchiveHelper { int decide_start_log_id_on_beginning_(); int decide_start_log_id_on_doing_(); - public: +public: bool success_; common::ObPGKey pg_key_; bool need_kickoff_log_; diff --git a/src/clog/ob_archive_log_fetcher.h b/src/clog/ob_archive_log_fetcher.h index 0880ae558..4d21a2815 100644 --- a/src/clog/ob_archive_log_fetcher.h +++ b/src/clog/ob_archive_log_fetcher.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace logservice { class ObArchiveLogFetcher : public ObLogFetcherImpl { - public: +public: ObArchiveLogFetcher() {} ~ObArchiveLogFetcher() diff --git a/src/clog/ob_batch_buffer.cpp b/src/clog/ob_batch_buffer.cpp index d72462d6d..07a6c9ed2 100644 --- a/src/clog/ob_batch_buffer.cpp +++ b/src/clog/ob_batch_buffer.cpp @@ -69,7 +69,7 @@ ObBatchBuffer::IncPos& ObBatchBuffer::IncPos::next_block() } class ObBatchBuffer::Block : public ObIBatchBufferTask { - public: +public: Block(ObBatchBuffer& host, int64_t seq, char* buf, int64_t block_count, bool auto_freeze) : host_(host), seq_(seq), @@ -96,7 +96,7 @@ class ObBatchBuffer::Block : public ObIBatchBufferTask { } void reuse(); - private: +private: ObBatchBuffer& host_; int64_t seq_; int64_t status_seq_; diff --git a/src/clog/ob_batch_buffer.h b/src/clog/ob_batch_buffer.h index 27aef27a7..e58ad6c0c 100644 --- a/src/clog/ob_batch_buffer.h +++ b/src/clog/ob_batch_buffer.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace clog { class ObLogWriterWrapper; class ObBatchBuffer : public ObIBufferConsumer { - public: +public: ObBatchBuffer(); virtual ~ObBatchBuffer(); @@ -31,9 +31,9 @@ class ObBatchBuffer : public ObIBufferConsumer { void update_next_flush_block_id(const int64_t block_id); bool is_all_consumed() const; - private: +private: class IncPos { - public: + public: IncPos() : seq_(0), offset_(0), entry_cnt_(0) {} ~IncPos() @@ -54,12 +54,12 @@ class ObBatchBuffer : public ObIBufferConsumer { } __attribute__((__aligned__(16))); class Block; - private: +private: int wait_block(const int64_t block_id); Block* get_block(const int64_t block_id); int fill_buffer(const IncPos cur_pos, ObIBufferTask* task); - private: +private: bool is_inited_; ObIBatchBufferConsumer* handler_; Block* block_array_; diff --git a/src/clog/ob_batch_packet.h b/src/clog/ob_batch_packet.h index 768e8d7b6..caabd3c82 100644 --- a/src/clog/ob_batch_packet.h +++ b/src/clog/ob_batch_packet.h @@ -23,7 +23,7 @@ class ObAddr; namespace clog { // count | partition_id pcode len content | partition_id pcode len content | ... class ObBatchPacketCodec { - public: +public: static int64_t get_batch_header_size(); static int64_t get_packet_header_size(); static int encode_batch_header(char* buf, const int64_t len, int64_t& pos, const int64_t timestamp, diff --git a/src/clog/ob_batch_submit_ctx.h b/src/clog/ob_batch_submit_ctx.h index b0b195253..eb93e8c9b 100644 --- a/src/clog/ob_batch_submit_ctx.h +++ b/src/clog/ob_batch_submit_ctx.h @@ -37,7 +37,7 @@ typedef common::LinkHashNode BatchSubmitCtxHashNode; typedef common::LinkHashValue BatchSubmitCtxHashValue; class ObBatchSubmitCtx : public BatchSubmitCtxHashValue { - public: +public: ObBatchSubmitCtx() { reset(); @@ -47,7 +47,7 @@ class ObBatchSubmitCtx : public BatchSubmitCtxHashValue { destroy(); } - public: +public: int init(const transaction::ObTransID& trans_id, const common::ObPartitionArray& partition_array, const ObLogInfoArray& log_info_array, const ObLogPersistSizeArray& size_array, const ObISubmitLogCbArray& cb_array, const common::ObMemberList& member_list, const int64_t replica_num, @@ -65,7 +65,7 @@ class ObBatchSubmitCtx : public BatchSubmitCtxHashValue { TO_STRING_KV(K(trans_id_), K(partition_array_), K(log_info_array_), K(log_persist_size_array_), K(member_list_), K(replica_num_), K(leader_), K(self_)); - private: +private: int make_cursor_array_(const ObLogCursor& base_log_cursor); int backfill_log_(const bool is_leader, ObBatchAckArray& batch_ack_array); int backfill_log_(const common::ObPartitionKey& partition_key, const ObLogInfo& log_info, @@ -82,7 +82,7 @@ class ObBatchSubmitCtx : public BatchSubmitCtxHashValue { bool ack_need_split_() const; int handle_ack_array_(const common::ObAddr& server, const ObBatchAckArray& batch_ack_array); - private: +private: static const int64_t SPLIT_INTERVAL = 500 * 1000; // 500ms bool is_inited_; mutable lib::ObMutex lock_; @@ -105,23 +105,23 @@ class ObBatchSubmitCtx : public BatchSubmitCtxHashValue { ObLogCursorArray log_cursor_array_; int64_t create_ctx_ts_; ObLogPersistSizeArray log_persist_size_array_; // record clog size in file - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBatchSubmitCtx); }; class ObBatchSubmitCtxFactory { - public: +public: static ObBatchSubmitCtx* alloc(common::ObILogAllocator* alloc_mgr); static void free(ObBatchSubmitCtx* ctx); static void statistics(); - private: +private: static int64_t alloc_cnt_; static int64_t free_cnt_; }; class ObBatchSubmitCtxAlloc { - public: +public: ObBatchSubmitCtx* alloc_value() { return NULL; diff --git a/src/clog/ob_batch_submit_ctx_mgr.cpp b/src/clog/ob_batch_submit_ctx_mgr.cpp index 416a48610..747d5c25e 100644 --- a/src/clog/ob_batch_submit_ctx_mgr.cpp +++ b/src/clog/ob_batch_submit_ctx_mgr.cpp @@ -21,13 +21,13 @@ namespace oceanbase { using namespace common; namespace clog { class ObBatchSubmitCtxMgr::RemoveIfFunctor { - public: +public: RemoveIfFunctor() {} ~RemoveIfFunctor() {} - public: +public: bool operator()(const transaction::ObTransID& trans_id, ObBatchSubmitCtx* ctx) { int tmp_ret = OB_SUCCESS; diff --git a/src/clog/ob_batch_submit_ctx_mgr.h b/src/clog/ob_batch_submit_ctx_mgr.h index f78adf76a..644f5295c 100644 --- a/src/clog/ob_batch_submit_ctx_mgr.h +++ b/src/clog/ob_batch_submit_ctx_mgr.h @@ -33,13 +33,13 @@ class ObPartitionService; namespace clog { class ObILogEngine; class ObIBatchSubmitCtxMgr { - public: +public: ObIBatchSubmitCtxMgr() {} virtual ~ObIBatchSubmitCtxMgr() {} - public: +public: virtual int alloc_ctx(const transaction::ObTransID& trans_id, const common::ObPartitionArray& partition_array, const ObLogInfoArray& log_info_array, const ObLogPersistSizeArray& size_array, const ObISubmitLogCbArray& cb_array, const common::ObMemberList& member_list, const int64_t replica_num, @@ -53,7 +53,7 @@ class ObIBatchSubmitCtxMgr { }; class ObBatchSubmitCtxMgr : public ObIBatchSubmitCtxMgr, public share::ObThreadPool { - public: +public: ObBatchSubmitCtxMgr() { reset(); @@ -63,7 +63,7 @@ class ObBatchSubmitCtxMgr : public ObIBatchSubmitCtxMgr, public share::ObThreadP destroy(); } - public: +public: int init(storage::ObPartitionService* partition_service, ObILogEngine* log_engine, const common::ObAddr& self); int start(); void stop(); @@ -72,7 +72,7 @@ class ObBatchSubmitCtxMgr : public ObIBatchSubmitCtxMgr, public share::ObThreadP void reset(); void destroy(); - public: +public: virtual int alloc_ctx(const transaction::ObTransID& trans_id, const common::ObPartitionArray& partition_array, const ObLogInfoArray& log_info_array, const ObLogPersistSizeArray& size_array, const ObISubmitLogCbArray& cb_array, const common::ObMemberList& member_list, const int64_t replica_num, @@ -86,7 +86,7 @@ class ObBatchSubmitCtxMgr : public ObIBatchSubmitCtxMgr, public share::ObThreadP void run1(); - private: +private: typedef common::ObLinkHashMap CtxMap; class RemoveIfFunctor; static const int64_t LOOP_INTERVAL = 200 * 1000; // 200ms @@ -97,7 +97,7 @@ class ObBatchSubmitCtxMgr : public ObIBatchSubmitCtxMgr, public share::ObThreadP ObILogEngine* log_engine_; common::ObAddr self_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBatchSubmitCtxMgr); }; } // namespace clog diff --git a/src/clog/ob_batch_submit_mock_test.h b/src/clog/ob_batch_submit_mock_test.h index 0ca7f252f..d5ec20d26 100644 --- a/src/clog/ob_batch_submit_mock_test.h +++ b/src/clog/ob_batch_submit_mock_test.h @@ -43,7 +43,7 @@ static void statistics() } class MockSubmitCb : public ObISubmitLogCb { - public: +public: MockSubmitCb() {} int on_success(const common::ObPartitionKey& partition_key, const clog::ObLogType log_type, const uint64_t log_id, @@ -69,7 +69,7 @@ class MockSubmitCb : public ObISubmitLogCb { }; class ObBatchSubmitMockTest : public share::ObThreadPool { - public: +public: const static int64_t SIG_START_STRESS = 57; const static int64_t THREAD_NUM = 1; const static int64_t MAX_SUBMIT_CNT = 100 * 1000 * 1000; @@ -125,7 +125,7 @@ class ObBatchSubmitMockTest : public share::ObThreadPool { (new (std::nothrow) ObBatchSubmitMockTest())->start_stress(); } - private: +private: int batch_submit_log() { int ret = OB_SUCCESS; diff --git a/src/clog/ob_batch_submit_task.h b/src/clog/ob_batch_submit_task.h index 7b4c5fac6..a46e2bc42 100644 --- a/src/clog/ob_batch_submit_task.h +++ b/src/clog/ob_batch_submit_task.h @@ -27,7 +27,7 @@ namespace clog { class ObICLogMgr; class ObILogEngine; class ObBatchSubmitDiskTask : public ObIBufferTask { - public: +public: ObBatchSubmitDiskTask() { reset(); @@ -37,7 +37,7 @@ class ObBatchSubmitDiskTask : public ObIBufferTask { reset(); } - public: +public: void reset(); int init(const transaction::ObTransID& trans_id, const common::ObPartitionArray& partition_array, const ObLogInfoArray& log_info_array, ObICLogMgr* clog_mgr, ObILogEngine* log_engine); @@ -48,7 +48,7 @@ class ObBatchSubmitDiskTask : public ObIBufferTask { virtual int after_consume(const int handle_err, const void* arg, const int64_t before_push_cb_ts); TO_STRING_KV(K(partition_array_), K(log_info_array_), K(offset_)); - private: +private: bool is_inited_; transaction::ObTransID trans_id_; common::ObPartitionArray partition_array_; @@ -57,17 +57,17 @@ class ObBatchSubmitDiskTask : public ObIBufferTask { ObILogEngine* log_engine_; offset_t offset_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBatchSubmitDiskTask); }; class ObBatchSubmitDiskTaskFactory { - public: +public: static ObBatchSubmitDiskTask* alloc(common::ObILogAllocator* alloc_mgr); static void free(ObBatchSubmitDiskTask* task); static void statistics(); - private: +private: static int64_t alloc_cnt_; static int64_t free_cnt_; }; diff --git a/src/clog/ob_buffer_arena.h b/src/clog/ob_buffer_arena.h index 3e1ecbc54..f5087f745 100644 --- a/src/clog/ob_buffer_arena.h +++ b/src/clog/ob_buffer_arena.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace clog { // It is responsible for buffer alloc, which reserves header and aligns memory. class ObIBufferArena { - public: +public: ObIBufferArena() {} virtual ~ObIBufferArena() @@ -30,7 +30,7 @@ class ObIBufferArena { }; class ObBufferArena : public ObIBufferArena { - public: +public: ObBufferArena(); virtual ~ObBufferArena(); int init(const char* label, int64_t align_size, int64_t header_size, int64_t trailer_size, int64_t buffer_size, @@ -45,7 +45,7 @@ class ObBufferArena : public ObIBufferArena { } char* alloc(); - private: +private: bool is_inited_; int64_t align_size_; int64_t header_size_; diff --git a/src/clog/ob_buffer_task.h b/src/clog/ob_buffer_task.h index d62633be0..2b16c4d4a 100644 --- a/src/clog/ob_buffer_task.h +++ b/src/clog/ob_buffer_task.h @@ -23,7 +23,7 @@ class ObLogWriterWrapper; template class MyFixedBufferAlloc { - public: +public: MyFixedBufferAlloc() : pos_(0) {} ~MyFixedBufferAlloc() @@ -42,7 +42,7 @@ class MyFixedBufferAlloc { return ret; } - private: +private: int64_t pos_; char buf_[limit]; @@ -51,7 +51,7 @@ class MyFixedBufferAlloc { // DiskLogBuffer and NetLogBuffer serilize different content to BatchBuffer by using respective BufferTask. class ObIBufferTask { - public: +public: ObIBufferTask() : next_(NULL), need_callback_(false) {} virtual ~ObIBufferTask() @@ -72,7 +72,7 @@ class ObIBufferTask { }; class DummyBuffferTask : public ObIBufferTask { - public: +public: DummyBuffferTask() {} virtual ~DummyBuffferTask() @@ -83,13 +83,13 @@ class DummyBuffferTask : public ObIBufferTask { virtual int st_after_consume(const int handle_err); virtual int after_consume(const int handle_err, const void* arg, const int64_t before_push_cb_ts); - private: +private: DISALLOW_COPY_AND_ASSIGN(DummyBuffferTask); }; // BatchBuffer will submit a batch to BufferConsumer, which will construct a header and submit to disk/net. class ObIBatchBufferTask { - public: +public: ObIBatchBufferTask() : batch_buf_(NULL), batch_size_(0), subtask_count_(0), head_(), task_list_tail_(&head_) {} virtual ~ObIBatchBufferTask() @@ -125,7 +125,7 @@ class ObIBatchBufferTask { virtual ObICLogItem* get_flush_task() = 0; TO_STRING_KV(N_BUF, ((uint64_t)(batch_buf_)), N_BUF_LEN, batch_size_, N_COUNT, subtask_count_); - private: +private: // alloc memory for RpcPostHandler's Task MyFixedBufferAlloc<256> alloc_; char* batch_buf_; @@ -138,7 +138,7 @@ class ObIBatchBufferTask { }; class ObIBufferConsumer { - public: +public: typedef ObIBufferTask Task; ObIBufferConsumer() {} @@ -148,7 +148,7 @@ class ObIBufferConsumer { }; class ObIBatchBufferConsumer { - public: +public: typedef ObIBatchBufferTask Task; ObIBatchBufferConsumer() {} diff --git a/src/clog/ob_clog_aggre_runnable.h b/src/clog/ob_clog_aggre_runnable.h index 8e222d2e8..aaccdcc05 100644 --- a/src/clog/ob_clog_aggre_runnable.h +++ b/src/clog/ob_clog_aggre_runnable.h @@ -25,7 +25,7 @@ namespace clog { class ObClogAggreRunnable; class ObClogAggreTask { - public: +public: ObClogAggreTask(ObClogAggreRunnable* host, storage::ObPartitionService* ps) : host_(host), ps_(ps), run_ts_(0) {} ~ObClogAggreTask() @@ -33,7 +33,7 @@ class ObClogAggreTask { int set_partition_key(const common::ObPartitionKey& pkey); int set_run_ts(const int64_t run_ts); - public: +public: void handle(); uint64_t hash() const { @@ -41,7 +41,7 @@ class ObClogAggreTask { } TO_STRING_KV(K_(pkey)); - private: +private: common::ObPartitionKey pkey_; ObClogAggreRunnable* host_; storage::ObPartitionService* ps_; @@ -51,37 +51,37 @@ class ObClogAggreTask { class ObClogAggreRunnable : public lib::TGTaskHandler { friend class ObClogAggreTask; - public: +public: ObClogAggreRunnable(); virtual ~ObClogAggreRunnable(); - public: +public: int init(storage::ObPartitionService* partition_service); int start(); void stop(); void wait(); void destroy(); - public: +public: void handle(void* task); int add_task(const common::ObPartitionKey& pkey, const int64_t delay_us); - public: +public: static const int64_t THREAD_COUNT = 4; static const int64_t MINI_THREAD_COUNT = 1; static const int64_t TOTAL_TASK = 256; - private: +private: int push_back(ObClogAggreTask* task); - private: +private: bool is_inited_; ObClogAggreTask* task_array_[TOTAL_TASK]; int64_t available_index_; common::ObSpinLock lock_; int tg_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObClogAggreRunnable); }; diff --git a/src/clog/ob_clog_file_writer.cpp b/src/clog/ob_clog_file_writer.cpp index 7b9411b8a..d52559974 100644 --- a/src/clog/ob_clog_file_writer.cpp +++ b/src/clog/ob_clog_file_writer.cpp @@ -257,16 +257,20 @@ int ObCLogBaseFileWriter::append_trailer_entry(const uint32_t info_block_offset) const file_id_t phy_file_id = file_id_ + 1; // build trailer from last 512 byte offset (4096-512) int64_t trailer_pos = CLOG_DIO_ALIGN_SIZE - CLOG_TRAILER_SIZE; - char *buf = shm_data_buf_ + trailer_pos; + char* buf = shm_data_buf_ + trailer_pos; reset_buf(); if (CLOG_TRAILER_OFFSET != file_offset_) { // Defense code ret = OB_ERR_UNEXPECTED; - CLOG_LOG(WARN, "file_offset_ mismatch trailer offset", K(ret), K_(file_offset), - LITERAL_K(CLOG_TRAILER_OFFSET)); + CLOG_LOG(WARN, "file_offset_ mismatch trailer offset", K(ret), K_(file_offset), LITERAL_K(CLOG_TRAILER_OFFSET)); } else if (OB_FAIL(trailer.build_serialized_trailer(buf, CLOG_TRAILER_SIZE, info_block_offset, phy_file_id, pos))) { - CLOG_LOG(WARN, "build_serialized_trailer fail", K(ret), LITERAL_K(CLOG_DIO_ALIGN_SIZE), - K(info_block_offset), K_(file_id), K(phy_file_id)); + CLOG_LOG(WARN, + "build_serialized_trailer fail", + K(ret), + LITERAL_K(CLOG_DIO_ALIGN_SIZE), + K(info_block_offset), + K_(file_id), + K(phy_file_id)); } else { buf_write_pos_ += (uint32_t)CLOG_DIO_ALIGN_SIZE; } @@ -284,8 +288,13 @@ int ObCLogBaseFileWriter::flush_trailer_entry() ret = OB_ERR_UNEXPECTED; CLOG_LOG(WARN, "buf write position mismatch", K_(buf_write_pos), LITERAL_K(CLOG_DIO_ALIGN_SIZE)); } else if (OB_FAIL(store_->write(shm_data_buf_, buf_write_pos_, CLOG_TRAILER_ALIGN_WRITE_OFFSET))) { - CLOG_LOG(ERROR, "write fail", K(ret), K(buf_write_pos_), K_(file_offset), - LITERAL_K(CLOG_TRAILER_ALIGN_WRITE_OFFSET), K(errno)); + CLOG_LOG(ERROR, + "write fail", + K(ret), + K(buf_write_pos_), + K_(file_offset), + LITERAL_K(CLOG_TRAILER_ALIGN_WRITE_OFFSET), + K(errno)); } return ret; } @@ -386,7 +395,7 @@ int ObCLogBaseFileWriter::append_padding_entry(const uint32_t padding_size) return ret; } -int ObCLogBaseFileWriter::cache_buf(ObLogCache *log_cache, const char *buf, const uint32_t buf_len) +int ObCLogBaseFileWriter::cache_buf(ObLogCache* log_cache, const char* buf, const uint32_t buf_len) { int ret = OB_SUCCESS; if (OB_ISNULL(buf) || 0 == buf_len) { @@ -680,7 +689,7 @@ int ObCLogLocalFileWriter::end_current_file(ObIInfoBlockHandler* info_getter, Ob // - Flush trailer entry to log file // - Cache trailer entry to log cache - char *trailer_buf = shm_data_buf_ + CLOG_DIO_ALIGN_SIZE - CLOG_TRAILER_SIZE; + char* trailer_buf = shm_data_buf_ + CLOG_DIO_ALIGN_SIZE - CLOG_TRAILER_SIZE; if (OB_SUCC(ret)) { if (OB_FAIL(append_trailer_entry(info_block_offset))) { CLOG_LOG(WARN, "fail to add trailer", K(ret)); diff --git a/src/clog/ob_clog_file_writer.h b/src/clog/ob_clog_file_writer.h index fc00d7370..b72432b43 100644 --- a/src/clog/ob_clog_file_writer.h +++ b/src/clog/ob_clog_file_writer.h @@ -33,7 +33,7 @@ class ObTailCursor; // Local disk IO should be aligned and can be in-place-update. // OFS AIO can be unaligned but should be append-only. class ObCLogBaseFileWriter { - public: +public: ObCLogBaseFileWriter(); virtual ~ObCLogBaseFileWriter(); @@ -86,17 +86,17 @@ class ObCLogBaseFileWriter { // append log item meta and data to buffer int append_log_entry(const char* item_buf, const uint32_t len); - protected: +protected: // align memory buffer, append padding_entry if need virtual int align_buf() = 0; - protected: +protected: int append_padding_entry(const uint32_t padding_size); int append_info_block_entry(ObIInfoBlockHandler* info_getter); int append_trailer_entry(const uint32_t info_block_offset); int flush_trailer_entry(); // append all data in buffer to log cache - int cache_buf(ObLogCache *log_cache, const char *buf, const uint32_t buf_len); + int cache_buf(ObLogCache* log_cache, const char* buf, const uint32_t buf_len); OB_INLINE bool need_align() const { @@ -107,7 +107,7 @@ class ObCLogBaseFileWriter { buf_write_pos_ = 0; } - protected: +protected: bool is_inited_; common::ObBaseLogBufferCtrl* log_ctrl_; common::ObBaseLogBuffer* shm_buf_; @@ -121,12 +121,12 @@ class ObCLogBaseFileWriter { uint32_t file_id_; char log_dir_[common::MAX_PATH_SIZE]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCLogBaseFileWriter); }; class ObCLogLocalFileWriter : public ObCLogBaseFileWriter { - public: +public: ObCLogLocalFileWriter() : blank_buf_(NULL) {} virtual ~ObCLogLocalFileWriter() @@ -155,10 +155,10 @@ class ObCLogLocalFileWriter : public ObCLogBaseFileWriter { void reset(); - protected: +protected: virtual int align_buf() override; - private: +private: // last padding entry need sync to log cache int cache_last_padding_entry(ObLogCache* log_cache); // cache blank space between info block and trailer entry @@ -167,7 +167,7 @@ class ObCLogLocalFileWriter : public ObCLogBaseFileWriter { // truncate buf after flush void truncate_buf(); - private: +private: char* blank_buf_; DISALLOW_COPY_AND_ASSIGN(ObCLogLocalFileWriter); diff --git a/src/clog/ob_clog_history_reporter.h b/src/clog/ob_clog_history_reporter.h index b498f65db..7f6b01d8b 100644 --- a/src/clog/ob_clog_history_reporter.h +++ b/src/clog/ob_clog_history_reporter.h @@ -29,11 +29,11 @@ class ObMySQLProxy; } // namespace common namespace clog { class ObClogHistoryReporter : public lib::TGRunnable { - public: +public: static const int64_t THREAD_NUM = 3; static const int64_t MINI_MODE_THREAD_NUM = 1; - private: +private: // ObConcurrentFIFOAllocator static const int64_t TOTAL_LIMIT = 512L * 1024L * 1024L; static const int64_t HOLD_LIMIT = 512L * 1024L; @@ -53,7 +53,7 @@ class ObClogHistoryReporter : public lib::TGRunnable { // PartitionQueueTask array max number static const int64_t QUEUE_TASK_NUM_LIMIT = 1024; - public: +public: ObClogHistoryReporter() : task_num_limit_(0), thread_counter_(0), @@ -75,13 +75,13 @@ class ObClogHistoryReporter : public lib::TGRunnable { destroy(); } - public: +public: int init(common::ObMySQLProxy* sql_proxy, const common::ObAddr& addr); void stop(); void wait(); void destroy(); - public: +public: static ObClogHistoryReporter& get_instance(); static bool is_related_table(uint64_t tenant_id, uint64_t table_id); void online(const common::ObPartitionKey& pkey, const uint64_t start_log_id, const int64_t start_log_timestamp); @@ -90,7 +90,7 @@ class ObClogHistoryReporter : public lib::TGRunnable { void delete_server_record(const common::ObAddr& delete_addr); virtual void handle(void* task); - private: +private: int init_thread_pool_(const int64_t task_num_limit); void destroy_thread_pool_(); int push_work_queue_(void* task, const int64_t timeout); @@ -105,7 +105,7 @@ class ObClogHistoryReporter : public lib::TGRunnable { void run1() final; - private: +private: enum QueueTaskType { UNKNOWN_TASK, PARTITION_TASK, // PartitionQueueTask @@ -364,11 +364,11 @@ class ObClogHistoryReporter : public lib::TGRunnable { TO_STRING_KV(K_(delete_addr)); }; - private: +private: // If the task_map_ has corresponding partition's task,online_op/offline_op // will be inserted to the tail of the task. class InsertTaskTailFunctor { - public: + public: explicit InsertTaskTailFunctor(PartitionOp& op) : err_(common::OB_SUCCESS), op_(op) {} bool operator()(const common::ObPartitionKey& pkey, PartitionQueueTask& task); @@ -378,14 +378,14 @@ class ObClogHistoryReporter : public lib::TGRunnable { } TO_STRING_KV(K_(err), K_(op)); - private: + private: int err_; PartitionOp& op_; }; // If task fails, and the task_map_ has corresponding partition's other task, it will be inserted to the head of the // task. class InsertTaskHeadFunctor { - public: + public: explicit InsertTaskHeadFunctor(PartitionQueueTask& task) : err_(common::OB_SUCCESS), task_(task) {} bool operator()(const common::ObPartitionKey& pkey, PartitionQueueTask& task); @@ -395,13 +395,13 @@ class ObClogHistoryReporter : public lib::TGRunnable { } TO_STRING_KV(K_(err), K_(task)); - private: + private: int err_; PartitionQueueTask& task_; }; // for hashmap remove_if, push task into the queue of the thread pool class PushTaskFunctor { - public: + public: explicit PushTaskFunctor(ObClogHistoryReporter& host) : err_(common::OB_SUCCESS), host_(host) {} // return true: task_map_ will delete current item immediately, return false: task_map_ will go on traversing. @@ -412,23 +412,23 @@ class ObClogHistoryReporter : public lib::TGRunnable { } TO_STRING_KV(K(err_)); - private: + private: int err_; ObClogHistoryReporter& host_; }; // for hashmap destory class DestoryTaskFunctor { - public: + public: explicit DestoryTaskFunctor(ObClogHistoryReporter& host) : count_(0), host_(host) {} bool operator()(const common::ObPartitionKey& pkey, PartitionQueueTask& task); - private: + private: int count_; ObClogHistoryReporter& host_; }; - private: +private: int alloc_queue_task_(const QueueTaskType queue_task_type, IQueueTask*& queue_task); int free_queue_task_(IQueueTask* queue_task); @@ -465,7 +465,7 @@ class ObClogHistoryReporter : public lib::TGRunnable { void print_stat(); - private: +private: // thread pool int64_t task_num_limit_; int64_t thread_counter_; @@ -480,10 +480,10 @@ class ObClogHistoryReporter : public lib::TGRunnable { }; ThreadConf thread_conf_array_[MAX_THREAD_NUM]; - private: +private: typedef common::ObList TaskList; - private: +private: common::ObLinearHashMap task_map_; volatile int64_t partition_task_count_ CACHE_ALIGNED; common::ObConcurrentFIFOAllocator local_allocator_; @@ -493,7 +493,7 @@ class ObClogHistoryReporter : public lib::TGRunnable { char* sql_str_[MAX_THREAD_NUM]; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObClogHistoryReporter); }; diff --git a/src/clog/ob_clog_mgr.h b/src/clog/ob_clog_mgr.h index 72e70ea7d..977cdb1e8 100644 --- a/src/clog/ob_clog_mgr.h +++ b/src/clog/ob_clog_mgr.h @@ -80,73 +80,73 @@ struct CLogMgrConfig { }; class ObCheckLogFileCollectTask : public common::ObTimerTask { - public: +public: ObCheckLogFileCollectTask() : clog_mgr_(NULL), is_inited_(false) {} virtual ~ObCheckLogFileCollectTask() {} - public: +public: int init(ObICLogMgr* clog_mgr); virtual void runTimerTask(); - private: +private: ObICLogMgr* clog_mgr_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCheckLogFileCollectTask); }; class ObCheckpointLogReplicaTask : public common::ObTimerTask { - public: +public: ObCheckpointLogReplicaTask() : partition_service_(NULL), is_inited_(false) {} virtual ~ObCheckpointLogReplicaTask() {} - public: +public: int init(storage::ObPartitionService* partition_service); virtual void runTimerTask(); - private: +private: storage::ObPartitionService* partition_service_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCheckpointLogReplicaTask); }; class ObCheckCLogDiskFullTask : public common::ObTimerTask { - public: +public: ObCheckCLogDiskFullTask() : partition_service_(NULL), is_inited_(false) {} virtual ~ObCheckCLogDiskFullTask() {} - public: +public: int init(storage::ObPartitionService* partition_service); void runTimerTask() final; - private: +private: int do_run_timer_task_(); - private: +private: storage::ObPartitionService* partition_service_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCheckCLogDiskFullTask); }; class ObICLogMgr : public election::ObIElectionGroupPriorityGetter { - public: +public: ObICLogMgr() {} virtual ~ObICLogMgr() {} - public: +public: virtual int init(storage::ObPartitionService* partition_service, ObLogReplayEngineWrapper* replay_engine, election::ObIElectionMgr* election_mgr, const common::ObAddr& self_addr, obrpc::ObBatchRpc* batch_rpc, obrpc::ObLogRpcProxy* rpc, common::ObMySQLProxy* sql_proxy, const CLogMgrConfig& config) = 0; @@ -303,11 +303,11 @@ class ObICLogMgr : public election::ObIElectionGroupPriorityGetter { }; class ObCLogMgr : public ObICLogMgr { - public: +public: ObCLogMgr(); virtual ~ObCLogMgr(); - public: +public: virtual int init(storage::ObPartitionService* partition_service, ObLogReplayEngineWrapper* replay_engine, election::ObIElectionMgr* election_mgr, const common::ObAddr& self_addr, obrpc::ObBatchRpc* batch_rpc, obrpc::ObLogRpcProxy* rpc, common::ObMySQLProxy* sql_proxy, const CLogMgrConfig& config); @@ -370,7 +370,7 @@ class ObCLogMgr : public ObICLogMgr { virtual int get_ilog_using_disk_space(int64_t& using_space) const override; //===================== transaction one phase commit begin ================ - public: +public: virtual int batch_submit_log(const transaction::ObTransID& trans_id, const common::ObPartitionArray& partition_array, const ObLogInfoArray& log_info_array, const ObISubmitLogCbArray& cb_array); virtual int check_can_batch_submit(const common::ObPartitionArray& partition_array, bool& can_batch); @@ -409,7 +409,7 @@ class ObCLogMgr : public ObICLogMgr { const common::ObAddrIArray& dst_server_list, common::ObSArray& candidate_mlist_array, common::ObSArray& status_array) const; //===================== batch change member begin ================ - public: +public: virtual int batch_add_member(const obrpc::ObChangeMemberArgs& ctx_array, obrpc::ObChangeMemberCtxs& return_ctx_array); virtual int batch_remove_member( const obrpc::ObChangeMemberArgs& ctx_array, obrpc::ObChangeMemberCtxs& return_ctx_array); @@ -440,12 +440,12 @@ class ObCLogMgr : public ObICLogMgr { int get_archive_pg_map(archive::PGArchiveMap*& map); bool is_server_archive_stop(const int64_t incarnation, const int64_t archive_round); - public: +public: // clog callback thread num static int64_t CLOG_CB_THREAD_COUNT; static int64_t MINI_MODE_CLOG_CB_THREAD_COUNT; - private: +private: static const int64_t OB_ARRAY_COUNT = 16; typedef common::ObSEArray McTimestampArray; typedef common::ObSEArray MemberListArray; @@ -524,7 +524,7 @@ class ObCLogMgr : public ObICLogMgr { const int64_t follower_max_gap, ReturnMap& ret_map); int get_partition_max_log_id_(const common::ObPartitionKey& partiton_key, uint64_t& partition_max_log_id); //===================== batch change member end ================ - private: +private: int create_partition_(const common::ObPartitionKey& partition_key, const int64_t replica_num, const common::ObMemberList& member_list, const common::ObVersion& freeze_version, const common::ObReplicaType replica_type, const common::ObReplicaProperty replia_property, @@ -532,7 +532,7 @@ class ObCLogMgr : public ObICLogMgr { const bool need_skip_mlist_check, ObIPartitionLogService* pls); int query_max_ilog_id_(const common::ObPartitionKey& pkey, uint64_t& ret_max_file_id); //===================== transaction one phase commit begin ================ - private: +private: int check_can_batch_submit_(const common::ObPartitionArray& partition_array, bool& can_batch); bool check_batch_submit_arguments_(const transaction::ObTransID& trans_id, const common::ObPartitionArray& partition_array, const ObLogInfoArray& log_info_array, @@ -564,7 +564,7 @@ class ObCLogMgr : public ObICLogMgr { //===================== transaction one phase commit end ================ int check_svr_in_member_list_(const ObPartitionKey& pkey, const ObAddr& server, bool& is_in_member_list) const; - private: +private: bool is_inited_; bool is_running_; CLogMgrConfig clog_mgr_config_; @@ -597,7 +597,7 @@ class ObCLogMgr : public ObICLogMgr { ObCheckpointLogReplicaTask checkpoint_log_replica_task_; ObCheckCLogDiskFullTask check_clog_disk_full_task_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCLogMgr); }; diff --git a/src/clog/ob_clog_sync_msg.h b/src/clog/ob_clog_sync_msg.h index ae1b214e9..aa38e6e90 100644 --- a/src/clog/ob_clog_sync_msg.h +++ b/src/clog/ob_clog_sync_msg.h @@ -22,7 +22,7 @@ static const int64_t OB_ARRAY_COUNT = 16; struct McCtx { OB_UNIS_VERSION(1); - public: +public: McCtx() { reset(); @@ -48,7 +48,7 @@ namespace obrpc { class ObLogGetMCTsRequest { OB_UNIS_VERSION(1); - public: +public: ObLogGetMCTsRequest() { reset(); @@ -71,17 +71,17 @@ class ObLogGetMCTsRequest { } TO_STRING_KV(K_(partition_key)); - private: +private: common::ObPartitionKey partition_key_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGetMCTsRequest); }; class ObLogGetMCTsResponse { OB_UNIS_VERSION(1); - public: +public: ObLogGetMCTsResponse() { reset(); @@ -131,7 +131,7 @@ class ObLogGetMCTsResponse { } TO_STRING_KV(K_(partition_key), K_(membership_timestamp), K_(max_confirmed_log_id), K_(is_normal_partition)); - private: +private: common::ObPartitionKey partition_key_; int64_t membership_timestamp_; uint64_t max_confirmed_log_id_; @@ -140,14 +140,14 @@ class ObLogGetMCTsResponse { // 2. disk space not enougn bool is_normal_partition_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGetMCTsResponse); }; class ObLogGetPriorityArrayRequest { OB_UNIS_VERSION(1); - public: +public: ObLogGetPriorityArrayRequest() { reset(); @@ -172,17 +172,17 @@ class ObLogGetPriorityArrayRequest { } TO_STRING_KV(K(partition_array_)); - private: +private: common::ObPartitionArray partition_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGetPriorityArrayRequest); }; class ObLogGetPriorityArrayResponse { OB_UNIS_VERSION(1); - public: +public: ObLogGetPriorityArrayResponse() { reset(); @@ -205,17 +205,17 @@ class ObLogGetPriorityArrayResponse { } TO_STRING_KV(K(priority_array_)); - private: +private: election::PriorityArray priority_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGetPriorityArrayResponse); }; class ObLogGetMcCtxArrayRequest { OB_UNIS_VERSION(1); - public: +public: ObLogGetMcCtxArrayRequest() { reset(); @@ -238,17 +238,17 @@ class ObLogGetMcCtxArrayRequest { } TO_STRING_KV(K(partition_array_)); - private: +private: common::ObPartitionArray partition_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGetMcCtxArrayRequest); }; class ObLogGetMcCtxArrayResponse { OB_UNIS_VERSION(1); - public: +public: ObLogGetMcCtxArrayResponse() { reset(); @@ -271,17 +271,17 @@ class ObLogGetMcCtxArrayResponse { } TO_STRING_KV(K(mc_ctx_array_)); - private: +private: clog::McCtxArray mc_ctx_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGetMcCtxArrayResponse); }; class ObLogGetRemoteLogRequest { OB_UNIS_VERSION(1); - public: +public: ObLogGetRemoteLogRequest() { reset(); @@ -310,18 +310,18 @@ class ObLogGetRemoteLogRequest { } TO_STRING_KV(K(partition_key_), K(log_id_)); - private: +private: common::ObPartitionKey partition_key_; uint64_t log_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGetRemoteLogRequest); }; class ObLogGetRemoteLogResponse { OB_UNIS_VERSION(1); - public: +public: ObLogGetRemoteLogResponse() { reset(); @@ -361,14 +361,14 @@ class ObLogGetRemoteLogResponse { } TO_STRING_KV(K(partition_key_), K(log_id_), K(trans_id_), K(submit_timestamp_), K(ret_value_)); - private: +private: common::ObPartitionKey partition_key_; uint64_t log_id_; transaction::ObTransID trans_id_; int64_t submit_timestamp_; int ret_value_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGetRemoteLogResponse); }; } // namespace obrpc diff --git a/src/clog/ob_clog_sync_rpc.h b/src/clog/ob_clog_sync_rpc.h index cf4ff497c..3fcf04cb5 100644 --- a/src/clog/ob_clog_sync_rpc.h +++ b/src/clog/ob_clog_sync_rpc.h @@ -24,7 +24,7 @@ class ObPartitionService; } namespace obrpc { class ObLogGetMCTsProcessor : public ObRpcProcessor > { - public: +public: ObLogGetMCTsProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogGetMCTsProcessor() @@ -32,18 +32,18 @@ class ObLogGetMCTsProcessor : public ObRpcProcessor > { - public: +public: ObLogGetMcCtxArrayProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogGetMcCtxArrayProcessor() @@ -51,18 +51,18 @@ class ObLogGetMcCtxArrayProcessor : public ObRpcProcessor > { - public: +public: ObLogGetPriorityArrayProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogGetPriorityArrayProcessor() @@ -70,18 +70,18 @@ class ObLogGetPriorityArrayProcessor : public ObRpcProcessor > { - public: +public: ObLogGetRemoteLogProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogGetRemoteLogProcessor() @@ -89,13 +89,13 @@ class ObLogGetRemoteLogProcessor : public ObRpcProcessor class ObLogFileTailLocatorImpl { - public: +public: ObLogFileTailLocatorImpl() {} ~ObLogFileTailLocatorImpl() diff --git a/src/clog/ob_disk_log_buffer.h b/src/clog/ob_disk_log_buffer.h index 5e0e7872e..414a63dfc 100644 --- a/src/clog/ob_disk_log_buffer.h +++ b/src/clog/ob_disk_log_buffer.h @@ -21,9 +21,9 @@ namespace oceanbase { namespace clog { class ObLogWriterWrapper : public ObIBatchBufferConsumer { - public: +public: class CallbackTask : public common::ObICallback { - public: + public: CallbackTask() { reset(); @@ -33,7 +33,7 @@ class ObLogWriterWrapper : public ObIBatchBufferConsumer { void reset(); int callback(); - public: + public: ObLogCursor cursor_; int error_code_; int64_t before_push_cb_ts_; @@ -41,11 +41,11 @@ class ObLogWriterWrapper : public ObIBatchBufferConsumer { ObIBufferTask* header_task_; int64_t task_num_; - private: + private: DISALLOW_COPY_AND_ASSIGN(CallbackTask); }; - public: +public: ObLogWriterWrapper() : log_writer_(NULL), callback_handler_(NULL), batch_buffer_(NULL), is_inited_(false) {} virtual ~ObLogWriterWrapper() @@ -58,7 +58,7 @@ class ObLogWriterWrapper : public ObIBatchBufferConsumer { int after_consume(common::ObICallback& task); void add_group_size(const int64_t task_num, const ObLogWritePoolType type); - private: +private: ObCLogWriter* log_writer_; common::ObICallbackHandler* callback_handler_; ObBatchBuffer* batch_buffer_; @@ -71,7 +71,7 @@ class ObLogWriterWrapper : public ObIBatchBufferConsumer { }; class ObCLogItem : public ObICLogItem { - public: +public: ObCLogItem(); virtual ~ObCLogItem(); int init(ObLogWriterWrapper* host, ObIBatchBufferTask* buffer_task, ObBatchBuffer* batch_buffer); @@ -84,24 +84,24 @@ class ObCLogItem : public ObICLogItem { const file_id_t file_id, const offset_t offset, const int error_code, const ObLogWritePoolType type); TO_STRING_KV(KP_(host), KP_(buffer_task), KP_(batch_buffer)); - private: +private: static const int64_t MAX_TASK_NUM_PER_CB = 20; ObLogWriterWrapper* host_; ObIBatchBufferTask* buffer_task_; ObBatchBuffer* batch_buffer_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCLogItem); }; class ObDiskLogBuffer : public ObIDiskLogBuffer { - public: +public: ObDiskLogBuffer() : log_buffer_cnt_(0) {} virtual ~ObDiskLogBuffer() {} - public: +public: int init(const int64_t buffer_size, const int64_t buffer_cnt, ObCLogWriter* log_writer, common::ObICallbackHandler* callback_handler); int submit(ObIBufferTask* task); @@ -114,13 +114,13 @@ class ObDiskLogBuffer : public ObIDiskLogBuffer { return log_buffer_cnt_; } - private: +private: int64_t log_buffer_cnt_; ObLogWriterWrapper log_writer_; ObBufferArena buffer_arena_; ObBatchBuffer batch_buffer_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDiskLogBuffer); }; }; // namespace clog diff --git a/src/clog/ob_dist_futex.h b/src/clog/ob_dist_futex.h index fbc0419d2..e0c2c7792 100644 --- a/src/clog/ob_dist_futex.h +++ b/src/clog/ob_dist_futex.h @@ -20,21 +20,21 @@ namespace common { template class ObDistFutex { - public: +public: ObDistFutex() {} ~ObDistFutex() {} - public: +public: int wait(volatile ValueType* p, ValueType v, int64_t timeout); int wake(volatile ValueType* p, int64_t n); - private: +private: typedef lib::CoFutex FutexType; FutexType futex_[CONCURRENCY]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistFutex); }; diff --git a/src/clog/ob_external_fetcher.h b/src/clog/ob_external_fetcher.h index 9dadd4960..8ffdb41d3 100644 --- a/src/clog/ob_external_fetcher.h +++ b/src/clog/ob_external_fetcher.h @@ -59,7 +59,7 @@ namespace logservice { ////////////////////////// ObExtLogFetcher /////////////////////////// struct FetchRunTime; class ObExtLogFetcher : public ObLogFetcherImpl { - public: +public: static const int64_t SYNC_TIMEOUT = 5 * 1000 * 1000; // 5 second // When fetch log finds that the remaining time is less than RPC_QIT_RESERVED_TIME, // exit immediately to avoid timeout @@ -76,7 +76,7 @@ class ObExtLogFetcher : public ObLogFetcherImpl { // get_cursor_batch internally retries 10 times, guarantee to return in a short time static const int64_t GET_CURSOR_RETRY_LIMIT = 10; - public: +public: ObExtLogFetcher() : cur_ts_(0), self_(), @@ -115,10 +115,10 @@ class ObExtLogFetcher : public ObLogFetcherImpl { int wash(); void print_all_stream(); - public: +public: // pick out expired streams class ExpiredStreamPicker { - public: + public: ExpiredStreamPicker() : retired_arr_() {} bool operator()(const obrpc::ObStreamSeq& steam_seq, ObStream* stream); @@ -127,7 +127,7 @@ class ObExtLogFetcher : public ObLogFetcherImpl { return retired_arr_; } - private: + private: RetiredStreamArray retired_arr_; }; @@ -136,7 +136,7 @@ class ObExtLogFetcher : public ObLogFetcherImpl { bool operator()(const obrpc::ObStreamSeq& steam_seq, ObStream* stream); }; - private: +private: inline static clog::ObReadParam cursor2param(const clog::ObLogCursorExt& cursor_ext) { const int64_t DEFAULT_READ_TIMEOUT = 10 * 1000; // 10 ms @@ -148,13 +148,13 @@ class ObExtLogFetcher : public ObLogFetcherImpl { return param; } - private: +private: inline static bool is_invalid_submit_timestamp(const int64_t timestamp) { return 0 == timestamp || common::OB_INVALID_TIMESTAMP == timestamp; } - private: +private: int generate_stream_seq(obrpc::ObStreamSeq& stream_seq); int alloc_stream_mem(const obrpc::ObStreamSeq& seq, const obrpc::ObLogOpenStreamReq& req, char*& ret_buf); void free_stream_mem(ObStream* stream); @@ -219,18 +219,18 @@ class ObExtLogFetcher : public ObLogFetcherImpl { return ret; } - private: +private: class DebugPrinter { - public: + public: DebugPrinter() : count_(0) {} bool operator()(const obrpc::ObStreamSeq& seq, ObStream* stream); - private: + private: int64_t count_; }; class DestroyFunctor { - public: + public: explicit DestroyFunctor(common::ObFIFOAllocator& fifo_allocator) : fifo_allocator_(fifo_allocator) {} bool operator()(const obrpc::ObStreamSeq& seq, ObStream* stream) @@ -243,11 +243,11 @@ class ObExtLogFetcher : public ObLogFetcherImpl { return true; } - private: + private: common::ObFIFOAllocator& fifo_allocator_; }; - private: +private: int64_t cur_ts_; common::ObAddr self_; storage::ObPartitionService* partition_service_; @@ -284,7 +284,7 @@ struct FetchRunTime { clog::ObIlogStorageQueryCost csr_cost_ CACHE_ALIGNED; obrpc::ObFetchStatus fetch_status_ CACHE_ALIGNED; - public: +public: FetchRunTime(); ~FetchRunTime(); int init(const ObLogRpcIDType rpc_id, const int64_t cur_tstamp, const obrpc::ObLogStreamFetchLogReq& req); diff --git a/src/clog/ob_external_heartbeat_handler.h b/src/clog/ob_external_heartbeat_handler.h index 0ace9d8bb..005f3b4fb 100644 --- a/src/clog/ob_external_heartbeat_handler.h +++ b/src/clog/ob_external_heartbeat_handler.h @@ -25,7 +25,7 @@ class ObILogEngine; } namespace logservice { class ObExtHeartbeatHandler { - public: +public: ObExtHeartbeatHandler() : partition_service_(NULL), log_engine_(NULL) {} ~ObExtHeartbeatHandler() @@ -37,7 +37,7 @@ class ObExtHeartbeatHandler { int req_heartbeat_info( const obrpc::ObLogReqHeartbeatInfoRequest& req_msg, obrpc::ObLogReqHeartbeatInfoResponse& response); - private: +private: uint64_t get_last_slide_log_id(const common::ObPartitionKey& pkey); int get_leader_info(const common::ObPartitionKey& pkey, common::ObRole& role, int64_t& leader_epoch); int get_predict_timestamp(const common::ObPartitionKey& pkey, const uint64_t last_log_id, int64_t& predict_ts); @@ -46,7 +46,7 @@ class ObExtHeartbeatHandler { int do_req_heartbeat_info( const obrpc::ObLogReqHeartbeatInfoRequest& req_msg, obrpc::ObLogReqHeartbeatInfoResponse& response); - private: +private: storage::ObPartitionService* partition_service_; clog::ObILogEngine* log_engine_; }; diff --git a/src/clog/ob_external_leader_heartbeat_handler.h b/src/clog/ob_external_leader_heartbeat_handler.h index 6d2259ae8..980e5ce45 100644 --- a/src/clog/ob_external_leader_heartbeat_handler.h +++ b/src/clog/ob_external_leader_heartbeat_handler.h @@ -34,7 +34,7 @@ namespace logservice { */ class ObExtLeaderHeartbeatHandler { - public: +public: ObExtLeaderHeartbeatHandler() { partition_service_ = NULL; @@ -50,7 +50,7 @@ class ObExtLeaderHeartbeatHandler { } int leader_heartbeat(const obrpc::ObLogLeaderHeartbeatReq& req_msg, obrpc::ObLogLeaderHeartbeatResp& resp_msg); - private: +private: inline int get_leader_info(const common::ObPartitionKey& pkey, clog::ObIPartitionLogService* pls, common::ObRole& role, int64_t& leader_epoch); inline int get_last_slide(const common::ObPartitionKey& pkey, clog::ObIPartitionLogService* pls, @@ -63,7 +63,7 @@ class ObExtLeaderHeartbeatHandler { const common::ObPartitionKey& pkey, uint64_t& next_served_log_id, int64_t& next_served_ts); int do_req_heartbeat_info(const obrpc::ObLogLeaderHeartbeatReq& req_msg, obrpc::ObLogLeaderHeartbeatResp& resp_msg); - private: +private: storage::ObPartitionService* partition_service_; }; diff --git a/src/clog/ob_external_log_service.h b/src/clog/ob_external_log_service.h index 7df70c153..a41f2f14a 100644 --- a/src/clog/ob_external_log_service.h +++ b/src/clog/ob_external_log_service.h @@ -52,7 +52,7 @@ class ObExtLogService { static const int64_t MINI_MODE_LINE_CACHE_FIXED_SIZE_IN_FILE_COUNT = 1; static const int64_t LINE_CACHE_FIXED_SIZE_IN_FILE_COUNT_FOR_LOG_ARCHIVE = 1; - public: +public: /* * Timed tasks used by ExtLogService include two types of tasks: * > regularly wash the old stream -- ObExtLogService::wash_expired_stream @@ -60,7 +60,7 @@ class ObExtLogService { * ObExtLogService::print_all_stream */ class StreamTimerTask : public common::ObTimerTask { - public: + public: StreamTimerTask() : els_(NULL) {} ~StreamTimerTask() @@ -70,15 +70,15 @@ class ObExtLogService { int init(ObExtLogService* els); virtual void runTimerTask(); - public: + public: // misc sub-task frequency static const int64_t TIMER_INTERVAL = 1000 * 1000; - private: + private: ObExtLogService* els_; }; class LineCacheTimerTask : public common::ObTimerTask { - public: + public: LineCacheTimerTask() : els_(NULL) {} ~LineCacheTimerTask() @@ -88,16 +88,16 @@ class ObExtLogService { int init(ObExtLogService* els); virtual void runTimerTask(); - public: + public: // misc sub-task frequency static const int64_t TIMER_INTERVAL = 100 * 1000; // 100ms once static const int64_t LINE_CACHE_STAT_INTERVAL = 10 * 1000 * 1000; static const int64_t LINE_CACHE_WASH_INTERVAL = 100 * 1000; // 100ms eliminate once - private: + private: ObExtLogService* els_; }; - public: +public: ObExtLogService() : is_inited_(false), clog_mgr_(NULL), @@ -142,7 +142,7 @@ class ObExtLogService { log_archive_line_cache_.wash(); } - private: +private: bool is_inited_; clog::ObICLogMgr* clog_mgr_; // log service global Line Cache diff --git a/src/clog/ob_external_log_service_monitor.h b/src/clog/ob_external_log_service_monitor.h index 7e5f899d1..ef1205d20 100644 --- a/src/clog/ob_external_log_service_monitor.h +++ b/src/clog/ob_external_log_service_monitor.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace logservice { class ObExtLogServiceMonitor { - public: +public: inline static void locate_count() { ATOMIC_INC(&locate_count_); @@ -214,7 +214,7 @@ class ObExtLogServiceMonitor { return dividend == 0 ? 0 : divisor / dividend; } - private: +private: // request count static int64_t locate_count_; static int64_t open_count_; diff --git a/src/clog/ob_external_start_log_locator.h b/src/clog/ob_external_start_log_locator.h index 4fa42ea41..31016e549 100644 --- a/src/clog/ob_external_start_log_locator.h +++ b/src/clog/ob_external_start_log_locator.h @@ -79,7 +79,7 @@ typedef obrpc::ObLogReqStartLogIdByTsResponseWithBreakpoint ObLocateByTsResp; // Qit for quit in time class ObExtRpcQit { - public: +public: ObExtRpcQit() : deadline_(common::OB_INVALID_TIMESTAMP) {} int init(const int64_t deadline); @@ -87,7 +87,7 @@ class ObExtRpcQit { bool should_hurry_quit() const; TO_STRING_KV(K(deadline_)); - private: +private: static const int64_t RESERVED_INTERVAL = 1 * 1000 * 1000; // 1 second int64_t deadline_; }; @@ -151,7 +151,7 @@ struct SearchStatus { TO_STRING_KV(K_(start_ts), K_(err), K_(start_log_id), K_(start_log_ts), K_(min_greater_log_id), K_(min_greater_log_ts), K_(finished)); - private: +private: DISALLOW_COPY_AND_ASSIGN(SearchStatus); }; @@ -160,7 +160,7 @@ typedef common::ObLinearHashMap SearchMap // SearchParam is to simplify the code structure and avoid passing too many parameters. // SearchParam mainly encapsulated some distributors. struct SearchParam { - public: +public: common::PageArena<>* map_allocator_; SearchParam() : map_allocator_(NULL) @@ -182,12 +182,12 @@ struct SearchParam { } TO_STRING_KV(KP(map_allocator_)); - private: +private: DISALLOW_COPY_AND_ASSIGN(SearchParam); }; class ObExtStartLogLocatorForDir { - public: +public: ObExtStartLogLocatorForDir() : is_inited_(false), partition_service_(NULL), log_engine_(NULL) {} ~ObExtStartLogLocatorForDir() @@ -198,7 +198,7 @@ class ObExtStartLogLocatorForDir { void destroy(); int locator_req(const ObLocateByTsReq& req_msg, ObLocateByTsResp& result, bool& is_hurry_quit); - private: +private: inline int64_t get_rpc_deadline() const { return THIS_WORKER.get_timeout_ts(); @@ -217,17 +217,17 @@ class ObExtStartLogLocatorForDir { int do_locator_req( const ObLocateByTsReq& req_msg, ObLocateByTsResp& response, const ObExtRpcQit& qit, bool& is_hurry_quit); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExtStartLogLocatorForDir); - private: +private: bool is_inited_; storage::ObPartitionService* partition_service_; clog::ObILogEngine* log_engine_; }; class ObExtStartLogLocator { - public: +public: ObExtStartLogLocator() : is_inited_(false), partition_service_(NULL), log_engine_(NULL) {} @@ -244,13 +244,13 @@ class ObExtStartLogLocator { int init(storage::ObPartitionService* partition_service, clog::ObILogEngine* log_engine); int req_start_log_id_by_ts_with_breakpoint(const ObLocateByTsReq& req_msg, ObLocateByTsResp& result); - private: +private: int do_req_start_log_id(const ObLocateByTsReq& req, ObLocateByTsResp& resp); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExtStartLogLocator); - private: +private: bool is_inited_; storage::ObPartitionService* partition_service_; clog::ObILogEngine* log_engine_; diff --git a/src/clog/ob_external_stream.h b/src/clog/ob_external_stream.h index d64914b43..e8ead2339 100644 --- a/src/clog/ob_external_stream.h +++ b/src/clog/ob_external_stream.h @@ -154,14 +154,14 @@ struct ObStreamItem { TO_STRING_KV(K(pkey_), K(next_log_id_), K(fetch_progress_ts_), K(last_slide_log_id_), K(fetch_rpc_id_), K(need_fetch_status_), K(next_cursor_), K(cursor_array_size_)); - private: +private: uint64_t get_last_slide_log_id_(const ObPartitionKey& pkey, storage::ObPartitionService& part_service); }; typedef common::ObSEArray ObStreamItemArray; class ObStream { - public: +public: ObStream() : processing_(false), liboblog_instance_id_(), @@ -243,11 +243,11 @@ class ObStream { DECLARE_TO_STRING; void print_basic_info(const int64_t stream_idx, const obrpc::ObStreamSeq& stream_seq) const; - public: +public: // maximum number of files to be cached static const int64_t MAX_CACHED_FILE_COUNT = 10; - public: +public: struct LiboblogInstanceId { common::ObAddr addr_; uint64_t peer_pid_; @@ -269,10 +269,10 @@ class ObStream { TO_STRING_KV(K(addr_), K(peer_pid_)); }; - private: +private: static const bool PRINT_STREAM_VERBOSE = false; - private: +private: // The Stream information maintained by the server does not allow concurrent modification. Use this mark to check. bool processing_; // LiboblogInstanceId is only used for debugging, since may be multiple liboblogs pulling the same cluster. diff --git a/src/clog/ob_external_traffic_controller.h b/src/clog/ob_external_traffic_controller.h index a0b1b2433..d707426b4 100644 --- a/src/clog/ob_external_traffic_controller.h +++ b/src/clog/ob_external_traffic_controller.h @@ -23,7 +23,7 @@ namespace logservice { // Subsequent consideration is to implement flow control at the request level, // control whether ack packet needs to wait, and control the ack frequency. class ObExtTrafficController { - public: +public: ObExtTrafficController() { reset(); @@ -109,12 +109,12 @@ class ObExtTrafficController { "read_clog_disk_count_", ATOMIC_LOAD(&read_clog_disk_count_), "read_ilog_disk_count_", ATOMIC_LOAD(&read_ilog_disk_count_), "read_info_block_disk_count_", ATOMIC_LOAD(&read_info_block_disk_count_)); - private: +private: static const int64_t C = 100; // coefficient static const int64_t TIRED_INTERVAL = 1000 * 1000; // 1 second static const int64_t TRAFFIC_SIZE_LIMIT = 800 * 1024 * 1024 * C; // 800 M static const int64_t READ_DISK_COUNT_LIMIT = 8192 * C; // 8K - private: +private: int64_t last_limit_ts_; int64_t traffic_size_; int64_t read_clog_disk_count_; // times of disk reads when reading clog diff --git a/src/clog/ob_fetch_log_engine.h b/src/clog/ob_fetch_log_engine.h index 6d2220196..65261a015 100644 --- a/src/clog/ob_fetch_log_engine.h +++ b/src/clog/ob_fetch_log_engine.h @@ -24,7 +24,7 @@ class ObPartitionService; } namespace clog { class ObFetchLogTask { - public: +public: ObFetchLogTask() : is_inited_(false) { reset(); @@ -39,7 +39,7 @@ class ObFetchLogTask { reset(); } - public: +public: int init(const common::ObPartitionKey& partition_key, const common::ObAddr& server, const int64_t cluster_id, const uint64_t start_log_id, const uint64_t end_log_id, const ObFetchLogType fetch_type, const common::ObProposalID& proposal_id, const int64_t network_limit); @@ -83,10 +83,10 @@ class ObFetchLogTask { TO_STRING_KV(K_(timestamp), K_(partition_key), K_(server), K_(cluster_id), K_(start_log_id), K_(end_log_id), K_(fetch_type), K_(proposal_id), K_(network_limit)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFetchLogTask); - private: +private: bool is_inited_; int64_t timestamp_; common::ObPartitionKey partition_key_; @@ -100,35 +100,35 @@ class ObFetchLogTask { }; class ObIFetchLogEngine { - public: +public: ObIFetchLogEngine() {} virtual ~ObIFetchLogEngine() {} - public: +public: virtual int submit_fetch_log_task(ObFetchLogTask* fetch_log_task) = 0; }; class ObFetchLogEngine : public ObIFetchLogEngine, public lib::TGTaskHandler { - public: +public: ObFetchLogEngine() : is_inited_(false), partition_service_(NULL) {} virtual ~ObFetchLogEngine() {} - public: +public: int init(storage::ObPartitionService* partition_service); int destroy(); virtual int submit_fetch_log_task(ObFetchLogTask* fetch_log_task); - public: +public: virtual void handle(void* task); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFetchLogEngine); - private: +private: bool is_inited_; bool is_task_queue_timeout_(ObFetchLogTask* fetch_log_task) const; storage::ObPartitionService* partition_service_; diff --git a/src/clog/ob_file_id_cache.cpp b/src/clog/ob_file_id_cache.cpp index f9c04bb54..eed05ca70 100644 --- a/src/clog/ob_file_id_cache.cpp +++ b/src/clog/ob_file_id_cache.cpp @@ -21,7 +21,7 @@ namespace clog { // Not thread safe template class ObLog2FileList : public ObISegArray { - public: +public: ObLog2FileList() : is_inited_(false), item_cnt_(0), allocator_(NULL), head_(NULL), tail_(NULL) {} @@ -34,7 +34,7 @@ class ObLog2FileList : public ObISegArray { tail_ = NULL; } - public: +public: virtual int init(ObSmallAllocator* allocator) override { int ret = OB_SUCCESS; @@ -185,7 +185,7 @@ class ObLog2FileList : public ObISegArray { return sizeof(DListNode); } - private: +private: bool is_empty_() const { return head_ == NULL && tail_ == NULL; @@ -243,27 +243,27 @@ class ObLog2FileList : public ObISegArray { return ret; } - private: +private: friend class ObFileIdList; class DListNode { - public: + public: DListNode() : value_(), next_(NULL), prev_(NULL) {} - public: + public: T value_; DListNode* next_; DListNode* prev_; }; - private: +private: bool is_inited_; int32_t item_cnt_; ObSmallAllocator* allocator_; DListNode* head_; DListNode* tail_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLog2FileList); }; diff --git a/src/clog/ob_file_id_cache.h b/src/clog/ob_file_id_cache.h index 983d6fa0a..c121d8988 100644 --- a/src/clog/ob_file_id_cache.h +++ b/src/clog/ob_file_id_cache.h @@ -53,7 +53,7 @@ class ObIlogAccessor; // // When querying (p2, 170), first find the ordered list corresponding to p2, and then, use binary search. class Log2File { - public: +public: Log2File() : file_id_(common::OB_INVALID_FILE_ID), // For version after 2.1(include 2.1), start_offset correspond to the offset @@ -72,7 +72,7 @@ class Log2File { reset(); } - public: +public: file_id_t get_file_id() const { return file_id_; @@ -240,7 +240,7 @@ class Log2File { TO_STRING_KV(K_(file_id), K_(start_offset), K_(min_log_id), "max_log_id", get_max_log_id(), K_(min_log_timestamp), "max_log_timestamp", get_max_log_timestamp()); - private: +private: file_id_t file_id_; offset_t start_offset_; uint64_t min_log_id_; @@ -250,7 +250,7 @@ class Log2File { }; struct ObLogBasePos { - public: +public: ObLogBasePos() { reset(); @@ -266,7 +266,7 @@ struct ObLogBasePos { } TO_STRING_KV(K(file_id_), K(base_offset_)); - public: +public: file_id_t file_id_; offset_t base_offset_; }; @@ -274,7 +274,7 @@ struct ObLogBasePos { class ObFileIdCache; class ObIFileIdCachePurgeStrategy { - public: +public: ObIFileIdCachePurgeStrategy() {} virtual ~ObIFileIdCachePurgeStrategy() @@ -286,7 +286,7 @@ class ObIFileIdCachePurgeStrategy { }; class ObFileIdCachePurgeByFileId : public ObIFileIdCachePurgeStrategy { - public: +public: explicit ObFileIdCachePurgeByFileId(const file_id_t min_file_id, ObFileIdCache& file_id_cache); ~ObFileIdCachePurgeByFileId(); bool can_purge(const Log2File& log_2_file, const common::ObPartitionKey& unused_pkey) const final; @@ -294,13 +294,13 @@ class ObFileIdCachePurgeByFileId : public ObIFileIdCachePurgeStrategy { bool need_wait(bool& need_print_error) const final; TO_STRING_KV(K(min_file_id_)); - private: +private: file_id_t min_file_id_; ObFileIdCache& file_id_cache_; }; class ObFileIdCachePurgeByTimestamp : public ObIFileIdCachePurgeStrategy { - public: +public: explicit ObFileIdCachePurgeByTimestamp(const int64_t max_decided_trans_version, const int64_t min_timestamp, ObIlogAccessor& ilog_accessor, ObFileIdCache& file_id_cache); ~ObFileIdCachePurgeByTimestamp(); @@ -309,7 +309,7 @@ class ObFileIdCachePurgeByTimestamp : public ObIFileIdCachePurgeStrategy { bool need_wait(bool& need_print_error) const final; TO_STRING_KV(K(max_decided_trans_version_), K(min_timestamp_)); - private: +private: int64_t max_decided_trans_version_; int64_t min_timestamp_; ObIlogAccessor& ilog_accessor_; @@ -317,9 +317,9 @@ class ObFileIdCachePurgeByTimestamp : public ObIFileIdCachePurgeStrategy { }; class ObFileIdList { - public: +public: class BackFillFunctor { - public: + public: BackFillFunctor() : err_(common::OB_SUCCESS), file_id_(common::OB_INVALID_FILE_ID), start_offset_(OB_INVALID_OFFSET) {} int init(const file_id_t file_id, const offset_t start_offset); @@ -330,14 +330,14 @@ class ObFileIdList { } TO_STRING_KV(K(err_), K(file_id_), K(start_offset_)); - private: + private: int err_; file_id_t file_id_; offset_t start_offset_; }; class IPurgeChecker { - public: + public: virtual bool should_purge(const Log2File& log_2_file) const = 0; virtual bool is_valid() const = 0; DECLARE_VIRTUAL_TO_STRING = 0; @@ -345,7 +345,7 @@ class ObFileIdList { // purge min // should_purge return true if min_log_id > top_item.file_id_ class PurgeChecker : public IPurgeChecker { - public: + public: explicit PurgeChecker(const common::ObPartitionKey& pkey, ObIFileIdCachePurgeStrategy& purge_strategy) : partition_key_(pkey), purge_strategy_(purge_strategy) {} @@ -356,7 +356,7 @@ class ObFileIdList { bool should_purge(const Log2File& log_2_file) const; TO_STRING_KV(K(purge_strategy_), K(partition_key_)); - private: + private: common::ObPartitionKey partition_key_; ObIFileIdCachePurgeStrategy& purge_strategy_; }; @@ -365,7 +365,7 @@ class ObFileIdList { // Because loading an InfoBlock involves multiple partitions, if only load a part of them, // then all of this load must be cleaned up class ClearBrokenFunctor : public IPurgeChecker { - public: + public: explicit ClearBrokenFunctor(const file_id_t file_id) : broken_file_id_(file_id) {} bool is_valid() const @@ -375,18 +375,18 @@ class ObFileIdList { bool should_purge(const Log2File& log_2_file) const; TO_STRING_KV(K(broken_file_id_)); - private: + private: file_id_t broken_file_id_; }; - public: +public: ObFileIdList(); ~ObFileIdList() { destroy(); } - public: +public: int init(common::ObSmallAllocator* seg_array_allocator, common::ObSmallAllocator* seg_item_allocator, common::ObSmallAllocator* log2file_list_allocator, common::ObSmallAllocator* list_item_allocator, ObFileIdCache* file_id_cache); @@ -413,14 +413,14 @@ class ObFileIdList { static const int64_t SEG_COUNT = 500; static const int64_t NEED_USE_SEG_ARRAY_THRESHOLD = 50; - private: +private: int purge_(const bool is_front_end, IPurgeChecker& checker, bool& empty); int purge_preceding_items_(const common::ObPartitionKey& pkey, const Log2File& last_item); // The caller guarantees that the function will not be executed concurrently int prepare_container_(); int move_item_to_seg_array_(common::ObISegArray* tmp_container_ptr) const; - private: +private: bool is_inited_; bool use_seg_array_; uint64_t min_continuous_log_id_; @@ -433,16 +433,16 @@ class ObFileIdList { common::ObSmallAllocator* log2file_list_allocator_; common::ObSmallAllocator* list_item_allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFileIdList); }; class ObFileIdCache { - public: +public: ObFileIdCache(); ~ObFileIdCache(); - public: +public: int init(const int64_t server_seq, const common::ObAddr& addr, ObIlogAccessor* ilog_accessor); void destroy(); @@ -467,9 +467,9 @@ class ObFileIdCache { int get_cursor_from_file( const common::ObPartitionKey& pkey, const uint64_t log_id, const Log2File& item, ObLogCursorExt& log_cursor); - private: +private: class AppendInfoFunctor { - public: + public: int init(const file_id_t file_id, ObFileIdCache* cache); bool operator()(const common::ObPartitionKey& pkey, const IndexInfoBlockEntry& entry); int get_err() const @@ -478,14 +478,14 @@ class ObFileIdCache { } TO_STRING_KV(K(file_id_), K(err_)); - private: + private: int err_; file_id_t file_id_; ObFileIdCache* cache_; }; // Ensure that the loading process is atomic class ObUndoAppendFunctor { - public: + public: explicit ObUndoAppendFunctor(const file_id_t broken_file_id) : broken_file_id_(broken_file_id) {} bool operator()(const common::ObPartitionKey& pkey, ObFileIdList* list); @@ -495,12 +495,12 @@ class ObFileIdCache { } TO_STRING_KV(K(broken_file_id_), K(dead_pkeys_)); - private: + private: file_id_t broken_file_id_; common::ObPartitionArray dead_pkeys_; }; class ObPurgeFunctor { - public: + public: explicit ObPurgeFunctor(ObIFileIdCachePurgeStrategy& purge_strategy) : purge_strategy_(purge_strategy), next_can_purge_log2file_timestamp_(common::OB_INVALID_TIMESTAMP) {} @@ -518,13 +518,13 @@ class ObFileIdCache { return next_can_purge_log2file_timestamp_; } - private: + private: ObIFileIdCachePurgeStrategy& purge_strategy_; common::ObPartitionArray dead_pkeys_; int64_t next_can_purge_log2file_timestamp_; }; class LogContinuousFunctor { - public: + public: explicit LogContinuousFunctor(const uint64_t log_id, const uint64_t memstore_min_log_id) : log_id_(log_id), memstore_min_log_id_(memstore_min_log_id), is_continuous_(false), next_item_() {} @@ -534,14 +534,14 @@ class ObFileIdCache { return is_continuous_; } - private: + private: uint64_t log_id_; uint64_t memstore_min_log_id_; bool is_continuous_; Log2File next_item_; }; class DestroyListFunctor { - public: + public: explicit DestroyListFunctor(common::ObSmallAllocator& list_allocator) : list_allocator_(list_allocator) {} int operator()(const common::ObPartitionKey& pkey, const ObFileIdList* list) @@ -559,11 +559,11 @@ class ObFileIdCache { return common::OB_SUCCESS == ret; } - private: + private: common::ObSmallAllocator& list_allocator_; }; - private: +private: int append_(const file_id_t file_id, IndexInfoBlockMap& index_info_block_map); int append_(const common::ObPartitionKey& pkey, const file_id_t file_id, const offset_t start_offset, const uint64_t min_log_id, const uint64_t max_log_id, const int64_t min_log_timestamp, @@ -577,7 +577,7 @@ class ObFileIdCache { int undo_append_(const file_id_t broken_file_id); int check_need_filter_partition_(const common::ObPartitionKey& pkey, const uint64_t max_log_id, bool& need_filter); - private: +private: typedef common::SpinRWLock RWLock; typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; @@ -598,7 +598,7 @@ class ObFileIdCache { common::ObLinearHashMap map_; common::ObLinearHashMap filter_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFileIdCache); }; diff --git a/src/clog/ob_i_disk_log_buffer.h b/src/clog/ob_i_disk_log_buffer.h index b0a064914..9f3036705 100644 --- a/src/clog/ob_i_disk_log_buffer.h +++ b/src/clog/ob_i_disk_log_buffer.h @@ -17,13 +17,13 @@ namespace oceanbase { namespace clog { class ObDiskBufferTask : public ObIBufferTask { - public: +public: ObDiskBufferTask() : proposal_id_(), buf_(NULL), len_(0), offset_(0) { need_callback_ = true; } - public: +public: void reset(); void set(char* buf, const int64_t len); common::ObProposalID get_proposal_id() const @@ -45,27 +45,27 @@ class ObDiskBufferTask : public ObIBufferTask { // st == single thread virtual int st_after_consume(const int handle_err) = 0; - protected: +protected: int fill_buffer(char* buf, const offset_t offset); - protected: +protected: common::ObProposalID proposal_id_; char* buf_; int64_t len_; offset_t offset_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDiskBufferTask); }; class ObIDiskLogBuffer { - public: +public: ObIDiskLogBuffer() {} virtual ~ObIDiskLogBuffer() {} - private: +private: virtual int submit(ObIBufferTask* task) = 0; }; }; // end namespace clog diff --git a/src/clog/ob_i_log_engine.h b/src/clog/ob_i_log_engine.h index b770418b2..6a1d2f0eb 100644 --- a/src/clog/ob_i_log_engine.h +++ b/src/clog/ob_i_log_engine.h @@ -31,16 +31,16 @@ class ObCommitLogEnv; class ObIndexLogEnv; class ObLogCache; class ObILogEngine { - public: +public: typedef ObDiskBufferTask FlushTask; - public: +public: ObILogEngine() {} virtual ~ObILogEngine() {} - public: +public: virtual ObIRawLogIterator* alloc_raw_log_iterator( const file_id_t start_file_id, const file_id_t end_file_id, const offset_t offset, const int64_t timeout) = 0; virtual void revert_raw_log_iterator(ObIRawLogIterator* iter) = 0; @@ -199,7 +199,7 @@ class ObILogEngine { }; class ObILogNetTask { - public: +public: virtual ~ObILogNetTask() {} virtual const char* get_data_buffer() const = 0; @@ -208,7 +208,7 @@ class ObILogNetTask { }; class ObLogNetTask : public ObILogNetTask { - public: +public: ObLogNetTask(common::ObProposalID proposal_id, const char* buff, int64_t data_len) : proposal_id_(proposal_id), buff_(buff), data_len_(data_len) {} @@ -225,12 +225,12 @@ class ObLogNetTask : public ObILogNetTask { return data_len_; } - private: +private: common::ObProposalID proposal_id_; const char* buff_; int64_t data_len_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogNetTask); }; } // end namespace clog diff --git a/src/clog/ob_i_partition_log_packet_handler.h b/src/clog/ob_i_partition_log_packet_handler.h index 3367e6809..c58fadbbe 100644 --- a/src/clog/ob_i_partition_log_packet_handler.h +++ b/src/clog/ob_i_partition_log_packet_handler.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace clog { struct ObLogReqContext; class ObIPartitionLogPacketHandler { - public: +public: ObIPartitionLogPacketHandler() {} virtual ~ObIPartitionLogPacketHandler() diff --git a/src/clog/ob_i_submit_log_cb.h b/src/clog/ob_i_submit_log_cb.h index 8b72debf0..a2e359de2 100644 --- a/src/clog/ob_i_submit_log_cb.h +++ b/src/clog/ob_i_submit_log_cb.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace clog { class ObISubmitLogCb { - public: +public: ObISubmitLogCb() : next_(NULL), submit_timestamp_(0), need_post_cb_(false), is_high_priority_(false) {} virtual ~ObISubmitLogCb() @@ -29,7 +29,7 @@ class ObISubmitLogCb { is_high_priority_ = false; } - public: +public: // batch_committed: // For distributed transactions of batch commit type, this value is used to notify the upper-layer transaction // whether the commit is successful batch_committed = true @@ -88,7 +88,7 @@ class ObISubmitLogCb { return is_high_priority_; } - public: +public: ObISubmitLogCb* next_; int64_t submit_timestamp_; bool need_post_cb_; @@ -97,13 +97,13 @@ class ObISubmitLogCb { }; class ObSubmitLogDummyCb : public ObISubmitLogCb { - public: +public: ObSubmitLogDummyCb() {} ~ObSubmitLogDummyCb() {} - public: +public: int on_success(const common::ObPartitionKey& partition_key, const clog::ObLogType log_type, const uint64_t log_id, const int64_t version, const bool batch_committed, const bool batch_last_succeed) { diff --git a/src/clog/ob_ilog_cache.h b/src/clog/ob_ilog_cache.h index c86560f8e..e28586e63 100644 --- a/src/clog/ob_ilog_cache.h +++ b/src/clog/ob_ilog_cache.h @@ -93,7 +93,7 @@ struct ObIlogPerFileCacheWrapper { // value in map class ObIlogPerFileCacheNode { - public: +public: ObIlogPerFileCacheNode(); ~ObIlogPerFileCacheNode(); bool is_valid() const @@ -143,7 +143,7 @@ class ObIlogPerFileCacheNode { } TO_STRING_KV("node_status", ATOMIC_LOAD(&node_status_), KP_(cache_wrapper), KP(wrapper_allocator_), K_(seq)); - private: +private: void destroy_wrapper(); static int64_t alloc_seq() { @@ -151,7 +151,7 @@ class ObIlogPerFileCacheNode { return ATOMIC_AAF(&s_seq, 1); } - private: +private: NodeStatus node_status_; int64_t seq_; ObIlogPerFileCacheWrapper* cache_wrapper_; @@ -206,9 +206,9 @@ struct NodeItem { typedef common::ObSEArray NodeItemArray; class ObIlogCache { - private: +private: class NodeReadyMarker { - public: + public: explicit NodeReadyMarker(const int64_t seq) : err_(common::OB_SUCCESS), owner_seq_(seq), owner_match_(true) {} bool operator()(const file_id_t file_id, ObIlogPerFileCacheNode& node); @@ -222,7 +222,7 @@ class ObIlogCache { } TO_STRING_KV(K(err_), K(owner_seq_), K(owner_match_)); - private: + private: int err_; int64_t owner_seq_; bool owner_match_; // for debug @@ -230,7 +230,7 @@ class ObIlogCache { }; class GetNodeFunctor { - public: + public: GetNodeFunctor() : err_(common::OB_SUCCESS) {} bool operator()(const file_id_t file_id, ObIlogPerFileCacheNode& node); @@ -244,13 +244,13 @@ class ObIlogCache { } TO_STRING_KV(K(err_)); - private: + private: int err_; ObIlogPerFileCacheNode node_; }; class EraseNodeFunctor { - public: + public: EraseNodeFunctor() : err_(common::OB_SUCCESS) {} bool operator()(const file_id_t file_id, ObIlogPerFileCacheNode& node); @@ -260,12 +260,12 @@ class ObIlogCache { } TO_STRING_KV(K(err_)); - private: + private: int err_; }; class VictimPicker { - public: + public: VictimPicker() : err_(common::OB_SUCCESS), count_(0), @@ -291,9 +291,9 @@ class ObIlogCache { } TO_STRING_KV(K(err_), K(count_), K(victim_), K(min_access_ts_)); - private: + private: static const int64_t LARGE_ENOUGH_TIMESTAMP = 5000000000000000; // 2128-06-11 16:53:20 - private: + private: int err_; int count_; file_id_t victim_; @@ -301,7 +301,7 @@ class ObIlogCache { }; class ExpiredNodesPicker { - public: + public: explicit ExpiredNodesPicker(FileIdArray& expired_file_id_arr) : err_(common::OB_SUCCESS), expired_file_id_arr_(expired_file_id_arr) {} @@ -316,15 +316,15 @@ class ObIlogCache { } TO_STRING_KV(K(err_), K(expired_file_id_arr_)); - private: + private: static const int64_t EXPIRED_INVTERVAL = 600L * 1000L * 1000L; // 10 min - private: + private: int err_; FileIdArray& expired_file_id_arr_; }; class AllFileIdGetter { - public: + public: explicit AllFileIdGetter(FileIdArray& all_file_id_arr) : err_(common::OB_SUCCESS), all_file_id_arr_(all_file_id_arr) {} bool operator()(const file_id_t file_id, ObIlogPerFileCacheNode& node); @@ -334,13 +334,13 @@ class ObIlogCache { } TO_STRING_KV(K(err_), K(all_file_id_arr_)); - private: + private: int err_; FileIdArray& all_file_id_arr_; }; class RemoveNodeFunctor { - public: + public: RemoveNodeFunctor() : count_(0) {} ~RemoveNodeFunctor() @@ -349,7 +349,7 @@ class ObIlogCache { } bool operator()(const file_id_t file_id, ObIlogPerFileCacheNode& node); - private: + private: int count_; }; @@ -375,7 +375,7 @@ class ObIlogCache { }; class NodeReporter { - public: + public: NodeReporter() : arr_() {} ~NodeReporter() @@ -391,11 +391,11 @@ class ObIlogCache { } DECLARE_TO_STRING; - private: + private: NodeItemArray arr_; }; - public: +public: ObIlogCache() : is_inited_(false), wrapper_allocator_(), node_map_(), config_(), statistic_(), pf_cache_builder_(NULL) {} int init(const ObIlogCacheConfig& config, ObIlogPerFileCacheBuilder* pf_cache_builder); @@ -414,7 +414,7 @@ class ObIlogCache { const uint64_t min_log_id, const uint64_t max_log_id, const offset_t start_offset_index, uint64_t& target_log_id, int64_t& target_log_timestamp); - private: +private: int do_locate_by_timestamp_(const file_id_t file_id, const common::ObPartitionKey& pkey, const int64_t start_ts, const uint64_t min_log_id, const uint64_t max_log_id, const offset_t start_offset_index, uint64_t& target_log_id, int64_t& target_log_timestamp, ObIlogStorageQueryCost& csr_cost); @@ -440,10 +440,10 @@ class ObIlogCache { int get_expired_arr(FileIdArray& file_id_arr); int get_all_file_id_arr(FileIdArray& all_file_id_arr); - private: +private: static const file_id_t PRELOAD_AHEAD = 5; - private: +private: bool is_inited_; common::ObSmallAllocator wrapper_allocator_; common::ObLinearHashMap node_map_; diff --git a/src/clog/ob_ilog_file_builder.cpp b/src/clog/ob_ilog_file_builder.cpp index 870bc08fa..269c0efa7 100644 --- a/src/clog/ob_ilog_file_builder.cpp +++ b/src/clog/ob_ilog_file_builder.cpp @@ -25,13 +25,13 @@ namespace oceanbase { using namespace common; namespace clog { class ObIlogFileBuilder::PrepareRawArrayFunctor { - public: +public: explicit PrepareRawArrayFunctor(RawArray& raw_array) : raw_array_(raw_array), curr_idx_(0) {} ~PrepareRawArrayFunctor() {} - public: +public: bool operator()(const ObPartitionLogInfo& partition_log_info, ObLogCursorExt& log_cursor_ext) { bool bool_ret = false; @@ -58,22 +58,22 @@ class ObIlogFileBuilder::PrepareRawArrayFunctor { return bool_ret; } - private: +private: RawArray& raw_array_; int64_t curr_idx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(PrepareRawArrayFunctor); }; class ObIlogFileBuilder::UpdateStartOffsetFunctor { - public: +public: explicit UpdateStartOffsetFunctor(const offset_t start_offset) : start_offset_(start_offset) {} ~UpdateStartOffsetFunctor() {} - public: +public: bool operator()(const common::ObPartitionKey& partition_key, IndexInfoBlockEntry& index_info_block_entry) { bool bool_ret = false; @@ -86,21 +86,21 @@ class ObIlogFileBuilder::UpdateStartOffsetFunctor { return bool_ret; } - private: +private: offset_t start_offset_; - private: +private: DISALLOW_COPY_AND_ASSIGN(UpdateStartOffsetFunctor); }; class ObIlogFileBuilder::BuildArrayMapFunctor { - public: +public: explicit BuildArrayMapFunctor(IndexInfoBlockMap& index_info_block_map) : index_info_block_map_(index_info_block_map) {} ~BuildArrayMapFunctor() {} - public: +public: bool operator()(const common::ObPartitionKey& partition_key, IndexInfoBlockEntry& index_info_block_entry) { int ret = OB_SUCCESS; @@ -113,21 +113,21 @@ class ObIlogFileBuilder::BuildArrayMapFunctor { return bool_ret; } - private: +private: IndexInfoBlockMap& index_info_block_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(BuildArrayMapFunctor); }; class ObIlogFileBuilder::BuildMemberListMapFunctor { - public: +public: explicit BuildMemberListMapFunctor(MemberListMap& memberlist_map) : memberlist_map_(memberlist_map) {} ~BuildMemberListMapFunctor() {} - public: +public: bool operator()(const common::ObPartitionKey& partition_key, MemberListInfo& memberlist_info) { int ret = OB_SUCCESS; @@ -140,10 +140,10 @@ class ObIlogFileBuilder::BuildMemberListMapFunctor { return bool_ret; } - private: +private: MemberListMap& memberlist_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(BuildMemberListMapFunctor); }; diff --git a/src/clog/ob_ilog_file_builder.h b/src/clog/ob_ilog_file_builder.h index 93b7fd7e2..c0d3a54b6 100644 --- a/src/clog/ob_ilog_file_builder.h +++ b/src/clog/ob_ilog_file_builder.h @@ -24,7 +24,7 @@ namespace clog { class PinnedMemory; class MemberListInfo { - public: +public: MemberListInfo() : memberlist_(), replica_num_(0), @@ -34,7 +34,7 @@ class MemberListInfo { ~MemberListInfo() {} - public: +public: const common::ObMemberList& get_memberlist() const { return memberlist_; @@ -61,7 +61,7 @@ class MemberListInfo { } TO_STRING_KV(K(memberlist_), K(replica_num_), K(membership_log_id_), K(memberlist_version_)); - private: +private: common::ObMemberList memberlist_; int64_t replica_num_; uint64_t membership_log_id_; @@ -72,11 +72,11 @@ typedef common::ObArrayHashMap MemberLis class ObIlogMemstore; class RawArray; class ObIlogFileBuilder { - public: +public: ObIlogFileBuilder(); ~ObIlogFileBuilder(); - public: +public: int init(ObIlogMemstore* ilog_memstore, PinnedMemory* pinned_memory); void destroy(); @@ -86,7 +86,7 @@ class ObIlogFileBuilder { return index_info_block_map_; } - private: +private: class PrepareRawArrayFunctor; class UpdateStartOffsetFunctor; class BuildArrayMapFunctor; @@ -111,7 +111,7 @@ class ObIlogFileBuilder { bool check_ilog_continous_( const uint64_t min_log_id, const uint64_t max_log_id, const uint64_t last_log_id, const uint64_t curr_log_id); - private: +private: bool is_inited_; ObIlogMemstore* ilog_memstore_; char* buffer_; @@ -122,7 +122,7 @@ class ObIlogFileBuilder { common::PageArena<> page_arena_; common::ObTimeGuard time_guard_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIlogFileBuilder); }; } // namespace clog diff --git a/src/clog/ob_ilog_memstore.h b/src/clog/ob_ilog_memstore.h index 5cf17d6af..02ad7ba69 100644 --- a/src/clog/ob_ilog_memstore.h +++ b/src/clog/ob_ilog_memstore.h @@ -35,11 +35,11 @@ enum ObIlogFreezeTriggerType { class ObIlogMemstore { friend ObIlogFileBuilder; - public: +public: ObIlogMemstore(); ~ObIlogMemstore(); - public: +public: typedef common::ObLinearHashMap PartitionMetaInfo; typedef common::ObLinearHashMap PartitionMemberListInfo; typedef common::ObLinearHashMap PartitionLogCursorExtInfo; @@ -123,11 +123,11 @@ class ObIlogMemstore { int get_index_entry(const common::ObPartitionKey& partition_key, IndexInfoBlockEntry& index_info_block_entry) const; TO_STRING_KV(K(create_ts_), K(cursor_size_), K(clog_size_), K(partition_meta_info_.count())); - public: +public: const static int64_t CURSOR_SIZE_TRIGGER = 32 * 1024 * 1024; // 32M const static int64_t CLOG_SIZE_TRIGGER = 1024 * 1024 * 1024; // 1G const static int64_t TIME_TRIGGER_US = 10 * 1000L * 1000L; // 10s - private: +private: int check_log_continuous_( const common::ObPartitionKey& partition_key, const uint64_t log_id, bool& log_continuous) const; int submit_cursor_( @@ -139,14 +139,14 @@ class ObIlogMemstore { const int64_t replica_num, const uint64_t membership_log_id, const int64_t memberlist_version); class PartitionMetaInfoFunctor { - public: + public: PartitionMetaInfoFunctor(const uint64_t log_id, const ObLogCursorExt& log_cursor_ext) : log_id_(log_id), log_cursor_ext_(log_cursor_ext) {} ~PartitionMetaInfoFunctor() {} - public: + public: bool operator()(const common::ObPartitionKey& partition_key, IndexInfoBlockEntry& index_info_block_entry) { UNUSED(partition_key); @@ -163,12 +163,12 @@ class ObIlogMemstore { return bool_ret; } - private: + private: uint64_t log_id_; ObLogCursorExt log_cursor_ext_; }; class MemberListInfoFunctor { - public: + public: MemberListInfoFunctor(const common::ObMemberList& memberlist, const int64_t replica_num, const uint64_t membership_log_id, const int64_t memberlist_version) : memberlist_(memberlist), @@ -179,7 +179,7 @@ class ObIlogMemstore { ~MemberListInfoFunctor() {} - public: + public: bool operator()(const common::ObPartitionKey& partition_key, MemberListInfo& memberlist_info) { UNUSED(partition_key); @@ -197,14 +197,14 @@ class ObIlogMemstore { return true; } - private: + private: common::ObMemberList memberlist_; int64_t replica_num_; uint64_t membership_log_id_; int64_t memberlist_version_; }; - private: +private: bool is_inited_; PartitionMetaInfo partition_meta_info_; PartitionMemberListInfo partition_memberlist_info_; @@ -217,7 +217,7 @@ class ObIlogMemstore { // The total size of clog in ilog_memstore int64_t clog_size_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIlogMemstore); }; } // namespace clog diff --git a/src/clog/ob_ilog_per_file_cache.h b/src/clog/ob_ilog_per_file_cache.h index 242a201fa..43f0f9197 100644 --- a/src/clog/ob_ilog_per_file_cache.h +++ b/src/clog/ob_ilog_per_file_cache.h @@ -37,7 +37,7 @@ struct RawArray { }; class ObIlogPerFileCache { - public: +public: ObIlogPerFileCache() : is_inited_(false), file_id_(common::OB_INVALID_FILE_ID), @@ -57,7 +57,7 @@ class ObIlogPerFileCache { } void destroy(); - public: +public: // append cursor to sorted array int append_cursor(const ObLogCursorExt& cursor); int query_cursor(const common::ObPartitionKey& pkey, const uint64_t query_log_id, const uint64_t min_log_id, @@ -66,11 +66,11 @@ class ObIlogPerFileCache { const uint64_t max_log_id, const offset_t start_offset_index, uint64_t& target_log_id, int64_t& target_log_timestamp); - private: +private: int binary_search_timestamp_from_cursor_array_(const ObLogCursorExt* csr_arr, const int64_t array_len, const int64_t start_ts, const ObLogCursorExt*& target_cursor); - private: +private: bool is_inited_; file_id_t file_id_; common::PageArena<>* pf_allocator_; @@ -86,11 +86,11 @@ class ObIlogPerFileCache { int ilog_entry_comparator(const void* e1, const void* e2); class ObIlogPerFileCacheBuilder { - public: +public: ObIlogPerFileCacheBuilder() : ilog_storage_(NULL), file_id_cache_(NULL) {} - public: +public: int init(ObIlogStorage* ilog_storage, ObFileIdCache* file_id_cache); void destroy() { @@ -100,9 +100,9 @@ class ObIlogPerFileCacheBuilder { int build_cache(const file_id_t file_id, ObIlogPerFileCache* pf_cache, common::PageArena<>& pf_page_arena, ObIlogStorageQueryCost& csr_cost); - private: +private: class BackfillGenerator { - public: + public: BackfillGenerator() { reset(); @@ -112,11 +112,11 @@ class ObIlogPerFileCacheBuilder { int track(const ObIndexEntry& ilog_entry, const int32_t array_index); int close(); - private: + private: int do_track_(const common::ObPartitionKey& pkey, const uint64_t log_id, const int32_t array_index); int end_cur_pkey_(); - private: + private: file_id_t file_id_; ObFileIdCache* file_id_cache_; offset_t cur_offset_; @@ -127,14 +127,14 @@ class ObIlogPerFileCacheBuilder { offset_t cur_start_offset_index_; }; - private: +private: inline ObLogCursorExt trim_to_cursor_(const ObIndexEntry& ilog_entry); int prepare_sorted_raw_array_(const file_id_t file_id, ObIRawIndexIterator* raw_ilog_iter, common::ObIAllocator& raw_entry_allocator, RawArray& raw_array, ObIlogStorageQueryCost& csr_cost); int build_pf_cache_(const file_id_t file_id, const RawArray& raw_array, ObIlogPerFileCache* pf_cache); static const int64_t ILOG_ENTRY_COUNT_PER_FILE = 2 * 1000 * 1000; - private: +private: ObIlogStorage* ilog_storage_; ObFileIdCache* file_id_cache_; }; diff --git a/src/clog/ob_ilog_storage.cpp b/src/clog/ob_ilog_storage.cpp index f55730069..3a378990d 100644 --- a/src/clog/ob_ilog_storage.cpp +++ b/src/clog/ob_ilog_storage.cpp @@ -596,7 +596,7 @@ int ObIlogAccessor::check_partition_ilog_can_be_purged(const common::ObPartition } class ObIlogStorage::PurgeCheckFunctor { - public: +public: PurgeCheckFunctor(ObIlogStorage* host, int64_t max_decided_trans_version, file_id_t file_id) : host_(host), max_decided_trans_version_(max_decided_trans_version), file_id_(file_id), can_purge_(true) {} @@ -604,7 +604,7 @@ class ObIlogStorage::PurgeCheckFunctor { ~PurgeCheckFunctor() {} - public: +public: bool operator()(const common::ObPartitionKey& partition_key, const IndexInfoBlockEntry& index_info_block_entry) { int ret = OB_SUCCESS; @@ -634,13 +634,13 @@ class ObIlogStorage::PurgeCheckFunctor { return can_purge_; } - private: +private: ObIlogStorage* host_; int64_t max_decided_trans_version_; file_id_t file_id_; bool can_purge_; - private: +private: DISALLOW_COPY_AND_ASSIGN(PurgeCheckFunctor); }; diff --git a/src/clog/ob_ilog_storage.h b/src/clog/ob_ilog_storage.h index 7f9666d70..8aa0066e3 100644 --- a/src/clog/ob_ilog_storage.h +++ b/src/clog/ob_ilog_storage.h @@ -34,12 +34,12 @@ class ObILogFileStore; namespace clog { class ObCommitLogEnv; class ObIlogAccessor { - public: +public: ObIlogAccessor(); virtual ~ObIlogAccessor(); virtual void destroy(); - public: +public: int init(const char* dir_name, const char* shm_path, const int64_t server_seq, const common::ObAddr& addr, ObLogCache* log_cache); @@ -69,7 +69,7 @@ class ObIlogAccessor { int check_partition_ilog_can_be_purged(const ObPartitionKey& pkey, const int64_t max_decided_trans_version, const uint64_t item_max_log_id, const int64_t item_max_log_ts, bool& can_purge); - protected: +protected: int handle_last_ilog_file_(const file_id_t file_id); int fill_file_id_cache_(const file_id_t file_id); int get_index_info_block_map_( @@ -81,7 +81,7 @@ class ObIlogAccessor { int write_old_version_trailer_(const file_id_t file_id, const offset_t offset); bool is_new_version_ilog_file_(const file_id_t file_id) const; - protected: +protected: ObILogFileStore* file_store_; ObFileIdCache file_id_cache_; ObAlignedBuffer buffer_; @@ -90,16 +90,16 @@ class ObIlogAccessor { ObLogDirectReader direct_reader_; file_id_t old_version_max_file_id_; - private: +private: bool inited_; }; class ObIlogStorage : public ObIlogAccessor { - public: +public: ObIlogStorage(); ~ObIlogStorage(); - public: +public: int init(const char* dir_name, const char* shm_path, const int64_t server_seq, const common::ObAddr& addr, ObLogCache* log_cache, storage::ObPartitionService* partition_service, ObCommitLogEnv* commit_log_env); void destroy(); @@ -107,7 +107,7 @@ class ObIlogStorage : public ObIlogAccessor { void stop(); void wait(); - public: +public: // Return value: // 1) OB_SUCCESS // 2) OB_ERR_OUT_OF_UPPER_BOUND @@ -164,30 +164,30 @@ class ObIlogStorage : public ObIlogAccessor { int get_next_ilog_file_id_from_memory(file_id_t& next_ilog_file_id) const; - private: +private: class PurgeCheckFunctor; class ObIlogStorageTimerTask : public common::ObTimerTask { - public: + public: ObIlogStorageTimerTask() : ilog_storage_(NULL) {} ~ObIlogStorageTimerTask() {} - public: + public: int init(ObIlogStorage* ilog_storage); virtual void runTimerTask(); - private: + private: void wash_ilog_cache_(); void purge_stale_file_(); void purge_stale_ilog_index_(); - private: + private: ObIlogStorage* ilog_storage_; }; static const int64_t TIMER_TASK_INTERVAL = 20L * 1000L * 1000L; - private: +private: int init_next_ilog_file_id_(file_id_t& next_ilog_file_id) const; int get_cursor_from_memstore_( const common::ObPartitionKey& partition_key, const uint64_t query_log_id, ObGetCursorResult& result); @@ -214,7 +214,7 @@ class ObIlogStorage : public ObIlogAccessor { int search_cursor_result_for_locate_( const ObGetCursorResult& result, const int64_t start_ts, const ObLogCursorExt*& target_cursor) const; - private: +private: bool is_inited_; storage::ObPartitionService* partition_service_; ObCommitLogEnv* commit_log_env_; @@ -223,7 +223,7 @@ class ObIlogStorage : public ObIlogAccessor { ObIlogCache ilog_cache_; ObIlogStorageTimerTask task_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIlogStorage); }; } // namespace clog diff --git a/src/clog/ob_ilog_store.cpp b/src/clog/ob_ilog_store.cpp index 392a7a466..67da312d6 100644 --- a/src/clog/ob_ilog_store.cpp +++ b/src/clog/ob_ilog_store.cpp @@ -103,13 +103,13 @@ void ObIlogStore::IlogWriterTask::runTimerTask() } class ObIlogStore::UpdateMaxFlushedIlogFunctor { - public: +public: UpdateMaxFlushedIlogFunctor(ObPartitionService* partition_service) : partition_service_(partition_service) {} ~UpdateMaxFlushedIlogFunctor() {} - public: +public: bool operator()(const common::ObPartitionKey& partition_key, const IndexInfoBlockEntry& index_info_block_entry) { int ret = OB_SUCCESS; @@ -133,15 +133,15 @@ class ObIlogStore::UpdateMaxFlushedIlogFunctor { return OB_SUCCESS == ret; } - private: +private: ObPartitionService* partition_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(UpdateMaxFlushedIlogFunctor); }; class ObIlogStore::MergeIlogMemstoreContainer { - public: +public: MergeIlogMemstoreContainer() : is_inited_(false) {} ~MergeIlogMemstoreContainer() @@ -246,13 +246,13 @@ class ObIlogStore::MergeIlogMemstoreContainer { return ret; } - private: +private: typedef ObHashMap::iterator InfoBlockIterator; typedef ObHashMap::iterator MemberListIterator; typedef ObHashMap::iterator LogCursorIterator; static const int64_t BUCKET_NUM = 1000 * 50; - private: +private: int insert_into_info_block_(const common::ObPartitionKey pkey, const IndexInfoBlockEntry& entry_to_merge) { int ret = OB_SUCCESS; @@ -313,7 +313,7 @@ class ObIlogStore::MergeIlogMemstoreContainer { } class MergePartitionMetaInfoFunctor { - public: + public: MergePartitionMetaInfoFunctor(MergeIlogMemstoreContainer& host) : host_(host), ret_code_(OB_SUCCESS) {} bool operator()(const ObPartitionKey& pkey, const IndexInfoBlockEntry& entry_to_merge) @@ -331,14 +331,14 @@ class ObIlogStore::MergeIlogMemstoreContainer { return ret_code_; } - private: + private: MergeIlogMemstoreContainer& host_; int ret_code_; }; // not support class MergePartitionMemberListInfoFunctor { - public: + public: MergePartitionMemberListInfoFunctor(MergeIlogMemstoreContainer& host) : host_(host), ret_code_(OB_SUCCESS) {} bool operator()(const ObPartitionKey& pkey, const MemberListInfo& memberlist_to_merge) @@ -356,13 +356,13 @@ class ObIlogStore::MergeIlogMemstoreContainer { return ret_code_; } - private: + private: MergeIlogMemstoreContainer& host_; int ret_code_; }; class MergeLogCursorInfoFunctor { - public: + public: MergeLogCursorInfoFunctor(MergeIlogMemstoreContainer& host) : host_(host), ret_code_(OB_SUCCESS) {} bool operator()(const ObPartitionLogInfo& log_info, const ObLogCursorExt& log_cursor_to_merge) @@ -379,7 +379,7 @@ class ObIlogStore::MergeIlogMemstoreContainer { return ret_code_; } - private: + private: MergeIlogMemstoreContainer& host_; int ret_code_; }; @@ -459,14 +459,14 @@ class ObIlogStore::MergeIlogMemstoreContainer { return ret; } - private: +private: ObHashMap partition_info_block_map_; ObHashMap partition_memberlist_info_map_; ObHashMap partition_log_cursor_map_; bool is_inited_; ObTimeGuard time_gurad_; - private: +private: DISALLOW_COPY_AND_ASSIGN(MergeIlogMemstoreContainer); }; diff --git a/src/clog/ob_ilog_store.h b/src/clog/ob_ilog_store.h index e0a763e87..10ab18ca6 100644 --- a/src/clog/ob_ilog_store.h +++ b/src/clog/ob_ilog_store.h @@ -36,7 +36,7 @@ class ObILogDir; class ObIlogFileBuilder; class PinnedMemory { - public: +public: PinnedMemory(); ~PinnedMemory(); int init(const int64_t size); @@ -45,7 +45,7 @@ class PinnedMemory { bool is_valid(const int64_t size) const; TO_STRING_KV(KP(pinned_memory_), K(size_)); - private: +private: char* pinned_memory_; int64_t size_; bool is_inited_; @@ -53,11 +53,11 @@ class PinnedMemory { }; class ObIlogStore { - public: +public: ObIlogStore(); ~ObIlogStore(); - public: +public: int init(const file_id_t next_ilog_file_id, common::ObILogFileStore* file_store, ObFileIdCache* file_id_cache, ObLogDirectReader* direct_reader, storage::ObPartitionService* partition_service); void destroy(); @@ -65,7 +65,7 @@ class ObIlogStore { void stop(); void wait(); - public: +public: // retry inside the function // caller guarantees that the same partition_key is called from // a single thread, log_id is monotonically increasing. @@ -110,7 +110,7 @@ class ObIlogStore { // ilog writer worker void runTimerTask(); - private: +private: const static int64_t DEFAULT_MEMSTORE_COUNT = 16; const static int64_t TIMER_TASK_INTERVAL = 2 * 1000 * 1000; // PINNED_MEMORY_SIZE should set as ObIlogMemstore::CURSOR_SIZE_TRIGGER(32MB) @@ -180,19 +180,19 @@ class ObIlogStore { void alloc_memstore_(ObIlogMemstore*& memstore); - private: +private: class IlogWriterTask : public common::ObTimerTask { - public: + public: IlogWriterTask() : ilog_store_(NULL) {} ~IlogWriterTask() {} - public: + public: int init(ObIlogStore* ilog_store); virtual void runTimerTask(); - private: + private: ObIlogStore* ilog_store_; }; @@ -232,7 +232,7 @@ class ObIlogStore { typedef RWLock::RLockGuard RLockGuard; typedef RWLock::WLockGuard WLockGuard; - private: +private: mutable RWLock lock_; bool is_inited_; file_id_t next_ilog_file_id_; @@ -251,7 +251,7 @@ class ObIlogStore { PinnedMemory pinned_memory_; IlogWriterTask task_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIlogStore); }; } // namespace clog diff --git a/src/clog/ob_info_block_handler.h b/src/clog/ob_info_block_handler.h index 09bde922b..78ec9db0e 100644 --- a/src/clog/ob_info_block_handler.h +++ b/src/clog/ob_info_block_handler.h @@ -34,7 +34,7 @@ static const int16_t INDEX_LOG_INFO_BLOCK_VERSION = 1; class ObIPartitionLogService; class NeedFreezePartition { - public: +public: NeedFreezePartition() { reset(); @@ -42,7 +42,7 @@ class NeedFreezePartition { ~NeedFreezePartition() {} - public: +public: void reset() { partition_key_.reset(); @@ -70,7 +70,7 @@ class NeedFreezePartition { } TO_STRING_KV(K(partition_key_), K(max_log_id_)); - private: +private: common::ObPartitionKey partition_key_; uint64_t max_log_id_; }; @@ -78,15 +78,15 @@ class NeedFreezePartition { typedef common::ObSEArray NeedFreezePartitionArray; class ObIInfoBlockHandler { - public: +public: ObIInfoBlockHandler(); virtual ~ObIInfoBlockHandler() {} - public: +public: static int get_min_submit_timestamp(storage::ObPartitionService* partition_service, int64_t& min_submit_timestamp); - public: +public: virtual int build_info_block(char* buf, const int64_t buf_len, int64_t& pos) = 0; virtual int resolve_info_block(const char* buf, const int64_t buf_len, int64_t& pos) = 0; virtual int update_info(const int64_t max_submit_timestamp) = 0; @@ -103,11 +103,11 @@ class ObIInfoBlockHandler { int get_max_submit_timestamp(int64_t& max_submit_timestamp) const; - public: +public: // echo info_block_handler_max_submit_timestamp|sha1sum static const int64_t MAGIC_NUMBER_FOR_MAX_SUBMIT_TIMESTAMP = 0xfa06d5f2b8a1cce1ull; - protected: +protected: struct InfoEntryV2 { uint64_t max_log_id_; void reset() @@ -118,11 +118,11 @@ class ObIInfoBlockHandler { }; typedef common::ObArrayHashMap InfoHashV2; class InfoEntrySerializeFunctorV2 { - public: + public: InfoEntrySerializeFunctorV2(char* buf, const int64_t buf_len, int64_t& pos); bool operator()(const common::ObPartitionKey& partition_key, const InfoEntryV2& info_entry_v2); - private: + private: char* buf_; int64_t buf_len_; int64_t& pos_; @@ -141,18 +141,18 @@ class ObIInfoBlockHandler { int update_info_hash_v2_(const common::ObPartitionKey& partition_key, const uint64_t log_id); int resolve_info_hash_v2_(const char* buf, const int64_t buf_len, int64_t& pos, const int64_t expected_magic_number); - private: +private: static int record_need_freeze_partition( NeedFreezePartitionArray& partition_array, const common::ObPartitionKey& partition_key, const uint64_t log_id); - private: +private: // adapt hashmap forech, used to traverse infoblock. // 1. during the restart phase, log_scan_runnable will compare max_log_id which // is record in infoblock with last_replay_log_id which is record in base_storage_info, // if last_replay_log_id is greator than max_log_id, means that the file needn't // to read. class CheckFileCanBeSkippedFunctor { - public: + public: CheckFileCanBeSkippedFunctor(storage::ObPartitionService* partition_service); bool operator()(const common::ObPartitionKey& pkey, const InfoEntryV2& entry); bool can_skip() const @@ -164,7 +164,7 @@ class ObIInfoBlockHandler { return ret_code_; } - private: + private: storage::ObPartitionService* partition_service_; int64_t check_partition_not_exist_time_; bool can_skip_; @@ -174,7 +174,7 @@ class ObIInfoBlockHandler { // adapt hashmap forech, used to traverse infoblock. // 1. record partition which need to be minor freeze. class CheckPartitionNeedFreezeFunctor { - public: + public: CheckPartitionNeedFreezeFunctor(storage::ObPartitionService* partition_service, NeedFreezePartitionArray& partition_array, const bool need_record, const bool is_strict_recycle_mode); bool operator()(const common::ObPartitionKey& partition_key, const InfoEntryV2& entry_v2); @@ -187,7 +187,7 @@ class ObIInfoBlockHandler { return ret_code_; } - private: + private: // check partition whether need to do minor freeze. // last_replay_log_id means that the max_log_id has beed replayed. // max_log_id means that the max_log_id in this file. @@ -199,7 +199,7 @@ class ObIInfoBlockHandler { int do_check_log_only_partition_need_freeze_(ObIPartitionLogService* pls, const common::ObPartitionKey& partition_key, const int64_t last_replay_log_id, const int64_t max_log_id); - private: + private: storage::ObPartitionService* partition_service_; NeedFreezePartitionArray& partition_array_; int64_t check_partition_not_exist_time_; @@ -214,14 +214,14 @@ class ObIInfoBlockHandler { // the following two classes called by LogWriter, don't need to protect // by lock. class ObCommitInfoBlockHandler : public ObIInfoBlockHandler { - public: +public: ObCommitInfoBlockHandler(); virtual ~ObCommitInfoBlockHandler() { destroy(); } - public: +public: int init(); void destroy(); virtual int build_info_block(char* buf, const int64_t buf_len, int64_t& pos); @@ -235,12 +235,12 @@ class ObCommitInfoBlockHandler : public ObIInfoBlockHandler { int update_info(const common::ObPartitionKey& partition_key, const uint64_t log_id, const int64_t submit_timestamp); int reset(); - public: +public: // echo commit_info_block_handler|sha1sum // the first 16 bits is valid static const int64_t MAGIC_NUMBER = 0x13bd710f4b907562ull; - private: +private: bool is_inited_; DISALLOW_COPY_AND_ASSIGN(ObCommitInfoBlockHandler); @@ -281,14 +281,14 @@ struct IndexInfoBlockEntry { typedef common::ObArrayHashMap IndexInfoBlockMap; class ObIndexInfoBlockHandler : public ObIInfoBlockHandler { - public: +public: ObIndexInfoBlockHandler(); virtual ~ObIndexInfoBlockHandler() { destroy(); } - private: +private: struct InfoEntry { uint64_t min_log_id_; int64_t min_log_timestamp_; @@ -309,11 +309,11 @@ class ObIndexInfoBlockHandler : public ObIInfoBlockHandler { typedef common::ObSEArray TstampArray; class InfoEntrySerializeFunctor { - public: + public: InfoEntrySerializeFunctor(char* buf, const int64_t buf_len, int64_t& pos, TstampArray& max_log_tstamp_array); bool operator()(const common::ObPartitionKey& partition_key, const InfoEntry& info_entry); - private: + private: char* buf_; int64_t buf_len_; int64_t& pos_; @@ -329,12 +329,12 @@ class ObIndexInfoBlockHandler : public ObIInfoBlockHandler { // // used to load each entry into map class InfoEntryLoader { - public: + public: InfoEntryLoader(IndexInfoBlockMap& map) : map_(map) {} bool operator()(const common::ObPartitionKey& partition_key, const InfoEntry& info_entry); - private: + private: IndexInfoBlockMap& map_; }; @@ -342,27 +342,27 @@ class ObIndexInfoBlockHandler : public ObIInfoBlockHandler { // // used to update entry in map class InfoEntryV2Loader { - public: + public: InfoEntryV2Loader(IndexInfoBlockMap& map) : map_(map) {} bool operator()(const common::ObPartitionKey& partition_key, const InfoEntryV2& info_entry); - private: + private: IndexInfoBlockMap& map_; }; - public: +public: typedef common::ObArrayHashMap MinLogIdInfo; class AppendMinLogIdInfoFunctor { - public: + public: AppendMinLogIdInfoFunctor(MinLogIdInfo& min_log_id_info); bool operator()(const common::ObPartitionKey& partition_key, const InfoEntry& info_entry); - private: + private: MinLogIdInfo& min_log_id_info_; }; - public: +public: int init(void); void destroy(); virtual int build_info_block(char* buf, const int64_t buf_len, int64_t& pos); @@ -383,11 +383,11 @@ class ObIndexInfoBlockHandler : public ObIInfoBlockHandler { int reset(); - private: +private: int resolve_max_log_timestamp_(const char* buf, const int64_t buf_len, int64_t& pos, const common::ObPartitionKey* part_array, const int64_t part_number); - private: +private: // echo index_info_block_handler|sha1sum // the first 16 bits is valid static const int64_t MAGIC_NUMBER = 0x20a10b0830216399ull; diff --git a/src/clog/ob_log_archive_and_restore_driver.h b/src/clog/ob_log_archive_and_restore_driver.h index 16bffadc9..5b3434732 100644 --- a/src/clog/ob_log_archive_and_restore_driver.h +++ b/src/clog/ob_log_archive_and_restore_driver.h @@ -22,11 +22,11 @@ class ObPartitionService; } namespace clog { class ObLogArchiveAndRestoreDriver : public share::ObThreadPool { - public: +public: ObLogArchiveAndRestoreDriver(); virtual ~ObLogArchiveAndRestoreDriver(); - public: +public: int init(storage::ObPartitionService* partition_service); void destroy(); void run1(); @@ -35,7 +35,7 @@ class ObLogArchiveAndRestoreDriver : public share::ObThreadPool { return last_run_time_; } - private: +private: void state_driver_loop(); const int64_t SYNC_LOG_ARCHIVE_PROGRESS_INTERVAL = 2 * 1000 * 1000LL; // 2s const int64_t CONFIRM_CLOG_INTERVAL = 1 * 1000 * 1000LL; @@ -43,7 +43,7 @@ class ObLogArchiveAndRestoreDriver : public share::ObThreadPool { const int64_t CHECK_LOG_ARCHIVE_CHECKPOINT_INTERVAL = 1 * 1000 * 1000LL; // 1s const int64_t CLEAR_TRANS_AFTER_RESTORE_INTERVAL = 5 * 1000 * 1000LL; // 5s const int64_t ARCHVIE_AND_RESTORE_STATE_DRIVER_INTERVAL = 500 * 1000LL; // 500ms - private: +private: bool is_inited_; storage::ObPartitionService* partition_service_; int64_t last_check_time_for_sync_log_archive_progress_; @@ -53,7 +53,7 @@ class ObLogArchiveAndRestoreDriver : public share::ObThreadPool { int64_t last_check_time_for_clear_trans_after_restore_; int64_t last_run_time_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogArchiveAndRestoreDriver); }; diff --git a/src/clog/ob_log_block.h b/src/clog/ob_log_block.h index d7509d254..341398f7c 100644 --- a/src/clog/ob_log_block.h +++ b/src/clog/ob_log_block.h @@ -57,7 +57,7 @@ namespace oceanbase { namespace clog { class ObLogBlockMetaV2 { - public: +public: ObLogBlockMetaV2(); ~ObLogBlockMetaV2(); @@ -137,13 +137,13 @@ class ObLogBlockMetaV2 { NEED_SERIALIZE_AND_DESERIALIZE; static const int16_t META_MAGIC = 0x4C42; // BL means block - private: +private: int generate_block(const char* buf, const int64_t data_len, const ObBlockType type); int64_t calc_data_checksum_(const char* buf, const int64_t data_len) const; int64_t calc_meta_checksum_() const; bool check_data_checksum_(const char* buf, const int64_t data_len) const; - private: +private: static const int16_t BLOCK_VERSION = 1; int16_t magic_; diff --git a/src/clog/ob_log_broadcast_info_mgr.h b/src/clog/ob_log_broadcast_info_mgr.h index 4f21fa5cd..ce448f253 100644 --- a/src/clog/ob_log_broadcast_info_mgr.h +++ b/src/clog/ob_log_broadcast_info_mgr.h @@ -23,20 +23,20 @@ namespace oceanbase { namespace clog { class ObILogMembershipMgr; class ObLogBroadcastInfoMgr { - public: +public: ObLogBroadcastInfoMgr(); ~ObLogBroadcastInfoMgr(); - public: +public: int init(const common::ObPartitionKey& partition_key, const ObILogMembershipMgr* membership_mgr); void destroy(); int update_broadcast_info( const common::ObAddr& server, const common::ObReplicaType& replica_type, const uint64_t max_confirmed_log_id); int get_recyclable_log_id(uint64_t& log_id) const; - private: +private: struct BroadcastInfo { - public: + public: BroadcastInfo() : server_(), replica_type_(common::REPLICA_TYPE_MAX), @@ -47,14 +47,14 @@ class ObLogBroadcastInfoMgr { {} TO_STRING_KV(K_(server), K_(replica_type), K_(max_confirmed_log_id), K_(update_ts)); - public: + public: common::ObAddr server_; common::ObReplicaType replica_type_; uint64_t max_confirmed_log_id_; int64_t update_ts_; }; - private: +private: bool is_member_completed_(const common::ObMemberList& member_list) const; int check_majority_or_all_( const common::ObMemberList& member_list, const int64_t replica_num, uint64_t& log_id) const; @@ -63,7 +63,7 @@ class ObLogBroadcastInfoMgr { int get_broadcast_info_by_server(const common::ObAddr& observer, BroadcastInfo& out_info) const; int clear_expired_broadcast_info(const common::ObMemberList& member_list); - private: +private: bool is_inited_; mutable common::ObSpinLock lock_; common::ObPartitionKey partition_key_; diff --git a/src/clog/ob_log_cache.h b/src/clog/ob_log_cache.h index d57c41e0d..235c2d130 100644 --- a/src/clog/ob_log_cache.h +++ b/src/clog/ob_log_cache.h @@ -24,7 +24,7 @@ namespace clog { // ---------------- ObLogKVCache ---------------- class ObLogKVCacheKey : public common::ObIKVCacheKey { - public: +public: ObLogKVCacheKey() : addr_(), seq_(0), file_id_(common::OB_INVALID_FILE_ID), offset_(clog::OB_INVALID_OFFSET) {} ObLogKVCacheKey(const common::ObAddr& addr, const int64_t seq, const file_id_t file_id, const offset_t offset) @@ -47,7 +47,7 @@ class ObLogKVCacheKey : public common::ObIKVCacheKey { virtual int deep_copy(char* buf, const int64_t buf_len, ObIKVCacheKey*& key) const; TO_STRING_KV(K(addr_), K(seq_), K(file_id_), K(offset_)); // Intentionally copyable and assignable - private: +private: common::ObAddr addr_; int64_t seq_; file_id_t file_id_; @@ -55,7 +55,7 @@ class ObLogKVCacheKey : public common::ObIKVCacheKey { }; class ObLogKVCacheValue : public common::ObIKVCacheValue { - public: +public: ObLogKVCacheValue() : buf_(NULL) {} explicit ObLogKVCacheValue(char* buf) : buf_(buf) @@ -69,13 +69,13 @@ class ObLogKVCacheValue : public common::ObIKVCacheValue { virtual int deep_copy(char* buf, const int64_t buf_len, ObIKVCacheValue*& value) const; TO_STRING_KV(KP(buf_)); - private: +private: char* buf_; DISALLOW_COPY_AND_ASSIGN(ObLogKVCacheValue); }; class ObLogKVCache : public common::ObKVCache { - public: +public: ObLogKVCache() : is_inited_(false), log_type_(INVALID_TYPE), cache_name_() {} virtual ~ObLogKVCache() @@ -89,7 +89,7 @@ class ObLogKVCache : public common::ObKVCache RegionArray; - private: +private: int set_parent_(const common::ObAddr& new_parent_addr, const int64_t cluster_id); void reset_parent_(const uint32_t reset_type); int get_parent_candidate_list_(const common::ObAddr& server, const common::ObReplicaType replica_type, @@ -154,13 +154,13 @@ class ObLogCascadingMgr { bool is_valid_child_unlock_(const common::ObAddr& server) const; bool need_update_parent_() const; - private: +private: typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; static const int64_t MAX_CHILD_NUM = 5; - private: +private: bool is_inited_; mutable common::SpinRWLock lock_; common::ObAddr self_; diff --git a/src/clog/ob_log_checksum_V2.h b/src/clog/ob_log_checksum_V2.h index 58b65e09d..a1875ed80 100644 --- a/src/clog/ob_log_checksum_V2.h +++ b/src/clog/ob_log_checksum_V2.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace clog { class ObILogChecksum { - public: +public: ObILogChecksum() {} virtual ~ObILogChecksum() {} - public: +public: // called by leader/follower when handle_index_log_() virtual int acquire_accum_checksum(const int64_t data_checksum, int64_t& accum_checksum) = 0; // called when slide out from sw @@ -37,12 +37,12 @@ class ObILogChecksum { }; class ObLogChecksum : public ObILogChecksum { - public: +public: ObLogChecksum(); virtual ~ObLogChecksum() {} - public: +public: int init(uint64_t log_id, const int64_t accum_checksum, const common::ObPartitionKey& partition_key); virtual int acquire_accum_checksum(const int64_t data_checksum, int64_t& accum_checksum); virtual int verify_accum_checksum(const int64_t data_checksum, const int64_t accum_checksum); @@ -51,13 +51,13 @@ class ObLogChecksum : public ObILogChecksum { virtual void set_verify_checksum(const uint64_t log_id, const int64_t verify_checksum); virtual int64_t get_verify_checksum() const; - private: +private: bool is_inited_; common::ObPartitionKey partition_key_; int64_t accum_checksum_; int64_t verify_checksum_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogChecksum); }; diff --git a/src/clog/ob_log_common.cpp b/src/clog/ob_log_common.cpp index 9214b53be..76b0265aa 100644 --- a/src/clog/ob_log_common.cpp +++ b/src/clog/ob_log_common.cpp @@ -22,7 +22,7 @@ namespace clog { char ObNewLogFileBuf::buf_[CLOG_DIO_ALIGN_SIZE] __attribute__((aligned(CLOG_DIO_ALIGN_SIZE))); static class NEW_LOG_FILE_BUF_CONSTRUCTOR { - public: +public: NEW_LOG_FILE_BUF_CONSTRUCTOR() { const char* mark_str = "NL"; diff --git a/src/clog/ob_log_common.h b/src/clog/ob_log_common.h index d4e3bca3a..fade8c407 100644 --- a/src/clog/ob_log_common.h +++ b/src/clog/ob_log_common.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace clog { class ObICLogItem : public common::ObIBaseLogItem { - public: +public: ObICLogItem() {} virtual ~ObICLogItem() @@ -41,20 +41,20 @@ class ObICLogItem : public common::ObIBaseLogItem { // The new file will write ObNewLogFileBuf in the file header to avoid reading the old block when reusing log files class ObNewLogFileBuf { - public: +public: ObNewLogFileBuf() {} ~ObNewLogFileBuf() {} static char buf_[CLOG_DIO_ALIGN_SIZE] __attribute__((aligned(CLOG_DIO_ALIGN_SIZE))); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNewLogFileBuf); }; template struct TSI { - public: +public: TSI() : create_err_(0), key_() { create_err_ = pthread_key_create(&key_, release); @@ -85,7 +85,7 @@ struct TSI { return val; } - private: +private: static void release(void* arg) { if (NULL != arg) { @@ -106,7 +106,7 @@ inline common::ObQSync& get_log_file_qs() int close_fd(const int fd); class ObLogMeta { - public: +public: ObLogMeta() : log_id_(common::OB_INVALID_ID), submit_timestamp_(common::OB_INVALID_TIMESTAMP), proposal_id_() {} ~ObLogMeta() @@ -149,10 +149,10 @@ class ObLogMeta { return proposal_id_; } - public: +public: TO_STRING_KV(K(log_id_), K(submit_timestamp_), K(proposal_id_)); - private: +private: uint64_t log_id_; int64_t submit_timestamp_; common::ObProposalID proposal_id_; @@ -161,7 +161,7 @@ class ObLogMeta { class ObLogInfo { OB_UNIS_VERSION(1); - public: +public: ObLogInfo() { reset(); @@ -171,7 +171,7 @@ class ObLogInfo { reset(); } - public: +public: void reset() { buff_ = NULL; @@ -240,7 +240,7 @@ class ObLogInfo { } TO_STRING_KV(K(size_), K(log_id_), K(submit_timestamp_), K(proposal_id_), K(need_flushed_)); - private: +private: const char* buff_; int64_t size_; uint64_t log_id_; diff --git a/src/clog/ob_log_define.h b/src/clog/ob_log_define.h index 948ed2d2e..f6cfd39cd 100644 --- a/src/clog/ob_log_define.h +++ b/src/clog/ob_log_define.h @@ -37,9 +37,8 @@ typedef int32_t offset_t; const int64_t CLOG_RPC_TIMEOUT = 3000 * 1000 - 100 * 1000; const int64_t CLOG_TRAILER_SIZE = 512; -const int64_t CLOG_TRAILER_OFFSET = CLOG_FILE_SIZE - CLOG_TRAILER_SIZE; // 512B for the trailer block -const int64_t CLOG_TRAILER_ALIGN_WRITE_OFFSET = CLOG_FILE_SIZE - - CLOG_DIO_ALIGN_SIZE; // 4k aligned write +const int64_t CLOG_TRAILER_OFFSET = CLOG_FILE_SIZE - CLOG_TRAILER_SIZE; // 512B for the trailer block +const int64_t CLOG_TRAILER_ALIGN_WRITE_OFFSET = CLOG_FILE_SIZE - CLOG_DIO_ALIGN_SIZE; // 4k aligned write const int64_t CLOG_MAX_DATA_OFFSET = CLOG_TRAILER_OFFSET - common::OB_MAX_LOG_BUFFER_SIZE; const int64_t CLOG_CACHE_SIZE = 64 * 1024; const int64_t CLOG_REPLAY_CHECKSUM_WINDOW_SIZE = 1 << 9; @@ -236,7 +235,7 @@ inline int cursor_cmp(const file_id_t f1, const offset_t o1, const file_id_t f2, } class ObTailCursor { - public: +public: ObTailCursor() : file_id_(common::OB_INVALID_FILE_ID), offset_(OB_INVALID_OFFSET) {} ~ObTailCursor() @@ -284,7 +283,7 @@ class ObTailCursor { } TO_STRING_KV(K_(file_id), K_(offset)); - public: +public: file_id_t file_id_; offset_t offset_; } __attribute__((aligned(8))); @@ -317,14 +316,14 @@ struct ObLogCursor { } TO_STRING_KV(K_(file_id), K_(offset), K_(size)); - private: +private: // Intentionally copyable and assigned }; // ObLogCursor extended structure // add acc_cksm and timestamp member class ObLogCursorExt { - public: +public: ObLogCursorExt() { reset(); @@ -390,7 +389,7 @@ class ObLogCursorExt { is_batch_committed(), K_(acc_cksm)); NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: static const uint64_t MASK = 1ull << 63; file_id_t file_id_; offset_t offset_; @@ -477,14 +476,14 @@ struct ObLogFlushCbArg { TO_STRING_KV(K_(log_type), K_(log_id), K_(proposal_id), K_(leader), K_(cluster_id), K_(log_cursor), K_(after_consume_timestamp)); - private: +private: // Intentionally copyable and assigned }; struct ObPGLogArchiveStatus { OB_UNIS_VERSION(1); - public: +public: ObPGLogArchiveStatus() { reset(); @@ -510,7 +509,7 @@ struct ObPGLogArchiveStatus { K_(round_accum_checksum), K_(archive_incarnation), K_(log_archive_round), K_(last_archived_log_id), K_(last_archived_checkpoint_ts), K_(last_archived_log_submit_ts), K_(clog_epoch_id), K_(accum_checksum)); - public: +public: share::ObLogArchiveStatus::STATUS status_; int64_t round_start_ts_; diff --git a/src/clog/ob_log_dir.h b/src/clog/ob_log_dir.h index 313c28754..ab83e0a33 100644 --- a/src/clog/ob_log_dir.h +++ b/src/clog/ob_log_dir.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace clog { class ObDir { - public: +public: ObDir() : is_inited_(false), dir_fd_(-1) { dir_name_[0] = '\0'; @@ -83,21 +83,21 @@ class ObDir { return ret; } - public: +public: TO_STRING_KV(K_(is_inited), K_(dir_fd), K_(dir_name)); - private: +private: static const int OPEN_MODE = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; static const int MKDIR_MODE = OPEN_MODE | S_IXUSR; - private: +private: bool is_inited_; int dir_fd_; char dir_name_[common::MAX_PATH_SIZE]; }; class ObILogDir { - public: +public: ObILogDir() {} virtual ~ObILogDir() @@ -113,12 +113,12 @@ class ObILogDir { virtual int get_tmp_path(const file_id_t file_id, char* path, const int64_t size, int& dir_fd) const = 0; virtual int get_total_size(int64_t& total_size) const = 0; - public: +public: VIRTUAL_TO_STRING_KV("", ""); - protected: +protected: class GetFileIdRange { - public: + public: explicit GetFileIdRange() : min_file_id_(common::OB_INVALID_FILE_ID), max_file_id_(common::OB_INVALID_FILE_ID) {} ~GetFileIdRange() @@ -133,25 +133,25 @@ class ObILogDir { return max_file_id_; } - private: + private: file_id_t min_file_id_; file_id_t max_file_id_; }; class GetFileSizeFunctor { - public: + public: explicit GetFileSizeFunctor(const ObILogDir* log_dir) : total_size_(0), log_dir_(log_dir) {} ~GetFileSizeFunctor() {} - public: + public: bool operator()(const char* dir_name, const char* entry); int64_t get_total_size() const { return total_size_; } - private: + private: int get_size_(const file_id_t file_id, int64_t& size); int64_t total_size_; const ObILogDir* log_dir_; @@ -159,7 +159,7 @@ class ObILogDir { }; class ObLogDir : public ObILogDir { - public: +public: ObLogDir() : is_inited_(false), dir_() {} ~ObLogDir() @@ -177,10 +177,10 @@ class ObLogDir : public ObILogDir { int get_tmp_path(const file_id_t file_id, char* path, const int64_t size, int& dir_fd) const; int get_total_size(int64_t& total_size) const; - public: +public: TO_STRING_KV(K_(is_inited), K_(dir)); - private: +private: bool is_inited_; ObDir dir_; }; diff --git a/src/clog/ob_log_direct_reader.cpp b/src/clog/ob_log_direct_reader.cpp index 92b22ff6e..c89340234 100644 --- a/src/clog/ob_log_direct_reader.cpp +++ b/src/clog/ob_log_direct_reader.cpp @@ -1073,11 +1073,11 @@ int ObLogDirectReader::read_trailer( ObReadRes res; ObReadParam trailer_param; trailer_param.file_id_ = param.file_id_; - trailer_param.offset_ = CLOG_TRAILER_ALIGN_WRITE_OFFSET; // 4k aligned write, but data is in last 512bytes + trailer_param.offset_ = CLOG_TRAILER_ALIGN_WRITE_OFFSET; // 4k aligned write, but data is in last 512bytes trailer_param.read_len_ = CLOG_DIO_ALIGN_SIZE; trailer_param.timeout_ = param.timeout_; - const char *trailer_buf = NULL; + const char* trailer_buf = NULL; int64_t trailer_len = 0; // always read trailed from disk, handling error code specially diff --git a/src/clog/ob_log_direct_reader.h b/src/clog/ob_log_direct_reader.h index b1cdcaa65..58e6852ea 100644 --- a/src/clog/ob_log_direct_reader.h +++ b/src/clog/ob_log_direct_reader.h @@ -33,7 +33,7 @@ namespace clog { class Log2File; // Alloc a buffer which is aligned, used to read or write file directly class ObAlignedBuffer { - public: +public: ObAlignedBuffer(); ~ObAlignedBuffer(); // Allocate memory space according to size and align_size during initialization @@ -54,7 +54,7 @@ class ObAlignedBuffer { } TO_STRING_KV(KP(align_buf_), K(size_), K(align_size_), K(is_inited_)); - private: +private: // Save the aligned starting address in the allocated space char* align_buf_; // The size of the externally visible space @@ -63,22 +63,22 @@ class ObAlignedBuffer { int64_t align_size_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlignedBuffer); }; class ObLogDirectReader : public ObILogDirectReader { - public: +public: ObLogDirectReader(); virtual ~ObLogDirectReader(); - public: +public: int init(const char* log_dir, const char* shm_buf, const bool use_cache, ObLogCache* log_cache, ObTailCursor* tail, ObLogWritePoolType type); int get_file_id_range(uint32_t& min_file_id, uint32_t& max_file_id) const; void destroy(); - public: +public: // Interface of read // Read data from disk directlly // @@ -114,7 +114,7 @@ class ObLogDirectReader : public ObILogDirectReader { const offset_t want_offset, const int64_t want_size, char* user_buf, const int64_t buf_size, int64_t& origin_size); - private: +private: offset_t limit_by_file_size(const int64_t offset) const; int limit_param_by_tail(const ObReadParam& want_param, ObReadParam& real_param); void align_param_for_dio_without_cache(const ObReadParam& param, ObReadParam& align_param, int64_t& backoff); @@ -148,11 +148,11 @@ class ObLogDirectReader : public ObILogDirectReader { int get_log_file_type(ObLogWritePoolType& file_type) const; - private: +private: static const int64_t STAT_TIME_INTERVAL = 10 * 1000 * 1000; static const int64_t READ_DISK_SIZE = CLOG_CACHE_SIZE; - private: +private: bool is_inited_; bool use_cache_; common::ObILogFileStore* file_store_; diff --git a/src/clog/ob_log_engine.h b/src/clog/ob_log_engine.h index 4a492e21d..586d48049 100644 --- a/src/clog/ob_log_engine.h +++ b/src/clog/ob_log_engine.h @@ -46,7 +46,7 @@ class ObBatchSubmitDiskTask; class ObCLogBaseFileWriter; class ObHotCacheWarmUpHelper { - public: +public: static int warm_up(ObLogDirectReader& reader, ObTailCursor& tail, ObLogCache& cache); // for unittest static void test_warm_up(ObLogCache& cache) @@ -59,7 +59,7 @@ class ObHotCacheWarmUpHelper { }; class ObLogEnv { - public: +public: struct Config { Config() : log_dir_(NULL), index_log_dir_(NULL), cache_name_(NULL) { @@ -89,7 +89,7 @@ class ObLogEnv { K_(write_timeout), K_(disk_log_buffer_size), K_(disk_log_buffer_cnt), K_(ethernet_speed)); }; - public: +public: ObLogEnv() : is_inited_(false), log_file_writer_(NULL), @@ -111,7 +111,7 @@ class ObLogEnv { void wait(); void destroy(); - public: +public: ObLogDirectReader& get_reader() { return direct_reader_; @@ -135,10 +135,10 @@ class ObLogEnv { uint32_t get_min_file_id() const; uint32_t get_max_file_id() const; - public: +public: VIRTUAL_TO_STRING_KV(K_(is_inited), KP_(partition_service)); - protected: +protected: // When the number of flashing items accounted for the percentage of max_buffer_item_cnt_ exceeds this value, // the clog_writer is returned to be busy static const int64_t BUFFER_ITEM_CONGESTED_PERCENTAGE = 50; @@ -160,7 +160,7 @@ class ObLogEnv { }; class ObCommitLogEnv : public ObLogEnv { - public: +public: ObCommitLogEnv() { preread_file_id_ = 0; @@ -184,7 +184,7 @@ class ObCommitLogEnv : public ObLogEnv { } int get_min_file_mtime(time_t& min_clog_mtime); - private: +private: common::ObLinearHashMap partition_hash_map_; int preread_freeze_array_(const file_id_t file_id, const file_id_t max_file_id, ObILogInfoBlockReader* reader, NeedFreezePartitionArray& partition_array); @@ -192,7 +192,7 @@ class ObCommitLogEnv : public ObLogEnv { NeedFreezePartitionArray& partition_array, const NeedFreezePartitionArray& tmp_partition_array); int get_min_file_mtime_(time_t& min_clog_mtime); - protected: +protected: ObCommitInfoBlockHandler info_block_handler_; // Provide pre-reading function for triggering minor freeze on demand, and trigger minor freeze earlier static const int64_t PREREAD_FILE_NUM = 256; @@ -201,18 +201,18 @@ class ObCommitLogEnv : public ObLogEnv { }; class NetworkLimitManager { - public: +public: NetworkLimitManager(); ~NetworkLimitManager(); - public: +public: int init(const int64_t ethernet_speed); void destroy(); int get_limit(const common::ObAddr& addr, int64_t& network_limit); int get_limit(const common::ObMemberList& member_list, int64_t& network_limit); int try_limit(const common::ObAddr& addr, const int64_t size, const int64_t network_limit); - private: +private: struct HashV { void reset() { @@ -223,13 +223,13 @@ class NetworkLimitManager { int64_t last_reset_ts_; }; class CheckFunction { - public: + public: CheckFunction(const int64_t size, const int64_t limit) : size_(size), limit_(limit) {} ~CheckFunction() {} - public: + public: bool operator()(const common::ObAddr& addr, HashV& value) { UNUSED(addr); @@ -249,12 +249,12 @@ class NetworkLimitManager { return bool_ret; } - private: + private: int64_t size_; int64_t limit_; }; - private: +private: static const int64_t RESET_ADDR_ARRAY_INTERVAL = 120 * 1000 * 1000; // 2 minutes static const int64_t RESET_NETWORK_LIMIT_INTERVAL = 100 * 1000; // 100ms static const int64_t SLEEP_TS = 1 * 1000; // 1ms @@ -267,19 +267,19 @@ class NetworkLimitManager { int update_addr_array_(const common::ObMemberList& member_list); void try_reset_addr_array_(); - private: +private: bool is_inited_; RWLock lock_; // only protect addr_array_; ObAddrArray addr_array_; int64_t ethernet_speed_; common::ObLinearHashMap hash_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(NetworkLimitManager); }; class ObLogRpcStat { - public: +public: ObLogRpcStat() { reset_(); @@ -287,7 +287,7 @@ class ObLogRpcStat { ~ObLogRpcStat() {} - public: +public: void stat(const enum ObLogReqType& type) { if (type >= 0 && type < OB_LOG_MAX_REQ_TYPE_ID) { @@ -299,7 +299,7 @@ class ObLogRpcStat { } } - private: +private: void reset_() { for (int64_t i = 0; i < OB_LOG_MAX_REQ_TYPE_ID; i++) { @@ -340,266 +340,139 @@ class ObLogRpcStat { } } - private: +private: int64_t cnt_[OB_LOG_MAX_REQ_TYPE_ID + 10]; }; class ObLogEngine : public ObILogEngine, public share::ObThreadPool { // TODO private/public function - friend class ObLogEngineAccessor;//for clog perf test + friend class ObLogEngineAccessor; // for clog perf test public: - ObLogEngine(): is_inited_(false), - batch_rpc_(NULL), - rpc_(NULL) {} - virtual ~ObLogEngine() { destroy(); } - int init(const ObLogEnv::Config &cfg, - const common::ObAddr &self_addr, - obrpc::ObBatchRpc *batch_rpc, - obrpc::ObLogRpcProxy *rpc, - common::ObICallbackHandler *callback_handler, - storage::ObPartitionService *partition_service); + ObLogEngine() : is_inited_(false), batch_rpc_(NULL), rpc_(NULL) + {} + virtual ~ObLogEngine() + { + destroy(); + } + int init(const ObLogEnv::Config& cfg, const common::ObAddr& self_addr, obrpc::ObBatchRpc* batch_rpc, + obrpc::ObLogRpcProxy* rpc, common::ObICallbackHandler* callback_handler, + storage::ObPartitionService* partition_service); int start() override; void stop() override; void wait() override; void destroy(); void run1() override; - ObIRawLogIterator *alloc_raw_log_iterator(const file_id_t start_file_id, - const file_id_t end_file_id, - const offset_t offset, - const int64_t timeout) override; - void revert_raw_log_iterator(ObIRawLogIterator *iter) override; - int read_log_by_location(const ObReadParam ¶m, - ObReadBuf &buf, - ObLogEntry &entry) override; - int read_log_by_location(const ObLogTask &log_task, - ObReadBuf &buf, - ObLogEntry &entry) override; - int read_log_by_location(const ObReadParam ¶m, - ObReadBuf &buf, - ObLogEntry &entry, - ObReadCost &cost) override; - int get_clog_real_length(const ObReadParam ¶m, int64_t &real_length) override; + ObIRawLogIterator* alloc_raw_log_iterator(const file_id_t start_file_id, const file_id_t end_file_id, + const offset_t offset, const int64_t timeout) override; + void revert_raw_log_iterator(ObIRawLogIterator* iter) override; + int read_log_by_location(const ObReadParam& param, ObReadBuf& buf, ObLogEntry& entry) override; + int read_log_by_location(const ObLogTask& log_task, ObReadBuf& buf, ObLogEntry& entry) override; + int read_log_by_location(const ObReadParam& param, ObReadBuf& buf, ObLogEntry& entry, ObReadCost& cost) override; + int get_clog_real_length(const ObReadParam& param, int64_t& real_length) override; // read clog from hot cache - int read_data_from_hot_cache(const file_id_t want_file_id, - const offset_t want_offset, - const int64_t want_size, - char *user_buf) override; + int read_data_from_hot_cache( + const file_id_t want_file_id, const offset_t want_offset, const int64_t want_size, char* user_buf) override; // want_size refers to the length in clog, which may be the length after compression, // and the returned data is after decompression - int read_uncompressed_data_from_hot_cache(const common::ObAddr &addr, - const int64_t seq, - const file_id_t want_file_id, - const offset_t want_offset, - const int64_t want_size, - char *user_buf, - const int64_t buf_size, - int64_t &origin_data_len) override; + int read_uncompressed_data_from_hot_cache(const common::ObAddr& addr, const int64_t seq, const file_id_t want_file_id, + const offset_t want_offset, const int64_t want_size, char* user_buf, const int64_t buf_size, + int64_t& origin_data_len) override; // read clog from disk directly - int read_data_direct(const ObReadParam ¶m, - ObReadBuf &rbuf, - ObReadRes &res, - ObReadCost &cost) override; - int submit_flush_task(FlushTask *task) override; - int submit_flush_task(ObBatchSubmitDiskTask *task); - int submit_net_task( - const share::ObCascadMemberList &mem_list, - const common::ObPartitionKey &key, - const ObPushLogMode push_mode, - ObILogNetTask *task) override; - int submit_fetch_log_resp( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const int64_t network_limit, - const ObPushLogMode push_mode, - ObILogNetTask *task) override; - int submit_push_ms_log_req( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - ObILogNetTask *task) override; - int submit_fake_ack( - const common::ObAddr &server, - const common::ObPartitionKey &key, - const uint64_t log_id, - const ObProposalID proposal_id) override; - int submit_fake_push_log_req( - const common::ObMemberList &member_list, - const common::ObPartitionKey &key, - const uint64_t log_id, - const ObProposalID proposal_id) override; - int submit_log_ack( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const uint64_t log_id, - const common::ObProposalID proposal_id) override; - int standby_query_sync_start_id(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const int64_t send_ts) override; - int submit_sync_start_id_resp(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const int64_t original_send_ts, - const uint64_t sync_start_id) override; - int submit_standby_log_ack(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const uint64_t log_id, - const ObProposalID proposal_id) override; - int submit_renew_ms_log_ack( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const uint64_t log_id, - const int64_t submit_timestamp, + int read_data_direct(const ObReadParam& param, ObReadBuf& rbuf, ObReadRes& res, ObReadCost& cost) override; + int submit_flush_task(FlushTask* task) override; + int submit_flush_task(ObBatchSubmitDiskTask* task); + int submit_net_task(const share::ObCascadMemberList& mem_list, const common::ObPartitionKey& key, + const ObPushLogMode push_mode, ObILogNetTask* task) override; + int submit_fetch_log_resp(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const int64_t network_limit, const ObPushLogMode push_mode, + ObILogNetTask* task) override; + int submit_push_ms_log_req(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, ObILogNetTask* task) override; + int submit_fake_ack(const common::ObAddr& server, const common::ObPartitionKey& key, const uint64_t log_id, + const ObProposalID proposal_id) override; + int submit_fake_push_log_req(const common::ObMemberList& member_list, const common::ObPartitionKey& key, + const uint64_t log_id, const ObProposalID proposal_id) override; + int submit_log_ack(const common::ObAddr& server, const int64_t dst_cluster_id, const common::ObPartitionKey& key, + const uint64_t log_id, const common::ObProposalID proposal_id) override; + int standby_query_sync_start_id(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const int64_t send_ts) override; + int submit_sync_start_id_resp(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const int64_t original_send_ts, const uint64_t sync_start_id) override; + int submit_standby_log_ack(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const uint64_t log_id, const ObProposalID proposal_id) override; + int submit_renew_ms_log_ack(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const uint64_t log_id, const int64_t submit_timestamp, const common::ObProposalID proposal_id) override; // send fetch log request to all followers - int fetch_log_from_all_follower( - const common::ObMemberList &mem_list, - const common::ObPartitionKey &key, - const uint64_t start_id, - const uint64_t end_id, - const common::ObProposalID proposal_id, + int fetch_log_from_all_follower(const common::ObMemberList& mem_list, const common::ObPartitionKey& key, + const uint64_t start_id, const uint64_t end_id, const common::ObProposalID proposal_id, const uint64_t max_confirmed_log_id) override; - int fetch_log_from_leader( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const ObFetchLogType fetch_type, - const uint64_t start_id, - const uint64_t end_id, - const common::ObProposalID proposal_id, - const common::ObReplicaType replica_type, + int fetch_log_from_leader(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const ObFetchLogType fetch_type, const uint64_t start_id, + const uint64_t end_id, const common::ObProposalID proposal_id, const common::ObReplicaType replica_type, const uint64_t max_confirmed_log_id) override; - int submit_check_rebuild_req( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const ObPartitionKey &key, + int submit_check_rebuild_req(const common::ObAddr& server, const int64_t dst_cluster_id, const ObPartitionKey& key, const uint64_t start_id) override; - int fetch_register_server( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const ObPartitionKey &key, - const common::ObRegion ®ion, - const common::ObIDC &idc, - const common::ObReplicaType replica_type, - const int64_t next_replay_log_ts, - const bool is_request_leader, - const bool is_need_force_register) override; - int response_register_server( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const bool is_assign_parent_succeed, - const share::ObCascadMemberList &candidate_list, + int fetch_register_server(const common::ObAddr& server, const int64_t dst_cluster_id, const ObPartitionKey& key, + const common::ObRegion& region, const common::ObIDC& idc, const common::ObReplicaType replica_type, + const int64_t next_replay_log_ts, const bool is_request_leader, const bool is_need_force_register) override; + int response_register_server(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const bool is_assign_parent_succeed, + const share::ObCascadMemberList& candidate_list, const int32_t msg_type) override; + int request_replace_sick_child(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const common::ObAddr& sick_child) override; + int reject_server(const common::ObAddr& server, const int64_t dst_cluster_id, const common::ObPartitionKey& key, const int32_t msg_type) override; - int request_replace_sick_child(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const common::ObAddr &sick_child) override; - int reject_server( - const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const int32_t msg_type) override; - int notify_restore_log_finished(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const uint64_t log_id) override; - int notify_reregister(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &key, - const share::ObCascadMember &new_leader) override; - int submit_prepare_rqst( - const common::ObMemberList &mem_list, - const common::ObPartitionKey &key, + int notify_restore_log_finished(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& key, const uint64_t log_id) override; + int notify_reregister(const common::ObAddr& server, const int64_t dst_cluster_id, const common::ObPartitionKey& key, + const share::ObCascadMember& new_leader) override; + int submit_prepare_rqst(const common::ObMemberList& mem_list, const common::ObPartitionKey& key, const common::ObProposalID proposal_id) override; - int submit_standby_prepare_rqst( - const common::ObMemberList &mem_list, - const common::ObPartitionKey &key, + int submit_standby_prepare_rqst(const common::ObMemberList& mem_list, const common::ObPartitionKey& key, const common::ObProposalID proposal_id) override; - int broadcast_info( - const common::ObMemberList &mem_list, - const common::ObPartitionKey &key, - const common::ObReplicaType &replica_type, - const uint64_t max_confirmed_log_id) override; + int broadcast_info(const common::ObMemberList& mem_list, const common::ObPartitionKey& key, + const common::ObReplicaType& replica_type, const uint64_t max_confirmed_log_id) override; // confirmed_info msg is special that no need compare proposal_id - int submit_confirmed_info( - const share::ObCascadMemberList &mem_list, - const common::ObPartitionKey &key, - const uint64_t log_id, - const ObConfirmedInfo &confirmed_info, - const bool batch_committed) override; - int submit_renew_ms_confirmed_info(const share::ObCascadMemberList &mem_list, - const common::ObPartitionKey &key, - const uint64_t log_id, - const common::ObProposalID &ms_proposal_id, - const ObConfirmedInfo &confirmed_info) override; - int prepare_response(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &partition_key, - const common::ObProposalID proposal_id, - const uint64_t max_log_id, - const int64_t max_log_ts) override; - int standby_prepare_response(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &partition_key, - const ObProposalID proposal_id, - const uint64_t ms_log_id, - const int64_t membership_version, - const common::ObMemberList &member_list) override; - int send_keepalive_msg(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &partition_key, - const uint64_t next_log_id, - const int64_t next_log_ts_lb, - const uint64_t deliver_cnt) override; - int send_restore_alive_msg(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &partition_key, - const uint64_t start_log_id) override; - int send_restore_alive_req(const common::ObAddr &server, - const common::ObPartitionKey &partition_key) override; - int send_restore_alive_resp(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &partition_key) override; - int notify_restore_leader_takeover(const common::ObAddr &server, - const common::ObPartitionKey &key) override; - int send_leader_max_log_msg(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &partition_key, - const int64_t switchover_epoch, - const uint64_t max_log_id, - const int64_t next_log_ts) override; - int send_sync_log_archive_progress_msg(const common::ObAddr &server, - const int64_t cluster_id, - const common::ObPartitionKey &partition_key, - const ObPGLogArchiveStatus &status) override; - virtual int notify_follower_log_missing(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &partition_key, - const uint64_t start_log_id, - const bool is_in_member_list, - const int32_t msg_type) override; + int submit_confirmed_info(const share::ObCascadMemberList& mem_list, const common::ObPartitionKey& key, + const uint64_t log_id, const ObConfirmedInfo& confirmed_info, const bool batch_committed) override; + int submit_renew_ms_confirmed_info(const share::ObCascadMemberList& mem_list, const common::ObPartitionKey& key, + const uint64_t log_id, const common::ObProposalID& ms_proposal_id, + const ObConfirmedInfo& confirmed_info) override; + int prepare_response(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& partition_key, const common::ObProposalID proposal_id, const uint64_t max_log_id, + const int64_t max_log_ts) override; + int standby_prepare_response(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& partition_key, const ObProposalID proposal_id, const uint64_t ms_log_id, + const int64_t membership_version, const common::ObMemberList& member_list) override; + int send_keepalive_msg(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& partition_key, const uint64_t next_log_id, const int64_t next_log_ts_lb, + const uint64_t deliver_cnt) override; + int send_restore_alive_msg(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& partition_key, const uint64_t start_log_id) override; + int send_restore_alive_req(const common::ObAddr& server, const common::ObPartitionKey& partition_key) override; + int send_restore_alive_resp( + const common::ObAddr& server, const int64_t dst_cluster_id, const common::ObPartitionKey& partition_key) override; + int notify_restore_leader_takeover(const common::ObAddr& server, const common::ObPartitionKey& key) override; + int send_leader_max_log_msg(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& partition_key, const int64_t switchover_epoch, const uint64_t max_log_id, + const int64_t next_log_ts) override; + int send_sync_log_archive_progress_msg(const common::ObAddr& server, const int64_t cluster_id, + const common::ObPartitionKey& partition_key, const ObPGLogArchiveStatus& status) override; + virtual int notify_follower_log_missing(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& partition_key, const uint64_t start_log_id, const bool is_in_member_list, + const int32_t msg_type) override; virtual void update_clog_info(const int64_t max_submit_timestamp) override; - virtual void update_clog_info(const common::ObPartitionKey &partition_key, - const uint64_t log_id, - const int64_t submit_timestamp) override; + virtual void update_clog_info( + const common::ObPartitionKey& partition_key, const uint64_t log_id, const int64_t submit_timestamp) override; int reset_clog_info_block() override; - int get_clog_info_handler(const file_id_t file_id, - ObCommitInfoBlockHandler &handler) override; - int get_remote_membership_status(const common::ObAddr &server, - const int64_t dst_cluster_id, - const common::ObPartitionKey &partition_key, - int64_t ×tamp, - uint64_t &max_confirmed_log_id, - bool &remote_replica_is_normal) override; - int get_remote_mc_ctx_array(const common::ObAddr &server, - const common::ObPartitionArray &partition_array, - McCtxArray &mc_ctx_array); + int get_clog_info_handler(const file_id_t file_id, ObCommitInfoBlockHandler& handler) override; + int get_remote_membership_status(const common::ObAddr& server, const int64_t dst_cluster_id, + const common::ObPartitionKey& partition_key, int64_t& timestamp, uint64_t& max_confirmed_log_id, + bool& remote_replica_is_normal) override; + int get_remote_mc_ctx_array( + const common::ObAddr& server, const common::ObPartitionArray& partition_array, McCtxArray& mc_ctx_array); int update_min_using_file_id(); uint32_t get_clog_min_using_file_id() const override; uint32_t get_clog_min_file_id() const override; @@ -607,82 +480,58 @@ public: int64_t get_free_quota() const override; bool is_disk_space_enough() const override; void try_recycle_file(); - int get_need_freeze_partition_array(NeedFreezePartitionArray &partition_array) const; - virtual int submit_batch_log(const common::ObMemberList &member_list, - const transaction::ObTransID &trans_id, - const common::ObPartitionArray &partition_array, - const ObLogInfoArray &log_info_array) override; - virtual int submit_batch_ack(const common::ObAddr &leader, - const transaction::ObTransID &trans_id, - const ObBatchAckArray &batch_ack_array) override; - int get_remote_priority_array(const common::ObAddr &server, - const common::ObPartitionIArray &partition_array, - election::PriorityArray &priority_array) const; - virtual int query_remote_log(const common::ObAddr &server, - const common::ObPartitionKey &partition_key, - const uint64_t log_id, - transaction::ObTransID &trans_id, - int64_t &submit_timestamp) override; - int get_clog_file_id_range(file_id_t &min_file_id, file_id_t &max_file_id) override; + int get_need_freeze_partition_array(NeedFreezePartitionArray& partition_array) const; + virtual int submit_batch_log(const common::ObMemberList& member_list, const transaction::ObTransID& trans_id, + const common::ObPartitionArray& partition_array, const ObLogInfoArray& log_info_array) override; + virtual int submit_batch_ack(const common::ObAddr& leader, const transaction::ObTransID& trans_id, + const ObBatchAckArray& batch_ack_array) override; + int get_remote_priority_array(const common::ObAddr& server, const common::ObPartitionIArray& partition_array, + election::PriorityArray& priority_array) const; + virtual int query_remote_log(const common::ObAddr& server, const common::ObPartitionKey& partition_key, + const uint64_t log_id, transaction::ObTransID& trans_id, int64_t& submit_timestamp) override; + int get_clog_file_id_range(file_id_t& min_file_id, file_id_t& max_file_id) override; int delete_all_clog_files(); // ================== interface for ObIlogStorage begin==================== - int get_cursor_batch(const common::ObPartitionKey &pkey, - const uint64_t query_log_id, - ObGetCursorResult &result) override; - int get_cursor_batch(const common::ObPartitionKey &pkey, - const uint64_t query_log_id, - ObLogCursorExt &log_cursor, - ObGetCursorResult &result, - uint64_t &cursor_start_log_id) override; - int get_cursor_batch_from_file(const common::ObPartitionKey &pkey, - const uint64_t query_log_id, - ObGetCursorResult &result) override; - int get_cursor(const common::ObPartitionKey &pkey, - const uint64_t query_log_id, - ObLogCursorExt &log_cursor) override; - int submit_cursor(const common::ObPartitionKey &pkey, - const uint64_t log_id, - const ObLogCursorExt &log_cursor_ext) override; - int submit_cursor(const common::ObPartitionKey &partition_key, - const uint64_t log_id, - const ObLogCursorExt &log_cursor_ext, - const common::ObMemberList &memberlist, - const int64_t replica_num, - const int64_t memberlist_version) override; - int query_max_ilog_id(const common::ObPartitionKey &pkey, - uint64_t &ret_max_ilog_id) override; - int query_max_flushed_ilog_id(const common::ObPartitionKey &pkey, - uint64_t &ret_max_ilog_id) override; - int get_ilog_memstore_min_log_id_and_ts(const common::ObPartitionKey &pkey, - uint64_t &min_log_id, - int64_t &min_log_ts) override; - int get_ilog_file_id_range(file_id_t &min_file_id, file_id_t &max_file_id) override; - int query_next_ilog_file_id(file_id_t &next_ilog_file_id) override; - int locate_by_timestamp(const common::ObPartitionKey &pkey, - const int64_t start_ts, - uint64_t &target_log_id, - int64_t &target_log_timestamp) override; - int locate_ilog_file_by_log_id(const common::ObPartitionKey &pkey, - const uint64_t start_log_id, - uint64_t &end_log_id, - file_id_t &ilog_id) override; + int get_cursor_batch( + const common::ObPartitionKey& pkey, const uint64_t query_log_id, ObGetCursorResult& result) override; + int get_cursor_batch(const common::ObPartitionKey& pkey, const uint64_t query_log_id, ObLogCursorExt& log_cursor, + ObGetCursorResult& result, uint64_t& cursor_start_log_id) override; + int get_cursor_batch_from_file( + const common::ObPartitionKey& pkey, const uint64_t query_log_id, ObGetCursorResult& result) override; + int get_cursor(const common::ObPartitionKey& pkey, const uint64_t query_log_id, ObLogCursorExt& log_cursor) override; + int submit_cursor( + const common::ObPartitionKey& pkey, const uint64_t log_id, const ObLogCursorExt& log_cursor_ext) override; + int submit_cursor(const common::ObPartitionKey& partition_key, const uint64_t log_id, + const ObLogCursorExt& log_cursor_ext, const common::ObMemberList& memberlist, const int64_t replica_num, + const int64_t memberlist_version) override; + int query_max_ilog_id(const common::ObPartitionKey& pkey, uint64_t& ret_max_ilog_id) override; + int query_max_flushed_ilog_id(const common::ObPartitionKey& pkey, uint64_t& ret_max_ilog_id) override; + int get_ilog_memstore_min_log_id_and_ts( + const common::ObPartitionKey& pkey, uint64_t& min_log_id, int64_t& min_log_ts) override; + int get_ilog_file_id_range(file_id_t& min_file_id, file_id_t& max_file_id) override; + int query_next_ilog_file_id(file_id_t& next_ilog_file_id) override; + int locate_by_timestamp(const common::ObPartitionKey& pkey, const int64_t start_ts, uint64_t& target_log_id, + int64_t& target_log_timestamp) override; + int locate_ilog_file_by_log_id(const common::ObPartitionKey& pkey, const uint64_t start_log_id, uint64_t& end_log_id, + file_id_t& ilog_id) override; int fill_file_id_cache() override; - int ensure_log_continuous_in_file_id_cache(const common::ObPartitionKey &partition_key, - const uint64_t log_id) override; - int get_index_info_block_map(const file_id_t file_id, - IndexInfoBlockMap &index_info_block_map) override; - int check_need_block_log(bool &is_need) const override; + int ensure_log_continuous_in_file_id_cache( + const common::ObPartitionKey& partition_key, const uint64_t log_id) override; + int get_index_info_block_map(const file_id_t file_id, IndexInfoBlockMap& index_info_block_map) override; + int check_need_block_log(bool& is_need) const override; int delete_all_ilog_files(); - ObLogCache *get_ilog_log_cache() override {return is_inited_ ? &ilog_log_cache_ : NULL;} + ObLogCache* get_ilog_log_cache() override + { + return is_inited_ ? &ilog_log_cache_ : NULL; + } - int check_is_clog_obsoleted(const common::ObPartitionKey &partition_key, - const file_id_t file_id, - const offset_t offset, - bool &is_obsoleted) const override; + int check_is_clog_obsoleted(const common::ObPartitionKey& partition_key, const file_id_t file_id, + const offset_t offset, bool& is_obsoleted) const override; // ================== interface for ObIlogStorage end ==================== int get_clog_using_disk_space(int64_t& space) const; int get_ilog_using_disk_space(int64_t& space) const; bool is_clog_disk_error() const override; + private: int fetch_log_from_server( const common::ObAddr& server, const common::ObPartitionKey& key, const uint64_t start_id, const uint64_t end_id); @@ -714,11 +563,11 @@ private: void get_dst_list_(const share::ObCascadMemberList& mem_list, share::ObCascadMemberList& dst_list) const; int delete_file_(const char* name); - private: +private: static const int64_t PREPARE_CACHE_FILE_INTERVAL = 100 * 1000; static const int64_t RESERVED_DISK_USAGE_PERFERT = 80; - private: +private: bool is_inited_; // instance for clog ObCommitLogEnv clog_env_; diff --git a/src/clog/ob_log_entry.cpp b/src/clog/ob_log_entry.cpp index 8a0bf05e9..11af4dad0 100644 --- a/src/clog/ob_log_entry.cpp +++ b/src/clog/ob_log_entry.cpp @@ -113,23 +113,24 @@ int ObLogEntry::deep_copy_to(ObLogEntry& entry) const return deep_copy_to_(entry); } -int ObLogEntry::get_next_replay_ts_for_rg(int64_t &next_replay_ts) const +int ObLogEntry::get_next_replay_ts_for_rg(int64_t& next_replay_ts) const { int ret = OB_SUCCESS; if (OB_LOG_AGGRE == header_.get_log_type()) { int64_t pos = 0; int32_t next_log_offset = 0; - const char *log_buf = get_buf(); + const char* log_buf = get_buf(); const int64_t log_buf_len = header_.get_data_len(); if (OB_FAIL(serialization::decode_i32(log_buf, log_buf_len, pos, &next_log_offset))) { - REPLAY_LOG(ERROR, "serialization decode_i32 failed", KR(ret), K(log_buf_len), K(pos), - K(header_), K(next_log_offset)); + REPLAY_LOG( + ERROR, "serialization decode_i32 failed", KR(ret), K(log_buf_len), K(pos), K(header_), K(next_log_offset)); } else if (OB_FAIL(serialization::decode_i64(log_buf, log_buf_len, pos, &next_replay_ts))) { - REPLAY_LOG(ERROR, "serialization decode_i64 failed", KR(ret), K(log_buf_len), K(pos), - K(header_), K(next_log_offset)); - } else {/*do nothing*/} + REPLAY_LOG( + ERROR, "serialization decode_i64 failed", KR(ret), K(log_buf_len), K(pos), K(header_), K(next_log_offset)); + } else { /*do nothing*/ + } } else { - //for non_aggregate_log, just assign next_replay_ts with submit_timestamp_ + // for non_aggregate_log, just assign next_replay_ts with submit_timestamp_ next_replay_ts = header_.get_submit_timestamp(); } return ret; diff --git a/src/clog/ob_log_entry.h b/src/clog/ob_log_entry.h index e9caf6f57..8fa8728b2 100644 --- a/src/clog/ob_log_entry.h +++ b/src/clog/ob_log_entry.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace clog { class ObLogEntry { - public: +public: ObLogEntry(); ~ObLogEntry(); int generate_entry(const ObLogEntryHeader& header, const char* buf); @@ -59,14 +59,14 @@ class ObLogEntry { { return header_.update_proposal_id(new_proposal_id); } - int get_next_replay_ts_for_rg(int64_t &next_replay_ts) const; + int get_next_replay_ts_for_rg(int64_t& next_replay_ts) const; TO_STRING_KV(N_HEADER, header_); NEED_SERIALIZE_AND_DESERIALIZE; - protected: +protected: int deep_copy_to_(ObLogEntry& entry) const; - private: +private: ObLogEntryHeader header_; const char* buf_; DISALLOW_COPY_AND_ASSIGN(ObLogEntry); @@ -76,7 +76,7 @@ class ObLogEntry { class ObIndexEntry { OB_UNIS_VERSION(1); - public: +public: ObIndexEntry(); ~ObIndexEntry() { @@ -147,12 +147,12 @@ class ObIndexEntry { file_id_, N_OFFSET, offset_, N_SIZE, size_, N_SUBMIT_TIMESTAMP, get_submit_timestamp(), "is_batch_committed", is_batch_committed(), K_(accum_checksum)); - private: +private: static const int16_t INDEX_MAGIC = 0x494E; // IN means index static const int16_t INDEX_VERSION = 1; static const uint64_t MASK = 1ull << 63; - private: +private: int16_t magic_; int16_t version_; common::ObPartitionKey partition_key_; @@ -168,7 +168,7 @@ class ObIndexEntry { }; class ObPaddingEntry { - public: +public: ObPaddingEntry(); ~ObPaddingEntry() {} @@ -178,11 +178,11 @@ class ObPaddingEntry { TO_STRING_KV(K(magic_), K(version_), K(entry_size_)); NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: static const int16_t PADDING_MAGIC = 0x5044; // "PD" static const int16_t PADDING_VERSION = 1; - private: +private: int16_t magic_; int16_t version_; int64_t entry_size_; // total len of ObPaddingEntry, @@ -190,7 +190,7 @@ class ObPaddingEntry { }; class ObCompressedLogEntryHeader { - public: +public: ObCompressedLogEntryHeader(); ~ObCompressedLogEntryHeader(); int shallow_copy(const ObCompressedLogEntryHeader& other); @@ -216,7 +216,7 @@ class ObCompressedLogEntryHeader { TO_STRING_KV(K(magic_), K(orig_data_len_), K(compressed_data_len_)); NEED_SERIALIZE_AND_DESERIALIZE; - public: +public: // attention!!!!: you should modify is_compress_log() in "ob_log_compress.h" and // parse_log_item_type() in "ob_raw_entry_iterator.h" when modifing following magic numbers // , and also ObCLogItemType in "ob_raw_entry_iterator.h". @@ -225,7 +225,7 @@ class ObCompressedLogEntryHeader { static const int16_t COMPRESS_LZ4_MAGIC = 0x4302; static const int16_t COMPRESS_ZSTD_1_3_8_MAGIC = 0x4303; - private: +private: // Attention!!! Note that the serialization size of this structure should not exceed ObLogEntryHeader int16_t magic_; // The first byte indicates whether to use compression, and the second byte indicates the compression // algorithm @@ -235,7 +235,7 @@ class ObCompressedLogEntryHeader { }; class ObCompressedLogEntry { - public: +public: ObCompressedLogEntry(); ~ObCompressedLogEntry(); void destroy(); @@ -250,7 +250,7 @@ class ObCompressedLogEntry { TO_STRING_KV(N_HEADER, header_); NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: ObCompressedLogEntryHeader header_; const char* buf_; // ObLogEntry's content after compressed DISALLOW_COPY_AND_ASSIGN(ObCompressedLogEntry); diff --git a/src/clog/ob_log_entry_header.h b/src/clog/ob_log_entry_header.h index 0cf28fd61..9514443a5 100644 --- a/src/clog/ob_log_entry_header.h +++ b/src/clog/ob_log_entry_header.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace clog { class ObLogEntryHeader { - public: +public: ObLogEntryHeader(); ~ObLogEntryHeader(); @@ -192,11 +192,11 @@ class ObLogEntryHeader { return ENTRY_MAGIC == magic_number; } - private: +private: int64_t calc_header_checksum() const; int64_t calc_data_checksum(const char* buf, const int64_t data_len) const; - private: +private: static const int16_t ENTRY_MAGIC = 0x4552; // RE means record static const int16_t OB_LOG_VERSION = 1; static const uint64_t TRANS_BATCH_COMMIT_FLAG = (1ULL << 63); @@ -204,7 +204,7 @@ class ObLogEntryHeader { static const uint32_t IS_TRANS_LOG_FLAG = (1 << 31); static const uint32_t IS_TRANS_LOG_MASK = IS_TRANS_LOG_FLAG - 1; - private: +private: int16_t magic_; int16_t version_; // The highest position of log_type is used to indicates @@ -243,7 +243,7 @@ class ObLogEntryHeader { // 3. Must keep the variable before this is 64-bit aligned int64_t header_checksum_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogEntryHeader); }; diff --git a/src/clog/ob_log_event_scheduler.h b/src/clog/ob_log_event_scheduler.h index baebc76d5..b358453fc 100644 --- a/src/clog/ob_log_event_scheduler.h +++ b/src/clog/ob_log_event_scheduler.h @@ -19,11 +19,11 @@ namespace oceanbase { namespace clog { class ObLogStateEventTaskV2; class ObLogEventScheduler { - public: +public: ObLogEventScheduler(); ~ObLogEventScheduler(); - public: +public: virtual int init(); virtual void destroy(); virtual int start(); @@ -32,17 +32,17 @@ class ObLogEventScheduler { virtual int add_state_change_event(ObLogStateEventTaskV2* task); virtual int add_state_change_delay_event(ObLogStateEventTaskV2* task); - private: +private: int schedule_task_(ObLogStateEventTaskV2* task, const int64_t delay); int64_t get_time_wheel_thread_num_() const; - private: +private: static const int64_t CLOG_EVENT_TIME_WHEEL_PRECISION = 1000; // 1ms - private: +private: common::ObTimeWheel time_wheel_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogEventScheduler); }; // class ObLogEventScheduler } // namespace clog diff --git a/src/clog/ob_log_event_task_V2.h b/src/clog/ob_log_event_task_V2.h index 4aa02e690..709f425de 100644 --- a/src/clog/ob_log_event_task_V2.h +++ b/src/clog/ob_log_event_task_V2.h @@ -23,11 +23,11 @@ class ObPartitionService; namespace clog { class ObLogEventScheduler; class ObLogStateEventTaskV2 : public common::ObTimeWheelTask { - public: +public: ObLogStateEventTaskV2(); virtual ~ObLogStateEventTaskV2(); - public: +public: int init(const common::ObPartitionKey& partition_key, ObLogEventScheduler* event_scheduler, storage::ObPartitionService* partition_service); void destroy(); @@ -39,7 +39,7 @@ class ObLogStateEventTaskV2 : public common::ObTimeWheelTask { } int set_expected_ts(const int64_t delay); - private: +private: static const int64_t MAX_EVENT_EXECUTE_DEPLAY_TS = 100 * 1000; bool is_inited_; @@ -48,7 +48,7 @@ class ObLogStateEventTaskV2 : public common::ObTimeWheelTask { storage::ObPartitionService* partition_service_; int64_t expected_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogStateEventTaskV2); }; diff --git a/src/clog/ob_log_executor.h b/src/clog/ob_log_executor.h index 815a41135..a78d6da16 100644 --- a/src/clog/ob_log_executor.h +++ b/src/clog/ob_log_executor.h @@ -50,7 +50,7 @@ class ObIndexEntry; class ObLogEntry; class ObLogExecutor { - public: +public: ObLogExecutor() : is_inited_(false), pkt_handler_(NULL), log_engine_(NULL) {} ~ObLogExecutor() @@ -69,10 +69,10 @@ class ObLogExecutor { int req_heartbeat_info( const obrpc::ObLogReqHeartbeatInfoRequest& req_msg, obrpc::ObLogReqHeartbeatInfoResponse& result); - private: +private: int handle_request(const common::ObAddr& server, const char* data, int64_t len, int64_t& pos); - private: +private: bool is_inited_; ObIPartitionLogPacketHandler* pkt_handler_; ObILogEngine* log_engine_; diff --git a/src/clog/ob_log_ext_ring_buffer.h b/src/clog/ob_log_ext_ring_buffer.h index 8339f4c99..0241f7257 100644 --- a/src/clog/ob_log_ext_ring_buffer.h +++ b/src/clog/ob_log_ext_ring_buffer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace clog { class ObILogExtRingBufferData : public common::ObExternalRef::IERefPtr { - public: +public: virtual bool can_overwrite(const ObILogExtRingBufferData* data) = 0; virtual bool can_be_removed() = 0; @@ -36,13 +36,13 @@ class ObILogExtRingBufferData : public common::ObExternalRef::IERefPtr { }; class ObILogTaskCallBack { - public: +public: ObILogTaskCallBack() {} virtual ~ObILogTaskCallBack() {} - public: +public: virtual int sliding_cb(const int64_t sn, const ObILogExtRingBufferData* data) = 0; }; @@ -112,13 +112,13 @@ class ObLogExtRingBuffer : protected common::ObExtendibleRingBuffer BaseType; - public: +public: ObLogExtRingBuffer(); virtual ~ObLogExtRingBuffer(); inline int init(const int64_t start_id); int destroy(); - public: +public: int get(const int64_t id, ObILogExtRingBufferData*& val, const int64_t*& ref) const; int revert(const int64_t* ref); int set(const int64_t id, ObILogExtRingBufferData* data); @@ -134,10 +134,10 @@ class ObLogExtRingBuffer : protected common::ObExtendibleRingBuffer SearchMap; struct SearchParam { - public: +public: SearchStatusType type_; common::PageArena<>* map_allocator_; common::PageArena<>* info_allocator_; @@ -212,7 +212,7 @@ struct SearchParam { } TO_STRING_KV(K(type_), KP(map_allocator_), KP(info_allocator_)); - private: +private: DISALLOW_COPY_AND_ASSIGN(SearchParam); }; @@ -352,13 +352,13 @@ struct Progress { TO_STRING_KV( K(total_), K(finished_), K(min_file_id_), K(max_file_id_), K(cur_file_id_), K(start_file_id_), K(break_file_id_)); - private: +private: DISALLOW_COPY_AND_ASSIGN(Progress); }; // Only supports positioning with breakpoints class ObLogExternalExecutorWithBreakpoint { - public: +public: struct Config { const char* ilog_dir_; uint64_t read_timeout_; @@ -375,7 +375,7 @@ class ObLogExternalExecutorWithBreakpoint { TO_STRING_KV(K(ilog_dir_), K(read_timeout_)); }; - public: +public: ObLogExternalExecutorWithBreakpoint() : is_inited_(false), log_engine_(NULL), config_(), partition_service_(NULL) {} ~ObLogExternalExecutorWithBreakpoint() @@ -383,13 +383,13 @@ class ObLogExternalExecutorWithBreakpoint { int init(const ObLogExternalExecutorWithBreakpoint::Config& config, clog::ObILogEngine* log_engine, storage::ObPartitionService* partition_service); - public: +public: int req_start_log_id_by_ts_with_breakpoint(const obrpc::ObLogReqStartLogIdByTsRequestWithBreakpoint& req_msg, obrpc::ObLogReqStartLogIdByTsResponseWithBreakpoint& result); int req_start_pos_by_log_id_with_breakpoint(const obrpc::ObLogReqStartPosByLogIdRequestWithBreakpoint& req_msg, obrpc::ObLogReqStartPosByLogIdResponseWithBreakpoint& result); - private: +private: inline int64_t get_rpc_deadline() { return THIS_WORKER.get_timeout_ts(); @@ -435,10 +435,10 @@ class ObLogExternalExecutorWithBreakpoint { int get_min_log_id_and_ts_from_index_info_block_map_(clog::IndexInfoBlockMap& index_info_block_map, const common::ObPartitionKey& partition_key, uint64_t& min_log_id, int64_t& min_submit_timestamp) const; - private: +private: static const bool FORCE_RPINT_STATISTIC = true; - private: +private: bool is_inited_; clog::ObILogEngine* log_engine_; Config config_; diff --git a/src/clog/ob_log_external_monitor.h b/src/clog/ob_log_external_monitor.h index fc0c02b48..30d871476 100644 --- a/src/clog/ob_log_external_monitor.h +++ b/src/clog/ob_log_external_monitor.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace clog { // statistic for external rpc request class ObExtReqStatistic { - public: +public: static void reset_all() { ts.reset(); @@ -133,7 +133,7 @@ class ObExtReqStatistic { } } - private: +private: struct ReqByTsStatistic { int64_t req_count_; int64_t pkey_count_; @@ -211,7 +211,7 @@ class ObExtReqStatistic { TO_STRING_KV(K(req_count_), K(pkey_count_), K(err_count_), K(disk_pkey_count_), K(disk_count_)); }; - private: +private: static ReqByTsStatistic ts; static ReqByIdStatistic id; static ReqFetchStatistic fetch; diff --git a/src/clog/ob_log_external_qit.h b/src/clog/ob_log_external_qit.h index bd1270f1e..b686f6256 100644 --- a/src/clog/ob_log_external_qit.h +++ b/src/clog/ob_log_external_qit.h @@ -21,10 +21,10 @@ namespace extlog { // Quit In Time class ObExtRpcQit { - public: +public: enum ExtRpcType { RPC_INVALID_TYPE = 0, RPC_LOCATE_BY_TS = 1, RPC_LOCATE_BY_ID = 2, RPC_TYPE_MAX = 3 }; - public: +public: ObExtRpcQit() : is_inited_(false), type_(RPC_INVALID_TYPE), deadline_(0) {} ~ObExtRpcQit() @@ -41,7 +41,7 @@ class ObExtRpcQit { TO_STRING_KV(K(is_inited_), K(type_), K(deadline_)); - private: +private: inline int64_t cur_ts() const { return common::ObTimeUtility::current_time(); @@ -53,7 +53,7 @@ class ObExtRpcQit { int64_t get_handle_time() const; int enough_time(const int64_t reserved_interval, bool& is_enough) const; - public: +public: static const int64_t MILLI_SECOND = 1000; static const int64_t SECOND = 1000 * 1000; static const int64_t HANDLE_TIME_INVALD = 0; @@ -61,7 +61,7 @@ class ObExtRpcQit { static const int64_t HANDLE_TIME_ID = 1 * SECOND; static const int64_t HURRY_QUIT_RESERVED = 100 * MILLI_SECOND; - private: +private: bool is_inited_; ExtRpcType type_; int64_t deadline_; diff --git a/src/clog/ob_log_external_rpc.h b/src/clog/ob_log_external_rpc.h index 47d9074a5..2e3799641 100644 --- a/src/clog/ob_log_external_rpc.h +++ b/src/clog/ob_log_external_rpc.h @@ -59,7 +59,7 @@ class ObLogLeaderHeartbeatReq; class ObLogLeaderHeartbeatResp; class ObLogExternalProxy : public ObRpcProxy { - public: +public: DEFINE_TO(ObLogExternalProxy); // req_start_log_id_by_ts() @@ -107,7 +107,7 @@ class ObLogExternalProxy : public ObRpcProxy { class ObLogReqStartLogIdByTsRequest { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 400kb for cur version. - public: +public: struct Param { common::ObPartitionKey pkey_; int64_t start_tstamp_; @@ -117,11 +117,11 @@ class ObLogReqStartLogIdByTsRequest { }; typedef common::ObSEArray ParamArray; - public: +public: ObLogReqStartLogIdByTsRequest(); ~ObLogReqStartLogIdByTsRequest(); - public: +public: void reset(); bool is_valid() const; int set_params(const ParamArray& params); @@ -132,18 +132,18 @@ class ObLogReqStartLogIdByTsRequest { TO_STRING_KV(K_(rpc_ver), K_(params)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; ParamArray params_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReqStartLogIdByTsRequest); }; class ObLogReqStartLogIdByTsResponse { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 400kb for cur version. - public: +public: // Stored in the same order as Request's params. struct Result { // Partition specific error code. @@ -156,11 +156,11 @@ class ObLogReqStartLogIdByTsResponse { }; typedef common::ObSEArray ResultArray; - public: +public: ObLogReqStartLogIdByTsResponse(); ~ObLogReqStartLogIdByTsResponse(); - public: +public: void reset(); void set_err(const int err); int set_results(const ResultArray& results); @@ -172,18 +172,18 @@ class ObLogReqStartLogIdByTsResponse { TO_STRING_KV(K_(rpc_ver), K_(err), K_(res)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; int err_; ResultArray res_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReqStartLogIdByTsResponse); }; class ObLogReqStartLogIdByTsProcessor : public ObRpcProcessor > { - public: +public: ObLogReqStartLogIdByTsProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} @@ -192,10 +192,10 @@ class ObLogReqStartLogIdByTsProcessor partition_service_ = NULL; } - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; @@ -217,7 +217,7 @@ class ObLogReqStartLogIdByTsProcessor class ObLogReqStartPosByLogIdRequest { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 400kb for cur version. - public: +public: struct Param { common::ObPartitionKey pkey_; uint64_t start_log_id_; @@ -229,11 +229,11 @@ class ObLogReqStartPosByLogIdRequest { }; typedef common::ObSEArray ParamArray; - public: +public: ObLogReqStartPosByLogIdRequest(); ~ObLogReqStartPosByLogIdRequest(); - public: +public: void reset(); bool is_valid() const; int set_params(const ParamArray& params); @@ -243,18 +243,18 @@ class ObLogReqStartPosByLogIdRequest { TO_STRING_KV(K_(rpc_ver), K_(params)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; ParamArray params_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReqStartPosByLogIdRequest); }; class ObLogReqStartPosByLogIdResponse { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 500kb for cur version. - public: +public: // Stored in the same order as Request's params. struct Result { // Partition specific error code. @@ -270,11 +270,11 @@ class ObLogReqStartPosByLogIdResponse { }; typedef common::ObSEArray ResultArray; - public: +public: ObLogReqStartPosByLogIdResponse(); ~ObLogReqStartPosByLogIdResponse(); - public: +public: void reset(); void set_err(const int err); int set_results(const ResultArray& results); @@ -286,18 +286,18 @@ class ObLogReqStartPosByLogIdResponse { TO_STRING_KV(K_(rpc_ver), K_(err), K_(res)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; int err_; ResultArray res_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReqStartPosByLogIdResponse); }; class ObLogReqStartPosByLogIdProcessor : public ObRpcProcessor > { - public: +public: ObLogReqStartPosByLogIdProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} @@ -306,10 +306,10 @@ class ObLogReqStartPosByLogIdProcessor partition_service_ = NULL; } - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; @@ -324,7 +324,7 @@ class ObLogExternalFetchLogRequest { static const int64_t ITEM_CNT_LMT = 10000; // Around 500kb for cur version. static const int64_t DEFAULT_OFFLINE_TIMEOUT = 5 * 1000 * 1000; - public: +public: struct Param { common::ObPartitionKey pkey_; uint64_t start_log_id_; @@ -337,11 +337,11 @@ class ObLogExternalFetchLogRequest { }; typedef common::ObSEArray ParamArray; - public: +public: ObLogExternalFetchLogRequest(); ~ObLogExternalFetchLogRequest(); - public: +public: void reset(); bool is_valid() const; int set_params(const ParamArray& params); @@ -357,9 +357,9 @@ class ObLogExternalFetchLogRequest { TO_STRING_KV(K_(rpc_ver), K_(params), K_(file_id), K_(offset), K_(offline_timeout)); OB_UNIS_VERSION(1); - private: +private: static const int64_t MAX_OFFLINE_TIMEOUT = 100 * 1000 * 1000; // 100 second - private: +private: int64_t rpc_ver_; ParamArray params_; clog::file_id_t file_id_; @@ -370,7 +370,7 @@ class ObLogExternalFetchLogRequest { class ObLogExternalFetchLogResponse { static const int64_t CUR_RPC_VER = 1; - public: +public: struct OfflinePartition { common::ObPartitionKey pkey_; int64_t sync_ts_; @@ -380,11 +380,11 @@ class ObLogExternalFetchLogResponse { }; typedef common::ObSEArray OfflinePartitionArray; - public: +public: ObLogExternalFetchLogResponse(); ~ObLogExternalFetchLogResponse(); - public: +public: void reset(); int set_offline_partitions(const OfflinePartitionArray& offlines); int append_offline_partition(const common::ObPartitionKey& pkey, const int64_t sync_ts); @@ -407,14 +407,14 @@ class ObLogExternalFetchLogResponse { TO_STRING_KV(K_(rpc_ver), K_(err), K_(offline_partitions), K_(file_id), K_(offset), K_(log_num), K_(pos)); OB_UNIS_VERSION(1); - private: +private: int64_t offline_partition_cnt_lmt_(); int64_t cur_ver_offline_partition_cnt_lmt_(); - private: +private: static const int64_t FETCH_BUF_LEN = common::OB_MAX_LOG_BUFFER_SIZE; - private: +private: int64_t rpc_ver_; int err_; OfflinePartitionArray offline_partitions_; @@ -426,7 +426,7 @@ class ObLogExternalFetchLogResponse { }; class ObLogExternalFetchLogProcessor : public ObRpcProcessor > { - public: +public: ObLogExternalFetchLogProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogExternalFetchLogProcessor() @@ -434,10 +434,10 @@ class ObLogExternalFetchLogProcessor : public ObRpcProcessor ParamArray; - public: +public: ObLogReqHeartbeatInfoRequest(); ~ObLogReqHeartbeatInfoRequest(); - public: +public: void reset(); bool is_valid() const; int set_params(const ParamArray& params); @@ -473,7 +473,7 @@ class ObLogReqHeartbeatInfoRequest { TO_STRING_KV(K_(rpc_ver), K_(params)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; ParamArray params_; }; @@ -481,7 +481,7 @@ class ObLogReqHeartbeatInfoRequest { class ObLogReqHeartbeatInfoResponse { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 300kb for cur version. - public: +public: struct Result { int err_; int64_t tstamp_; @@ -491,11 +491,11 @@ class ObLogReqHeartbeatInfoResponse { }; typedef common::ObSEArray ResultArray; - public: +public: ObLogReqHeartbeatInfoResponse(); ~ObLogReqHeartbeatInfoResponse(); - public: +public: void reset(); void set_err(const int err); int set_results(const ResultArray& results); @@ -507,7 +507,7 @@ class ObLogReqHeartbeatInfoResponse { TO_STRING_KV(K_(rpc_ver), K_(err), K_(res)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; int err_; ResultArray res_; @@ -515,7 +515,7 @@ class ObLogReqHeartbeatInfoResponse { class ObLogReqHeartbeatInfoProcessor : public ObRpcProcessor > { - public: +public: ObLogReqHeartbeatInfoProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogReqHeartbeatInfoProcessor() @@ -523,17 +523,17 @@ class ObLogReqHeartbeatInfoProcessor partition_service_ = NULL; } - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; // check ps & ps->clog_mgr not null // to simplify code class ObExternalProcessorHelper { - public: +public: static int get_clog_mgr(storage::ObPartitionService* ps, clog::ObICLogMgr*& clog_mgr); }; @@ -565,11 +565,11 @@ struct BreakInfo { }; class ObLogReqStartLogIdByTsRequestWithBreakpoint { - public: +public: static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 400kb for cur version. - public: +public: struct Param { common::ObPartitionKey pkey_; int64_t start_tstamp_; @@ -590,11 +590,11 @@ class ObLogReqStartLogIdByTsRequestWithBreakpoint { }; typedef common::ObSEArray ParamArray; - public: +public: ObLogReqStartLogIdByTsRequestWithBreakpoint(); ~ObLogReqStartLogIdByTsRequestWithBreakpoint(); - public: +public: void reset(); bool is_valid() const; int set_params(const ParamArray& params); @@ -605,11 +605,11 @@ class ObLogReqStartLogIdByTsRequestWithBreakpoint { TO_STRING_KV(K_(rpc_ver), "param_count", params_.count(), K_(params)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; ParamArray params_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReqStartLogIdByTsRequestWithBreakpoint); }; @@ -623,7 +623,7 @@ class ObLogReqStartLogIdByTsRequestWithBreakpoint { class ObLogReqStartLogIdByTsResponseWithBreakpoint { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 400kb for cur version. - public: +public: // Stored in the same order as Request's params. struct Result { // Partition specific error code. @@ -646,11 +646,11 @@ class ObLogReqStartLogIdByTsResponseWithBreakpoint { }; typedef common::ObSEArray ResultArray; - public: +public: ObLogReqStartLogIdByTsResponseWithBreakpoint(); ~ObLogReqStartLogIdByTsResponseWithBreakpoint(); - public: +public: void reset(); void set_err(const int err); int set_results(const ResultArray& results); @@ -662,18 +662,18 @@ class ObLogReqStartLogIdByTsResponseWithBreakpoint { TO_STRING_KV(K_(rpc_ver), K_(err), "result_count", res_.count(), "result", res_); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; int err_; ResultArray res_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReqStartLogIdByTsResponseWithBreakpoint); }; class ObLogReqStartLogIdByTsProcessorWithBreakpoint : public ObRpcProcessor > { - public: +public: ObLogReqStartLogIdByTsProcessorWithBreakpoint(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} @@ -682,17 +682,17 @@ class ObLogReqStartLogIdByTsProcessorWithBreakpoint partition_service_ = NULL; } - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; class ObLogReqStartPosByLogIdRequestWithBreakpoint { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 400kb for cur version. - public: +public: struct Param { common::ObPartitionKey pkey_; uint64_t start_log_id_; @@ -707,11 +707,11 @@ class ObLogReqStartPosByLogIdRequestWithBreakpoint { }; typedef common::ObSEArray ParamArray; - public: +public: ObLogReqStartPosByLogIdRequestWithBreakpoint(); ~ObLogReqStartPosByLogIdRequestWithBreakpoint(); - public: +public: void reset(); bool is_valid() const; int set_params(const ParamArray& params); @@ -721,18 +721,18 @@ class ObLogReqStartPosByLogIdRequestWithBreakpoint { TO_STRING_KV(K(rpc_ver_), K(params_)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; ParamArray params_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReqStartPosByLogIdRequestWithBreakpoint); }; class ObLogReqStartPosByLogIdResponseWithBreakpoint { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 500kb for cur version. - public: +public: // Stored in the same order as Request's params. struct Result { // Partition specific error code. @@ -749,11 +749,11 @@ class ObLogReqStartPosByLogIdResponseWithBreakpoint { }; typedef common::ObSEArray ResultArray; - public: +public: ObLogReqStartPosByLogIdResponseWithBreakpoint(); ~ObLogReqStartPosByLogIdResponseWithBreakpoint(); - public: +public: void reset(); void set_err(const int err); int set_results(const ResultArray& results); @@ -765,18 +765,18 @@ class ObLogReqStartPosByLogIdResponseWithBreakpoint { TO_STRING_KV(K_(rpc_ver), K_(err), K_(res)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; int err_; ResultArray res_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReqStartPosByLogIdResponseWithBreakpoint); }; class ObLogReqStartPosByLogIdProcessorWithBreakpoint : public ObRpcProcessor > { - public: +public: ObLogReqStartPosByLogIdProcessorWithBreakpoint(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} @@ -785,10 +785,10 @@ class ObLogReqStartPosByLogIdProcessorWithBreakpoint partition_service_ = NULL; } - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; @@ -826,7 +826,7 @@ struct ObStreamSeq { class ObLogOpenStreamReq { static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 400kb for cur version. - public: +public: struct Param { common::ObPartitionKey pkey_; uint64_t start_log_id_; @@ -844,7 +844,7 @@ class ObLogOpenStreamReq { }; typedef common::ObSEArray ParamArray; - public: +public: ObLogOpenStreamReq() { reset(); @@ -852,7 +852,7 @@ class ObLogOpenStreamReq { ~ObLogOpenStreamReq() {} - public: +public: void reset() { rpc_ver_ = CUR_RPC_VER; @@ -923,24 +923,24 @@ class ObLogOpenStreamReq { K_(rpc_ver), K_(stream_lifetime), K_(liboblog_pid), K_(stale_stream), "param_count", params_.count(), K_(params)); OB_UNIS_VERSION(1); - private: +private: inline static bool is_valid_stream_lifetime(const int64_t lifetime) { // 0 means stream can be washed immediately return lifetime >= 0; } - private: +private: static const int64_t INVALID_STREAM_LIFETIME = -1; - private: +private: int64_t rpc_ver_; ParamArray params_; int64_t stream_lifetime_; // us uint64_t liboblog_pid_; // Process ID. ObStreamSeq stale_stream_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogOpenStreamReq); }; @@ -953,7 +953,7 @@ class ObLogOpenStreamReq { class ObLogOpenStreamResp { static const int64_t CUR_RPC_VER = 1; - public: +public: ObLogOpenStreamResp() { reset(); @@ -961,7 +961,7 @@ class ObLogOpenStreamResp { ~ObLogOpenStreamResp() {} - public: +public: int assign(const ObLogOpenStreamResp& other) { if (this != &other) { @@ -1022,18 +1022,18 @@ class ObLogOpenStreamResp { TO_STRING_KV(K(rpc_ver_), K(err_), K(debug_err_), K(seq_)); OB_UNIS_VERSION(1); - private: +private: int64_t rpc_ver_; int err_; int debug_err_; ObStreamSeq seq_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogOpenStreamResp); }; class ObLogOpenStreamProcessor : public ObRpcProcessor > { - public: +public: ObLogOpenStreamProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogOpenStreamProcessor() @@ -1041,17 +1041,17 @@ class ObLogOpenStreamProcessor : public ObRpcProcessor FetchLogHeartbeatArray; - public: +public: ObLogStreamFetchLogResp(); ~ObLogStreamFetchLogResp() { reset(); } - public: +public: int assign(const ObLogStreamFetchLogResp& other); void reset() @@ -1408,7 +1408,7 @@ class ObLogStreamFetchLogResp { feedback_partition_arr_, "heartbeat_array", fetch_log_heartbeat_arr_); OB_UNIS_VERSION(1); - private: +private: int64_t feedback_array_cnt_lmt_() { return CUR_RPC_VER == rpc_ver_ ? (cur_ver_array_cnt_lmt_() / 2) : 0; @@ -1419,10 +1419,10 @@ class ObLogStreamFetchLogResp { } int64_t cur_ver_array_cnt_lmt_(); - private: +private: static const int64_t FETCH_BUF_LEN = common::OB_MAX_LOG_BUFFER_SIZE; - private: +private: int64_t rpc_ver_; int err_; int debug_err_; @@ -1433,12 +1433,12 @@ class ObLogStreamFetchLogResp { int64_t pos_; char log_entry_buf_[FETCH_BUF_LEN]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogStreamFetchLogResp); }; class ObLogStreamFetchLogProcessor : public ObRpcProcessor > { - public: +public: ObLogStreamFetchLogProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogStreamFetchLogProcessor() @@ -1446,15 +1446,15 @@ class ObLogStreamFetchLogProcessor : public ObRpcProcessor ParamArray; - public: +public: ObLogLeaderHeartbeatReq() { reset(); @@ -1524,10 +1524,10 @@ class ObLogLeaderHeartbeatReq { TO_STRING_KV(K_(rpc_ver), "param_count", params_.count(), K_(params)); OB_UNIS_VERSION(1); - public: +public: static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 300kb for cur version. - private: +private: int64_t rpc_ver_; ParamArray params_; }; @@ -1541,7 +1541,7 @@ largest log_id that has been served + 1, next_served_ts_ is the timestamp corres served + 1 OB_PARTITION_NOT_EXIST: next_served_log_id_/next_served_ts_ is an invalid value */ class ObLogLeaderHeartbeatResp { - public: +public: struct Result { int err_; uint64_t next_served_log_id_; @@ -1558,7 +1558,7 @@ class ObLogLeaderHeartbeatResp { }; typedef common::ObSEArray ResultArray; - public: +public: ObLogLeaderHeartbeatResp() { reset(); @@ -1566,7 +1566,7 @@ class ObLogLeaderHeartbeatResp { ~ObLogLeaderHeartbeatResp() {} - public: +public: void reset() { rpc_ver_ = CUR_RPC_VER; @@ -1613,10 +1613,10 @@ class ObLogLeaderHeartbeatResp { TO_STRING_KV(K_(rpc_ver), K_(err), K_(debug_err), "result_count", res_.count(), "result", res_); OB_UNIS_VERSION(1); - private: +private: static const int64_t CUR_RPC_VER = 1; static const int64_t ITEM_CNT_LMT = 10000; // Around 300kb for cur version. - private: +private: int64_t rpc_ver_; int err_; int debug_err_; // For debugging, liboblog does not rely on this field @@ -1624,7 +1624,7 @@ class ObLogLeaderHeartbeatResp { }; class ObLogLeaderHeartbeatProcessor : public ObRpcProcessor > { - public: +public: ObLogLeaderHeartbeatProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObLogLeaderHeartbeatProcessor() @@ -1632,10 +1632,10 @@ class ObLogLeaderHeartbeatProcessor : public ObRpcProcessor ObMCLogInfoArray; class ObILogMembershipMgr { - public: +public: ObILogMembershipMgr() {} virtual ~ObILogMembershipMgr() {} - public: +public: virtual bool is_state_changed() = 0; virtual int switch_state() = 0; virtual int add_member(const common::ObMember& member, const int64_t quorum, obrpc::ObMCLogInfo& log_info) = 0; @@ -91,80 +91,58 @@ class ObILogMembershipMgr { }; class ObLogMembershipMgr : public ObILogMembershipMgr, public ObISubmitLogCb { - public: +public: ObLogMembershipMgr(); virtual ~ObLogMembershipMgr(); - public: +public: // When creating Partition,membership_timestamp is 0,membership_log_id is 0 // When observer is restarted, the value is obtained from BaseStorageInfo - int init(const common::ObMemberList &member_list, - const int64_t membership_timestamp, - const uint64_t membership_log_id, - const common::ObProposalID &ms_proposal_id, - const common::ObReplicaType replica_type, - const common::ObReplicaProperty replica_property, - const int64_t replica_num, - const bool need_skip_mlist_check, - const common::ObAddr &self, - const common::ObPartitionKey &partition_key, - ObILogSWForMS *sw, - ObLogMembershipTaskMgr *ms_task_mgr, - ObILogStateMgrForMS *state_mgr, - ObLogCascadingMgr *cascading_mgr, - ObILogCallbackEngine *cb_engine, - storage::ObPartitionService *partition_service, - common::ObILogAllocator *alloc_mgr); + int init(const common::ObMemberList& member_list, const int64_t membership_timestamp, + const uint64_t membership_log_id, const common::ObProposalID& ms_proposal_id, + const common::ObReplicaType replica_type, const common::ObReplicaProperty replica_property, + const int64_t replica_num, const bool need_skip_mlist_check, const common::ObAddr& self, + const common::ObPartitionKey& partition_key, ObILogSWForMS* sw, ObLogMembershipTaskMgr* ms_task_mgr, + ObILogStateMgrForMS* state_mgr, ObLogCascadingMgr* cascading_mgr, ObILogCallbackEngine* cb_engine, + storage::ObPartitionService* partition_service, common::ObILogAllocator* alloc_mgr); virtual bool is_state_changed() override; virtual int switch_state() override; - virtual int add_member(const common::ObMember &member, const int64_t quorum, obrpc::ObMCLogInfo &log_info) override; - virtual int remove_member(const common::ObMember &member, const int64_t quorum, obrpc::ObMCLogInfo &log_info) override; - virtual int change_quorum(const common::ObMemberList &curr_member_list, - const int64_t curr_quorum, - const int64_t new_quorum, - obrpc::ObMCLogInfo &log_info) override; + virtual int add_member(const common::ObMember& member, const int64_t quorum, obrpc::ObMCLogInfo& log_info) override; + virtual int remove_member( + const common::ObMember& member, const int64_t quorum, obrpc::ObMCLogInfo& log_info) override; + virtual int change_quorum(const common::ObMemberList& curr_member_list, const int64_t curr_quorum, + const int64_t new_quorum, obrpc::ObMCLogInfo& log_info) override; virtual int64_t get_replica_num() const override; virtual common::ObReplicaType get_replica_type() const override; virtual common::ObReplicaProperty get_replica_property() const override; - virtual const common::ObMemberList &get_curr_member_list() const override; - virtual int receive_log(const ObLogEntry &log_entry, - const common::ObAddr &server, - const int64_t cluster_id, - const ReceiveLogType rl_type) override; - virtual int receive_recovery_log(const ObLogEntry &log_entry, - const bool is_confirmed, - const int64_t accum_checksum, - const bool is_batch_committed) override; - virtual int append_disk_log(const ObLogEntry &log_entry, - const ObLogCursor &log_cursor, - const int64_t accum_checksum, - const bool batch_committed) override; - virtual int force_set_member_list(const common::ObMemberList &member_list, - const int64_t replica_num); - virtual int set_membership_info(const common::ObMemberList &member_list, - const int64_t membership_timestamp, - const uint64_t membership_log_id, - const int64_t replica_num, - const common::ObProposalID &ms_proposal_id); + virtual const common::ObMemberList& get_curr_member_list() const override; + virtual int receive_log(const ObLogEntry& log_entry, const common::ObAddr& server, const int64_t cluster_id, + const ReceiveLogType rl_type) override; + virtual int receive_recovery_log(const ObLogEntry& log_entry, const bool is_confirmed, const int64_t accum_checksum, + const bool is_batch_committed) override; + virtual int append_disk_log(const ObLogEntry& log_entry, const ObLogCursor& log_cursor, const int64_t accum_checksum, + const bool batch_committed) override; + virtual int force_set_member_list(const common::ObMemberList& member_list, const int64_t replica_num); + virtual int set_membership_info(const common::ObMemberList& member_list, const int64_t membership_timestamp, + const uint64_t membership_log_id, const int64_t replica_num, const common::ObProposalID& ms_proposal_id); virtual int64_t get_timestamp() const override; - virtual uint64_t get_log_id() const override { return membership_log_id_; } + virtual uint64_t get_log_id() const override + { + return membership_log_id_; + } virtual void reset_status() override; - virtual int write_start_membership(const ObLogType &log_type) override; - virtual int on_success(const common::ObPartitionKey &partition_key, - const clog::ObLogType log_type, - const uint64_t log_id, - const int64_t version, - const bool batch_committed, - const bool batch_last_succeed) override; - bool is_inited() const { return is_inited_; } + virtual int write_start_membership(const ObLogType& log_type) override; + virtual int on_success(const common::ObPartitionKey& partition_key, const clog::ObLogType log_type, + const uint64_t log_id, const int64_t version, const bool batch_committed, const bool batch_last_succeed) override; + bool is_inited() const + { + return is_inited_; + } virtual bool is_state_init() const override; virtual void reset_follower_pending_entry() override; - virtual void submit_success_cb_task(const ObLogType &log_type, - const uint64_t log_id, - const char *log_buf, - const int64_t log_buf_len, - const common::ObProposalID &proposal_id) override; - virtual void reconfirm_update_status(const ObLogEntry &log_entry) override; + virtual void submit_success_cb_task(const ObLogType& log_type, const uint64_t log_id, const char* log_buf, + const int64_t log_buf_len, const common::ObProposalID& proposal_id) override; + virtual void reconfirm_update_status(const ObLogEntry& log_entry) override; virtual int force_set_as_single_replica() override; virtual int force_set_replica_num(const int64_t replica_num) override; // Only keep members existing in server_list in member_list @@ -173,17 +151,19 @@ class ObLogMembershipMgr : public ObILogMembershipMgr, public ObISubmitLogCb { void destroy(); virtual int set_replica_type(const enum ObReplicaType replica_type) override; virtual int change_member_list_to_self(const int64_t new_membership_version) override; - common::ObProposalID get_ms_proposal_id() const override { return ms_proposal_id_; } - int update_ms_proposal_id(const common::ObProposalID &ms_proposal_id) override; - int check_follower_has_pending_entry(bool &has_pending); - int get_curr_ms_log_body(ObLogEntryHeader &log_entry_header, - char *buffer, const int64_t buf_len) const override; + common::ObProposalID get_ms_proposal_id() const override + { + return ms_proposal_id_; + } + int update_ms_proposal_id(const common::ObProposalID& ms_proposal_id) override; + int check_follower_has_pending_entry(bool& has_pending); + int get_curr_ms_log_body(ObLogEntryHeader& log_entry_header, char* buffer, const int64_t buf_len) const override; int reset_renew_ms_log_task() override; bool is_renew_ms_log_majority_success() const override; int check_renew_ms_log_sync_state() const override; + private: - enum ObMsState - { + enum ObMsState { MS_INIT, MS_PENDING, MS_CHANGING, @@ -229,7 +209,7 @@ private: bool need_skip_apply_ms_log_(const ObMembershipLog& ms_log) const; int try_check_cluster_state_(); - private: +private: bool is_inited_; bool need_check_cluster_type_; diff --git a/src/clog/ob_log_membership_task_mgr.h b/src/clog/ob_log_membership_task_mgr.h index a7ea1650c..187f51b46 100644 --- a/src/clog/ob_log_membership_task_mgr.h +++ b/src/clog/ob_log_membership_task_mgr.h @@ -71,7 +71,7 @@ struct RenewMsLogTask { }; class ObLogMembershipTaskMgr { - public: +public: ObLogMembershipTaskMgr(); virtual ~ObLogMembershipTaskMgr() { @@ -83,7 +83,7 @@ class ObLogMembershipTaskMgr { const common::ObPartitionKey& key); void destroy(); - public: +public: int submit_log(const ObRenewMembershipLog& renew_ms_log, const ObLogType& log_type, const char* buff, const int64_t size, const uint64_t log_id, const int64_t log_timestamp, const bool is_trans_log, ObISubmitLogCb* cb); @@ -106,7 +106,7 @@ class ObLogMembershipTaskMgr { virtual int check_renew_ms_log_sync_state() const; int reset_renew_ms_log_task(); - private: +private: int submit_renew_ms_log_(const ObRenewMembershipLog& renew_ms_log, const ObLogEntryHeader& header, const char* buff, ObISubmitLogCb* cb, const bool need_replay, const bool send_slave, const common::ObAddr& server, const int64_t cluster_id); @@ -133,7 +133,7 @@ class ObLogMembershipTaskMgr { int submit_confirmed_info_(const uint64_t log_id, const ObProposalID& ms_proposal_id, const ObConfirmedInfo& confirmed_info, const bool is_leader); - private: +private: ObILogEngine* log_engine_; ObILogStateMgrForSW* state_mgr_; ObILogMembershipMgr* mm_; @@ -151,7 +151,7 @@ class ObLogMembershipTaskMgr { RenewMsLogTask cur_renew_ms_task_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogMembershipTaskMgr); }; } // namespace clog diff --git a/src/clog/ob_log_reader_interface.h b/src/clog/ob_log_reader_interface.h index cb6ac3a1f..5808bba58 100644 --- a/src/clog/ob_log_reader_interface.h +++ b/src/clog/ob_log_reader_interface.h @@ -35,7 +35,7 @@ struct ObReadParam { TO_STRING_KV(N_FILE_ID, file_id_, N_OFFSET, offset_, N_PARTITION_KEY, partition_key_, N_LOG_ID, log_id_, N_READ_LEN, read_len_, N_TIMEOUT, timeout_); - private: +private: static const int64_t OB_TIMEOUT = 10000000; // 10s }; @@ -50,7 +50,7 @@ struct ObReadRes { }; struct ObReadBuf { - public: +public: ObReadBuf() : buf_(NULL), buf_len_(0) {} ~ObReadBuf() @@ -72,13 +72,13 @@ struct ObReadBuf { } TO_STRING_KV(KP(buf_), K(buf_len_)); - public: +public: char* buf_; int64_t buf_len_; }; class ObILogDirectReader { - public: +public: enum TSIBufferIdx { CACHE_IDX = 0, IO_IDX = 1, @@ -86,7 +86,7 @@ class ObILogDirectReader { MAX_IDX, }; - public: +public: ObILogDirectReader() {} virtual ~ObILogDirectReader() @@ -108,7 +108,7 @@ class ObILogDirectReader { }; class ObILogInfoBlockReader { - public: +public: ObILogInfoBlockReader() {} virtual ~ObILogInfoBlockReader() @@ -118,7 +118,7 @@ class ObILogInfoBlockReader { }; class ObIRawLogIterator { - public: +public: ObIRawLogIterator() {} virtual ~ObIRawLogIterator() @@ -128,7 +128,7 @@ class ObIRawLogIterator { }; class ObIRawIndexIterator { - public: +public: ObIRawIndexIterator() {} virtual ~ObIRawIndexIterator() @@ -139,7 +139,7 @@ class ObIRawIndexIterator { }; class ObReadBufGuard { - public: +public: ObReadBufGuard(const char* label) : read_buf_() { ObILogDirectReader::alloc_buf(label, read_buf_); @@ -154,7 +154,7 @@ class ObReadBufGuard { return read_buf_; } - private: +private: ObReadBuf read_buf_; }; diff --git a/src/clog/ob_log_reconfirm.h b/src/clog/ob_log_reconfirm.h index cef9fee76..df3b696da 100644 --- a/src/clog/ob_log_reconfirm.h +++ b/src/clog/ob_log_reconfirm.h @@ -34,7 +34,7 @@ class ObILogEngine; class ObLogEntry; struct ObReconfirmLogInfo { - public: +public: ObReconfirmLogInfo() : leader_ts_(common::OB_INVALID_TIMESTAMP), confirmed_log_ts_(common::OB_INVALID_TIMESTAMP), @@ -113,7 +113,7 @@ struct ObReconfirmLogInfo { } TO_STRING_KV(K_(leader_ts), K_(ack_list), K_(status_map), K_(log_entry)); - private: +private: int64_t leader_ts_; // The confirmed log's submit_timestamp is maintained by this field and used to advance the last_ts int64_t confirmed_log_ts_; @@ -123,7 +123,7 @@ struct ObReconfirmLogInfo { }; class ObReconfirmLogInfoArray { - public: +public: ObReconfirmLogInfoArray() : start_id_(OB_INVALID_ID), alloc_mgr_(NULL), array_ptr_(NULL), is_inited_(false) {} ~ObReconfirmLogInfoArray() @@ -141,7 +141,7 @@ class ObReconfirmLogInfoArray { return start_id_ + RECONFIRM_LOG_ARRAY_LENGTH; } - private: +private: uint64_t start_id_; common::ObILogAllocator* alloc_mgr_; ObReconfirmLogInfo* array_ptr_; @@ -149,13 +149,13 @@ class ObReconfirmLogInfoArray { }; class ObILogReconfirm { - public: +public: ObILogReconfirm() {} virtual ~ObILogReconfirm() {} - public: +public: virtual int reconfirm() = 0; virtual bool need_start_up() = 0; virtual int receive_log(const ObLogEntry& log_entry, const common::ObAddr& server) = 0; @@ -166,12 +166,12 @@ class ObILogReconfirm { class ObLogReconfirm : public ObILogReconfirm { friend class unittest::ReconfirmStateAccessorForTest; - public: +public: ObLogReconfirm(); virtual ~ObLogReconfirm() {} - public: +public: int init(ObILogSWForReconfirm* sw, ObILogStateMgrForReconfirm* state_mgr, ObILogMembershipMgr* mm, ObLogCascadingMgr* cascading_mgr, ObILogEngine* log_engine, common::ObILogAllocator* alloc_mgr, const common::ObPartitionKey& partition_key, const common::ObAddr& self, @@ -192,7 +192,7 @@ class ObLogReconfirm : public ObILogReconfirm { return ATOMIC_LOAD(&next_id_); } - private: +private: enum State { INITED = 0, FLUSHING_PREPARE_LOG = 1, @@ -206,7 +206,7 @@ class ObLogReconfirm : public ObILogReconfirm { // The status that the log has been confirmed is recorded in the mark index of the bitmap static const int64_t CONFIRMED_TAG_BIT = 1; - private: +private: // generate new proposal_id and flush it to disk int init_reconfirm_(); // check whether new proposal_id has been flushed to disk @@ -235,7 +235,7 @@ class ObLogReconfirm : public ObILogReconfirm { int try_update_last_ts_(const int64_t log_ts); int try_update_failover_truncate_log_id_(ObLogEntryHeader* header); - private: +private: static const int64_t BUF_SIZE = 2048; static const int64_t RECEIVE_PREVIOUS_NEXT_REPLAY_LOG_INFO_INTERVAL = 1 * 1000 * 1000; // 1s static const int64_t REPEATED_FETCH_LOG_INTERVAL = 1 * 1000 * 1000; // 1s @@ -274,7 +274,7 @@ class ObLogReconfirm : public ObILogReconfirm { bool receive_previous_max_log_ts_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReconfirm); }; } // namespace clog diff --git a/src/clog/ob_log_replay_driver_runnable.h b/src/clog/ob_log_replay_driver_runnable.h index bab405dcf..540a58836 100644 --- a/src/clog/ob_log_replay_driver_runnable.h +++ b/src/clog/ob_log_replay_driver_runnable.h @@ -22,23 +22,23 @@ class ObPartitionService; } namespace clog { class ObLogReplayDriverRunnable : public share::ObThreadPool { - public: +public: ObLogReplayDriverRunnable(); virtual ~ObLogReplayDriverRunnable(); - public: +public: int init(storage::ObPartitionService* partition_service); void destroy(); void run1(); - private: +private: void try_replay_loop(); storage::ObPartitionService* partition_service_; bool can_start_service_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogReplayDriverRunnable); }; diff --git a/src/clog/ob_log_replay_engine_wrapper.h b/src/clog/ob_log_replay_engine_wrapper.h index d0f605f97..4fac68377 100644 --- a/src/clog/ob_log_replay_engine_wrapper.h +++ b/src/clog/ob_log_replay_engine_wrapper.h @@ -19,13 +19,13 @@ namespace oceanbase { namespace clog { class ObLogReplayEngineWrapper { - public: +public: ObLogReplayEngineWrapper() : is_inited_(false), log_replay_engine_(NULL) {} virtual ~ObLogReplayEngineWrapper() {} - public: +public: virtual int init(replayengine::ObILogReplayEngine* log_replay_engine); virtual int is_replay_finished(const common::ObPartitionKey& partition_key, bool& is_finished) const; @@ -39,7 +39,7 @@ class ObLogReplayEngineWrapper { virtual int reset_partition(const common::ObPartitionKey& partition_key); virtual int is_tenant_out_of_memory(const common::ObPartitionKey& partition_key, bool& is_out_of_mem); - private: +private: bool is_inited_; replayengine::ObILogReplayEngine* log_replay_engine_; diff --git a/src/clog/ob_log_req.h b/src/clog/ob_log_req.h index 62d1c9247..d43cca717 100644 --- a/src/clog/ob_log_req.h +++ b/src/clog/ob_log_req.h @@ -109,7 +109,7 @@ struct ObLogReqContext { }; class ObINetReq : public obrpc::ObIFill { - public: +public: ObINetReq() {} virtual ~ObINetReq() @@ -137,7 +137,7 @@ enum ObPushLogMode { struct ObPushLogReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObPushLogReq(common::ObProposalID proposal_id, const char* buf, int64_t len, int32_t push_mode) : proposal_id_(proposal_id), buf_(buf), len_(len), push_mode_(push_mode) {} @@ -156,7 +156,7 @@ struct ObPushLogReq : public ObINetReq { struct ObPushMsLogReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObPushMsLogReq(common::ObProposalID proposal_id, const char* buf, int64_t len) : proposal_id_(proposal_id), buf_(buf), len_(len) {} @@ -174,7 +174,7 @@ struct ObPushMsLogReq : public ObINetReq { struct ObFetchLogReqV2 : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObFetchLogReqV2() : start_id_(0), end_limit_(0), @@ -214,7 +214,7 @@ struct ObFetchLogReqV2 : public ObINetReq { struct ObAckLogReqV2 : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObAckLogReqV2(uint64_t log_id, common::ObProposalID proposal_id) : log_id_(log_id), proposal_id_(proposal_id) {} ObAckLogReqV2() : log_id_(0), proposal_id_() @@ -230,7 +230,7 @@ struct ObAckLogReqV2 : public ObINetReq { struct ObStandbyAckLogReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObStandbyAckLogReq() : log_id_(common::OB_INVALID_ID), proposal_id_() {} ObStandbyAckLogReq(uint64_t log_id, common::ObProposalID proposal_id) : log_id_(log_id), proposal_id_(proposal_id) @@ -246,7 +246,7 @@ struct ObStandbyAckLogReq : public ObINetReq { struct ObStandbyQuerySyncStartIdReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObStandbyQuerySyncStartIdReq() : send_ts_(common::OB_INVALID_TIMESTAMP) {} explicit ObStandbyQuerySyncStartIdReq(const int64_t timestamp) : send_ts_(timestamp) @@ -261,7 +261,7 @@ struct ObStandbyQuerySyncStartIdReq : public ObINetReq { struct ObStandbyQuerySyncStartIdResp : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObStandbyQuerySyncStartIdResp() : original_send_ts_(common::OB_INVALID_TIMESTAMP), sync_start_id_(common::OB_INVALID_ID) {} @@ -279,7 +279,7 @@ struct ObStandbyQuerySyncStartIdResp : public ObINetReq { struct ObRenewMsLogAckReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObRenewMsLogAckReq(uint64_t log_id, int64_t submit_timestamp, common::ObProposalID proposal_id) : log_id_(log_id), submit_timestamp_(submit_timestamp), proposal_id_(proposal_id) {} @@ -297,7 +297,7 @@ struct ObRenewMsLogAckReq : public ObINetReq { struct ObFakeAckReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObFakeAckReq(uint64_t log_id, common::ObProposalID proposal_id) : log_id_(log_id), proposal_id_(proposal_id) {} ObFakeAckReq() : log_id_(0), proposal_id_() @@ -313,7 +313,7 @@ struct ObFakeAckReq : public ObINetReq { struct ObFakePushLogReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObFakePushLogReq(uint64_t log_id, common::ObProposalID proposal_id) : log_id_(log_id), proposal_id_(proposal_id) {} ObFakePushLogReq() : log_id_(0), proposal_id_() @@ -329,7 +329,7 @@ struct ObFakePushLogReq : public ObINetReq { struct ObPrepareReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: explicit ObPrepareReq(common::ObProposalID proposal_id) : proposal_id_(proposal_id) {} ObPrepareReq() : proposal_id_() @@ -344,7 +344,7 @@ struct ObPrepareReq : public ObINetReq { struct ObPrepareRespV2 : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObPrepareRespV2(common::ObProposalID proposal_id, int64_t max_log_id, int64_t max_log_ts) : proposal_id_(proposal_id), max_log_id_(max_log_id), max_log_ts_(max_log_ts) {} @@ -361,7 +361,7 @@ struct ObPrepareRespV2 : public ObINetReq { struct ObStandbyPrepareReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: explicit ObStandbyPrepareReq(common::ObProposalID proposal_id) : ms_proposal_id_(proposal_id) {} ObStandbyPrepareReq() : ms_proposal_id_() @@ -376,7 +376,7 @@ struct ObStandbyPrepareReq : public ObINetReq { struct ObStandbyPrepareResp : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: explicit ObStandbyPrepareResp(common::ObProposalID proposal_id, uint64_t ms_log_id, int64_t membership_version) : ms_proposal_id_(proposal_id), ms_log_id_(ms_log_id), membership_version_(membership_version) {} @@ -399,7 +399,7 @@ struct ObStandbyPrepareResp : public ObINetReq { struct ObConfirmedInfoReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObConfirmedInfoReq(const uint64_t log_id, const ObConfirmedInfo& confirmed_info, const bool batch_committed) { log_id_ = log_id; @@ -419,7 +419,7 @@ struct ObConfirmedInfoReq : public ObINetReq { struct ObRenewMsLogConfirmedInfoReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObRenewMsLogConfirmedInfoReq( const uint64_t log_id, const common::ObProposalID& ms_proposal_id, const ObConfirmedInfo& confirmed_info) { @@ -440,7 +440,7 @@ struct ObRenewMsLogConfirmedInfoReq : public ObINetReq { struct ObLogKeepaliveMsg : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObLogKeepaliveMsg(const uint64_t next_log_id, const int64_t next_log_ts_lb, const uint64_t deliver_cnt) : next_log_id_(next_log_id), next_log_ts_lb_(next_log_ts_lb), deliver_cnt_(deliver_cnt) {} @@ -457,7 +457,7 @@ struct ObLogKeepaliveMsg : public ObINetReq { struct ObRestoreAliveMsg : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObRestoreAliveMsg(const uint64_t start_log_id) : start_log_id_(start_log_id) {} ObRestoreAliveMsg() : start_log_id_(0) @@ -472,7 +472,7 @@ struct ObRestoreAliveMsg : public ObINetReq { struct ObRestoreAliveReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObRestoreAliveReq(const int64_t send_ts) : send_ts_(send_ts) {} ObRestoreAliveReq() : send_ts_(0) @@ -487,7 +487,7 @@ struct ObRestoreAliveReq : public ObINetReq { struct ObRestoreAliveResp : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObRestoreAliveResp(const int64_t send_ts) : send_ts_(send_ts) {} ObRestoreAliveResp() : send_ts_(0) @@ -502,7 +502,7 @@ struct ObRestoreAliveResp : public ObINetReq { struct ObRestoreTakeoverMsg : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObRestoreTakeoverMsg() : send_ts_(common::OB_INVALID_TIMESTAMP) {} ObRestoreTakeoverMsg(const int64_t send_ts) : send_ts_(send_ts) @@ -522,7 +522,7 @@ enum ObLogMissingMsgType { struct ObNotifyLogMissingReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObNotifyLogMissingReq(const uint64_t start_log_id, const bool is_in_member_list, const int32_t msg_type) : start_log_id_(start_log_id), is_in_member_list_(is_in_member_list), msg_type_(msg_type) {} @@ -539,7 +539,7 @@ struct ObNotifyLogMissingReq : public ObINetReq { struct ObFetchRegisterServerRespV2 : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObFetchRegisterServerRespV2() : is_assign_parent_succeed_(false), candidate_list_(), msg_type_(0) {} explicit ObFetchRegisterServerRespV2(bool is_assign_parent_succeed, const int32_t msg_type) @@ -558,7 +558,7 @@ struct ObFetchRegisterServerRespV2 : public ObINetReq { struct ObFetchRegisterServerReqV2 : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObFetchRegisterServerReqV2() : replica_type_(common::REPLICA_TYPE_MAX), next_replay_log_ts_(common::OB_INVALID_TIMESTAMP), @@ -605,7 +605,7 @@ struct ObFetchRegisterServerReqV2 : public ObINetReq { struct ObRejectMsgReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObRejectMsgReq() : msg_type_(0), timestamp_(common::OB_INVALID_TIMESTAMP) {} explicit ObRejectMsgReq(const int32_t msg_type, const int64_t timestamp) : msg_type_(msg_type), timestamp_(timestamp) @@ -621,7 +621,7 @@ struct ObRejectMsgReq : public ObINetReq { struct ObRestoreLogFinishMsg : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObRestoreLogFinishMsg() : log_id_(common::OB_INVALID_ID) {} explicit ObRestoreLogFinishMsg(const uint64_t log_id) : log_id_(log_id) @@ -636,7 +636,7 @@ struct ObRestoreLogFinishMsg : public ObINetReq { struct ObReregisterMsg : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObReregisterMsg() : send_ts_(common::OB_INVALID_TIMESTAMP), new_leader_() {} explicit ObReregisterMsg(const int64_t timestamp, const share::ObCascadMember& new_leader) @@ -653,7 +653,7 @@ struct ObReregisterMsg : public ObINetReq { struct ObBroadcastInfoReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObBroadcastInfoReq(const common::ObReplicaType& replica_type, const uint64_t max_confirmed_log_id) : replica_type_(replica_type), max_confirmed_log_id_(max_confirmed_log_id) {} @@ -670,7 +670,7 @@ struct ObBroadcastInfoReq : public ObINetReq { class ObBatchPushLogReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObBatchPushLogReq() { reset(); @@ -684,19 +684,19 @@ class ObBatchPushLogReq : public ObINetReq { void reset(); TO_STRING_KV(K(trans_id_), K(partition_array_), K(log_info_array_)); - public: +public: transaction::ObTransID trans_id_; common::ObPartitionArray partition_array_; ObLogInfoArray log_info_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBatchPushLogReq); }; class ObBatchAckLogReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObBatchAckLogReq() { reset(); @@ -709,18 +709,18 @@ class ObBatchAckLogReq : public ObINetReq { void reset(); TO_STRING_KV(K(trans_id_), K(batch_ack_array_)); - public: +public: transaction::ObTransID trans_id_; ObBatchAckArray batch_ack_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBatchAckLogReq); }; struct ObReplaceSickChildReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObReplaceSickChildReq() : sick_child_(), cluster_id_(common::OB_INVALID_CLUSTER_ID) {} explicit ObReplaceSickChildReq(const common::ObAddr& sick_child) @@ -740,7 +740,7 @@ struct ObReplaceSickChildReq : public ObINetReq { struct ObLeaderMaxLogMsg : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObLeaderMaxLogMsg() : switchover_epoch_(-1), leader_max_log_id_(0), leader_next_log_ts_(-1) {} ObLeaderMaxLogMsg(const int64_t switchover_epoch, const uint64_t leader_max_log_id, const int64_t leader_next_log_ts) @@ -759,7 +759,7 @@ struct ObLeaderMaxLogMsg : public ObINetReq { struct ObCheckRebuildReq : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObCheckRebuildReq() : start_id_(0) {} @@ -775,7 +775,7 @@ struct ObCheckRebuildReq : public ObINetReq { struct ObSyncLogArchiveProgressMsg : public ObINetReq { OB_UNIS_VERSION(1); - public: +public: ObSyncLogArchiveProgressMsg(const ObPGLogArchiveStatus& status) : status_(status) {} ObSyncLogArchiveProgressMsg() : status_() diff --git a/src/clog/ob_log_restore_mgr.h b/src/clog/ob_log_restore_mgr.h index a10a4fbd4..c8524d6cd 100644 --- a/src/clog/ob_log_restore_mgr.h +++ b/src/clog/ob_log_restore_mgr.h @@ -34,7 +34,7 @@ class ObILogEngine; class ObILogMembershipMgr; class ObLogRestoreMgr { - public: +public: ObLogRestoreMgr() : lock_(), partition_service_(NULL), @@ -104,7 +104,7 @@ class ObLogRestoreMgr { } bool is_standby_restore_state() const; - private: +private: int leader_takeover_(); int leader_revoke_(); int leader_check_role_(); @@ -113,7 +113,7 @@ class ObLogRestoreMgr { int try_submit_restore_task_(); int try_send_alive_req_(); - private: +private: // time threshold that follower judges leader down static const int64_t RESTORE_LEADER_TIMEOUT_THRESHOLD = 1 * 60 * 1000 * 1000l; // renew location interval @@ -123,7 +123,7 @@ class ObLogRestoreMgr { // interval for follower sending alive req static const int64_t RESTORE_ALIVE_REQ_INTERVAL = 5 * 1000 * 1000l; - private: +private: common::ObSpinLock lock_; storage::ObPartitionService* partition_service_; ObILogSWForStateMgr* sw_; diff --git a/src/clog/ob_log_rpc.h b/src/clog/ob_log_rpc.h index 0eeee660c..abf8d199c 100644 --- a/src/clog/ob_log_rpc.h +++ b/src/clog/ob_log_rpc.h @@ -24,7 +24,7 @@ enum { }; class ObILogRpc { - public: +public: ObILogRpc() {} virtual ~ObILogRpc() diff --git a/src/clog/ob_log_rpc_processor.h b/src/clog/ob_log_rpc_processor.h index a0f38856f..76425ad8f 100644 --- a/src/clog/ob_log_rpc_processor.h +++ b/src/clog/ob_log_rpc_processor.h @@ -22,16 +22,16 @@ class ObPartitionService; } namespace clog { class ObLogRpcProcessor : public obrpc::ObRpcProcessor > { - public: +public: ObLogRpcProcessor(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObLogRpcProcessor() {} - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; }; // end namespace clog diff --git a/src/clog/ob_log_rpc_proxy.cpp b/src/clog/ob_log_rpc_proxy.cpp index c9fc7afb9..0706b1aa7 100644 --- a/src/clog/ob_log_rpc_proxy.cpp +++ b/src/clog/ob_log_rpc_proxy.cpp @@ -61,7 +61,7 @@ DEFINE_GET_SERIALIZE_SIZE(ObLogRpcProxy::Buffer) } class CallBack : public ObLogRpcProxy::AsyncCB { - public: +public: CallBack() {} virtual ~CallBack() @@ -110,7 +110,7 @@ class CallBack : public ObLogRpcProxy::AsyncCB { } } - private: +private: static const int64_t LOG_INTERVAL = 1 * 1000 * 1000; // 1S }; diff --git a/src/clog/ob_log_rpc_proxy.h b/src/clog/ob_log_rpc_proxy.h index 5512e8b72..943b05314 100644 --- a/src/clog/ob_log_rpc_proxy.h +++ b/src/clog/ob_log_rpc_proxy.h @@ -27,7 +27,7 @@ class ObLogRpcProxy; struct ObLogRpcProxyBuffer { OB_UNIS_VERSION(1); - public: +public: ObLogRpcProxyBuffer() : pcode_(0), data_(NULL), len_(0) {} ObLogRpcProxyBuffer(int pcode, const char* data, int64_t len) : pcode_(pcode), data_(data), len_(len) @@ -45,7 +45,7 @@ struct ObLogRpcProxyBuffer { }; class ObLogRpcProxy : public clog::ObILogRpc, public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObLogRpcProxy); static const int64_t MAX_PROCESS_HANDLER_TIME = 100 * 1000; @@ -60,7 +60,7 @@ class ObLogRpcProxy : public clog::ObILogRpc, public obrpc::ObRpcProxy { int post(const common::ObAddr& server, int pcode, const char* data, int64_t len); - private: +private: bool cluster_version_before_1472_() const; }; diff --git a/src/clog/ob_log_scan_runnable.h b/src/clog/ob_log_scan_runnable.h index b2151a73b..0cea2f33a 100644 --- a/src/clog/ob_log_scan_runnable.h +++ b/src/clog/ob_log_scan_runnable.h @@ -25,22 +25,22 @@ namespace clog { class ObIPartitionLogService; class ObILogEngine; class ObLogScanRunnable : public share::ObThreadPool { - public: +public: static const int64_t MAX_THREAD_CNT = FILE_RANGE_THREAD_CNT; static const int64_t MINI_MODE_THREAD_CNT = MINI_MODE_FILE_RANGE_THREAD_CNT; - public: +public: ObLogScanRunnable(); virtual ~ObLogScanRunnable(); - public: +public: int init(storage::ObPartitionService* partition_service, ObILogEngine* log_engine); int start(); void stop(); void wait(); void destroy(); - public: +public: // ObLogScanRunnable: // 1. Load file_id_cache; // 2. Get the next_index_log_id of each partition and update it in partition log service; @@ -56,14 +56,14 @@ class ObLogScanRunnable : public share::ObThreadPool { bool is_before_scan() const; bool is_scan_finished() const; - private: +private: class LocateFileRangeTimerTask : public common::ObTimerTask { - public: + public: LocateFileRangeTimerTask(); ~LocateFileRangeTimerTask() {} - public: + public: int init(ObLogScanRunnable* host, const int64_t thread_index, const file_id_t start_file_id, const file_id_t last_file_id); virtual void runTimerTask(); @@ -76,39 +76,39 @@ class ObLogScanRunnable : public share::ObThreadPool { return result_file_id_; } - private: + private: ObLogScanRunnable* host_; int64_t thread_index_; file_id_t start_file_id_; file_id_t last_file_id_; file_id_t result_file_id_; - private: + private: DISALLOW_COPY_AND_ASSIGN(LocateFileRangeTimerTask); }; class ScanTimerTask : public common::ObTimerTask { - public: + public: ScanTimerTask(); ~ScanTimerTask() {} - public: + public: int init(ObLogScanRunnable* host, const int64_t scan_thread_index, const file_id_t start_file_id, const file_id_t last_file_id); virtual void runTimerTask(); - private: + private: ObLogScanRunnable* host_; int64_t scan_thread_index_; file_id_t start_file_id_; file_id_t last_file_id_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ScanTimerTask); }; - private: +private: void do_scan_log_(); int fill_file_id_cache_(); int set_next_index_log_id_(); @@ -141,7 +141,7 @@ class ObLogScanRunnable : public share::ObThreadPool { int do_locate_file_range_(const int64_t thread_index, const file_id_t start_file_id, const file_id_t last_file_id); int wait_locate_task_finished_() const; - private: +private: enum ScanState { BEFORE_SCAN = 1, SCANNING = 2, SCAN_FINISHED = 3 }; bool is_inited_; bool is_stopped_; @@ -156,7 +156,7 @@ class ObLogScanRunnable : public share::ObThreadPool { int file_range_th_cnt_; int scan_th_cnt_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogScanRunnable); }; } // namespace clog diff --git a/src/clog/ob_log_sliding_window.cpp b/src/clog/ob_log_sliding_window.cpp index ada524459..86b451607 100644 --- a/src/clog/ob_log_sliding_window.cpp +++ b/src/clog/ob_log_sliding_window.cpp @@ -3357,8 +3357,8 @@ int ObLogSlidingWindow::need_replay_for_data_or_log_replica_(const bool is_trans return ret; } -int ObLogSlidingWindow::get_log_meta_info(uint64_t log_id, bool &is_meta_log, int64_t &log_ts, - int64_t &next_replay_log_ts_for_rg, int64_t &accum_checksum, ObLogType &log_type) const +int ObLogSlidingWindow::get_log_meta_info(uint64_t log_id, bool& is_meta_log, int64_t& log_ts, + int64_t& next_replay_log_ts_for_rg, int64_t& accum_checksum, ObLogType& log_type) const { int ret = OB_SUCCESS; is_meta_log = false; @@ -3369,7 +3369,8 @@ int ObLogSlidingWindow::get_log_meta_info(uint64_t log_id, bool &is_meta_log, in } else { clog::ObLogEntry log_entry; bool is_batch_committed = false; - if (OB_FAIL(clog_mgr->query_log_info_with_log_id(partition_key_, log_id, log_entry, accum_checksum, is_batch_committed))) { + if (OB_FAIL(clog_mgr->query_log_info_with_log_id( + partition_key_, log_id, log_entry, accum_checksum, is_batch_committed))) { if (OB_EAGAIN == ret) { if (REACH_TIME_INTERVAL(100 * 1000)) { CLOG_LOG(WARN, "failed to query_log_info_with_log_id ", K(partition_key_), K(log_id), K(ret)); @@ -3513,9 +3514,10 @@ int ObLogSlidingWindow::try_submit_replay_task_(const uint64_t log_id, const ObL if (OB_SUCC(ret)) { if (state_mgr_->is_offline()) { - CLOG_LOG(WARN, "no need to submit log to replay when partition is offline", KR(ret), K(partition_key_), K(log_id)); - } else if (OB_FAIL(replay_engine_->submit_replay_log_task_sequentially(partition_key_, log_id, log_submit_timestamp, - need_replay, header_log_type, next_replay_log_ts))) { + CLOG_LOG( + WARN, "no need to submit log to replay when partition is offline", KR(ret), K(partition_key_), K(log_id)); + } else if (OB_FAIL(replay_engine_->submit_replay_log_task_sequentially( + partition_key_, log_id, log_submit_timestamp, need_replay, header_log_type, next_replay_log_ts))) { if (OB_EAGAIN != ret) { CLOG_LOG(WARN, "failed to submit replay task", diff --git a/src/clog/ob_log_sliding_window.h b/src/clog/ob_log_sliding_window.h index 277fec459..996f7f76a 100644 --- a/src/clog/ob_log_sliding_window.h +++ b/src/clog/ob_log_sliding_window.h @@ -70,13 +70,13 @@ enum ObFetchLogExecuteType { }; class ObILogSWForCasMgr { - public: +public: ObILogSWForCasMgr() {} virtual ~ObILogSWForCasMgr() {} - public: +public: virtual int get_next_replay_log_timestamp(int64_t& next_replay_log_timestamp) const = 0; virtual void get_next_replay_log_id_info(uint64_t& next_log_id, int64_t& next_log_ts) const = 0; virtual uint64_t get_next_index_log_id() const = 0; @@ -84,13 +84,13 @@ class ObILogSWForCasMgr { }; class ObILogSWForStateMgr { - public: +public: ObILogSWForStateMgr() {} virtual ~ObILogSWForStateMgr() {} - public: +public: virtual uint64_t get_start_id() const = 0; virtual uint64_t get_max_log_id() const = 0; virtual int clean_log() = 0; @@ -111,13 +111,13 @@ class ObILogSWForStateMgr { }; class ObILogSWForReconfirm { - public: +public: ObILogSWForReconfirm() {} virtual ~ObILogSWForReconfirm() {} - public: +public: virtual uint64_t get_start_id() const = 0; virtual uint64_t get_max_log_id() const = 0; virtual int try_update_max_log_id(const uint64_t log_id) = 0; @@ -132,13 +132,13 @@ class ObILogSWForReconfirm { }; class ObILogSWForMS { - public: +public: ObILogSWForMS() {} virtual ~ObILogSWForMS() {} - public: +public: virtual uint64_t get_start_id() const = 0; virtual int submit_log(const ObLogEntryHeader& header, const char* buff, ObISubmitLogCb* cb) = 0; virtual int submit_log(const ObLogType& log_type, const char* buff, const int64_t size, const int64_t base_timestamp, @@ -270,7 +270,7 @@ struct FakeAckInfo { }; class FakeAckInfoMgr { - public: +public: FakeAckInfoMgr() : lock_() { reset(); @@ -348,7 +348,7 @@ class FakeAckInfoMgr { return need_revoke; } - private: +private: mutable common::ObSpinLock lock_; uint64_t log_id_; FakeAckInfo ack_info_[common::OB_MAX_MEMBER_NUMBER]; @@ -361,14 +361,14 @@ class ObLogSlidingWindow : public ObILogSWForCasMgr, public ObILogTaskCallBack { friend class unittest::TestSlidingWindow; - public: +public: ObLogSlidingWindow(); virtual ~ObLogSlidingWindow() { destroy(); } - public: +public: int init(ObLogReplayEngineWrapper* replay_engine, ObILogEngine* log_engine, ObILogStateMgrForSW* state_mgr, ObILogMembershipMgr* mm, ObLogCascadingMgr* cascading_mgr, storage::ObPartitionService* partition_service, common::ObILogAllocator* alloc_mgr, ObILogChecksum* checksum, ObILogCallbackEngine* cb_engine, @@ -379,58 +379,39 @@ class ObLogSlidingWindow : public ObILogSWForCasMgr, void try_update_next_replay_log_info(const uint64_t log_id, const int64_t log_ts, const bool is_nop_log = false); void try_update_next_replay_log_info_on_leader(const int64_t log_ts); uint64_t get_start_id() const override; - void get_max_log_id_info(uint64_t &max_log_id, - int64_t &max_log_ts) const; + void get_max_log_id_info(uint64_t& max_log_id, int64_t& max_log_ts) const; uint64_t get_max_log_id() const override; - int get_switchover_info(int64_t &switchover_epoch, uint64_t &leader_max_log_id, int64_t &leader_next_log_ts) const; + int get_switchover_info(int64_t& switchover_epoch, uint64_t& leader_max_log_id, int64_t& leader_next_log_ts) const; uint64_t get_max_timestamp() const; int64_t get_epoch_id() const override; int try_update_max_log_id(const uint64_t log_id) override; - int submit_log(const ObLogType &log_type, - const char *buff, - const int64_t size, - const int64_t base_timestamp, - const bool is_trans_log, - ObISubmitLogCb *cb, - uint64_t &log_id, - int64_t &log_timestamp) override; - int submit_aggre_log(ObAggreBuffer *buffer, - const int64_t base_timestamp); - int submit_log(const ObLogEntryHeader &header, const char *buff, - ObISubmitLogCb *cb) override; - int append_disk_log(const ObLogEntry &log, const ObLogCursor &log_cursor, - const int64_t accum_checksum, - const bool batch_committed) override; - int receive_log(const ObLogEntry &log_entry, const common::ObAddr &server, - const int64_t cluster_id, const ReceiveLogType type) override; - int receive_recovery_log(const ObLogEntry &log_entry, - const bool is_confirmed, - const int64_t accum_checksum, - const bool is_batch_commited) override; - int ack_log(const uint64_t log_id, const common::ObAddr &server, bool &majority); - int standby_ack_log(const uint64_t log_id, const ObAddr &server, bool &majority); - int fake_ack_log(const uint64_t log_id, const common::ObAddr &server, const int64_t receive_ts); + int submit_log(const ObLogType& log_type, const char* buff, const int64_t size, const int64_t base_timestamp, + const bool is_trans_log, ObISubmitLogCb* cb, uint64_t& log_id, int64_t& log_timestamp) override; + int submit_aggre_log(ObAggreBuffer* buffer, const int64_t base_timestamp); + int submit_log(const ObLogEntryHeader& header, const char* buff, ObISubmitLogCb* cb) override; + int append_disk_log(const ObLogEntry& log, const ObLogCursor& log_cursor, const int64_t accum_checksum, + const bool batch_committed) override; + int receive_log(const ObLogEntry& log_entry, const common::ObAddr& server, const int64_t cluster_id, + const ReceiveLogType type) override; + int receive_recovery_log(const ObLogEntry& log_entry, const bool is_confirmed, const int64_t accum_checksum, + const bool is_batch_commited) override; + int ack_log(const uint64_t log_id, const common::ObAddr& server, bool& majority); + int standby_ack_log(const uint64_t log_id, const ObAddr& server, bool& majority); + int fake_ack_log(const uint64_t log_id, const common::ObAddr& server, const int64_t receive_ts); bool is_fake_info_need_revoke(const uint64_t log_id, const int64_t current_time) override; int restore_leader_try_confirm_log() override; - void start_fetch_log_from_leader(bool &is_fetched) override; - int get_log_task(const uint64_t log_id, ObLogTask *&log_task, const int64_t *&ref) const override; - int check_left_bound_empty(bool &is_empty); - int revert_log_task(const int64_t *ref) override; - int get_log(const uint64_t log_id, - const uint32_t log_attr, - bool &log_confirmed, - ObLogCursor &cursor, - int64_t &accum_checksum, - bool &batch_committed); + void start_fetch_log_from_leader(bool& is_fetched) override; + int get_log_task(const uint64_t log_id, ObLogTask*& log_task, const int64_t*& ref) const override; + int check_left_bound_empty(bool& is_empty); + int revert_log_task(const int64_t* ref) override; + int get_log(const uint64_t log_id, const uint32_t log_attr, bool& log_confirmed, ObLogCursor& cursor, + int64_t& accum_checksum, bool& batch_committed); int clean_log() override; int process_sync_standby_max_confirmed_id(const uint64_t standby_max_confirmed_id, const uint64_t reconfirm_next_id); - int set_log_flushed_succ(const uint64_t log_id, const common::ObProposalID proposal_id, - const ObLogCursor &log_cursor, - const int64_t after_consume_timestamp, - bool &majority); + int set_log_flushed_succ(const uint64_t log_id, const common::ObProposalID proposal_id, const ObLogCursor& log_cursor, + const int64_t after_consume_timestamp, bool& majority); int set_log_confirmed(const uint64_t log_id, const bool batch_committed) override; - int receive_confirmed_info(const uint64_t log_id, const ObConfirmedInfo &confirmed_info, - const bool batch_committed); + int receive_confirmed_info(const uint64_t log_id, const ObConfirmedInfo& confirmed_info, const bool batch_committed); int majority_cb(const uint64_t log_id, const bool batch_committed, const bool batch_first_participant); inline void advance_leader_ts(const int64_t ts) { @@ -439,31 +420,43 @@ class ObLogSlidingWindow : public ObILogSWForCasMgr, ATOMIC_STORE(&leader_ts_, ts); } } - int sliding_cb(const int64_t sn, const ObILogExtRingBufferData *data) override; - uint64_t get_next_index_log_id() const override { return ATOMIC_LOAD(&next_index_log_id_); } - int64_t get_next_index_log_ts() override { return ATOMIC_LOAD(&next_index_log_ts_); } - int submit_replay_task(const bool need_async, bool &is_replayed, bool &is_replay_failed) override; + int sliding_cb(const int64_t sn, const ObILogExtRingBufferData* data) override; + uint64_t get_next_index_log_id() const override + { + return ATOMIC_LOAD(&next_index_log_id_); + } + int64_t get_next_index_log_ts() override + { + return ATOMIC_LOAD(&next_index_log_ts_); + } + int submit_replay_task(const bool need_async, bool& is_replayed, bool& is_replay_failed) override; void destroy(); - int alloc_log_id(const int64_t base_timestamp, uint64_t &log_id, int64_t &submit_timestamp) override; - int get_next_timestamp(const uint64_t last_log_id, int64_t &res_ts); - int get_next_served_log_info_by_next_replay_log_info(uint64_t &next_served_log_id, - int64_t &next_served_log_ts); - bool is_inited() const { return is_inited_; } + int alloc_log_id(const int64_t base_timestamp, uint64_t& log_id, int64_t& submit_timestamp) override; + int get_next_timestamp(const uint64_t last_log_id, int64_t& res_ts); + int get_next_served_log_info_by_next_replay_log_info(uint64_t& next_served_log_id, int64_t& next_served_log_ts); + bool is_inited() const + { + return is_inited_; + } bool is_empty() const override; int set_next_index_log_id(const uint64_t log_id, const int64_t accum_checksum); uint64_t get_max_confirmed_log_id() const override; bool check_can_receive_larger_log(const uint64_t log_id); - int truncate_first_stage(const common::ObBaseStorageInfo &base_storage_info); - int truncate_second_stage(const common::ObBaseStorageInfo &base_storage_info); - int64_t get_last_submit_timestamp() const override { return last_replay_log_.get_ts(); } - void get_last_replay_log(uint64_t &log_id, int64_t &ts) { last_replay_log_.get(log_id, ts); } - int get_next_replay_log_timestamp(int64_t &next_replay_log_timestamp) const override; - void get_next_replay_log_id_info(uint64_t &next_log_id, int64_t &next_log_ts) const override; - int follower_update_leader_next_log_info(const uint64_t leader_next_log_id, - const int64_t leader_next_log_ts); - int follower_update_leader_max_log_info(const int64_t switchover_epoch, - const uint64_t leader_max_log_id, - const int64_t leader_next_log_ts); + int truncate_first_stage(const common::ObBaseStorageInfo& base_storage_info); + int truncate_second_stage(const common::ObBaseStorageInfo& base_storage_info); + int64_t get_last_submit_timestamp() const override + { + return last_replay_log_.get_ts(); + } + void get_last_replay_log(uint64_t& log_id, int64_t& ts) + { + last_replay_log_.get(log_id, ts); + } + int get_next_replay_log_timestamp(int64_t& next_replay_log_timestamp) const override; + void get_next_replay_log_id_info(uint64_t& next_log_id, int64_t& next_log_ts) const override; + int follower_update_leader_next_log_info(const uint64_t leader_next_log_id, const int64_t leader_next_log_ts); + int follower_update_leader_max_log_info( + const int64_t switchover_epoch, const uint64_t leader_max_log_id, const int64_t leader_next_log_ts); void set_last_replay_log(const uint64_t last_replay_log_id, const int64_t last_submit_timestamp) { last_replay_log_.set(last_replay_log_id, last_submit_timestamp); @@ -505,14 +498,10 @@ class ObLogSlidingWindow : public ObILogSWForCasMgr, int leader_active() override; int leader_takeover() override; int leader_revoke() override; - int get_replica_replay_type(ObReplicaReplayType &replay_type) const; - //is_meta_log: log type that need been replayed by D replica and log replica - int get_log_meta_info(uint64_t log_id, - bool &is_meta_log, - int64_t &log_ts, - int64_t &next_replay_log_ts_for_rg, - int64_t &accum_checksum, - ObLogType &log_type) const; + int get_replica_replay_type(ObReplicaReplayType& replay_type) const; + // is_meta_log: log type that need been replayed by D replica and log replica + int get_log_meta_info(uint64_t log_id, bool& is_meta_log, int64_t& log_ts, int64_t& next_replay_log_ts_for_rg, + int64_t& accum_checksum, ObLogType& log_type) const; void destroy_aggre_buffer(); uint64_t get_leader_max_unconfirmed_log_count(); uint64_t get_follower_max_unconfirmed_log_count(); @@ -550,7 +539,7 @@ class ObLogSlidingWindow : public ObILogSWForCasMgr, int check_if_all_log_replayed(bool& has_replayed) const; int try_freeze_aggre_buffer(); - private: +private: int alloc_log_id_ts_(const int64_t base_timestamp, uint64_t& log_id, int64_t& submit_timestamp); int alloc_log_id_ts_( const int64_t base_timestamp, const int64_t size, uint64_t& log_id, int64_t& submit_timestamp, int64_t& offset); @@ -559,17 +548,11 @@ class ObLogSlidingWindow : public ObILogSWForCasMgr, const int64_t submit_timestamp, ObISubmitLogCb* cb); int try_freeze_aggre_buffer_(const uint64_t log_id); int submit_freeze_aggre_buffer_task_(const uint64_t log_id); - int submit_aggre_log_(ObAggreBuffer *buffer, - const uint64_t log_id, - const int64_t submit_timestamp); + int submit_aggre_log_(ObAggreBuffer* buffer, const uint64_t log_id, const int64_t submit_timestamp); int try_update_submit_timestamp(const int64_t base_ts) override; - bool is_confirm_match_(const uint64_t log_id, - const int64_t log_data_checksum, - const int64_t log_epoch_id, - const int64_t confirmed_info_data_checksum, - const int64_t confirmed_info_epoch_id); - int receive_log_(const ObLogEntry &log_entry, const common::ObAddr &server, - const int64_t cluster_id); + bool is_confirm_match_(const uint64_t log_id, const int64_t log_data_checksum, const int64_t log_epoch_id, + const int64_t confirmed_info_data_checksum, const int64_t confirmed_info_epoch_id); + int receive_log_(const ObLogEntry& log_entry, const common::ObAddr& server, const int64_t cluster_id); void update_max_log_id_(const uint64_t log_id); int submit_to_sliding_window_(const ObLogEntryHeader& header, const char* buff, ObISubmitLogCb* cb, const bool need_replay, const bool send_slave, const common::ObAddr& server, const int64_t cluster_id, @@ -656,9 +639,9 @@ class ObLogSlidingWindow : public ObILogSWForCasMgr, bool check_need_fetch_log_(const uint64_t start_log_id, bool& need_check_rebuild); int follower_check_need_rebuild_(const uint64_t start_log_id); - private: +private: static const int64_t MAX_TIME_DIFF_BETWEEN_SERVER = T_ST; // 200 ms - private: +private: int64_t tenant_id_; ObILogStateMgrForSW* state_mgr_; ObLogReplayEngineWrapper* replay_engine_; @@ -716,7 +699,7 @@ class ObLogSlidingWindow : public ObILogSWForCasMgr, bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogSlidingWindow); }; diff --git a/src/clog/ob_log_state_driver_runnable.h b/src/clog/ob_log_state_driver_runnable.h index f643d0f2f..09b0719ec 100644 --- a/src/clog/ob_log_state_driver_runnable.h +++ b/src/clog/ob_log_state_driver_runnable.h @@ -26,20 +26,20 @@ class ObIElectionMgr; namespace clog { class ObLogStateDriverRunnable : public share::ObThreadPool { - public: +public: ObLogStateDriverRunnable(); virtual ~ObLogStateDriverRunnable(); - public: +public: int init(storage::ObPartitionService* partition_service, election::ObIElectionMgr* election_mgr); void destroy(); void run1(); - private: +private: void state_driver_loop(); void check_can_start_service_(); - private: +private: storage::ObPartitionService* partition_service_; election::ObIElectionMgr* election_mgr_; bool already_disk_error_; @@ -49,7 +49,7 @@ class ObLogStateDriverRunnable : public share::ObThreadPool { int64_t last_check_time_for_replica_state_; int64_t last_check_time_for_broadcast_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogStateDriverRunnable); }; diff --git a/src/clog/ob_log_state_mgr.h b/src/clog/ob_log_state_mgr.h index 921b37c0f..3bf67a8c3 100644 --- a/src/clog/ob_log_state_mgr.h +++ b/src/clog/ob_log_state_mgr.h @@ -59,13 +59,13 @@ enum ObCreatePlsType { }; class ObILogStateMgrForService { - public: +public: ObILogStateMgrForService() {} virtual ~ObILogStateMgrForService() {} - public: +public: virtual bool can_submit_log() const = 0; virtual bool can_submit_start_working_log() const = 0; virtual bool can_append_disk_log() const = 0; @@ -126,13 +126,13 @@ class ObILogStateMgrForService { }; class ObILogStateMgrForSW { - public: +public: ObILogStateMgrForSW() {} virtual ~ObILogStateMgrForSW() {} - public: +public: virtual int16_t get_state() const = 0; virtual common::ObRole get_role() const = 0; virtual common::ObAddr get_leader() const = 0; @@ -170,13 +170,13 @@ class ObILogStateMgrForSW { }; class ObILogStateMgrForCasMgr { - public: +public: ObILogStateMgrForCasMgr() {} virtual ~ObILogStateMgrForCasMgr() {} - public: +public: virtual common::ObAddr get_leader() const = 0; virtual int get_cascad_leader(share::ObCascadMember& cascad_leader_member) const = 0; virtual share::ObCascadMember get_leader_member() const = 0; @@ -202,13 +202,13 @@ class ObILogStateMgrForCasMgr { }; class ObILogStateMgrForMS { - public: +public: ObILogStateMgrForMS() {} virtual ~ObILogStateMgrForMS() {} - public: +public: virtual bool can_submit_log() const = 0; virtual bool can_submit_with_assigned_id() const = 0; virtual common::ObAddr get_leader() const = 0; @@ -239,13 +239,13 @@ class ObILogStateMgrForMS { }; class ObILogStateMgrForReconfirm { - public: +public: ObILogStateMgrForReconfirm() {} virtual ~ObILogStateMgrForReconfirm() {} - public: +public: virtual common::ObAddr get_leader() const = 0; virtual common::ObAddr get_previous_leader() const = 0; virtual common::ObProposalID get_proposal_id() const = 0; @@ -270,25 +270,20 @@ class ObLogStateMgr : public ObILogStateMgrForService, public ObILogStateMgrForReconfirm { friend class unittest::ObLogStateMgrTest; - public: - ObLogStateMgr(); - virtual ~ObLogStateMgr() { destroy(); } public: - int init(ObILogSWForStateMgr *sw, - ObILogReconfirm *reconfirm, - ObILogEngine *log_engine, - ObILogMembershipMgr *mm, - ObLogCascadingMgr *cascading_mgr, - ObLogRestoreMgr *restore_mgr, - election::ObIElection *election, - ObLogReplayEngineWrapper *replay_engine, - storage::ObPartitionService *partition_service, - common::ObILogAllocator *alloc_mgr, - const common::ObAddr &self, - const common::ObProposalID &proposal_id, - const common::ObVersion &freeze_version, - const common::ObPartitionKey &partition_key, - const ObCreatePlsType &create_pls_type); + ObLogStateMgr(); + virtual ~ObLogStateMgr() + { + destroy(); + } + +public: + int init(ObILogSWForStateMgr* sw, ObILogReconfirm* reconfirm, ObILogEngine* log_engine, ObILogMembershipMgr* mm, + ObLogCascadingMgr* cascading_mgr, ObLogRestoreMgr* restore_mgr, election::ObIElection* election, + ObLogReplayEngineWrapper* replay_engine, storage::ObPartitionService* partition_service, + common::ObILogAllocator* alloc_mgr, const common::ObAddr& self, const common::ObProposalID& proposal_id, + const common::ObVersion& freeze_version, const common::ObPartitionKey& partition_key, + const ObCreatePlsType& create_pls_type); virtual bool can_submit_log() const override { bool bool_ret = (is_leader_active_() && !is_offline() && @@ -308,30 +303,30 @@ public: } virtual bool can_append_disk_log() const override; virtual bool can_receive_recovery_log() const override; - virtual bool can_majority_cb(const common::ObProposalID &proposal_id) const override; - virtual bool can_standby_majority_cb(const common::ObProposalID &proposal_id) const override; - virtual bool can_majority_cb_for_renew_ms_log(const common::ObProposalID &ms_proposal_id) const override; - virtual bool can_receive_log_ack(const common::ObProposalID &proposal_id) const override; - virtual bool can_send_log_ack(const common::ObProposalID &proposal_id) const override; - virtual bool can_send_standby_log_ack(const common::ObProposalID &proposal_id) const override; - virtual bool can_receive_max_log_id(const common::ObProposalID &proposal_id) const override; - virtual bool can_receive_renew_ms_log_ack(const common::ObProposalID &ms_proposal_id) const override; - virtual bool can_send_renew_ms_log_ack(const common::ObProposalID &proposal_id) const override; - virtual bool can_handle_standby_prepare_resp(const common::ObProposalID &proposal_id) const override; + virtual bool can_majority_cb(const common::ObProposalID& proposal_id) const override; + virtual bool can_standby_majority_cb(const common::ObProposalID& proposal_id) const override; + virtual bool can_majority_cb_for_renew_ms_log(const common::ObProposalID& ms_proposal_id) const override; + virtual bool can_receive_log_ack(const common::ObProposalID& proposal_id) const override; + virtual bool can_send_log_ack(const common::ObProposalID& proposal_id) const override; + virtual bool can_send_standby_log_ack(const common::ObProposalID& proposal_id) const override; + virtual bool can_receive_max_log_id(const common::ObProposalID& proposal_id) const override; + virtual bool can_receive_renew_ms_log_ack(const common::ObProposalID& ms_proposal_id) const override; + virtual bool can_send_renew_ms_log_ack(const common::ObProposalID& proposal_id) const override; + virtual bool can_handle_standby_prepare_resp(const common::ObProposalID& proposal_id) const override; bool is_diff_cluster_req_in_disabled_state(const int64_t cluster_id) const; virtual bool can_get_log(const int64_t cluster_id) const override; - virtual bool can_get_log_for_reconfirm(const common::ObProposalID &proposal_id) const override; - virtual bool can_receive_log(const common::ObProposalID &proposal_id, - const common::ObProposalID &proposal_id_in_log, - const int64_t cluster_id) const override; - virtual bool can_receive_renew_ms_log(const common::ObProposalID &proposal_id_in_req, - const common::ObProposalID &proposal_id_in_log, - const int64_t cluster_id) const override; + virtual bool can_get_log_for_reconfirm(const common::ObProposalID& proposal_id) const override; + virtual bool can_receive_log(const common::ObProposalID& proposal_id, const common::ObProposalID& proposal_id_in_log, + const int64_t cluster_id) const override; + virtual bool can_receive_renew_ms_log(const common::ObProposalID& proposal_id_in_req, + const common::ObProposalID& proposal_id_in_log, const int64_t cluster_id) const override; virtual bool can_change_member() const override; virtual bool can_change_leader() const override; virtual bool can_get_leader_curr_member_list() const override; - virtual bool can_handle_prepare_rqst(const common::ObProposalID &proposal_id, const int64_t cluster_id) const override; - virtual bool can_handle_standby_prepare_rqst(const common::ObProposalID &proposal_id, const int64_t cluster_id) const override; + virtual bool can_handle_prepare_rqst( + const common::ObProposalID& proposal_id, const int64_t cluster_id) const override; + virtual bool can_handle_standby_prepare_rqst( + const common::ObProposalID& proposal_id, const int64_t cluster_id) const override; virtual bool can_slide_sw() const override; virtual bool is_standby_leader_can_receive_log_id(const uint32_t log_id) const override; virtual bool can_receive_confirmed_info(const int64_t src_cluster_id) const override; @@ -341,108 +336,200 @@ public: bool can_backfill_log(const bool is_leader, const common::ObProposalID& proposal_id) const; bool can_backfill_confirmed(const common::ObProposalID& proposal_id) const; - virtual common::ObProposalID get_proposal_id() const override { return curr_proposal_id_; } - virtual int switch_state(bool &need_retry) override; + virtual common::ObProposalID get_proposal_id() const override + { + return curr_proposal_id_; + } + virtual int switch_state(bool& need_retry) override; virtual bool check_sliding_window_state() override; - virtual bool is_state_changed(bool &need_retry) override; + virtual bool is_state_changed(bool& need_retry) override; virtual int set_scan_disk_log_finished() override; - virtual bool is_scan_disk_log_finished() const { return scan_disk_log_finished_; } - virtual int16_t get_state() const override { return state_; } - virtual common::ObRole get_role() const override { return role_; } - virtual common::ObAddr get_leader() const override { return leader_.get_server(); } - virtual share::ObCascadMember get_leader_member() const override { return leader_; } - virtual common::ObAddr get_primary_leader_addr() const override { return primary_leader_.get_server(); } - virtual share::ObCascadMember get_primary_leader() const override { return primary_leader_; } - virtual share::ObCascadMember get_prepared_primary_leader() const { return prepared_primary_leader_; } - virtual int get_cascad_leader(share::ObCascadMember &cascad_leader_member) const override; - virtual common::ObAddr get_previous_leader() const override { return previous_leader_; } - virtual const common::ObRegion &get_region() const override; - virtual const common::ObIDC &get_idc() const override; - virtual int set_region(const common::ObRegion ®ion, bool &is_changed) override; - virtual int set_idc(const common::ObIDC &idc, bool &is_changed) override; - virtual int64_t get_leader_epoch() const { return leader_epoch_; } + virtual bool is_scan_disk_log_finished() const + { + return scan_disk_log_finished_; + } + virtual int16_t get_state() const override + { + return state_; + } + virtual common::ObRole get_role() const override + { + return role_; + } + virtual common::ObAddr get_leader() const override + { + return leader_.get_server(); + } + virtual share::ObCascadMember get_leader_member() const override + { + return leader_; + } + virtual common::ObAddr get_primary_leader_addr() const override + { + return primary_leader_.get_server(); + } + virtual share::ObCascadMember get_primary_leader() const override + { + return primary_leader_; + } + virtual share::ObCascadMember get_prepared_primary_leader() const + { + return prepared_primary_leader_; + } + virtual int get_cascad_leader(share::ObCascadMember& cascad_leader_member) const override; + virtual common::ObAddr get_previous_leader() const override + { + return previous_leader_; + } + virtual const common::ObRegion& get_region() const override; + virtual const common::ObIDC& get_idc() const override; + virtual int set_region(const common::ObRegion& region, bool& is_changed) override; + virtual int set_idc(const common::ObIDC& idc, bool& is_changed) override; + virtual int64_t get_leader_epoch() const + { + return leader_epoch_; + } virtual common::ObVersion get_freeze_version() const override; - virtual int64_t get_last_leader_active_time() const override { return last_leader_active_time_; } - virtual int update_freeze_version(const common::ObVersion &freeze_version); - virtual int handle_prepare_rqst(const common::ObProposalID &proposal_id, - const common::ObAddr &new_leader, - const int64_t cluster_id) override; - virtual int handle_standby_prepare_rqst(const common::ObProposalID &proposal_id, - const common::ObAddr &new_leader, - const int64_t cluster_id) override; - virtual int update_proposal_id(const common::ObProposalID &proposal_id) override; + virtual int64_t get_last_leader_active_time() const override + { + return last_leader_active_time_; + } + virtual int update_freeze_version(const common::ObVersion& freeze_version); + virtual int handle_prepare_rqst( + const common::ObProposalID& proposal_id, const common::ObAddr& new_leader, const int64_t cluster_id) override; + virtual int handle_standby_prepare_rqst( + const common::ObProposalID& proposal_id, const common::ObAddr& new_leader, const int64_t cluster_id) override; + virtual int update_proposal_id(const common::ObProposalID& proposal_id) override; virtual int start_election() override; virtual int stop_election() override; - virtual int set_election_leader(const common::ObAddr &leader, const int64_t lease_start) override; + virtual int set_election_leader(const common::ObAddr& leader, const int64_t lease_start) override; virtual void set_offline(); virtual void set_online(); - virtual bool is_offline() const override { return true == ATOMIC_LOAD(&is_offline_); } + virtual bool is_offline() const override + { + return true == ATOMIC_LOAD(&is_offline_); + } virtual bool is_changing_leader() const; - virtual int change_leader_async(const common::ObPartitionKey &partition_key, - const common::ObAddr &leader, - common::ObTsWindows &changing_leader_windows); - virtual bool is_leader_active() const override { return is_leader_active_(); } - virtual bool is_standby_leader_active() const override { return is_standby_leader_active_(); } - virtual bool is_leader_taking_over() const override { return is_leader_taking_over_(); } - virtual bool is_leader_reconfirm() const override { return is_leader_reconfirm_(); } - virtual bool is_follower_active() const override { return is_follower_active_(); } + virtual int change_leader_async(const common::ObPartitionKey& partition_key, const common::ObAddr& leader, + common::ObTsWindows& changing_leader_windows); + virtual bool is_leader_active() const override + { + return is_leader_active_(); + } + virtual bool is_standby_leader_active() const override + { + return is_standby_leader_active_(); + } + virtual bool is_leader_taking_over() const override + { + return is_leader_taking_over_(); + } + virtual bool is_leader_reconfirm() const override + { + return is_leader_reconfirm_(); + } + virtual bool is_follower_active() const override + { + return is_follower_active_(); + } virtual int set_follower_active(); - void set_pre_member_changing() { ATOMIC_STORE(&is_pre_member_changing_, true); } - void reset_pre_member_changing() { ATOMIC_STORE(&is_pre_member_changing_, false); } - bool is_pre_member_changing() const { return ATOMIC_LOAD(&is_pre_member_changing_); } - bool is_inited() const { return is_inited_; } - bool is_restoring() const { return ATOMIC_LOAD(&is_restoring_); } - bool set_restoring() { return ATOMIC_BCAS(&is_restoring_, false, true); } - void reset_restoring() { return ATOMIC_STORE(&is_restoring_, false); } - bool is_write_disabled() const override { return ATOMIC_LOAD(&is_write_disabled_); } - void disable_write_authority() { return ATOMIC_STORE(&is_write_disabled_, true); } - void enable_write_authority() { return ATOMIC_STORE(&is_write_disabled_, false); } + void set_pre_member_changing() + { + ATOMIC_STORE(&is_pre_member_changing_, true); + } + void reset_pre_member_changing() + { + ATOMIC_STORE(&is_pre_member_changing_, false); + } + bool is_pre_member_changing() const + { + return ATOMIC_LOAD(&is_pre_member_changing_); + } + bool is_inited() const + { + return is_inited_; + } + bool is_restoring() const + { + return ATOMIC_LOAD(&is_restoring_); + } + bool set_restoring() + { + return ATOMIC_BCAS(&is_restoring_, false, true); + } + void reset_restoring() + { + return ATOMIC_STORE(&is_restoring_, false); + } + bool is_write_disabled() const override + { + return ATOMIC_LOAD(&is_write_disabled_); + } + void disable_write_authority() + { + return ATOMIC_STORE(&is_write_disabled_, true); + } + void enable_write_authority() + { + return ATOMIC_STORE(&is_write_disabled_, false); + } bool is_archive_restoring() const override; bool is_archive_restore_leader() const override; bool is_archive_restoring_log() const override; int check_role_leader_and_state() const; int check_role_elect_leader_and_state() const; int try_update_leader_from_loc_cache() override; - virtual int async_get_dst_cluster_leader_from_loc_cache(const bool is_need_renew, - const int64_t cluster_id, - ObAddr &leader) override; + virtual int async_get_dst_cluster_leader_from_loc_cache( + const bool is_need_renew, const int64_t cluster_id, ObAddr& leader) override; int64_t get_self_cluster_id() const override; int64_t get_leader_cluster_id() const override; - virtual int64_t get_reconfirm_start_time() const override { return reconfirm_start_time_; } + virtual int64_t get_reconfirm_start_time() const override + { + return reconfirm_start_time_; + } void destroy(); - virtual bool is_new_created_leader() const override { return is_new_created_leader_; } - void set_need_rebuild() { ATOMIC_STORE(&need_rebuild_, true); } - void reset_need_rebuild() override { ATOMIC_STORE(&need_rebuild_, false); } - bool is_need_rebuild() const override { return ATOMIC_LOAD(&need_rebuild_); } + virtual bool is_new_created_leader() const override + { + return is_new_created_leader_; + } + void set_need_rebuild() + { + ATOMIC_STORE(&need_rebuild_, true); + } + void reset_need_rebuild() override + { + ATOMIC_STORE(&need_rebuild_, false); + } + bool is_need_rebuild() const override + { + return ATOMIC_LOAD(&need_rebuild_); + } bool is_replaying() const; int enable_replay(); int disable_replay(); bool is_replay_enabled() const override; - int set_election_candidates(const int64_t replica_num, - const ObMemberList &member_list, - const int64_t membership_timestamp) override; + int set_election_candidates( + const int64_t replica_num, const ObMemberList& member_list, const int64_t membership_timestamp) override; int set_election_replica_num(const int64_t replica_num) override; int inc_election_replica_num() override; int dec_election_replica_num() override; - int get_election_valid_candidates(ObMemberList &valid_candidate_list) const override; - int get_election_leader(ObAddr &leader, int64_t &leader_epoch, - common::ObTsWindows &changing_leader_windows) const override; - int get_election_leader(ObAddr &leader, int64_t &leader_epoch) const override; + int get_election_valid_candidates(ObMemberList& valid_candidate_list) const override; + int get_election_leader( + ObAddr& leader, int64_t& leader_epoch, common::ObTsWindows& changing_leader_windows) const override; + int get_election_leader(ObAddr& leader, int64_t& leader_epoch) const override; bool is_leader_revoke_recently() const; void report_start_id_trace(const uint64_t start_id) override; - int standby_set_election_leader(const common::ObAddr &leader, const int64_t lease_start); + int standby_set_election_leader(const common::ObAddr& leader, const int64_t lease_start); bool is_cluster_allow_vote() const override; bool is_can_elect_standby_leader() const override; bool has_valid_member_list() const override; virtual int try_renew_sync_standby_location() override; int standby_update_protection_level(); int standby_leader_check_protection_level(); - int handle_sync_start_id_resp(const ObAddr &server, - const int64_t cluster_id, - const int64_t original_send_ts, - const uint64_t sync_start_id); - int get_standby_protection_level(uint32_t &protection_level) const; - virtual int get_pls_epoch(int64_t &pls_epoch) const override; + int handle_sync_start_id_resp( + const ObAddr& server, const int64_t cluster_id, const int64_t original_send_ts, const uint64_t sync_start_id); + int get_standby_protection_level(uint32_t& protection_level) const; + virtual int get_pls_epoch(int64_t& pls_epoch) const override; int primary_process_protect_mode_switch(); // The following two functions cooperate to achieve congestion control of clog @@ -458,7 +545,7 @@ public: int64_t get_fetch_log_interval() const override final; uint64_t get_fetch_window_size() const override final; - private: +private: int on_leader_takeover_(); int on_leader_active_(); int on_leader_revoke_(); @@ -525,7 +612,7 @@ public: bool need_fetch_log_() const; void reset_fetch_state_(); - private: +private: typedef common::SpinRWLock RWLock; typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; diff --git a/src/clog/ob_log_stress.h b/src/clog/ob_log_stress.h index a7ff492e6..0c0e4def0 100644 --- a/src/clog/ob_log_stress.h +++ b/src/clog/ob_log_stress.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace clog { class FakeTask : public ObISubmitLogCb { - public: +public: FakeTask(int64_t& finished_cnt, CountReporter& counter) : submit_time_(ObTimeUtility::current_time()), finished_cnt_(finished_cnt), counter_(counter) {} @@ -43,14 +43,14 @@ class FakeTask : public ObISubmitLogCb { submit_time_ = ObTimeUtility::current_time(); } - private: +private: int64_t submit_time_; int64_t& finished_cnt_; CountReporter& counter_; }; class ObLogStressRunnable : public share::ObThreadPool { - public: +public: enum { SIG_START_STRESS = 57 }; ObLogStressRunnable() : submit_cnt_(0), finished_cnt_(0), counter_("submit", 1000000) {} @@ -99,7 +99,7 @@ class ObLogStressRunnable : public share::ObThreadPool { } } - private: +private: void start_stress() { set_thread_count(32); @@ -200,7 +200,7 @@ class ObLogStressRunnable : public share::ObThreadPool { (new (std::nothrow) ObLogStressRunnable())->start_stress(); } - private: +private: int64_t submit_cnt_ CACHE_ALIGNED; int64_t finished_cnt_ CACHE_ALIGNED; CountReporter counter_; diff --git a/src/clog/ob_log_task.cpp b/src/clog/ob_log_task.cpp index bbf892bcb..57ead8737 100644 --- a/src/clog/ob_log_task.cpp +++ b/src/clog/ob_log_task.cpp @@ -753,7 +753,7 @@ int ObLogTask::log_deep_copy_to_(const ObLogEntry& log_entry, const bool need_co CLOG_LOG(WARN, "failed to get_next_replay_ts_for_rg", K(ret), "header", log_entry.get_header()); } else { log_type_ = static_cast(log_entry.get_header().get_log_type()); - const ObLogEntryHeader &log_header = log_entry.get_header(); + const ObLogEntryHeader& log_header = log_entry.get_header(); if (log_header.is_trans_log()) { state_map_.set_map(IS_TRANS_LOG); } diff --git a/src/clog/ob_log_task.h b/src/clog/ob_log_task.h index 27d994300..e286eee89 100644 --- a/src/clog/ob_log_task.h +++ b/src/clog/ob_log_task.h @@ -30,7 +30,7 @@ namespace clog { class ObISubmitLogCb; class ObILogTaskCallBack; class ObLogSimpleBitMap { - public: +public: ObLogSimpleBitMap() : val_(0) {} ~ObLogSimpleBitMap() @@ -45,7 +45,7 @@ class ObLogSimpleBitMap { bool test_and_set(const int64_t idx); TO_STRING_KV(K_(val)); - private: +private: uint16_t val_; }; @@ -69,7 +69,7 @@ class ObLogTask : public ObILogExtRingBufferData { ALREADY_SEND_TO_STANDBY = 15, // whether it has been send to standby cluster }; - public: +public: ObLogTask(); virtual ~ObLogTask(); int init(ObISubmitLogCb* submit_cb, const int64_t replica_num, const bool need_replay); @@ -153,18 +153,19 @@ class ObLogTask : public ObILogExtRingBufferData { // common::ObTraceProfile *get_trace_profile() {return trace_profile_;} // int report_trace(); - TO_STRING_KV(K(log_type_), K(proposal_id_), K(log_buf_len_), K_(generation_timestamp), - K(submit_timestamp_), K(next_replay_log_ts_), K_(data_checksum), K(epoch_id_), K(accum_checksum_), - K_(state_map), K_(ack_list), KP_(submit_cb), K_(majority_cnt), K_(log_cursor)); + TO_STRING_KV(K(log_type_), K(proposal_id_), K(log_buf_len_), K_(generation_timestamp), K(submit_timestamp_), + K(next_replay_log_ts_), K_(data_checksum), K(epoch_id_), K(accum_checksum_), K_(state_map), K_(ack_list), + KP_(submit_cb), K_(majority_cnt), K_(log_cursor)); + public: virtual void destroy(); virtual bool can_be_removed(); virtual bool can_overwrite(const ObILogExtRingBufferData* log_task); - private: +private: int log_deep_copy_to_(const ObLogEntry& log_entry, const bool need_copy); - private: +private: // The first 4 variables are sorted in order to save space overhead caused by alignment // // 1 bytes diff --git a/src/clog/ob_log_timer_utility.h b/src/clog/ob_log_timer_utility.h index b90e52772..849e6c393 100644 --- a/src/clog/ob_log_timer_utility.h +++ b/src/clog/ob_log_timer_utility.h @@ -20,11 +20,11 @@ namespace oceanbase { namespace clog { class ObLogTimerUtility { - public: +public: ObLogTimerUtility() : bt1_(common::OB_INVALID_TIMESTAMP), bt2_(common::OB_INVALID_TIMESTAMP) {} - public: +public: void start_timer() { if (ENABLE_CLOG_PERF) { @@ -47,11 +47,11 @@ class ObLogTimerUtility { } } - private: +private: int64_t bt1_; int64_t bt2_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogTimerUtility); }; } // namespace clog diff --git a/src/clog/ob_log_type.h b/src/clog/ob_log_type.h index bd0c71376..d2a14f58b 100644 --- a/src/clog/ob_log_type.h +++ b/src/clog/ob_log_type.h @@ -23,13 +23,13 @@ namespace clog { class ObConfirmedInfo { OB_UNIS_VERSION(1); - public: +public: ObConfirmedInfo() : data_checksum_(0), epoch_id_(common::OB_INVALID_TIMESTAMP), accum_checksum_(0) {} ~ObConfirmedInfo() {} - public: +public: int init(const int64_t data_checksum, const int64_t epoch_id, const int64_t accum_checksum); int64_t get_data_checksum() const { @@ -58,12 +58,12 @@ class ObConfirmedInfo { friend bool operator==(const ObConfirmedInfo& lhs, const ObConfirmedInfo& rhs); TO_STRING_KV(K_(data_checksum), K_(epoch_id), K_(accum_checksum)); - private: +private: int64_t data_checksum_; int64_t epoch_id_; int64_t accum_checksum_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObConfirmedInfo); }; @@ -76,11 +76,11 @@ inline bool operator==(const ObConfirmedInfo& lhs, const ObConfirmedInfo& rhs) class ObMembershipLog { OB_UNIS_VERSION(1); - public: +public: ObMembershipLog(); ~ObMembershipLog(); - public: +public: int64_t get_replica_num() const; int64_t get_timestamp() const; const common::ObMemberList& get_member_list() const; @@ -96,7 +96,7 @@ class ObMembershipLog { int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: static const int16_t MS_LOG_VERSION = 1; int16_t version_; int64_t replica_num_; @@ -106,18 +106,18 @@ class ObMembershipLog { int64_t type_; int64_t cluster_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMembershipLog); }; class ObRenewMembershipLog { OB_UNIS_VERSION(1); - public: +public: ObRenewMembershipLog(); ~ObRenewMembershipLog(); - public: +public: int64_t get_replica_num() const; int64_t get_timestamp() const; const common::ObMemberList& get_member_list() const; @@ -137,7 +137,7 @@ class ObRenewMembershipLog { int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: int64_t replica_num_; int64_t timestamp_; common::ObMemberList member_list_; @@ -147,48 +147,48 @@ class ObRenewMembershipLog { common::ObProposalID ms_proposal_id_; uint64_t barrier_log_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRenewMembershipLog); }; class ObNopLog { OB_UNIS_VERSION(1); - public: +public: ObNopLog() : version_(NOP_LOG_VERSION) {} ~ObNopLog() {} - private: +private: static const int16_t NOP_LOG_VERSION = 1; int16_t version_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNopLog); }; class ObPreparedLog { OB_UNIS_VERSION(1); - public: +public: ObPreparedLog() : version_(PREPARED_LOG_VERSION) {} ~ObPreparedLog() {} - private: +private: static const int16_t PREPARED_LOG_VERSION = 1; int16_t version_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPreparedLog); }; class ObLogArchiveInnerLog { OB_UNIS_VERSION(1); - public: +public: ObLogArchiveInnerLog() : version_(ARCHIVE_CHECKPOINT_LOG_VERSION), checkpoint_ts_(common::OB_INVALID_TIMESTAMP), @@ -222,13 +222,13 @@ class ObLogArchiveInnerLog { } TO_STRING_KV(K_(version), K_(checkpoint_ts), K_(round_start_ts), K_(round_snapshot_version)); - private: +private: static const int16_t ARCHIVE_CHECKPOINT_LOG_VERSION = 1; int16_t version_; int64_t checkpoint_ts_; int64_t round_start_ts_; // only kickoff log use this int64_t round_snapshot_version_; // only kickoff log use this.use for recovery point by qianchen - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogArchiveInnerLog); }; diff --git a/src/clog/ob_log_virtual_stat.h b/src/clog/ob_log_virtual_stat.h index b51f604fd..38fc45e1b 100644 --- a/src/clog/ob_log_virtual_stat.h +++ b/src/clog/ob_log_virtual_stat.h @@ -22,11 +22,11 @@ namespace oceanbase { namespace clog { class ObIPartitionLogService; class ObClogVirtualStat { - public: +public: ObClogVirtualStat(); virtual ~ObClogVirtualStat(); - public: +public: int init(common::ObAddr self, common::ObPartitionKey& partition_key, ObLogStateMgr* state_mgr, ObLogSlidingWindow* sw, ObLogMembershipMgr* mm, ObLogCascadingMgr* cm, ObIPartitionLogService* pls); int get_server_ip(char* buffer, uint32_t size); @@ -54,7 +54,7 @@ class ObClogVirtualStat { bool is_need_rebuild() const; uint64_t get_next_replay_ts_delta() const; - private: +private: bool is_inited_; common::ObAddr self_; common::ObPartitionKey partition_key_; diff --git a/src/clog/ob_max_log_meta_info.h b/src/clog/ob_max_log_meta_info.h index 9861181cb..34c9ea4d1 100644 --- a/src/clog/ob_max_log_meta_info.h +++ b/src/clog/ob_max_log_meta_info.h @@ -21,11 +21,11 @@ namespace oceanbase { namespace clog { class ObMaxLogMetaInfo { - public: +public: ObMaxLogMetaInfo(); ~ObMaxLogMetaInfo(); - public: +public: int init(const common::ObPartitionKey& partition_key, const uint64_t log_id, const int64_t timestamp); void reset(); uint64_t get_log_id() const; @@ -39,7 +39,7 @@ class ObMaxLogMetaInfo { int try_update_timestamp(const int64_t base_timestamp); int try_update_log_id(const uint64_t log_id); - private: +private: void check_log_id_range_(const uint64_t log_id) const; // a.v128_.lo = ((log_id & MASK) << 16) + offset; // a.v128_.hi = ts; @@ -55,7 +55,7 @@ class ObMaxLogMetaInfo { } __attribute__((__aligned__(16))); }; - private: +private: common::ObPartitionKey partition_key_; MetaInfo meta_info_; int64_t saved_last_gts_; @@ -64,16 +64,16 @@ class ObMaxLogMetaInfo { int64_t total_log_cnt_; int64_t total_commit_log_cnt_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMaxLogMetaInfo); }; class ObAggreBuffer { - public: +public: ObAggreBuffer(); ~ObAggreBuffer(); - public: +public: int init(const uint64_t id, const uint64_t tenant_id); void reset(); void destroy(); @@ -89,10 +89,10 @@ class ObAggreBuffer { void wait(const uint64_t id, int64_t& wait_times); void reuse(const uint64_t id); - private: +private: void add_callback_to_list_(ObISubmitLogCb* cb); - private: +private: uint64_t id_; int64_t ref_; char* data_; @@ -105,7 +105,7 @@ class ObAggreBuffer { // lock for cb_list_head_ and cb_list_tail_ common::ObSpinLock lock_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAggreBuffer); } CACHE_ALIGNED; } // namespace clog diff --git a/src/clog/ob_partition_log_packet_handler.h b/src/clog/ob_partition_log_packet_handler.h index a431f71e1..5c2c8df05 100644 --- a/src/clog/ob_partition_log_packet_handler.h +++ b/src/clog/ob_partition_log_packet_handler.h @@ -28,7 +28,7 @@ class ObILogEngine; class ObIPartitionLogService; class ObPartitionLogPacketHandler : public ObIPartitionLogPacketHandler { - public: +public: typedef ObIPartitionLogService LogService; typedef ObLogReqContext Context; ObPartitionLogPacketHandler() : partition_service_(NULL), clog_mgr_(NULL) @@ -38,7 +38,7 @@ class ObPartitionLogPacketHandler : public ObIPartitionLogPacketHandler { int init(storage::ObPartitionService* partition_service, ObICLogMgr* clog_mgr); int handle_request(Context& req); - protected: +protected: int handle_single_request(Context& req); int handle_batch_request(Context& req); static int receive_log(LogService* log_service, ObILogEngine* log_engine, Context& ctx, ReceiveLogType type); @@ -74,7 +74,7 @@ class ObPartitionLogPacketHandler : public ObIPartitionLogPacketHandler { static int process_leader_max_log_msg(LogService* log_service, Context& ctx); static int process_check_rebuild_req(LogService* log_service, Context& ctx); - private: +private: storage::ObPartitionService* partition_service_; ObICLogMgr* clog_mgr_; }; diff --git a/src/clog/ob_partition_log_service.cpp b/src/clog/ob_partition_log_service.cpp index ecd93c849..31309b6ed 100644 --- a/src/clog/ob_partition_log_service.cpp +++ b/src/clog/ob_partition_log_service.cpp @@ -5032,8 +5032,8 @@ int ObPartitionLogService::restore_replayed_log(const common::ObBaseStorageInfo& } bool is_meta_log = false; ObLogType log_type = OB_LOG_UNKNOWN; - if (OB_FAIL(sw_.get_log_meta_info(cur_log_id, is_meta_log, log_submit_timestamp, - next_replay_log_ts_for_rg, accum_checksum, log_type))) { + if (OB_FAIL(sw_.get_log_meta_info( + cur_log_id, is_meta_log, log_submit_timestamp, next_replay_log_ts_for_rg, accum_checksum, log_type))) { if (OB_EAGAIN == ret) { if (REACH_TIME_INTERVAL(100 * 1000)) { CLOG_LOG(WARN, "failed to check is meta log", K(partition_key_), K(cur_log_id), K(ret)); @@ -5047,9 +5047,12 @@ int ObPartitionLogService::restore_replayed_log(const common::ObBaseStorageInfo& uint64_t last_replay_log_id = OB_INVALID_ID; if (OB_FAIL(ret)) { - } else if (OB_FAIL(replay_engine_->submit_replay_log_task_sequentially(partition_key_, cur_log_id, - log_submit_timestamp, need_replay, - log_type, next_replay_log_ts_for_rg))) { + } else if (OB_FAIL(replay_engine_->submit_replay_log_task_sequentially(partition_key_, + cur_log_id, + log_submit_timestamp, + need_replay, + log_type, + next_replay_log_ts_for_rg))) { if (OB_EAGAIN == ret) { if (REACH_TIME_INTERVAL(100 * 1000)) { CLOG_LOG(WARN, "failed to submit replay task step by step", K(ret), K_(partition_key), K(cur_log_id)); diff --git a/src/clog/ob_partition_log_service.h b/src/clog/ob_partition_log_service.h index 24e17489d..0feda65c6 100644 --- a/src/clog/ob_partition_log_service.h +++ b/src/clog/ob_partition_log_service.h @@ -62,7 +62,7 @@ class ObLogEventScheduler; class ObRemoteLogQueryEngine; class ObCandidateInfo { - public: +public: ObCandidateInfo() { reset(); @@ -70,7 +70,7 @@ class ObCandidateInfo { ~ObCandidateInfo() {} - public: +public: void reset(); common::ObRole get_role() const { @@ -177,7 +177,7 @@ class ObCandidateInfo { memstore_percent_ = memstore_percent; } - private: +private: common::ObRole role_; bool is_tenant_active_; bool is_dest_splitting_; @@ -194,33 +194,33 @@ class ObCandidateInfo { }; class ObCursorArrayCache { - public: +public: ObCursorArrayCache() {} ~ObCursorArrayCache() {} - public: +public: int init(); - public: +public: static const int64_t CURSOR_ARRAY_SIZE = 20; uint64_t cursor_start_log_id_[SCAN_THREAD_CNT]; uint64_t cursor_end_log_id_[SCAN_THREAD_CNT]; ObLogCursorExt cursor_array_[SCAN_THREAD_CNT][CURSOR_ARRAY_SIZE]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCursorArrayCache); }; class ObIPartitionLogService : public ObILogFlushCb, public election::ObIElectionCallback { - public: +public: ObIPartitionLogService() {} virtual ~ObIPartitionLogService() {} - public: +public: virtual int init(ObILogEngine* log_engine, ObLogReplayEngineWrapper* replay_engine, ObIFetchLogEngine* fetch_log_engine, election::ObIElectionMgr* election_mgr, storage::ObPartitionService* partition_service, ObILogCallbackEngine* cb_engine, @@ -485,14 +485,14 @@ class ObIPartitionLogService : public ObILogFlushCb, public election::ObIElectio }; class ObPartitionLogService : public ObIPartitionLogService { - public: +public: ObPartitionLogService(); virtual ~ObPartitionLogService() { destroy(); } - public: +public: virtual int init(ObILogEngine* log_engine, ObLogReplayEngineWrapper* replay_engine, ObIFetchLogEngine* fetch_log_engine, election::ObIElectionMgr* election_mgr, storage::ObPartitionService* partition_service, ObILogCallbackEngine* cb_engine, @@ -504,247 +504,165 @@ class ObPartitionLogService : public ObIPartitionLogService { archive::ObArchiveMgr* archive_mgr, archive::ObArchiveRestoreEngine* archive_restore_engine, const enum ObCreatePlsType& create_pls_type) override; - virtual int get_log_id_timestamp(const int64_t base_timestamp, ObLogMeta &log_meta) override; - virtual int submit_aggre_log(ObAggreBuffer *buffer, - const int64_t base_timestamp) override; - virtual int submit_log(const char *buff, - const int64_t size, - const int64_t base_timestamp, - ObISubmitLogCb *cb, - const bool is_trans_log, - uint64_t &log_id, - int64_t &log_timestamp) override; - virtual int add_member(const common::ObMember &member, - const int64_t quorum, - obrpc::ObMCLogInfo &log_info) override; - virtual int remove_member(const common::ObMember &member, - const int64_t quorum, - obrpc::ObMCLogInfo &log_info) override; - virtual int change_quorum(const common::ObMemberList &curr_member_list, - const int64_t curr_quorum, - const int64_t new_quorum, - obrpc::ObMCLogInfo &log_info) override; - virtual int is_member_change_done(const obrpc::ObMCLogInfo &log_info) override; - virtual int get_base_storage_info(common::ObBaseStorageInfo &base_storage_info, - uint64_t &sw_last_replay_log_id) override; + virtual int get_log_id_timestamp(const int64_t base_timestamp, ObLogMeta& log_meta) override; + virtual int submit_aggre_log(ObAggreBuffer* buffer, const int64_t base_timestamp) override; + virtual int submit_log(const char* buff, const int64_t size, const int64_t base_timestamp, ObISubmitLogCb* cb, + const bool is_trans_log, uint64_t& log_id, int64_t& log_timestamp) override; + virtual int add_member(const common::ObMember& member, const int64_t quorum, obrpc::ObMCLogInfo& log_info) override; + virtual int remove_member( + const common::ObMember& member, const int64_t quorum, obrpc::ObMCLogInfo& log_info) override; + virtual int change_quorum(const common::ObMemberList& curr_member_list, const int64_t curr_quorum, + const int64_t new_quorum, obrpc::ObMCLogInfo& log_info) override; + virtual int is_member_change_done(const obrpc::ObMCLogInfo& log_info) override; + virtual int get_base_storage_info( + common::ObBaseStorageInfo& base_storage_info, uint64_t& sw_last_replay_log_id) override; virtual common::ObPartitionKey get_partition_key() const override; - virtual int get_saved_base_storage_info(common::ObBaseStorageInfo &base_storage_info) const override; - virtual int get_leader(common::ObAddr &addr) const override; - virtual int get_clog_parent(common::ObAddr &parent, int64_t &cluster_id) const override; - virtual int change_leader(const common::ObAddr &leader, common::ObTsWindows &changing_leader_windows) override; - virtual int change_restore_leader(const common::ObAddr &leader) override; + virtual int get_saved_base_storage_info(common::ObBaseStorageInfo& base_storage_info) const override; + virtual int get_leader(common::ObAddr& addr) const override; + virtual int get_clog_parent(common::ObAddr& parent, int64_t& cluster_id) const override; + virtual int change_leader(const common::ObAddr& leader, common::ObTsWindows& changing_leader_windows) override; + virtual int change_restore_leader(const common::ObAddr& leader) override; virtual int check_and_set_restore_progress() override; virtual int set_restore_fetch_log_finished(ObArchiveFetchLogResult fetch_log_result) override; virtual int process_restore_takeover_msg(const int64_t send_ts) override; virtual int try_update_next_replay_log_ts_in_restore(const int64_t new_ts) override; - virtual int get_role(common::ObRole &role) const override; - virtual int get_role_for_partition_table(common::ObRole &role) const override; - virtual int get_role_unsafe(int64_t &leader_epoch, - common::ObTsWindows &changing_leader_windows) const override; - virtual int get_role_unlock(int64_t &leader_epoch, - common::ObTsWindows &changing_leader_windows) const override; - virtual int get_role_for_partition_table_unlock(int64_t &leader_epoch, - common::ObTsWindows &changing_leader_windows) const; - virtual int get_role_and_last_leader_active_time(common::ObRole &role, int64_t ×tamp) const override; - virtual int get_role_and_leader_epoch(common::ObRole &role, int64_t &leader_epoch) override; - virtual int get_role_and_leader_epoch(common::ObRole &role, int64_t &leader_epoch, - int64_t &takeover_time) override; - virtual int set_election_leader(const common::ObAddr &leader, const int64_t lease_start) override; - virtual int get_leader_curr_member_list(common::ObMemberList &member_list) const override; - virtual int get_curr_member_list(common::ObMemberList &member_list) const override; - virtual int get_curr_member_list_for_report(common::ObMemberList &member_list) const override; - virtual int try_get_curr_member_list(common::ObMemberList &member_list) const override; - virtual int get_replica_num(int64_t &replica_num) const override; - virtual int try_get_replica_num(int64_t &replica_num) const override; - virtual int receive_log(const ObLogEntry &log_entry, - const common::ObAddr &server, - const int64_t cluster_id, - const common::ObProposalID &proposal_id, - const ObPushLogMode push_mode, - const ReceiveLogType type) override; - virtual int receive_renew_ms_log(const ObLogEntry &log_entry, - const ObAddr &server, - const int64_t cluster_id, - const ObProposalID &proposal_id, - const ReceiveLogType type) override; - virtual int receive_archive_log(const ObLogEntry &log_entry, - const bool is_batch_committed) override; - virtual int ack_log(const common::ObAddr &server, - const uint64_t log_id, - const common::ObProposalID &proposal_id) override; - virtual int standby_ack_log(const ObAddr &server, - const int64_t cluster_id, - const uint64_t log_id, - const ObProposalID &proposal_id) override; - virtual int fake_ack_log(const ObAddr &server, - const uint64_t log_id, - const ObProposalID &proposal_id) override; - virtual int ack_renew_ms_log(const ObAddr &server, - const uint64_t log_id, - const int64_t submit_timestamp, - const ObProposalID &ms_proposal_id) override; - virtual int fake_receive_log(const ObAddr &server, - const uint64_t log_id, - const ObProposalID &proposal_id) override; - virtual int get_log(const common::ObAddr &server, - const uint64_t log_id, - const int64_t log_num, - const ObFetchLogType fetch_type, - const common::ObProposalID &proposal_id, - const int64_t cluster_id, - const common::ObReplicaType replica_type, - const int64_t network_limit, - const uint64_t max_confirmed_log_id) override; - virtual int async_get_log(const common::ObAddr &server, - const int64_t cluster_id, - const uint64_t start_log_id, - const uint64_t end_log_id, - const ObFetchLogType fetch_type, - const common::ObProposalID &proposal_id, - const int64_t network_limit) override; - virtual int get_max_log_id(const common::ObAddr &server, - const int64_t cluster_id, - const common::ObProposalID &proposal_id) override; - virtual int handle_standby_prepare_req(const ObAddr &server, - const int64_t cluster_id, - const ObProposalID &proposal_id) override; - virtual int handle_standby_prepare_resp(const ObAddr &server, - const ObProposalID &proposal_id, - const uint64_t ms_log_id, - const int64_t membership_version, - const ObMemberList &member_list) override; - virtual int handle_query_sync_start_id_req(const ObAddr &server, - const int64_t cluster_id, - const int64_t send_ts) override; - virtual int handle_sync_start_id_resp(const ObAddr &server, - const int64_t cluster_id, - const int64_t original_send_ts, - const uint64_t sync_start_id) override; - virtual int receive_max_log_id(const common::ObAddr &server, - const uint64_t max_log_id, - const ObProposalID &proposal_id, - const int64_t max_log_ts) override; - virtual int receive_confirmed_info(const common::ObAddr &server, - const int64_t src_cluster_id, - const uint64_t log_id, - const ObConfirmedInfo &confirmed_info, - const bool batch_committed) override; - virtual int receive_renew_ms_log_confirmed_info(const common::ObAddr &server, - const uint64_t log_id, - const common::ObProposalID &ms_proposal_id, - const ObConfirmedInfo &confirmed_info) override; - virtual int append_disk_log(const ObLogEntry &log, - const ObLogCursor &log_cursor, - const int64_t accum_checksum, - const bool batch_committed) override; - virtual int is_offline(bool &is_offline) override; + virtual int get_role(common::ObRole& role) const override; + virtual int get_role_for_partition_table(common::ObRole& role) const override; + virtual int get_role_unsafe(int64_t& leader_epoch, common::ObTsWindows& changing_leader_windows) const override; + virtual int get_role_unlock(int64_t& leader_epoch, common::ObTsWindows& changing_leader_windows) const override; + virtual int get_role_for_partition_table_unlock( + int64_t& leader_epoch, common::ObTsWindows& changing_leader_windows) const; + virtual int get_role_and_last_leader_active_time(common::ObRole& role, int64_t& timestamp) const override; + virtual int get_role_and_leader_epoch(common::ObRole& role, int64_t& leader_epoch) override; + virtual int get_role_and_leader_epoch(common::ObRole& role, int64_t& leader_epoch, int64_t& takeover_time) override; + virtual int set_election_leader(const common::ObAddr& leader, const int64_t lease_start) override; + virtual int get_leader_curr_member_list(common::ObMemberList& member_list) const override; + virtual int get_curr_member_list(common::ObMemberList& member_list) const override; + virtual int get_curr_member_list_for_report(common::ObMemberList& member_list) const override; + virtual int try_get_curr_member_list(common::ObMemberList& member_list) const override; + virtual int get_replica_num(int64_t& replica_num) const override; + virtual int try_get_replica_num(int64_t& replica_num) const override; + virtual int receive_log(const ObLogEntry& log_entry, const common::ObAddr& server, const int64_t cluster_id, + const common::ObProposalID& proposal_id, const ObPushLogMode push_mode, const ReceiveLogType type) override; + virtual int receive_renew_ms_log(const ObLogEntry& log_entry, const ObAddr& server, const int64_t cluster_id, + const ObProposalID& proposal_id, const ReceiveLogType type) override; + virtual int receive_archive_log(const ObLogEntry& log_entry, const bool is_batch_committed) override; + virtual int ack_log( + const common::ObAddr& server, const uint64_t log_id, const common::ObProposalID& proposal_id) override; + virtual int standby_ack_log( + const ObAddr& server, const int64_t cluster_id, const uint64_t log_id, const ObProposalID& proposal_id) override; + virtual int fake_ack_log(const ObAddr& server, const uint64_t log_id, const ObProposalID& proposal_id) override; + virtual int ack_renew_ms_log(const ObAddr& server, const uint64_t log_id, const int64_t submit_timestamp, + const ObProposalID& ms_proposal_id) override; + virtual int fake_receive_log(const ObAddr& server, const uint64_t log_id, const ObProposalID& proposal_id) override; + virtual int get_log(const common::ObAddr& server, const uint64_t log_id, const int64_t log_num, + const ObFetchLogType fetch_type, const common::ObProposalID& proposal_id, const int64_t cluster_id, + const common::ObReplicaType replica_type, const int64_t network_limit, + const uint64_t max_confirmed_log_id) override; + virtual int async_get_log(const common::ObAddr& server, const int64_t cluster_id, const uint64_t start_log_id, + const uint64_t end_log_id, const ObFetchLogType fetch_type, const common::ObProposalID& proposal_id, + const int64_t network_limit) override; + virtual int get_max_log_id( + const common::ObAddr& server, const int64_t cluster_id, const common::ObProposalID& proposal_id) override; + virtual int handle_standby_prepare_req( + const ObAddr& server, const int64_t cluster_id, const ObProposalID& proposal_id) override; + virtual int handle_standby_prepare_resp(const ObAddr& server, const ObProposalID& proposal_id, + const uint64_t ms_log_id, const int64_t membership_version, const ObMemberList& member_list) override; + virtual int handle_query_sync_start_id_req( + const ObAddr& server, const int64_t cluster_id, const int64_t send_ts) override; + virtual int handle_sync_start_id_resp(const ObAddr& server, const int64_t cluster_id, const int64_t original_send_ts, + const uint64_t sync_start_id) override; + virtual int receive_max_log_id(const common::ObAddr& server, const uint64_t max_log_id, + const ObProposalID& proposal_id, const int64_t max_log_ts) override; + virtual int receive_confirmed_info(const common::ObAddr& server, const int64_t src_cluster_id, const uint64_t log_id, + const ObConfirmedInfo& confirmed_info, const bool batch_committed) override; + virtual int receive_renew_ms_log_confirmed_info(const common::ObAddr& server, const uint64_t log_id, + const common::ObProposalID& ms_proposal_id, const ObConfirmedInfo& confirmed_info) override; + virtual int append_disk_log(const ObLogEntry& log, const ObLogCursor& log_cursor, const int64_t accum_checksum, + const bool batch_committed) override; + virtual int is_offline(bool& is_offline) override; virtual int stop_election() override; virtual int set_offline() override; - virtual int set_online(const common::ObBaseStorageInfo &base_storage_info, - const common::ObVersion &memstore_version) override; + virtual int set_online( + const common::ObBaseStorageInfo& base_storage_info, const common::ObVersion& memstore_version) override; virtual int on_election_role_change() override; virtual int set_scan_disk_log_finished() override; virtual int switch_state() override; - virtual int switch_state(bool &need_retry) override; + virtual int switch_state(bool& need_retry) override; virtual int check_mc_and_sliding_window_state() override; virtual int leader_send_max_log_info() override; virtual int leader_keepalive(const int64_t keepalive_interval) override; virtual int sync_log_archive_progress() override; - virtual int get_log_archive_status(ObPGLogArchiveStatus &status) override; + virtual int get_log_archive_status(ObPGLogArchiveStatus& status) override; virtual int check_cascading_state() override; virtual int archive_checkpoint(const int64_t interval) override; virtual int set_next_index_log_id(const uint64_t log_id, const int64_t accum_checksum) override; - virtual int is_in_sync(bool &is_sync) const override; - virtual int is_log_sync_with_leader(bool &is_sync) const override; - virtual int is_log_sync_with_primary(const int64_t switchover_epoch, bool &is_sync) const override; - virtual int is_need_rebuild(bool &need_rebuild) const override; + virtual int is_in_sync(bool& is_sync) const override; + virtual int is_log_sync_with_leader(bool& is_sync) const override; + virtual int is_log_sync_with_primary(const int64_t switchover_epoch, bool& is_sync) const override; + virtual int is_need_rebuild(bool& need_rebuild) const override; virtual bool is_leader_active() const override; virtual int check_self_is_election_leader_() const; - virtual int get_next_replay_log_info(uint64_t &next_replay_log_id, int64_t &next_replay_log_timestamp) override; - virtual int get_follower_log_delay(int64_t &log_delay) override; - virtual int process_keepalive_msg(const common::ObAddr &server, - const int64_t cluster_id, - const uint64_t next_log_id, - const int64_t next_log_ts_lb, - const uint64_t deliver_cnt) override; - virtual int process_archive_checkpoint(const uint64_t next_log_id, - const int64_t next_log_ts) override; - virtual int get_restore_leader_info(bool &is_restore_leader, - int64_t &leader_takeover_ts) override; - virtual int process_leader_max_log_msg(const common::ObAddr &server, - const int64_t switchover_epoch, - const uint64_t leader_max_log_id, - const int64_t leader_next_log_ts) override; - virtual int process_sync_log_archive_progress_msg(const common::ObAddr &server, - const int64_t cluster_id, - const ObPGLogArchiveStatus &status) override; - virtual int notify_log_missing(const common::ObAddr &src_server, - const uint64_t start_log_id, - const bool is_in_member_list, - const int32_t msg_type) override; - virtual int fetch_register_server(const common::ObAddr &server, - const common::ObReplicaType replica_type, - const int64_t next_replay_log_ts, - const bool is_request_leader, - const bool is_need_force_register, - const common::ObRegion ®ion, - const int64_t cluster_id, - const common::ObIDC &idc) override; - virtual int fetch_register_server_resp_v2(const common::ObAddr &sender, - const bool is_assign_parent_succeed, - const share::ObCascadMemberList &candidate_list, - const int32_t msg_type) override; - virtual int replace_sick_child(const common::ObAddr &sender, - const int64_t cluster_id, - const common::ObAddr &sick_child) override; - virtual int get_curr_leader_and_memberlist(common::ObAddr &leader, - common::ObRole &role, - common::ObMemberList &curr_member_list, - common::ObChildReplicaList &children_list) const override; - virtual int migrate_set_base_storage_info(const common::ObBaseStorageInfo &base_storage_info) override; - virtual int restore_replayed_log(const common::ObBaseStorageInfo &base_storage_info) override; + virtual int get_next_replay_log_info(uint64_t& next_replay_log_id, int64_t& next_replay_log_timestamp) override; + virtual int get_follower_log_delay(int64_t& log_delay) override; + virtual int process_keepalive_msg(const common::ObAddr& server, const int64_t cluster_id, const uint64_t next_log_id, + const int64_t next_log_ts_lb, const uint64_t deliver_cnt) override; + virtual int process_archive_checkpoint(const uint64_t next_log_id, const int64_t next_log_ts) override; + virtual int get_restore_leader_info(bool& is_restore_leader, int64_t& leader_takeover_ts) override; + virtual int process_leader_max_log_msg(const common::ObAddr& server, const int64_t switchover_epoch, + const uint64_t leader_max_log_id, const int64_t leader_next_log_ts) override; + virtual int process_sync_log_archive_progress_msg( + const common::ObAddr& server, const int64_t cluster_id, const ObPGLogArchiveStatus& status) override; + virtual int notify_log_missing(const common::ObAddr& src_server, const uint64_t start_log_id, + const bool is_in_member_list, const int32_t msg_type) override; + virtual int fetch_register_server(const common::ObAddr& server, const common::ObReplicaType replica_type, + const int64_t next_replay_log_ts, const bool is_request_leader, const bool is_need_force_register, + const common::ObRegion& region, const int64_t cluster_id, const common::ObIDC& idc) override; + virtual int fetch_register_server_resp_v2(const common::ObAddr& sender, const bool is_assign_parent_succeed, + const share::ObCascadMemberList& candidate_list, const int32_t msg_type) override; + virtual int replace_sick_child( + const common::ObAddr& sender, const int64_t cluster_id, const common::ObAddr& sick_child) override; + virtual int get_curr_leader_and_memberlist(common::ObAddr& leader, common::ObRole& role, + common::ObMemberList& curr_member_list, common::ObChildReplicaList& children_list) const override; + virtual int migrate_set_base_storage_info(const common::ObBaseStorageInfo& base_storage_info) override; + virtual int restore_replayed_log(const common::ObBaseStorageInfo& base_storage_info) override; inline virtual uint64_t get_last_replay_log_id() const override { return saved_base_storage_info_.get_last_replay_log_id(); } - virtual void get_last_replay_log(uint64_t &log_id, int64_t &ts) override; + virtual void get_last_replay_log(uint64_t& log_id, int64_t& ts) override; virtual int64_t get_last_submit_timestamp() const override; virtual int remove_election() override; virtual int standby_update_protection_level() override; - virtual int get_standby_leader_protection_level(uint32_t &protection_level) override; + virtual int get_standby_leader_protection_level(uint32_t& protection_level) override; virtual int primary_process_protect_mode_switch() override; virtual int64_t get_membership_timestamp() const override; - virtual int try_replay(const bool need_async, bool &is_replayed, bool &is_replay_failed) override; - virtual bool is_svr_in_member_list(const ObAddr &server) const override; - virtual int get_dst_leader_candidate(common::ObMemberList &member_list) const override; - virtual int get_max_data_version(ObVersion &max_data_version) const override; + virtual int try_replay(const bool need_async, bool& is_replayed, bool& is_replay_failed) override; + virtual bool is_svr_in_member_list(const ObAddr& server) const override; + virtual int get_dst_leader_candidate(common::ObMemberList& member_list) const override; + virtual int get_max_data_version(ObVersion& max_data_version) const override; virtual int set_follower_active() override; virtual uint64_t get_last_slide_log_id() override; virtual uint64_t get_start_log_id() override; virtual uint64_t get_start_log_id_unsafe() override; - virtual int get_log_id_range(uint64_t &start_log_id, - int64_t &start_ts, - uint64_t &end_log_id, - int64_t &end_ts) override; - virtual int get_sw_max_log_id_info(uint64_t &sw_max_log_id, int64_t &sw_max_log_ts) override; - int get_sw_max_log_id(uint64_t &sw_max_log_id) override; - virtual ObClogVirtualStat *alloc_clog_virtual_stat() override; - virtual int revert_clog_virtual_stat(ObClogVirtualStat *virtual_stat) override; + virtual int get_log_id_range( + uint64_t& start_log_id, int64_t& start_ts, uint64_t& end_log_id, int64_t& end_ts) override; + virtual int get_sw_max_log_id_info(uint64_t& sw_max_log_id, int64_t& sw_max_log_ts) override; + int get_sw_max_log_id(uint64_t& sw_max_log_id) override; + virtual ObClogVirtualStat* alloc_clog_virtual_stat() override; + virtual int revert_clog_virtual_stat(ObClogVirtualStat* virtual_stat) override; virtual int force_set_as_single_replica() override; virtual int force_set_replica_num(const int64_t replica_num) override; - virtual int force_set_parent(const common::ObAddr &new_parent) override; + virtual int force_set_parent(const common::ObAddr& new_parent) override; virtual int force_reset_parent() override; - virtual int force_set_server_list(const obrpc::ObServerList &server_list, - const int64_t replica_num) override; - virtual int renew_ms_log_flush_cb(const storage::ObMsInfoTask &task) override; + virtual int force_set_server_list(const obrpc::ObServerList& server_list, const int64_t replica_num) override; + virtual int renew_ms_log_flush_cb(const storage::ObMsInfoTask& task) override; virtual int try_update_leader_from_loc_cache() override; - virtual int flush_cb(const ObLogFlushCbArg &arg) override; - virtual int on_get_election_priority(election::ObElectionPriority &priority) override; - virtual int on_change_leader_retry(const common::ObAddr &server, - ObTsWindows &changing_leader_windows) override; - virtual int get_next_timestamp(const uint64_t last_log_id, int64_t &res_ts) override; - virtual int get_next_served_log_info_for_leader(uint64_t &next_served_log_id, - int64_t &next_served_log_ts) override; + virtual int flush_cb(const ObLogFlushCbArg& arg) override; + virtual int on_get_election_priority(election::ObElectionPriority& priority) override; + virtual int on_change_leader_retry(const common::ObAddr& server, ObTsWindows& changing_leader_windows) override; + virtual int get_next_timestamp(const uint64_t last_log_id, int64_t& res_ts) override; + virtual int get_next_served_log_info_for_leader(uint64_t& next_served_log_id, int64_t& next_served_log_ts) override; virtual uint64_t get_next_index_log_id() const override { return sw_.get_next_index_log_id(); @@ -754,82 +672,66 @@ class ObPartitionLogService : public ObIPartitionLogService { { return ATOMIC_LOAD(&scan_confirmed_log_cnt_); } - virtual int get_pls_epoch(int64_t &pls_epoch) const override; - virtual int allow_gc(bool &allowed) override; - virtual int query_max_flushed_ilog_id(uint64_t &ret_max_ilog_id) override; + virtual int get_pls_epoch(int64_t& pls_epoch) const override; + virtual int allow_gc(bool& allowed) override; + virtual int query_max_flushed_ilog_id(uint64_t& ret_max_ilog_id) override; virtual void set_zone_priority(const uint64_t zone_priority) override; - virtual int set_region(const common::ObRegion ®ion) override; - virtual int set_idc(const common::ObIDC &idc) override; - virtual const common::ObRegion &get_region() const; - virtual const common::ObIDC &get_idc() const; + virtual int set_region(const common::ObRegion& region) override; + virtual int set_idc(const common::ObIDC& idc) override; + virtual const common::ObRegion& get_region() const; + virtual const common::ObIDC& get_idc() const; virtual enum ObReplicaType get_replica_type() override; virtual int set_replica_type(const enum ObReplicaType replica_type) override; - virtual int check_is_normal_partition(bool &is_normal_partition) const override; + virtual int check_is_normal_partition(bool& is_normal_partition) const override; + public: virtual bool need_skip_when_check_start_service() const override; virtual int broadcast_info() override; - virtual int update_broadcast_info(const common::ObAddr &server, - const common::ObReplicaType &replica_type, - const uint64_t max_confirmed_log_id) override; - virtual int get_recyclable_log_id(uint64_t &log_id) const override; - virtual int is_valid_member(const common::ObAddr &addr, bool &is_valid) const override; + virtual int update_broadcast_info(const common::ObAddr& server, const common::ObReplicaType& replica_type, + const uint64_t max_confirmed_log_id) override; + virtual int get_recyclable_log_id(uint64_t& log_id) const override; + virtual int is_valid_member(const common::ObAddr& addr, bool& is_valid) const override; virtual bool has_valid_next_replay_log_ts() const override; virtual bool has_valid_member_list() const override; - virtual int process_check_rebuild_req(const common::ObAddr &server, - const uint64_t start_log_id, - const int64_t cluster_id) override; - virtual void get_max_majority_log(uint64_t &log_id, int64_t &log_ts) const override; + virtual int process_check_rebuild_req( + const common::ObAddr& server, const uint64_t start_log_id, const int64_t cluster_id) override; + virtual void get_max_majority_log(uint64_t& log_id, int64_t& log_ts) const override; virtual uint64_t get_max_confirmed_log_id() const override; + public: -//==================== batch change member begin ==================== - virtual int pre_change_member(const int64_t quorum, - const bool is_add_member, - int64_t &mc_timestamp, - ObMemberList &member_list, - ObProposalID &proposal_id) override; + //==================== batch change member begin ==================== + virtual int pre_change_member(const int64_t quorum, const bool is_add_member, int64_t& mc_timestamp, + ObMemberList& member_list, ObProposalID& proposal_id) override; virtual int set_member_changing() override; virtual int reset_member_changing() override; - virtual int wait_log_confirmed(const int64_t begin_time, - const int64_t max_wait_time) override; - virtual int batch_change_member(const common::ObMember &member, - const int64_t quorum, - const int64_t mc_timestamp, - const common::ObProposalID &proposal_id, - const bool is_add_member, - obrpc::ObMCLogInfo &mc_log_info) override; - virtual int get_partition_max_log_id(uint64_t &partition_max_log_id) override; -//==================== batch change member end ==================== + virtual int wait_log_confirmed(const int64_t begin_time, const int64_t max_wait_time) override; + virtual int batch_change_member(const common::ObMember& member, const int64_t quorum, const int64_t mc_timestamp, + const common::ObProposalID& proposal_id, const bool is_add_member, obrpc::ObMCLogInfo& mc_log_info) override; + virtual int get_partition_max_log_id(uint64_t& partition_max_log_id) override; + //==================== batch change member end ==================== -//=================== one phase commit begin ================ - virtual int get_candidate_info(ObCandidateInfo &info) override; + //=================== one phase commit begin ================ + virtual int get_candidate_info(ObCandidateInfo& info) override; - virtual int query_confirmed_log(const uint64_t log_id, - transaction::ObTransID &trans_id, - int64_t &submit_timestamp) override; - virtual int backfill_log(const ObLogInfo &log_info, - const ObLogCursor &log_cursor, - const bool is_leader, - ObISubmitLogCb *submit_cb) override; - virtual int backfill_confirmed(const ObLogInfo &log_info, const bool batch_first_participant) override; - virtual int resubmit_log(const ObLogInfo &log_info, - ObISubmitLogCb *submit_cb) override; - virtual int backfill_nop_log(const ObLogMeta &log_meta) override; -//=================== one phase commit end ================ + virtual int query_confirmed_log( + const uint64_t log_id, transaction::ObTransID& trans_id, int64_t& submit_timestamp) override; + virtual int backfill_log(const ObLogInfo& log_info, const ObLogCursor& log_cursor, const bool is_leader, + ObISubmitLogCb* submit_cb) override; + virtual int backfill_confirmed(const ObLogInfo& log_info, const bool batch_first_participant) override; + virtual int resubmit_log(const ObLogInfo& log_info, ObISubmitLogCb* submit_cb) override; + virtual int backfill_nop_log(const ObLogMeta& log_meta) override; + //=================== one phase commit end ================ virtual bool need_add_event_task() override; virtual void reset_has_event_task() override; virtual int check_can_receive_batch_log(const uint64_t log_id) override; virtual int update_max_flushed_ilog_id(const uint64_t log_id) override; - virtual int get_cursor_with_cache(const int64_t scan_thread_index, - const uint64_t log_id, - ObLogCursorExt &log_cursor) override; + virtual int get_cursor_with_cache( + const int64_t scan_thread_index, const uint64_t log_id, ObLogCursorExt& log_cursor) override; virtual int reset_has_pop_task() override; - virtual int set_member_list(const ObMemberList &member_list, - const int64_t replica_num, - const common::ObAddr &assigned_leader, - const int64_t lease_start) override; - int get_last_archived_log_id(const int64_t incarnartion, - const int64_t archive_round, - uint64_t &last_archived_log_id) override; + virtual int set_member_list(const ObMemberList& member_list, const int64_t replica_num, + const common::ObAddr& assigned_leader, const int64_t lease_start) override; + int get_last_archived_log_id( + const int64_t incarnartion, const int64_t archive_round, uint64_t& last_archived_log_id) override; virtual int try_freeze_aggre_buffer() override; int set_archive_restore_state(const int16_t archive_restore_state) override; /*return values: @@ -838,14 +740,15 @@ public: * other code * */ - virtual int check_if_start_log_task_empty(bool &is_empty) override; + virtual int check_if_start_log_task_empty(bool& is_empty) override; bool is_archive_restoring() const override; common::ObAddr get_restore_leader() const override; virtual int restore_leader_try_confirm_log() override; virtual bool is_standby_restore_state() const override; - virtual int check_and_try_leader_revoke(const election::ObElection::RevokeType &revoke_type) override; + virtual int check_and_try_leader_revoke(const election::ObElection::RevokeType& revoke_type) override; + private: - enum { DEFAULT_TIMEOUT = 10 * 1000 * 1000}; + enum { DEFAULT_TIMEOUT = 10 * 1000 * 1000 }; virtual void destroy(); int majority_cb_(const uint64_t log_id); int standby_majority_cb_(const common::ObAddr& server, const int64_t cluster_id, @@ -884,51 +787,34 @@ private: int64_t get_zone_priority() const; int response_sliding_window_info_(const common::ObAddr& server, const bool is_leader); int process_replica_type_change_(); - int process_reject_msg(const common::ObAddr &server, const int32_t msg_type, const int64_t timestamp) override; - int process_reregister_msg(const common::ObAddr &src_server, - const share::ObCascadMember &new_leader, - const int64_t send_ts) override; - int process_restore_alive_msg(const common::ObAddr &server, - const uint64_t start_log_id) override; - int process_restore_alive_req(const common::ObAddr &server, - const int64_t dst_cluster_id, - const int64_t send_ts) override; - int process_restore_alive_resp(const common::ObAddr &server, - const int64_t send_ts) override; - int process_restore_log_finish_msg(const common::ObAddr &src_server, - const uint64_t log_id) override; - int resp_sw_info_when_get_log_(const common::ObAddr &server, const int64_t cluster_id); - int internal_fetch_log_(const uint64_t start_log_id, - const uint64_t end_log_id, - const ObFetchLogType &fetch_type, - const ObProposalID &proposal_id, - const common::ObAddr &server, - const int64_t cluster_id, - const uint32_t log_attr, - const bool need_send_confirm_info, - const int64_t network_limit); - int fetch_log_from_sw_(const uint64_t log_id, - const ObFetchLogType &fetch_type, - const ObProposalID &proposal_id, - const common::ObAddr &server, - const int64_t cluster_id, - const uint32_t log_attr, - const bool need_send_confirm_info, - const int64_t network_limit); - int fetch_log_from_ilog_storage_(const uint64_t log_id, - const ObFetchLogType &fetch_type, - const ObProposalID &proposal_id, - const common::ObAddr &server, - const int64_t cluster_id, - const bool need_send_confirm_info, - const int64_t network_limit, - ObGetCursorResult &result, - uint64_t &cursor_start_log_id); - int send_keepalive_msg_to_children_(const uint64_t next_log_id, const int64_t next_log_ts_lb, const uint64_t deliver_cnt) const; - int send_keepalive_msg_to_mlist_(const uint64_t next_log_id, const int64_t next_log_ts_lb, const uint64_t deliver_cnt) const; - int send_archive_progress_msg_to_children_(const ObPGLogArchiveStatus &status) const; - int send_max_log_msg_to_children_(const int64_t switchover_epoch, const uint64_t leader_max_log_id, const int64_t leader_next_log_ts) const; - int send_max_log_msg_to_mlist_(const int64_t switchover_epoch, const uint64_t leader_max_log_id, const int64_t leader_next_log_ts) const; + int process_reject_msg(const common::ObAddr& server, const int32_t msg_type, const int64_t timestamp) override; + int process_reregister_msg( + const common::ObAddr& src_server, const share::ObCascadMember& new_leader, const int64_t send_ts) override; + int process_restore_alive_msg(const common::ObAddr& server, const uint64_t start_log_id) override; + int process_restore_alive_req( + const common::ObAddr& server, const int64_t dst_cluster_id, const int64_t send_ts) override; + int process_restore_alive_resp(const common::ObAddr& server, const int64_t send_ts) override; + int process_restore_log_finish_msg(const common::ObAddr& src_server, const uint64_t log_id) override; + int resp_sw_info_when_get_log_(const common::ObAddr& server, const int64_t cluster_id); + int internal_fetch_log_(const uint64_t start_log_id, const uint64_t end_log_id, const ObFetchLogType& fetch_type, + const ObProposalID& proposal_id, const common::ObAddr& server, const int64_t cluster_id, const uint32_t log_attr, + const bool need_send_confirm_info, const int64_t network_limit); + int fetch_log_from_sw_(const uint64_t log_id, const ObFetchLogType& fetch_type, const ObProposalID& proposal_id, + const common::ObAddr& server, const int64_t cluster_id, const uint32_t log_attr, + const bool need_send_confirm_info, const int64_t network_limit); + int fetch_log_from_ilog_storage_(const uint64_t log_id, const ObFetchLogType& fetch_type, + const ObProposalID& proposal_id, const common::ObAddr& server, const int64_t cluster_id, + const bool need_send_confirm_info, const int64_t network_limit, ObGetCursorResult& result, + uint64_t& cursor_start_log_id); + int send_keepalive_msg_to_children_( + const uint64_t next_log_id, const int64_t next_log_ts_lb, const uint64_t deliver_cnt) const; + int send_keepalive_msg_to_mlist_( + const uint64_t next_log_id, const int64_t next_log_ts_lb, const uint64_t deliver_cnt) const; + int send_archive_progress_msg_to_children_(const ObPGLogArchiveStatus& status) const; + int send_max_log_msg_to_children_( + const int64_t switchover_epoch, const uint64_t leader_max_log_id, const int64_t leader_next_log_ts) const; + int send_max_log_msg_to_mlist_( + const int64_t switchover_epoch, const uint64_t leader_max_log_id, const int64_t leader_next_log_ts) const; bool is_paxos_offline_replica_() const; bool is_no_update_next_replay_log_id_info_too_long_() const; int check_state_(); @@ -969,7 +855,7 @@ private: bool is_tenant_out_of_memory_() const; int get_role_and_leader_epoch_unlock_(common::ObRole& role, int64_t& leader_epoch, int64_t& takeover_time); - private: +private: typedef common::RWLock RWLock; typedef RWLock::RLockGuard RLockGuard; typedef RWLock::WLockGuard WLockGuard; diff --git a/src/clog/ob_raw_entry_iterator.h b/src/clog/ob_raw_entry_iterator.h index f6d906360..e9e05738a 100644 --- a/src/clog/ob_raw_entry_iterator.h +++ b/src/clog/ob_raw_entry_iterator.h @@ -104,11 +104,11 @@ inline int parse_log_item_type(const char* buf, const int64_t len, ObCLogItemTyp // or equal to last_block_ts, if not, the end of the file is read. template class ObRawEntryIterator : public Interface { - public: +public: ObRawEntryIterator(); virtual ~ObRawEntryIterator(); - public: +public: int init(ObILogDirectReader* direct_reader, const file_id_t start_file_id, const offset_t start_offset, const file_id_t end_file_id, const int64_t timeout); void destroy(); @@ -118,7 +118,7 @@ class ObRawEntryIterator : public Interface { return read_cost_; } - private: +private: ObCLogItemType get_type_() const; inline void advance_(const int64_t step); inline int get_next_file_id_(file_id_t& next_file_id); @@ -131,7 +131,7 @@ class ObRawEntryIterator : public Interface { bool is_compressed_item_(const ObCLogItemType item_type) const; int check_compressed_entry_length_(const char* buf, const int64_t buf_size) const; - private: +private: // magic number length in byte. // "en" EOF // "LB" block meta @@ -150,7 +150,7 @@ class ObRawEntryIterator : public Interface { // Since our log disk space is large enough, log files will not be reused within two seconds, // so this constant is safe in the scenario of reusing files. static const int64_t CHECK_LAST_BLOCK_TS_INTERVAL = 2000 * 1000; // 2s - private: +private: bool is_inited_; ObILogDirectReader* reader_; file_id_t file_id_; diff --git a/src/clog/ob_remote_log_query_engine.cpp b/src/clog/ob_remote_log_query_engine.cpp index b0e40d4b6..ca24d52e6 100644 --- a/src/clog/ob_remote_log_query_engine.cpp +++ b/src/clog/ob_remote_log_query_engine.cpp @@ -80,13 +80,13 @@ void ObRemoteLogQueryEngine::ClearCacheTask::destroy() } class ObRemoteLogQueryEngine::RemoveIfFunctor { - public: +public: RemoveIfFunctor() {} ~RemoveIfFunctor() {} - public: +public: bool operator()(const ObPartitionLogInfo& pl_info, ObTransIDInfo& trans_id_info) { UNUSED(pl_info); diff --git a/src/clog/ob_remote_log_query_engine.h b/src/clog/ob_remote_log_query_engine.h index 17cb8c80b..b44749640 100644 --- a/src/clog/ob_remote_log_query_engine.h +++ b/src/clog/ob_remote_log_query_engine.h @@ -28,19 +28,19 @@ class ObMySQLProxy; namespace clog { class ObILogEngine; class ObIRemoteLogQueryEngine { - public: +public: ObIRemoteLogQueryEngine() {} virtual ~ObIRemoteLogQueryEngine() {} - public: +public: virtual int get_log(const common::ObPartitionKey& partition_key, const uint64_t log_id, const common::ObMemberList& curr_member_list, transaction::ObTransID& trans_id, int64_t& submit_timestamp) = 0; }; class ObPartitionLogInfo { - public: +public: ObPartitionLogInfo(const common::ObPartitionKey& partition_key, const uint64_t log_id) : partition_key_(partition_key), log_id_(log_id) {} @@ -49,7 +49,7 @@ class ObPartitionLogInfo { ~ObPartitionLogInfo() {} - public: +public: uint64_t hash() const; bool operator==(const ObPartitionLogInfo& other) const; void set(const common::ObPartitionKey& partition_key, const uint64_t log_id) @@ -71,19 +71,19 @@ class ObPartitionLogInfo { } TO_STRING_KV(K(partition_key_), K(log_id_)); - private: +private: common::ObPartitionKey partition_key_; uint64_t log_id_; }; class ObRemoteLogQETask { - public: +public: ObRemoteLogQETask() : partition_key_(), log_id_(common::OB_INVALID_ID), curr_member_list_() {} ~ObRemoteLogQETask() {} - public: +public: void set( const common::ObPartitionKey& partition_key, const uint64_t log_id, const common::ObMemberList& curr_member_list) { @@ -108,17 +108,17 @@ class ObRemoteLogQETask { } TO_STRING_KV(K(partition_key_), K(log_id_), K(curr_member_list_)); - private: +private: common::ObPartitionKey partition_key_; uint64_t log_id_; common::ObMemberList curr_member_list_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRemoteLogQETask); }; class ObTransIDInfo { - public: +public: ObTransIDInfo(const transaction::ObTransID& trans_id, const int64_t submit_timestamp, const int64_t ts) : trans_id_(trans_id), submit_timestamp_(submit_timestamp), ts_(ts) {} @@ -127,7 +127,7 @@ class ObTransIDInfo { ~ObTransIDInfo() {} - public: +public: const transaction::ObTransID& get_trans_id() const { return trans_id_; @@ -142,7 +142,7 @@ class ObTransIDInfo { } TO_STRING_KV(K(trans_id_), K(submit_timestamp_), K(ts_)); - private: +private: transaction::ObTransID trans_id_; int64_t submit_timestamp_; // The time inserted into hash map, used to cache replacement @@ -150,29 +150,29 @@ class ObTransIDInfo { }; class ObRemoteLogQueryEngine : public ObIRemoteLogQueryEngine, public lib::TGTaskHandler { - public: +public: const static int64_t REMOTE_LOG_QUERY_ENGINE_THREAD_NUM = 2; const static int64_t MINI_MODE_REMOTE_LOG_QUERY_ENGINE_THREAD_NUM = 1; const static int64_t REMOTE_LOG_QUERY_ENGINE_TASK_NUM = 1000; - public: +public: ObRemoteLogQueryEngine(); virtual ~ObRemoteLogQueryEngine(); - public: +public: int init(common::ObMySQLProxy* sql_proxy, ObILogEngine* log_engine, const common::ObAddr& self); int start(); void stop(); void wait(); void destroy(); - public: +public: virtual int get_log(const common::ObPartitionKey& partition_key, const uint64_t log_id, const common::ObMemberList& curr_member_list, transaction::ObTransID& trans_id, int64_t& submit_timestamp); virtual void handle(void* task); int run_clear_cache_task(); - private: +private: int get_addr_array_( const common::ObPartitionKey& partition_key, const uint64_t log_id, common::ObAddrArray& addr_array); int execute_query_(const common::ObPartitionKey& partition_key, const uint64_t log_id, @@ -180,23 +180,23 @@ class ObRemoteLogQueryEngine : public ObIRemoteLogQueryEngine, public lib::TGTas static int transfer_addr_array_(const common::ObMemberList& member_list, common::ObAddrArray& addr_array); const static int64_t CLEAR_CACHE_INTERVAL = 300 * 1000 * 1000L; // 5 minutes class ClearCacheTask : public common::ObTimerTask { - public: + public: ClearCacheTask(); virtual ~ClearCacheTask() {} - public: + public: int init(ObRemoteLogQueryEngine* host); virtual void runTimerTask(); void destroy(); - private: + private: bool is_inited_; ObRemoteLogQueryEngine* host_; }; class RemoveIfFunctor; - private: +private: bool is_inited_; bool is_running_; // Query __all_clog_hisotry_info @@ -208,7 +208,7 @@ class ObRemoteLogQueryEngine : public ObIRemoteLogQueryEngine, public lib::TGTas ClearCacheTask clear_cache_task_; common::ObAddr self_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRemoteLogQueryEngine); }; } // namespace clog diff --git a/src/clog/ob_rpc_post_handler.h b/src/clog/ob_rpc_post_handler.h index ce404657e..8175ee3aa 100644 --- a/src/clog/ob_rpc_post_handler.h +++ b/src/clog/ob_rpc_post_handler.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace clog { class ObILogRpc; class ObRpcPostHandler : public share::ObThreadPool { - public: +public: struct Task; ObRpcPostHandler() : rpc_(NULL) {} @@ -37,11 +37,11 @@ class ObRpcPostHandler : public share::ObThreadPool { void wait(); void destroy(); - private: +private: void run1(); int handle_task(); - private: +private: const static int64_t WAIT_TASK_TIMEOUT = 100 * 1000; ObILogRpc* rpc_; common::ObLinkQueue queue_; diff --git a/src/clog/ob_simple_member_list.h b/src/clog/ob_simple_member_list.h index b56421afc..74ebb5ee4 100644 --- a/src/clog/ob_simple_member_list.h +++ b/src/clog/ob_simple_member_list.h @@ -21,13 +21,13 @@ namespace oceanbase { namespace clog { class ObSimpleMemberList final { - public: +public: ObSimpleMemberList() { reset(); } - public: +public: int add_server(const common::ObAddr& server); bool contains(const common::ObAddr& server) const; int64_t get_count() const @@ -40,7 +40,7 @@ class ObSimpleMemberList final { int deep_copy_to(common::ObMemberList& member_list); int remove_server(const common::ObAddr& server); - private: +private: int8_t count_; common::ObAddr server_[common::OB_MAX_MEMBER_NUMBER]; }; @@ -48,7 +48,7 @@ class ObSimpleMemberList final { typedef common::ObSEArray ObSimpleMemberListArray; class ObAckList { - public: +public: ObAckList() { reset(); @@ -56,13 +56,13 @@ class ObAckList { ~ObAckList() {} - public: +public: int add_server(const common::ObAddr& server); int64_t get_count() const; void reset(); int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: const static int64_t ACK_LIST_SERVER_NUM = common::OB_MAX_MEMBER_NUMBER / 2; common::ObAddr server_[ACK_LIST_SERVER_NUM]; }; diff --git a/src/election/ob_election.h b/src/election/ob_election.h index d7ec88e53..153623349 100644 --- a/src/election/ob_election.h +++ b/src/election/ob_election.h @@ -56,7 +56,7 @@ enum class PhysicalCondition { HEALTHY = 0, INFECTED = 1, SICK = 2, DEAD = 3 }; /**************************************************************************************************/ class ObIElection : public common::LinkHashValue { - public: +public: ObIElection() {} virtual ~ObIElection() @@ -68,7 +68,7 @@ class ObIElection : public common::LinkHashValue { virtual int start() = 0; virtual int stop() = 0; - public: +public: virtual int handle_devote_prepare(const ObElectionMsgDEPrepare& msg, obrpc::ObElectionRpcResult& result) = 0; virtual int handle_devote_vote(const ObElectionMsgDEVote& msg, obrpc::ObElectionRpcResult& result) = 0; virtual int handle_devote_success(const ObElectionMsgDESuccess& msg, obrpc::ObElectionRpcResult& result) = 0; @@ -79,7 +79,7 @@ class ObIElection : public common::LinkHashValue { virtual int handle_query_leader_response( const ObElectionQueryLeaderResponse& msg, obrpc::ObElectionRpcResult& result) = 0; - public: +public: virtual int set_candidate( const int64_t replica_num, const common::ObMemberList& curr_mlist, const int64_t membership_version) = 0; virtual int change_leader_async(const common::ObAddr& leader, common::ObTsWindows& changing_leader_windows) = 0; @@ -99,14 +99,14 @@ class ObIElection : public common::LinkHashValue { virtual int set_replica_num(const int64_t replica_num) = 0; virtual int64_t get_election_time_offset() const = 0; - public: +public: virtual int leader_takeover(const common::ObAddr& leader, const int64_t lease_start, int64_t& leader_epoch) = 0; virtual int64_t get_current_ts() const = 0; virtual int get_priority(ObElectionPriority& priority) const = 0; virtual int get_timestamp(int64_t& gts, common::ObAddr& leader) const = 0; virtual int64_t get_last_leader_revoke_time() const = 0; - public: +public: // for election group virtual int move_out_election_group(const ObElectionGroupId& eg_id) = 0; virtual int move_into_election_group(const ObElectionGroupId& eg_id) = 0; @@ -116,13 +116,13 @@ class ObIElection : public common::LinkHashValue { }; class ObIElectionTimerP { - public: +public: ObIElectionTimerP() {} virtual ~ObIElectionTimerP() {} - public: +public: virtual uint64_t hash() const = 0; virtual int64_t get_current_ts() const = 0; virtual void run_gt1_task(const int64_t expect_ts) = 0; @@ -135,77 +135,105 @@ class ObIElectionTimerP { class ObElection : public ObIElection, public ObIElectionTimerP, public ObElectionInfo { typedef ObElectionEventHistory::EventType EventType; + public: - ObElection() - : lock_(common::ObLatchIds::ELECTION_LOCK) - { reset(); } - ~ObElection() { destroy(); } - int init(const common::ObPartitionKey &partition, const common::ObAddr &self, - ObIElectionRpc *rpc, common::ObTimeWheel *tw, const int64_t replica_num, - ObIElectionCallback *election_cb, ObIElectionGroupMgr *eg_mgr, - ObElectionEventHistoryArray *event_history_array) override; + ObElection() : lock_(common::ObLatchIds::ELECTION_LOCK) + { + reset(); + } + ~ObElection() + { + destroy(); + } + int init(const common::ObPartitionKey& partition, const common::ObAddr& self, ObIElectionRpc* rpc, + common::ObTimeWheel* tw, const int64_t replica_num, ObIElectionCallback* election_cb, ObIElectionGroupMgr* eg_mgr, + ObElectionEventHistoryArray* event_history_array) override; void destroy() override; void reset(); int start() override; int stop() override; + public: - int handle_devote_prepare(const ObElectionMsgDEPrepare &msg, obrpc::ObElectionRpcResult &result) override; - int handle_devote_vote(const ObElectionMsgDEVote &msg, obrpc::ObElectionRpcResult &result) override; - int handle_devote_success(const ObElectionMsgDESuccess &msg, obrpc::ObElectionRpcResult &result) override; - int handle_vote_prepare(const ObElectionMsgPrepare &msg, obrpc::ObElectionRpcResult &result) override; - int handle_vote_vote(const ObElectionMsgVote &msg, obrpc::ObElectionRpcResult &result) override; - int handle_vote_success(const ObElectionMsgSuccess &msg, obrpc::ObElectionRpcResult &result) override; - int handle_query_leader(const ObElectionQueryLeader &msg, obrpc::ObElectionRpcResult &result) override; - int handle_query_leader_response(const ObElectionQueryLeaderResponse &msg,obrpc::ObElectionRpcResult &result) override; + int handle_devote_prepare(const ObElectionMsgDEPrepare& msg, obrpc::ObElectionRpcResult& result) override; + int handle_devote_vote(const ObElectionMsgDEVote& msg, obrpc::ObElectionRpcResult& result) override; + int handle_devote_success(const ObElectionMsgDESuccess& msg, obrpc::ObElectionRpcResult& result) override; + int handle_vote_prepare(const ObElectionMsgPrepare& msg, obrpc::ObElectionRpcResult& result) override; + int handle_vote_vote(const ObElectionMsgVote& msg, obrpc::ObElectionRpcResult& result) override; + int handle_vote_success(const ObElectionMsgSuccess& msg, obrpc::ObElectionRpcResult& result) override; + int handle_query_leader(const ObElectionQueryLeader& msg, obrpc::ObElectionRpcResult& result) override; + int handle_query_leader_response( + const ObElectionQueryLeaderResponse& msg, obrpc::ObElectionRpcResult& result) override; + public: - int set_candidate(const int64_t replica_num, const common::ObMemberList &curr_mlist, const int64_t membership_version) override; - int change_leader_async(const common::ObAddr &leader, common::ObTsWindows &changing_leader_windows) override; + int set_candidate( + const int64_t replica_num, const common::ObMemberList& curr_mlist, const int64_t membership_version) override; + int change_leader_async(const common::ObAddr& leader, common::ObTsWindows& changing_leader_windows) override; int change_leader_to_self_async() override; int force_leader_async() override; - int get_curr_candidate(common::ObMemberList &mlist) const override; - int get_valid_candidate(common::ObMemberList &mlist) const override; - int get_leader(common::ObAddr &leader, common::ObAddr &previous_leader, - int64_t &leader_epoch, bool &is_elected_by_changing_leader) const override; - int get_leader(common::ObAddr &leader, int64_t &leader_epoch, - bool &is_elected_by_changing_leader, common::ObTsWindows &changing_leader_windows) const override; - int get_current_leader(common::ObAddr &leader) const override; - int get_election_info(ObElectionInfo &election_info) const override; + int get_curr_candidate(common::ObMemberList& mlist) const override; + int get_valid_candidate(common::ObMemberList& mlist) const override; + int get_leader(common::ObAddr& leader, common::ObAddr& previous_leader, int64_t& leader_epoch, + bool& is_elected_by_changing_leader) const override; + int get_leader(common::ObAddr& leader, int64_t& leader_epoch, bool& is_elected_by_changing_leader, + common::ObTsWindows& changing_leader_windows) const override; + int get_current_leader(common::ObAddr& leader) const override; + int get_election_info(ObElectionInfo& election_info) const override; void leader_revoke(const uint32_t revoke_type) override; int inc_replica_num() override; int dec_replica_num() override; int set_replica_num(const int64_t replica_num) override; - int64_t get_election_time_offset() const override { return get_election_time_offset_(); } - static bool is_valid_leader_epoch(const int64_t leader_epoch) { return leader_epoch > 0; } -public: - int leader_takeover(const common::ObAddr &leader, const int64_t lease_start, int64_t &leader_epoch) override; - int64_t get_current_ts() const override; - int get_priority(ObElectionPriority &priority) const override; - int get_timestamp(int64_t >s, common::ObAddr &leader) const override; - int move_out_election_group(const ObElectionGroupId &eg_id) override; - int move_into_election_group(const ObElectionGroupId &eg_id) override; - int64_t get_replica_num() const override { return replica_num_; } - uint64_t get_eg_id_hash() const override { return eg_id_.hash(); } - const lease_t &get_leader_lease() const override { return leader_lease_; } - uint64_t hash() const override; - int64_t get_last_leader_revoke_time() const override { return ATOMIC_LOAD(&last_leader_revoke_time_); } + int64_t get_election_time_offset() const override + { + return get_election_time_offset_(); + } + static bool is_valid_leader_epoch(const int64_t leader_epoch) + { + return leader_epoch > 0; + } - public: +public: + int leader_takeover(const common::ObAddr& leader, const int64_t lease_start, int64_t& leader_epoch) override; + int64_t get_current_ts() const override; + int get_priority(ObElectionPriority& priority) const override; + int get_timestamp(int64_t& gts, common::ObAddr& leader) const override; + int move_out_election_group(const ObElectionGroupId& eg_id) override; + int move_into_election_group(const ObElectionGroupId& eg_id) override; + int64_t get_replica_num() const override + { + return replica_num_; + } + uint64_t get_eg_id_hash() const override + { + return eg_id_.hash(); + } + const lease_t& get_leader_lease() const override + { + return leader_lease_; + } + uint64_t hash() const override; + int64_t get_last_leader_revoke_time() const override + { + return ATOMIC_LOAD(&last_leader_revoke_time_); + } + +public: TO_STRING_AND_YSON(Y_(partition), Y_(is_running), Y_(is_changing_leader), Y_(self), Y_(proposal_leader), - OB_ID(cur_leader), current_leader_, Y_(curr_candidates), Y_(curr_membership_version), - Y_(leader_lease), Y_(election_time_offset), Y_(active_timestamp), Y_(T1_timestamp), - Y_(leader_epoch), Y_(state), Y_(role), Y_(stage), Y_(type), Y_(replica_num), - Y_(unconfirmed_leader), Y_(unconfirmed_leader_lease), Y_(takeover_t1_timestamp), Y_(is_need_query), - Y_(valid_candidates), Y_(change_leader_timestamp), Y_(ignore_log), - Y_(leader_revoke_timestamp), Y_(vote_period), Y_(lease_time), Y_(move_out_timestamp), - OB_ID(eg_part_array_idx), eg_part_array_idx_, OB_ID(eg_id_hash), eg_id_.hash()); + OB_ID(cur_leader), current_leader_, Y_(curr_candidates), Y_(curr_membership_version), Y_(leader_lease), + Y_(election_time_offset), Y_(active_timestamp), Y_(T1_timestamp), Y_(leader_epoch), Y_(state), Y_(role), + Y_(stage), Y_(type), Y_(replica_num), Y_(unconfirmed_leader), Y_(unconfirmed_leader_lease), + Y_(takeover_t1_timestamp), Y_(is_need_query), Y_(valid_candidates), Y_(change_leader_timestamp), Y_(ignore_log), + Y_(leader_revoke_timestamp), Y_(vote_period), Y_(lease_time), Y_(move_out_timestamp), OB_ID(eg_part_array_idx), + eg_part_array_idx_, OB_ID(eg_id_hash), eg_id_.hash()); + public: void run_gt1_task(const int64_t expect_ts) override; void run_gt2_task(const int64_t expect_ts) override; void run_gt3_task(const int64_t expect_ts) override; void run_gt4_task(const int64_t expect_ts) override; void run_change_leader_task(const int64_t expect_ts) override; + public: -/**********should removed after a barrier version bigger than 3.1**********/ + /**********should removed after a barrier version bigger than 3.1**********/ static bool IS_CLUSTER_MIN_VSERDION_LESS_THAN_3_1; /**************************************************************************************************/ enum RevokeType { @@ -231,7 +259,7 @@ public: }; static const char* const REVOKE_REASON_STR[RevokeType::REVOKE_TYPE_MAX]; class RevokeTypeChecker { - public: + public: static bool is_unexpected_revoke_type(const uint32_t revoke_type) { return (CLUSTER_ROLE_SWITCH != revoke_type && STANDBY_RESTORE_FAIL != revoke_type && @@ -239,7 +267,7 @@ public: } }; - private: +private: int process_devote_prepare_(const ObElectionMsgDEPrepare& msg); int process_devote_vote_(const ObElectionMsgDEVote& msg); int process_devote_success_(const ObElectionMsgDESuccess& msg); @@ -272,7 +300,7 @@ public: int send_devote_success_(const ObElectionMsgDESuccess& msg); int send_vote_success_(const ObElectionMsgSuccess& msg); - private: +private: int try_stop_(); int change_leader_async_(const common::ObAddr& server, common::ObTsWindows& changing_leader_windows); int force_leader_async_(); @@ -321,7 +349,7 @@ public: bool is_clockdiff_error_(); bool verify_lease_start_valid_(const common::ObAddr& leader, const int64_t lease_start_t1) const; - private: +private: int post_election_msg_( const common::ObMemberList& mlist, const common::ObPartitionKey& partition, const ObElectionMsg& msg); int post_election_msg_( @@ -339,7 +367,7 @@ public: int64_t real_ts_(int64_t logic_ts) const; int64_t logic_ts_(int64_t real_ts) const; - private: +private: static const int64_t ACTIVE_TIME_DELTA = 0; static const int64_t MAX_WATCHER = 16; /**********should removed after a barrier version bigger than 3.1**********/ @@ -359,7 +387,7 @@ public: typedef common::RWLock::WLockGuard WLockGuard; mutable common::RWLock lock_; #endif - private: +private: bool is_inited_; bool is_need_query_; bool is_reappoint_period_; diff --git a/src/election/ob_election_async_log.h b/src/election/ob_election_async_log.h index c9c73d66c..69e9698c4 100644 --- a/src/election/ob_election_async_log.h +++ b/src/election/ob_election_async_log.h @@ -35,7 +35,7 @@ namespace election { template class ObRingBuffer { - public: +public: ObRingBuffer() : destroyed_(false), size_(size), start_(0), end_(0) { memset(&elems_, 0, sizeof(elems_)); @@ -45,7 +45,7 @@ class ObRingBuffer { destroy(); } - public: +public: bool is_full(void) const { return (end_ + 1) % size_ == start_; @@ -59,7 +59,7 @@ class ObRingBuffer { int pop(Type& elem); void destroy(); - private: +private: bool destroyed_; int size_; int start_; @@ -136,7 +136,7 @@ void ObRingBuffer::destroy() } class ObLogItem { - public: +public: static const int64_t MAX_LOG_SIZE = 4096; ObLogItem(const char* buf = NULL, int64_t size = 0, int log_level = OB_LOG_LEVEL_NONE); @@ -150,7 +150,7 @@ class ObLogItem { reset(); } - public: +public: char* get_buf() { return buf_; @@ -177,17 +177,17 @@ class ObLogItem { } ObLogItem& operator=(const ObLogItem& item); - public: +public: static const int64_t OP_LOCAL_NUM = 4; - private: +private: int64_t size_; int log_level_; char buf_[MAX_LOG_SIZE]; }; class ObLogItemFactory { - public: +public: static ObLogItem* alloc(); static void release(ObLogItem* item); static int64_t alloc_count_; @@ -195,14 +195,14 @@ class ObLogItemFactory { }; class ObLogFile { - public: +public: ObLogFile(); virtual ~ObLogFile() { close(); } - public: +public: int open(const char* log_file); int close(); int write(const char* buf, const int64_t len); @@ -221,7 +221,7 @@ class ObLogFile { return last_log_time; } - private: +private: char fname_[common::OB_MAX_FILE_NAME_LENGTH]; int fd_; struct stat stat_; @@ -361,14 +361,14 @@ class ObLogFile { } class ObAsyncLog : public share::ObThreadPool { - public: +public: ObAsyncLog(); virtual ~ObAsyncLog() { destroy(); } - public: +public: static ObAsyncLog& getLogger(void); int init(const char* fname, const int level, const bool open_wf); void destroy(void); @@ -405,7 +405,7 @@ class ObAsyncLog : public share::ObThreadPool { log_warn_ = log_warn; } - public: +public: void async_log_message_kv(const char* mod_name, const int level, const char* levelstr, const char* file, const int32_t line, const char* func, const char* fmt, ...); DEFINE_ASYNC_LOG_PRINT_KV(1); @@ -425,17 +425,17 @@ class ObAsyncLog : public share::ObThreadPool { DEFINE_ASYNC_LOG_PRINT_KV(15); DEFINE_ASYNC_LOG_PRINT_KV(16); - private: +private: void run1() final; void do_flush_log_(void); int logdata_print_info_(char* buf, int64_t& pos, const char* mod_name, const int level, const char* levelstr, const char* file, const int32_t line, const char* func, const int64_t last_log_time); - public: +public: static const int64_t OB_MAX_LOG_ITEM_COUNT = 81920; static const int64_t OB_MAX_LOG_PER_SEC = 1000; - private: +private: typedef ObRingBuffer ObLogBuffer; bool is_inited_; bool destroyed_; diff --git a/src/election/ob_election_cb.h b/src/election/ob_election_cb.h index 4989fa132..4892ba215 100644 --- a/src/election/ob_election_cb.h +++ b/src/election/ob_election_cb.h @@ -26,13 +26,13 @@ class ObElectionPriority; class ObElectionGroupPriority; class ObIElectionCallback { - public: +public: ObIElectionCallback() {} virtual ~ObIElectionCallback() {} - public: +public: // when role change // virtual int on_role_change(const ObElectionRole &role) = 0; // when get election priority @@ -48,13 +48,13 @@ class ObIElectionCallback { }; class ObIElectionGroupPriorityGetter { - public: +public: ObIElectionGroupPriorityGetter() {} virtual ~ObIElectionGroupPriorityGetter() {} - public: +public: virtual int get_election_group_priority(const uint64_t tenant_id, ObElectionGroupPriority& priority) const = 0; }; diff --git a/src/election/ob_election_event_history.h b/src/election/ob_election_event_history.h index 918029016..697128032 100644 --- a/src/election/ob_election_event_history.h +++ b/src/election/ob_election_event_history.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace election { class ObElectionEventHistory { - public: +public: ObElectionEventHistory() { reset(); @@ -35,7 +35,7 @@ class ObElectionEventHistory { reset(); } - public: +public: int64_t get_timestamp() const { return timestamp_; @@ -60,7 +60,7 @@ class ObElectionEventHistory { const char* get_event_info_cstr() const; TO_STRING_KV(K_(partition), K_(addr), K_(current_leader), K_(event_type)); - public: +public: enum EventType { EVENT_MIN = 0, L_TAKEOVER_ASSIGN, @@ -80,7 +80,7 @@ class ObElectionEventHistory { return (etype >= EVENT_MIN && etype <= EVENT_MAX); } - public: +public: int64_t timestamp_; common::ObPartitionKey partition_; common::ObAddr addr_; @@ -91,7 +91,7 @@ class ObElectionEventHistory { class ObElectionEventHistoryArray { typedef ObElectionEventHistory::EventType EventType; - public: +public: ObElectionEventHistoryArray() : array_(NULL), self_(), is_inited_(false), idx_(0) {} ~ObElectionEventHistoryArray() @@ -101,7 +101,7 @@ class ObElectionEventHistoryArray { void destroy(); int init(const common::ObAddr& self); - public: +public: int32_t get_event_cursor() const { return ATOMIC_LOAD(&idx_); @@ -110,15 +110,15 @@ class ObElectionEventHistoryArray { const common::ObPartitionKey& pkey, const common::ObAddr& current_leader, const EventType etype); int get_prev_event_history(const int64_t now, int32_t& idx, ObElectionEventHistory& event_history) const; - public: +public: static const int64_t OB_ELECT_EVENT_ITEM_NUM = 50000 * 5; // 5w partitions, 5 records each - private: +private: ObElectionEventHistory* array_; common::ObAddr self_; bool is_inited_; int32_t idx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObElectionEventHistoryArray); }; diff --git a/src/election/ob_election_gc_thread.h b/src/election/ob_election_gc_thread.h index 9ea70f481..3527d93e0 100644 --- a/src/election/ob_election_gc_thread.h +++ b/src/election/ob_election_gc_thread.h @@ -22,11 +22,11 @@ namespace election { class ObElectionGroupMgr; class ObElectionGCThread : public share::ObThreadPool { - public: +public: ObElectionGCThread(); ~ObElectionGCThread(); - public: +public: int init(ObElectionGroupMgr* eg_mgr); int start(); void stop(); @@ -34,17 +34,17 @@ class ObElectionGCThread : public share::ObThreadPool { void destroy(); void run1(); - private: +private: int exec_gc_loop_(); - private: +private: static const int32_t ELECT_GC_INTERVAL = 60 * 1000 * 1000; - private: +private: ObElectionGroupMgr* eg_mgr_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObElectionGCThread); }; } // namespace election diff --git a/src/election/ob_election_group.h b/src/election/ob_election_group.h index f2d8f5ad0..5dc95e4bf 100644 --- a/src/election/ob_election_group.h +++ b/src/election/ob_election_group.h @@ -50,7 +50,7 @@ class ObElectionGroupInfo; class ObElectionGroupCache; class ObIElectionGroup : public common::LinkHashValue { - public: +public: ObIElectionGroup() {} virtual ~ObIElectionGroup() @@ -67,7 +67,7 @@ class ObIElectionGroup : public common::LinkHashValue lease_t; class ObElectionGroupId { OB_UNIS_VERSION(1); - public: +public: ObElectionGroupId() : server_(), create_time_(common::OB_INVALID_TIMESTAMP), hash_val_(0) {} ~ObElectionGroupId() @@ -62,10 +62,10 @@ class ObElectionGroupId { TO_STRING_AND_YSON(OB_ID(eg_id_hash), hash_val_, Y_(server), Y_(create_time)); - private: +private: uint64_t cal_hash_() const; - private: +private: common::ObAddr server_; int64_t create_time_; uint64_t hash_val_; diff --git a/src/election/ob_election_group_info.h b/src/election/ob_election_group_info.h index 5ef5926e4..539d4206d 100644 --- a/src/election/ob_election_group_info.h +++ b/src/election/ob_election_group_info.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace election { class ObElectionGroupInfo { - public: +public: ObElectionGroupInfo() { reset(); @@ -37,7 +37,7 @@ class ObElectionGroupInfo { } void reset(); - public: +public: bool is_running() const { return is_running_; @@ -200,7 +200,7 @@ class ObElectionGroupInfo { K_(replica_num), K_(takeover_t1_timestamp), K_(T1_timestamp), K_(leader_lease), K_(role), K_(state), K_(pre_destroy_state)); - private: +private: bool is_running_; ObElectionGroupId eg_id_; int64_t eg_version_; diff --git a/src/election/ob_election_group_mgr.h b/src/election/ob_election_group_mgr.h index 59faae58a..8fc0a78af 100644 --- a/src/election/ob_election_group_mgr.h +++ b/src/election/ob_election_group_mgr.h @@ -34,7 +34,7 @@ typedef common::ObSimpleIterator Node; static ObIElectionGroup* alloc_value() @@ -68,7 +68,7 @@ class ElectionGroupAllocHandle { }; class ObIElectionGroupMgr { - public: +public: ObIElectionGroupMgr() {} virtual ~ObIElectionGroupMgr() @@ -80,7 +80,7 @@ class ObIElectionGroupMgr { virtual int start() = 0; virtual int stop() = 0; - public: +public: virtual ObIElectionGroup* get_election_group(const ObElectionGroupId& eg_id) const = 0; virtual int revert_election_group(ObIElectionGroup* election_group) = 0; virtual int assign_election_group(const common::ObPartitionKey& pkey, const common::ObAddr& part_leader, @@ -92,7 +92,7 @@ class ObIElectionGroupMgr { }; class ObElectionGroupMgr : public ObIElectionGroupMgr { - public: +public: ObElectionGroupMgr() { reset(); @@ -108,7 +108,7 @@ class ObElectionGroupMgr : public ObIElectionGroupMgr { int start(); int stop(); - public: +public: ObIElectionGroup* get_election_group(const ObElectionGroupId& eg_id) const; int get_election_group_cache(ObElectionGroupCache*& cache); // for now, just for unit test int revert_election_group(ObIElectionGroup* election_group); @@ -121,14 +121,14 @@ class ObElectionGroupMgr : public ObIElectionGroupMgr { int iterate_election_group_info(ObElectionGroupInfoIterator& eg_info_iter); int exec_gc_loop(); - private: +private: int stop_(); int create_new_eg_leader_(const ObElectionGroupId& eg_id, const uint64_t tenant_id, const common::ObMemberList& member_list, const int64_t replica_num); int create_new_eg_follower_(const ObElectionGroupId& eg_id, const uint64_t tenant_id); int get_create_time_(int64_t& create_time); - private: +private: typedef common::DRWLock::WRLockGuard WRLockGuard; typedef common::DRWLock::RDLockGuard RDLockGuard; template @@ -137,7 +137,7 @@ class ObElectionGroupMgr : public ObIElectionGroupMgr { return election_group_map_.for_each(fn); } - private: +private: bool is_inited_; bool is_running_; common::ObAddr self_; @@ -151,23 +151,23 @@ class ObElectionGroupMgr : public ObIElectionGroupMgr { }; class IterateElectionGroupFunctor { - public: +public: explicit IterateElectionGroupFunctor(ObElectionGroupInfoIterator& eg_info_iter) : eg_info_iter_(eg_info_iter) {} bool operator()(const ObElectionGroupId& eg_id, ObIElectionGroup* eg); - private: +private: ObElectionGroupInfoIterator& eg_info_iter_; }; class EgGCFunctor { - public: +public: typedef common::ObSEArray EgIdArray; explicit EgGCFunctor(EgIdArray& gc_candidates) : gc_candidates_(gc_candidates) {} bool operator()(const ObElectionGroupId& eg_id, ObIElectionGroup* eg); - private: +private: EgIdArray& gc_candidates_; }; diff --git a/src/election/ob_election_group_msg_pool.h b/src/election/ob_election_group_msg_pool.h index 8a1c19b42..ca0707fa9 100644 --- a/src/election/ob_election_group_msg_pool.h +++ b/src/election/ob_election_group_msg_pool.h @@ -31,10 +31,10 @@ class ObElection; template class ObElectionVoteMsgArray { - public: +public: static const int64_t OB_MAX_ELECTION_MSG_COUNT = 2 * common::OB_MAX_MEMBER_NUMBER; - public: +public: ObElectionVoteMsgArray() { reset(); @@ -52,7 +52,7 @@ class ObElectionVoteMsgArray { reset(); } - public: +public: int set_msg(const int64_t idx, const T& msg); int push_msg(const T& msg); int get_msg(const int64_t idx, T& msg) const; @@ -62,7 +62,7 @@ class ObElectionVoteMsgArray { } int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: T msg_array_[OB_MAX_ELECTION_MSG_COUNT]; int64_t msg_count_; }; @@ -138,7 +138,7 @@ int64_t ObElectionVoteMsgArray::to_string(char* buf, const int64_t buf_len) c } class ObEGVoteMsgPool { - public: +public: ObEGVoteMsgPool() : lock_(common::ObLatchIds::ELECTION_MSG_LOCK) { reset(); @@ -159,7 +159,7 @@ class ObEGVoteMsgPool { const int64_t t1, const uint64_t eg_hash, const int64_t cur_ts); int get_eg_centralized_candidate(common::ObAddr& cur_leader, common::ObAddr& new_leader, const int64_t t1); - public: +public: ObElectionVoteMsgArray& get_eg_prepare_msg_array() { return eg_prepare_array_; @@ -170,7 +170,7 @@ class ObEGVoteMsgPool { } TO_STRING_KV(K_(eg_prepare_array), K_(eg_vote_array)); - private: +private: int get_eg_centralized_majority_(common::ObAddr& cur_leader, common::ObAddr& new_leader, const bool is_all_part_merged_in, bool& is_eg_majority, ObPartStateArray& part_state_array, const common::ObPartitionArray& partition_array, const int64_t self_version, const int64_t replica_num, @@ -182,15 +182,15 @@ class ObEGVoteMsgPool { int process_vote_cnt_(const int64_t eg_vote_cnt, const int64_t replica_num, ObPartStateArray& part_state_array, bool& is_eg_majority, const int64_t cur_ts); - private: +private: int store_(const ObElectionMsgEGPrepare& msg); int store_(const ObElectionMsgEGVote4Store& msg); - private: +private: template int do_store_(const T& msg, ObElectionVoteMsgArray& array); - private: +private: ObElectionVoteMsgArray eg_prepare_array_; ObElectionVoteMsgArray eg_vote_array_; mutable common::ObSpinLock lock_; diff --git a/src/election/ob_election_group_priority.h b/src/election/ob_election_group_priority.h index d44202923..df6de3d68 100644 --- a/src/election/ob_election_group_priority.h +++ b/src/election/ob_election_group_priority.h @@ -25,7 +25,7 @@ namespace election { class ObElectionGroupPriority { OB_UNIS_VERSION(1); - public: +public: ObElectionGroupPriority() { reset(); @@ -35,7 +35,7 @@ class ObElectionGroupPriority { {} void reset(); - public: +public: void set_candidate(const bool is_candidate) { is_candidate_ = is_candidate; @@ -58,12 +58,12 @@ class ObElectionGroupPriority { DECLARE_TO_STRING_AND_YSON; - private: +private: const static int64_t SYSTEM_SCORE_CLOG_DISK_ERROR = (1 << 6); const static int64_t SYSTEM_SCORE_DATA_DISK_ERROR = (1 << 4); const static int64_t SYSTEM_SCORE_SERVICE_NOT_STARTED = (1 << 1); - private: +private: bool is_candidate_; int64_t system_score_; // lower score means higher priority }; diff --git a/src/election/ob_election_info.h b/src/election/ob_election_info.h index bb16b9858..c9aafa56b 100644 --- a/src/election/ob_election_info.h +++ b/src/election/ob_election_info.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace election { class ObElectionInfo { - public: +public: ObElectionInfo() { reset(); @@ -39,7 +39,7 @@ class ObElectionInfo { reset(); } - public: +public: const common::ObAddr& get_self() const { return self_; @@ -138,9 +138,9 @@ class ObElectionInfo { K_(election_time_offset), K_(active_timestamp), K_(T1_timestamp), K_(leader_epoch), K_(state), K_(role), K_(stage), K_(type), K_(change_leader_timestamp), K_(eg_id), K_(last_leader_revoke_time)); - public: +public: class State { - public: + public: static const int32_t INVALID = -1; static const int32_t D_IDLE = 0; static const int32_t V_IDLE = 1; @@ -160,7 +160,7 @@ class ObElectionInfo { static const int32_t V_SUCCESS = 12; static const int32_t MAX = 13; - public: + public: static bool is_valid(const int32_t state) { return state > INVALID && state < MAX; @@ -176,7 +176,7 @@ class ObElectionInfo { }; class Ops { - public: + public: static const int32_t INVALID = -1; static const int32_t RESET = 0; static const int32_t D_ELECT = 1; @@ -194,7 +194,7 @@ class ObElectionInfo { static const int32_t LEADER_REVOKE = 13; static const int32_t MAX = 14; - public: + public: static bool is_valid(const int32_t state) { return state > INVALID && state < MAX; @@ -202,24 +202,24 @@ class ObElectionInfo { }; class StateHelper { - public: + public: explicit StateHelper(int32_t& state) : state_(state) {} ~StateHelper() {} int switch_state(const int32_t op); - private: + private: int32_t& state_; }; - protected: +protected: bool is_self_(const common::ObAddr& addr) const { return self_ == addr; } - protected: +protected: bool is_running_; // mark need change leader or not bool need_change_leader_; diff --git a/src/election/ob_election_mem_stat.h b/src/election/ob_election_mem_stat.h index 819f7e4b7..fbc96802d 100644 --- a/src/election/ob_election_mem_stat.h +++ b/src/election/ob_election_mem_stat.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace election { class ObElectionMemStat { - public: +public: ObElectionMemStat() { reset(); @@ -33,7 +33,7 @@ class ObElectionMemStat { void reset(); void destroy(); - public: +public: const char* get_type_name() const { return type_name_; @@ -54,10 +54,10 @@ class ObElectionMemStat { TO_STRING_KV("type_name", type_name_, K_(alloc_count), K_(release_count)); - public: +public: static const int64_t OB_ELECTION_TYPE_NAME_LENGTH = 64; - private: +private: common::ObAddr addr_; char type_name_[OB_ELECTION_TYPE_NAME_LENGTH]; int64_t alloc_count_; diff --git a/src/election/ob_election_mgr.h b/src/election/ob_election_mgr.h index 36a7f1bee..edaa42b52 100644 --- a/src/election/ob_election_mgr.h +++ b/src/election/ob_election_mgr.h @@ -65,7 +65,7 @@ typedef common::ObSimpleIterator Node; static int64_t TOTAL_RELEASE_COUNT; // for unittest @@ -154,7 +154,7 @@ class ElectionAllocHandle { template class ObPointerCache { - public: +public: ObPointerCache() { reset(); @@ -193,12 +193,12 @@ class ObPointerCache { return common::OB_SUCCESS; } - private: +private: T* cache_[CACHE_NUM]; }; class ObElectionMgr : public ObIElectionMgr { - public: +public: // typedef common::ObConcurrentHashMap ElectionMap; static int64_t TOTAL_ADD_COUNT; static int64_t TOTAL_REMOVE_COUNT; @@ -225,7 +225,7 @@ class ObElectionMgr : public ObIElectionMgr { int wait(); int stop(); - public: +public: int add_partition(const common::ObPartitionKey& partition, const int64_t replica_num, ObIElectionCallback* election_cb, ObIElection*& election); int remove_partition(const common::ObPartitionKey& partition); @@ -235,12 +235,12 @@ class ObElectionMgr : public ObIElectionMgr { int leader_revoke(const common::ObPartitionKey& partition, const uint32_t revoke_type); int revoke_all(const uint32_t revoke_type); - public: +public: int handle_election_group_req(int msg_type, const char* buf, int64_t limit); int handle_election_req(int msg_type, common::ObPartitionKey& pkey, const char* buf, int64_t limit); int handle_election_msg(const ObElectionMsgBuffer& msgbuf, obrpc::ObElectionRpcResult& result); - public: +public: int set_candidate(const common::ObPartitionKey& partition, const int64_t replica_num, const common::ObMemberList& curr_mlist, const int64_t membership_version); int get_curr_candidate(const common::ObPartitionKey& partition, common::ObMemberList& mlist) const; @@ -262,13 +262,13 @@ class ObElectionMgr : public ObIElectionMgr { // int get_election(const common::ObPartitionKey &partition, ObIElection *&election) const; void revert_election(const ObIElection* election) const; - private: +private: static const int64_t TIMER_THREAD_COUNT = 6; // precision of time wheel is 1000us static const int64_t TIME_WHEEL_PRECISION_US = 1000; static const int64_t CACHE_NUM = 17313; - private: +private: ObIElection* get_election_(const common::ObPartitionKey& partition) const; void revert_election_(const ObIElection* election) const; template @@ -289,16 +289,16 @@ class ObElectionMgr : public ObIElectionMgr { int handle_election_msg_unlock_(int msg_type, ObPartitionKey& partition, const char* buf, const int64_t limit, int64_t& pos, obrpc::ObElectionRpcResult& result); - protected: +protected: ObIElectionRpc* rpc_; - private: +private: typedef common::RWLock RWLock; typedef RWLock::RLockGuard RDLockGuard; typedef RWLock::WLockGuard WRLockGuard; typedef RWLock::RLockGuardWithTimeout RDLockGuardWithTimeout; - private: +private: bool is_inited_; bool is_running_; ElectionMap election_map_; @@ -313,27 +313,27 @@ class ObElectionMgr : public ObIElectionMgr { }; class IterateElectionFunctor { - public: +public: explicit IterateElectionFunctor(ObElectionInfoIterator& election_info_iter) : election_info_iter_(election_info_iter) {} bool operator()(const common::ObPartitionKey& partition, ObIElection* e); - private: +private: ObElectionInfoIterator& election_info_iter_; }; class RevokeElectionFunctor { - public: +public: explicit RevokeElectionFunctor(const uint32_t revoke_type) : revoke_type_(revoke_type) {} bool operator()(const common::ObPartitionKey& partition, ObIElection* e); - private: +private: uint32_t revoke_type_; }; class GetElectionStatusFunctor { - public: +public: explicit GetElectionStatusFunctor() : total_num_(0), inactive_num_(0) {} bool operator()(const common::ObPartitionKey& partition, ObIElection* e); @@ -346,7 +346,7 @@ class GetElectionStatusFunctor { return inactive_num_; } - private: +private: int64_t total_num_; int64_t inactive_num_; }; diff --git a/src/election/ob_election_msg.h b/src/election/ob_election_msg.h index 257bf8f9f..f6012b584 100644 --- a/src/election/ob_election_msg.h +++ b/src/election/ob_election_msg.h @@ -56,13 +56,13 @@ enum ObElectionMsgType { }; class ObElectionMsgTypeChecker { - private: +private: ObElectionMsgTypeChecker() {} ~ObElectionMsgTypeChecker() {} - public: +public: static bool is_valid_msg_type(const int msg_type) { return ((OB_ELECTION_DEVOTE_PREPARE <= msg_type && OB_ELECTION_EG_DESTROY >= msg_type) || @@ -82,7 +82,7 @@ class ObElectionMsgTypeChecker { class ObElectionMsgBuffer : public common::ObDataBuffer { OB_UNIS_VERSION_V(1); - public: +public: ObElectionMsgBuffer() { (void)set_data(buf_, MAX_MSGBUF_SIZE); @@ -92,10 +92,10 @@ class ObElectionMsgBuffer : public common::ObDataBuffer { TO_STRING_KV(K_(capacity), K_(position), K_(limit)); - public: +public: static const int64_t MAX_MSGBUF_SIZE = 8192 - 256; - private: +private: char buf_[MAX_MSGBUF_SIZE]; }; @@ -103,7 +103,7 @@ class ObElectionMsgBuffer : public common::ObDataBuffer { class ObElectionMsg : public obrpc::ObIFill { OB_UNIS_VERSION_V(1); - public: +public: ObElectionMsg() : msg_type_(UNKNOWN_TYPE), send_timestamp_(0), reserved_(0) {} ObElectionMsg(const int msg_type, const int64_t send_ts, const common::ObAddr& sender) @@ -150,7 +150,7 @@ class ObElectionMsg : public obrpc::ObIFill { virtual int64_t to_string(char* buf, const int64_t buf_len) const; VIRTUAL_TO_YSON_KV(Y_(msg_type), Y_(send_timestamp), Y_(sender)); - protected: +protected: int msg_type_; int64_t send_timestamp_; int64_t reserved_; @@ -161,7 +161,7 @@ class ObElectionMsg : public obrpc::ObIFill { class ObElectionVoteMsg : public ObElectionMsg { OB_UNIS_VERSION_V(1); - public: +public: ObElectionVoteMsg() : T1_timestamp_(0) {} ObElectionVoteMsg(const int msg_type, const int64_t send_ts, const common::ObAddr& sender, const int64_t t1) @@ -170,7 +170,7 @@ class ObElectionVoteMsg : public ObElectionMsg { ~ObElectionVoteMsg() {} - public: +public: int64_t get_T1_timestamp() const { return T1_timestamp_; @@ -185,7 +185,7 @@ class ObElectionVoteMsg : public ObElectionMsg { virtual int64_t to_string(char* buf, const int64_t buf_len) const; VIRTUAL_TO_YSON_KV(Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp)); - protected: +protected: int64_t T1_timestamp_; }; @@ -193,7 +193,7 @@ class ObElectionVoteMsg : public ObElectionMsg { class ObElectionMsgDEPrepare : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgDEPrepare() : lease_time_(0) {} ObElectionMsgDEPrepare(const ObElectionPriority& priority, const int64_t t1, const int64_t send_ts, @@ -225,7 +225,7 @@ class ObElectionMsgDEPrepare : public ObElectionVoteMsg { int64_t to_string(char* buf, const int64_t buf_len) const; TO_YSON_KV(Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), Y_(lease_time), Y_(priority)); - private: +private: ObElectionPriority priority_; int64_t lease_time_; }; @@ -234,7 +234,7 @@ class ObElectionMsgDEPrepare : public ObElectionVoteMsg { class ObElectionMsgDEVote : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgDEVote() {} ObElectionMsgDEVote( @@ -255,7 +255,7 @@ class ObElectionMsgDEVote : public ObElectionVoteMsg { int64_t to_string(char* buf, const int64_t buf_len) const; TO_YSON_KV(Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), Y_(vote_leader)); - private: +private: common::ObAddr vote_leader_; }; @@ -263,7 +263,7 @@ class ObElectionMsgDEVote : public ObElectionVoteMsg { class ObElectionMsgDESuccess : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgDESuccess() : lease_time_(0) {} ObElectionMsgDESuccess(const common::ObAddr& leader, const int64_t t1, const int64_t send_ts, @@ -287,7 +287,7 @@ class ObElectionMsgDESuccess : public ObElectionVoteMsg { int64_t to_string(char* buf, const int64_t buf_len) const; TO_YSON_KV(Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(lease_time), Y_(T1_timestamp), Y_(leader)); - private: +private: common::ObAddr leader_; int64_t lease_time_; }; @@ -296,7 +296,7 @@ class ObElectionMsgDESuccess : public ObElectionVoteMsg { class ObElectionMsgPrepare : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgPrepare() : lease_time_(0) {} ObElectionMsgPrepare(const common::ObAddr& cur_leader, const common::ObAddr& new_leader, const int64_t t1, @@ -331,7 +331,7 @@ class ObElectionMsgPrepare : public ObElectionVoteMsg { TO_YSON_KV( Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), Y_(cur_leader), Y_(new_leader), Y_(lease_time)); - private: +private: common::ObAddr cur_leader_; common::ObAddr new_leader_; int64_t lease_time_; @@ -341,7 +341,7 @@ class ObElectionMsgPrepare : public ObElectionVoteMsg { class ObElectionMsgVote : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgVote() {} ObElectionMsgVote(const ObElectionPriority& priority, const common::ObAddr& cur_leader, @@ -376,7 +376,7 @@ class ObElectionMsgVote : public ObElectionVoteMsg { TO_YSON_KV( Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), Y_(priority), Y_(cur_leader), Y_(new_leader)); - private: +private: ObElectionPriority priority_; common::ObAddr cur_leader_; common::ObAddr new_leader_; @@ -386,7 +386,7 @@ class ObElectionMsgVote : public ObElectionVoteMsg { class ObElectionMsgSuccess : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgSuccess() : lease_time_(0), last_gts_(common::OB_INVALID_TIMESTAMP), last_leader_epoch_(common::OB_INVALID_TIMESTAMP) {} @@ -423,7 +423,7 @@ class ObElectionMsgSuccess : public ObElectionVoteMsg { TO_YSON_KV( Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), Y_(cur_leader), Y_(new_leader), Y_(lease_time)); - private: +private: common::ObAddr cur_leader_; common::ObAddr new_leader_; int64_t lease_time_; @@ -435,14 +435,14 @@ class ObElectionMsgSuccess : public ObElectionVoteMsg { class ObElectionQueryLeader : public ObElectionMsg { OB_UNIS_VERSION_V(1); - public: +public: ObElectionQueryLeader() {} ObElectionQueryLeader(const int64_t send_ts, const common::ObAddr& sender); ~ObElectionQueryLeader() {} - public: +public: bool is_valid() const; int64_t to_string(char* buf, const int64_t buf_len) const; TO_YSON_KV(Y_(msg_type), Y_(send_timestamp), Y_(sender)); @@ -452,7 +452,7 @@ class ObElectionQueryLeader : public ObElectionMsg { class ObElectionQueryLeaderResponse : public ObElectionMsg { OB_UNIS_VERSION_V(1); - public: +public: ObElectionQueryLeaderResponse() : epoch_(0), t1_(0), lease_time_(0) {} ObElectionQueryLeaderResponse(const int64_t send_ts, const common::ObAddr& sender, const common::ObAddr& leader, @@ -460,7 +460,7 @@ class ObElectionQueryLeaderResponse : public ObElectionMsg { ~ObElectionQueryLeaderResponse() {} - public: +public: const common::ObAddr& get_leader() const { return leader_; @@ -482,7 +482,7 @@ class ObElectionQueryLeaderResponse : public ObElectionMsg { int64_t to_string(char* buf, const int64_t buf_len) const; TO_YSON_KV(Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(leader), Y_(epoch), Y_(t1), Y_(lease_time)); - private: +private: common::ObAddr leader_; int64_t epoch_; int64_t t1_; @@ -493,7 +493,7 @@ class ObElectionQueryLeaderResponse : public ObElectionMsg { class ObElectionMsgEGPrepare : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgEGPrepare() : lease_time_(0) {} ObElectionMsgEGPrepare(const common::ObAddr& cur_leader, const common::ObAddr& new_leader, const int64_t t1, @@ -518,7 +518,7 @@ class ObElectionMsgEGPrepare : public ObElectionVoteMsg { TO_YSON_KV( Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), Y_(cur_leader), Y_(new_leader), Y_(lease_time)); - private: +private: common::ObAddr cur_leader_; common::ObAddr new_leader_; int64_t lease_time_; @@ -529,7 +529,7 @@ class ObElectionMsgEGPrepare : public ObElectionVoteMsg { class ObElectionMsgEGVote : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgEGVote() {} ObElectionMsgEGVote(const ObElectionMsgEGVote& msg); @@ -554,7 +554,7 @@ class ObElectionMsgEGVote : public ObElectionVoteMsg { TO_YSON_KV( Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), Y_(priority), Y_(cur_leader), Y_(new_leader)); - protected: +protected: ObElectionGroupPriority priority_; common::ObAddr cur_leader_; common::ObAddr new_leader_; @@ -562,7 +562,7 @@ class ObElectionMsgEGVote : public ObElectionVoteMsg { // stored vote messages on leader class ObElectionMsgEGVote4Store : public ObElectionMsgEGVote { - public: +public: ObElectionMsgEGVote4Store() : eg_version_(0) {} ObElectionMsgEGVote4Store(const ObElectionMsgEGVote& eg_vote_msg); @@ -590,7 +590,7 @@ class ObElectionMsgEGVote4Store : public ObElectionMsgEGVote { TO_YSON_KV(Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), OB_ID(priority), get_priority(), OB_ID(cur_leader), get_cur_leader(), OB_ID(new_leader), get_new_leader(), Y_(eg_version)); - protected: +protected: int64_t eg_version_; common::ObPartitionArray vote_part_array_; }; @@ -599,7 +599,7 @@ class ObElectionMsgEGVote4Store : public ObElectionMsgEGVote { class ObElectionMsgEGSuccess : public ObElectionVoteMsg { OB_UNIS_VERSION(1); - public: +public: ObElectionMsgEGSuccess() : is_all_part_merged_in_(false), lease_time_(0) {} ObElectionMsgEGSuccess(const common::ObAddr& cur_leader, const common::ObAddr& new_leader, const int64_t t1, @@ -633,7 +633,7 @@ class ObElectionMsgEGSuccess : public ObElectionVoteMsg { TO_YSON_KV( Y_(msg_type), Y_(send_timestamp), Y_(sender), Y_(T1_timestamp), Y_(cur_leader), Y_(new_leader), Y_(lease_time)); - private: +private: common::ObAddr cur_leader_; common::ObAddr new_leader_; bool is_all_part_merged_in_; @@ -642,7 +642,7 @@ class ObElectionMsgEGSuccess : public ObElectionVoteMsg { }; class ObEGBatchReq : public obrpc::ObIFill { - public: +public: ObEGBatchReq() { reset(); @@ -661,7 +661,7 @@ class ObEGBatchReq : public obrpc::ObIFill { virtual int fill_buffer(char* buf, int64_t size, int64_t& filled_size) const; virtual int64_t get_req_size() const; - private: +private: int64_t eg_version_; const char* array_buf_; int64_t buf_ser_size_; diff --git a/src/election/ob_election_msg_pool.h b/src/election/ob_election_msg_pool.h index a6fe75285..43a896e90 100644 --- a/src/election/ob_election_msg_pool.h +++ b/src/election/ob_election_msg_pool.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace election { class ObIElection; class ObElectionVoteMsgPool { - public: +public: ObElectionVoteMsgPool() : election_(nullptr), deprepare_recorder_(election_, partition_), @@ -60,11 +60,11 @@ class ObElectionVoteMsgPool { int get_centralized_candidate(common::ObAddr& cur_leader, common::ObAddr& new_leader, // get the leader vote for const int64_t t1); - private: +private: class MsgRecorder { static const int64_t OB_MAX_ELECTION_MSG_COUNT = common::OB_MAX_MEMBER_NUMBER / 2 + 1; - public: + public: MsgRecorder(ObIElection*& election, const common::ObPartitionKey& partition) : cur_idx_(0), record_T1_timestamp_(common::OB_INVALID_TIMESTAMP), election_(election), partition_(partition) {} @@ -77,7 +77,7 @@ class ObElectionVoteMsgPool { int size() const; const common::ObAddr& get_new_leader() const; - private: + private: common::ObAddr record_member_[OB_MAX_ELECTION_MSG_COUNT]; common::ObAddr new_leader_; int cur_idx_; diff --git a/src/election/ob_election_part_array_buf.h b/src/election/ob_election_part_array_buf.h index 7235a0b93..6c2630eaf 100644 --- a/src/election/ob_election_part_array_buf.h +++ b/src/election/ob_election_part_array_buf.h @@ -22,7 +22,7 @@ namespace election { static const int64_t MAX_EG_PARTITION_NUM = 100; // limits of election group size class ObPartArrayBuffer { - public: +public: ObPartArrayBuffer() : cur_eg_version_(-1), serialize_size_(0) {} ~ObPartArrayBuffer() @@ -49,10 +49,10 @@ class ObPartArrayBuffer { } int update_content(const common::ObPartitionArray& part_array); - public: +public: static const int64_t ARRAY_BUF_SIZE = 4096; - private: +private: char buf_[ARRAY_BUF_SIZE]; int64_t cur_eg_version_; int64_t serialize_size_; diff --git a/src/election/ob_election_priority.h b/src/election/ob_election_priority.h index 498010d88..1a3b134c3 100644 --- a/src/election/ob_election_priority.h +++ b/src/election/ob_election_priority.h @@ -26,7 +26,7 @@ namespace election { class ObElectionPriority { OB_UNIS_VERSION(1); - public: +public: ObElectionPriority() { reset(); @@ -36,7 +36,7 @@ class ObElectionPriority { int init(const bool is_candidate, const int64_t membership_version, const uint64_t log_id, const uint64_t locality); void reset(); - public: +public: void set_membership_version(const int64_t ts) { membership_version_ = ts; @@ -92,10 +92,10 @@ class ObElectionPriority { int64_t to_string(char* buf, const int64_t buf_len) const; TO_YSON_KV(Y_(is_candidate), Y_(membership_version), Y_(log_id), Y_(data_version), Y_(locality)); - private: +private: int compare_(const ObElectionPriority& priority, const bool with_locality, const bool with_log_id) const; - private: +private: const static int64_t SYSTEM_SCORE_CLOG_DISK_ERROR = (1 << 6); const static int64_t SYSTEM_SCORE_TENANT_OUT_OF_MEM = (1 << 5); const static int64_t SYSTEM_SCORE_DATA_DISK_ERROR = (1 << 4); @@ -104,7 +104,7 @@ class ObElectionPriority { const static int64_t SYSTEM_SCORE_SERVICE_NOT_STARTED = (1 << 1); const static int64_t SYSTEM_SCORE_WITHOUT_MEMSTORE = (1 << 0); - private: +private: bool is_candidate_; int64_t membership_version_; uint64_t log_id_; diff --git a/src/election/ob_election_rpc.h b/src/election/ob_election_rpc.h index ccb782f9b..64dae75a5 100644 --- a/src/election/ob_election_rpc.h +++ b/src/election/ob_election_rpc.h @@ -47,7 +47,7 @@ namespace obrpc { class ObElectionRpcResult { OB_UNIS_VERSION(1); - public: +public: ObElectionRpcResult() : status_(common::OB_SUCCESS), send_timestamp_(0L) {} ~ObElectionRpcResult() @@ -78,40 +78,40 @@ class ObElectionRpcResult { TO_STRING_KV(K_(status), K_(send_timestamp)); - private: +private: int status_; int64_t send_timestamp_; DISALLOW_COPY_AND_ASSIGN(ObElectionRpcResult); }; class ObElectionRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObElectionRpcProxy); RPC_AP(PR1 post_election_msg, OB_ELECTION, (election::ObElectionMsgBuffer), ObElectionRpcResult); }; class ObElectionP : public ObRpcProcessor > { - public: +public: // ObElectionP(election::ObIElectionMgr *election_mgr) : election_mgr_(election_mgr) {} ObElectionP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObElectionP() {} - public: +public: static void statistics(const int64_t fly_us, const int64_t wait_us, const int64_t handle_us); - protected: +protected: int process(); - private: +private: static const int64_t STATISTICS_INTERVAL = 5 * 1000 * 1000; static int64_t total_fly_us_; static int64_t total_wait_us_; static int64_t total_handle_us_; static int64_t total_process_; - private: +private: // election::ObIElectionMgr *election_mgr_; storage::ObPartitionService* partition_service_; DISALLOW_COPY_AND_ASSIGN(ObElectionP); @@ -119,7 +119,7 @@ class ObElectionP : public ObRpcProcessor class ObElectionRPCCB : public ObElectionRpcProxy::AsyncCB { - public: +public: ObElectionRPCCB() : is_inited_(false), election_mgr_(NULL) {} virtual ~ObElectionRPCCB() @@ -140,11 +140,11 @@ class ObElectionRPCCB : public ObElectionRpcProxy::AsyncCB { return newcb; } - public: +public: int process(); void on_timeout(); - private: +private: bool is_inited_; election::ObIElectionMgr* election_mgr_; DISALLOW_COPY_AND_ASSIGN(ObElectionRPCCB); @@ -217,7 +217,7 @@ void ObElectionRPCCB::on_timeout() namespace election { class ObIElectionRpc { - public: +public: ObIElectionRpc() {} virtual ~ObIElectionRpc() @@ -225,7 +225,7 @@ class ObIElectionRpc { virtual int init(obrpc::ObElectionRpcProxy* rpc_proxy, ObIElectionMgr* election_mgr, const common::ObAddr& self) = 0; virtual void destroy() = 0; - public: +public: virtual int post_election_msg(const common::ObAddr& server, const int64_t cluster_id, const common::ObPartitionKey& partition, const ObElectionMsg& msg) = 0; virtual int post_election_group_msg(const common::ObAddr& server, const int64_t cluster_id, @@ -233,7 +233,7 @@ class ObIElectionRpc { }; class ObElectionRpc : public ObIElectionRpc { - public: +public: ObElectionRpc() : is_inited_(false), rpc_proxy_(NULL), election_mgr_(NULL) {} ~ObElectionRpc() @@ -243,16 +243,16 @@ class ObElectionRpc : public ObIElectionRpc { int init(obrpc::ObElectionRpcProxy* rpc_proxy, ObIElectionMgr* election_mgr, const common::ObAddr& self); void destroy(); - public: +public: int post_election_msg(const common::ObAddr& server, const int64_t cluster_id, const common::ObPartitionKey& partition, const ObElectionMsg& msg); int post_election_group_msg(const common::ObAddr& server, const int64_t cluster_id, const ObElectionGroupId& eg_id, const ObPartArrayBuffer& part_array_buf, const ObElectionMsg& msg); - private: +private: static const int64_t MAX_PROCESS_HANDLER_TIME = 10 * 1000; - private: +private: bool is_inited_; obrpc::ObElectionRpcProxy* rpc_proxy_; obrpc::ObElectionRPCCB election_cb_; @@ -262,7 +262,7 @@ class ObElectionRpc : public ObIElectionRpc { }; class ObElectionBatchRpc : public ObIElectionRpc { - public: +public: ObElectionBatchRpc() : rpc_(NULL) {} ~ObElectionBatchRpc() @@ -285,13 +285,13 @@ class ObElectionBatchRpc : public ObIElectionRpc { void destroy() {} - public: +public: int post_election_msg(const common::ObAddr& server, const int64_t cluster_id, const common::ObPartitionKey& partition, const ObElectionMsg& msg); int post_election_group_msg(const common::ObAddr& server, const int64_t cluster_id, const ObElectionGroupId& eg_id, const ObPartArrayBuffer& part_array_buf, const ObElectionMsg& msg); - private: +private: obrpc::ObBatchRpc* rpc_; DISALLOW_COPY_AND_ASSIGN(ObElectionBatchRpc); }; diff --git a/src/election/ob_election_timer.h b/src/election/ob_election_timer.h index 3dce9604d..2c09dd065 100644 --- a/src/election/ob_election_timer.h +++ b/src/election/ob_election_timer.h @@ -32,7 +32,7 @@ class ObIElectionRpc; // election base task class ObElectionTask : public common::ObTimeWheelTask { - public: +public: ObElectionTask() { reset(); @@ -43,7 +43,7 @@ class ObElectionTask : public common::ObTimeWheelTask { int init(ObIElectionTimerP* e, ObElectionTimer* timer, ObIElectionRpc* rpc); void reset(); - public: +public: void set_run_time_expect(const int64_t ts) { run_time_expect_ = ts; @@ -76,10 +76,10 @@ class ObElectionTask : public common::ObTimeWheelTask { virtual uint64_t hash() const; bool is_valid() const; - public: +public: virtual int64_t to_string(char* buf, const int64_t buf_len) const; - protected: +protected: bool is_inited_; bool is_running_; ObIElectionTimerP* e_; @@ -91,7 +91,7 @@ class ObElectionTask : public common::ObTimeWheelTask { // election GT1 timer task class ObElectionGT1Task : public ObElectionTask { - public: +public: ObElectionGT1Task() { reset(); @@ -103,13 +103,13 @@ class ObElectionGT1Task : public ObElectionTask { void reset(); int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: int64_t candidate_index_; }; // election GT2 timer task class ObElectionGT2Task : public ObElectionTask { - public: +public: ObElectionGT2Task() { reset(); @@ -124,7 +124,7 @@ class ObElectionGT2Task : public ObElectionTask { // election GT3 timer task class ObElectionGT3Task : public ObElectionTask { - public: +public: ObElectionGT3Task() { reset(); @@ -139,7 +139,7 @@ class ObElectionGT3Task : public ObElectionTask { // election GT4 timer task class ObElectionGT4Task : public ObElectionTask { - public: +public: ObElectionGT4Task() { reset(); @@ -154,7 +154,7 @@ class ObElectionGT4Task : public ObElectionTask { // election ChangeLeader Timer task class ObElectionChangeLeaderTask : public ObElectionTask { - public: +public: ObElectionChangeLeaderTask() { reset(); @@ -169,7 +169,7 @@ class ObElectionChangeLeaderTask : public ObElectionTask { // election timer class ObElectionTimer { - public: +public: ObElectionTimer(); ~ObElectionTimer(); int init(ObIElectionTimerP* e, common::ObTimeWheel* tw, ObIElectionRpc* rpc); @@ -178,20 +178,20 @@ class ObElectionTimer { int start(const int64_t start); int stop(); int try_stop(); // don't wait - public: +public: int register_gt1_once(const int64_t run_time_expect, int64_t& delay); int register_gt2_once(const int64_t run_time_expect, int64_t& delay); int register_gt3_once(const int64_t run_time_expect, int64_t& delay); int register_gt4_once(const int64_t run_time_expect, int64_t& delay); int register_change_leader_once(const int64_t run_time_expect, int64_t& delay); - private: +private: template int register_gt_once_(GT& gt, const int64_t run_time_expect, int64_t& delay); template int unregister_gt_(GT& gt); - private: +private: bool is_inited_; bool is_running_; ObIElectionTimerP* e_; diff --git a/src/observer/mysql/ob_async_cmd_driver.h b/src/observer/mysql/ob_async_cmd_driver.h index 91beaa9da..0c81824a9 100644 --- a/src/observer/mysql/ob_async_cmd_driver.h +++ b/src/observer/mysql/ob_async_cmd_driver.h @@ -29,14 +29,14 @@ class ObGlobalContext; class ObMySQLResultSet; class ObQueryRetryCtrl; class ObAsyncCmdDriver : public ObQueryDriver { - public: +public: ObAsyncCmdDriver(const ObGlobalContext& gctx, const sql::ObSqlCtx& ctx, sql::ObSQLSessionInfo& session, ObQueryRetryCtrl& retry_ctrl, ObIMPPacketSender& sender); virtual ~ObAsyncCmdDriver(); virtual int response_result(ObMySQLResultSet& result); - private: +private: /* disallow copy & assign */ DISALLOW_COPY_AND_ASSIGN(ObAsyncCmdDriver); }; diff --git a/src/observer/mysql/ob_async_plan_driver.h b/src/observer/mysql/ob_async_plan_driver.h index 3ff273543..4b9e45379 100644 --- a/src/observer/mysql/ob_async_plan_driver.h +++ b/src/observer/mysql/ob_async_plan_driver.h @@ -30,14 +30,14 @@ class ObMySQLResultSet; class ObQueryRetryCtrl; class ObSqlEndTransCb; class ObAsyncPlanDriver : public ObQueryDriver { - public: +public: ObAsyncPlanDriver(const ObGlobalContext& gctx, const sql::ObSqlCtx& ctx, sql::ObSQLSessionInfo& session, ObQueryRetryCtrl& retry_ctrl, ObIMPPacketSender& sender); virtual ~ObAsyncPlanDriver(); virtual int response_result(ObMySQLResultSet& result); - private: +private: /* functions */ /* variables */ /* disallow copy & assign */ diff --git a/src/observer/mysql/ob_diag.h b/src/observer/mysql/ob_diag.h index 8a2250723..18b5a5465 100644 --- a/src/observer/mysql/ob_diag.h +++ b/src/observer/mysql/ob_diag.h @@ -24,13 +24,13 @@ namespace obmysql { class ObDiag { static const int64_t EXPIRED_TIME = 10 * 1000L * 1000L; // 10 seconds - public: +public: ObDiag(); int refresh_passwd(common::ObString& passwd); int check_passwd(const common::ObString& passwd, const common::ObString& scramble_str); - private: +private: lib::ObMutex lock_; char passwd_[64]; int64_t fresh_timestamp_; diff --git a/src/observer/mysql/ob_eliminate_task.h b/src/observer/mysql/ob_eliminate_task.h index 187503739..c5f840832 100644 --- a/src/observer/mysql/ob_eliminate_task.h +++ b/src/observer/mysql/ob_eliminate_task.h @@ -21,7 +21,7 @@ namespace obmysql { class ObMySQLRequestManager; class ObEliminateTask : public common::ObTimerTask { - public: +public: ObEliminateTask(); virtual ~ObEliminateTask(); @@ -30,7 +30,7 @@ class ObEliminateTask : public common::ObTimerTask { int check_config_mem_limit(bool& is_change); int calc_evict_mem_level(int64_t& low, int64_t& high); - private: +private: ObMySQLRequestManager* request_manager_; int64_t config_mem_limit_; }; diff --git a/src/observer/mysql/ob_mysql_end_trans_cb.h b/src/observer/mysql/ob_mysql_end_trans_cb.h index be869d53f..eec43f0ae 100644 --- a/src/observer/mysql/ob_mysql_end_trans_cb.h +++ b/src/observer/mysql/ob_mysql_end_trans_cb.h @@ -37,7 +37,7 @@ class ObOKPParam; class ObMySQLResultSet; struct ObSMConnection; class ObSqlEndTransCb { - public: +public: ObSqlEndTransCb(); virtual ~ObSqlEndTransCb(); @@ -54,12 +54,12 @@ class ObSqlEndTransCb { need_disconnect_ = need_disconnect; } - private: +private: int revert_session(sql::ObSQLSessionInfo* sess_info); ObSMConnection* get_conn() const; int get_conn_id(uint32_t& sessid) const; - protected: +protected: int encode_ok_packet(rpc::ObRequest* req, easy_buf_t* buf, observer::ObOKPParam& ok_param, sql::ObSQLSessionInfo& sess_info, uint8_t packet_seq); int encode_error_packet(rpc::ObRequest* req, easy_buf_t* ez_buf, sql::ObSQLSessionInfo& sess_info, uint8_t packet_seq, @@ -68,7 +68,7 @@ class ObSqlEndTransCb { inline int encode_packet(obmysql::ObMySQLPacket& pkt, const uint8_t packet_seq, const bool is_last); - protected: +protected: char* data_; rpc::ObRequest* mysql_request_; sql::ObSQLSessionInfo* sess_info_; @@ -82,7 +82,7 @@ class ObSqlEndTransCb { bool need_disconnect_; uint32_t sessid_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlEndTransCb); }; } // namespace observer diff --git a/src/observer/mysql/ob_mysql_request_manager.h b/src/observer/mysql/ob_mysql_request_manager.h index ccfd831a3..a8b4a8355 100644 --- a/src/observer/mysql/ob_mysql_request_manager.h +++ b/src/observer/mysql/ob_mysql_request_manager.h @@ -39,16 +39,16 @@ enum ObMySQLRequestStatus { }; class ObMySQLRequestRecord { - public: +public: common::ObConcurrentFIFOAllocator* allocator_; sql::ObAuditRecordData data_; - public: +public: ObMySQLRequestRecord() : allocator_(nullptr) {} virtual ~ObMySQLRequestRecord(); - public: +public: virtual void destroy() { if (NULL != allocator_) { @@ -56,7 +56,7 @@ class ObMySQLRequestRecord { } } - public: +public: int64_t get_self_size() const { return sizeof(ObMySQLRequestRecord) + data_.get_extra_size(); @@ -64,7 +64,7 @@ class ObMySQLRequestRecord { }; class ObMySQLRequestManager { - public: +public: static const int64_t SQL_AUDIT_PAGE_SIZE = (1LL << 21) - (1LL << 13); // 2M - 8k static const int64_t MAX_PARAM_BUF_SIZE = 64 * 1024; // number of deleted sql_audit records executing release_old one time @@ -81,15 +81,15 @@ class ObMySQLRequestManager { static const int64_t EVICT_INTERVAL = 1000000; // 1s typedef common::ObRaQueue::Ref Ref; - public: +public: ObMySQLRequestManager(); virtual ~ObMySQLRequestManager(); - public: +public: int init(uint64_t tenant_id, const int64_t max_mem_size, const int64_t queue_size); void destroy(); - public: +public: static int mtl_init(ObMySQLRequestManager*& req_mgr); static void mtl_destroy(ObMySQLRequestManager*& req_mgr); @@ -179,10 +179,10 @@ class ObMySQLRequestManager { static int get_mem_limit(uint64_t tenant_id, int64_t& mem_limit); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMySQLRequestManager); - private: +private: bool inited_; bool destroyed_; uint64_t request_id_; diff --git a/src/observer/mysql/ob_mysql_result_set.h b/src/observer/mysql/ob_mysql_result_set.h index c54f8d3ac..00dcd9082 100644 --- a/src/observer/mysql/ob_mysql_result_set.h +++ b/src/observer/mysql/ob_mysql_result_set.h @@ -31,7 +31,7 @@ using obmysql::ObMySQLField; using obmysql::ObMySQLRow; class ObMySQLResultSet : public ObResultSet, public common::ObDLinkBase { - public: +public: /** * construct * @@ -98,7 +98,7 @@ class ObMySQLResultSet : public ObResultSet, public common::ObDLinkBase ParamStore; class ObMPStmtExecute : public ObMPBase, public ObIMPPacketSender { - public: +public: static const obmysql::ObMySQLCmd COM = obmysql::OB_MYSQL_COM_STMT_EXECUTE; explicit ObMPStmtExecute(const ObGlobalContext& gctx); @@ -72,7 +72,7 @@ class ObMPStmtExecute : public ObMPBase, public ObIMPPacketSender { return ObMPBase::flush_buffer(is_last); } - protected: +protected: virtual int deserialize() { return common::OB_SUCCESS; @@ -113,7 +113,7 @@ class ObMPStmtExecute : public ObMPBase, public ObIMPPacketSender { return ObMPBase::after_process(); } - private: +private: // for arraybinding int init_field_for_arraybinding(); int init_row_for_arraybinding(ObIAllocator& alloc); @@ -165,7 +165,7 @@ class ObMPStmtExecute : public ObMPBase, public ObIMPPacketSender { const common::ObCollationType dst_type, const common::ObString& src, common::ObString& out, int64_t extra_buf_len = 0); - private: +private: ObQueryRetryCtrl retry_ctrl_; sql::ObSqlCtx ctx_; int64_t stmt_id_; @@ -187,7 +187,7 @@ class ObMPStmtExecute : public ObMPBase, public ObIMPPacketSender { int64_t exec_start_timestamp_; int64_t exec_end_timestamp_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMPStmtExecute); }; // end of class diff --git a/src/observer/mysql/obmp_stmt_prepare.h b/src/observer/mysql/obmp_stmt_prepare.h index 7fbe3ed54..0f8495532 100644 --- a/src/observer/mysql/obmp_stmt_prepare.h +++ b/src/observer/mysql/obmp_stmt_prepare.h @@ -25,7 +25,7 @@ namespace observer { struct ObGlobalContext; class ObMPStmtPrepare : public ObMPBase, public ObIMPPacketSender { - public: +public: static const obmysql::ObMySQLCmd COM = obmysql::OB_MYSQL_COM_STMT_PREPARE; explicit ObMPStmtPrepare(const ObGlobalContext& gctx); @@ -60,7 +60,7 @@ class ObMPStmtPrepare : public ObMPBase, public ObIMPPacketSender { return proxy_version_; } - protected: +protected: virtual int deserialize(); virtual int before_process() override; virtual int process(); @@ -96,7 +96,7 @@ class ObMPStmtPrepare : public ObMPBase, public ObIMPPacketSender { return OB_NOT_NULL(get_conn()) && get_conn()->need_send_extra_ok_packet(); } - private: +private: int do_process( sql::ObSQLSessionInfo& session, const bool has_more_result, const bool force_sync_resp, bool& async_resp_used); int process_prepare_stmt(const sql::ObMultiStmtItem& multi_stmt_item, sql::ObSQLSessionInfo& session, @@ -109,7 +109,7 @@ class ObMPStmtPrepare : public ObMPBase, public ObIMPPacketSender { int send_column_packet(const sql::ObSQLSessionInfo& session, ObMySQLResultSet& result); int send_param_packet(const sql::ObSQLSessionInfo& session, ObMySQLResultSet& result); - private: +private: ObQueryRetryCtrl retry_ctrl_; sql::ObSqlCtx ctx_; common::ObString sql_; @@ -119,7 +119,7 @@ class ObMPStmtPrepare : public ObMPBase, public ObIMPPacketSender { int64_t exec_end_timestamp_; uint64_t proxy_version_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMPStmtPrepare); }; // end of class ObMPStmtPrepare diff --git a/src/observer/mysql/obmp_utils.h b/src/observer/mysql/obmp_utils.h index 53df94235..8486be547 100644 --- a/src/observer/mysql/obmp_utils.h +++ b/src/observer/mysql/obmp_utils.h @@ -32,7 +32,7 @@ class ObObj; } // namespace common namespace observer { class ObMPUtils { - public: +public: static int add_changed_session_info(obmysql::OMPKOK& ok_pkt, sql::ObSQLSessionInfo& session); static int add_session_info_on_connect(obmysql::OMPKOK& okp, sql::ObSQLSessionInfo& session); static int add_client_feedback(obmysql::OMPKOK& ok_pkt, sql::ObSQLSessionInfo& session); @@ -40,7 +40,7 @@ class ObMPUtils { obmysql::OMPKOK& pk_pkt, sql::ObSQLSessionInfo& session, share::ObFeedbackRerouteInfo& reroute_info); static int add_nls_format(obmysql::OMPKOK& pk_pkt, sql::ObSQLSessionInfo& session, const bool only_changed = false); - private: +private: static int get_plain_str_literal( common::ObIAllocator& allocator, const common::ObObj& obj, common::ObString& value_str); diff --git a/src/observer/mysql/obsm_handler.h b/src/observer/mysql/obsm_handler.h index 16da2cb42..f87a1b92e 100644 --- a/src/observer/mysql/obsm_handler.h +++ b/src/observer/mysql/obsm_handler.h @@ -27,7 +27,7 @@ class ObProto20PktContext; namespace observer { class ObSMHandler : public obmysql::ObMySQLHandler { - public: +public: ObSMHandler(rpc::frame::ObReqDeliver& deliver, ObGlobalContext& gctx); virtual ~ObSMHandler(); virtual int on_connect(easy_connection_t* c); @@ -44,14 +44,14 @@ class ObSMHandler : public obmysql::ObMySQLHandler { virtual uint32_t get_sessid(easy_connection_t* c) const; virtual common::ObCSProtocolType get_cs_protocol_type(easy_connection_t* c) const; - protected: +protected: virtual obmysql::ObMysqlPktContext* get_mysql_pkt_context(easy_connection_t* c); virtual obmysql::ObCompressedPktContext* get_compressed_pkt_context(easy_connection_t* c); virtual obmysql::ObProto20PktContext* get_proto20_pkt_context(easy_connection_t* c); int create_scramble_string(char* scramble_buf, const int64_t buf_len, common::ObMysqlRandom& thread_rand); - private: +private: ObGlobalContext& gctx_; DISALLOW_COPY_AND_ASSIGN(ObSMHandler); }; // end of class ObSMHandler diff --git a/src/observer/mysql/obsm_row.h b/src/observer/mysql/obsm_row.h index 59b485ad3..3313f914f 100644 --- a/src/observer/mysql/obsm_row.h +++ b/src/observer/mysql/obsm_row.h @@ -29,7 +29,7 @@ class ObSchemaGetterGuard; namespace common { class ObSMRow : public obmysql::ObMySQLRow { - public: +public: ObSMRow(obmysql::MYSQL_PROTOCOL_TYPE type, const ObNewRow& obrow, const ObDataTypeCastParams& dtc_params, const ColumnsFieldIArray* fields = NULL, share::schema::ObSchemaGetterGuard* schema_guard = NULL, uint64_t tenant = common::OB_INVALID_ID); @@ -37,11 +37,11 @@ class ObSMRow : public obmysql::ObMySQLRow { virtual ~ObSMRow() {} - protected: +protected: virtual int64_t get_cells_cnt() const; virtual int encode_cell(int64_t idx, char* buf, int64_t len, int64_t& pos, char* bitmap) const; - private: +private: const ObNewRow& obrow_; const ObDataTypeCastParams dtc_params_; const ColumnsFieldIArray* fields_; diff --git a/src/observer/mysql/obsm_struct.h b/src/observer/mysql/obsm_struct.h index b25110142..c40b442d0 100644 --- a/src/observer/mysql/obsm_struct.h +++ b/src/observer/mysql/obsm_struct.h @@ -29,7 +29,7 @@ class ObTenant; namespace observer { struct ObSMConnection { - public: +public: static const uint32_t INITIAL_SESSID = 0; static const int64_t SCRAMBLE_BUF_SIZE = 20; @@ -131,7 +131,7 @@ struct ObSMConnection { connection_phase_ = rpc::ConnectionPhaseEnum::CPE_AUTHED; } - public: +public: obmysql::ObMySQLCapabilityFlags cap_flags_; bool is_proxy_; bool is_java_client_; diff --git a/src/observer/mysql/obsm_utils.h b/src/observer/mysql/obsm_utils.h index d62b6c45d..0bae35bf3 100644 --- a/src/observer/mysql/obsm_utils.h +++ b/src/observer/mysql/obsm_utils.h @@ -31,7 +31,7 @@ class ObSchemaGetterGuard; namespace common { class ObField; class ObSMUtils { - public: +public: /** * * @param [in] obj: need to serialize cell diff --git a/src/observer/ob_cache_size_calculator.h b/src/observer/ob_cache_size_calculator.h index a6775e2a1..1fb96503f 100644 --- a/src/observer/ob_cache_size_calculator.h +++ b/src/observer/ob_cache_size_calculator.h @@ -28,7 +28,7 @@ class ObMultiVersionSchemaService; namespace observer { class ObCacheSizeCalculator : public share::ObThreadPool { - public: +public: ObCacheSizeCalculator(); virtual ~ObCacheSizeCalculator(); int init(storage::ObPartitionService& partition_service, share::schema::ObMultiVersionSchemaService& schema_service); @@ -36,7 +36,7 @@ class ObCacheSizeCalculator : public share::ObThreadPool { int start(); void stop(); - private: +private: static const int64_t RENEW_CACHE_SIZE_INTERVAL_US = 10 * 1000 * 1000; static const int64_t MIN_HOLD_SIZE = 10L * 1024L * 1024L; // 10MB static const int64_t MAX_HOLD_SIZE = 5L * 1024L * 1024L * 1024L; // 5GB diff --git a/src/observer/ob_dump_task_generator.h b/src/observer/ob_dump_task_generator.h index bf856d0b1..bcf49773e 100644 --- a/src/observer/ob_dump_task_generator.h +++ b/src/observer/ob_dump_task_generator.h @@ -42,11 +42,11 @@ class ObDumpTaskGenerator { MEMORY_LEAK = 7, }; - public: +public: static int generate_task_from_file(); static int generate_mod_stat_task(); - private: +private: static int read_cmd(char* buf, int64_t len, int64_t& real_size); static void dump_memory_leak(); }; diff --git a/src/observer/ob_heartbeat.h b/src/observer/ob_heartbeat.h index 840891d69..eb032a9bc 100644 --- a/src/observer/ob_heartbeat.h +++ b/src/observer/ob_heartbeat.h @@ -25,7 +25,7 @@ namespace observer { class ObServerSchemaUpdater; class ObHeartBeatProcess : public observer::IHeartBeatProcess { - public: +public: ObHeartBeatProcess( const ObGlobalContext& gctx, ObServerSchemaUpdater& schema_updater, ObLeaseStateMgr& lease_state_mgr); virtual ~ObHeartBeatProcess(); @@ -37,15 +37,15 @@ class ObHeartBeatProcess : public observer::IHeartBeatProcess { int update_lease_info(); int try_update_infos(); - private: +private: class ObZoneLeaseInfoUpdateTask : public common::ObTimerTask { - public: + public: explicit ObZoneLeaseInfoUpdateTask(ObHeartBeatProcess& hb_process); virtual ~ObZoneLeaseInfoUpdateTask(); virtual void runTimerTask(); - private: + private: ObHeartBeatProcess& hb_process_; }; @@ -53,7 +53,7 @@ class ObHeartBeatProcess : public observer::IHeartBeatProcess { int try_reload_config(const int64_t config_version); int try_reload_time_zone_info(const int64_t time_zone_info_version); - private: +private: bool inited_; ObZoneLeaseInfoUpdateTask update_task_; share::ObZoneLeaseInfo zone_lease_info_; @@ -63,7 +63,7 @@ class ObHeartBeatProcess : public observer::IHeartBeatProcess { ObServerSchemaUpdater& schema_updater_; ObLeaseStateMgr& lease_state_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHeartBeatProcess); }; diff --git a/src/observer/ob_index_status_reporter.h b/src/observer/ob_index_status_reporter.h index c6ec1c3f2..542a2810c 100644 --- a/src/observer/ob_index_status_reporter.h +++ b/src/observer/ob_index_status_reporter.h @@ -25,7 +25,7 @@ class ObMySQLProxy; namespace observer { // report local index build status to __all_local_index_status class ObIndexStatusReporter : public common::ObDLinkBase { - public: +public: const static int64_t RETRY_INTERVAL_US = 2l * 1000 * 1000; // 2 seconds. ObIndexStatusReporter(); @@ -67,10 +67,10 @@ class ObIndexStatusReporter : public common::ObDLinkBase TO_STRING_KV(K_(part_key), K_(self), K_(index_table_id), K_(index_status), K_(ret_code)); - private: +private: int do_process(); - private: +private: bool inited_; common::ObPartitionKey part_key_; common::ObAddr self_; @@ -81,7 +81,7 @@ class ObIndexStatusReporter : public common::ObDLinkBase common::ObMySQLProxy* sql_proxy_; }; class ObIndexStatusUpdater { - public: +public: ObIndexStatusUpdater() {} ~ObIndexStatusUpdater() diff --git a/src/observer/ob_inner_sql_connection.cpp b/src/observer/ob_inner_sql_connection.cpp index 513312e51..5b507f790 100644 --- a/src/observer/ob_inner_sql_connection.cpp +++ b/src/observer/ob_inner_sql_connection.cpp @@ -49,7 +49,7 @@ namespace observer { constexpr const char ObInnerSQLConnection::LABEL[]; class ObInnerSQLConnection::ObSqlQueryExecutor : public sqlclient::ObIExecutor { - public: +public: explicit ObSqlQueryExecutor(const ObString& sql) : sql_(sql) {} explicit ObSqlQueryExecutor(const char* sql) : sql_(ObString::make_string(sql)) @@ -73,7 +73,7 @@ class ObInnerSQLConnection::ObSqlQueryExecutor : public sqlclient::ObIExecutor { INHERIT_TO_STRING_KV("ObIExecutor", ObIExecutor, K_(sql)); - private: +private: ObString sql_; }; @@ -479,7 +479,7 @@ int ObInnerSQLConnection::process_retry( } class ObInnerSQLTimeRecord : public ObITimeRecord { - public: +public: ObInnerSQLTimeRecord(sql::ObSQLSessionInfo& session) : session_(session), execute_start_timestamp_(0), execute_end_timestamp_(0) {} @@ -526,7 +526,7 @@ class ObInnerSQLTimeRecord : public ObITimeRecord { execute_end_timestamp_ = v; } - private: +private: sql::ObSQLSessionInfo& session_; int64_t execute_start_timestamp_; int64_t execute_end_timestamp_; diff --git a/src/observer/ob_inner_sql_connection.h b/src/observer/ob_inner_sql_connection.h index ec9702bf2..97f19fc45 100644 --- a/src/observer/ob_inner_sql_connection.h +++ b/src/observer/ob_inner_sql_connection.h @@ -48,7 +48,7 @@ class ObVTIterCreator; class ObVirtualTableIteratorFactory; class ObInnerSQLReadContext; class ObITimeRecord { - public: +public: virtual int64_t get_send_timestamp() const = 0; virtual int64_t get_receive_timestamp() const = 0; virtual int64_t get_enqueue_timestamp() const = 0; @@ -63,10 +63,10 @@ typedef common::Ob2DArray { - public: +public: static constexpr const char LABEL[] = "RPInnerSqlConn"; class SavedValue { - public: + public: SavedValue() { reset(); @@ -78,7 +78,7 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, execute_end_timestamp_ = 0; } - public: + public: ObInnerSQLReadContext* ref_ctx_; int64_t execute_start_timestamp_; int64_t execute_end_timestamp_; @@ -86,18 +86,18 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, // Worker and session timeout may be altered in sql execution, restore to origin value after execution. class TimeoutGuard { - public: + public: TimeoutGuard(ObInnerSQLConnection& conn); ~TimeoutGuard(); - private: + private: ObInnerSQLConnection& conn_; int64_t worker_timeout_; int64_t query_timeout_; int64_t trx_timeout_; }; - public: +public: class ObSqlQueryExecutor; ObInnerSQLConnection(); @@ -161,7 +161,7 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, } void dump_conn_bt_info(); class RefGuard { - public: + public: explicit RefGuard(ObInnerSQLConnection& conn) : conn_(conn) { conn_.ref(); @@ -175,11 +175,11 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, return conn_; } - private: + private: ObInnerSQLConnection& conn_; }; - public: +public: int64_t get_send_timestamp() const { return get_session().get_query_start_time(); @@ -217,7 +217,7 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, return associated_client_; } - public: +public: int prepare(const uint64_t tenant_id, const ObString& sql, bool is_dynamic_sql, bool is_dbms_sql, bool is_cursor, common::ObISQLClient::ReadResult& res); int execute(const uint64_t tenant_id, const ObPsStmtId client_stmt_id, const sql::stmt::StmtType stmt_type, @@ -225,7 +225,7 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, virtual int execute(const uint64_t tenant_id, sqlclient::ObIExecutor& executor) override; - public: +public: // nested session and sql execute for foreign key. int begin_nested_session( sql::ObSQLSessionInfo::StmtSavedValue& saved_session, SavedValue& saved_conn, bool skip_cur_stmt_tables); @@ -247,14 +247,14 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, return is_spi_conn_; } - public: +public: static int process_record(ObInnerSQLResult& res, sql::ObSQLSessionInfo& session, ObITimeRecord& time_record, int last_ret, int64_t execution_id, int64_t ps_stmt_id, int64_t routine_id, ObWaitEventDesc& max_wait_desc, ObWaitEventStat& total_wait_desc, sql::ObExecRecord& exec_record, sql::ObExecTimestamp& exec_timestamp, bool is_from_pl = false); static void record_stat(sql::ObSQLSessionInfo& session, const sql::stmt::StmtType type, bool is_from_pl = false); - public: +public: static const int64_t LOCK_RETRY_TIME = 1L * 1000 * 1000; static const int64_t TOO_MANY_REF_ALERT = 1024; static const uint32_t INNER_SQL_SESS_VERSION = 0; @@ -263,7 +263,7 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, static const int64_t MAX_BT_SIZE = 20; static const int64_t EXTRA_REFRESH_LOCATION_TIME = 1L * 1000 * 1000; - private: +private: int init_session(sql::ObSQLSessionInfo* session_info = NULL); int init_result(ObInnerSQLResult& res, ObVirtualTableIteratorFactory* vt_iter_factory, int64_t retry_cnt, share::schema::ObSchemaGetterGuard& schema_guard, bool is_prepare_protocol = false, bool is_prepare_stage = false, @@ -296,7 +296,7 @@ class ObInnerSQLConnection : public common::sqlclient::ObISQLConnection, share::ObWorker::CompatMode get_compat_mode() const; - private: +private: bool inited_; sql::ObSQLSessionInfo inner_session_; sql::ObSQLSessionInfo* extern_session_; // nested sql and spi both use it, rename to extern. diff --git a/src/observer/ob_inner_sql_connection_pool.h b/src/observer/ob_inner_sql_connection_pool.h index 8e37e8cf9..a6425e333 100644 --- a/src/observer/ob_inner_sql_connection_pool.h +++ b/src/observer/ob_inner_sql_connection_pool.h @@ -38,7 +38,7 @@ namespace observer { class ObVTIterCreator; class ObInnerSQLConnectionPool : public common::sqlclient::ObISQLConnectionPool { - public: +public: friend class ObInnerSQLConnection; static constexpr int64_t RP_MAX_FREE_LIST_NUM = 1024; class LinkNode : public common::ObDLinkBase {}; @@ -77,7 +77,7 @@ class ObInnerSQLConnectionPool : public common::sqlclient::ObISQLConnectionPool void dump_used_conn_list(); - private: +private: // alloc connection from %free_conn_list_ int alloc_conn(ObInnerSQLConnection*& conn); // revert connection to %free_conn_list_ @@ -86,7 +86,7 @@ class ObInnerSQLConnectionPool : public common::sqlclient::ObISQLConnectionPool // revert connection, called by ObInnerSQLConnection::unref() int revert(ObInnerSQLConnection* conn); - private: +private: // Dozens of connections may acquired by one worker in oracle mode, because all sys tables // implemented by agent virtual table which need inner connection. Too many connections // warning may be triggered by parallel execution complicate sys table queries. @@ -95,7 +95,7 @@ class ObInnerSQLConnectionPool : public common::sqlclient::ObISQLConnectionPool const static int64_t WARNNING_CONNECTION_CNT = 100000; const static int64_t MAX_DUMP_SIZE = 20; - private: +private: bool inited_; volatile bool stop_; common::ObThreadCond cond_; diff --git a/src/observer/ob_inner_sql_read_context.h b/src/observer/ob_inner_sql_read_context.h index 595e21654..7a852da09 100644 --- a/src/observer/ob_inner_sql_read_context.h +++ b/src/observer/ob_inner_sql_read_context.h @@ -27,7 +27,7 @@ namespace observer { class ObInnerSQLConnection; class ObInnerSQLReadContext : public common::sqlclient::ObISQLResultHandler { - public: +public: explicit ObInnerSQLReadContext(ObInnerSQLConnection& conn); virtual ~ObInnerSQLReadContext(); virtual common::sqlclient::ObMySQLResult* mysql_result() @@ -43,7 +43,7 @@ class ObInnerSQLReadContext : public common::sqlclient::ObISQLResultHandler { return vt_iter_factory_; } - private: +private: // define order dependent: // %conn_ref_ (session info) need be destructed after %result_ // %vt_iter_factory_ need be destructed after %result_ diff --git a/src/observer/ob_inner_sql_result.h b/src/observer/ob_inner_sql_result.h index 68a334ec8..f288ef2b9 100644 --- a/src/observer/ob_inner_sql_result.h +++ b/src/observer/ob_inner_sql_result.h @@ -34,7 +34,7 @@ namespace observer { class ObInnerSQLResult : public common::sqlclient::ObMySQLResult { friend class ObInnerSQLConnection; - public: +public: explicit ObInnerSQLResult(sql::ObSQLSessionInfo& session); virtual ~ObInnerSQLResult(); @@ -143,7 +143,7 @@ class ObInnerSQLResult : public common::sqlclient::ObMySQLResult { return is_inited_; } - private: +private: virtual int inner_get_number(const int64_t col_idx, common::number::ObNumber& nmb_val, IAllocator& allocator) const; virtual int get_number_impl(const int64_t col_idx, common::number::ObNumber& nmb_val) const; @@ -176,9 +176,9 @@ class ObInnerSQLResult : public common::sqlclient::ObMySQLResult { static inline int check_extend_value(const common::ObObj& obj); - private: +private: class MemEntifyDestroyGuard { - public: + public: MemEntifyDestroyGuard(lib::MemoryContext*& entity) : ref_(entity) {} ~MemEntifyDestroyGuard() @@ -189,7 +189,7 @@ class ObInnerSQLResult : public common::sqlclient::ObMySQLResult { } } - private: + private: lib::MemoryContext*& ref_; }; diff --git a/src/observer/ob_lease_state_mgr.h b/src/observer/ob_lease_state_mgr.h index d9bb0cef8..9612c842c 100644 --- a/src/observer/ob_lease_state_mgr.h +++ b/src/observer/ob_lease_state_mgr.h @@ -32,7 +32,7 @@ class ObLeaseStateMgr; class ObService; class IHeartBeatProcess { - public: +public: virtual ~IHeartBeatProcess() {} virtual int init_lease_request(share::ObLeaseRequest& lease_request) = 0; @@ -40,7 +40,7 @@ class IHeartBeatProcess { }; class ObRefreshSchemaStatusTimerTask : public common::ObTimerTask { - public: +public: ObRefreshSchemaStatusTimerTask(); // no repeat, no retry virtual ~ObRefreshSchemaStatusTimerTask() {} @@ -51,7 +51,7 @@ class ObRefreshSchemaStatusTimerTask : public common::ObTimerTask { // heartbeat or lease management // root servers list maintenance class ObLeaseStateMgr { - public: +public: friend class HeartBeat; friend class AvgCalculator; ObLeaseStateMgr(); @@ -78,21 +78,21 @@ class ObLeaseStateMgr { inline int64_t get_lease_expire_time(); inline int set_lease_response(const share::ObLeaseResponse& lease_response); - private: +private: int try_report_all_core_table_partition(); class HeartBeat : public common::ObTimerTask { - public: + public: HeartBeat(); ~HeartBeat(); int init(ObLeaseStateMgr* lease_state_mgr); virtual void runTimerTask(); - private: + private: bool inited_; ObLeaseStateMgr* lease_state_mgr_; - private: + private: DISALLOW_COPY_AND_ASSIGN(HeartBeat); }; @@ -103,7 +103,7 @@ class ObLeaseStateMgr { // maintain fixed-length buffer and calculate avarage value class AvgCalculator { - public: + public: AvgCalculator(); ~AvgCalculator(); @@ -111,22 +111,22 @@ class ObLeaseStateMgr { int calc_avg(int64_t num); int get_avg(double& avg); - private: + private: common::ObSEArray calc_buffer_; bool inited_; int64_t limit_num_; int64_t head_; double avg_; - private: + private: DISALLOW_COPY_AND_ASSIGN(AvgCalculator); }; - private: +private: int start_heartbeat(); int do_renew_lease(); - private: +private: bool inited_; bool stopped_; share::ObLeaseResponse lease_response_; @@ -143,7 +143,7 @@ class ObLeaseStateMgr { int64_t baseline_schema_version_; volatile int64_t heartbeat_expire_time_ CACHE_ALIGNED; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLeaseStateMgr); }; diff --git a/src/observer/ob_partition_table_checker.h b/src/observer/ob_partition_table_checker.h index f56002097..7a7795051 100644 --- a/src/observer/ob_partition_table_checker.h +++ b/src/observer/ob_partition_table_checker.h @@ -48,7 +48,7 @@ class ObPartitionService; namespace observer { class ObPartitionTableChecker; class ObCheckPartitionTableTask : public common::IObDedupTask { - public: +public: typedef common::ObSArray ServerList; ObCheckPartitionTableTask(ObPartitionTableChecker& pt_checker, volatile const bool& stopped); virtual ~ObCheckPartitionTableTask(); @@ -67,13 +67,13 @@ class ObCheckPartitionTableTask : public common::IObDedupTask { TO_STRING_KV("pt_checker", reinterpret_cast(&pt_checker_)); - private: +private: ObPartitionTableChecker& pt_checker_; volatile const bool& stopped_; }; class ObCheckDanglingReplicaTask : public common::IObDedupTask { - public: +public: ObCheckDanglingReplicaTask(ObPartitionTableChecker& pt_checker, volatile const bool& stopped, int64_t version); virtual ~ObCheckDanglingReplicaTask(); @@ -91,14 +91,14 @@ class ObCheckDanglingReplicaTask : public common::IObDedupTask { TO_STRING_KV("pt_checker", reinterpret_cast(&pt_checker_), K_(version)); - private: +private: ObPartitionTableChecker& pt_checker_; volatile const bool& stopped_; int64_t version_; }; class ObPartitionTableChecker : public common::ObTimerTask { - public: +public: ObPartitionTableChecker(); virtual ~ObPartitionTableChecker(); @@ -121,7 +121,7 @@ class ObPartitionTableChecker : public common::ObTimerTask { int check_partition_table(); int check_dangling_replica_exist(const int64_t version); - private: +private: typedef common::hash::ObHashMap ObReplicaMap; static const int64_t SERVER_REPLICA_MAP_BUCKET_NUM = 64 * 1024; @@ -129,7 +129,7 @@ class ObPartitionTableChecker : public common::ObTimerTask { static const int64_t PT_CHECK_QUEUE_SIZE = 64; static const int64_t PTTASK_MAP_SIZE = 256; static const int64_t PT_CHECK_THREAD_DEAD_THRESHOLD = 300L * 1000L * 1000L; // 300s - private: +private: // iterator partition table, and put replicas in current observer in hashset int build_replica_map(ObReplicaMap& server_replica_map); // check replica exist in partition table but not in observer @@ -139,7 +139,7 @@ class ObPartitionTableChecker : public common::ObTimerTask { share::ObPartitionReplica& replica, share::ObPartitionReplica& local_replica, bool& is_equal); int member_list_is_equal(share::ObPartitionReplica::MemberList& a, share::ObPartitionReplica::MemberList& b); - private: +private: bool inited_; volatile bool stopped_; share::ObPartitionTableOperator* pt_operator_; @@ -149,7 +149,7 @@ class ObPartitionTableChecker : public common::ObTimerTask { int tg_id_; common::ObDedupQueue queue_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionTableChecker); }; diff --git a/src/observer/ob_partition_table_updater.h b/src/observer/ob_partition_table_updater.h index a05836d1e..55b4ff3fb 100644 --- a/src/observer/ob_partition_table_updater.h +++ b/src/observer/ob_partition_table_updater.h @@ -35,7 +35,7 @@ namespace observer { // fill partition replica class ObIPartitionReplicaFiller { - public: +public: ObIPartitionReplicaFiller() {} ~ObIPartitionReplicaFiller() @@ -51,10 +51,10 @@ class ObIPartitionReplicaFiller { class ObPartitionTableUpdater; class ObPTUpdateRoleTask : public common::ObDLinkBase { - public: +public: friend class ObPartitionTableUpdater; - public: +public: ObPTUpdateRoleTask() : pkey_(), data_version_(0), first_submit_time_(0) {} virtual ~ObPTUpdateRoleTask(); @@ -85,7 +85,7 @@ class ObPTUpdateRoleTask : public common::ObDLinkBase { } TO_STRING_KV(K_(pkey), K_(data_version), K_(first_submit_time)); - private: +private: common::ObPartitionKey pkey_; int64_t data_version_; // no task with the same pkey shall exist in the task queue, @@ -96,7 +96,7 @@ class ObPTUpdateRoleTask : public common::ObDLinkBase { // partition table update task class ObPTUpdateTask : public common::ObDLinkBase { - public: +public: friend class ObPartitionTableUpdater; friend class TestBatchProcessQueue_test_task_Test; friend class TestBatchProcessQueue_test_single_update_Test; @@ -130,7 +130,7 @@ class ObPTUpdateTask : public common::ObDLinkBase { TO_STRING_KV(K_(part_key), K_(data_version), K_(first_submit_time), K_(is_remove), K_(with_role)); - private: +private: const static int64_t rpc_task_group_id_; common::ObPartitionKey part_key_; @@ -147,7 +147,7 @@ typedef ObUniqTaskQueue ObPTUpdateTaskQ typedef ObUniqTaskQueue ObPTUpdateRoleTaskQueue; class ObPartitionTableUpdater { - public: +public: friend class TestBatchProcessQueue_test_single_update_Test; friend class TestBatchProcessQueue_test_update_process_Test; friend class TestBatchProcessQueue_test_reput_Test; @@ -213,7 +213,7 @@ class ObPartitionTableUpdater { } static int throttle(const bool is_sys_table, const int return_code, const int64_t execute_time_us, bool& stopped); - private: +private: int get_pg_key(const common::ObPartitionKey& key, common::ObPGKey& pg_key); int get_queue(const common::ObPartitionKey& key, ObPTUpdateTaskQueue*& queue); int direct_execute(ObPTUpdateTask& task); @@ -232,7 +232,7 @@ class ObPartitionTableUpdater { const common::ObIArray& replicas, const bool with_role); int do_batch_execute(const common::ObIArray& tasks, const common::ObRole new_role); - private: +private: bool inited_; bool stopped_; ObPTUpdateTaskQueue core_table_queue_; diff --git a/src/observer/ob_pg_partition_meta_table_updater.h b/src/observer/ob_pg_partition_meta_table_updater.h index 6489abb13..321ed40a0 100644 --- a/src/observer/ob_pg_partition_meta_table_updater.h +++ b/src/observer/ob_pg_partition_meta_table_updater.h @@ -28,7 +28,7 @@ class ObPGPartitionMTUpdater; enum ObPGPartitionMTUpdateType { INSERT_ON_UPDATE, DELETE }; class ObPGPartitionMTUpdateTask : public common::ObDLinkBase { - public: +public: friend class ObPGPartitionMTUpdater; const static common::ObPartitionKey sync_pt_key_; ObPGPartitionMTUpdateTask(); @@ -59,7 +59,7 @@ class ObPGPartitionMTUpdateTask : public common::ObDLinkBase PartitionMetaTableTaskQueue; class ObPGPartitionMTUpdater { - public: +public: ObPGPartitionMTUpdater() { reset(); @@ -90,18 +90,18 @@ class ObPGPartitionMTUpdater { int sync_pg_pt(const int64_t version); virtual int process_barrier(const ObPGPartitionMTUpdateTask& task, bool& stopped); - public: +public: static ObPGPartitionMTUpdater& get_instance(); - private: +private: void add_tasks_to_queue_(const ObPGPartitionMTUpdateTask& task); int do_sync_pt_finish_(const int64_t version); - private: +private: static const int64_t UPDATER_THREAD_CNT = 8; static const int64_t MINI_MODE_UPDATER_THREAD_CNT = 1; - private: +private: bool is_inited_; bool is_running_; PartitionMetaTableTaskQueue task_queue_; diff --git a/src/observer/ob_rebuild_flag_reporter.h b/src/observer/ob_rebuild_flag_reporter.h index 4d796a8ad..9571d9c0e 100644 --- a/src/observer/ob_rebuild_flag_reporter.h +++ b/src/observer/ob_rebuild_flag_reporter.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace observer { class ObRebuildFlagReporter : public common::ObDLinkBase { - public: +public: ObRebuildFlagReporter(); virtual ~ObRebuildFlagReporter(); @@ -62,10 +62,10 @@ class ObRebuildFlagReporter : public common::ObDLinkBase TO_STRING_KV(K_(part_key), K_(server), K_(rebuild_flag)); - private: +private: int do_process(); - private: +private: bool inited_; common::ObPartitionKey part_key_; common::ObAddr server_; @@ -73,7 +73,7 @@ class ObRebuildFlagReporter : public common::ObDLinkBase }; class ObRebuildFlagUpdater { - public: +public: ObRebuildFlagUpdater() {} ~ObRebuildFlagUpdater() diff --git a/src/observer/ob_req_time_service.h b/src/observer/ob_req_time_service.h index 01867abe3..882a5f81a 100644 --- a/src/observer/ob_req_time_service.h +++ b/src/observer/ob_req_time_service.h @@ -54,7 +54,7 @@ struct ObReqTimeInfo : public common::ObDLinkBase { }; class ObGlobalReqTimeService { - public: +public: ObGlobalReqTimeService() : lock_(common::ObLatchIds::OB_REQ_TIMEINFO_LIST_LOCK), time_info_list_() {} @@ -117,7 +117,7 @@ class ObGlobalReqTimeService { static void check_req_timeinfo(); - private: +private: common::SpinRWLock lock_; common::ObDList time_info_list_; }; diff --git a/src/observer/ob_restore_ctx.h b/src/observer/ob_restore_ctx.h index 088c9fce2..8b72f1261 100644 --- a/src/observer/ob_restore_ctx.h +++ b/src/observer/ob_restore_ctx.h @@ -37,7 +37,7 @@ namespace observer { class ObVTIterCreator; class ObRestoreCtx { - public: +public: ObRestoreCtx() : schema_service_(NULL), sql_client_(NULL), @@ -62,7 +62,7 @@ class ObRestoreCtx { common::ObServerConfig* server_config_; obrpc::ObCommonRpcProxy* rs_rpc_proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRestoreCtx); }; diff --git a/src/observer/ob_restore_sql_modifier.h b/src/observer/ob_restore_sql_modifier.h index 36eb2db18..3741a7d24 100644 --- a/src/observer/ob_restore_sql_modifier.h +++ b/src/observer/ob_restore_sql_modifier.h @@ -21,7 +21,7 @@ class ObResultSet; namespace observer { class ObRestoreSQLModifier { - public: +public: virtual int modify(sql::ObResultSet& rs) = 0; }; } // namespace observer diff --git a/src/observer/ob_root_service_monitor.h b/src/observer/ob_root_service_monitor.h index 3c61caa14..79ce4aad3 100644 --- a/src/observer/ob_root_service_monitor.h +++ b/src/observer/ob_root_service_monitor.h @@ -26,7 +26,7 @@ class ObPartitionService; namespace observer { class ObRootServiceMonitor : public share::ObThreadPool { - public: +public: ObRootServiceMonitor(rootserver::ObRootService& root_service, storage::ObPartitionService& partition_service); virtual ~ObRootServiceMonitor(); int init(); @@ -34,20 +34,20 @@ class ObRootServiceMonitor : public share::ObThreadPool { int start(); void stop(); - private: +private: static const int64_t MONITOR_ROOT_SERVICE_INTERVAL_US = 100 * 1000; // 100ms int monitor_root_service(); int try_start_root_service(); int wait_rs_finish_start(); - private: +private: bool inited_; rootserver::ObRootService& root_service_; int64_t fail_count_; storage::ObPartitionService& partition_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRootServiceMonitor); }; } // end namespace observer diff --git a/src/observer/ob_rpc_extra_payload.h b/src/observer/ob_rpc_extra_payload.h index 672713620..6cbe8ae88 100644 --- a/src/observer/ob_rpc_extra_payload.h +++ b/src/observer/ob_rpc_extra_payload.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace observer { class ObRpcExtraPayload : public obrpc::ObIRpcExtraPayload { - public: +public: ObRpcExtraPayload() {} virtual ~ObRpcExtraPayload() @@ -35,7 +35,7 @@ class ObRpcExtraPayload : public obrpc::ObIRpcExtraPayload { return global_rpc_extra_payload; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcExtraPayload); }; diff --git a/src/observer/ob_rpc_intrusion_detect.cpp b/src/observer/ob_rpc_intrusion_detect.cpp index a0194c434..94add9e33 100644 --- a/src/observer/ob_rpc_intrusion_detect.cpp +++ b/src/observer/ob_rpc_intrusion_detect.cpp @@ -25,7 +25,7 @@ static int ez2ob_addr(ObAddr& addr, easy_addr_t ez_addr) addr.reset(); if (AF_INET == ez_addr.family) { addr.set_ipv4_addr(ntohl(ez_addr.u.addr), ntohs(ez_addr.port)); - } else if (AF_INET6 == ez_addr.family) { // ipv6 + } else if (AF_INET6 == ez_addr.family) { // ipv6 ret = OB_NOT_SUPPORTED; } return ret; diff --git a/src/observer/ob_rpc_processor_simple.h b/src/observer/ob_rpc_processor_simple.h index 683929d15..4feda05b8 100644 --- a/src/observer/ob_rpc_processor_simple.h +++ b/src/observer/ob_rpc_processor_simple.h @@ -24,44 +24,44 @@ #define OB_DEFINE_PROCESSOR_S(cls, pcode, pname) \ OB_DEFINE_PROCESSOR(cls, obrpc::pcode, pname) \ { \ - public: \ + public: \ explicit pname(const ObGlobalContext& gctx) : gctx_(gctx) \ {} \ \ - protected: \ + protected: \ int process(); \ \ - private: \ + private: \ const ObGlobalContext& gctx_; \ } #define OB_DEFINE_PROCESSOR_SM(cls, pcode, pname) \ OB_DEFINE_PROCESSOR(cls, obrpc::pcode, pname) \ { \ - public: \ + public: \ explicit pname(const ObGlobalContext& gctx) : gctx_(gctx) \ {} \ \ - protected: \ + protected: \ int process(); \ int after_process(); \ \ - private: \ + private: \ const ObGlobalContext& gctx_; \ } #define RPC_PROCESSOR_X(pcode, pname) \ OB_DEFINE_PROCESSOR(Srv, obrpc::pcode, pname) \ { \ - public: \ + public: \ explicit pname(int ret) : ret_(ret) \ {} \ \ - protected: \ + protected: \ int process(); \ int deserialize(); \ \ - private: \ + private: \ int ret_; \ } @@ -70,16 +70,16 @@ namespace observer { OB_DEFINE_PROCESSOR(Srv, obrpc::OB_GET_DIAGNOSE_ARGS, ObGetDiagnoseArgsP) { - public: +public: ObGetDiagnoseArgsP() : pwbuf_(), passwd_(), argsbuf_() { passwd_.assign_buffer(pwbuf_, sizeof(pwbuf_)); } - protected: +protected: int process(); - private: +private: char pwbuf_[64]; common::ObString passwd_; char argsbuf_[1024]; diff --git a/src/observer/ob_server.h b/src/observer/ob_server.h index 48cdc23cd..dd250f297 100644 --- a/src/observer/ob_server.h +++ b/src/observer/ob_server.h @@ -62,11 +62,11 @@ namespace observer { // server.destory(); // class ObServer { - public: +public: static const int64_t DEFAULT_ETHERNET_SPEED = 1000 / 8 * 1024 * 1024; // default 125m/s 1000Mbit static ObServer& get_instance(); - public: +public: int init(const ObServerOptions& opts, const ObPLogWriterCfg& log_cfg); void destroy(); @@ -76,10 +76,10 @@ class ObServer { int wait(); void set_stop(); - public: +public: // Refer to ObPurgeCompletedMonitorInfoTask class ObCTASCleanUpTask : public common::ObTimerTask { - public: + public: ObCTASCleanUpTask(); virtual ~ObCTASCleanUpTask() {} @@ -87,14 +87,14 @@ class ObServer { void destroy(); virtual void runTimerTask() override; - private: + private: const static int64_t CLEANUP_INTERVAL = 60L * 1000L * 1000L; // 60s ObServer* obs_; bool is_inited_; }; class ObRefreshTimeTask : public common::ObTimerTask { - public: + public: ObRefreshTimeTask(); virtual ~ObRefreshTimeTask() {} @@ -102,27 +102,27 @@ class ObServer { void destroy(); virtual void runTimerTask() override; - private: + private: const static int64_t REFRESH_INTERVAL = 60L * 60L * 1000L * 1000L; // 1hr ObServer* obs_; bool is_inited_; }; class ObRefreshTime { - public: + public: explicit ObRefreshTime(ObServer* obs) : obs_(obs) {} virtual ~ObRefreshTime() {} bool operator()(sql::ObSQLSessionMgr::Key key, sql::ObSQLSessionInfo* sess_info); - private: + private: ObServer* obs_; DISALLOW_COPY_AND_ASSIGN(ObRefreshTime); }; class ObCTASCleanUp { - public: + public: explicit ObCTASCleanUp(ObServer* obs, bool drop_flag) : obs_(obs), drop_flag_(drop_flag) {} virtual ~ObCTASCleanUp() @@ -166,7 +166,7 @@ class ObServer { TEMP_TAB_PROXY_RULE // Temporary table cleanup rules (PROXY) }; - private: + private: ObServer* obs_; uint64_t session_id_; // Determine whether the sesion_id of the table schema needs to be dropped int64_t schema_version_; // Determine whether the version number of the table schema that needs to be dropped @@ -221,10 +221,10 @@ class ObServer { return sql_proxy_; } - private: +private: int stop(); - private: +private: ObServer(); ~ObServer(); @@ -271,10 +271,10 @@ class ObServer { int set_running_mode(); int check_server_can_start_service(); - public: +public: volatile bool need_ctas_cleanup_; // true: ObCTASCleanUpTask should traverse all table schemas to find the one need // be dropped - private: +private: // thread to deal signals ObSignalHandle signal_handle_; diff --git a/src/observer/ob_server_event_history_table_operator.h b/src/observer/ob_server_event_history_table_operator.h index cccf90d1a..e992e02ef 100644 --- a/src/observer/ob_server_event_history_table_operator.h +++ b/src/observer/ob_server_event_history_table_operator.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace observer { class ObAllServerEventHistoryTableOperator : public share::ObEventHistoryTableOperator { - public: +public: virtual ~ObAllServerEventHistoryTableOperator() {} @@ -27,7 +27,7 @@ class ObAllServerEventHistoryTableOperator : public share::ObEventHistoryTableOp static ObAllServerEventHistoryTableOperator& get_instance(); - private: +private: ObAllServerEventHistoryTableOperator() {} DISALLOW_COPY_AND_ASSIGN(ObAllServerEventHistoryTableOperator); diff --git a/src/observer/ob_server_memory_cutter.h b/src/observer/ob_server_memory_cutter.h index b6310a136..c7b955a93 100644 --- a/src/observer/ob_server_memory_cutter.h +++ b/src/observer/ob_server_memory_cutter.h @@ -18,10 +18,10 @@ namespace oceanbase { namespace observer { class ObServerMemoryCutter : public lib::ObIMemoryCutter { - public: +public: virtual void cut(int64_t& total_size) override; - private: +private: void free_cache(int64_t& total_size); }; diff --git a/src/observer/ob_server_reload_config.h b/src/observer/ob_server_reload_config.h index c9607ad98..c6d116a73 100644 --- a/src/observer/ob_server_reload_config.h +++ b/src/observer/ob_server_reload_config.h @@ -21,13 +21,13 @@ namespace observer { class ObGlobalContext; class ObServerReloadConfig : public common::ObReloadConfig { - public: +public: ObServerReloadConfig(common::ObServerConfig& config, ObGlobalContext& gctx); virtual ~ObServerReloadConfig(); int operator()(); - private: +private: ObGlobalContext& gctx_; }; diff --git a/src/observer/ob_server_schema_updater.h b/src/observer/ob_server_schema_updater.h index 1b8c81e0d..34f309fb4 100644 --- a/src/observer/ob_server_schema_updater.h +++ b/src/observer/ob_server_schema_updater.h @@ -32,7 +32,7 @@ class ObServerSchemaUpdater; typedef ObUniqTaskQueue ObServerSchemaTaskQueue; class ObServerSchemaTask : public common::ObDLinkBase { - public: +public: friend class ObServerSchemaUpdater; enum TYPE { ASYNC_REFRESH, // async schema refresh task caused by sql @@ -73,14 +73,14 @@ class ObServerSchemaTask : public common::ObDLinkBase { } TO_STRING_KV(K_(type), K_(did_retry), K_(schema_info)); - private: +private: TYPE type_; bool did_retry_; share::schema::ObRefreshSchemaInfo schema_info_; }; class ObServerSchemaUpdater { - public: +public: ObServerSchemaUpdater() : schema_mgr_(NULL), inited_(false) {} ~ObServerSchemaUpdater() @@ -99,12 +99,12 @@ class ObServerSchemaUpdater { int process_barrier(const ObServerSchemaTask& task, bool& stopped); int batch_process_tasks(const common::ObIArray& batch_tasks, bool& stopped); - private: +private: int process_refresh_task(const ObServerSchemaTask& task); int process_release_task(); int process_async_refresh_tasks(const common::ObIArray& tasks); - private: +private: static const int32_t SSU_MAX_THREAD_NUM = 1; static const int64_t SSU_TASK_QUEUE_SIZE = 1024; static const int64_t SSU_TASK_MAP_SIZE = 1024; diff --git a/src/observer/ob_server_struct.h b/src/observer/ob_server_struct.h index 03f2d3dc6..53ecf259d 100644 --- a/src/observer/ob_server_struct.h +++ b/src/observer/ob_server_struct.h @@ -86,7 +86,7 @@ class ObService; class ObVTIterCreator; class ObServerOptions { - public: +public: ObServerOptions() : rpc_port_(0), elect_port_(0), @@ -321,7 +321,7 @@ struct ObGlobalContext { return ATOMIC_LOAD(&sync_standby_redo_options_.net_timeout_); } - private: +private: common::SpinRWLock cluster_info_rwlock_; share::ObClusterInfo cluster_info_; int64_t cluster_idx_; // Internal identification of cluster @@ -345,7 +345,7 @@ struct ObUseWeakGuard { ~ObUseWeakGuard(); static bool did_use_weak(); - private: +private: struct TSIUseWeak { bool inited_; bool did_use_weak_; diff --git a/src/observer/ob_server_utils.h b/src/observer/ob_server_utils.h index 59b30bfd7..6d9413600 100644 --- a/src/observer/ob_server_utils.h +++ b/src/observer/ob_server_utils.h @@ -22,14 +22,14 @@ using common::ObString; namespace observer { class ObServerUtils { - public: +public: // Get the server's ipstr. // @param [in] allocator. // @param [out] server's ip str. // @return the error code. static int get_server_ip(ObIAllocator* allocator, ObString& ipstr); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObServerUtils); }; } // namespace observer diff --git a/src/observer/ob_service.h b/src/observer/ob_service.h index b4742a08b..89f7c885e 100644 --- a/src/observer/ob_service.h +++ b/src/observer/ob_service.h @@ -49,7 +49,7 @@ class ObServerInstance; class ObRemoteLocationGetter; class ObSchemaReleaseTimeTask : public common::ObTimerTask { - public: +public: ObSchemaReleaseTimeTask(); virtual ~ObSchemaReleaseTimeTask() {} @@ -57,7 +57,7 @@ class ObSchemaReleaseTimeTask : public common::ObTimerTask { void destroy(); virtual void runTimerTask() override; - private: +private: const static int64_t REFRESH_INTERVAL = 30L * 60L * 1000L * 1000L; // 30min ObServerSchemaUpdater* schema_updater_; bool is_inited_; @@ -66,7 +66,7 @@ class ObSchemaReleaseTimeTask : public common::ObTimerTask { class ObService : public ObIPartitionReplicaFiller, public share::ObIPartPropertyGetter, public storage::ObIPartitionReport { - public: +public: explicit ObService(const ObGlobalContext& gctx); virtual ~ObService(); @@ -291,14 +291,14 @@ class ObService : public ObIPartitionReplicaFiller, int renew_in_zone_hb(const share::ObInZoneHbRequest& arg, share::ObInZoneHbResponse& result); int pre_process_server_reply(const obrpc::ObPreProcessServerReplyArg& arg); - private: +private: int register_self(); int check_server_empty(const obrpc::ObCheckServerEmptyArg& arg, const bool wait_log_scan, bool& server_empty); int schedule_pt_check_task(); int check_partition_need_update_pt_(const obrpc::ObCreatePartitionBatchArg& batch_arg, obrpc::ObCreatePartitionBatchRes& batch_res, bool& need_update); - private: +private: bool inited_; bool in_register_process_; bool service_started_; diff --git a/src/observer/ob_signal_handle.h b/src/observer/ob_signal_handle.h index 6525c1854..172a25479 100644 --- a/src/observer/ob_signal_handle.h +++ b/src/observer/ob_signal_handle.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace observer { class ObSignalHandle : public share::ObThreadPool { - public: +public: ObSignalHandle() {} ~ObSignalHandle() diff --git a/src/observer/ob_sql_client_decorator.h b/src/observer/ob_sql_client_decorator.h index 39147101d..b9dbb3f73 100644 --- a/src/observer/ob_sql_client_decorator.h +++ b/src/observer/ob_sql_client_decorator.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { // read will retry `retry_limit' times when failed class ObSQLClientRetry : public ObISQLClient { - public: +public: ObSQLClientRetry(ObISQLClient* sql_client, int32_t retry_limit) : sql_client_(sql_client), retry_limit_(retry_limit) {} virtual ~ObSQLClientRetry() @@ -45,11 +45,11 @@ class ObSQLClientRetry : public ObISQLClient { return NULL == sql_client_ ? false : sql_client_->is_oracle_mode(); } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSQLClientRetry); - private: +private: ObISQLClient* sql_client_; int32_t retry_limit_; }; @@ -57,7 +57,7 @@ class ObSQLClientRetry : public ObISQLClient { class ObMySQLProxy; // use READ_CONSISTENCY(WEAK) when did_retry_weak is true class ObSQLClientRetryWeak : public ObISQLClient { - public: +public: ObSQLClientRetryWeak(ObISQLClient* sql_client, bool did_use_weak = false, bool did_use_retry = false, int64_t snapshot_timestamp = OB_INVALID_TIMESTAMP, bool check_sys_variable = true) : sql_client_(sql_client), @@ -97,14 +97,14 @@ class ObSQLClientRetryWeak : public ObISQLClient { return NULL == sql_client_ ? false : sql_client_->is_oracle_mode(); } - private: +private: bool is_auto_mode() { return OB_INVALID_TENANT_ID != tenant_id_ || OB_INVALID_ID != table_id_; } int update_weak_read_snapshot_timestamp(const uint64_t tenant_id); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSQLClientRetryWeak); // functions @@ -115,7 +115,7 @@ class ObSQLClientRetryWeak : public ObISQLClient { int read_without_check_sys_variable( ObSingleConnectionProxy& single_conn_proxy, ReadResult& res, const uint64_t tenant_id, const char* sql); - private: +private: ObISQLClient* sql_client_; bool did_use_weak_; bool did_use_retry_; diff --git a/src/observer/ob_srv_deliver.h b/src/observer/ob_srv_deliver.h index ea06ef2f1..1d379a66f 100644 --- a/src/observer/ob_srv_deliver.h +++ b/src/observer/ob_srv_deliver.h @@ -35,13 +35,13 @@ using rpc::frame::ObiReqQHandler; using rpc::frame::ObReqQueue; class QueueThread { - public: +public: QueueThread(const char* thread_name = nullptr) : thread_(queue_, thread_name) {} - public: +public: class Thread : public lib::TGRunnable { - public: + public: Thread(ObReqQueue& queue, const char* thread_name) : queue_(queue), thread_name_(thread_name) {} void run1() @@ -52,7 +52,7 @@ class QueueThread { queue_.loop(); } - private: + private: ObReqQueue& queue_; const char* thread_name_; } thread_; @@ -60,7 +60,7 @@ class QueueThread { }; class ObSrvDeliver : public rpc::frame::ObReqQDeliver { - public: +public: ObSrvDeliver(ObiReqQHandler& qhandler, ObRpcSessionHandler& session_handler, ObGlobalContext& gctx); int init(); @@ -75,14 +75,14 @@ class ObSrvDeliver : public rpc::frame::ObReqQDeliver { int create_queue_thread(int tg_id, const char* thread_name, QueueThread*& qthread); - private: +private: int init_queue_threads(); int deliver_rpc_request(rpc::ObRequest& req); int deliver_mysql_request(rpc::ObRequest& req); - private: +private: bool is_inited_; bool stop_; common::ObAddr host_; @@ -95,7 +95,7 @@ class ObSrvDeliver : public rpc::frame::ObReqQDeliver { DISALLOW_COPY_AND_ASSIGN(ObSrvDeliver); - public: +public: static const int64_t MAX_QUEUE_LEN = 10000; static const int LEASE_TASK_THREAD_CNT = 3; static const int MINI_MODE_LEASE_TASK_THREAD_CNT = 1; diff --git a/src/observer/ob_srv_network_frame.h b/src/observer/ob_srv_network_frame.h index 4104a8da1..19cbacab6 100644 --- a/src/observer/ob_srv_network_frame.h +++ b/src/observer/ob_srv_network_frame.h @@ -34,7 +34,7 @@ namespace oceanbase { namespace observer { class ObSrvNetworkFrame { - public: +public: enum { NET_IO_NORMAL_GID = 0, NET_IO_HP_GID = 64, NET_IO_BATCH_GID = 72 }; explicit ObSrvNetworkFrame(ObGlobalContext& gctx); @@ -63,7 +63,7 @@ class ObSrvNetworkFrame { rpc::frame::ObReqTransport* get_batch_rpc_req_transport(); inline rpc::frame::ObReqTranslator& get_xlator(); - private: +private: ObGlobalContext& gctx_; ObSrvXlator xlator_; diff --git a/src/observer/ob_srv_task.h b/src/observer/ob_srv_task.h index eedc95496..20a47670c 100644 --- a/src/observer/ob_srv_task.h +++ b/src/observer/ob_srv_task.h @@ -23,7 +23,7 @@ class ObFreeSessionCtx; namespace observer { class ObSrvTask : public rpc::ObRequest { - public: +public: ObSrvTask() : ObRequest(ObRequest::OB_TASK) {} @@ -31,7 +31,7 @@ class ObSrvTask : public rpc::ObRequest { }; // end of class ObSrvTask class ObDisconnectTask : public ObSrvTask { - public: +public: ObDisconnectTask(const sql::ObFreeSessionCtx& ctx) : proc_(ctx) {} @@ -40,7 +40,7 @@ class ObDisconnectTask : public ObSrvTask { return proc_; } - private: +private: ObMPDisconnect proc_; }; // end of class ObDisconnectTAsk diff --git a/src/observer/ob_srv_xlator.h b/src/observer/ob_srv_xlator.h index d75ddb06e..335ad7640 100644 --- a/src/observer/ob_srv_xlator.h +++ b/src/observer/ob_srv_xlator.h @@ -79,7 +79,7 @@ void init_srv_xlator_for_migrator(ObSrvRpcXlator* xlator); void init_srv_xlator_for_others(ObSrvRpcXlator* xlator); class ObSrvRpcXlator : public ObRpcTranslator { - public: +public: explicit ObSrvRpcXlator(const ObGlobalContext& gctx) : gctx_(gctx) { memset(funcs_, 0, sizeof(funcs_)); @@ -99,26 +99,26 @@ class ObSrvRpcXlator : public ObRpcTranslator { int translate(rpc::ObRequest& req, ObReqProcessor*& processor); - protected: +protected: ObReqProcessor* get_processor(rpc::ObRequest&) { return NULL; } - private: +private: const ObGlobalContext& gctx_; DISALLOW_COPY_AND_ASSIGN(ObSrvRpcXlator); RPCProcessFunc funcs_[MAX_PCODE]; }; // end of class ObSrvRpcXlator class ObSrvMySQLXlator : public ObMySQLTranslator { - public: +public: explicit ObSrvMySQLXlator(const ObGlobalContext& gctx) : gctx_(gctx) {} int translate(rpc::ObRequest& req, ObReqProcessor*& processor); - protected: +protected: ObReqProcessor* get_processor(rpc::ObRequest&) { return NULL; @@ -127,13 +127,13 @@ class ObSrvMySQLXlator : public ObMySQLTranslator { // mpconnect use high memory, more limit than common int get_mp_connect_processor(ObReqProcessor*& ret_proc); - private: +private: const ObGlobalContext& gctx_; DISALLOW_COPY_AND_ASSIGN(ObSrvMySQLXlator); }; // end of class ObSrvMySQLXlator class ObSrvXlator : public rpc::frame::ObReqTranslator { - public: +public: explicit ObSrvXlator(const ObGlobalContext& gctx) : rpc_xlator_(gctx), mysql_xlator_(gctx), session_handler_() {} @@ -145,15 +145,15 @@ class ObSrvXlator : public rpc::frame::ObReqTranslator { inline ObRpcSessionHandler& get_session_handler(); - protected: +protected: ObReqProcessor* get_processor(rpc::ObRequest&); - private: +private: // This method must return non-null processor ObReqProcessor* get_error_rpc_processor(const int ret); ObReqProcessor* get_error_mysql_processor(const int ret); - private: +private: ObSrvRpcXlator rpc_xlator_; ObSrvMySQLXlator mysql_xlator_; ObRpcSessionHandler session_handler_; diff --git a/src/observer/ob_sstable_checksum_updater.h b/src/observer/ob_sstable_checksum_updater.h index 4100faf87..e02bd12e0 100644 --- a/src/observer/ob_sstable_checksum_updater.h +++ b/src/observer/ob_sstable_checksum_updater.h @@ -50,7 +50,7 @@ inline bool is_valid_checksum_update_type(const ObSSTableChecksumUpdateType upda } class ObSSTableChecksumUpdateTask : public common::ObDLinkBase { - public: +public: friend class ObSSTableChecksumUpdater; ObSSTableChecksumUpdateTask(); virtual ~ObSSTableChecksumUpdateTask() = default; @@ -77,7 +77,7 @@ class ObSSTableChecksumUpdateTask : public common::ObDLinkBase ObSSTableChecksumTaskQueue; class ObSSTableChecksumUpdater : public lib::TGRunnable { - public: +public: const static int64_t UPDATER_THREAD_CNT = 8; const static int64_t MINI_MODE_UPDATER_THREAD_CNT = 1; - public: +public: ObSSTableChecksumUpdater(); virtual ~ObSSTableChecksumUpdater() { @@ -112,12 +112,12 @@ class ObSSTableChecksumUpdater : public lib::TGRunnable { void destroy(); void run1() override; - private: +private: int reput_to_queue(const common::ObIArray& tasks); void try_submit_task(int64_t& time_to_wait); void add_tasks_to_queue(); - private: +private: const static int64_t EXPECT_BATCH_SIZE = 30; const static int64_t MAX_WAIT_TIME_US = 3000 * 1000L; // 3s const static int64_t COND_WAIT_US = 200 * 1000L; // 200ms diff --git a/src/observer/ob_tenant_duty_task.h b/src/observer/ob_tenant_duty_task.h index 69e7517bc..cb6259347 100644 --- a/src/observer/ob_tenant_duty_task.h +++ b/src/observer/ob_tenant_duty_task.h @@ -24,15 +24,15 @@ namespace observer { class ObTenantDutyTask : private common::ObTimerTask { static constexpr int64_t SCHEDULE_PERIOD = 10 * 1000L * 1000L; - public: +public: int schedule(int tg_id); ObTenantDutyTask(); - private: +private: void runTimerTask() override; void update_all_tenants(); - private: +private: int read_obj(uint64_t tenant_id, share::ObSysVarClassType sys_var, common::ObObj& obj); int read_int64(uint64_t tenant_id, share::ObSysVarClassType sys_var, int64_t& val); // There's no system variable with double type, so here the function @@ -49,18 +49,18 @@ class ObTenantDutyTask : private common::ObTimerTask { // Read tenant work area memory settings from tenant system variables. int read_tenant_wa_percentage(uint64_t tenant_id, int64_t& pctg); - private: +private: common::ObArenaAllocator allocator_; }; class ObTenantSqlMemoryTimerTask : private common::ObTimerTask { - public: +public: int schedule(int tg_id); - private: +private: void runTimerTask() override; - private: +private: static constexpr int64_t SCHEDULE_PERIOD = 3 * 1000L * 1000L; }; diff --git a/src/observer/ob_uniq_task_queue.h b/src/observer/ob_uniq_task_queue.h index 9a8196f63..aa52c46ee 100644 --- a/src/observer/ob_uniq_task_queue.h +++ b/src/observer/ob_uniq_task_queue.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace observer { // implement interface of DefaultSimpleAllocerAllocator struct ObHighPrioMemAllocator { - public: +public: explicit ObHighPrioMemAllocator(const char* label = common::ObModIds::OB_PARTITION_TABLE_TASK) { attr_.label_ = label; @@ -44,12 +44,12 @@ struct ObHighPrioMemAllocator { attr_ = attr; } - private: +private: common::ObMemAttr attr_; }; template struct Compare { - public: +public: bool operator()(const T& a, const T& b) const { return a.compare_without_version(b); @@ -61,7 +61,7 @@ struct Compare { // before process finish. template class ObUniqTaskQueue : public share::ObThreadPool { - public: +public: friend class TestBatchProcessQueue_test_reput_Test; friend class TestBatchProcessQueue_test_eput2_Test; friend class TestBatchProcessQueue_test_update_process_Test; @@ -105,7 +105,7 @@ class ObUniqTaskQueue : public share::ObThreadPool { return task_count_; } - private: +private: struct Group : public common::ObDLinkBase { Group() {} diff --git a/src/observer/omt/ob_cgroup_ctrl.h b/src/observer/omt/ob_cgroup_ctrl.h index 9f38f75da..fafb0fb15 100644 --- a/src/observer/omt/ob_cgroup_ctrl.h +++ b/src/observer/omt/ob_cgroup_ctrl.h @@ -26,7 +26,7 @@ class ObGroupName; namespace omt { class ObCgroupCtrl { - public: +public: ObCgroupCtrl() : valid_(false), last_cpu_usage_(0), last_usage_check_time_(0) {} ~ObCgroupCtrl() @@ -66,7 +66,7 @@ class ObCgroupCtrl { int get_cpu_usage(const uint64_t tenant_id, int32_t& cpu_usage); int create_user_tenant_group_dir(const uint64_t tenant_id, int level, const common::ObString& group); - private: +private: // The observer's initialization script will iterator the cgroup soft connection, // the directory layout is as follows: // ---bin/ @@ -103,7 +103,7 @@ class ObCgroupCtrl { int64_t last_cpu_usage_; int64_t last_usage_check_time_; - private: +private: int init_cgroup_root_dir_(const char* cgroup_path); int init_cgroup_dir_(const char* cgroup_path); int write_string_to_file_(const char* filename, const char* content); diff --git a/src/observer/omt/ob_multi_level_queue.h b/src/observer/omt/ob_multi_level_queue.h index fd6715016..393e8873a 100644 --- a/src/observer/omt/ob_multi_level_queue.h +++ b/src/observer/omt/ob_multi_level_queue.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace omt { class ObMultiLevelQueue { - public: +public: int init(const int64_t limit); int push(rpc::ObRequest& req, const int32_t level, const int32_t prio); int pop(common::ObLink*& task, const int32_t level, const int64_t timeout_us); @@ -39,7 +39,7 @@ class ObMultiLevelQueue { return pos; } - private: +private: common::ObPriorityQueue<1> queue_[MULTI_LEVEL_QUEUE_SIZE]; }; diff --git a/src/observer/omt/ob_multi_tenant.h b/src/observer/omt/ob_multi_tenant.h index 6a85da8b0..bcd0802e5 100644 --- a/src/observer/omt/ob_multi_tenant.h +++ b/src/observer/omt/ob_multi_tenant.h @@ -41,12 +41,12 @@ struct ObCtxMemConfig { }; class ObICtxMemConfigGetter { - public: +public: virtual int get(common::ObIArray& configs) = 0; }; class ObCtxMemConfigGetter : public ObICtxMemConfigGetter { - public: +public: virtual int get(common::ObIArray& configs); }; @@ -60,13 +60,13 @@ typedef common::ObVector TenantIdList; // This is the entry class of OMT module. class ObMultiTenant : public share::ObThreadPool { - public: +public: const static int64_t DEFAULT_TIMES_OF_WORKERS = 10; const static int64_t TIME_SLICE_PERIOD = 10000; constexpr static double DEFAULT_NODE_QUOTA = 16.; constexpr static double DEFAULT_QUOTA2THREAD = 2.; - public: +public: explicit ObMultiTenant(ObIWorkerProcessor& procor); int init(common::ObAddr myaddr, double node_quota = DEFAULT_NODE_QUOTA, @@ -111,11 +111,11 @@ class ObMultiTenant : public share::ObThreadPool { void set_workers_per_cpu(int64_t v); - protected: +protected: void run1(); int get_tenant_unsafe(const uint64_t tenant_id, ObTenant*& tenant) const; - protected: +protected: common::SpinRWLock lock_; double quota2token_; ObWorkerPool worker_pool_; @@ -129,7 +129,7 @@ class ObMultiTenant : public share::ObThreadPool { bool has_synced_; static ObICtxMemConfigGetter* mcg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultiTenant); }; // end of class ObMultiTenant diff --git a/src/observer/omt/ob_retry_queue.h b/src/observer/omt/ob_retry_queue.h index 8dff2285d..c2aa55335 100644 --- a/src/observer/omt/ob_retry_queue.h +++ b/src/observer/omt/ob_retry_queue.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace omt { const uint64_t RETRY_QUEUE_TIMESTEP = 10 * 1000L; class ObRetryQueue { - public: +public: ObRetryQueue() { last_timestamp_ = common::ObTimeUtility::current_time(); @@ -30,7 +30,7 @@ class ObRetryQueue { int pop(common::ObLink*& task); uint64_t get_last_timestamp() const; - private: +private: common::ObSpLinkQueue queue_[RETRY_QUEUE_SIZE]; uint64_t last_timestamp_; }; diff --git a/src/observer/omt/ob_tenant.h b/src/observer/omt/ob_tenant.h index 2b431c288..074c28777 100644 --- a/src/observer/omt/ob_tenant.h +++ b/src/observer/omt/ob_tenant.h @@ -49,7 +49,7 @@ class ObPxPool : public share::ObThreadPool { return false; } - public: +public: ObPxPool() : tenant_id_(common::OB_INVALID_ID), group_id_(0) {} int64_t get_pool_size() const @@ -65,13 +65,13 @@ class ObPxPool : public share::ObThreadPool { group_id_ = group_id; } - private: +private: uint64_t tenant_id_; uint64_t group_id_; }; class ObPxPools { - public: +public: static int mtl_init(ObPxPools*& pools) { int ret = common::OB_SUCCESS; @@ -89,7 +89,7 @@ class ObPxPools { pools = nullptr; } - public: +public: ObPxPools() : tenant_id_(common::OB_INVALID_ID) {} ~ObPxPools() @@ -99,12 +99,12 @@ class ObPxPools { int init(uint64_t tenant_id); int get_or_create(int64_t group_id, ObPxPool*& pool); - private: +private: void destroy(); int create_pool(int64_t group_id, ObPxPool*& pool); int delete_pool(int64_t group_id); - private: +private: uint64_t tenant_id_; common::SpinRWLock lock_; common::hash::ObHashMap pool_map_; @@ -136,7 +136,7 @@ typedef common::ObDLinkNode WorkerNode; typedef common::ObDList WorkerList; class MultiLevelReqCnt { - public: +public: MultiLevelReqCnt() { for (int i = 0; i < MAX_REQUEST_LEVEL; i++) { @@ -155,7 +155,7 @@ class MultiLevelReqCnt { return pos; } - private: +private: volatile uint64_t cnt_[MAX_REQUEST_LEVEL]; }; @@ -165,7 +165,7 @@ class ObResourceGroup friend class ObTenant; friend class GroupMap; - public: +public: using WListNode = common::ObDLinkNode; using WList = common::ObDList; enum { CALIBRATE_TOKEN_INTERVAL = 100 * 1000 }; @@ -286,11 +286,11 @@ class ObResourceGroup lib::ObMutex workers_lock_; - protected: +protected: WList workers_; common::ObPriorityQueue2<0, 1> req_queue_; - private: +private: bool inited_; // Mark whether the container has threads and queues allocated int32_t group_id_; @@ -312,7 +312,7 @@ class ObResourceGroup typedef common::FixedHash2 GroupHash; class GroupMap : public GroupHash // Store all group containers of the current tenant { - public: +public: GroupMap(void* buf, int64_t size) : GroupHash(buf, size), inited_(false) {} ~GroupMap() @@ -344,7 +344,7 @@ class GroupMap : public GroupHash // Store all group containers of the current return pos; } - private: +private: bool inited_; }; @@ -361,7 +361,7 @@ class ObTenant : public share::ObTenantBase { enum { CALIBRATE_WORKER_INTERVAL = 30 * 1000 * 1000 }; enum { CALIBRATE_TOKEN_INTERVAL = 100 * 1000 }; - public: +public: // Quick Queue Priorities enum { QQ_HIGH = 0, QQ_PRIOR_TO_NORMAL, QQ_NORMAL, QQ_MAX_PRIO }; // Request queue priorities @@ -433,7 +433,7 @@ class ObTenant : public share::ObTenantBase { "nesting workers", nesting_workers_.get_size(), "lq waiting workers", lq_waiting_workers_.get_size(), K_(req_queue), "large queued", large_req_queue_.size(), K_(multi_level_queue), K_(recv_level_rpc_cnt), K_(group_map)) - public: +public: static bool equal(const ObTenant* t1, const ObTenant* t2) { return (!OB_ISNULL(t1) && !OB_ISNULL(t2) && t1->id_ == t2->id_); @@ -492,7 +492,7 @@ class ObTenant : public share::ObTenantBase { // calling this function. void periodically_check(); - private: +private: // alloc NUM worker int acquire_level_worker(int64_t num, int64_t& succ_num, int32_t level); int acquire_more_worker(int64_t num, int64_t& succ_num); @@ -514,7 +514,7 @@ class ObTenant : public share::ObTenantBase { // The update of the resource manager is applied to the cgroup void check_resource_manager_plan(); - protected: +protected: // times of workers of cpu slice this tenant can alloc. const int64_t times_of_workers_; // max/min cpu read from unit @@ -590,7 +590,7 @@ class ObTenant : public share::ObTenantBase { common::ObSpinLock worker_list_lock_; - public: +public: common::ObLDLatch lock_; // Variables for V2 diff --git a/src/observer/omt/ob_tenant_config.h b/src/observer/omt/ob_tenant_config.h index 611a3e8f0..cd9546b79 100644 --- a/src/observer/omt/ob_tenant_config.h +++ b/src/observer/omt/ob_tenant_config.h @@ -31,9 +31,9 @@ using common::Source; class ObTenantConfigMgr; class ObTenantConfig : public ObCommonConfig { - public: +public: class TenantConfigUpdateTask : public common::ObTimerTask { - public: + public: TenantConfigUpdateTask() : config_mgr_(nullptr), tenant_config_(nullptr), @@ -72,7 +72,7 @@ class ObTenantConfig : public ObCommonConfig { }; friend class TenantConfigUpdateTask; - public: +public: ObTenantConfig(); ObTenantConfig(uint64_t tenant_id); int init(ObTenantConfigMgr* config_mgr); @@ -122,7 +122,7 @@ class ObTenantConfig : public ObCommonConfig { OB_UNIS_VERSION(1); - private: +private: uint64_t tenant_id_; int64_t current_version_; // currently processed task version int64_t newest_version_; @@ -135,7 +135,7 @@ class ObTenantConfig : public ObCommonConfig { common::ObLatch lock_; bool is_deleting_; - public: +public: /////////////////////////////////////////////////////////////////////////////// // use MACRO 'OB_TENANT_PARAMETER' to define new tenant parameters // in ob_parameter_seed.ipp diff --git a/src/observer/omt/ob_tenant_config_mgr.h b/src/observer/omt/ob_tenant_config_mgr.h index d346ea166..0d8cea831 100644 --- a/src/observer/omt/ob_tenant_config_mgr.h +++ b/src/observer/omt/ob_tenant_config_mgr.h @@ -28,7 +28,7 @@ namespace oceanbase { namespace omt { class ObTenantConfigGuard { - public: +public: ObTenantConfigGuard(); ObTenantConfigGuard(ObTenantConfig* config); virtual ~ObTenantConfigGuard(); @@ -49,7 +49,7 @@ class ObTenantConfigGuard { return config_; } - private: +private: ObTenantConfig* config_; }; @@ -130,7 +130,7 @@ using SuccessFunctor = std::function; using FailureFunctor = std::function; class ObTenantConfigMgr { - public: +public: static ObTenantConfigMgr& get_instance(); virtual ~ObTenantConfigMgr(); ObTenantConfigMgr(const ObTenantConfigMgr& config) = delete; @@ -184,7 +184,7 @@ class ObTenantConfigMgr { OB_UNIS_VERSION(1); - private: +private: ObTenantConfigMgr(); bool inited_; common::ObAddr self_; diff --git a/src/observer/omt/ob_tenant_node_balancer.h b/src/observer/omt/ob_tenant_node_balancer.h index 8e4db4abb..f3560246c 100644 --- a/src/observer/omt/ob_tenant_node_balancer.h +++ b/src/observer/omt/ob_tenant_node_balancer.h @@ -28,9 +28,9 @@ namespace omt { class ObMultiTenant; // monitor tenant units and create/delete/modify local OMT. class ObTenantNodeBalancer : public share::ObThreadPool { - public: +public: struct ServerResource { - public: + public: ServerResource() : max_cpu_(0), min_cpu_(0), max_memory_(0), min_memory_(0) {} ~ServerResource() @@ -48,7 +48,7 @@ class ObTenantNodeBalancer : public share::ObThreadPool { int64_t min_memory_; }; - public: +public: static OB_INLINE ObTenantNodeBalancer& get_instance(); int init(ObMultiTenant* omt, common::ObMySQLProxy& sql_proxy, const common::ObAddr& myaddr); @@ -71,7 +71,7 @@ class ObTenantNodeBalancer : public share::ObThreadPool { virtual void run1(); - private: +private: static const int64_t RECYCLE_LATENCY = 1000L * 1000L * 180L; ObTenantNodeBalancer(); ~ObTenantNodeBalancer(); @@ -85,7 +85,7 @@ class ObTenantNodeBalancer : public share::ObThreadPool { int create_new_tenant(share::ObUnitInfoGetter::ObTenantConfig& unit); DISALLOW_COPY_AND_ASSIGN(ObTenantNodeBalancer); - private: +private: ObMultiTenant* omt_; common::ObAddr myaddr_; share::ObUnitInfoGetter unit_getter_; diff --git a/src/observer/omt/ob_tenant_timezone.h b/src/observer/omt/ob_tenant_timezone.h index 0f8fb602e..035a0b83d 100644 --- a/src/observer/omt/ob_tenant_timezone.h +++ b/src/observer/omt/ob_tenant_timezone.h @@ -24,9 +24,9 @@ class ObTenantTimezoneMgr; class ObTenantTimezone { friend class ObTenantTimezoneMgr; - public: +public: class TenantTZUpdateTask : public common::ObTimerTask { - public: + public: TenantTZUpdateTask() : tenant_tz_mgr_(nullptr), tenant_tz_(nullptr), task_lock_() {} int init(ObTenantTimezoneMgr* tz_mgr, ObTenantTimezone* timezone) @@ -51,7 +51,7 @@ class ObTenantTimezone { }; friend class TenantTZUpdateTask; - public: +public: ObTenantTimezone(); ObTenantTimezone(uint64_t tenant_id); virtual ~ObTenantTimezone(); @@ -105,7 +105,7 @@ class ObTenantTimezone { }; VIRTUAL_TO_STRING_KV(K_(is_inited), K_(tenant_id), K_(ref_count)); - private: +private: bool is_inited_; uint64_t tenant_id_; ObTenantTimezoneMgr* tenant_tz_mgr_; diff --git a/src/observer/omt/ob_tenant_timezone_mgr.h b/src/observer/omt/ob_tenant_timezone_mgr.h index 542d9b503..52c5139b0 100644 --- a/src/observer/omt/ob_tenant_timezone_mgr.h +++ b/src/observer/omt/ob_tenant_timezone_mgr.h @@ -30,10 +30,10 @@ class ObMultiVersionSchemaService; namespace omt { class ObTenantTimezoneMgr { - private: +private: template class __ObTimezoneContainer : public common::hash::ObHashMap { - public: + public: __ObTimezoneContainer() { this->create(num, oceanbase::common::ObModIds::OB_HASH_BUCKET_TIME_ZONE_INFO_MAP, "HasNodTzInfM"); @@ -41,12 +41,12 @@ class ObTenantTimezoneMgr { virtual ~__ObTimezoneContainer() {} - private: + private: DISALLOW_COPY_AND_ASSIGN(__ObTimezoneContainer); }; // Obtain all_tenant_ids regularly and update the timezone_map in mgr. class UpdateAllTenantTask : public common::ObTimerTask { - public: + public: UpdateAllTenantTask(ObTenantTimezoneMgr* tenant_tz_mgr) : tenant_tz_mgr_(tenant_tz_mgr) {} virtual ~UpdateAllTenantTask() @@ -60,7 +60,7 @@ class ObTenantTimezoneMgr { const uint64_t SLEEP_USECONDS = 5000000; }; class DeleteTenantTZTask : public common::ObTimerTask { - public: + public: DeleteTenantTZTask(ObTenantTimezoneMgr* tenant_tz_mgr) : tenant_tz_mgr_(tenant_tz_mgr) {} int init(ObTenantTimezoneMgr* tz_mgr); @@ -74,7 +74,7 @@ class ObTenantTimezoneMgr { friend UpdateAllTenantTask; friend DeleteTenantTZTask; - public: +public: using TenantTimezoneMap = __ObTimezoneContainer; typedef int (*tenant_timezone_map_getter)(const uint64_t tenant_id, common::ObTZMapWrap& timezone_wrap); @@ -122,7 +122,7 @@ class ObTenantTimezoneMgr { } void destroy(); - private: +private: int get_tenant_timezone_inner( const uint64_t tenant_id, common::ObTZMapWrap& timezone_wrap, common::ObTimeZoneInfoManager*& tz_info_mgr); // static function of calling instance().get_tenant_timezone_map(). For init tenant_tz_map_getter_ @@ -130,7 +130,7 @@ class ObTenantTimezoneMgr { static int get_tenant_timezone_default(const uint64_t tenant_id, common::ObTZMapWrap& timezone_wrap); - private: +private: ObTenantTimezoneMgr(); common::ObArenaAllocator allocator_; bool is_inited_; @@ -147,7 +147,7 @@ class ObTenantTimezoneMgr { // tenants which have been dropped, waiting for ref_count = 0 and delete them. common::ObList drop_tenant_tz_; - public: +public: // tenant timezone getter, observer and liboblog init it during start up. tenant_timezone_map_getter tenant_tz_map_getter_; }; diff --git a/src/observer/omt/ob_th_worker.cpp b/src/observer/omt/ob_th_worker.cpp index 0a7ba7d8e..e63dc7373 100644 --- a/src/observer/omt/ob_th_worker.cpp +++ b/src/observer/omt/ob_th_worker.cpp @@ -84,7 +84,7 @@ void ObThWorker::destroy() } class ObDiagTenantGuard { - public: +public: ObDiagTenantGuard(ObThWorker& worker, uint64_t tenant_id) : worker_(worker) { if (OB_DIAG_TENANT_ID == tenant_id) { @@ -97,7 +97,7 @@ class ObDiagTenantGuard { worker_.reset_rpc_tenant(); } - private: +private: ObThWorker& worker_; }; @@ -400,7 +400,7 @@ void ObThWorker::worker(int64_t& tenant_id, int64_t& req_recv_timestamp, int32_t CREATE_WITH_TEMP_CONTEXT(param) { class AllocatorGuard { - public: + public: AllocatorGuard(ObIAllocator** allocator) : allocator_(allocator) { *allocator_ = &CURRENT_CONTEXT.get_arena_allocator(); @@ -410,7 +410,7 @@ void ObThWorker::worker(int64_t& tenant_id, int64_t& req_recv_timestamp, int32_t *allocator_ = nullptr; } - private: + private: ObIAllocator** allocator_; } allocator_guard(&allocator_); const uint64_t owner_id = diff --git a/src/observer/omt/ob_th_worker.h b/src/observer/omt/ob_th_worker.h index e50ce92f5..b219d4b14 100644 --- a/src/observer/omt/ob_th_worker.h +++ b/src/observer/omt/ob_th_worker.h @@ -38,11 +38,11 @@ static const int64_t WORKER_CHECK_PERIOD = 500L; static const int64_t REQUEST_WAIT_TIME = 10 * 1000L; class ObThWorker : public share::ObWorker, public lib::CoKThread { - public: +public: enum RequestType { RT_NOTASK, RT_NEW, RT_OLD }; enum class WStatus { STOPPED, IDLE, RUNNING, WAITING, RUNNABLE }; - public: +public: explicit ObThWorker(ObIWorkerProcessor& procor); virtual ~ObThWorker(); @@ -119,7 +119,7 @@ class ObThWorker : public share::ObWorker, public lib::CoKThread { return group_; } - private: +private: void set_th_worker_thread_name(uint64_t tenant_id); void wait_runnable(); void process_request(rpc::ObRequest& req); @@ -127,7 +127,7 @@ class ObThWorker : public share::ObWorker, public lib::CoKThread { void th_created(); void th_destroy(); - private: +private: ObIWorkerProcessor& procor_; bool is_inited_; @@ -164,7 +164,7 @@ class ObThWorker : public share::ObWorker, public lib::CoKThread { int64_t active_inactive_ts_; bool lq_token_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObThWorker); }; // end of class ObThWorker diff --git a/src/observer/omt/ob_token_calcer.h b/src/observer/omt/ob_token_calcer.h index 7278b3c40..debc96b95 100644 --- a/src/observer/omt/ob_token_calcer.h +++ b/src/observer/omt/ob_token_calcer.h @@ -31,7 +31,7 @@ class ObTokenCalcer { friend class TTC; // Tenant of Token Cacler class TTC { - public: + public: void prepare(ObTenant* tenant); void revise_min_max_tokens(int64_t& avail_tokens); @@ -63,11 +63,11 @@ class ObTokenCalcer { DECLARE_TO_STRING; - private: + private: double min_slice() const; double max_slice() const; - private: + private: ObTenant* tenant_; double weight_; int64_t min_tokens_; @@ -77,11 +77,11 @@ class ObTokenCalcer { }; using TTCVec = TTC[MAX_TENANT_COUNT]; - public: +public: explicit ObTokenCalcer(ObMultiTenant& omt); int calculate(); - private: +private: // Prepare tenants who's tokens should be calculated. It includes // two steps, filter out legal tenants and calculate min/max tokens // this round for tenant. @@ -122,7 +122,7 @@ class ObTokenCalcer { // number of tokens, target tokens larger than max or less than min. bool adjust_tenants(double& total_weights, int64_t& total_tokens, int64_t& offset); - private: +private: ObMultiTenant& omt_; // Number of tenants that participate in the reassignment of tokens. int64_t nttc_; diff --git a/src/observer/omt/ob_worker_pool.h b/src/observer/omt/ob_worker_pool.h index 19f1b47de..fc46fa81a 100644 --- a/src/observer/omt/ob_worker_pool.h +++ b/src/observer/omt/ob_worker_pool.h @@ -35,7 +35,7 @@ class ObWorkerPool { static const int64_t MAX_WORKER_CNT = 10240; typedef common::ObFixedQueue WorkerArray; - public: +public: explicit ObWorkerPool(ObIWorkerProcessor& procor); virtual ~ObWorkerPool(); @@ -47,11 +47,11 @@ class ObWorkerPool { void set_max(int64_t v); - private: +private: int create_worker(ObThWorker*& worker); void destroy_worker(ObThWorker* worker); - private: +private: bool is_inited_; int64_t init_cnt_; int64_t idle_cnt_; diff --git a/src/observer/omt/ob_worker_processor.h b/src/observer/omt/ob_worker_processor.h index a5d58261f..2dc7387a4 100644 --- a/src/observer/omt/ob_worker_processor.h +++ b/src/observer/omt/ob_worker_processor.h @@ -30,7 +30,7 @@ class ObReqTranslator; namespace omt { class ObIWorkerProcessor { - public: +public: virtual ~ObIWorkerProcessor() {} @@ -50,7 +50,7 @@ class ObFakeWorkerProcessor : public ObIWorkerProcessor { }; class ObWorkerProcessor : public ObIWorkerProcessor { - public: +public: ObWorkerProcessor(rpc::frame::ObReqTranslator& xlator, const common::ObAddr& myaddr); virtual void th_created(); @@ -58,10 +58,10 @@ class ObWorkerProcessor : public ObIWorkerProcessor { virtual int process(rpc::ObRequest& req); - private: +private: int process_one(rpc::ObRequest& req, int& process_ret); - private: +private: rpc::frame::ObReqTranslator& translator_; const common::ObAddr& myaddr_; }; // end of class ObWorkerProcessor diff --git a/src/observer/virtual_table/ob_agent_table_base.h b/src/observer/virtual_table/ob_agent_table_base.h index 96de53d44..e45fbcbbd 100644 --- a/src/observer/virtual_table/ob_agent_table_base.h +++ b/src/observer/virtual_table/ob_agent_table_base.h @@ -34,7 +34,7 @@ namespace observer { class ObInnerSQLResult; class ObAgentTableBase : public common::ObVirtualTableScannerIterator { - public: +public: typedef int (*convert_func_t)(const common::ObObj& src, common::ObObj& dst, common::ObIAllocator&); struct MapItem { MapItem() : base_col_name_(), convert_func_(NULL), combine_tenant_id_(false) @@ -62,7 +62,7 @@ class ObAgentTableBase : public common::ObVirtualTableScannerIterator { void destroy(); - protected: +protected: int build_base_table_mapping(); // init map item, which column not exist in base table. @@ -87,7 +87,7 @@ class ObAgentTableBase : public common::ObVirtualTableScannerIterator { virtual int change_column_value(const MapItem& item, ObIAllocator& allocator, ObObj& new_value); - protected: +protected: // Allocator used in inner_open() to inner_close() duration. common::ObArenaAllocator inner_allocator_; // save value to %allocator_bak_ before switch allocator_ to %inner_allocator_ diff --git a/src/observer/virtual_table/ob_agent_virtual_table.h b/src/observer/virtual_table/ob_agent_virtual_table.h index 08071123d..130067607 100644 --- a/src/observer/virtual_table/ob_agent_virtual_table.h +++ b/src/observer/virtual_table/ob_agent_virtual_table.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace observer { // mysql mode system table access agent for oracle tenant. class ObAgentVirtualTable : public ObAgentTableBase { - public: +public: ObAgentVirtualTable(); virtual ~ObAgentVirtualTable(); @@ -30,7 +30,7 @@ class ObAgentVirtualTable : public ObAgentTableBase { virtual int do_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: virtual int set_convert_func(convert_func_t& func, const share::schema::ObColumnSchemaV2& col, const share::schema::ObColumnSchemaV2& base_col) override; @@ -40,7 +40,7 @@ class ObAgentVirtualTable : public ObAgentTableBase { int should_add_tenant_condition(bool& need, const uint64_t tenant_id) const; - private: +private: // id of simple agent tenant before switching to system tenant. uint64_t general_tenant_id_; bool only_sys_data_; diff --git a/src/observer/virtual_table/ob_all_concurrency_object_pool.h b/src/observer/virtual_table/ob_all_concurrency_object_pool.h index 215270fac..bb8bca58d 100644 --- a/src/observer/virtual_table/ob_all_concurrency_object_pool.h +++ b/src/observer/virtual_table/ob_all_concurrency_object_pool.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace observer { class ObAllConcurrencyObjectPool : public common::ObVirtualTableScannerIterator { - public: +public: ObAllConcurrencyObjectPool(); virtual ~ObAllConcurrencyObjectPool(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -31,7 +31,7 @@ class ObAllConcurrencyObjectPool : public common::ObVirtualTableScannerIterator addr_ = &addr; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllConcurrencyObjectPool); common::ObAddr* addr_; common::ObVector flls_; diff --git a/src/observer/virtual_table/ob_all_data_type_class_table.h b/src/observer/virtual_table/ob_all_data_type_class_table.h index 0c29e5b7e..0f0e8b1ee 100644 --- a/src/observer/virtual_table/ob_all_data_type_class_table.h +++ b/src/observer/virtual_table/ob_all_data_type_class_table.h @@ -24,13 +24,13 @@ class ObAllDataTypeClassTable : public common::ObVirtualTableScannerIterator { DATA_TYPE_CLASS_STR, }; - public: +public: ObAllDataTypeClassTable(); virtual ~ObAllDataTypeClassTable(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllDataTypeClassTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_all_data_type_table.h b/src/observer/virtual_table/ob_all_data_type_table.h index b51ed7f0d..4bed8a086 100644 --- a/src/observer/virtual_table/ob_all_data_type_table.h +++ b/src/observer/virtual_table/ob_all_data_type_table.h @@ -25,13 +25,13 @@ class ObAllDataTypeTable : public common::ObVirtualTableScannerIterator { DATA_TYPE_CLASS, }; - public: +public: ObAllDataTypeTable(); virtual ~ObAllDataTypeTable(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllDataTypeTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_all_disk_stat.h b/src/observer/virtual_table/ob_all_disk_stat.h index 43de8dbb7..055c9d838 100644 --- a/src/observer/virtual_table/ob_all_disk_stat.h +++ b/src/observer/virtual_table/ob_all_disk_stat.h @@ -27,7 +27,7 @@ class ObObj; namespace observer { class ObInfoSchemaDiskStatTable : public common::ObVirtualTableScannerIterator { - public: +public: ObInfoSchemaDiskStatTable(); virtual ~ObInfoSchemaDiskStatTable(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -38,7 +38,7 @@ class ObInfoSchemaDiskStatTable : public common::ObVirtualTableScannerIterator { } virtual int set_ip(common::ObAddr* addr); - private: +private: enum DISK_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, diff --git a/src/observer/virtual_table/ob_all_latch.h b/src/observer/virtual_table/ob_all_latch.h index 0b63f6764..707dbd426 100644 --- a/src/observer/virtual_table/ob_all_latch.h +++ b/src/observer/virtual_table/ob_all_latch.h @@ -24,7 +24,7 @@ class ObDiagnoseTenantInfo; namespace observer { class ObAllLatch : public common::ObVirtualTableIterator { - public: +public: ObAllLatch(); virtual ~ObAllLatch(); virtual int inner_open(); @@ -36,7 +36,7 @@ class ObAllLatch : public common::ObVirtualTableIterator { addr_ = &addr; } - private: +private: enum SYS_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_all_plan_cache_stat.h b/src/observer/virtual_table/ob_all_plan_cache_stat.h index 9c2973958..3118305e8 100644 --- a/src/observer/virtual_table/ob_all_plan_cache_stat.h +++ b/src/observer/virtual_table/ob_all_plan_cache_stat.h @@ -40,7 +40,7 @@ enum ObPlanCacheStatType { }; class ObAllPlanCacheBase : public common::ObVirtualTableIterator { - public: +public: ObAllPlanCacheBase(); virtual ~ObAllPlanCacheBase(); inline void set_plan_cache_manager(sql::ObPlanCacheManager* pcm) @@ -52,7 +52,7 @@ class ObAllPlanCacheBase : public common::ObVirtualTableIterator { // deriative class specific virtual int inner_get_next_row() = 0; - protected: +protected: sql::ObPlanCacheManager* pcm_; common::ObSEArray tenant_id_array_; int64_t tenant_id_array_idx_; @@ -60,7 +60,7 @@ class ObAllPlanCacheBase : public common::ObVirtualTableIterator { }; class ObAllPlanCacheStat : public ObAllPlanCacheBase { - public: +public: ObAllPlanCacheStat() {} virtual ~ObAllPlanCacheStat() @@ -71,12 +71,12 @@ class ObAllPlanCacheStat : public ObAllPlanCacheBase { return get_row_from_tenants(); } - protected: +protected: int get_row_from_tenants(); int fill_cells(sql::ObPlanCache& plan_cache); virtual int get_all_tenant_ids(common::ObIArray& tenant_ids); - private: +private: enum { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -124,23 +124,23 @@ class ObAllPlanCacheStat : public ObAllPlanCacheBase { PCV_EXPIRE_BY_MEM }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllPlanCacheStat); }; // end of class ObAllPlanCacheStat class ObAllPlanCacheStatI1 : public ObAllPlanCacheStat { - public: +public: ObAllPlanCacheStatI1() {} virtual ~ObAllPlanCacheStatI1() {} - protected: +protected: int set_tenant_ids(const common::ObIArray& ranges); virtual int get_all_tenant_ids(common::ObIArray& tenant_ids); - private: +private: common::ObSEArray tenant_ids_; DISALLOW_COPY_AND_ASSIGN(ObAllPlanCacheStatI1); }; diff --git a/src/observer/virtual_table/ob_all_storage_stat.h b/src/observer/virtual_table/ob_all_storage_stat.h index 08bae5479..bcaae05e6 100644 --- a/src/observer/virtual_table/ob_all_storage_stat.h +++ b/src/observer/virtual_table/ob_all_storage_stat.h @@ -32,7 +32,7 @@ class ObPGPartition; namespace observer { class ObInfoSchemaStorageStatTable : public common::ObVirtualTableScannerIterator { - public: +public: ObInfoSchemaStorageStatTable(); virtual ~ObInfoSchemaStorageStatTable(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -43,7 +43,7 @@ class ObInfoSchemaStorageStatTable : public common::ObVirtualTableScannerIterato } virtual int set_ip(common::ObAddr* addr); - private: +private: enum STORAGE_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_all_virtual_backupset_history_mgr.h b/src/observer/virtual_table/ob_all_virtual_backupset_history_mgr.h index 0dccd0de6..ffee3e919 100644 --- a/src/observer/virtual_table/ob_all_virtual_backupset_history_mgr.h +++ b/src/observer/virtual_table/ob_all_virtual_backupset_history_mgr.h @@ -59,14 +59,14 @@ class ObAllVirtualBackupSetHistoryMgr : public common::ObVirtualTableScannerIter BACKUP_RECOVERY_WINDOW, }; - public: +public: ObAllVirtualBackupSetHistoryMgr(); virtual ~ObAllVirtualBackupSetHistoryMgr(); int init(common::ObMySQLProxy& sql_proxy); virtual void reset() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: bool is_inited_; ObMySQLProxy::MySQLResult res_; sqlclient::ObMySQLResult* result_; @@ -75,7 +75,7 @@ class ObAllVirtualBackupSetHistoryMgr : public common::ObVirtualTableScannerIter char backup_dest_str_[share::OB_MAX_BACKUP_DEST_LENGTH]; char cluster_version_display_[OB_INNER_TABLE_BACKUP_TASK_CLUSTER_FORMAT_LENGTH]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualBackupSetHistoryMgr); }; diff --git a/src/observer/virtual_table/ob_all_virtual_bad_block_table.h b/src/observer/virtual_table/ob_all_virtual_bad_block_table.h index 78391ac4e..ee6495025 100644 --- a/src/observer/virtual_table/ob_all_virtual_bad_block_table.h +++ b/src/observer/virtual_table/ob_all_virtual_bad_block_table.h @@ -22,14 +22,14 @@ namespace oceanbase { namespace observer { class ObVirtualBadBlockTable : public ObVirtualTableScannerIterator { - public: +public: ObVirtualBadBlockTable(); virtual ~ObVirtualBadBlockTable(); virtual int inner_get_next_row(common::ObNewRow*& row) override; virtual void reset() override; int init(const common::ObAddr& addr); - private: +private: enum BAD_BLOCK_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, diff --git a/src/observer/virtual_table/ob_all_virtual_clog_stat.h b/src/observer/virtual_table/ob_all_virtual_clog_stat.h index 876cd36fd..b1006c558 100644 --- a/src/observer/virtual_table/ob_all_virtual_clog_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_clog_stat.h @@ -24,23 +24,23 @@ class ObIPartitionGroupIterator; } // namespace storage namespace observer { class ObAllVirtualClogStat : public common::ObVirtualTableScannerIterator { - public: +public: explicit ObAllVirtualClogStat(storage::ObPartitionService* partition_service); virtual ~ObAllVirtualClogStat(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); void destroy(); - private: +private: int prepare_get_clog_stat_(); int finish_get_clog_stat_(); - private: +private: storage::ObPartitionService* partition_service_; storage::ObIPartitionGroupIterator* partition_iter_; - private: +private: char server_ip_buff_[common::OB_IP_PORT_STR_BUFF]; char leader_buff_[common::OB_IP_PORT_STR_BUFF]; char freeze_version_buff_[common::MAX_VERSION_LENGTH]; diff --git a/src/observer/virtual_table/ob_all_virtual_dag_warning_history.h b/src/observer/virtual_table/ob_all_virtual_dag_warning_history.h index abebaa7a3..94eb2f3b9 100644 --- a/src/observer/virtual_table/ob_all_virtual_dag_warning_history.h +++ b/src/observer/virtual_table/ob_all_virtual_dag_warning_history.h @@ -24,7 +24,7 @@ class ObSSTable; namespace observer { class ObAllVirtualDagWarningHistory : public common::ObVirtualTableScannerIterator { - public: +public: enum COLUMN_ID_LIST { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -44,10 +44,10 @@ class ObAllVirtualDagWarningHistory : public common::ObVirtualTableScannerIterat virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - protected: +protected: int fill_cells(storage::ObDagWarningInfo& dag_warning_info); - private: +private: char ip_buf_[common::OB_IP_STR_BUFF]; char task_id_buf_[common::OB_TRACE_STAT_BUFFER_SIZE]; storage::ObDagWarningInfo dag_warning_info_; diff --git a/src/observer/virtual_table/ob_all_virtual_deadlock_stat.h b/src/observer/virtual_table/ob_all_virtual_deadlock_stat.h index dee1db547..95ea62a8b 100644 --- a/src/observer/virtual_table/ob_all_virtual_deadlock_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_deadlock_stat.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualDeadlockStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualDeadlockStat() : start_to_read_(false), cycle_offset_(0), cur_id_(-1), end_id_(0) {} virtual ~ObAllVirtualDeadlockStat() @@ -26,12 +26,12 @@ class ObAllVirtualDeadlockStat : public common::ObVirtualTableScannerIterator { destroy(); } - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); virtual void destroy(); - private: +private: enum { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -47,13 +47,13 @@ class ObAllVirtualDeadlockStat : public common::ObVirtualTableScannerIterator { LOCK_WAIT_TS, }; - private: +private: bool start_to_read_; uint32_t cycle_offset_; int32_t cur_id_; int32_t end_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualDeadlockStat); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_all_virtual_diag_index_scan.h b/src/observer/virtual_table/ob_all_virtual_diag_index_scan.h index f81829d11..d6aa65162 100644 --- a/src/observer/virtual_table/ob_all_virtual_diag_index_scan.h +++ b/src/observer/virtual_table/ob_all_virtual_diag_index_scan.h @@ -23,7 +23,7 @@ namespace observer { class ObAllVirtualDiagIndexScan { typedef common::ObSEArray ObIndexArray; - public: +public: ObAllVirtualDiagIndexScan() : index_ids_() {} virtual ~ObAllVirtualDiagIndexScan() @@ -36,7 +36,7 @@ class ObAllVirtualDiagIndexScan { return index_ids_; } - private: +private: ObIndexArray index_ids_; DISALLOW_COPY_AND_ASSIGN(ObAllVirtualDiagIndexScan); }; diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_channel.h b/src/observer/virtual_table/ob_all_virtual_dtl_channel.h index 99764f007..5de2d1fb3 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_channel.h +++ b/src/observer/virtual_table/ob_all_virtual_dtl_channel.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace observer { class ObVirtualChannelInfo { - public: +public: ObVirtualChannelInfo() : is_local_(false), is_data_(false), @@ -51,7 +51,7 @@ class ObVirtualChannelInfo { TO_STRING_KV(K(channel_id_), K(op_id_), K(peer_id_), K(tenant_id_)); - public: +public: bool is_local_; // 1 bool is_data_; bool is_transmit_; @@ -76,7 +76,7 @@ class ObVirtualChannelInfo { }; class ObVirtualDtlChannelOp { - public: +public: explicit ObVirtualDtlChannelOp(common::ObArray* channels) : channels_(channels) {} @@ -86,14 +86,14 @@ class ObVirtualDtlChannelOp { } int operator()(sql::dtl::ObDtlChannel* entry); - private: +private: // the maxinum of get channels static const int64_t MAX_CHANNEL_CNT_PER_TENANT = 1000000; common::ObArray* channels_; }; class ObVirtualDtlChannelIterator { - public: +public: ObVirtualDtlChannelIterator(common::ObArenaAllocator* allocator); ~ObVirtualDtlChannelIterator() { @@ -118,14 +118,14 @@ class ObVirtualDtlChannelIterator { int get_next_channel(ObVirtualChannelInfo& chan_info); - private: +private: common::ObArenaAllocator* iter_allocator_; common::ObArray channels_; int64_t cur_nth_channel_; }; class ObAllVirtualDtlChannel : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualDtlChannel(); ~ObAllVirtualDtlChannel() { @@ -137,7 +137,7 @@ class ObAllVirtualDtlChannel : public common::ObVirtualTableScannerIterator { int inner_open(); int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum STORAGE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -165,7 +165,7 @@ class ObAllVirtualDtlChannel : public common::ObVirtualTableScannerIterator { }; int get_row(ObVirtualChannelInfo& chan_info, common::ObNewRow*& row); - private: +private: common::ObString ipstr_; int32_t port_; common::ObArenaAllocator arena_allocator_; diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp index c4550e2a9..ac1a90f45 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp @@ -85,9 +85,9 @@ int ObAllVirtualDtlFirstCachedBufferIterator::init() } class ObAllVirtualDtlFirstCachedBufferPoolOp { - public: +public: class ObDtlFirstBufferHashMapOp { - public: + public: ObDtlFirstBufferHashMapOp(int64_t max_cnt, int64_t tenant_id, ObArray* first_buffer_info) : max_cnt_(max_cnt), tenant_id_(tenant_id), first_buffer_infos_(first_buffer_info) @@ -108,13 +108,13 @@ class ObAllVirtualDtlFirstCachedBufferPoolOp { return ret; } - private: + private: int64_t max_cnt_; int64_t tenant_id_; ObArray* first_buffer_infos_; }; - public: +public: explicit ObAllVirtualDtlFirstCachedBufferPoolOp( uint64_t tenant_id, ObArray* first_buffer_info) : tenant_id_(tenant_id), first_buffer_infos_(first_buffer_info) @@ -135,7 +135,7 @@ class ObAllVirtualDtlFirstCachedBufferPoolOp { return ret; } - private: +private: // the maxinum of get channels static const int64_t MAX_BUFFER_CNT_PER_TENANT = 1000; uint64_t tenant_id_; diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.h b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.h index 94946b89e..16883f349 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.h +++ b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualDtlFirstBufferInfo { - public: +public: ObAllVirtualDtlFirstBufferInfo() : tenant_id_(0), channel_id_(0), calced_val_(0), buffer_pool_id_(0), timeout_ts_(0) {} @@ -31,7 +31,7 @@ class ObAllVirtualDtlFirstBufferInfo { TO_STRING_KV(K(tenant_id_), K(channel_id_)); - public: +public: uint64_t tenant_id_; // 1 int64_t channel_id_; int64_t calced_val_; @@ -40,7 +40,7 @@ class ObAllVirtualDtlFirstBufferInfo { }; class ObAllVirtualDtlFirstCachedBufferIterator { - public: +public: ObAllVirtualDtlFirstCachedBufferIterator(common::ObArenaAllocator* iter_allocator); virtual ~ObAllVirtualDtlFirstCachedBufferIterator(); @@ -57,7 +57,7 @@ class ObAllVirtualDtlFirstCachedBufferIterator { int get_next_buffer_info(ObAllVirtualDtlFirstBufferInfo& buffer_info); - private: +private: static const int64_t MAX_BUFFER_CAPCITY = 1000; int64_t cur_tenant_idx_; int64_t cur_buffer_idx_; @@ -67,7 +67,7 @@ class ObAllVirtualDtlFirstCachedBufferIterator { }; class ObAllVirtualDtlFirstCachedBuffer : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualDtlFirstCachedBuffer(); virtual ~ObAllVirtualDtlFirstCachedBuffer(); @@ -76,10 +76,10 @@ class ObAllVirtualDtlFirstCachedBuffer : public common::ObVirtualTableScannerIte int inner_open(); int inner_get_next_row(common::ObNewRow*& row); - private: +private: int get_row(ObAllVirtualDtlFirstBufferInfo& buffer_info, common::ObNewRow*& row); - private: +private: enum STORAGE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -90,7 +90,7 @@ class ObAllVirtualDtlFirstCachedBuffer : public common::ObVirtualTableScannerIte TIMEOUT_TS, }; - private: +private: common::ObString ipstr_; int32_t port_; common::ObArenaAllocator arena_allocator_; diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_memory.h b/src/observer/virtual_table/ob_all_virtual_dtl_memory.h index 6c027e82a..754772dfe 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_memory.h +++ b/src/observer/virtual_table/ob_all_virtual_dtl_memory.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualDtlMemoryPoolInfo { - public: +public: ObAllVirtualDtlMemoryPoolInfo() : tenant_id_(0), channel_total_cnt_(0), @@ -45,7 +45,7 @@ class ObAllVirtualDtlMemoryPoolInfo { TO_STRING_KV(K(tenant_id_), K(seqno_)); - public: +public: uint64_t tenant_id_; // 1 int64_t channel_total_cnt_; int64_t channel_block_cnt_; @@ -63,7 +63,7 @@ class ObAllVirtualDtlMemoryPoolInfo { }; class ObAllVirtualDtlMemoryIterator { - public: +public: ObAllVirtualDtlMemoryIterator(common::ObArenaAllocator* iter_allocator); virtual ~ObAllVirtualDtlMemoryIterator(); @@ -77,7 +77,7 @@ class ObAllVirtualDtlMemoryIterator { int get_next_mem_pool_info(ObAllVirtualDtlMemoryPoolInfo& memory_pool_info); - private: +private: int64_t cur_tenant_idx_; int64_t cur_mem_pool_idx_; common::ObArenaAllocator* iter_allocator_; @@ -86,7 +86,7 @@ class ObAllVirtualDtlMemoryIterator { }; class ObAllVirtualDtlMemory : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualDtlMemory(); virtual ~ObAllVirtualDtlMemory(); @@ -95,10 +95,10 @@ class ObAllVirtualDtlMemory : public common::ObVirtualTableScannerIterator { int inner_open(); int inner_get_next_row(common::ObNewRow*& row); - private: +private: int get_row(ObAllVirtualDtlMemoryPoolInfo& mem_pool_info, common::ObNewRow*& row); - private: +private: enum STORAGE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -118,7 +118,7 @@ class ObAllVirtualDtlMemory : public common::ObVirtualTableScannerIterator { REAL_FREE_CNT, // OB_APP_MIN_COLUMN_ID + 15 }; - private: +private: common::ObString ipstr_; int32_t port_; common::ObArenaAllocator arena_allocator_; diff --git a/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.h b/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.h index d1b3958f3..fdf7a5691 100644 --- a/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.h +++ b/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.h @@ -17,12 +17,12 @@ namespace oceanbase { namespace observer { class ObAllVirtualDumpTenantInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualDumpTenantInfo(); virtual ~ObAllVirtualDumpTenantInfo(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: char ip_buf_[common::OB_IP_STR_BUFF]; bool is_inited_; DISALLOW_COPY_AND_ASSIGN(ObAllVirtualDumpTenantInfo); diff --git a/src/observer/virtual_table/ob_all_virtual_duplicate_partition_mgr_stat.h b/src/observer/virtual_table/ob_all_virtual_duplicate_partition_mgr_stat.h index ef303c484..c03c77269 100644 --- a/src/observer/virtual_table/ob_all_virtual_duplicate_partition_mgr_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_duplicate_partition_mgr_stat.h @@ -29,7 +29,7 @@ class ObTransService; namespace observer { class ObGVDuplicatePartitionMgrStat : public common::ObVirtualTableScannerIterator { - public: +public: ObGVDuplicatePartitionMgrStat(transaction::ObTransService* trans_service) : trans_service_(trans_service) { reset(); @@ -42,7 +42,7 @@ class ObGVDuplicatePartitionMgrStat : public common::ObVirtualTableScannerIterat void reset(); void destroy(); - private: +private: int prepare_start_to_read_(); int get_next_duplicate_partition_mgr_stat_(transaction::ObDuplicatePartitionStat& stat); static const int64_t OB_MIN_BUFFER_SIZE = 128; @@ -50,7 +50,7 @@ class ObGVDuplicatePartitionMgrStat : public common::ObVirtualTableScannerIterat char ip_buffer_[common::OB_IP_STR_BUFF]; char dup_table_lease_info_buffer_[OB_MAX_BUFFER_SIZE]; - private: +private: transaction::ObTransService* trans_service_; transaction::ObPartitionIterator partition_iter_; transaction::ObDuplicatePartitionStatIterator duplicate_partition_stat_iter_; diff --git a/src/observer/virtual_table/ob_all_virtual_election_event_history.h b/src/observer/virtual_table/ob_all_virtual_election_event_history.h index c3671a42c..a3cabdc73 100644 --- a/src/observer/virtual_table/ob_all_virtual_election_event_history.h +++ b/src/observer/virtual_table/ob_all_virtual_election_event_history.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace observer { class ObGVElectionEventHistory : public common::ObVirtualTableScannerIterator { - public: +public: ObGVElectionEventHistory() : ObVirtualTableScannerIterator() { reset(); @@ -37,15 +37,15 @@ class ObGVElectionEventHistory : public common::ObVirtualTableScannerIterator { destroy(); } - public: +public: int inner_get_next_row(common::ObNewRow*& row) override; void reset(); void destroy(); - private: +private: int prepare_to_read_(); - private: +private: election::ObElectionMgr* election_mgr_; char ip_buffer_[common::OB_IP_STR_BUFF]; char event_buffer_[32]; @@ -53,7 +53,7 @@ class ObGVElectionEventHistory : public common::ObVirtualTableScannerIterator { char current_leader_ip_port_buffer_[common::OB_IP_PORT_STR_BUFF]; election::ObElectionEventHistoryIterator event_history_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVElectionEventHistory); }; diff --git a/src/observer/virtual_table/ob_all_virtual_election_group_info.h b/src/observer/virtual_table/ob_all_virtual_election_group_info.h index 52862be7d..92806b032 100644 --- a/src/observer/virtual_table/ob_all_virtual_election_group_info.h +++ b/src/observer/virtual_table/ob_all_virtual_election_group_info.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace observer { class ObGVElectionGroupInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObGVElectionGroupInfo() : ObVirtualTableScannerIterator() { reset(); @@ -37,15 +37,15 @@ class ObGVElectionGroupInfo : public common::ObVirtualTableScannerIterator { destroy(); } - public: +public: int inner_get_next_row(common::ObNewRow*& row); void reset(); void destroy(); - private: +private: int prepare_to_read_(); - private: +private: election::ObElectionMgr* election_mgr_; char ip_buffer_[common::OB_IP_STR_BUFF]; char current_leader_ip_port_buffer_[common::OB_IP_PORT_STR_BUFF]; @@ -54,7 +54,7 @@ class ObGVElectionGroupInfo : public common::ObVirtualTableScannerIterator { char member_list_buffer_[common::MAX_MEMBER_LIST_LENGTH]; election::ObElectionGroupInfoIterator election_info_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVElectionGroupInfo); }; diff --git a/src/observer/virtual_table/ob_all_virtual_election_info.h b/src/observer/virtual_table/ob_all_virtual_election_info.h index add469a5f..fe7c6538d 100644 --- a/src/observer/virtual_table/ob_all_virtual_election_info.h +++ b/src/observer/virtual_table/ob_all_virtual_election_info.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace observer { class ObGVElectionInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObGVElectionInfo() : ObVirtualTableScannerIterator() { reset(); @@ -37,15 +37,15 @@ class ObGVElectionInfo : public common::ObVirtualTableScannerIterator { destroy(); } - public: +public: int inner_get_next_row(common::ObNewRow*& row); void reset(); void destroy(); - private: +private: int prepare_to_read_(); - private: +private: election::ObElectionMgr* election_mgr_; char ip_buffer_[common::OB_IP_STR_BUFF]; char current_leader_ip_port_buffer_[common::OB_IP_PORT_STR_BUFF]; @@ -54,7 +54,7 @@ class ObGVElectionInfo : public common::ObVirtualTableScannerIterator { char member_list_buffer_[common::MAX_MEMBER_LIST_LENGTH]; election::ObElectionInfoIterator election_info_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVElectionInfo); }; diff --git a/src/observer/virtual_table/ob_all_virtual_election_mem_stat.h b/src/observer/virtual_table/ob_all_virtual_election_mem_stat.h index 3c434f1bc..8e54b02df 100644 --- a/src/observer/virtual_table/ob_all_virtual_election_mem_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_election_mem_stat.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace observer { class ObGVElectionMemStat : public common::ObVirtualTableScannerIterator { - public: +public: ObGVElectionMemStat() : ObVirtualTableScannerIterator() { reset(); @@ -37,21 +37,21 @@ class ObGVElectionMemStat : public common::ObVirtualTableScannerIterator { destroy(); } - public: +public: int inner_get_next_row(common::ObNewRow*& row); void reset(); void destroy(); - private: +private: int prepare_to_read_(); - private: +private: election::ObElectionMgr* election_mgr_; char ip_buffer_[common::OB_IP_STR_BUFF]; char type_name_[election::ObElectionMemStat::OB_ELECTION_TYPE_NAME_LENGTH]; election::ObElectionMemStatIterator election_mem_stat_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVElectionMemStat); }; diff --git a/src/observer/virtual_table/ob_all_virtual_election_priority.h b/src/observer/virtual_table/ob_all_virtual_election_priority.h index 9a5947e11..f13494e6c 100644 --- a/src/observer/virtual_table/ob_all_virtual_election_priority.h +++ b/src/observer/virtual_table/ob_all_virtual_election_priority.h @@ -24,11 +24,11 @@ class ObIPartitionGroupIterator; } // namespace storage namespace observer { class ObAllVirtualElectionPriority : public common::ObVirtualTableScannerIterator { - public: +public: explicit ObAllVirtualElectionPriority(storage::ObPartitionService* partition_service); virtual ~ObAllVirtualElectionPriority(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); void set_addr(common::ObAddr& addr) { @@ -36,16 +36,16 @@ class ObAllVirtualElectionPriority : public common::ObVirtualTableScannerIterato } void destroy(); - private: +private: int inner_get_next_row_(common::ObNewRow*& row); int prepare_get_election_priority_(); int finish_get_election_priority_(); - private: +private: storage::ObPartitionService* partition_service_; storage::ObIPartitionGroupIterator* partition_iter_; - private: +private: common::ObAddr addr_; char server_ip_buff_[common::OB_IP_STR_BUFF]; }; // class ObAllVirtualElectionPriority diff --git a/src/observer/virtual_table/ob_all_virtual_engine_table.h b/src/observer/virtual_table/ob_all_virtual_engine_table.h index 3842fa35c..cb6e2325b 100644 --- a/src/observer/virtual_table/ob_all_virtual_engine_table.h +++ b/src/observer/virtual_table/ob_all_virtual_engine_table.h @@ -28,12 +28,12 @@ class ObAllVirtualEngineTable : public common::ObVirtualTableScannerIterator { SAVEPOINTS, }; - public: +public: ObAllVirtualEngineTable(); virtual ~ObAllVirtualEngineTable(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualEngineTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_all_virtual_files_table.h b/src/observer/virtual_table/ob_all_virtual_files_table.h index 7a29b6bf3..5e3999f56 100644 --- a/src/observer/virtual_table/ob_all_virtual_files_table.h +++ b/src/observer/virtual_table/ob_all_virtual_files_table.h @@ -18,12 +18,12 @@ namespace oceanbase { namespace observer { class ObAllVirtualFilesTable : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualFilesTable(); virtual ~ObAllVirtualFilesTable(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualFilesTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_all_virtual_io_stat.h b/src/observer/virtual_table/ob_all_virtual_io_stat.h index 6f0909d2f..eb5c72a19 100644 --- a/src/observer/virtual_table/ob_all_virtual_io_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_io_stat.h @@ -19,12 +19,12 @@ namespace oceanbase { namespace observer { class ObAllVirtualIOStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualIOStat(); virtual ~ObAllVirtualIOStat(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum IOStatColumn { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -36,12 +36,12 @@ class ObAllVirtualIOStat : public common::ObVirtualTableScannerIterator { IO_BENCH_RESULT, }; - private: +private: char svr_ip_[common::OB_IP_STR_BUFF]; char disk_type_[common::OB_MAX_DISK_TYPE_LENGTH]; char io_bench_result_[common::OB_MAX_IO_BENCH_RESULT_LENGTH]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualIOStat); }; diff --git a/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.h b/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.h index 78dbf430f..56202df07 100644 --- a/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualLockWaitStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualLockWaitStat() : node_iter_(NULL) {} virtual ~ObAllVirtualLockWaitStat() @@ -27,15 +27,15 @@ class ObAllVirtualLockWaitStat : public common::ObVirtualTableScannerIterator { reset(); } - public: +public: virtual int inner_open(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: int make_this_ready_to_read(); - private: +private: enum { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -57,7 +57,7 @@ class ObAllVirtualLockWaitStat : public common::ObVirtualTableScannerIterator { rpc::ObLockWaitNode cur_node_; rpc::ObLockWaitNode* node_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualLockWaitStat); }; diff --git a/src/observer/virtual_table/ob_all_virtual_long_ops_status.h b/src/observer/virtual_table/ob_all_virtual_long_ops_status.h index 814050b8a..acce5c6fd 100644 --- a/src/observer/virtual_table/ob_all_virtual_long_ops_status.h +++ b/src/observer/virtual_table/ob_all_virtual_long_ops_status.h @@ -21,16 +21,16 @@ namespace oceanbase { namespace observer { class ObAllVirtualLongOpsStatus : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualLongOpsStatus(); virtual ~ObAllVirtualLongOpsStatus() = default; int init(); virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: int convert_stat_to_row(const storage::ObILongOpsStat& stat, common::ObNewRow*& row); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualLongOpsStatus); bool is_inited_; storage::ObLongOpsMonitorIterator iter_; diff --git a/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.h b/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.h index a104a3570..f140a3dec 100644 --- a/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.h +++ b/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualMacroBlockMarkerStatus : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualMacroBlockMarkerStatus(); virtual ~ObAllVirtualMacroBlockMarkerStatus(); @@ -29,7 +29,7 @@ class ObAllVirtualMacroBlockMarkerStatus : public common::ObVirtualTableScannerI virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: char svr_ip_[common::MAX_IP_ADDR_LENGTH]; char comment_[common::MAX_TABLE_COMMENT_LENGTH]; blocksstable::ObMacroBlockMarkerStatus marker_status_; diff --git a/src/observer/virtual_table/ob_all_virtual_memory_context_stat.h b/src/observer/virtual_table/ob_all_virtual_memory_context_stat.h index 83431ffae..edd9fdf7e 100644 --- a/src/observer/virtual_table/ob_all_virtual_memory_context_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_memory_context_stat.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace observer { class ObAllVirtualMemoryContextStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualMemoryContextStat(); virtual ~ObAllVirtualMemoryContextStat(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: char ip_buf_[common::OB_IP_STR_BUFF]; char entity_buf_[32]; char p_entity_buf_[32]; diff --git a/src/observer/virtual_table/ob_all_virtual_memory_info.h b/src/observer/virtual_table/ob_all_virtual_memory_info.h index 32232ba9a..14dbd487d 100644 --- a/src/observer/virtual_table/ob_all_virtual_memory_info.h +++ b/src/observer/virtual_table/ob_all_virtual_memory_info.h @@ -22,14 +22,14 @@ class ObTenantManager; } namespace observer { class ObAllVirtualMemoryInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualMemoryInfo(); virtual ~ObAllVirtualMemoryInfo(); virtual int inner_open(); virtual void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum CACHE_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_all_virtual_memstore_info.h b/src/observer/virtual_table/ob_all_virtual_memstore_info.h index 75a236462..958edaf2c 100644 --- a/src/observer/virtual_table/ob_all_virtual_memstore_info.h +++ b/src/observer/virtual_table/ob_all_virtual_memstore_info.h @@ -28,11 +28,11 @@ class ObMemtable; } namespace observer { class ObAllVirtualMemstoreInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualMemstoreInfo(); virtual ~ObAllVirtualMemstoreInfo(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); inline void set_partition_service(storage::ObPartitionService* partition_service) @@ -44,11 +44,11 @@ class ObAllVirtualMemstoreInfo : public common::ObVirtualTableScannerIterator { addr_ = addr; } - private: +private: int make_this_ready_to_read(); int get_next_memtable(memtable::ObMemtable*& mt); - private: +private: storage::ObPartitionService* partition_service_; common::ObAddr addr_; common::ObPartitionKey pkey_; @@ -59,7 +59,7 @@ class ObAllVirtualMemstoreInfo : public common::ObVirtualTableScannerIterator { common::ObArray memtables_; int64_t memtable_array_pos_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualMemstoreInfo); }; diff --git a/src/observer/virtual_table/ob_all_virtual_partition_amplification_stat.h b/src/observer/virtual_table/ob_all_virtual_partition_amplification_stat.h index 2e7daf866..9596ba733 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_amplification_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_amplification_stat.h @@ -23,7 +23,7 @@ class ObPGPartitionIterator; namespace observer { class ObAllPartitionAmplificationStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllPartitionAmplificationStat(); virtual ~ObAllPartitionAmplificationStat(); virtual int inner_get_next_row(common::ObNewRow*& row) override; @@ -36,7 +36,7 @@ class ObAllPartitionAmplificationStat : public common::ObVirtualTableScannerIter } virtual void reset() override; - private: +private: enum TABLE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, diff --git a/src/observer/virtual_table/ob_all_virtual_partition_audit.h b/src/observer/virtual_table/ob_all_virtual_partition_audit.h index 08f86d5f7..b02a321bc 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_audit.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_audit.h @@ -23,14 +23,14 @@ class ObIPartitionGroupIterator; namespace observer { class ObAllVirtualPartitionAudit : public ObVirtualTableScannerIterator { - public: +public: ObAllVirtualPartitionAudit(); virtual ~ObAllVirtualPartitionAudit(); int init(); virtual void reset() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: enum COLUMNS { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, diff --git a/src/observer/virtual_table/ob_all_virtual_partition_item.h b/src/observer/virtual_table/ob_all_virtual_partition_item.h index 8c9f28a06..46c63a63b 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_item.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_item.h @@ -54,14 +54,14 @@ class ObAllVirtualPartitionItem : public common::ObVirtualTableScannerIterator { static const int32_t COLUMN_COUNT = 20; static const int64_t BOUND_BUF_LENGTH = 100; - public: +public: ObAllVirtualPartitionItem(); virtual ~ObAllVirtualPartitionItem(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualPartitionItem); int fill_row_cells(const share::schema::ObSimpleTableSchemaV2& table_schema, share::schema::ObPartitionItem& item, const char* tenant_name); diff --git a/src/observer/virtual_table/ob_all_virtual_partition_location.h b/src/observer/virtual_table/ob_all_virtual_partition_location.h index da4fc371b..90461e25d 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_location.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_location.h @@ -42,7 +42,7 @@ class ObAllVirtualPartitionLocation : public common::ObVirtualTableIterator { DATA_VERSION, }; - public: +public: ObAllVirtualPartitionLocation(); virtual ~ObAllVirtualPartitionLocation(); virtual int inner_open(); @@ -50,11 +50,11 @@ class ObAllVirtualPartitionLocation : public common::ObVirtualTableIterator { int init(share::ObPartitionTableOperator& pt_operator); - private: +private: int get_query_key(uint64_t& tenant_id, uint64_t& table_id, int64_t& partition_id); int fill_row(const share::ObPartitionReplica& replica, common::ObNewRow*& row); - private: +private: bool inited_; ObArenaAllocator arena_allocator_; share::ObPartitionTableOperator* pt_operator_; diff --git a/src/observer/virtual_table/ob_all_virtual_partition_migration_status.h b/src/observer/virtual_table/ob_all_virtual_partition_migration_status.h index 957e4003e..58fbb050a 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_migration_status.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_migration_status.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualPartitionMigrationStatus : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualPartitionMigrationStatus(); virtual ~ObAllVirtualPartitionMigrationStatus(); @@ -31,7 +31,7 @@ class ObAllVirtualPartitionMigrationStatus : public common::ObVirtualTableScanne virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: enum TABLE_COLUMN { TASK_ID = common::OB_APP_MIN_COLUMN_ID, TENANT_ID, diff --git a/src/observer/virtual_table/ob_all_virtual_partition_replay_status.h b/src/observer/virtual_table/ob_all_virtual_partition_replay_status.h index 7bd3926d6..d06c16fc8 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_replay_status.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_replay_status.h @@ -26,11 +26,11 @@ class ObIPartitionGroupIterator; } // namespace storage namespace observer { class ObAllVirtualPartitionReplayStatus : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualPartitionReplayStatus(); virtual ~ObAllVirtualPartitionReplayStatus(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); void reset(); inline void set_partition_service(storage::ObPartitionService* partition_service) @@ -43,11 +43,11 @@ class ObAllVirtualPartitionReplayStatus : public common::ObVirtualTableScannerIt addr_ = addr; } - private: +private: int get_last_replay_log_type(int64_t last_replay_log_type, char* buf, int64_t buf_len); int get_post_barrier_status(int64_t post_barrier_status, char* buf, int64_t buf_len); - private: +private: storage::ObPartitionService* ps_; common::ObAddr addr_; storage::ObIPartitionGroupIterator* ptt_iter_; @@ -55,7 +55,7 @@ class ObAllVirtualPartitionReplayStatus : public common::ObVirtualTableScannerIt char post_barrier_status_[common::MAX_FREEZE_SUBMIT_STATUS_LENGTH]; char last_replay_log_type_[common::MAX_REPLAY_LOG_TYPE_LENGTH]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualPartitionReplayStatus); }; diff --git a/src/observer/virtual_table/ob_all_virtual_partition_split_info.h b/src/observer/virtual_table/ob_all_virtual_partition_split_info.h index 13b6a940f..cca3367c1 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_split_info.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_split_info.h @@ -25,14 +25,14 @@ class ObTenantManager; namespace observer { class ObAllVirtualPartitionSplitInfo : public common::ObVirtualTableIterator { - public: +public: ObAllVirtualPartitionSplitInfo(); virtual ~ObAllVirtualPartitionSplitInfo(); virtual int init(share::schema::ObMultiVersionSchemaService& schema_service); virtual void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum CACHE_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_all_virtual_partition_sstable_macro_info.h b/src/observer/virtual_table/ob_all_virtual_partition_sstable_macro_info.h index b774b0064..e62d71b61 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_sstable_macro_info.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_sstable_macro_info.h @@ -25,14 +25,14 @@ class ObPGPartitionIterator; namespace observer { class ObAllVirtualPartitionSSTableMacroInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualPartitionSSTableMacroInfo(); virtual ~ObAllVirtualPartitionSSTableMacroInfo(); int init(storage::ObPartitionService& partition_service); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: int set_key_ranges(const common::ObIArray& key_ranges); int gen_row(common::ObNewRow*& row); int get_next_sstable(); @@ -53,7 +53,7 @@ class ObAllVirtualPartitionSSTableMacroInfo : public common::ObVirtualTableScann common::ObObj objs_[common::OB_MAX_ROWKEY_COLUMN_NUMBER]; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualPartitionSSTableMacroInfo); }; diff --git a/src/observer/virtual_table/ob_all_virtual_partition_sstable_merge_info.h b/src/observer/virtual_table/ob_all_virtual_partition_sstable_merge_info.h index a6da24c11..5b1a115b7 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_sstable_merge_info.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_sstable_merge_info.h @@ -24,7 +24,7 @@ class ObSSTable; namespace observer { class ObAllVirtualPartitionSSTableMergeInfo : public common::ObVirtualTableScannerIterator { - public: +public: enum COLUMN_ID_LIST { VERSION = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -69,10 +69,10 @@ class ObAllVirtualPartitionSSTableMergeInfo : public common::ObVirtualTableScann virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - protected: +protected: int fill_cells(storage::ObSSTableMergeInfo* merge_info); - private: +private: char ip_buf_[common::OB_IP_STR_BUFF]; char version_buf_[common::OB_SYS_TASK_TYPE_LENGTH]; storage::ObSSTableMergeInfo merge_info_; diff --git a/src/observer/virtual_table/ob_all_virtual_partition_store_info.h b/src/observer/virtual_table/ob_all_virtual_partition_store_info.h index b929e1a9a..d7232df2c 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_store_info.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_store_info.h @@ -25,7 +25,7 @@ class ObIPartitionGroupIterator; namespace observer { class ObAllPartitionStoreInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObAllPartitionStoreInfo(); virtual ~ObAllPartitionStoreInfo(); virtual int inner_get_next_row(common::ObNewRow*& row) override; @@ -38,7 +38,7 @@ class ObAllPartitionStoreInfo : public common::ObVirtualTableScannerIterator { } virtual void reset() override; - private: +private: enum TABLE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, diff --git a/src/observer/virtual_table/ob_all_virtual_partition_table_store_stat.h b/src/observer/virtual_table/ob_all_virtual_partition_table_store_stat.h index d92557fb1..adc10b27a 100644 --- a/src/observer/virtual_table/ob_all_virtual_partition_table_store_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_partition_table_store_stat.h @@ -24,17 +24,17 @@ class ObPartitionService; namespace observer { class ObAllVirtualPartitionTableStoreStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualPartitionTableStoreStat(); virtual ~ObAllVirtualPartitionTableStoreStat(); int init(storage::ObPartitionService* partition_service); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - protected: +protected: int fill_cells(const storage::ObTableStoreStat& stat); - private: +private: int get_rowkey_prefix_info(const common::ObPartitionKey& pkey); char ip_buf_[common::OB_IP_STR_BUFF]; char rowkey_prefix_info_[common::COLUMN_DEFAULT_LENGTH]; // json format diff --git a/src/observer/virtual_table/ob_all_virtual_pg_backup_log_archive_status.h b/src/observer/virtual_table/ob_all_virtual_pg_backup_log_archive_status.h index 054e4d961..262e9fbd3 100644 --- a/src/observer/virtual_table/ob_all_virtual_pg_backup_log_archive_status.h +++ b/src/observer/virtual_table/ob_all_virtual_pg_backup_log_archive_status.h @@ -38,20 +38,20 @@ class ObAllVirtualPGBackupLogArchiveStatus : public common::ObVirtualTableIterat MAX_LOG_TS, }; - public: +public: ObAllVirtualPGBackupLogArchiveStatus(); virtual ~ObAllVirtualPGBackupLogArchiveStatus(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); void reset(); int init(storage::ObPartitionService* partition_service, common::ObAddr& addr); - private: +private: int inner_get_next_row_(common::ObNewRow*& row); const char* get_log_archive_status_str_(share::ObLogArchiveStatus::STATUS status); - private: +private: bool is_inited_; storage::ObPartitionService* ps_; common::ObAddr addr_; diff --git a/src/observer/virtual_table/ob_all_virtual_pg_log_archive_stat.h b/src/observer/virtual_table/ob_all_virtual_pg_log_archive_stat.h index 3a5a28a4a..d2ef70dd3 100644 --- a/src/observer/virtual_table/ob_all_virtual_pg_log_archive_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_pg_log_archive_stat.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace observer { struct PGLogArchiveStat { - public: +public: PGLogArchiveStat() { reset(); @@ -93,20 +93,20 @@ class ObAllVirtualPGLogArchiveStat : public common::ObVirtualTableIterator { CUR_DATA_FILE_OFFSET, }; - public: +public: ObAllVirtualPGLogArchiveStat(); virtual ~ObAllVirtualPGLogArchiveStat(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); void reset(); int init(storage::ObPartitionService* partition_service, common::ObAddr& addr); - private: +private: int get_log_archive_stat_(PGLogArchiveStat& stat); int get_iter_(); - private: +private: bool is_inited_; storage::ObPartitionService* ps_; common::ObAddr addr_; diff --git a/src/observer/virtual_table/ob_all_virtual_pg_partition_info.h b/src/observer/virtual_table/ob_all_virtual_pg_partition_info.h index 42b50930f..8b4ea6209 100644 --- a/src/observer/virtual_table/ob_all_virtual_pg_partition_info.h +++ b/src/observer/virtual_table/ob_all_virtual_pg_partition_info.h @@ -22,11 +22,11 @@ namespace oceanbase { namespace observer { class ObPGPartitionInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObPGPartitionInfo(); virtual ~ObPGPartitionInfo(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); inline void set_partition_service(storage::ObPartitionService* partition_service) @@ -38,17 +38,17 @@ class ObPGPartitionInfo : public common::ObVirtualTableScannerIterator { addr_ = addr; } - private: +private: int partition_state_to_string_(int64_t partition_state, char* buf, int16_t buf_len); - private: +private: storage::ObPartitionService* partition_service_; common::ObAddr addr_; storage::ObPGPartitionIterator* ptt_iter_; char ip_buf_[common::OB_IP_STR_BUFF]; char partition_state_buf_[common::TABLE_MAX_VALUE_LENGTH]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPGPartitionInfo); }; diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_base.h b/src/observer/virtual_table/ob_all_virtual_proxy_base.h index 4453fcfd3..885db8dff 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_base.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_base.h @@ -30,7 +30,7 @@ class ObMultiVersionSchemaService; namespace observer { // this class is just a base class, not for a real virtual table class ObAllVirtualProxyBaseIterator : public common::ObVirtualTableIterator { - public: +public: ObAllVirtualProxyBaseIterator(); virtual ~ObAllVirtualProxyBaseIterator(); @@ -60,7 +60,7 @@ class ObAllVirtualProxyBaseIterator : public common::ObVirtualTableIterator { int get_table_schema(share::schema::ObSchemaGetterGuard& schema_guard, uint64_t table_id, const share::schema::ObTableSchema*& table_schema); - protected: +protected: share::schema::ObMultiVersionSchemaService* schema_service_; share::schema::ObSchemaGetterGuard full_schema_guard_; // Not sure if the incoming SQL is tenant_schema_guard, please // try again here for safety diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_partition.h b/src/observer/virtual_table/ob_all_virtual_proxy_partition.h index 6920177b0..512bbdbd8 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_partition.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_partition.h @@ -57,7 +57,7 @@ class ObAllVirtualProxyPartition : public ObAllVirtualProxyBaseIterator { ROW_KEY_COUNT, }; - public: +public: ObAllVirtualProxyPartition(); virtual ~ObAllVirtualProxyPartition(); @@ -66,7 +66,7 @@ class ObAllVirtualProxyPartition : public ObAllVirtualProxyBaseIterator { int fill_cells(const share::schema::ObPartition& table_schema); - private: +private: share::schema::ObPartIteratorV2* iter_; share::schema::ObPartitionFuncType part_func_type_; DISALLOW_COPY_AND_ASSIGN(ObAllVirtualProxyPartition); diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.h b/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.h index 1a4e79068..aa982070d 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.h @@ -74,7 +74,7 @@ class ObAllVirtualProxyPartitionInfo : public ObAllVirtualProxyBaseIterator { SPARE6, }; - public: +public: ObAllVirtualProxyPartitionInfo(); virtual ~ObAllVirtualProxyPartitionInfo(); @@ -83,14 +83,14 @@ class ObAllVirtualProxyPartitionInfo : public ObAllVirtualProxyBaseIterator { int fill_cells(const share::schema::ObTableSchema& table_schema); - private: +private: int gen_proxy_part_pruning_str(const share::schema::ObTableSchema& table_schema, const share::schema::ObColumnSchemaV2* column_schema, common::ObString& proxy_check_partition_str); int build_check_str_to_raw_expr(const common::ObString& check_expr_str, const share::schema::ObTableSchema& table_schema, sql::ObRawExpr*& check_expr); - private: +private: int64_t next_table_idx_; int64_t next_part_key_idx_; common::ObSEArray table_schemas_; diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_route.h b/src/observer/virtual_table/ob_all_virtual_proxy_route.h index f684ae1a1..b5c0656c6 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_route.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_route.h @@ -40,7 +40,7 @@ class ObAllVirtualProxyRoute : public ObAllVirtualProxyBaseIterator { ROW_KEY_COUNT, }; - public: +public: ObAllVirtualProxyRoute(); virtual ~ObAllVirtualProxyRoute(); @@ -49,7 +49,7 @@ class ObAllVirtualProxyRoute : public ObAllVirtualProxyBaseIterator { int fill_cells(); - private: +private: bool is_iter_end_; common::ObString sql_string_; common::ObString tenant_name_; diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_schema.h b/src/observer/virtual_table/ob_all_virtual_proxy_schema.h index 72aba378d..d3a81fa82 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_schema.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_schema.h @@ -73,7 +73,7 @@ class ObAllVirtualProxySchema : public common::ObVirtualTableIterator { MAX_CT_TYPE }; - public: +public: ObAllVirtualProxySchema(); virtual ~ObAllVirtualProxySchema(); @@ -100,7 +100,7 @@ class ObAllVirtualProxySchema : public common::ObVirtualTableIterator { force_sql_refresh_ = force_sql_refresh; } class ObTenantServer { - public: + public: ObTenantServer() : location_(), virtual_partition_id_(0){}; ~ObTenantServer(){}; @@ -115,7 +115,7 @@ class ObAllVirtualProxySchema : public common::ObVirtualTableIterator { int64_t virtual_partition_id_; }; - private: +private: int inner_get_next_row(); int get_tenant_db_name( const uint64_t tenant_id, const uint64_t database_id, common::ObString& tenant_name, common::ObString& db_name); @@ -143,7 +143,7 @@ class ObAllVirtualProxySchema : public common::ObVirtualTableIterator { int get_actual_partition_idx(const share::schema::ObTableSchema& table_schema, int64_t& partition_idx); int transfer_table_schema(const share::schema::ObTableSchema*& table_schema); - private: +private: share::ObPartitionLocationCache* pl_cache_; common::ObMySQLProxy* sql_proxy_; uint64_t tenant_id_; diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.h b/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.h index 9432bbce1..54879bfd9 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.h @@ -54,7 +54,7 @@ class ObAllVirtualProxySubPartition : public ObAllVirtualProxyBaseIterator { ROW_KEY_COUNT, }; - public: +public: ObAllVirtualProxySubPartition(); virtual ~ObAllVirtualProxySubPartition(); @@ -63,7 +63,7 @@ class ObAllVirtualProxySubPartition : public ObAllVirtualProxyBaseIterator { int fill_cells(const share::schema::ObSubPartition& table_schema); - private: +private: share::schema::ObPartIteratorV2 part_iter_; share::schema::ObSubPartIteratorV2 subpart_iter_; share::schema::ObPartitionFuncType part_func_type_; diff --git a/src/observer/virtual_table/ob_all_virtual_ps_item_info.h b/src/observer/virtual_table/ob_all_virtual_ps_item_info.h index c353fddd9..fde3fd1ce 100644 --- a/src/observer/virtual_table/ob_all_virtual_ps_item_info.h +++ b/src/observer/virtual_table/ob_all_virtual_ps_item_info.h @@ -21,7 +21,7 @@ using common::ObPsStmtId; namespace observer { class ObAllVirtualPsItemInfo : public ObAllPlanCacheBase { - public: +public: ObAllVirtualPsItemInfo() : ObAllPlanCacheBase(), stmt_id_array_idx_(OB_INVALID_ID), stmt_id_array_(), ps_cache_(NULL) {} virtual ~ObAllVirtualPsItemInfo() @@ -31,12 +31,12 @@ class ObAllVirtualPsItemInfo : public ObAllPlanCacheBase { virtual int inner_open() override; virtual void reset() override; - private: +private: int fill_cells(uint64_t tenant_id, ObPsStmtId stmt_id, sql::ObPsStmtItem* stmt_item, sql::ObPsStmtInfo* stmt_info); int get_next_row_from_specified_tenant(uint64_t tenant_id, bool& is_end); DISALLOW_COPY_AND_ASSIGN(ObAllVirtualPsItemInfo); - private: +private: int64_t stmt_id_array_idx_; common::ObSEArray stmt_id_array_; sql::ObPsCache* ps_cache_; diff --git a/src/observer/virtual_table/ob_all_virtual_ps_stat.h b/src/observer/virtual_table/ob_all_virtual_ps_stat.h index 21afdc2cc..cbb3da609 100644 --- a/src/observer/virtual_table/ob_all_virtual_ps_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_ps_stat.h @@ -22,7 +22,7 @@ class ObPsCache; namespace observer { class ObAllVirtualPsStat : public ObAllPlanCacheBase { - public: +public: ObAllVirtualPsStat() : ObAllPlanCacheBase() {} virtual ~ObAllVirtualPsStat() @@ -31,7 +31,7 @@ class ObAllVirtualPsStat : public ObAllPlanCacheBase { virtual int inner_get_next_row() override; virtual int inner_open() override; - private: +private: int fill_cells(sql::ObPsCache& ps_cache, uint64_t tenant_id); DISALLOW_COPY_AND_ASSIGN(ObAllVirtualPsStat); }; diff --git a/src/observer/virtual_table/ob_all_virtual_px_worker_stat.h b/src/observer/virtual_table/ob_all_virtual_px_worker_stat.h index 9f29ca199..26947f610 100644 --- a/src/observer/virtual_table/ob_all_virtual_px_worker_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_px_worker_stat.h @@ -24,7 +24,7 @@ class ObPxWorkerStat; namespace observer { class ObAllPxWorkerStatTable : public common::ObVirtualTableScannerIterator { - public: +public: ObAllPxWorkerStatTable(); virtual ~ObAllPxWorkerStatTable(); virtual void reset(); @@ -34,7 +34,7 @@ class ObAllPxWorkerStatTable : public common::ObVirtualTableScannerIterator { addr_ = &addr; } - private: +private: common::ObAddr* addr_; bool start_to_read_; common::ObArray stat_array_; @@ -54,7 +54,7 @@ class ObAllPxWorkerStatTable : public common::ObVirtualTableScannerIterator { THREAD_ID, }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllPxWorkerStatTable); }; diff --git a/src/observer/virtual_table/ob_all_virtual_raid_stat.h b/src/observer/virtual_table/ob_all_virtual_raid_stat.h index a2752ac35..b75420fd1 100644 --- a/src/observer/virtual_table/ob_all_virtual_raid_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_raid_stat.h @@ -35,22 +35,22 @@ class ObAllVirtualRaidStat : public common::ObVirtualTableScannerIterator { PERCENT, }; - public: +public: ObAllVirtualRaidStat(); virtual ~ObAllVirtualRaidStat(); int init(const common::ObAddr& addr); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: char ip_buf_[common::OB_IP_STR_BUFF]; blocksstable::ObDiskStats disk_stats_; int64_t cur_idx_; common::ObAddr addr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualRaidStat); }; diff --git a/src/observer/virtual_table/ob_all_virtual_reserved_table_mgr.h b/src/observer/virtual_table/ob_all_virtual_reserved_table_mgr.h index a36572829..238d899b9 100644 --- a/src/observer/virtual_table/ob_all_virtual_reserved_table_mgr.h +++ b/src/observer/virtual_table/ob_all_virtual_reserved_table_mgr.h @@ -43,21 +43,21 @@ class ObAllVirtualReservedTableMgr : public common::ObVirtualTableScannerIterato RESERVE_POINT_VERSION, }; - public: +public: ObAllVirtualReservedTableMgr(); virtual ~ObAllVirtualReservedTableMgr(); int init(); virtual void reset() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: const char* get_reserve_type_name_(storage::ObRecoveryPointType type); int get_point_next_table_(storage::ObITable*& table); int get_mgr_next_point_(); int get_mgr_next_table_(storage::ObITable*& table); int get_next_table_(storage::ObITable*& table); - private: +private: bool is_inited_; char svr_ip_[common::OB_MAX_SERVER_ADDR_SIZE]; int32_t svr_port_; @@ -69,7 +69,7 @@ class ObAllVirtualReservedTableMgr : public common::ObVirtualTableScannerIterato storage::ObRecoveryPointIterator point_iter_; storage::ObIPartitionGroupIterator* partition_itertor_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualReservedTableMgr); }; diff --git a/src/observer/virtual_table/ob_all_virtual_server_backup_log_archive_status.h b/src/observer/virtual_table/ob_all_virtual_server_backup_log_archive_status.h index 06d1b15db..03ba3fb40 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_backup_log_archive_status.h +++ b/src/observer/virtual_table/ob_all_virtual_server_backup_log_archive_status.h @@ -36,20 +36,20 @@ class ObAllVirtualServerBackupLogArchiveStatus : public common::ObVirtualTableIt PG_COUNT }; - public: +public: ObAllVirtualServerBackupLogArchiveStatus(); virtual ~ObAllVirtualServerBackupLogArchiveStatus(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); int init(storage::ObPartitionService* partition_service, common::ObAddr& addr); - private: +private: int fill_rows_(); int prepare_to_read_(); void finish_read_(); - private: +private: bool is_inited_; bool has_reported_; storage::ObPartitionService* ps_; diff --git a/src/observer/virtual_table/ob_all_virtual_server_blacklist.h b/src/observer/virtual_table/ob_all_virtual_server_blacklist.h index ba6612077..8d073da7f 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_blacklist.h +++ b/src/observer/virtual_table/ob_all_virtual_server_blacklist.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualServerBlacklist : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualServerBlacklist(); virtual ~ObAllVirtualServerBlacklist(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -29,10 +29,10 @@ class ObAllVirtualServerBlacklist : public common::ObVirtualTableScannerIterator self_addr_ = addr; } - private: +private: int prepare_to_read_(); - private: +private: enum TBL_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -42,7 +42,7 @@ class ObAllVirtualServerBlacklist : public common::ObVirtualTableScannerIterator IS_CLOCKDIFF_ERROR }; - private: +private: bool ready_to_read_; common::ObAddr self_addr_; char self_ip_buf_[common::OB_IP_STR_BUFF]; diff --git a/src/observer/virtual_table/ob_all_virtual_server_clog_stat.h b/src/observer/virtual_table/ob_all_virtual_server_clog_stat.h index e785a0271..df3ce7dff 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_clog_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_server_clog_stat.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualServerClogStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualServerClogStat(); virtual ~ObAllVirtualServerClogStat(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -29,7 +29,7 @@ class ObAllVirtualServerClogStat : public common::ObVirtualTableScannerIterator } virtual int set_ip(common::ObAddr* addr); - private: +private: enum DISK_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, diff --git a/src/observer/virtual_table/ob_all_virtual_server_memory_info.h b/src/observer/virtual_table/ob_all_virtual_server_memory_info.h index 6e58405b5..cd391f347 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_memory_info.h +++ b/src/observer/virtual_table/ob_all_virtual_server_memory_info.h @@ -36,11 +36,11 @@ class ObAllVirtualServerMemoryInfo : public common::ObVirtualTableScannerIterato MEMSTORE_LIMIT }; - public: +public: ObAllVirtualServerMemoryInfo(); virtual ~ObAllVirtualServerMemoryInfo(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); inline void set_tenant_mgr(common::ObTenantManager* tenant_mgr) @@ -52,12 +52,12 @@ class ObAllVirtualServerMemoryInfo : public common::ObVirtualTableScannerIterato addr_ = addr; } - private: +private: common::ObTenantManager* tenant_mgr_; uint64_t current_pos_; common::ObAddr addr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualServerMemoryInfo); }; diff --git a/src/observer/virtual_table/ob_all_virtual_server_object_pool.h b/src/observer/virtual_table/ob_all_virtual_server_object_pool.h index 26d762383..a38e99d77 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_object_pool.h +++ b/src/observer/virtual_table/ob_all_virtual_server_object_pool.h @@ -21,14 +21,14 @@ namespace oceanbase { namespace observer { class ObAllVirtualServerObjectPool : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualServerObjectPool(); virtual ~ObAllVirtualServerObjectPool() { reset(); } - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); void set_addr(common::ObAddr& addr) @@ -36,10 +36,10 @@ class ObAllVirtualServerObjectPool : public common::ObVirtualTableScannerIterato addr_ = &addr; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualServerObjectPool); - private: +private: common::ObServerObjectPoolRegistry::ArenaIterator iter_; common::ObAddr* addr_; }; diff --git a/src/observer/virtual_table/ob_all_virtual_server_schema_info.h b/src/observer/virtual_table/ob_all_virtual_server_schema_info.h index 5e41f428b..9b1ed8ca9 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_schema_info.h +++ b/src/observer/virtual_table/ob_all_virtual_server_schema_info.h @@ -21,19 +21,19 @@ namespace oceanbase { namespace observer { class ObAllVirtualServerSchemaInfo : public common::ObVirtualTableScannerIterator { - public: +public: explicit ObAllVirtualServerSchemaInfo(share::schema::ObMultiVersionSchemaService& schema_service) : schema_service_(schema_service), tenant_ids_(), idx_(0) {} virtual ~ObAllVirtualServerSchemaInfo() {} - public: +public: virtual int inner_open(); virtual int inner_get_next_row(common::ObNewRow*& row); void destroy(); - private: +private: const static int64_t DEFAULT_TENANT_NUM = 10; char ip_buffer_[OB_MAX_SERVER_ADDR_SIZE]; share::schema::ObMultiVersionSchemaService& schema_service_; diff --git a/src/observer/virtual_table/ob_all_virtual_session_event.h b/src/observer/virtual_table/ob_all_virtual_session_event.h index 928c07e3e..b7609a0a0 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_event.h +++ b/src/observer/virtual_table/ob_all_virtual_session_event.h @@ -25,7 +25,7 @@ class ObObj; namespace observer { class ObAllVirtualSessionEvent : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualSessionEvent(); virtual ~ObAllVirtualSessionEvent(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -36,12 +36,12 @@ class ObAllVirtualSessionEvent : public common::ObVirtualTableScannerIterator { } virtual int set_ip(common::ObAddr* addr); - protected: +protected: virtual int get_all_diag_info(); common::ObSEArray, common::OB_MAX_SERVER_SESSION_CNT + 1> session_status_; - private: +private: enum EVENT_COLUMN { SESSION_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -69,7 +69,7 @@ class ObAllVirtualSessionEvent : public common::ObVirtualTableScannerIterator { }; class ObAllVirtualSessionEventI1 : public ObAllVirtualSessionEvent, public ObAllVirtualDiagIndexScan { - public: +public: ObAllVirtualSessionEventI1() {} virtual ~ObAllVirtualSessionEventI1() @@ -79,10 +79,10 @@ class ObAllVirtualSessionEventI1 : public ObAllVirtualSessionEvent, public ObAll return set_index_ids(key_ranges_); } - protected: +protected: virtual int get_all_diag_info(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualSessionEventI1); }; diff --git a/src/observer/virtual_table/ob_all_virtual_session_stat.h b/src/observer/virtual_table/ob_all_virtual_session_stat.h index abc55e002..0ff017c9e 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_session_stat.h @@ -25,7 +25,7 @@ class ObObj; namespace observer { class ObAllVirtualSessionStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualSessionStat(); virtual ~ObAllVirtualSessionStat(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -36,12 +36,12 @@ class ObAllVirtualSessionStat : public common::ObVirtualTableScannerIterator { } virtual int set_ip(common::ObAddr* addr); - protected: +protected: virtual int get_all_diag_info(); common::ObSEArray, common::OB_MAX_SERVER_SESSION_CNT + 1> session_status_; - private: +private: enum SESSION_COLUMN { SESSION_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -61,7 +61,7 @@ class ObAllVirtualSessionStat : public common::ObVirtualTableScannerIterator { }; class ObAllVirtualSessionStatI1 : public ObAllVirtualSessionStat, public ObAllVirtualDiagIndexScan { - public: +public: ObAllVirtualSessionStatI1() {} virtual ~ObAllVirtualSessionStatI1() @@ -71,10 +71,10 @@ class ObAllVirtualSessionStatI1 : public ObAllVirtualSessionStat, public ObAllVi return set_index_ids(key_ranges_); } - protected: +protected: virtual int get_all_diag_info(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualSessionStatI1); }; diff --git a/src/observer/virtual_table/ob_all_virtual_session_wait.h b/src/observer/virtual_table/ob_all_virtual_session_wait.h index 9220a853b..05b4a11de 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_wait.h +++ b/src/observer/virtual_table/ob_all_virtual_session_wait.h @@ -25,7 +25,7 @@ class ObObj; namespace observer { class ObAllVirtualSessionWait : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualSessionWait(); virtual ~ObAllVirtualSessionWait(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -36,12 +36,12 @@ class ObAllVirtualSessionWait : public common::ObVirtualTableScannerIterator { } virtual int set_ip(common::ObAddr* addr); - protected: +protected: virtual int get_all_diag_info(); common::ObSEArray, common::OB_MAX_SERVER_SESSION_CNT + 1> session_status_; - private: +private: enum WAIT_COLUMN { SESSION_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -72,7 +72,7 @@ class ObAllVirtualSessionWait : public common::ObVirtualTableScannerIterator { }; class ObAllVirtualSessionWaitI1 : public ObAllVirtualSessionWait, public ObAllVirtualDiagIndexScan { - public: +public: ObAllVirtualSessionWaitI1() {} virtual ~ObAllVirtualSessionWaitI1() @@ -82,10 +82,10 @@ class ObAllVirtualSessionWaitI1 : public ObAllVirtualSessionWait, public ObAllVi return set_index_ids(key_ranges_); } - protected: +protected: virtual int get_all_diag_info(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualSessionWaitI1); }; diff --git a/src/observer/virtual_table/ob_all_virtual_session_wait_history.h b/src/observer/virtual_table/ob_all_virtual_session_wait_history.h index a053ab847..97705f2b5 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_wait_history.h +++ b/src/observer/virtual_table/ob_all_virtual_session_wait_history.h @@ -25,7 +25,7 @@ class ObObj; namespace observer { class ObAllVirtualSessionWaitHistory : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualSessionWaitHistory(); virtual ~ObAllVirtualSessionWaitHistory(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -36,12 +36,12 @@ class ObAllVirtualSessionWaitHistory : public common::ObVirtualTableScannerItera } virtual int set_ip(common::ObAddr* addr); - protected: +protected: virtual int get_all_diag_info(); common::ObSEArray, common::OB_MAX_SERVER_SESSION_CNT + 1> session_status_; - private: +private: enum HISTORY_COLUMN { SESSION_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -72,7 +72,7 @@ class ObAllVirtualSessionWaitHistory : public common::ObVirtualTableScannerItera }; class ObAllVirtualSessionWaitHistoryI1 : public ObAllVirtualSessionWaitHistory, public ObAllVirtualDiagIndexScan { - public: +public: ObAllVirtualSessionWaitHistoryI1() {} virtual ~ObAllVirtualSessionWaitHistoryI1() @@ -82,10 +82,10 @@ class ObAllVirtualSessionWaitHistoryI1 : public ObAllVirtualSessionWaitHistory, return set_index_ids(key_ranges_); } - protected: +protected: virtual int get_all_diag_info(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualSessionWaitHistoryI1); }; diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.h b/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.h index 1903147f5..31c6fbe75 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.h @@ -22,23 +22,23 @@ namespace oceanbase { namespace observer { class ObSqlWorkareaActiveIterator { - public: +public: ObSqlWorkareaActiveIterator(); ~ObSqlWorkareaActiveIterator() { destroy(); } - public: +public: void destroy(); void reset(); int init(); int get_next_wa_active(sql::ObSqlWorkareaProfileInfo*& wa_active, uint64_t& tenant_id); - private: +private: int get_next_batch_wa_active(); - private: +private: common::ObSEArray wa_actives_; common::ObSEArray tenant_ids_; int64_t cur_nth_wa_; @@ -46,19 +46,19 @@ class ObSqlWorkareaActiveIterator { }; class ObSqlWorkareaActive : public common::ObVirtualTableScannerIterator { - public: +public: ObSqlWorkareaActive(); virtual ~ObSqlWorkareaActive() { destroy(); } - public: +public: void destroy(); void reset(); int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum STORAGE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -81,7 +81,7 @@ class ObSqlWorkareaActive : public common::ObVirtualTableScannerIterator { int fill_row(uint64_t tenant_id, sql::ObSqlWorkareaProfileInfo& wa_active, common::ObNewRow*& row); int get_server_ip_and_port(); - private: +private: common::ObString ipstr_; int32_t port_; ObSqlWorkareaActiveIterator iter_; diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.h b/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.h index 48b88d529..f874234a9 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.h @@ -22,23 +22,23 @@ namespace oceanbase { namespace observer { class ObSqlWorkareaHistogramIterator { - public: +public: ObSqlWorkareaHistogramIterator(); ~ObSqlWorkareaHistogramIterator() { destroy(); } - public: +public: void destroy(); void reset(); int init(); int get_next_wa_histogram(sql::ObWorkareaHistogram*& wa_histogram, uint64_t& tenant_id); - private: +private: int get_next_batch_wa_histograms(); - private: +private: common::ObSEArray wa_histograms_; common::ObSEArray tenant_ids_; int64_t cur_nth_wa_hist_; @@ -46,19 +46,19 @@ class ObSqlWorkareaHistogramIterator { }; class ObSqlWorkareaHistogram : public common::ObVirtualTableScannerIterator { - public: +public: ObSqlWorkareaHistogram(); virtual ~ObSqlWorkareaHistogram() { destroy(); } - public: +public: void destroy(); void reset(); int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum STORAGE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -73,7 +73,7 @@ class ObSqlWorkareaHistogram : public common::ObVirtualTableScannerIterator { int fill_row(uint64_t tenant_id, sql::ObWorkareaHistogram& wa_histogram, common::ObNewRow*& row); int get_server_ip_and_port(); - private: +private: common::ObString ipstr_; int32_t port_; ObSqlWorkareaHistogramIterator iter_; diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.h b/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.h index ea1f609ef..4bc3df2b1 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.h @@ -22,23 +22,23 @@ namespace oceanbase { namespace observer { class ObSqlWorkareaHistoryStatIterator { - public: +public: ObSqlWorkareaHistoryStatIterator(); ~ObSqlWorkareaHistoryStatIterator() { destroy(); } - public: +public: void destroy(); void reset(); int init(); int get_next_wa_stat(sql::ObSqlWorkAreaStat*& wa_stat, uint64_t& tenant_id); - private: +private: int get_next_batch_wa_stats(); - private: +private: common::ObSEArray wa_stats_; common::ObSEArray tenant_ids_; int64_t cur_nth_wa_; @@ -46,19 +46,19 @@ class ObSqlWorkareaHistoryStatIterator { }; class ObSqlWorkareaHistoryStat : public common::ObVirtualTableScannerIterator { - public: +public: ObSqlWorkareaHistoryStat(); virtual ~ObSqlWorkareaHistoryStat() { destroy(); } - public: +public: void destroy(); void reset(); int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum STORAGE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -84,7 +84,7 @@ class ObSqlWorkareaHistoryStat : public common::ObVirtualTableScannerIterator { int fill_row(uint64_t tenant_id, sql::ObSqlWorkAreaStat& wa_stat, common::ObNewRow*& row); int get_server_ip_and_port(); - private: +private: common::ObString ipstr_; int32_t port_; ObSqlWorkareaHistoryStatIterator iter_; diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.h b/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.h index a3dffabb4..bdb7b3880 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.h @@ -22,42 +22,42 @@ namespace oceanbase { namespace observer { class ObSqlWorkareaMemoryInfoIterator { - public: +public: ObSqlWorkareaMemoryInfoIterator(); ~ObSqlWorkareaMemoryInfoIterator() { destroy(); } - public: +public: void destroy(); void reset(); int init(); int get_next_wa_memory_info(sql::ObSqlWorkareaCurrentMemoryInfo*& wa_stat, uint64_t& tenant_id); - private: +private: int get_next_batch_wa_memory_info(); - private: +private: sql::ObSqlWorkareaCurrentMemoryInfo memory_info_; common::ObSEArray tenant_ids_; int64_t cur_nth_tenant_; }; class ObSqlWorkareaMemoryInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObSqlWorkareaMemoryInfo(); virtual ~ObSqlWorkareaMemoryInfo() { destroy(); } - public: +public: void destroy(); void reset(); int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum STORAGE_COLUMN { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, @@ -75,7 +75,7 @@ class ObSqlWorkareaMemoryInfo : public common::ObVirtualTableScannerIterator { int get_server_ip_and_port(); int fill_row(uint64_t tenant_id, sql::ObSqlWorkareaCurrentMemoryInfo& memory_info, common::ObNewRow*& row); - private: +private: common::ObString ipstr_; int32_t port_; ObSqlWorkareaMemoryInfoIterator iter_; diff --git a/src/observer/virtual_table/ob_all_virtual_sys_event.h b/src/observer/virtual_table/ob_all_virtual_sys_event.h index 92131c127..84a548c4e 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_event.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_event.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualSysEvent : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualSysEvent(); virtual ~ObAllVirtualSysEvent(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -34,11 +34,11 @@ class ObAllVirtualSysEvent : public common::ObVirtualTableScannerIterator { } virtual int set_ip(common::ObAddr* addr); - protected: +protected: virtual int get_all_diag_info(); common::ObSEArray, common::OB_MAX_SERVER_TENANT_CNT> tenant_dis_; - private: +private: enum SYS_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -65,7 +65,7 @@ class ObAllVirtualSysEvent : public common::ObVirtualTableScannerIterator { }; class ObAllVirtualSysEventI1 : public ObAllVirtualSysEvent, public ObAllVirtualDiagIndexScan { - public: +public: ObAllVirtualSysEventI1() {} virtual ~ObAllVirtualSysEventI1() @@ -75,10 +75,10 @@ class ObAllVirtualSysEventI1 : public ObAllVirtualSysEvent, public ObAllVirtualD return set_index_ids(key_ranges_); } - protected: +protected: virtual int get_all_diag_info(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualSysEventI1); }; diff --git a/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.h b/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.h index fe5a0f902..6cb5d118f 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.h @@ -21,14 +21,14 @@ namespace oceanbase { namespace observer { class ObAllVirtualSysParameterStat : public common::ObVirtualTableIterator { - public: +public: ObAllVirtualSysParameterStat(); virtual ~ObAllVirtualSysParameterStat(); virtual int inner_open(); virtual void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int inner_sys_get_next_row(common::ObNewRow*& row); int inner_tenant_get_next_row(common::ObNewRow*& row); enum SYS_PARAMETER_STAT_COLUMN { diff --git a/src/observer/virtual_table/ob_all_virtual_sys_stat.h b/src/observer/virtual_table/ob_all_virtual_sys_stat.h index dd1e17920..d555f3b9d 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_stat.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualSysStat : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualSysStat(); virtual ~ObAllVirtualSysStat(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -35,15 +35,15 @@ class ObAllVirtualSysStat : public common::ObVirtualTableScannerIterator { } virtual int set_ip(common::ObAddr* addr); - protected: +protected: virtual int get_all_diag_info(); common::ObSEArray, common::OB_MAX_SERVER_TENANT_CNT> tenant_dis_; - private: +private: int64_t get_tenant_memory_usage(int64_t tenant_id) const; int get_cache_size(ObStatEventSetStatArray& stat_events); - private: +private: enum SYS_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -65,7 +65,7 @@ class ObAllVirtualSysStat : public common::ObVirtualTableScannerIterator { }; class ObAllVirtualSysStatI1 : public ObAllVirtualSysStat, public ObAllVirtualDiagIndexScan { - public: +public: ObAllVirtualSysStatI1() {} virtual ~ObAllVirtualSysStatI1() @@ -75,10 +75,10 @@ class ObAllVirtualSysStatI1 : public ObAllVirtualSysStat, public ObAllVirtualDia return set_index_ids(key_ranges_); } - protected: +protected: virtual int get_all_diag_info(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualSysStatI1); }; diff --git a/src/observer/virtual_table/ob_all_virtual_sys_task_status.h b/src/observer/virtual_table/ob_all_virtual_sys_task_status.h index 102c5de76..539bbd6e2 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_task_status.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_task_status.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualSysTaskStatus : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualSysTaskStatus(); virtual ~ObAllVirtualSysTaskStatus(); @@ -30,7 +30,7 @@ class ObAllVirtualSysTaskStatus : public common::ObVirtualTableScannerIterator { virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: share::ObSysStatMgrIter iter_; char task_id_[common::OB_TRACE_STAT_BUFFER_SIZE]; char svr_ip_[common::MAX_IP_ADDR_LENGTH]; diff --git a/src/observer/virtual_table/ob_all_virtual_table_mgr.h b/src/observer/virtual_table/ob_all_virtual_table_mgr.h index c13384ff0..3787f7208 100644 --- a/src/observer/virtual_table/ob_all_virtual_table_mgr.h +++ b/src/observer/virtual_table/ob_all_virtual_table_mgr.h @@ -51,12 +51,12 @@ class ObAllVirtualTableMgr : public common::ObVirtualTableScannerIterator { CONTAIN_UNCOMMITTED_ROW }; - public: +public: ObAllVirtualTableMgr(); virtual ~ObAllVirtualTableMgr(); int init(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); inline void set_addr(common::ObAddr& addr) @@ -64,10 +64,10 @@ class ObAllVirtualTableMgr : public common::ObVirtualTableScannerIterator { addr_ = addr; } - private: +private: int get_next_table(storage::ObITable*& table); - private: +private: common::ObAddr addr_; char ip_buf_[common::OB_IP_STR_BUFF]; storage::ObIPartitionGroupIterator* pg_iter_; @@ -77,7 +77,7 @@ class ObAllVirtualTableMgr : public common::ObVirtualTableScannerIterator { int64_t table_idx_; int64_t memtable_idx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTableMgr); }; diff --git a/src/observer/virtual_table/ob_all_virtual_table_modifications.h b/src/observer/virtual_table/ob_all_virtual_table_modifications.h index 6d0836adf..7967e0779 100644 --- a/src/observer/virtual_table/ob_all_virtual_table_modifications.h +++ b/src/observer/virtual_table/ob_all_virtual_table_modifications.h @@ -33,7 +33,7 @@ class ObAllVirtualTableModifications : public common::ObVirtualTableScannerItera MAX_SNAPSHOT_VERSION }; - public: +public: ObAllVirtualTableModifications(); virtual ~ObAllVirtualTableModifications(); int init(); @@ -44,18 +44,18 @@ class ObAllVirtualTableModifications : public common::ObVirtualTableScannerItera addr_ = addr; } - private: +private: static const int64_t DEFAULT_TABLE_INFO_CNT = 2048; int get_next_table_info(storage::ObTableModificationInfo*& info); - private: +private: common::ObAddr addr_; char ip_buf_[common::OB_IP_STR_BUFF]; common::ObSEArray infos_; int64_t info_idx_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTableModifications); }; diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_disk_stat.h b/src/observer/virtual_table/ob_all_virtual_tenant_disk_stat.h index 6edb55d7e..4562b08ab 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_disk_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_disk_stat.h @@ -23,14 +23,14 @@ class ObTenantManager; } namespace observer { class ObAllVirtualTenantDiskStat : public common::ObVirtualTableIterator { - public: +public: ObAllVirtualTenantDiskStat(); virtual ~ObAllVirtualTenantDiskStat(); virtual int inner_open(); virtual void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum CACHE_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp index 212f14541..5040ad12a 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp @@ -22,7 +22,7 @@ using namespace share; namespace observer { class MemstoreInfoFill { - public: +public: typedef ObMemstoreAllocatorInfo Item; typedef ObArray ItemArray; typedef ObGMemstoreAllocator::AllocHandle Handle; diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.h b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.h index 036454f26..c5a676644 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.h @@ -40,7 +40,7 @@ struct ObMemstoreAllocatorInfo { common::ObVersion version_; }; class ObAllVirtualTenantMemstoreAllocatorInfo : public common::ObVirtualTableIterator { - public: +public: typedef ObMemstoreAllocatorInfo MemstoreInfo; ObAllVirtualTenantMemstoreAllocatorInfo(); virtual ~ObAllVirtualTenantMemstoreAllocatorInfo(); @@ -48,7 +48,7 @@ class ObAllVirtualTenantMemstoreAllocatorInfo : public common::ObVirtualTableIte virtual void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum COLUMNS { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.h b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.h index e34769e34..9f5fecb34 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.h @@ -23,14 +23,14 @@ namespace oceanbase { namespace observer { class ObAllVirtualTenantParameterInfo : public common::ObVirtualTableIterator { - public: +public: ObAllVirtualTenantParameterInfo(); virtual ~ObAllVirtualTenantParameterInfo(); virtual int inner_open(); virtual void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum ALL_TENANT_PARAMETER_INFO_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, ZONE, diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h index a586bd628..d3728e971 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace observer { class ObAllVirtualTenantParameterStat : public common::ObVirtualTableIterator { - public: +public: ObAllVirtualTenantParameterStat(); ObAllVirtualTenantParameterStat(uint64_t tenant_id); void set_exec_tenant(uint64_t tenant_id); @@ -31,7 +31,7 @@ class ObAllVirtualTenantParameterStat : public common::ObVirtualTableIterator { virtual void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int inner_sys_get_next_row(common::ObNewRow*& row); int inner_tenant_get_next_row(common::ObNewRow*& row); int update_seed(); diff --git a/src/observer/virtual_table/ob_all_virtual_timestamp_service.h b/src/observer/virtual_table/ob_all_virtual_timestamp_service.h index 9f2dc1938..8ca3dba32 100644 --- a/src/observer/virtual_table/ob_all_virtual_timestamp_service.h +++ b/src/observer/virtual_table/ob_all_virtual_timestamp_service.h @@ -28,22 +28,22 @@ class ObTransService; } namespace observer { class ObAllVirtualTimestampService : public common::ObVirtualTableScannerIterator { - public: +public: explicit ObAllVirtualTimestampService(transaction::ObTransService* trans_service); virtual ~ObAllVirtualTimestampService(); - public: +public: virtual void reset(); virtual void destroy(); virtual int inner_get_next_row(common::ObNewRow*& row); int init(share::schema::ObMultiVersionSchemaService& schema_service); - private: +private: int prepare_start_to_read_(); int get_next_tenant_ts_info_(); int fill_tenant_ids_(); - private: +private: bool init_; transaction::ObTransService* trans_service_; int64_t tenant_ids_index_; @@ -55,7 +55,7 @@ class ObAllVirtualTimestampService : public common::ObVirtualTableScannerIterato share::schema::ObMultiVersionSchemaService* schema_service_; common::ObArray all_tenants_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTimestampService); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_all_virtual_trans_audit.h b/src/observer/virtual_table/ob_all_virtual_trans_audit.h index a486580e4..2c13fa34c 100644 --- a/src/observer/virtual_table/ob_all_virtual_trans_audit.h +++ b/src/observer/virtual_table/ob_all_virtual_trans_audit.h @@ -19,24 +19,24 @@ namespace oceanbase { namespace observer { class ObAllVirtualTransAudit : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualTransAudit(); virtual ~ObAllVirtualTransAudit() { reset(); } - public: +public: virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; virtual void reset() override; - private: +private: int fill_cells_( const transaction::ObTransAuditCommonInfo& common_info, const transaction::ObTransAuditInfo& trans_info); int extract_tenant_ids_(); - private: +private: static const int64_t OB_MAX_BUFFER_SIZE = 2048; static const int64_t OB_MIN_BUFFER_SIZE = 128; char ip_buffer_[common::OB_IP_STR_BUFF]; @@ -52,7 +52,7 @@ class ObAllVirtualTransAudit : public common::ObVirtualTableScannerIterator { share::ObTenantSpaceFetcher* with_tenant_ctx_; transaction::ObTransAuditDataIterator audit_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTransAudit); }; diff --git a/src/observer/virtual_table/ob_all_virtual_trans_lock_stat.h b/src/observer/virtual_table/ob_all_virtual_trans_lock_stat.h index 15f967d7b..be91251cc 100644 --- a/src/observer/virtual_table/ob_all_virtual_trans_lock_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_trans_lock_stat.h @@ -29,7 +29,7 @@ class ObTransLockStat; namespace observer { class ObGVTransLockStat : public common::ObVirtualTableScannerIterator { - public: +public: explicit ObGVTransLockStat(transaction::ObTransService* trans_service) : trans_service_(trans_service) { reset(); @@ -42,7 +42,7 @@ class ObGVTransLockStat : public common::ObVirtualTableScannerIterator { void reset(); void destroy(); - private: +private: int prepare_start_to_read_(); int get_next_trans_lock_stat_(transaction::ObTransLockStat& trans_lock_stat); static const int64_t OB_MIN_BUFFER_SIZE = 128; @@ -53,7 +53,7 @@ class ObGVTransLockStat : public common::ObVirtualTableScannerIterator { char proxy_sessid_buffer_[OB_MIN_BUFFER_SIZE]; char memtable_key_buffer_[OB_MEMTABLE_KEY_BUFFER_SIZE]; - private: +private: transaction::ObTransService* trans_service_; transaction::ObPartitionIterator partition_iter_; transaction::ObTransLockStatIterator trans_lock_stat_iter_; diff --git a/src/observer/virtual_table/ob_all_virtual_trans_mem_stat.h b/src/observer/virtual_table/ob_all_virtual_trans_mem_stat.h index 0329f52b7..29ff47e89 100644 --- a/src/observer/virtual_table/ob_all_virtual_trans_mem_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_trans_mem_stat.h @@ -27,7 +27,7 @@ class ObTransMemoryStat; } // namespace transaction namespace observer { class ObGVTransMemoryStat : public common::ObVirtualTableScannerIterator { - public: +public: explicit ObGVTransMemoryStat(transaction::ObTransService* trans_service) : trans_service_(trans_service) { reset(); @@ -37,23 +37,23 @@ class ObGVTransMemoryStat : public common::ObVirtualTableScannerIterator { destroy(); } - public: +public: int inner_get_next_row(common::ObNewRow*& row); void reset(); void destroy(); - private: +private: int prepare_start_to_read_(); - private: +private: char ip_buffer_[common::OB_IP_STR_BUFF]; char mod_type_[transaction::ObTransMemoryStat::OB_TRANS_MEMORY_MOD_TYPE_SIZE]; - private: +private: transaction::ObTransService* trans_service_; transaction::ObTransMemStatIterator mem_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVTransMemoryStat); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_all_virtual_trans_mgr_stat.h b/src/observer/virtual_table/ob_all_virtual_trans_mgr_stat.h index ed078d0b2..f83ec0bf3 100644 --- a/src/observer/virtual_table/ob_all_virtual_trans_mgr_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_trans_mgr_stat.h @@ -28,7 +28,7 @@ class ObTransPartitonStat; } // namespace transaction namespace observer { class ObGVTransPartitionMgrStat : public common::ObVirtualTableScannerIterator { - public: +public: explicit ObGVTransPartitionMgrStat(transaction::ObTransService* trans_service) : trans_service_(trans_service) { reset(); @@ -38,23 +38,23 @@ class ObGVTransPartitionMgrStat : public common::ObVirtualTableScannerIterator { destroy(); } - public: +public: int inner_get_next_row(common::ObNewRow*& row); void reset(); void destroy(); - private: +private: int prepare_start_to_read_(); - private: +private: char ip_buffer_[common::OB_IP_STR_BUFF]; char memstore_version_buffer_[common::MAX_VERSION_LENGTH]; - private: +private: transaction::ObTransService* trans_service_; transaction::ObTransPartitionMgrStatIterator trans_partition_mgr_stat_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVTransPartitionMgrStat); }; diff --git a/src/observer/virtual_table/ob_all_virtual_trans_result_info.h b/src/observer/virtual_table/ob_all_virtual_trans_result_info.h index b991dcc4f..68d9a28f6 100644 --- a/src/observer/virtual_table/ob_all_virtual_trans_result_info.h +++ b/src/observer/virtual_table/ob_all_virtual_trans_result_info.h @@ -28,7 +28,7 @@ class ObTransResultInfoStat; namespace observer { class ObGVTransResultInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObGVTransResultInfo(transaction::ObTransService* trans_service) : trans_service_(trans_service) { reset(); @@ -41,7 +41,7 @@ class ObGVTransResultInfo : public common::ObVirtualTableScannerIterator { void reset(); void destroy(); - private: +private: int prepare_start_to_read_(); int get_next_trans_result_info_(transaction::ObTransResultInfoStat& trans_result_info); static const int64_t OB_MIN_BUFFER_SIZE = 128; @@ -49,7 +49,7 @@ class ObGVTransResultInfo : public common::ObVirtualTableScannerIterator { char partition_buffer_[OB_MIN_BUFFER_SIZE]; char trans_id_buffer_[OB_MIN_BUFFER_SIZE]; - private: +private: transaction::ObTransService* trans_service_; transaction::ObPartitionIterator partition_iter_; transaction::ObTransResultInfoStatIterator trans_result_info_stat_iter_; diff --git a/src/observer/virtual_table/ob_all_virtual_trans_sql_audit.h b/src/observer/virtual_table/ob_all_virtual_trans_sql_audit.h index 2b28348df..321fafbea 100644 --- a/src/observer/virtual_table/ob_all_virtual_trans_sql_audit.h +++ b/src/observer/virtual_table/ob_all_virtual_trans_sql_audit.h @@ -19,19 +19,19 @@ namespace oceanbase { namespace observer { class ObAllVirtualTransSQLAudit : public common::ObVirtualTableScannerIterator { - public: +public: ObAllVirtualTransSQLAudit(); virtual ~ObAllVirtualTransSQLAudit() { reset(); } - public: +public: virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; virtual void reset() override; - private: +private: int extract_tenant_ids_(); int fill_cells_( const transaction::ObTransAuditCommonInfo& common_info, const transaction::ObTransAuditStmtInfo& stmt_info); @@ -41,14 +41,14 @@ class ObAllVirtualTransSQLAudit : public common::ObVirtualTableScannerIterator { share::ObTenantSpaceFetcher* with_tenant_ctx_; transaction::ObTransSQLAuditDataIterator audit_iter_; - private: +private: static const int64_t OB_MIN_BUFFER_SIZE = 128; char ip_buffer_[common::OB_IP_STR_BUFF]; char trans_id_buffer_[OB_MIN_BUFFER_SIZE]; char trace_id_buffer_[OB_MIN_BUFFER_SIZE]; char partition_buffer_[OB_MIN_BUFFER_SIZE]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTransSQLAudit); }; diff --git a/src/observer/virtual_table/ob_all_virtual_trans_stat.h b/src/observer/virtual_table/ob_all_virtual_trans_stat.h index b1aca43f1..1a30dc812 100644 --- a/src/observer/virtual_table/ob_all_virtual_trans_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_trans_stat.h @@ -32,7 +32,7 @@ class ObTransStat; } // namespace transaction namespace observer { class ObGVTransStat : public common::ObVirtualTableScannerIterator { - public: +public: explicit ObGVTransStat(transaction::ObTransService* trans_service) : trans_service_(trans_service) {} virtual ~ObGVTransStat() @@ -40,16 +40,16 @@ class ObGVTransStat : public common::ObVirtualTableScannerIterator { destroy(); } - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); virtual void destroy(); - private: +private: int prepare_start_to_read_(); int get_next_trans_info_(transaction::ObTransStat& trans_stat); - private: +private: enum { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -99,12 +99,12 @@ class ObGVTransStat : public common::ObVirtualTableScannerIterator { char prev_trans_info_buffer_[OB_MAX_BUFFER_SIZE]; char next_trans_info_buffer_[OB_MAX_BUFFER_SIZE]; - private: +private: transaction::ObTransService* trans_service_; transaction::ObPartitionIterator partition_iter_; transaction::ObTransStatIterator trans_stat_iter_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVTransStat); }; diff --git a/src/observer/virtual_table/ob_all_virtual_trans_table_status.h b/src/observer/virtual_table/ob_all_virtual_trans_table_status.h index 2b829deef..6b49c2ca1 100644 --- a/src/observer/virtual_table/ob_all_virtual_trans_table_status.h +++ b/src/observer/virtual_table/ob_all_virtual_trans_table_status.h @@ -26,14 +26,14 @@ class ObTenantManager; namespace observer { class ObAllVirtualTransTableStatus : public common::ObVirtualTableIterator { - public: +public: ObAllVirtualTransTableStatus(); virtual ~ObAllVirtualTransTableStatus(); virtual int init(); virtual void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum CACHE_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_all_virtual_weak_read_stat.h b/src/observer/virtual_table/ob_all_virtual_weak_read_stat.h index 1430574a0..6bb33c563 100644 --- a/src/observer/virtual_table/ob_all_virtual_weak_read_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_weak_read_stat.h @@ -57,13 +57,13 @@ class ObAllVirtualWeakReadStat : public common::ObVirtualTableScannerIterator { MAX_CLUSTER_VERSION }; - public: +public: ObAllVirtualWeakReadStat(); ~ObAllVirtualWeakReadStat(); void reset(); int inner_get_next_row(common::ObNewRow*& row); - protected: +protected: bool start_to_read_; }; diff --git a/src/observer/virtual_table/ob_all_virtual_zone_stat.h b/src/observer/virtual_table/ob_all_virtual_zone_stat.h index 5913f5db8..ac8bd8b43 100644 --- a/src/observer/virtual_table/ob_all_virtual_zone_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_zone_stat.h @@ -30,7 +30,7 @@ class ObMultiVersionSchemaService; } // namespace share namespace observer { class ObAllVirtualZoneStat : public common::ObVirtualTableProjector { - public: +public: struct ZoneStat { ZoneStat(); ~ZoneStat() @@ -50,14 +50,14 @@ class ObAllVirtualZoneStat : public common::ObVirtualTableProjector { int init(share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy* sql_proxy); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int get_all_stat(); int get_full_row( const share::schema::ObTableSchema* table, const ZoneStat& zone_stat, common::ObIArray& columns); DISALLOW_COPY_AND_ASSIGN(ObAllVirtualZoneStat); - private: +private: bool inited_; common::ObArray zone_stats_; common::ObFixedLengthString cluster_name_; diff --git a/src/observer/virtual_table/ob_global_variables.h b/src/observer/virtual_table/ob_global_variables.h index 0fcba93bd..9bcde3e8a 100644 --- a/src/observer/virtual_table/ob_global_variables.h +++ b/src/observer/virtual_table/ob_global_variables.h @@ -28,7 +28,7 @@ class ObSQLSessionInfo; } namespace observer { class ObGlobalVariables : public common::ObVirtualTableScannerIterator { - public: +public: ObGlobalVariables(); virtual ~ObGlobalVariables(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -42,7 +42,7 @@ class ObGlobalVariables : public common::ObVirtualTableScannerIterator { sql_proxy_ = sql_proxy; } - private: +private: common::ObMySQLProxy* sql_proxy_; const share::schema::ObSysVariableSchema* sys_variable_schema_; DISALLOW_COPY_AND_ASSIGN(ObGlobalVariables); diff --git a/src/observer/virtual_table/ob_gv_partition_info.h b/src/observer/virtual_table/ob_gv_partition_info.h index 5ea2f3f63..8eb955bb8 100644 --- a/src/observer/virtual_table/ob_gv_partition_info.h +++ b/src/observer/virtual_table/ob_gv_partition_info.h @@ -22,11 +22,11 @@ namespace oceanbase { namespace observer { class ObGVPartitionInfo : public common::ObVirtualTableScannerIterator { - public: +public: ObGVPartitionInfo(); virtual ~ObGVPartitionInfo(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); inline void set_partition_service(storage::ObPartitionService* partition_service) @@ -38,11 +38,11 @@ class ObGVPartitionInfo : public common::ObVirtualTableScannerIterator { addr_ = addr; } - private: +private: int freeze_status_to_string(int64_t freeze_status, char* buf, int64_t buf_len); int partition_state_to_string(int64_t partition_state, char* buf, int16_t buf_len); - private: +private: storage::ObPartitionService* partition_service_; common::ObAddr addr_; storage::ObIPartitionGroupIterator* pg_iter_; @@ -54,7 +54,7 @@ class ObGVPartitionInfo : public common::ObVirtualTableScannerIterator { char active_version_buf_[common::TABLE_MAX_VALUE_LENGTH]; char pkey_buf_[common::OB_TMP_BUF_SIZE_256]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVPartitionInfo); }; diff --git a/src/observer/virtual_table/ob_gv_sql.h b/src/observer/virtual_table/ob_gv_sql.h index d99db28c8..a11c3b0c1 100644 --- a/src/observer/virtual_table/ob_gv_sql.h +++ b/src/observer/virtual_table/ob_gv_sql.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace observer { class ObGVSql : public ObAllPlanCacheBase { - public: +public: ObGVSql(); virtual ~ObGVSql(); void reset(); @@ -29,12 +29,12 @@ class ObGVSql : public ObAllPlanCacheBase { return get_row_from_tenants(); } - protected: +protected: int get_row_from_tenants(); int fill_cells(const sql::ObCacheObject* cache_obj, const sql::ObPlanCache& plan_cache); int get_row_from_specified_tenant(uint64_t tenant_id, bool& is_end); - private: +private: common::ObSEArray plan_id_array_; int64_t plan_id_array_idx_; sql::ObPlanCache* plan_cache_; diff --git a/src/observer/virtual_table/ob_gv_sql_audit.h b/src/observer/virtual_table/ob_gv_sql_audit.h index 02405dba1..809b82fe8 100644 --- a/src/observer/virtual_table/ob_gv_sql_audit.h +++ b/src/observer/virtual_table/ob_gv_sql_audit.h @@ -34,7 +34,7 @@ class ObTenantSpaceFetcher; namespace observer { class ObGvSqlAudit : public common::ObVirtualTableScannerIterator { - public: +public: ObGvSqlAudit(); virtual ~ObGvSqlAudit(); @@ -56,12 +56,12 @@ class ObGvSqlAudit : public common::ObVirtualTableScannerIterator { return is_use_index_; } - private: +private: int fill_cells(obmysql::ObMySQLRequestRecord& record); int extract_tenant_ids(); int extract_request_ids(const uint64_t tenant_id, int64_t& start_id, int64_t& end_id, bool& is_valid); - private: +private: enum WAIT_COLUMN { SERVER_IP = common::OB_APP_MIN_COLUMN_ID, SERVER_PORT, diff --git a/src/observer/virtual_table/ob_gv_tenant_memstore_info.h b/src/observer/virtual_table/ob_gv_tenant_memstore_info.h index c13ffcfc0..d92924bed 100644 --- a/src/observer/virtual_table/ob_gv_tenant_memstore_info.h +++ b/src/observer/virtual_table/ob_gv_tenant_memstore_info.h @@ -35,11 +35,11 @@ class ObGVTenantMemstoreInfo : public common::ObVirtualTableScannerIterator { FREEZE_CNT }; - public: +public: ObGVTenantMemstoreInfo(); virtual ~ObGVTenantMemstoreInfo(); - public: +public: virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); inline void set_tenant_mgr(common::ObTenantManager* tenant_mgr) @@ -51,12 +51,12 @@ class ObGVTenantMemstoreInfo : public common::ObVirtualTableScannerIterator { addr_ = addr; } - private: +private: common::ObTenantManager* tenant_mgr_; uint64_t current_pos_; common::ObAddr addr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGVTenantMemstoreInfo); }; diff --git a/src/observer/virtual_table/ob_information_columns_table.h b/src/observer/virtual_table/ob_information_columns_table.h index 28f865d64..4416a5196 100644 --- a/src/observer/virtual_table/ob_information_columns_table.h +++ b/src/observer/virtual_table/ob_information_columns_table.h @@ -52,7 +52,7 @@ class ObInfoSchemaColumnsTable : public common::ObVirtualTableScannerIterator { GENERATION_EXPRESSION }; - public: +public: ObInfoSchemaColumnsTable(); virtual ~ObInfoSchemaColumnsTable(); @@ -64,7 +64,7 @@ class ObInfoSchemaColumnsTable : public common::ObVirtualTableScannerIterator { tenant_id_ = tenant_id; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObInfoSchemaColumnsTable); int fill_row_cells(const common::ObString& database_name, const share::schema::ObTableSchema* table_schema, const share::schema::ObColumnSchemaV2* column_schema, const uint64_t ordinal_position); @@ -86,7 +86,7 @@ class ObInfoSchemaColumnsTable : public common::ObVirtualTableScannerIterator { int get_type_str(const ObObjMeta& obj_meta, const ObAccuracy& accuracy, const common::ObIArray& type_info, const int16_t default_length_semantics, int64_t& pos); - private: +private: uint64_t tenant_id_; int64_t last_schema_idx_; int64_t last_table_idx_; diff --git a/src/observer/virtual_table/ob_information_global_status_table.h b/src/observer/virtual_table/ob_information_global_status_table.h index 4c7b3b203..10abca02a 100644 --- a/src/observer/virtual_table/ob_information_global_status_table.h +++ b/src/observer/virtual_table/ob_information_global_status_table.h @@ -31,7 +31,7 @@ class ObInfoSchemaGlobalStatusTable : public common::ObVirtualTableScannerIterat typedef common::hash::ObHashMap AllStatus; - public: +public: ObInfoSchemaGlobalStatusTable(); virtual ~ObInfoSchemaGlobalStatusTable(); @@ -47,11 +47,11 @@ class ObInfoSchemaGlobalStatusTable : public common::ObVirtualTableScannerIterat global_ctx_ = global_ctx; } - private: +private: int fetch_all_global_status(AllStatus& all_status); DISALLOW_COPY_AND_ASSIGN(ObInfoSchemaGlobalStatusTable); - private: +private: sql::ObSQLSessionInfo* cur_session_; const observer::ObGlobalContext* global_ctx_; static const char* const variables_name[]; diff --git a/src/observer/virtual_table/ob_information_kvcache_table.h b/src/observer/virtual_table/ob_information_kvcache_table.h index 25fd3e97c..3a585519b 100644 --- a/src/observer/virtual_table/ob_information_kvcache_table.h +++ b/src/observer/virtual_table/ob_information_kvcache_table.h @@ -29,7 +29,7 @@ class ObObj; namespace observer { class ObInfoSchemaKvCacheTable : public common::ObVirtualTableScannerIterator { - public: +public: ObInfoSchemaKvCacheTable(); virtual ~ObInfoSchemaKvCacheTable(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -40,7 +40,7 @@ class ObInfoSchemaKvCacheTable : public common::ObVirtualTableScannerIterator { } virtual int set_ip(common::ObAddr* addr); - private: +private: enum CACHE_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_information_parameters_table.h b/src/observer/virtual_table/ob_information_parameters_table.h index 9c328083c..7cfc120eb 100644 --- a/src/observer/virtual_table/ob_information_parameters_table.h +++ b/src/observer/virtual_table/ob_information_parameters_table.h @@ -21,7 +21,7 @@ class ObSQLSessionInfo; } namespace observer { class ObInformationParametersTable : public common::ObVirtualTableScannerIterator { - private: +private: enum InformationParametersTableColumns { SPECIFIC_CATALOG = 16, SPECIFIC_SCHEMA, @@ -41,7 +41,7 @@ class ObInformationParametersTable : public common::ObVirtualTableScannerIterato ROUTINE_TYPE }; - public: +public: ObInformationParametersTable(); virtual ~ObInformationParametersTable(); @@ -52,11 +52,11 @@ class ObInformationParametersTable : public common::ObVirtualTableScannerIterato tenant_id_ = tenant_id; } - private: - private: +private: +private: uint64_t tenant_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObInformationParametersTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_information_partitions_table.h b/src/observer/virtual_table/ob_information_partitions_table.h index 44ca824b8..8ef4ec534 100644 --- a/src/observer/virtual_table/ob_information_partitions_table.h +++ b/src/observer/virtual_table/ob_information_partitions_table.h @@ -29,7 +29,7 @@ class ObDatabaseSchema; namespace observer { class ObInfoSchemaPartitionsTable : public common::ObVirtualTableScannerIterator { - public: +public: ObInfoSchemaPartitionsTable(); virtual ~ObInfoSchemaPartitionsTable(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -37,7 +37,7 @@ class ObInfoSchemaPartitionsTable : public common::ObVirtualTableScannerIterator inline void set_tenant_id(uint64_t tenant_id); - private: +private: int add_partitions( const share::schema::ObDatabaseSchema& database_schema, common::ObObj* cells, const int64_t col_count); int add_partitions(const share::schema::ObTableSchema& table_schema, const common::ObString& database_name, @@ -48,7 +48,7 @@ class ObInfoSchemaPartitionsTable : public common::ObVirtualTableScannerIterator const share::schema::ObTableSchema& table_schema, const int64_t part_id, common::ObString& val_str); uint64_t tenant_id_; - private: +private: enum PARTITION_COLUMN { TABLE_CATALOG = common::OB_APP_MIN_COLUMN_ID, TABLE_SCHEMA, diff --git a/src/observer/virtual_table/ob_information_referential_constraints_table.h b/src/observer/virtual_table/ob_information_referential_constraints_table.h index 196953c0a..1eff49ba2 100644 --- a/src/observer/virtual_table/ob_information_referential_constraints_table.h +++ b/src/observer/virtual_table/ob_information_referential_constraints_table.h @@ -30,7 +30,7 @@ class ObDatabaseSchema; namespace observer { class ObInfoSchemaReferentialConstraintsTable : public common::ObVirtualTableScannerIterator { - public: +public: ObInfoSchemaReferentialConstraintsTable(); virtual ~ObInfoSchemaReferentialConstraintsTable(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -41,14 +41,14 @@ class ObInfoSchemaReferentialConstraintsTable : public common::ObVirtualTableSca tenant_id_ = tenant_id; } - private: +private: int add_fk_constraints_in_db( const share::schema::ObDatabaseSchema& database_schema, common::ObObj* cells, const int64_t col_count); int add_fk_constraints_in_table(const share::schema::ObTableSchema& table_schema, const common::ObString& database_name, common::ObObj* cells, const int64_t col_count); uint64_t tenant_id_; - private: +private: enum REFERENTIAL_CONSTRAINTS_COLUMN_COUNT_COLUMN { CONSTRAINT_CATALOG = common::OB_APP_MIN_COLUMN_ID, CONSTRAINT_SCHEMA, diff --git a/src/observer/virtual_table/ob_information_schema_privileges_table.h b/src/observer/virtual_table/ob_information_schema_privileges_table.h index c9430ea3a..1369b48c8 100644 --- a/src/observer/virtual_table/ob_information_schema_privileges_table.h +++ b/src/observer/virtual_table/ob_information_schema_privileges_table.h @@ -27,9 +27,9 @@ class ObDBPriv; } // namespace share namespace observer { class ObInfoSchemaSchemaPrivilegesTable : public common::ObVirtualTableScannerIterator { - public: +public: class StaticInit { - public: + public: StaticInit(); }; friend class ObInfoSchemaSchemaPrivilegesTable::StaticInit; @@ -49,7 +49,7 @@ class ObInfoSchemaSchemaPrivilegesTable : public common::ObVirtualTableScannerIt user_id_ = user_id; } - private: +private: enum TABLE_PRIVS_COLUMN { GRANTEE = 16, TABLE_CATALOG, diff --git a/src/observer/virtual_table/ob_information_session_status_table.h b/src/observer/virtual_table/ob_information_session_status_table.h index dbb0dddb2..c75bcce29 100644 --- a/src/observer/virtual_table/ob_information_session_status_table.h +++ b/src/observer/virtual_table/ob_information_session_status_table.h @@ -31,7 +31,7 @@ class ObInfoSchemaSessionStatusTable : public common::ObVirtualTableScannerItera typedef common::hash::ObHashMap AllStatus; - public: +public: ObInfoSchemaSessionStatusTable(); virtual ~ObInfoSchemaSessionStatusTable(); @@ -47,11 +47,11 @@ class ObInfoSchemaSessionStatusTable : public common::ObVirtualTableScannerItera global_ctx_ = global_ctx; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObInfoSchemaSessionStatusTable); int fetch_all_session_status(AllStatus& all_status); - private: +private: sql::ObSQLSessionInfo* cur_session_; const observer::ObGlobalContext* global_ctx_; static const char* const variables_name[]; diff --git a/src/observer/virtual_table/ob_information_session_variables_table.h b/src/observer/virtual_table/ob_information_session_variables_table.h index a3adbd3de..c6778ce44 100644 --- a/src/observer/virtual_table/ob_information_session_variables_table.h +++ b/src/observer/virtual_table/ob_information_session_variables_table.h @@ -32,7 +32,7 @@ class ObInfoSchemaSessionVariablesTable : public common::ObVirtualTableScannerIt VARIABLE_VALUE, }; - public: +public: ObInfoSchemaSessionVariablesTable(); virtual ~ObInfoSchemaSessionVariablesTable(); @@ -44,10 +44,10 @@ class ObInfoSchemaSessionVariablesTable : public common::ObVirtualTableScannerIt sys_variable_schema_ = sys_variable_schema; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObInfoSchemaSessionVariablesTable); - private: +private: const share::schema::ObSysVariableSchema* sys_variable_schema_; }; } // namespace observer diff --git a/src/observer/virtual_table/ob_information_table_constraints_table.h b/src/observer/virtual_table/ob_information_table_constraints_table.h index 8935e4617..e5b1eebf9 100644 --- a/src/observer/virtual_table/ob_information_table_constraints_table.h +++ b/src/observer/virtual_table/ob_information_table_constraints_table.h @@ -36,7 +36,7 @@ static const common::ObString CHECK_CONSTRAINT_TYPE = "CHECK"; static const common::ObString FOREIGN_KEY_CONSTRAINT_TYPE = "FOREIGN KEY"; class ObInfoSchemaTableConstraintsTable : public common::ObVirtualTableScannerIterator { - public: +public: ObInfoSchemaTableConstraintsTable(); virtual ~ObInfoSchemaTableConstraintsTable(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -47,7 +47,7 @@ class ObInfoSchemaTableConstraintsTable : public common::ObVirtualTableScannerIt tenant_id_ = tenant_id; } - private: +private: int add_table_constraints( const share::schema::ObDatabaseSchema& database_schema, common::ObObj* cells, const int64_t col_count); int add_table_constraints(const share::schema::ObTableSchema& table_schema, const common::ObString& database_name, @@ -63,7 +63,7 @@ class ObInfoSchemaTableConstraintsTable : public common::ObVirtualTableScannerIt uint64_t tenant_id_; - private: +private: enum TABLE_CONSTRAINTS_COLUMN { CONSTRAINT_CATALOG = common::OB_APP_MIN_COLUMN_ID, CONSTRAINT_SCHEMA, diff --git a/src/observer/virtual_table/ob_information_table_privileges_table.h b/src/observer/virtual_table/ob_information_table_privileges_table.h index 1342eafda..0848fb28c 100644 --- a/src/observer/virtual_table/ob_information_table_privileges_table.h +++ b/src/observer/virtual_table/ob_information_table_privileges_table.h @@ -27,9 +27,9 @@ class ObTablePriv; } // namespace share namespace observer { class ObInfoSchemaTablePrivilegesTable : public common::ObVirtualTableScannerIterator { - public: +public: class StaticInit { - public: + public: StaticInit(); }; friend class ObInfoSchemaTablePrivilegesTable::StaticInit; @@ -49,7 +49,7 @@ class ObInfoSchemaTablePrivilegesTable : public common::ObVirtualTableScannerIte user_id_ = user_id; } - private: +private: enum TABLE_PRIVS_COLUMN { GRANTEE = 16, TABLE_CATALOG, diff --git a/src/observer/virtual_table/ob_information_user_privileges_table.h b/src/observer/virtual_table/ob_information_user_privileges_table.h index 825f3a5c2..eda35a496 100644 --- a/src/observer/virtual_table/ob_information_user_privileges_table.h +++ b/src/observer/virtual_table/ob_information_user_privileges_table.h @@ -27,9 +27,9 @@ class ObUserInfo; } // namespace share namespace observer { class ObInfoSchemaUserPrivilegesTable : public common::ObVirtualTableScannerIterator { - public: +public: class StaticInit { - public: + public: StaticInit(); }; friend class ObInfoSchemaUserPrivilegesTable::StaticInit; @@ -49,7 +49,7 @@ class ObInfoSchemaUserPrivilegesTable : public common::ObVirtualTableScannerIter user_id_ = user_id; } - private: +private: enum USER_PRIVS_COLUMN { GRANTEE = 16, TABLE_CATALOG, PRIVILEGE_TYPE, IS_GRANTABLE, MAX_USER_PRIVS_COLUMN }; enum { MAX_COL_COUNT = 4, diff --git a/src/observer/virtual_table/ob_iterate_virtual_table.h b/src/observer/virtual_table/ob_iterate_virtual_table.h index afe8bf2cf..de7419bc6 100644 --- a/src/observer/virtual_table/ob_iterate_virtual_table.h +++ b/src/observer/virtual_table/ob_iterate_virtual_table.h @@ -21,7 +21,7 @@ namespace observer { // Iterate tables of all tenants class ObIterateVirtualTable : public ObAgentTableBase { - public: +public: ObIterateVirtualTable(); virtual ~ObIterateVirtualTable(); @@ -34,7 +34,7 @@ class ObIterateVirtualTable : public ObAgentTableBase { int set_column_name_with_tenant_id(const char* column_name); - private: +private: virtual int init_non_exist_map_item(MapItem& item, const share::schema::ObColumnSchemaV2& col) override; virtual int setup_inital_rowkey_condition(common::ObSqlString& cols, common::ObSqlString& vals); @@ -51,7 +51,7 @@ class ObIterateVirtualTable : public ObAgentTableBase { int str_to_int(const ObString& str, int64_t& value); - private: +private: int64_t tenant_idx_; uint64_t cur_tenant_id_; // For sys table under user tenant, record real tenant id (effective_tenant_id()) in diff --git a/src/observer/virtual_table/ob_mem_leak_checker_info.h b/src/observer/virtual_table/ob_mem_leak_checker_info.h index 217e5b120..8a1a53eb0 100644 --- a/src/observer/virtual_table/ob_mem_leak_checker_info.h +++ b/src/observer/virtual_table/ob_mem_leak_checker_info.h @@ -27,7 +27,7 @@ namespace allocator {} namespace observer { class ObMemLeakChecker; class ObMemLeakCheckerInfo : public common::ObVirtualTableIterator { - public: +public: ObMemLeakCheckerInfo(); virtual ~ObMemLeakCheckerInfo(); @@ -42,11 +42,11 @@ class ObMemLeakCheckerInfo : public common::ObVirtualTableIterator { virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: int sanity_check(); int fill_row(common::ObNewRow*& row); - private: +private: bool opened_; common::ObMemLeakChecker* leak_checker_; common::ObMemLeakChecker::mod_info_map_t::const_iterator it_; @@ -55,7 +55,7 @@ class ObMemLeakCheckerInfo : public common::ObVirtualTableIterator { uint64_t tenant_id_; const char* label_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemLeakCheckerInfo); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_mysql_db_table.h b/src/observer/virtual_table/ob_mysql_db_table.h index 4e88b1c72..cfd7645aa 100644 --- a/src/observer/virtual_table/ob_mysql_db_table.h +++ b/src/observer/virtual_table/ob_mysql_db_table.h @@ -25,7 +25,7 @@ class ObSQLSessionInfo; } namespace observer { class ObMySQLDBTable : public common::ObVirtualTableScannerIterator { - private: +private: enum MySQLDBTableColumns { HOST = 16, DB, @@ -51,7 +51,7 @@ class ObMySQLDBTable : public common::ObVirtualTableScannerIterator { TRIGGER_PRIV, }; - public: +public: ObMySQLDBTable(); virtual ~ObMySQLDBTable(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -62,11 +62,11 @@ class ObMySQLDBTable : public common::ObVirtualTableScannerIterator { tenant_id_ = tenant_id; } - private: +private: int get_user_info(const uint64_t user_id, const share::schema::ObUserInfo*& user_info); uint64_t tenant_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMySQLDBTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_mysql_proc_table.h b/src/observer/virtual_table/ob_mysql_proc_table.h index 6770845a6..299b4ef96 100644 --- a/src/observer/virtual_table/ob_mysql_proc_table.h +++ b/src/observer/virtual_table/ob_mysql_proc_table.h @@ -21,7 +21,7 @@ class ObSQLSessionInfo; } namespace observer { class ObMySQLProcTable : public common::ObVirtualTableScannerIterator { - private: +private: enum MySQLProcTableColumns { DB = 16, NAME, @@ -45,7 +45,7 @@ class ObMySQLProcTable : public common::ObVirtualTableScannerIterator { BODY_UTF8, }; - public: +public: ObMySQLProcTable(); virtual ~ObMySQLProcTable(); @@ -56,10 +56,10 @@ class ObMySQLProcTable : public common::ObVirtualTableScannerIterator { tenant_id_ = tenant_id; } - private: +private: uint64_t tenant_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMySQLProcTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_mysql_user_table.h b/src/observer/virtual_table/ob_mysql_user_table.h index 7a67876b6..fcb69406e 100644 --- a/src/observer/virtual_table/ob_mysql_user_table.h +++ b/src/observer/virtual_table/ob_mysql_user_table.h @@ -21,7 +21,7 @@ class ObSQLSessionInfo; } namespace observer { class ObMySQLUserTable : public common::ObVirtualTableScannerIterator { - private: +private: enum MySQLUserTableColumns { HOST = 16, USER_NAME, @@ -68,7 +68,7 @@ class ObMySQLUserTable : public common::ObVirtualTableScannerIterator { PASSWORD_EXPIRED, }; - public: +public: ObMySQLUserTable(); virtual ~ObMySQLUserTable(); @@ -80,10 +80,10 @@ class ObMySQLUserTable : public common::ObVirtualTableScannerIterator { tenant_id_ = tenant_id; } - private: +private: uint64_t tenant_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMySQLUserTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_partition_sstable_image_info_table.h b/src/observer/virtual_table/ob_partition_sstable_image_info_table.h index 87b13432a..82ce3603a 100644 --- a/src/observer/virtual_table/ob_partition_sstable_image_info_table.h +++ b/src/observer/virtual_table/ob_partition_sstable_image_info_table.h @@ -82,26 +82,26 @@ struct SSStoreVersionInfo { }; class ObPartitionSstableImageInfoTable : public common::ObVirtualTableScannerIterator { - public: +public: ObPartitionSstableImageInfoTable(); virtual ~ObPartitionSstableImageInfoTable(); int init(storage::ObPartitionService& partition_service, share::schema::ObMultiVersionSchemaService& schema_service, common::ObAddr& addr); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int64_t find(ObVersion& version, ObArray& ss_store_version_info_list) const; int get_ss_store_version_info(ObArray& ss_store_version_info_list); int fill_scaner(); int get_table_store_cnt(int64_t& table_cnt); - private: +private: bool inited_; common::ObAddr* addr_; storage::ObPartitionService* partition_service_; share::schema::ObMultiVersionSchemaService* schema_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionSstableImageInfoTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_plan_cache_plan_explain.h b/src/observer/virtual_table/ob_plan_cache_plan_explain.h index 3b89a3677..c22a3d0d4 100644 --- a/src/observer/virtual_table/ob_plan_cache_plan_explain.h +++ b/src/observer/virtual_table/ob_plan_cache_plan_explain.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace observer { class ObExpVisitor { - public: +public: ObExpVisitor(common::ObIArray& output_column_ids, common::ObNewRow& cur_row, common::ObScanner& scanner) : output_column_ids_(output_column_ids), cur_row_(cur_row), @@ -57,11 +57,11 @@ class ObExpVisitor { return ret; } - private: +private: int get_table_access_desc(bool is_idx_access, const ObQueryFlag& scan_flag, ObString& tab_name, const ObString& index_name, ObString& ret_name); - protected: +protected: common::ObIArray& output_column_ids_; common::ObNewRow& cur_row_; common::ObScanner& scanner_; @@ -72,7 +72,7 @@ class ObExpVisitor { }; class ObPhyOpExpVisitor : public sql::ObPhyOperatorVisitor, public ObExpVisitor { - public: +public: ObPhyOpExpVisitor( common::ObIArray& output_column_ids, common::ObNewRow& cur_row, common::ObScanner& scanner) : ObExpVisitor(output_column_ids, cur_row, scanner) @@ -85,7 +85,7 @@ class ObPhyOpExpVisitor : public sql::ObPhyOperatorVisitor, public ObExpVisitor return ObExpVisitor::init(tenant_id, plan_id, allocator); } - private: +private: int pre_visit(const sql::ObSingleChildPhyOperator& op) { UNUSED(op); @@ -140,7 +140,7 @@ class ObPhyOpExpVisitor : public sql::ObPhyOperatorVisitor, public ObExpVisitor }; class ObOpSpecExpVisitor : public sql::ObOpSpecVisitor, public ObExpVisitor { - public: +public: ObOpSpecExpVisitor( common::ObIArray& output_column_ids, common::ObNewRow& cur_row, common::ObScanner& scanner) : ObExpVisitor(output_column_ids, cur_row, scanner) @@ -162,12 +162,12 @@ class ObOpSpecExpVisitor : public sql::ObOpSpecVisitor, public ObExpVisitor { return common::OB_SUCCESS; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOpSpecExpVisitor); }; class ObPlanCachePlanExplain : public common::ObVirtualTableScannerIterator { - public: +public: enum { TENANT_ID_COL = 16, IP_COL, @@ -191,7 +191,7 @@ class ObPlanCachePlanExplain : public common::ObVirtualTableScannerIterator { virtual int inner_open(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int set_tenant_plan_id(const common::ObIArray& ranges); int64_t tenant_id_; int64_t plan_id_; diff --git a/src/observer/virtual_table/ob_session_variables.h b/src/observer/virtual_table/ob_session_variables.h index a0f89afc6..47eeab47d 100644 --- a/src/observer/virtual_table/ob_session_variables.h +++ b/src/observer/virtual_table/ob_session_variables.h @@ -28,7 +28,7 @@ class ObObj; } namespace observer { class ObSessionVariables : public common::ObVirtualTableScannerIterator { - public: +public: ObSessionVariables(); virtual ~ObSessionVariables(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -38,10 +38,10 @@ class ObSessionVariables : public common::ObVirtualTableScannerIterator { sys_variable_schema_ = sys_variable_schema; } - private: +private: int set_pc_conf(const share::ObBasicSysVar* sys_var, common::ObObj& cell); - private: +private: const share::schema::ObSysVariableSchema* sys_variable_schema_; DISALLOW_COPY_AND_ASSIGN(ObSessionVariables); }; diff --git a/src/observer/virtual_table/ob_show_create_database.h b/src/observer/virtual_table/ob_show_create_database.h index f452b653f..7494d3953 100644 --- a/src/observer/virtual_table/ob_show_create_database.h +++ b/src/observer/virtual_table/ob_show_create_database.h @@ -22,17 +22,17 @@ class ObString; } namespace observer { class ObShowCreateDatabase : public common::ObVirtualTableScannerIterator { - public: +public: ObShowCreateDatabase(); virtual ~ObShowCreateDatabase(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: int calc_show_database_id(uint64_t& show_database_id); int fill_row_cells(uint64_t show_database_id, const common::ObString& database_name); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObShowCreateDatabase); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_show_create_table.h b/src/observer/virtual_table/ob_show_create_table.h index e75073bc6..8eb57467f 100644 --- a/src/observer/virtual_table/ob_show_create_table.h +++ b/src/observer/virtual_table/ob_show_create_table.h @@ -28,17 +28,17 @@ class ObTableSchema; } // namespace share namespace observer { class ObShowCreateTable : public common::ObVirtualTableScannerIterator { - public: +public: ObShowCreateTable(); virtual ~ObShowCreateTable(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: int calc_show_table_id(uint64_t& show_table_id); int fill_row_cells(uint64_t show_table_id, const share::schema::ObTableSchema& table_schema); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObShowCreateTable); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_show_create_tablegroup.h b/src/observer/virtual_table/ob_show_create_tablegroup.h index 0520d44f3..5f8013f18 100644 --- a/src/observer/virtual_table/ob_show_create_tablegroup.h +++ b/src/observer/virtual_table/ob_show_create_tablegroup.h @@ -22,17 +22,17 @@ class ObString; } namespace observer { class ObShowCreateTablegroup : public common::ObVirtualTableScannerIterator { - public: +public: ObShowCreateTablegroup(); virtual ~ObShowCreateTablegroup(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: int calc_show_tablegroup_id(uint64_t& show_tablegroup_id); int fill_row_cells(uint64_t show_tablegroup_id, const common::ObString& tablegroup_name); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObShowCreateTablegroup); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_show_database_status.h b/src/observer/virtual_table/ob_show_database_status.h index 949d32db8..366a7bb90 100644 --- a/src/observer/virtual_table/ob_show_database_status.h +++ b/src/observer/virtual_table/ob_show_database_status.h @@ -29,7 +29,7 @@ class ObDatabaseSchema; namespace observer { class ObShowDatabaseStatus : public common::ObVirtualTableScannerIterator { - public: +public: ObShowDatabaseStatus(); virtual ~ObShowDatabaseStatus(); @@ -45,10 +45,10 @@ class ObShowDatabaseStatus : public common::ObVirtualTableScannerIterator { common::ObObj* cells, const int64_t col_count); int add_all_database_status(); - private: +private: uint64_t tenant_id_; - private: +private: enum DATABASE_STATUS_COLUMN { DATABASE_NAME = common::OB_APP_MIN_COLUMN_ID, HOST, diff --git a/src/observer/virtual_table/ob_show_grants.h b/src/observer/virtual_table/ob_show_grants.h index 4c8345e67..b04ed4e3b 100644 --- a/src/observer/virtual_table/ob_show_grants.h +++ b/src/observer/virtual_table/ob_show_grants.h @@ -24,7 +24,7 @@ class ObSQLSessionInfo; } namespace observer { class ObShowGrants : public common::ObVirtualTableScannerIterator { - public: +public: ObShowGrants(); virtual ~ObShowGrants(); @@ -53,7 +53,7 @@ class ObShowGrants : public common::ObVirtualTableScannerIterator { static int print_obj_privs_to_buff_ora( char* buf, const int64_t buf_len, int64_t& pos, const share::ObPackedObjPriv obj_privs); - private: +private: // @brief get string 'grant priv on priv_level to user' int get_grants_string(char* buf, const int64_t buf_len, int64_t& pos, share::schema::ObNeedPriv& have_priv, common::ObString& user_name, common::ObString& host_name); @@ -74,12 +74,12 @@ class ObShowGrants : public common::ObVirtualTableScannerIterator { int priv_obj_info_ora( char* buf, const int64_t buf_len, int64_t& pos, ObString& db_name, ObString& obj_name, ObString& col_name); - private: +private: uint64_t tenant_id_; uint64_t user_id_; share::schema::ObSessionPrivInfo session_priv_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObShowGrants); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_show_interm_result.h b/src/observer/virtual_table/ob_show_interm_result.h index aed8e5d6b..403ad037a 100644 --- a/src/observer/virtual_table/ob_show_interm_result.h +++ b/src/observer/virtual_table/ob_show_interm_result.h @@ -20,13 +20,13 @@ class ObNewRow; } namespace observer { class ObShowIntermResult : public common::ObVirtualTableScannerIterator { - public: +public: ObShowIntermResult(); virtual ~ObShowIntermResult(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObShowIntermResult); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_show_processlist.h b/src/observer/virtual_table/ob_show_processlist.h index 2ed8163b3..94c283095 100644 --- a/src/observer/virtual_table/ob_show_processlist.h +++ b/src/observer/virtual_table/ob_show_processlist.h @@ -25,7 +25,7 @@ class ObSQLSessionInfo; } namespace observer { class ObShowProcesslist : public common::ObVirtualTableScannerIterator { - public: +public: ObShowProcesslist(); virtual ~ObShowProcesslist(); inline void set_session_mgr(sql::ObSQLSessionMgr* session_mgr) @@ -35,7 +35,7 @@ class ObShowProcesslist : public common::ObVirtualTableScannerIterator { virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: enum SESSION_INFO_COLUMN { ID = OB_APP_MIN_COLUMN_ID, USER, @@ -59,7 +59,7 @@ class ObShowProcesslist : public common::ObVirtualTableScannerIterator { SSL_CIPHER }; class FillScanner { - public: + public: FillScanner() : allocator_(NULL), scanner_(NULL), cur_row_(NULL), my_session_(NULL), output_column_ids_() {} virtual ~FillScanner() @@ -70,10 +70,10 @@ class ObShowProcesslist : public common::ObVirtualTableScannerIterator { share::schema::ObSchemaGetterGuard* schema_guard); inline void reset(); - public: + public: bool has_process_privilege(); - private: + private: ObIAllocator* allocator_; common::ObScanner* scanner_; common::ObNewRow* cur_row_; diff --git a/src/observer/virtual_table/ob_show_tenant_status.h b/src/observer/virtual_table/ob_show_tenant_status.h index 91b5268a0..d82493f0e 100644 --- a/src/observer/virtual_table/ob_show_tenant_status.h +++ b/src/observer/virtual_table/ob_show_tenant_status.h @@ -29,7 +29,7 @@ class ObTenantSchema; namespace observer { class ObShowTenantStatus : public common::ObVirtualTableScannerIterator { - public: +public: ObShowTenantStatus(); virtual ~ObShowTenantStatus(); @@ -45,10 +45,10 @@ class ObShowTenantStatus : public common::ObVirtualTableScannerIterator { const share::schema::ObSysVariableSchema& sys_variable_schema, common::ObObj* cells, const int64_t col_count); int add_all_tenant_status(); - private: +private: uint64_t tenant_id_; - private: +private: enum TENANT_STATUS_COLUMN { TENANT_NAME = common::OB_APP_MIN_COLUMN_ID, HOST, diff --git a/src/observer/virtual_table/ob_table_columns.h b/src/observer/virtual_table/ob_table_columns.h index c32b8e833..5e96a7deb 100644 --- a/src/observer/virtual_table/ob_table_columns.h +++ b/src/observer/virtual_table/ob_table_columns.h @@ -33,7 +33,7 @@ class ObRawExpr; } // namespace sql namespace observer { class ObTableColumns : public common::ObVirtualTableScannerIterator { - public: +public: ObTableColumns(); virtual ~ObTableColumns(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -42,7 +42,7 @@ class ObTableColumns : public common::ObVirtualTableScannerIterator { share::schema::ObSchemaGetterGuard* guard, const share::schema::ObTableSchema& table_schema, sql::ObSelectStmt*& select_stmt, sql::ObRawExprFactory& expr_factory, sql::ObStmtFactory& stmt_factory); - private: +private: enum KeyType { KEY_TYPE_EMPTY = 0, KEY_TYPE_PRIMARY = 1, @@ -83,7 +83,7 @@ class ObTableColumns : public common::ObVirtualTableScannerIterator { int get_type_str(const ObObjMeta& obj_meta, const ObAccuracy& accuracy, const common::ObIArray& type_info, const int16_t default_length_semantics, ObString& type_val); - private: +private: char type_str_[common::OB_MAX_SYS_PARAM_NAME_LENGTH]; char* column_type_str_; int64_t column_type_str_len_; diff --git a/src/observer/virtual_table/ob_table_index.h b/src/observer/virtual_table/ob_table_index.h index f0f3e3eb9..3e51dffc5 100644 --- a/src/observer/virtual_table/ob_table_index.h +++ b/src/observer/virtual_table/ob_table_index.h @@ -29,7 +29,7 @@ class ObDatabaseSchema; } // namespace share namespace observer { class ObTableIndex : public common::ObVirtualTableScannerIterator { - public: +public: ObTableIndex(); virtual ~ObTableIndex(); virtual int inner_open(); @@ -40,7 +40,7 @@ class ObTableIndex : public common::ObVirtualTableScannerIterator { tenant_id_ = tenant_id; } - private: +private: int add_table_indexes(const share::schema::ObTableSchema& table_schema, const common::ObString& database_name, common::ObObj* cells, int64_t col_count, bool& is_end); int add_database_indexes( @@ -58,7 +58,7 @@ class ObTableIndex : public common::ObVirtualTableScannerIterator { int get_show_column_name(const share::schema::ObTableSchema& table_schema, const share::schema::ObColumnSchemaV2& column_schema, common::ObString& column_name); - private: +private: uint64_t tenant_id_; uint64_t show_table_id_; common::ObSArray database_schemas_; diff --git a/src/observer/virtual_table/ob_tenant_all_tables.h b/src/observer/virtual_table/ob_tenant_all_tables.h index f11f83d64..7bcb2b8e0 100644 --- a/src/observer/virtual_table/ob_tenant_all_tables.h +++ b/src/observer/virtual_table/ob_tenant_all_tables.h @@ -59,7 +59,7 @@ class ObTenantAllTables : public common::ObVirtualTableIterator { COMMENT = OB_APP_MIN_COLUMN_ID + 19 }; class TableStatistics { - public: + public: TableStatistics() : row_count_(0), data_size_(0), data_version_(0), data_checksum_(0), create_time_(0), update_time_(0) {} @@ -82,7 +82,7 @@ class ObTenantAllTables : public common::ObVirtualTableIterator { int64_t update_time_; }; - public: +public: ObTenantAllTables(); virtual ~ObTenantAllTables(); virtual int inner_open(); @@ -97,7 +97,7 @@ class ObTenantAllTables : public common::ObVirtualTableIterator { sql_proxy_ = sql_proxy; } - private: +private: int inner_get_next_row(); int get_tables_stat(); int get_sequence_value(); @@ -108,7 +108,7 @@ class ObTenantAllTables : public common::ObVirtualTableIterator { int fill_user_table_statistics( const common::ObIArray& table_ids, const char* meta_table_name, uint64_t sql_tenant_id); - private: +private: common::ObMySQLProxy* sql_proxy_; uint64_t tenant_id_; uint64_t database_id_; diff --git a/src/observer/virtual_table/ob_tenant_partition_stat.h b/src/observer/virtual_table/ob_tenant_partition_stat.h index f005fa6b5..915c92c4e 100644 --- a/src/observer/virtual_table/ob_tenant_partition_stat.h +++ b/src/observer/virtual_table/ob_tenant_partition_stat.h @@ -26,7 +26,7 @@ class ObMultiVersionSchemaService; } // namespace share namespace observer { class ObTenantPartitionStat : public common::ObVirtualTableProjector { - public: +public: ObTenantPartitionStat(); virtual ~ObTenantPartitionStat(); @@ -35,7 +35,7 @@ class ObTenantPartitionStat : public common::ObVirtualTableProjector { virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: struct PartitionStat { PartitionStat(); void reset(); @@ -68,7 +68,7 @@ class ObTenantPartitionStat : public common::ObVirtualTableProjector { share::ObPartitionInfo prefetch_info_; bool tenant_end_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantPartitionStat); }; diff --git a/src/observer/virtual_table/ob_tenant_show_tables.h b/src/observer/virtual_table/ob_tenant_show_tables.h index c8c1237c0..353378c29 100644 --- a/src/observer/virtual_table/ob_tenant_show_tables.h +++ b/src/observer/virtual_table/ob_tenant_show_tables.h @@ -38,7 +38,7 @@ class ObTenantShowTables : public common::ObVirtualTableIterator { TABLE_TYPE = OB_APP_MIN_COLUMN_ID + 2, }; - public: +public: ObTenantShowTables(); virtual ~ObTenantShowTables(); virtual int inner_open(); @@ -49,10 +49,10 @@ class ObTenantShowTables : public common::ObVirtualTableIterator { tenant_id_ = tenant_id; } - private: +private: int inner_get_next_row(); - private: +private: uint64_t tenant_id_; uint64_t database_id_; common::ObSEArray table_schemas_; diff --git a/src/observer/virtual_table/ob_tenant_virtual_charset.h b/src/observer/virtual_table/ob_tenant_virtual_charset.h index 9012e24c7..72ce8e0ef 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_charset.h +++ b/src/observer/virtual_table/ob_tenant_virtual_charset.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace observer { class ObTenantVirtualCharset : public common::ObVirtualTableScannerIterator { - public: +public: ObTenantVirtualCharset() {} ~ObTenantVirtualCharset() @@ -29,7 +29,7 @@ class ObTenantVirtualCharset : public common::ObVirtualTableScannerIterator { } virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: ObTenantVirtualCharset(const ObTenantVirtualCharset& other) = delete; ObTenantVirtualCharset& operator=(const ObTenantVirtualCharset& other) = delete; enum CHARSET_COLUMN { CHARSET = common::OB_APP_MIN_COLUMN_ID, DESCRIPTION, DEFAULT_COLLATION, MAX_LENGTH }; diff --git a/src/observer/virtual_table/ob_tenant_virtual_collation.h b/src/observer/virtual_table/ob_tenant_virtual_collation.h index a3b4386c2..42df1da1e 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_collation.h +++ b/src/observer/virtual_table/ob_tenant_virtual_collation.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace observer { class ObTenantVirtualCollation : public common::ObVirtualTableScannerIterator { - public: +public: ObTenantVirtualCollation() {} ~ObTenantVirtualCollation() @@ -29,7 +29,7 @@ class ObTenantVirtualCollation : public common::ObVirtualTableScannerIterator { } virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: ObTenantVirtualCollation(const ObTenantVirtualCollation& other) = delete; ObTenantVirtualCollation& operator=(const ObTenantVirtualCollation& other) = delete; enum COLLATION_COLUMN { COLLATION = common::OB_APP_MIN_COLUMN_ID, CHARSET, ID, IS_DEFAULT, IS_COMPILED, SORTLEN }; diff --git a/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.h b/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.h index ceca23552..49a3c1a4e 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.h +++ b/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.h @@ -48,7 +48,7 @@ class ObTenantVirtualConcurrentLimitSql : public ObTenantVirtualOutlineBase { LIMIT_TARGET = OB_APP_MIN_COLUMN_ID + 9, }; - public: +public: ObTenantVirtualConcurrentLimitSql() : ObTenantVirtualOutlineBase(), param_idx_(common::OB_INVALID_INDEX) {} ~ObTenantVirtualConcurrentLimitSql() @@ -57,12 +57,12 @@ class ObTenantVirtualConcurrentLimitSql : public ObTenantVirtualOutlineBase { virtual int inner_open(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int fill_cells(const share::schema::ObOutlineInfo* outline_info, const share::schema::ObMaxConcurrentParam* param); int get_next_concurrent_limit_row(const share::schema::ObOutlineInfo* outline_info, bool& is_iter_end); int is_need_output(const share::schema::ObOutlineInfo* outline_info, bool& is_output); - private: +private: int64_t param_idx_; DISALLOW_COPY_AND_ASSIGN(ObTenantVirtualConcurrentLimitSql); }; diff --git a/src/observer/virtual_table/ob_tenant_virtual_current_tenant.h b/src/observer/virtual_table/ob_tenant_virtual_current_tenant.h index 1b363762f..1dca05865 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_current_tenant.h +++ b/src/observer/virtual_table/ob_tenant_virtual_current_tenant.h @@ -24,7 +24,7 @@ class ObNewRow; } // namespace common namespace observer { class ObTenantVirtualCurrentTenant : public common::ObVirtualTableScannerIterator { - public: +public: ObTenantVirtualCurrentTenant(); virtual ~ObTenantVirtualCurrentTenant(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -34,7 +34,7 @@ class ObTenantVirtualCurrentTenant : public common::ObVirtualTableScannerIterato sql_proxy_ = sql_proxy; } - private: +private: common::ObMySQLProxy* sql_proxy_; DISALLOW_COPY_AND_ASSIGN(ObTenantVirtualCurrentTenant); }; diff --git a/src/observer/virtual_table/ob_tenant_virtual_event_name.h b/src/observer/virtual_table/ob_tenant_virtual_event_name.h index 52a5c9a86..52591ec3d 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_event_name.h +++ b/src/observer/virtual_table/ob_tenant_virtual_event_name.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace observer { class ObTenantVirtualEventName : public common::ObVirtualTableScannerIterator { - public: +public: ObTenantVirtualEventName(); virtual ~ObTenantVirtualEventName(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -30,7 +30,7 @@ class ObTenantVirtualEventName : public common::ObVirtualTableScannerIterator { } virtual void reset(); - private: +private: enum SYS_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, EVENT_ID, diff --git a/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.h b/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.h index fb5e0232a..88ddf041b 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.h +++ b/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.h @@ -41,13 +41,13 @@ class ObGetObjectDefinition : public common::ObVirtualTableScannerIterator { }; static const char* ObjectTypeName[T_GET_DDL_MAX]; - public: +public: ObGetObjectDefinition(); virtual ~ObGetObjectDefinition(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: int get_object_type_and_name(GetDDLObjectType& object_type, ObString& object_name, ObString& ob_schema, ObString& version, ObString& model, ObString& transform); int get_ddl_creation_str( @@ -72,7 +72,7 @@ class ObGetObjectDefinition : public common::ObVirtualTableScannerIterator { int get_user_definition( ObString& ddl_str, const ObString& user_name, const ObString& db_name, GetDDLObjectType object_type); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGetObjectDefinition); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_tenant_virtual_outline.h b/src/observer/virtual_table/ob_tenant_virtual_outline.h index acf3f436f..cf05d35d4 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_outline.h +++ b/src/observer/virtual_table/ob_tenant_virtual_outline.h @@ -36,13 +36,13 @@ class ObOutlineInfo; namespace observer { class ObTenantVirtualOutlineBase : public common::ObVirtualTableIterator { - protected: +protected: struct DBInfo { common::ObString db_name_; bool is_recycle_; }; - public: +public: ObTenantVirtualOutlineBase() : tenant_id_(common::OB_INVALID_TENANT_ID), outline_info_idx_(common::OB_INVALID_INDEX), @@ -58,17 +58,17 @@ class ObTenantVirtualOutlineBase : public common::ObVirtualTableIterator { tenant_id_ = tenant_id; } - protected: +protected: int is_database_recycle(uint64_t database_id, bool& is_recycle); int set_database_infos_and_get_value(uint64_t database_id, bool& is_recycle); - protected: +protected: uint64_t tenant_id_; int64_t outline_info_idx_; common::ObSEArray outline_infos_; common::hash::ObHashMap database_infos_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantVirtualOutlineBase); }; @@ -85,7 +85,7 @@ class ObTenantVirtualOutline : public ObTenantVirtualOutlineBase { OUTLINE_SQL = OB_APP_MIN_COLUMN_ID + 8, }; - public: +public: ObTenantVirtualOutline() : ObTenantVirtualOutlineBase() {} ~ObTenantVirtualOutline() @@ -93,11 +93,11 @@ class ObTenantVirtualOutline : public ObTenantVirtualOutlineBase { void reset(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int fill_cells(const share::schema::ObOutlineInfo* outline_info); int is_output_outline(const share::schema::ObOutlineInfo* outline_info, bool& is_output); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantVirtualOutline); }; } // namespace observer diff --git a/src/observer/virtual_table/ob_tenant_virtual_statname.h b/src/observer/virtual_table/ob_tenant_virtual_statname.h index db34eb646..8a7362b12 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_statname.h +++ b/src/observer/virtual_table/ob_tenant_virtual_statname.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace observer { class ObTenantVirtualStatname : public common::ObVirtualTableScannerIterator { - public: +public: ObTenantVirtualStatname(); virtual ~ObTenantVirtualStatname(); virtual int inner_get_next_row(common::ObNewRow*& row); @@ -30,7 +30,7 @@ class ObTenantVirtualStatname : public common::ObVirtualTableScannerIterator { } virtual void reset(); - private: +private: enum SYS_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, STAT_ID, STATISTIC_NO, NAME, DISPLAY_NAME, CLASS }; int32_t stat_iter_; uint64_t tenant_id_; diff --git a/src/observer/virtual_table/ob_tenant_virtual_warning.h b/src/observer/virtual_table/ob_tenant_virtual_warning.h index 041da3a51..71069ddac 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_warning.h +++ b/src/observer/virtual_table/ob_tenant_virtual_warning.h @@ -22,16 +22,16 @@ class ObSQLSessionInfo; } namespace observer { class ObTenantVirtualWarning : public common::ObVirtualTableScannerIterator { - public: +public: ObTenantVirtualWarning(); virtual ~ObTenantVirtualWarning(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: int fill_scanner(); - private: +private: static const char* const SHOW_WARNING_STR; static const char* const SHOW_NOTE_STR; static const char* const SHOW_ERROR_STR; diff --git a/src/observer/virtual_table/ob_virtual_data_access_service.h b/src/observer/virtual_table/ob_virtual_data_access_service.h index 799ba884f..3e6b80bc4 100644 --- a/src/observer/virtual_table/ob_virtual_data_access_service.h +++ b/src/observer/virtual_table/ob_virtual_data_access_service.h @@ -28,7 +28,7 @@ class ObRootService; } namespace observer { class ObVirtualDataAccessService : public common::ObIDataAccessService { - public: +public: ObVirtualDataAccessService( rootserver::ObRootService& root_service, common::ObAddr& addr, common::ObServerConfig* config) : vt_iter_factory_(root_service, addr, config) @@ -51,7 +51,7 @@ class ObVirtualDataAccessService : public common::ObIDataAccessService { return vt_iter_factory_; } - private: +private: ObVirtualTableIteratorFactory vt_iter_factory_; DISALLOW_COPY_AND_ASSIGN(ObVirtualDataAccessService); }; diff --git a/src/observer/virtual_table/ob_virtual_obrpc_send_stat.h b/src/observer/virtual_table/ob_virtual_obrpc_send_stat.h index c51fba1d2..c9c4f334e 100644 --- a/src/observer/virtual_table/ob_virtual_obrpc_send_stat.h +++ b/src/observer/virtual_table/ob_virtual_obrpc_send_stat.h @@ -19,13 +19,13 @@ namespace oceanbase { namespace observer { class ObVirtualObRpcSendStat : public common::ObVirtualTableIterator { - public: +public: ObVirtualObRpcSendStat(); virtual ~ObVirtualObRpcSendStat(); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: enum CACHE_COLUMN { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_virtual_open_cursor_table.h b/src/observer/virtual_table/ob_virtual_open_cursor_table.h index f9b7a6dd4..9ccd5eaea 100644 --- a/src/observer/virtual_table/ob_virtual_open_cursor_table.h +++ b/src/observer/virtual_table/ob_virtual_open_cursor_table.h @@ -40,19 +40,19 @@ class ObCacheObjectFactory; namespace observer { class ObSessionOpenCursor { - public: +public: explicit ObSessionOpenCursor() {} virtual ~ObSessionOpenCursor() {} bool operator()(sql::ObSQLSessionMgr::Key key, sql::ObSQLSessionInfo* sess_info); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSessionOpenCursor); }; class ObVirtualOpenCursorTable : public common::ObVirtualTableScannerIterator { - public: +public: struct SessionInfo { uint32_t version; // session version uint32_t id; // session id @@ -68,7 +68,7 @@ class ObVirtualOpenCursorTable : public common::ObVirtualTableScannerIterator { typedef common::ObSEArray SessionInfoArray; typedef common::hash::ObHashMap SidMap; class ObEachSessionId { - public: + public: explicit ObEachSessionId(ObIAllocator* alloc) : is_success_(false), allocator_(alloc) {} virtual ~ObEachSessionId() @@ -81,7 +81,7 @@ class ObVirtualOpenCursorTable : public common::ObVirtualTableScannerIterator { return sids_map_; } - private: + private: SidMap sids_map_; bool is_success_; ObIAllocator* allocator_; @@ -107,11 +107,11 @@ class ObVirtualOpenCursorTable : public common::ObVirtualTableScannerIterator { } int set_addr(const common::ObAddr& addr); - protected: +protected: int fill_cells(ObNewRow*& row, bool& is_filled); int fill_cells_impl(const SessionInfo& sess_info, const sql::ObPhysicalPlan* plan); - private: +private: enum { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -127,7 +127,7 @@ class ObVirtualOpenCursorTable : public common::ObVirtualTableScannerIterator { SQL_EXEC_ID, }; - private: +private: sql::ObSQLSessionMgr* sess_mgr_; sql::ObPlanCacheManager* pcm_; common::ObSEArray plan_id_array_; diff --git a/src/observer/virtual_table/ob_virtual_proxy_server_stat.h b/src/observer/virtual_table/ob_virtual_proxy_server_stat.h index 5e07e5ac7..eef8db141 100644 --- a/src/observer/virtual_table/ob_virtual_proxy_server_stat.h +++ b/src/observer/virtual_table/ob_virtual_proxy_server_stat.h @@ -29,7 +29,7 @@ class ObServerConfig; } // namespace common namespace observer { class ObVirtualProxyServerStat : public common::ObVirtualTableProjector { - public: +public: ObVirtualProxyServerStat(); virtual ~ObVirtualProxyServerStat(); @@ -38,7 +38,7 @@ class ObVirtualProxyServerStat : public common::ObVirtualTableProjector { virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: struct ObServerStateInfo { ObServerStateInfo(); ~ObServerStateInfo() diff --git a/src/observer/virtual_table/ob_virtual_proxy_sys_variable.h b/src/observer/virtual_table/ob_virtual_proxy_sys_variable.h index 44aa4668c..0db5141db 100644 --- a/src/observer/virtual_table/ob_virtual_proxy_sys_variable.h +++ b/src/observer/virtual_table/ob_virtual_proxy_sys_variable.h @@ -30,7 +30,7 @@ class ObServerConfig; } // namespace common namespace observer { class ObVirtualProxySysVariable : public common::ObVirtualTableProjector { - public: +public: ObVirtualProxySysVariable(); virtual ~ObVirtualProxySysVariable(); @@ -38,7 +38,7 @@ class ObVirtualProxySysVariable : public common::ObVirtualTableProjector { virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: struct ObVarStateInfo { ObVarStateInfo(); ~ObVarStateInfo() diff --git a/src/observer/virtual_table/ob_virtual_sql_monitor.h b/src/observer/virtual_table/ob_virtual_sql_monitor.h index 267e10354..9d3c61e17 100644 --- a/src/observer/virtual_table/ob_virtual_sql_monitor.h +++ b/src/observer/virtual_table/ob_virtual_sql_monitor.h @@ -30,7 +30,7 @@ class ObPhyPlanMonitorInfo; } // namespace sql namespace observer { class ObVirtualSqlMonitor : public common::ObVirtualTableProjector { - public: +public: ObVirtualSqlMonitor(); virtual ~ObVirtualSqlMonitor(); int inner_open(); @@ -42,7 +42,7 @@ class ObVirtualSqlMonitor : public common::ObVirtualTableProjector { tenant_id_ = tenant_id; } - private: +private: enum COLUMN_ID { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, @@ -62,7 +62,7 @@ class ObVirtualSqlMonitor : public common::ObVirtualTableProjector { int get_next_monitor_info(); static const int64_t OB_MAX_INFO_LENGTH = 1024; - private: +private: sql::ObMonitorInfoManager* monitor_manager_; int64_t start_id_; int64_t end_id_; diff --git a/src/observer/virtual_table/ob_virtual_sql_monitor_statname.h b/src/observer/virtual_table/ob_virtual_sql_monitor_statname.h index 9790bffb1..770360467 100644 --- a/src/observer/virtual_table/ob_virtual_sql_monitor_statname.h +++ b/src/observer/virtual_table/ob_virtual_sql_monitor_statname.h @@ -19,13 +19,13 @@ namespace oceanbase { namespace observer { class ObVirtualSqlMonitorStatname : public common::ObVirtualTableScannerIterator { - public: +public: ObVirtualSqlMonitorStatname(); virtual ~ObVirtualSqlMonitorStatname(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: enum SYS_COLUMN { ID = common::OB_APP_MIN_COLUMN_ID, GROUP_ID, diff --git a/src/observer/virtual_table/ob_virtual_sql_plan_monitor.h b/src/observer/virtual_table/ob_virtual_sql_plan_monitor.h index a82c53603..674085202 100644 --- a/src/observer/virtual_table/ob_virtual_sql_plan_monitor.h +++ b/src/observer/virtual_table/ob_virtual_sql_plan_monitor.h @@ -30,7 +30,7 @@ class ObTenantSpaceFetcher; namespace observer { class ObVirtualSqlPlanMonitor : public common::ObVirtualTableScannerIterator { - public: +public: ObVirtualSqlPlanMonitor(); virtual ~ObVirtualSqlPlanMonitor(); virtual int inner_open() override; @@ -51,12 +51,12 @@ class ObVirtualSqlPlanMonitor : public common::ObVirtualTableScannerIterator { return is_use_index_; } - private: +private: int convert_node_to_row(sql::ObMonitorNode& node, ObNewRow*& row); int extract_tenant_ids(); int extract_request_ids(const uint64_t tenant_id, int64_t& start_id, int64_t& end_id, bool& is_valid); - private: +private: enum COLUMN_ID { SVR_IP = common::OB_APP_MIN_COLUMN_ID, SVR_PORT, diff --git a/src/observer/virtual_table/ob_virtual_sql_plan_statistics.h b/src/observer/virtual_table/ob_virtual_sql_plan_statistics.h index f687cdfb3..721f83a28 100644 --- a/src/observer/virtual_table/ob_virtual_sql_plan_statistics.h +++ b/src/observer/virtual_table/ob_virtual_sql_plan_statistics.h @@ -23,7 +23,7 @@ class ObPlanCacheManager; } namespace observer { class ObVirtualSqlPlanStatistics : public common::ObVirtualTableScannerIterator { - public: +public: ObVirtualSqlPlanStatistics(); virtual ~ObVirtualSqlPlanStatistics(); int inner_open(); @@ -38,12 +38,12 @@ class ObVirtualSqlPlanStatistics : public common::ObVirtualTableScannerIterator tenant_id_ = tenant_id; } - private: +private: int get_all_tenant_id(); int get_row_from_specified_tenant(uint64_t tenant_id, bool& is_end); int fill_cells(const sql::ObOperatorStat& pstat); - private: +private: enum COLUMN_ID { TENANT_ID = common::OB_APP_MIN_COLUMN_ID, SVR_IP, diff --git a/src/observer/virtual_table/ob_virtual_table_iterator_factory.h b/src/observer/virtual_table/ob_virtual_table_iterator_factory.h index cd56f299d..9dafe19c6 100644 --- a/src/observer/virtual_table/ob_virtual_table_iterator_factory.h +++ b/src/observer/virtual_table/ob_virtual_table_iterator_factory.h @@ -36,7 +36,7 @@ class ObRootService; } namespace observer { class ObVTIterCreator { - public: +public: ObVTIterCreator(rootserver::ObRootService& root_service, common::ObAddr& addr, common::ObServerConfig* config = NULL) : root_service_(root_service), addr_(addr), config_(config) {} @@ -50,17 +50,17 @@ class ObVTIterCreator { return root_service_; } - private: +private: int check_is_index(const share::schema::ObTableSchema& table, const char* index_name, bool& is_index) const; - private: +private: rootserver::ObRootService& root_service_; common::ObAddr& addr_; common::ObServerConfig* config_; }; class ObVirtualTableIteratorFactory : public sql::ObIVirtualTableIteratorFactory { - public: +public: explicit ObVirtualTableIteratorFactory(ObVTIterCreator& vt_iter_creator); ObVirtualTableIteratorFactory( rootserver::ObRootService& root_service, common::ObAddr& addr, common::ObServerConfig* config = NULL); @@ -73,7 +73,7 @@ class ObVirtualTableIteratorFactory : public sql::ObIVirtualTableIteratorFactory return vt_iter_creator_; } - private: +private: ObVTIterCreator vt_iter_creator_; DISALLOW_COPY_AND_ASSIGN(ObVirtualTableIteratorFactory); }; diff --git a/src/observer/virtual_table/ob_virtual_trace_log.h b/src/observer/virtual_table/ob_virtual_trace_log.h index 93f980669..b0c4922e3 100644 --- a/src/observer/virtual_table/ob_virtual_trace_log.h +++ b/src/observer/virtual_table/ob_virtual_trace_log.h @@ -22,13 +22,13 @@ class ObSQLSessionInfo; } namespace observer { class ObVirtualTraceLog : public common::ObVirtualTableScannerIterator { - public: +public: ObVirtualTraceLog(); virtual ~ObVirtualTraceLog(); virtual int inner_get_next_row(common::ObNewRow*& row); virtual void reset(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVirtualTraceLog); enum TRACE_COLUMN { TITLE = common::OB_APP_MIN_COLUMN_ID, KEY_VALUE, TIME }; int fill_scanner(); diff --git a/src/rootserver/backup/ob_backup_auto_delete_expired_backup.h b/src/rootserver/backup/ob_backup_auto_delete_expired_backup.h index 0a4b2f759..122f573dd 100644 --- a/src/rootserver/backup/ob_backup_auto_delete_expired_backup.h +++ b/src/rootserver/backup/ob_backup_auto_delete_expired_backup.h @@ -41,14 +41,14 @@ class ObSchemaGetterGuard; namespace rootserver { class OBackupAutoDeleteExpiredIdling : public ObThreadIdling { - public: +public: explicit OBackupAutoDeleteExpiredIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual int64_t get_idle_interval_us(); }; class ObBackupAutoDeleteExpiredData : public ObRsReentrantThread, public ObIBackupScheduler { - public: +public: ObBackupAutoDeleteExpiredData(); virtual ~ObBackupAutoDeleteExpiredData(); int init(common::ObServerConfig& cfg, ObMySQLProxy& sql_proxy, @@ -69,13 +69,13 @@ class ObBackupAutoDeleteExpiredData : public ObRsReentrantThread, public ObIBack int start(); ; - private: +private: int check_can_auto_delete( const bool auto_delete_expired_backup, const int64_t backup_recovery_window, bool& can_delete); int get_last_succeed_delete_expired_snapshot(int64_t& last_succ_delete_expired_snapshot); int schedule_auto_delete_expired_data(const int64_t backup_recovery_window); - private: +private: bool is_inited_; common::ObServerConfig* config_; common::ObMySQLProxy* sql_proxy_; @@ -85,7 +85,7 @@ class ObBackupAutoDeleteExpiredData : public ObRsReentrantThread, public ObIBack bool is_working_; share::ObIBackupLeaseService* backup_lease_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupAutoDeleteExpiredData); }; diff --git a/src/rootserver/backup/ob_backup_backupset.h b/src/rootserver/backup/ob_backup_backupset.h index 1b685614e..6f36a2b0e 100644 --- a/src/rootserver/backup/ob_backup_backupset.h +++ b/src/rootserver/backup/ob_backup_backupset.h @@ -35,32 +35,32 @@ class ObRootBalancer; class ObRebalanceTaskMgr; class ObBackupBackupsetIdling final : public ObThreadIdling { - public: +public: explicit ObBackupBackupsetIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual int64_t get_idle_interval_us() override; }; class ObBackupBackupsetLoadBalancer final { - public: +public: ObBackupBackupsetLoadBalancer(); virtual ~ObBackupBackupsetLoadBalancer(); int init(ObZoneManager& zone_mgr, ObServerManager& server_mgr); int get_next_server(common::ObAddr& server); - private: +private: int get_all_server_in_region(const common::ObRegion& region, common::ObIArray& server_list); int get_zone_list(const common::ObRegion& region, common::ObIArray& zone_list); int choose_server(const common::ObIArray& server_list, common::ObAddr& server); - private: +private: bool is_inited_; ObRandom random_; ObZoneManager* zone_mgr_; ObServerManager* server_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupBackupsetLoadBalancer); }; @@ -69,7 +69,7 @@ class ObBackupBackupset final : public ObRsReentrantThread { friend class ObTenantBackupBackupset; typedef ObArray::const_iterator BackupArrayIter; - public: +public: ObBackupBackupset(); virtual ~ObBackupBackupset(); int init(ObMySQLProxy& sql_proxy, ObZoneManager& zone_mgr, ObServerManager& server_mgr, ObRootBalancer& root_balancer, @@ -85,7 +85,7 @@ class ObBackupBackupset final : public ObRsReentrantThread { BLOCKING_RUN_IMPLEMENT(); } - private: +private: int check_can_do_work(); int do_work(const common::ObIArray& job_ids); int get_all_jobs(common::ObIArray& job_ids); @@ -121,14 +121,14 @@ class ObBackupBackupset final : public ObRsReentrantThread { int do_extern_cluster_backup_info(const share::ObBackupBackupsetJobInfo& job_info, const share::ObClusterBackupDest& src, const share::ObClusterBackupDest& dst); - private: +private: int do_job(const int64_t job_id); int do_schedule(const share::ObBackupBackupsetJobInfo& job_info); int do_backup(const share::ObBackupBackupsetJobInfo& job_info); int do_cancel(const share::ObBackupBackupsetJobInfo& job_info); int do_finish(const share::ObBackupBackupsetJobInfo& job_info); - private: +private: int inner_schedule_tenant_task( const share::ObBackupBackupsetJobInfo& job_info, const common::ObIArray& tenant_ids); int inner_schedule_tenant_backupset_task(const share::ObBackupBackupsetJobInfo& job_info, const uint64_t tenant_id, @@ -140,7 +140,7 @@ class ObBackupBackupset final : public ObRsReentrantThread { int get_dst_backup_dest_str(char* buf, const int64_t buf_size) const; int construct_sys_tenant_backup_backupset_info(share::ObTenantBackupBackupsetTaskInfo& info); - private: +private: struct CompareBackupTaskBackupSetId { bool operator()(const share::ObTenantBackupTaskItem& item, const int64_t backup_set_id) { @@ -161,7 +161,7 @@ class ObBackupBackupset final : public ObRsReentrantThread { } }; - private: +private: bool is_inited_; ObMySQLProxy* sql_proxy_; ObZoneManager* zone_mgr_; @@ -172,12 +172,12 @@ class ObBackupBackupset final : public ObRsReentrantThread { share::ObIBackupLeaseService* backup_lease_service_; mutable ObBackupBackupsetIdling idling_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupBackupset); }; class ObTenantBackupBackupset final { - public: +public: ObTenantBackupBackupset(); virtual ~ObTenantBackupBackupset(); int init(const uint64_t tenant_id, const int64_t job_id, const int64_t backup_set_id, ObMySQLProxy& sql_proxy, @@ -185,14 +185,14 @@ class ObTenantBackupBackupset final { ObBackupBackupset& backup_backupset, share::ObIBackupLeaseService& backup_lease_service); int do_task(); - private: +private: int do_with_status(const share::ObTenantBackupBackupsetTaskInfo& task_info); int do_generate(const share::ObTenantBackupBackupsetTaskInfo& task_info); int do_backup(const share::ObTenantBackupBackupsetTaskInfo& task_info); int do_cancel(const share::ObTenantBackupBackupsetTaskInfo& task_info); int do_finish(const share::ObTenantBackupBackupsetTaskInfo& task_info); - private: +private: int check_meta_file_complete(const share::ObTenantBackupTaskInfo& backup_info, const int64_t full_backup_set_id, const int64_t inc_backup_set_id, const common::ObIArray& pg_list, int64_t& total_partition_count, int64_t& total_macro_block_count, bool& complete); @@ -200,7 +200,7 @@ class ObTenantBackupBackupset final { const common::ObIArray& pg_key_list, int64_t& total_partition_count, int64_t& total_macro_block_count, bool& complete); - private: +private: int get_tenant_backup_task_info(const int64_t backup_set_id, share::ObTenantBackupTaskInfo& task_info); int get_backup_set_id_info( const share::ObTenantBackupTaskInfo& task_info, int64_t& full_backup_set_id, int64_t& inc_backup_set_id); @@ -212,7 +212,7 @@ class ObTenantBackupBackupset final { int check_backup_backupset_task_finished(bool& finished); int get_finished_pg_stat(share::ObPGBackupBackupsetTaskStat& pg_stat); - private: +private: int get_tenant_task_info(share::ObTenantBackupBackupsetTaskInfo& task_info); int update_tenant_task_info(const share::ObTenantBackupBackupsetTaskInfo& task_info); int transfer_backup_set_meta(const share::ObClusterBackupDest& src, const share::ObClusterBackupDest& dst, @@ -235,10 +235,10 @@ class ObTenantBackupBackupset final { int check_backup_info_exist(const common::ObIArray& extern_backup_infos, const int64_t full_backup_set_id, const int64_t inc_backup_set_id, bool& exist); - private: +private: int convert_array_to_set(const common::ObIArray& pg_key, hash::ObHashSet& pg_set); - private: +private: bool is_inited_; uint64_t tenant_id_; int64_t job_id_; @@ -254,18 +254,18 @@ class ObTenantBackupBackupset final { share::ObBaseBackupInfoStruct::BackupDest dst_backup_dest_; share::ObIBackupLeaseService* backup_lease_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantBackupBackupset); }; class ObPartitionBackupBackupset final { - public: +public: ObPartitionBackupBackupset(); virtual ~ObPartitionBackupBackupset(); int init(ObMySQLProxy& sql_proxy, ObZoneManager& zone_mgr, ObServerManager& server_mgr, ObRebalanceTaskMgr& task_mgr); int partition_backup_backupset(const uint64_t tenant_id); - private: +private: int get_one_job(int64_t& job_id); int get_smallest_unfinished_task( const int64_t job_id, const uint64_t tenant_id, const int64_t copy_id, int64_t& backup_set_id); @@ -289,7 +289,7 @@ class ObPartitionBackupBackupset final { const common::ObIArray& task_infos, common::ObIArray& new_task_infos); - private: +private: bool is_inited_; ObMySQLProxy* sql_proxy_; ObZoneManager* zone_mgr_; @@ -297,7 +297,7 @@ class ObPartitionBackupBackupset final { ObRebalanceTaskMgr* rebalance_task_mgr_; ObBackupBackupsetLoadBalancer load_balancer_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionBackupBackupset); }; diff --git a/src/rootserver/backup/ob_backup_data_mgr.h b/src/rootserver/backup/ob_backup_data_mgr.h index 31b8b53bd..0c3632e1f 100644 --- a/src/rootserver/backup/ob_backup_data_mgr.h +++ b/src/rootserver/backup/ob_backup_data_mgr.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace rootserver { class ObBackupDataMgr { - public: +public: ObBackupDataMgr(); virtual ~ObBackupDataMgr(); int init(const share::ObClusterBackupDest& backup_dest, const uint64_t tenant_id, const int64_t full_backup_set_id, @@ -32,10 +32,10 @@ class ObBackupDataMgr { int get_pg_meta_index(const ObPartitionKey& pkey, ObBackupMetaIndex& meta_index); int get_pg_meta(const ObPartitionKey& pkey, storage::ObPartitionGroupMeta& pg_meta); - private: +private: int get_clog_pkey_list(common::ObIArray& pkeys); - private: +private: bool is_inited_; storage::ObPhyRestoreMetaIndexStore meta_index_; share::ObClusterBackupDest cluster_backup_dest_; @@ -43,24 +43,24 @@ class ObBackupDataMgr { int64_t inc_backup_set_id_; uint64_t tenant_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupDataMgr); }; class ObBackupListDataMgr { - public: +public: ObBackupListDataMgr(); virtual ~ObBackupListDataMgr(); int init(const share::ObClusterBackupDest& backup_dest, const int64_t log_archive_round, const uint64_t tenant_id); int get_clog_pkey_list(common::ObIArray& pkeys); - private: +private: bool is_inited_; share::ObClusterBackupDest cluster_backup_dest_; int64_t log_archive_round_; uint64_t tenant_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupListDataMgr); }; diff --git a/src/rootserver/backup/ob_backup_lease_service.h b/src/rootserver/backup/ob_backup_lease_service.h index 51179a4bd..2e42b1cb3 100644 --- a/src/rootserver/backup/ob_backup_lease_service.h +++ b/src/rootserver/backup/ob_backup_lease_service.h @@ -21,7 +21,7 @@ namespace rootserver { class ObRsReentrantThread; class ObBackupLeaseService : public share::ObIBackupLeaseService, public lib::ThreadPool { - public: +public: ObBackupLeaseService(); virtual ~ObBackupLeaseService(); @@ -41,7 +41,7 @@ class ObBackupLeaseService : public share::ObIBackupLeaseService, public lib::Th virtual int get_lease_status(bool& is_lease_valid) override; VIRTUAL_TO_STRING_KV(K_(is_inited), K_(can_be_leader_ts), K_(expect_round), K_(lease_info)); - private: +private: int start_backup_scheduler_(); void stop_backup_scheduler_(); void wait_backup_scheduler_stop_(); @@ -57,7 +57,7 @@ class ObBackupLeaseService : public share::ObIBackupLeaseService, public lib::Th int check_sys_backup_info_(); class ObBackupLeaseIdle : public rootserver::ObThreadIdling { - public: + public: static const int64_t DEFAULT_IDLE_US = 60 * 1000 * 1000; // 60s static const int64_t FAST_IDLE_US = 1 * 1000 * 1000; // 1s explicit ObBackupLeaseIdle(volatile bool& stop) : ObThreadIdling(stop) @@ -67,7 +67,7 @@ class ObBackupLeaseService : public share::ObIBackupLeaseService, public lib::Th virtual int64_t get_idle_interval_us() override; }; - private: +private: bool is_inited_; int64_t can_be_leader_ts_; // > 0 means can do backup scheduler int64_t expect_round_; // usually, start/stop makes round+1. Or if rs epoch is changed, round will inc 1 also. diff --git a/src/rootserver/backup/ob_cancel_delete_backup_scheduler.h b/src/rootserver/backup/ob_cancel_delete_backup_scheduler.h index 333948a1d..04e565369 100644 --- a/src/rootserver/backup/ob_cancel_delete_backup_scheduler.h +++ b/src/rootserver/backup/ob_cancel_delete_backup_scheduler.h @@ -22,16 +22,16 @@ namespace oceanbase { namespace rootserver { class ObCancelDeleteBackupScheduler { - public: +public: ObCancelDeleteBackupScheduler(); virtual ~ObCancelDeleteBackupScheduler(); int init(const uint64_t tenant_id, common::ObMySQLProxy& proxy, rootserver::ObBackupDataClean* backup_data_clean); int start_schedule_cacel_delete_backup(); - private: +private: int inner_schedule_cancel_delete_backup(); - private: +private: bool is_inited_; uint64_t tenant_id_; common::ObMySQLProxy* proxy_; diff --git a/src/rootserver/backup/ob_cancel_validate_scheduler.h b/src/rootserver/backup/ob_cancel_validate_scheduler.h index 9c571a1b6..a2fac1129 100644 --- a/src/rootserver/backup/ob_cancel_validate_scheduler.h +++ b/src/rootserver/backup/ob_cancel_validate_scheduler.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace rootserver { class ObCancelValidateScheduler { - public: +public: ObCancelValidateScheduler(); virtual ~ObCancelValidateScheduler(); @@ -29,7 +29,7 @@ class ObCancelValidateScheduler { rootserver::ObRootValidate& root_validate); int start_schedule_cancel_validate(); - private: +private: bool is_inited_; uint64_t tenant_id_; int64_t job_id_; diff --git a/src/rootserver/backup/ob_partition_validate.h b/src/rootserver/backup/ob_partition_validate.h index cc331f0f3..d4e41a09c 100644 --- a/src/rootserver/backup/ob_partition_validate.h +++ b/src/rootserver/backup/ob_partition_validate.h @@ -33,33 +33,33 @@ class ObZoneManager; class TenantBalanceStat; class ObBackupValidateLoadBalancer { - public: +public: ObBackupValidateLoadBalancer() = default; virtual ~ObBackupValidateLoadBalancer() = default; int init(rootserver::ObServerManager& server_mgr, rootserver::ObZoneManager& zone_mgr); int get_next_server(common::ObAddr& server); - private: +private: int get_all_server_in_region(const common::ObRegion& region, common::ObIArray& server_list); int get_zone_list(const common::ObRegion& region, common::ObIArray& zone_list); int choose_server(const common::ObIArray& server_list, common::ObAddr& server); - private: +private: bool is_inited_; rootserver::ObServerManager* server_mgr_; rootserver::ObZoneManager* zone_mgr_; }; class ObPartitionValidate { - public: +public: ObPartitionValidate(); virtual ~ObPartitionValidate(); int init(common::ObMySQLProxy& sql_proxy, ObRebalanceTaskMgr& task_mgr, ObServerManager& server_mgr, ObZoneManager& zone_mgr); int partition_validate(const uint64_t tenant_id, int64_t& task_cnt); - private: +private: struct ObBackupSetPGTaskList { ObBackupSetPGTaskList(){}; virtual ~ObBackupSetPGTaskList(){}; @@ -101,7 +101,7 @@ class ObPartitionValidate { } }; - private: +private: int get_backup_validate_task_info(const int64_t job_id, share::ObBackupValidateTaskInfo& task_info); int get_log_archive_backup_info_(const int64_t snapshot_version, const common::ObArray& log_infos, share::ObLogArchiveBackupInfo& log_info); @@ -155,7 +155,7 @@ class ObPartitionValidate { int batch_update_pg_task_infos( const bool is_dropped_tenant, const common::ObIArray& task_info); - private: +private: bool is_inited_; common::ObMySQLProxy* sql_proxy_; rootserver::ObRootValidate* root_validate_; @@ -165,7 +165,7 @@ class ObPartitionValidate { rootserver::ObBackupValidateLoadBalancer load_balancer_; share::ObPGValidateTaskUpdater pg_task_updater_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionValidate); }; diff --git a/src/rootserver/backup/ob_root_validate.h b/src/rootserver/backup/ob_root_validate.h index 66ee6eb21..b92400355 100644 --- a/src/rootserver/backup/ob_root_validate.h +++ b/src/rootserver/backup/ob_root_validate.h @@ -43,7 +43,7 @@ class ObServerManager; class ObRebalanceTaskMgr; class ObRootValidateIdling : public ObThreadIdling { - public: +public: explicit ObRootValidateIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual int64_t get_idle_interval_us() override; @@ -52,7 +52,7 @@ class ObRootValidateIdling : public ObThreadIdling { class ObRootValidate : public ObRsReentrantThread { friend class ObTenantValidate; - public: +public: ObRootValidate(); virtual ~ObRootValidate(); int init(common::ObServerConfig& config, common::ObMySQLProxy& sql_proxy, ObRootBalancer& root_balancer, @@ -74,7 +74,7 @@ class ObRootValidate : public ObRsReentrantThread { void update_prepare_flag(const bool is_prepare); bool get_prepare_flag() const; - private: +private: int check_can_do_work(bool& can); int check_tenant_has_been_dropped(uint64_t tenant_id, bool& dropped); @@ -134,7 +134,7 @@ class ObRootValidate : public ObRsReentrantThread { int update_validate_task( const share::ObBackupValidateTaskInfo& src_info, const share::ObBackupValidateTaskInfo& dst_info); - private: +private: bool is_inited_; bool is_working_; bool is_prepare_flag_; @@ -153,12 +153,12 @@ class ObRootValidate : public ObRsReentrantThread { share::ObIBackupLeaseService* backup_lease_service_; mutable ObRootValidateIdling idling_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRootValidate); }; class ObTenantValidate { - public: +public: ObTenantValidate(); virtual ~ObTenantValidate(); @@ -167,7 +167,7 @@ class ObTenantValidate { ObServerManager& server_mgr, common::ObISQLClient& trans, obrpc::ObSrvRpcProxy& rpc_proxy, share::ObIBackupLeaseService& backup_lease_service); - public: +public: int do_scheduler(); int do_generate(const share::ObTenantValidateTaskInfo& task_info); @@ -193,7 +193,7 @@ class ObTenantValidate { const int64_t full_backup_set_id, const int64_t inc_backup_set_id, const share::ObTenantValidateTaskInfo& tenant_task_info, common::ObIArray& normal_pkeys); - private: +private: bool is_inited_; bool is_dropped_; // this tenant has been dropped int64_t job_id_; @@ -210,7 +210,7 @@ class ObTenantValidate { share::ObPGValidateTaskUpdater pg_task_updater_; share::ObIBackupLeaseService* backup_lease_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantValidate); }; diff --git a/src/rootserver/backup/ob_tenant_backup_data_clean_mgr.h b/src/rootserver/backup/ob_tenant_backup_data_clean_mgr.h index 2fdaa0b0e..af779e8a7 100644 --- a/src/rootserver/backup/ob_tenant_backup_data_clean_mgr.h +++ b/src/rootserver/backup/ob_tenant_backup_data_clean_mgr.h @@ -145,7 +145,7 @@ struct ObBackupDataCleanStatics { }; class ObBackupDataCleanUtil { - public: +public: static int get_backup_path_info(const ObBackupDest& backup_dest, const int64_t incarnation, const uint64_t tenant_id, const int64_t full_backup_set_id, const int64_t inc_backup_set_id, ObBackupBaseDataPathInfo& path_info); static int touch_backup_dir_files(const ObBackupPath& path, const char* storage_info, @@ -168,37 +168,37 @@ class ObBackupDataCleanUtil { const ObBackupPath& path, const char* storage_info, const common::ObStorageType& device_type); static int delete_tmp_files(const ObBackupPath& path, const char* storage_info); - private: +private: static int check_can_delete(const common::ObStorageType& device_type, bool& can_delete); static int check_can_touch(const common::ObStorageType& device_type, bool& can_touch); static int get_file_id(const ObString& file_name, int64_t& file_id); }; class ObTenantBackupDataCleanMgr { - public: +public: ObTenantBackupDataCleanMgr(); virtual ~ObTenantBackupDataCleanMgr(); int init(const ObBackupDataCleanTenant& clean_tenant, ObBackupDataClean* data_clean); int do_clean(); - private: +private: bool is_inited_; ObBackupDataCleanTenant clean_tenant_; ObBackupDataClean* data_clean_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantBackupDataCleanMgr); }; class ObTenantBackupBaseDataCleanTask { - public: +public: ObTenantBackupBaseDataCleanTask(); virtual ~ObTenantBackupBaseDataCleanTask(); int init(const ObBackupDataCleanTenant& clean_tenant, ObBackupDataClean* data_clean); int do_clean(); int get_clean_statics(ObBackupDataCleanStatics& clean_statics); - private: +private: int do_inner_clean( const ObSimpleBackupDataCleanTenant& simple_clean_tenant, const ObBackupDataCleanElement& clean_element); int clean_backup_data(const ObSimpleBackupDataCleanTenant& simple_clean_tenant, @@ -228,18 +228,18 @@ class ObTenantBackupBaseDataCleanTask { int try_clean_full_backup_set_dir( const uint64_t tenant_id, const ObBackupDataCleanElement& clean_element, const ObBackupSetId& backup_set_id); - private: +private: bool is_inited_; ObBackupDataCleanTenant clean_tenant_; ObBackupDataCleanStatics clean_statics_; ObBackupDataClean* data_clean_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantBackupBaseDataCleanTask); }; class ObTenantBackupClogDataCleanTask { - public: +public: ObTenantBackupClogDataCleanTask(); virtual ~ObTenantBackupClogDataCleanTask(); int init(const ObBackupDataCleanTenant& clean_tenant, ObBackupDataClean* data_clean); @@ -249,7 +249,7 @@ class ObTenantBackupClogDataCleanTask { const common::ObStorageType& device_type); int get_clean_statics(ObBackupDataCleanStatics& clean_statics); - private: +private: int do_inner_clean(const ObSimpleBackupDataCleanTenant& simple_clean_tenant, const ObBackupDataCleanElement& clean_element, const ObTenantBackupTaskInfo& clog_data_clean_point); int clean_clog_data(const ObSimpleBackupDataCleanTenant& simple_clean_tenant, @@ -273,7 +273,7 @@ class ObTenantBackupClogDataCleanTask { int try_clean_clog_data_dir(const ObClusterBackupDest& cluster_backup_dest, const uint64_t tenant_id, const int64_t log_archive_round, const char* storage_info, const common::ObStorageType& device_type); - private: +private: static const int MAX_BUCKET_NUM = 2048; bool is_inited_; ObBackupDataCleanTenant clean_tenant_; @@ -281,12 +281,12 @@ class ObTenantBackupClogDataCleanTask { ObBackupDataCleanStatics clean_statics_; ObBackupDataClean* data_clean_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantBackupClogDataCleanTask); }; class ObTableBaseDataCleanMgr { - public: +public: ObTableBaseDataCleanMgr(); virtual ~ObTableBaseDataCleanMgr(); int init(const int64_t table_id, const ObBackupDataCleanElement& clean_element, const ObBackupSetId& backup_set_id, @@ -295,11 +295,11 @@ class ObTableBaseDataCleanMgr { int do_clean(); int get_clean_statics(ObBackupDataCleanStatics& clean_statics); - private: +private: int clean_partition_backup_data(const ObBackupMetaIndex& meta_index); int try_clean_backup_table_dir(); - private: +private: bool is_inited_; int64_t table_id_; ObBackupDataCleanElement clean_element_; @@ -310,12 +310,12 @@ class ObTableBaseDataCleanMgr { ObBackupDataCleanStatics clean_statics_; ObBackupDataClean* data_clean_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableBaseDataCleanMgr); }; class ObTableClogDataCleanMgr { - public: +public: ObTableClogDataCleanMgr(); virtual ~ObTableClogDataCleanMgr(); int init(const int64_t table_id, const ObBackupDataCleanElement& clean_element, @@ -324,12 +324,12 @@ class ObTableClogDataCleanMgr { int do_clean(); int get_clean_statics(ObBackupDataCleanStatics& clean_statics); - private: +private: int clean_partition_clog_backup_data(const ObBackupMetaIndex& meta_index); int try_clean_backup_table_clog_dir(); int get_partition_meta(const ObBackupMetaIndex& meta_index, storage::ObPartitionGroupMeta& pg_meta); - private: +private: bool is_inited_; int64_t table_id_; ObBackupDataCleanElement clean_element_; @@ -339,12 +339,12 @@ class ObTableClogDataCleanMgr { ObBackupDataCleanStatics clean_statics_; ObBackupDataClean* data_clean_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableClogDataCleanMgr); }; class ObPartitionClogDataCleanMgr { - public: +public: ObPartitionClogDataCleanMgr(); virtual ~ObPartitionClogDataCleanMgr(); int init(const ObClusterBackupDest& cluster_backup_dest, const ObLogArchiveRound& log_archive_round, @@ -354,7 +354,7 @@ class ObPartitionClogDataCleanMgr { int clean_clog_backup_data(); int get_clean_statics(ObBackupDataCleanStatics& clean_statics); - private: +private: int touch_clog_data_(); int touch_clog_meta_(); int clean_clog_data_(); @@ -362,7 +362,7 @@ class ObPartitionClogDataCleanMgr { int set_need_delete_clog_dir( const ObClusterBackupDest& cluster_backup_dest, const ObLogArchiveRound& log_arcvhie_round); - private: +private: bool is_inited_; ObClusterBackupDest cluster_backup_dest_; ObLogArchiveRound log_archive_round_; @@ -375,7 +375,7 @@ class ObPartitionClogDataCleanMgr { }; class ObPartitionDataCleanMgr { - public: +public: ObPartitionDataCleanMgr(); virtual ~ObPartitionDataCleanMgr(); int init(const ObPartitionKey& pkey, const ObBackupDataCleanElement& clean_element, @@ -383,11 +383,11 @@ class ObPartitionDataCleanMgr { int do_clean(); int get_clean_statics(ObBackupDataCleanStatics& clean_statics); - private: +private: int touch_backup_data(); int clean_backup_data(); - private: +private: bool is_inited_; ObPartitionKey pkey_; ObBackupSetId backup_set_id_; @@ -396,7 +396,7 @@ class ObPartitionDataCleanMgr { ObBackupDataCleanStatics clean_statics_; ObBackupDataClean* data_clean_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionDataCleanMgr); }; diff --git a/src/rootserver/ob_all_server_checker.h b/src/rootserver/ob_all_server_checker.h index 23bc1aecd..509288fef 100644 --- a/src/rootserver/ob_all_server_checker.h +++ b/src/rootserver/ob_all_server_checker.h @@ -30,27 +30,27 @@ class ObMySQLResult; namespace rootserver { class ObServerManager; class ObAllServerChecker { - public: +public: ObAllServerChecker(); virtual ~ObAllServerChecker(); int init(ObServerManager& server_manager, const common::ObAddr& rs_addr); int check_all_server(); - private: +private: int check_status_same(const share::ObServerStatus& left, const share::ObServerStatus& right, bool& same) const; - private: +private: bool inited_; ObServerManager* server_manager_; common::ObAddr rs_addr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllServerChecker); }; class ObCheckServerTask : public common::ObAsyncTimerTask { - public: +public: ObCheckServerTask(common::ObWorkQueue& work_queue, ObAllServerChecker& checker); virtual ~ObCheckServerTask() {} @@ -63,7 +63,7 @@ class ObCheckServerTask : public common::ObAsyncTimerTask { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: +private: ObAllServerChecker& checker_; }; diff --git a/src/rootserver/ob_all_server_task.h b/src/rootserver/ob_all_server_task.h index 91cd782c4..424c1f5ce 100644 --- a/src/rootserver/ob_all_server_task.h +++ b/src/rootserver/ob_all_server_task.h @@ -30,7 +30,7 @@ namespace rootserver { class ObServerManager; class ObRebalanceTaskMgr; class ObAllServerTask : public share::ObAsyncTask { - public: +public: ObAllServerTask(ObServerManager& server_manager, ObRebalanceTaskMgr& rebalance_task_mgr, const common::ObAddr& server, bool with_rootserver); virtual ~ObAllServerTask(); @@ -39,7 +39,7 @@ class ObAllServerTask : public share::ObAsyncTask { int64_t get_deep_copy_size() const; share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: +private: ObServerManager& server_manager_; ObRebalanceTaskMgr& rebalance_task_mgr_; common::ObAddr server_; diff --git a/src/rootserver/ob_alloc_replica_strategy.h b/src/rootserver/ob_alloc_replica_strategy.h index 5353b5bc8..9547b43c6 100644 --- a/src/rootserver/ob_alloc_replica_strategy.h +++ b/src/rootserver/ob_alloc_replica_strategy.h @@ -42,21 +42,21 @@ class ObZoneManager; // this is used for replica_creator/root_balancer struct ZoneReplicaDistTask { - public: +public: enum class ReplicaNature { PAXOS = 0, NON_PAXOS, INVALID, }; - public: +public: ZoneReplicaDistTask() : replica_nature_(ReplicaNature::INVALID), zone_set_(), replica_task_set_(), multi_zone_dist_(false) {} virtual ~ZoneReplicaDistTask() {} - public: +public: int tmp_compatible_generate(const ReplicaNature replica_nature, const common::ObZone& zone, const ObReplicaType replica_type, const int64_t memstore_percent); int generate(const ReplicaNature replica_nature, const share::ObZoneReplicaAttrSet& zone_replica_attr_set, @@ -81,13 +81,13 @@ struct ZoneReplicaDistTask { return replica_task_set_; } - private: +private: int generate_paxos_replica_dist_task(const share::ObZoneReplicaAttrSet& zone_replica_attr_set, const common::ObIArray& exist_addr); int generate_non_paxos_replica_dist_task(const share::ObZoneReplicaAttrSet& zone_replica_attr_set, const common::ObIArray& exist_addr); - private: +private: ReplicaNature replica_nature_; common::ObSEArray zone_set_; share::ObReplicaAttrSet replica_task_set_; @@ -98,14 +98,14 @@ struct ZoneReplicaDistTask { // typedef common::ObArray UnitArray; // typedef common::ObSEArray ZoneUnitArray; class ObLocalityUtility { - public: +public: ObLocalityUtility(const ObZoneManager& zone_mgr, const share::schema::ZoneLocalityIArray& zloc, const common::ObIArray& zone_list); virtual ~ObLocalityUtility(); int init(bool with_paxos, bool with_readonly); void reset(); - protected: +protected: template struct AllocTask { AllocTask() : replica_type_(common::REPLICA_TYPE_MAX), memstore_percent_(100) @@ -139,10 +139,10 @@ class ObLocalityUtility { }; typedef AllocTask ZoneTask; - protected: +protected: int init_zone_task(const bool with_paxos, const bool with_readonly); - protected: +protected: const share::schema::ZoneLocalityIArray& zloc_; // By corresponding idx to record // how many replicas the current partition has allocated according to locality @@ -154,21 +154,21 @@ class ObLocalityUtility { }; class ObAllocReplicaByLocality : public ObLocalityUtility { - public: +public: ObAllocReplicaByLocality(const ObZoneManager& zone_mgr, ObZoneUnitsProvider& zone_units_provider, const share::schema::ZoneLocalityIArray& zloc, obrpc::ObCreateTableMode create_mode, const common::ObIArray& zone_list); virtual ~ObAllocReplicaByLocality(); - public: +public: void reset(); - protected: +protected: int init(bool with_paxos, bool with_readonly); int alloc_replica_in_zone(const int64_t pos, const common::ObZone& zone, const common::ObReplicaType replica_type, const int64_t memstore_percent, ObReplicaAddr& replica_addr); - protected: +protected: obrpc::ObCreateTableMode create_mode_; ObZoneUnitsProvider& zone_units_provider_; // Constraint: no two partition replicas will be allocated on the same server @@ -226,7 +226,7 @@ struct SingleReplicaSort { }; class ObCreateTableReplicaByLocality : public ObAllocReplicaByLocality { - public: +public: ObCreateTableReplicaByLocality(const ObZoneManager& zone_mgr, ObZoneUnitsProvider& zone_units_provider, const share::schema::ZoneLocalityIArray& zloc, obrpc::ObCreateTableMode create_mode, const common::ObIArray& zone_list, const int64_t seed, @@ -240,7 +240,7 @@ class ObCreateTableReplicaByLocality : public ObAllocReplicaByLocality { const bool non_partition_table, ObReplicaAddr& replica_addr); int fill_all_rest_server_with_replicas(ObPartitionAddr& paddr); - private: +private: int prepare_for_next_task(const ZoneTask& zone_task); int get_xy_index(const bool is_multiple_zone, const common::ObPartitionKey& pkey, const common::ObIArray& zone_array, int64_t& x_index, int64_t& y_index); @@ -335,14 +335,14 @@ class ObCreateTableReplicaByLocality : public ObAllocReplicaByLocality { } }; - private: +private: balancer::ObSinglePtBalanceContainer* pt_balance_container_; common::ObSEArray* high_priority_zone_array_; common::ObArray curr_part_zone_array_; common::ObArray curr_part_task_array_; int64_t curr_part_task_idx_; int64_t seed_; // table-level seed - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateTableReplicaByLocality); }; @@ -353,7 +353,7 @@ class ObCreateTableReplicaByLocality : public ObAllocReplicaByLocality { // This strategy is used to supplement copies of this logonly_task // TODO: Unprocessed region_task class ObAddSpecificReplicaByLocality : public ObAllocReplicaByLocality { - public: +public: ObAddSpecificReplicaByLocality(const ObZoneManager& zone_mgr, TenantBalanceStat& ts, ObZoneUnitsProvider& zone_units_provider, const share::schema::ZoneLocalityIArray& zloc, const common::ObIArray& zone_list); @@ -365,7 +365,7 @@ class ObAddSpecificReplicaByLocality : public ObAllocReplicaByLocality { int align_add_replica(const common::ObArray::iterator& p, ObReplicaAddr& replica_addr, const int64_t& next, bool& need_random_add_replica); - private: +private: TenantBalanceStat& ts_; common::ObArray logonly_zones_; // The zone where the logonly unit is located common::ObArray shadow_zone_tasks_local_; // logonly task located on logonly unit @@ -377,7 +377,7 @@ class ObAddSpecificReplicaByLocality : public ObAllocReplicaByLocality { }; class ObAddPaxosReplicaByLocality : public ObAllocReplicaByLocality { - public: +public: ObAddPaxosReplicaByLocality(const ObZoneManager& zone_mgr, TenantBalanceStat& ts, ObZoneUnitsProvider& zone_units_provider, ObZoneUnitsProvider& logonly_zone_units_provider, const share::schema::ZoneLocalityIArray& zloc, const common::ObIArray& zone_list); @@ -389,7 +389,7 @@ class ObAddPaxosReplicaByLocality : public ObAllocReplicaByLocality { int align_add_replica(const common::ObArray::iterator& pp, ObReplicaAddr& replica_addr, const int64_t& next, bool& need_random_add_replica); - private: +private: TenantBalanceStat& ts_; ObZoneUnitsProvider& logonly_zone_unit_provider_; @@ -397,7 +397,7 @@ class ObAddPaxosReplicaByLocality : public ObAllocReplicaByLocality { }; class ObAddReadonlyReplicaByLocality : public ObAllocReplicaByLocality { - public: +public: ObAddReadonlyReplicaByLocality(const ObZoneManager& zone_mgr, TenantBalanceStat& ts, ObZoneUnitsProvider& zone_units_provider, const share::schema::ZoneLocalityIArray& zloc, const common::ObIArray& zone_list); @@ -409,13 +409,13 @@ class ObAddReadonlyReplicaByLocality : public ObAllocReplicaByLocality { int align_add_replica(const common::ObArray::iterator& p, ObReplicaAddr& replica_addr, const int64_t& next, bool& need_random_add_replica); - private: +private: TenantBalanceStat& ts_; DISALLOW_COPY_AND_ASSIGN(ObAddReadonlyReplicaByLocality); }; struct FilterResult { - public: +public: FilterResult() : cmd_type_(ObRebalanceTaskType::MAX_TYPE), replica_(), @@ -475,7 +475,7 @@ struct FilterResult { int build_task(const Partition& partition, ObReplicaTask& task) const; TO_STRING_KV(K_(cmd_type), K_(replica), K_(zone), K_(dest_type)); - private: +private: ObRebalanceTaskType cmd_type_; Replica replica_; common::ObZone zone_; @@ -489,7 +489,7 @@ struct FilterResult { // By comparing locality and replica one by one, // what is finally returned to the user is where the replica and locality are inconsistent class ObFilterLocalityUtility : public ObLocalityUtility { - public: +public: struct ZoneReplicaInfo { common::ObZone zone_; int64_t non_readonly_replica_count_; @@ -521,7 +521,7 @@ class ObFilterLocalityUtility : public ObLocalityUtility { // Determine whether there is a task of type_transform in results; static bool has_type_transform_task(ObIArray& results); - private: +private: int inner_init(const Partition& partition); int inner_init(const share::ObPartitionInfo& partition_info); int filter_readonly_at_all(); @@ -529,10 +529,10 @@ class ObFilterLocalityUtility : public ObLocalityUtility { int delete_redundant_replica(const ObZone& zone, const int64_t delete_cnt); int choose_one_replica_to_delete(const ObZone& zone); - protected: +protected: int get_readonly_replica_count(const common::ObZone& zone, int64_t& readonly_count); - private: +private: int build_readonly_info(); int get_non_readonly_replica_count(const common::ObZone& zone, int64_t& non_readonly_replica_count); int get_unit_count(const common::ObZone& zone, int64_t& unit_count); @@ -542,10 +542,10 @@ class ObFilterLocalityUtility : public ObLocalityUtility { const common::ObReplicaType& type, const int64_t memstore_percent); int add_remove_task(const Replica& replica, bool invalid_unit = false); - public: +public: static const int64_t SAFE_REMOVE_REDUNDANCY_REPLICA_TIME = 60 * 1000 * 1000L; - protected: +protected: TenantBalanceStat* ts_; int64_t table_id_; int64_t partition_id_; @@ -560,7 +560,7 @@ class ObFilterLocalityUtility : public ObLocalityUtility { }; class ObDeleteReplicaUtility : public ObFilterLocalityUtility { - public: +public: ObDeleteReplicaUtility(const ObZoneManager& zone_mgr, TenantBalanceStat& ts, const share::schema::ZoneLocalityIArray& zloc, const common::ObIArray& zone_list); virtual ~ObDeleteReplicaUtility() @@ -572,15 +572,15 @@ class ObDeleteReplicaUtility : public ObFilterLocalityUtility { void reset(); - private: +private: int get_one_delete_task(const ObIArray& results, FilterResult& result); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDeleteReplicaUtility); }; class ObReplicaTypeTransformUtility : public ObFilterLocalityUtility { - public: +public: ObReplicaTypeTransformUtility(const ObZoneManager& zone_mgr, TenantBalanceStat& ts, const share::schema::ZoneLocalityIArray& zloc, const common::ObIArray& zone_list, const ObServerManager& server_mgr); @@ -592,7 +592,7 @@ class ObReplicaTypeTransformUtility : public ObFilterLocalityUtility { int64_t& dest_memstore_percent); static int get_one_type_transform_task(const ObIArray& results, FilterResult& result); - private: +private: int get_unit_count(const ObZone& zone, int64_t& active_unit_count, int64_t& inactive_unit_count); bool can_migrate_unit(const ObZone& zone); @@ -608,7 +608,7 @@ class ObReplicaTypeTransformUtility : public ObFilterLocalityUtility { int choose_replica_for_type_transform( const Partition& partition, const common::ObZone& zone, const ObReplicaType& dest_replica_type, Replica& replica); - private: +private: const ObServerManager* server_mgr_; }; } // namespace rootserver diff --git a/src/rootserver/ob_alter_locality_checker.h b/src/rootserver/ob_alter_locality_checker.h index 71656b964..9575d6a65 100644 --- a/src/rootserver/ob_alter_locality_checker.h +++ b/src/rootserver/ob_alter_locality_checker.h @@ -46,7 +46,7 @@ class TenantBalanceStat; struct ObCommitAlterTenantLocalityArg : public obrpc::ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCommitAlterTenantLocalityArg() : tenant_id_(common::OB_INVALID_ID) {} bool is_valid() const @@ -61,7 +61,7 @@ struct ObCommitAlterTenantLocalityArg : public obrpc::ObDDLArg { struct ObCommitAlterTablegroupLocalityArg : public obrpc::ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCommitAlterTablegroupLocalityArg() : tablegroup_id_(common::OB_INVALID_ID) {} bool is_valid() const @@ -76,7 +76,7 @@ struct ObCommitAlterTablegroupLocalityArg : public obrpc::ObDDLArg { struct ObCommitAlterTableLocalityArg : public obrpc::ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCommitAlterTableLocalityArg() : table_id_(common::OB_INVALID_ID) {} bool is_valid() const @@ -89,7 +89,7 @@ struct ObCommitAlterTableLocalityArg : public obrpc::ObDDLArg { }; class ObAlterLocalityChecker { - public: +public: explicit ObAlterLocalityChecker(volatile bool& is_stop) : is_stop_(is_stop), schema_service_(NULL), @@ -106,19 +106,19 @@ class ObAlterLocalityChecker { virtual ~ObAlterLocalityChecker() {} - public: +public: int init(share::schema::ObMultiVersionSchemaService* schema_service, rootserver::ObLeaderCoordinator* leader_coordinator, obrpc::ObCommonRpcProxy* common_rpc_proxy, share::ObPartitionTableOperator* pt_operator, rootserver::ObServerManager* server_mgr, common::ObAddr& addr, rootserver::ObZoneManager* zone_mgr, rootserver::ObUnitManager* unit_mgr); - public: +public: int check_alter_locality_finished(const uint64_t tenant_id, const balancer::HashIndexCollection& hash_index_collection, rootserver::TenantBalanceStat& tenant_stat); void notify_locality_modification(); bool has_locality_modification() const; - private: +private: int try_compensate_zone_locality( const bool compensate_readonly_all_server, common::ObIArray& zone_locality); int get_readonly_all_server_compensation_mode( @@ -157,11 +157,11 @@ class ObAlterLocalityChecker { int check_partition_quorum_match( const share::ObPartitionInfo& partition, const int64_t paxos_num, bool& locality_match); - private: +private: static const int64_t GET_SCHEMA_INTERVAL = 10 * 1000; // 10ms static const int64_t GET_SCHEMA_RETRY_LIMIT = 3; - private: +private: const volatile bool& is_stop_; share::schema::ObMultiVersionSchemaService* schema_service_; rootserver::ObLeaderCoordinator* leader_coordinator_; diff --git a/src/rootserver/ob_backup_cancel_scheduler.h b/src/rootserver/ob_backup_cancel_scheduler.h index 7111b180a..6aad23ee7 100644 --- a/src/rootserver/ob_backup_cancel_scheduler.h +++ b/src/rootserver/ob_backup_cancel_scheduler.h @@ -21,13 +21,13 @@ namespace oceanbase { namespace rootserver { class ObBackupCancelScheduler { - public: +public: ObBackupCancelScheduler(); virtual ~ObBackupCancelScheduler(); int init(const uint64_t tenant_id, common::ObMySQLProxy& proxy, rootserver::ObRootBackup* root_backup); int start_schedule_backup_cancel(); - private: +private: bool is_inited_; uint64_t tenant_id_; common::ObMySQLProxy* proxy_; diff --git a/src/rootserver/ob_backup_data_clean.h b/src/rootserver/ob_backup_data_clean.h index 1a6615cd9..b7c47d101 100644 --- a/src/rootserver/ob_backup_data_clean.h +++ b/src/rootserver/ob_backup_data_clean.h @@ -46,14 +46,14 @@ class ObSchemaGetterGuard; namespace rootserver { class ObBackupDataCleanIdling : public ObThreadIdling { - public: +public: explicit ObBackupDataCleanIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual int64_t get_idle_interval_us(); }; class ObBackupDataClean : public ObRsReentrantThread { - public: +public: ObBackupDataClean(); virtual ~ObBackupDataClean(); int init(share::schema::ObMultiVersionSchemaService& schema_service, ObMySQLProxy& sql_proxy, @@ -79,7 +79,7 @@ class ObBackupDataClean : public ObRsReentrantThread { return backup_lease_service_; } - private: +private: int get_need_clean_tenants(common::ObIArray& clean_tenants); int get_server_clean_tenants(common::ObIArray& clean_tenants); int get_extern_clean_tenants(hash::ObHashMap& clean_tenants_map); @@ -257,7 +257,7 @@ class ObBackupDataClean : public ObRsReentrantThread { void set_inner_error(const int32_t result); bool is_result_need_retry(const int32_t result); - private: +private: struct CompareLogArchiveBackupInfo { bool operator()(const share::ObLogArchiveBackupInfo& lhs, const share::ObLogArchiveBackupInfo& rhs) const { @@ -277,7 +277,7 @@ class ObBackupDataClean : public ObRsReentrantThread { } }; - private: +private: static const int64_t MAX_BUCKET_NUM = 1024; bool is_inited_; share::schema::ObMultiVersionSchemaService* schema_service_; @@ -288,7 +288,7 @@ class ObBackupDataClean : public ObRsReentrantThread { bool is_working_; share::ObIBackupLeaseService* backup_lease_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupDataClean); }; diff --git a/src/rootserver/ob_backup_data_clean_scheduler.h b/src/rootserver/ob_backup_data_clean_scheduler.h index 07ebd4f0b..38ec9375d 100644 --- a/src/rootserver/ob_backup_data_clean_scheduler.h +++ b/src/rootserver/ob_backup_data_clean_scheduler.h @@ -24,14 +24,14 @@ namespace oceanbase { namespace rootserver { class ObBackupDataCleanScheduler { - public: +public: ObBackupDataCleanScheduler(); virtual ~ObBackupDataCleanScheduler(); int init(const obrpc::ObBackupManageArg& arg, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& sql_proxy, ObBackupDataClean* data_clean); int start_schedule_backup_data_clean(); - private: +private: int prepare_backup_clean_infos(const common::ObIArray& tenant_ids); int get_backup_clean_info( const uint64_t tenant_id, common::ObISQLClient& sql_proxy, share::ObBackupCleanInfo& clean_info); @@ -51,7 +51,7 @@ class ObBackupDataCleanScheduler { // delete backup set need to know incarnation int get_backup_incarnation(const uint64_t tenant_id, const int64_t backup_set_id); - private: +private: bool is_inited_; obrpc::ObBackupManageArg arg_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/ob_balance_group_analyzer.cpp b/src/rootserver/ob_balance_group_analyzer.cpp index 53cf2f54a..ae1aeca13 100644 --- a/src/rootserver/ob_balance_group_analyzer.cpp +++ b/src/rootserver/ob_balance_group_analyzer.cpp @@ -157,7 +157,7 @@ int ShardGroupAnalyzer::build_prefix_map(uint64_t tenant_id, ShardGroupPrefixMap } class SortedShardGroupArray { - public: +public: SortedShardGroupArray(ShardGroupPrefixMap& prefix_map); int sort(); ObArray*>& array() @@ -165,7 +165,7 @@ class SortedShardGroupArray { return prefix_infos_; } - private: +private: ShardGroupPrefixMap& prefix_map_; ObArray sorted_prefix_; ObArray*> prefix_infos_; @@ -205,7 +205,7 @@ struct ShardGroupPrefixOrder { return cmp < 0; } - private: +private: uint64_t get_min_tid(ObIArray& tables) { uint64_t tid = OB_INVALID_ID; @@ -218,7 +218,7 @@ struct ShardGroupPrefixOrder { return tid; } - private: +private: int& ret_; ShardGroupPrefixMap& prefix_map_; }; diff --git a/src/rootserver/ob_balance_group_analyzer.h b/src/rootserver/ob_balance_group_analyzer.h index 3f95d1da4..4725abd30 100644 --- a/src/rootserver/ob_balance_group_analyzer.h +++ b/src/rootserver/ob_balance_group_analyzer.h @@ -41,7 +41,7 @@ class ITenantStatFinder; // Prefix_prefix_..._prefix_number_suffix class TablePrefixKey { - public: +public: TablePrefixKey() : prefix_(), suffix_(), digit_length_(0) {} @@ -60,7 +60,7 @@ class TablePrefixKey { }; class TablePrefixValue { - public: +public: uint64_t tablegroup_id_; uint64_t table_id_; const share::schema::ObTableSchema* schema_; @@ -68,7 +68,7 @@ class TablePrefixValue { }; class DistributionUtil { - public: +public: static int check_and_set(const uint64_t id, common::hash::ObHashSet& processed_tids); }; @@ -76,7 +76,7 @@ typedef common::ObArray ShardGroup; typedef common::hash::ObHashMap*> ShardGroupPrefixMap; class ShardGroupAnalyzer { - public: +public: ShardGroupAnalyzer(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator, common::hash::ObHashSet& processed_tids) : schema_guard_(schema_guard), @@ -93,7 +93,7 @@ class ShardGroupAnalyzer { // only the primary table in the table group is taken as a representative and stored in tids int next(common::ObIArray& schemas); - private: +private: int build_prefix_map(uint64_t tenant_id, ShardGroupPrefixMap& prefix_map); int build_shardgroup(ShardGroupPrefixMap& prefix_map); int build_shardgroups( @@ -103,7 +103,7 @@ class ShardGroupAnalyzer { int extract_table_name_prefix(const common::ObString& table, TablePrefixKey& prefix_info); int build_prefix_key(const share::schema::ObTableSchema& table, TablePrefixKey& prefix_key); - private: +private: share::schema::ObSchemaGetterGuard& schema_guard_; ITenantStatFinder& stat_finder_; common::ObIAllocator& allocator_; @@ -114,7 +114,7 @@ class ShardGroupAnalyzer { }; class TableGroupAnalyzer { - public: +public: TableGroupAnalyzer(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator, common::hash::ObHashSet& processed_tids) : schema_guard_(schema_guard), @@ -127,12 +127,12 @@ class TableGroupAnalyzer { int analysis(const uint64_t tenant_id); int next(const share::schema::ObPartitionSchema*& leader_schema); - private: +private: int pick_sample_table_schema(const common::ObIArray& table_schemas, const share::schema::ObSimpleTableSchemaV2*& sample_table_schema, bool& tg_processed); int check_table_already_processed(const uint64_t partition_entity_id, bool& table_processed); - private: +private: share::schema::ObSchemaGetterGuard& schema_guard_; ITenantStatFinder& stat_finder_; common::ObIAllocator& allocator_; @@ -142,7 +142,7 @@ class TableGroupAnalyzer { }; class PartitionTableAnalyzer { - public: +public: PartitionTableAnalyzer(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator, common::hash::ObHashSet& processed_tids) : schema_guard_(schema_guard), @@ -155,7 +155,7 @@ class PartitionTableAnalyzer { int analysis(const uint64_t tenant_id); int next(const share::schema::ObTableSchema*& table_schema); - private: +private: share::schema::ObSchemaGetterGuard& schema_guard_; ITenantStatFinder& stat_finder_; common::ObIAllocator& allocator_; @@ -165,7 +165,7 @@ class PartitionTableAnalyzer { }; class NonPartitionTableAnalyzer { - public: +public: NonPartitionTableAnalyzer(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator, common::hash::ObHashSet& processed_tids) : schema_guard_(schema_guard), @@ -178,10 +178,10 @@ class NonPartitionTableAnalyzer { int analysis(const uint64_t tenant_id); int next(common::ObIArray& schemas); - private: +private: typedef common::ObArray NonPartitionArray; - private: +private: share::schema::ObSchemaGetterGuard& schema_guard_; ITenantStatFinder& stat_finder_; common::ObIAllocator& allocator_; diff --git a/src/rootserver/ob_balance_group_container.h b/src/rootserver/ob_balance_group_container.h index 8009b10fd..d8402620b 100644 --- a/src/rootserver/ob_balance_group_container.h +++ b/src/rootserver/ob_balance_group_container.h @@ -48,7 +48,7 @@ class ITenantStatFinder; enum PartitionDistributePolicy { DISTRIBUTE_BY_AUTO = 0, DISTRIBUTE_BY_LEVEL_ONE, DISTRIBUTE_BY_LEVEL_TWO }; class PartitionSchemaChecker { - public: +public: static int check_same_primary_zone(const share::schema::ObPartitionSchema& ref, const share::schema::ObPartitionSchema& other, share::schema::ObSchemaGetterGuard& schema_guard, bool& same); static int check_same_primary_zone(const common::ObIArray& partition_schemas, @@ -62,7 +62,7 @@ class PartitionSchemaChecker { }; class ShardGroupValidator { - public: +public: static int check_table_schemas_compatible(ITenantStatFinder& stat_finder, share::schema::ObSchemaGetterGuard& schema_guard, const common::ObIArray& tables, bool& compatible, @@ -72,7 +72,7 @@ class ShardGroupValidator { class IBalanceGroupContainer; class IBalanceGroupContainerBuilder { - public: +public: IBalanceGroupContainerBuilder(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::hash::ObHashSet& processed_tids, int64_t& max_used_balance_group_id, common::ObIAllocator& allocator, IBalanceGroupContainer& balance_group_container) @@ -88,11 +88,11 @@ class IBalanceGroupContainerBuilder { virtual ~IBalanceGroupContainerBuilder() {} - public: +public: int init(const uint64_t tenant_id); virtual int build() = 0; - protected: +protected: bool inited_; uint64_t tenant_id_; share::schema::ObSchemaGetterGuard& schema_guard_; @@ -104,7 +104,7 @@ class IBalanceGroupContainerBuilder { }; class PartitionTableContainerBuilder : public IBalanceGroupContainerBuilder { - public: +public: PartitionTableContainerBuilder(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::hash::ObHashSet& processed_tids, int64_t& max_used_balance_group_id, common::ObIAllocator& allocator, IBalanceGroupContainer& balance_group_container) @@ -114,15 +114,15 @@ class PartitionTableContainerBuilder : public IBalanceGroupContainerBuilder { virtual ~PartitionTableContainerBuilder() {} - public: +public: int build() override; - private: +private: int build_partition_table_container(const share::schema::ObTableSchema* table_schema); }; class NonPartitionTableContainerBuilder : public IBalanceGroupContainerBuilder { - public: +public: NonPartitionTableContainerBuilder(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::hash::ObHashSet& processed_tids, int64_t& max_used_balance_group_id, common::ObIAllocator& allocator, IBalanceGroupContainer& balance_group_container) @@ -132,16 +132,16 @@ class NonPartitionTableContainerBuilder : public IBalanceGroupContainerBuilder { virtual ~NonPartitionTableContainerBuilder() {} - public: +public: int build() override; - private: +private: int build_non_partition_table_container( const common::ObIArray& partition_schemas); }; class ShardGroupContainerBuilder : public IBalanceGroupContainerBuilder { - public: +public: ShardGroupContainerBuilder(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::hash::ObHashSet& processed_tids, int64_t& max_used_balance_group_id, common::ObIAllocator& allocator, IBalanceGroupContainer& balance_group_container) @@ -151,10 +151,10 @@ class ShardGroupContainerBuilder : public IBalanceGroupContainerBuilder { virtual ~ShardGroupContainerBuilder() {} - public: +public: int build() override; - private: +private: struct SameRangePartInfo { SameRangePartInfo() : pkey_(), @@ -177,21 +177,21 @@ class ShardGroupContainerBuilder : public IBalanceGroupContainerBuilder { typedef common::ObArray SameRangeArray; typedef common::hash::ObHashMap SameRangeMap; class TableSchemaPartitionCntCmp { - public: + public: TableSchemaPartitionCntCmp(common::ObArray& shardgroup_schemas) : shardgroup_schemas_(shardgroup_schemas), ret_(common::OB_SUCCESS) {} int sort(); - public: + public: bool operator()(const share::schema::ObTableSchema* l, const share::schema::ObTableSchema* r); - private: + private: common::ObArray& shardgroup_schemas_; int ret_; }; - private: +private: int build_shardgroup_container(common::ObArray& shardgroup_table_schemas); int build_one_level_range_shard_partition_container( common::ObArray& shardgroup_table_schemas, const bool primary_zone_match, @@ -208,7 +208,7 @@ class ShardGroupContainerBuilder : public IBalanceGroupContainerBuilder { }; class TableGroupContainerBuilder : public IBalanceGroupContainerBuilder { - public: +public: TableGroupContainerBuilder(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::hash::ObHashSet& processed_tids, int64_t& max_used_balance_group_id, common::ObIAllocator& allocator, IBalanceGroupContainer& balance_group_container) @@ -218,15 +218,15 @@ class TableGroupContainerBuilder : public IBalanceGroupContainerBuilder { virtual ~TableGroupContainerBuilder() {} - public: +public: int build() override; - private: +private: int build_tablegroup_container(const share::schema::ObPartitionSchema* partition_schema); }; class SinglePtBalanceContainerBuilder { - public: +public: SinglePtBalanceContainerBuilder(BalanceGroupType balance_group_type, share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator, IBalanceGroupContainer& balance_group_container, int64_t& max_used_balance_group_id) @@ -240,10 +240,10 @@ class SinglePtBalanceContainerBuilder { virtual ~SinglePtBalanceContainerBuilder() {} - public: +public: int build(const share::schema::ObPartitionSchema& partition_schema); - private: +private: int build_one_level_partition_table_container(const share::schema::ObPartitionSchema& partition_schema); int build_two_level_partition_table_container(const share::schema::ObPartitionSchema& partition_schema); int build_two_level_partition_table_container_by_first_level( @@ -253,7 +253,7 @@ class SinglePtBalanceContainerBuilder { PartitionDistributePolicy get_partition_schema_distribute_policy( const share::schema::ObPartitionSchema& partition_schema); - private: +private: BalanceGroupType balance_group_type_; share::schema::ObSchemaGetterGuard& schema_guard_; ITenantStatFinder& stat_finder_; @@ -263,25 +263,25 @@ class SinglePtBalanceContainerBuilder { }; class IBalanceGroupContainer { - public: +public: IBalanceGroupContainer() : container_type_array_() {} virtual ~IBalanceGroupContainer() {} - public: +public: virtual int collect_balance_group_box(const common::ObIArray& balance_group_box_array) = 0; const common::ObIArray& get_container_type_array() const { return container_type_array_; } - protected: +protected: common::ObSEArray container_type_array_; }; class ObSinglePtBalanceContainer : public IBalanceGroupContainer { - public: +public: ObSinglePtBalanceContainer(const share::schema::ObPartitionSchema& partition_schema, share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : IBalanceGroupContainer(), @@ -295,7 +295,7 @@ class ObSinglePtBalanceContainer : public IBalanceGroupContainer { virtual ~ObSinglePtBalanceContainer() {} - public: +public: int init(const int64_t item_size); int build(); virtual int collect_balance_group_box(const common::ObIArray& balance_group_box_array) override; @@ -304,7 +304,7 @@ class ObSinglePtBalanceContainer : public IBalanceGroupContainer { return hash_index_collection_; } - private: +private: bool inited_; const share::schema::ObPartitionSchema& partition_schema_; share::schema::ObSchemaGetterGuard& schema_guard_; @@ -314,10 +314,10 @@ class ObSinglePtBalanceContainer : public IBalanceGroupContainer { }; class ObBalanceGroupContainer : public IBalanceGroupContainer { - public: +public: const int64_t PROCESSED_TABLE_MAP_SIZE = 100 * 1024; - public: +public: ObBalanceGroupContainer( share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : IBalanceGroupContainer(), @@ -340,7 +340,7 @@ class ObBalanceGroupContainer : public IBalanceGroupContainer { virtual ~ObBalanceGroupContainer() {} - public: +public: int init(const uint64_t tenant_id); virtual int build(); virtual int get_gts_switch(bool& on); @@ -349,7 +349,7 @@ class ObBalanceGroupContainer : public IBalanceGroupContainer { return processed_tids_; } - protected: +protected: bool inited_; uint64_t tenant_id_; int64_t max_used_balance_group_id_; @@ -364,7 +364,7 @@ class ObBalanceGroupContainer : public IBalanceGroupContainer { }; class BalanceGroupBoxBuilder { - public: +public: BalanceGroupBoxBuilder(const BalanceGroupType& balance_group_type, const common::ObIArray& container_type_array, share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) @@ -380,7 +380,7 @@ class BalanceGroupBoxBuilder { virtual ~BalanceGroupBoxBuilder() {} - public: +public: int init(const int64_t row_size, const int64_t col_size, const bool ignore_leader_balance, const common::ObZone& primary_zone); int set_item(const BalanceGroupBoxItem& item); @@ -389,12 +389,12 @@ class BalanceGroupBoxBuilder { return output_box_array_; } - private: +private: int init_square_id_map(const int64_t row_size, const int64_t col_size, const bool ignore_leader_balance, const common::ObZone& primary_zone); int init_hash_index_map(const int64_t row_size, const int64_t col_size); - protected: +protected: bool inited_; BalanceGroupType balance_group_type_; // Since the memory life cycle of hash index map is different from that of SquareIdMap, @@ -411,7 +411,7 @@ class BalanceGroupBoxBuilder { }; class ObLeaderBalanceGroupContainer : public ObBalanceGroupContainer { - public: +public: ObLeaderBalanceGroupContainer( share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : ObBalanceGroupContainer(schema_guard, stat_finder, allocator), hash_index_collection_() @@ -419,7 +419,7 @@ class ObLeaderBalanceGroupContainer : public ObBalanceGroupContainer { virtual ~ObLeaderBalanceGroupContainer() {} - public: +public: int init(const uint64_t tenant_id); virtual int collect_balance_group_box(const common::ObIArray& balance_group_box_array) override; const HashIndexCollection& get_hash_index() const @@ -427,12 +427,12 @@ class ObLeaderBalanceGroupContainer : public ObBalanceGroupContainer { return hash_index_collection_; } - private: +private: HashIndexCollection hash_index_collection_; }; class ObPartitionBalanceGroupContainer : public ObBalanceGroupContainer { - public: +public: ObPartitionBalanceGroupContainer( share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : ObBalanceGroupContainer(schema_guard, stat_finder, allocator), @@ -442,7 +442,7 @@ class ObPartitionBalanceGroupContainer : public ObBalanceGroupContainer { virtual ~ObPartitionBalanceGroupContainer() {} - public: +public: int init(const uint64_t tenant_id); virtual int collect_balance_group_box(const common::ObIArray& balance_group_box_array) override; common::ObIArray& get_square_id_map_array() @@ -455,7 +455,7 @@ class ObPartitionBalanceGroupContainer : public ObBalanceGroupContainer { } int calc_leader_balance_statistic(const common::ObZone& zone); - private: +private: HashIndexCollection hash_index_collection_; SquareIdMapCollection square_id_map_collection_; }; diff --git a/src/rootserver/ob_balance_group_data.h b/src/rootserver/ob_balance_group_data.h index 4d4d71014..5181f3ea9 100644 --- a/src/rootserver/ob_balance_group_data.h +++ b/src/rootserver/ob_balance_group_data.h @@ -107,26 +107,26 @@ struct BalanceGroupBoxItem { }; class BalanceGroupBox { - public: +public: BalanceGroupBox() {} virtual ~BalanceGroupBox() {} - public: +public: virtual BalanceGroupContainerType get_container_type() const = 0; virtual int set_item(const BalanceGroupBoxItem& item) = 0; virtual int64_t to_string(char* buf, const int64_t buf_len) const = 0; }; class BalanceGroupCollection { - public: +public: BalanceGroupCollection() {} virtual ~BalanceGroupCollection() {} - public: +public: virtual BalanceGroupContainerType get_container_type() const = 0; virtual int collect_box(const BalanceGroupBox* balance_group_box) = 0; }; @@ -214,15 +214,15 @@ struct SquareIdMapItem { template class IdMapIterator { - public: +public: typedef IdMapIterator self_t; - public: +public: typedef T* value_ptr_t; typedef T* pointer; typedef T& reference; - public: +public: IdMapIterator() : value_ptr_(NULL) {} explicit IdMapIterator(value_ptr_t value_ptr) @@ -266,7 +266,7 @@ class IdMapIterator { return (value_ptr_ != (other.value_ptr_)); } - private: +private: value_ptr_t value_ptr_; }; @@ -281,7 +281,7 @@ struct HashIndexMapItem; struct SquareIdMapItem; class SquareIdMap : public BalanceGroupBox { - public: +public: friend AverageCountBalancer; friend PartitionLeaderCountBalancer; friend BalanceStat; @@ -289,18 +289,18 @@ class SquareIdMap : public BalanceGroupBox { friend OverallBalanceStat; friend RowLeaderBalanceStat; - public: +public: typedef SquareIdMapItem Item; typedef IdMapIterator iterator; typedef IdMapIterator const_iterator; - public: +public: SquareIdMap(share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator); virtual ~SquareIdMap() {} - public: +public: int init(const int64_t row, const int64_t col); virtual BalanceGroupContainerType get_container_type() const override { @@ -388,11 +388,11 @@ class SquareIdMap : public BalanceGroupBox { TO_STRING_KV(K_(map_id), K_(ignore_leader_balance), K_(primary_zone), K_(tenant_id), K_(row_size), K_(col_size), "type", get_map_type(), K_(is_valid)); - protected: +protected: int get_all_tg_idx(uint64_t tablegroup_id, uint64_t table_id, int64_t& all_tg_idx); SquareIdMapItem* alloc_id_map_item_array(common::ObIAllocator& allocator, int64_t size); - protected: +protected: bool inited_; share::schema::ObSchemaGetterGuard& schema_guard_; ITenantStatFinder& stat_finder_; @@ -405,7 +405,7 @@ class SquareIdMap : public BalanceGroupBox { bool ignore_leader_balance_; common::ObZone primary_zone_; - private: +private: int64_t map_id_; // debug only bool enable_dump_; // debug only }; @@ -428,7 +428,7 @@ inline SquareIdMap::const_iterator SquareIdMap::end() const } class ShardGroupIdMap : public SquareIdMap { - public: +public: ShardGroupIdMap( share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : SquareIdMap(schema_guard, stat_finder, allocator) @@ -436,13 +436,13 @@ class ShardGroupIdMap : public SquareIdMap { virtual ~ShardGroupIdMap() {} - public: +public: virtual const char* get_comment() const; virtual BalanceGroupType get_map_type() const; }; class ShardPartitionIdMap : public SquareIdMap { - public: +public: ShardPartitionIdMap( share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : SquareIdMap(schema_guard, stat_finder, allocator) @@ -450,13 +450,13 @@ class ShardPartitionIdMap : public SquareIdMap { virtual ~ShardPartitionIdMap() {} - public: +public: virtual const char* get_comment() const; virtual BalanceGroupType get_map_type() const; }; class TableGroupIdMap : public SquareIdMap { - public: +public: TableGroupIdMap( share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : SquareIdMap(schema_guard, stat_finder, allocator) @@ -464,13 +464,13 @@ class TableGroupIdMap : public SquareIdMap { virtual ~TableGroupIdMap() {} - public: +public: virtual const char* get_comment() const; virtual BalanceGroupType get_map_type() const; }; class PartitionTableIdMap : public SquareIdMap { - public: +public: PartitionTableIdMap( share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : SquareIdMap(schema_guard, stat_finder, allocator) @@ -478,13 +478,13 @@ class PartitionTableIdMap : public SquareIdMap { virtual ~PartitionTableIdMap() {} - public: +public: virtual const char* get_comment() const; virtual BalanceGroupType get_map_type() const; }; class NonPartitionTableIdMap : public SquareIdMap { - public: +public: NonPartitionTableIdMap( share::schema::ObSchemaGetterGuard& schema_guard, ITenantStatFinder& stat_finder, common::ObIAllocator& allocator) : SquareIdMap(schema_guard, stat_finder, allocator) @@ -492,22 +492,22 @@ class NonPartitionTableIdMap : public SquareIdMap { virtual ~NonPartitionTableIdMap() {} - public: +public: virtual const char* get_comment() const; virtual BalanceGroupType get_map_type() const; }; class SquareIdMapCollection : public BalanceGroupCollection { - public: +public: SquareIdMapCollection() : BalanceGroupCollection(), inited_(false), square_id_map_array_() {} virtual ~SquareIdMapCollection() {} - public: +public: int init(); - public: +public: virtual BalanceGroupContainerType get_container_type() const override { return SQUARE_MAP_TYPE; @@ -519,13 +519,13 @@ class SquareIdMapCollection : public BalanceGroupCollection { return square_id_map_array_; } - private: +private: bool inited_; common::ObArray square_id_map_array_; }; struct HashIndexMapItem { - public: +public: HashIndexMapItem() : in_group_index_(-1), group_count_(0), @@ -748,18 +748,18 @@ struct HashIndexMapItem { class HashIndexCollection; typedef common::hash::ObHashMap IndexMap; class HashIndexMap : public BalanceGroupBox { - public: +public: friend HashIndexCollection; typedef HashIndexMapItem Item; - public: +public: HashIndexMap() : BalanceGroupBox(), inited_(false), index_map_() {} virtual ~HashIndexMap() {} TO_STRING_EMPTY(); - public: +public: int init(const int64_t map_size); virtual BalanceGroupContainerType get_container_type() const override { @@ -767,26 +767,26 @@ class HashIndexMap : public BalanceGroupBox { } virtual int set_item(const BalanceGroupBoxItem& item) override; - private: +private: bool inited_; IndexMap index_map_; }; class HashIndexCollection : public BalanceGroupCollection { - public: +public: HashIndexCollection() : BalanceGroupCollection(), inited_(false), index_map_() {} virtual ~HashIndexCollection() {} - public: +public: int init(const int64_t item_size); void reuse() { index_map_.reuse(); } - public: +public: virtual BalanceGroupContainerType get_container_type() const override { return HASH_INDEX_TYPE; @@ -795,7 +795,7 @@ class HashIndexCollection : public BalanceGroupCollection { int get_partition_index(const common::ObPartitionKey& pkey, HashIndexMapItem& hash_index_item) const; int assign(const HashIndexCollection& that); - private: +private: bool inited_; IndexMap index_map_; }; diff --git a/src/rootserver/ob_balance_info.h b/src/rootserver/ob_balance_info.h index 323cd87a5..f126d906e 100644 --- a/src/rootserver/ob_balance_info.h +++ b/src/rootserver/ob_balance_info.h @@ -49,7 +49,7 @@ class ObZoneManager; struct ObReplicaStat; class ObDataSourceCandidateChecker { - public: +public: ObDataSourceCandidateChecker(common::ObReplicaType type) : this_type_(type) {} inline bool is_candidate(common::ObReplicaType other_type) const @@ -58,12 +58,12 @@ class ObDataSourceCandidateChecker { return common::ObReplicaTypeCheck::can_as_data_source(this_type_, other_type); } - private: +private: common::ObReplicaType this_type_; }; class ObStatisticsCalculator { - public: +public: ObStatisticsCalculator(); void reset(); @@ -76,7 +76,7 @@ class ObStatisticsCalculator { return values_.count(); } - private: +private: common::ObSEArray values_; double sum_; }; @@ -136,7 +136,7 @@ struct ObResourceWeight { const static int64_t MIN_REBALANCABLE_REPLICA_NUM = 3; // @see ObReplicaStat and ObReplicaResourceUsage struct LoadFactor { - public: +public: LoadFactor() { reset(); @@ -203,7 +203,7 @@ struct LoadFactor { K_(cpu_utime_rate), K_(cpu_stime_rate), K_(net_in_rate), K_(net_in_bytes_rate), K_(net_out_rate), K_(net_out_bytes_rate)); - private: +private: // DISK capacity int64_t disk_used_; // DISK IO @@ -327,7 +327,7 @@ struct ServerStat { bool stopped_; int64_t in_member_replica_cnt_; share::ObServerResourceInfo resource_info_; // cpu,disk,mem - public: +public: ServerStat() : server_(), online_(false), @@ -387,7 +387,7 @@ struct UnitStat { // After deducting the load of gts, the service capacity coefficient that the unit can provide double capacity_ratio_; - public: +public: UnitStat() : server_(NULL), in_pool_(false), @@ -529,10 +529,10 @@ struct Replica { int64_t failmsg_start_pos_; int64_t failmsg_count_; - private: +private: bool in_member_list_; // in leader member list // Do not use this domain directly, please use is_in_service(); - public: +public: Replica() : unit_(NULL), server_(NULL), @@ -650,7 +650,7 @@ struct ObReplicaTask { ObRebalanceTaskType cmd_type_; const char* comment_; - public: +public: ObReplicaTask(); ~ObReplicaTask(){}; void reset(); @@ -680,13 +680,13 @@ struct Partition { int64_t all_pg_idx_; // Used for inverted index all_pg bool has_flag_replica_; - private: +private: int64_t quorum_; // Paxos member quorum value recorded in clog bool has_leader_; // at least one of the replicas role is LEADER bool can_balance_; // Replicas that are split and not fully merged cannot be load balanced bool can_rereplicate_; // Able to copy bool in_physical_restore_; // all replica in physical restore status - public: +public: Partition() : table_id_(common::OB_INVALID_ID), tablegroup_id_(common::OB_INVALID_ID), @@ -769,7 +769,7 @@ struct PartitionGroup { int64_t end_; // partition position end. (%sorted_partition_ array index) int64_t all_tg_idx_; // Used for inverted index all_tg_, Used for scenarios where table_id is known and its tablegroup is found - public: +public: PartitionGroup() : table_id_(common::OB_INVALID_ID), tablegroup_id_(common::OB_INVALID_ID), @@ -788,7 +788,7 @@ struct TableGroup { uint64_t tablegroup_id_; int64_t begin_; // partition group position begin. ($all_pg_ array index) int64_t end_; // partition group position end. ($all_pg_ array index) - public: +public: TableGroup() : tablegroup_id_(common::OB_INVALID_ID), begin_(0), end_(0) {} TO_STRING_KV(KT_(tablegroup_id), K_(begin), K_(end)); @@ -827,9 +827,9 @@ struct ZoneUnit { // statistics for one tablegroup UnitStatArray all_unit_; - private: +private: int64_t tg_pg_cnt_; // Count the number of pg on the zone - public: +public: ZoneUnit() : zone_(), active_unit_cnt_(0), @@ -861,12 +861,12 @@ struct ZoneUnit { TO_STRING_KV(K_(zone), K_(active_unit_cnt), K_(load_avg), K_(load_imbalance), K_(tg_pg_cnt), K_(resource_weight), K_(ru_total), K_(ru_capacity), K_(all_unit)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ZoneUnit); }; class ServerReplicaCountMgr { - public: +public: ServerReplicaCountMgr() : inited_(false), server_replica_counts_() {} virtual ~ServerReplicaCountMgr() @@ -879,7 +879,7 @@ class ServerReplicaCountMgr { return server_replica_counts_.count(); } - private: +private: struct ServerReplicaCount { common::ObAddr server_; int64_t replica_count_; @@ -915,7 +915,7 @@ struct ObSimpleSequenceGenerator { return seq_++; } - private: +private: int64_t seq_; }; @@ -924,14 +924,14 @@ struct ObPartitionGroupOrder { {} bool operator()(const Partition* left, const Partition* right); - private: +private: template int compare(const T& left, const T& right) { return left < right ? -1 : (left == right ? 0 : 1); } - private: +private: int& ret_; }; @@ -988,7 +988,7 @@ struct TenantBalanceStat : public balancer::ITenantStatFinder { // relying on tenants and tables are consistent features on paxos int64_t min_source_replica_version_; // The starting version number of the copy of the standby database, and the copy less than this version is not allowed - public: +public: friend class ObRootBalancer; const static int64_t MAX_SERVER_CNT = 5000; const static int64_t MAX_UNIT_CNT = MAX_SERVER_CNT * 100; @@ -1173,13 +1173,13 @@ struct TenantBalanceStat : public balancer::ITenantStatFinder { int check_table_schema_changed( share::schema::ObSchemaGetterGuard& guard, const uint64_t table_id, bool& schema_changed) const; - private: +private: int set_unit_capacity_ratio(UnitStat& unit_stat, Partition& gts_service_partition); int sort_unit_pg_by_load(ZoneUnit& zu, UnitStat& u); int fill_tables(const common::ObIArray& tables, const common::ObIArray& tablegroups); - private: +private: int try_assign_unit_on_random_server( const common::ObArray::iterator& partition, common::hash::ObHashSet& units_assigned); int try_assign_unit_by_ppr(const common::ObArray::iterator& partition, Partition*& primary_partition, @@ -1188,7 +1188,7 @@ struct TenantBalanceStat : public balancer::ITenantStatFinder { const common::ObArray::iterator& partition, common::hash::ObHashSet& units_assigned); int calc_unit_load(UnitStat*& us); void update_last_run_timestamp(); // save current time for thread checker. - private: +private: bool inited_; bool valid_; ObUnitManager* unit_mgr_; @@ -1296,7 +1296,7 @@ int TenantBalanceStat::build_readonly_at_all_info(const uint64_t schema_id, cons } class ObCanMigratePartitionChecker { - public: +public: static int can_migrate_out(ObZoneManager& zone_mgr, UnitStat& src_unit, bool& need_balance); }; diff --git a/src/rootserver/ob_balancer_interface.h b/src/rootserver/ob_balancer_interface.h index a62857437..152376af1 100644 --- a/src/rootserver/ob_balancer_interface.h +++ b/src/rootserver/ob_balancer_interface.h @@ -35,14 +35,14 @@ class UnitStat; namespace balancer { class BalancerStringUtil { - public: +public: static bool has_prefix(const common::ObString& str, const common::ObString& prefix); static int substract_numeric_suffix(const common::ObString& str, common::ObString& prefix, int64_t& digit_len); static int substract_extra_suffix(const common::ObString& str, common::ObString& prefix, common::ObString& suffix); }; class ITenantStatFinder { - public: +public: virtual uint64_t get_tenant_id() const = 0; virtual int get_all_pg_idx(const common::ObPartitionKey& pkey, const int64_t all_tg_idx, int64_t& all_pg_idx) = 0; @@ -66,13 +66,13 @@ class ITenantStatFinder { }; class TenantSchemaGetter : public ITenantStatFinder { - public: +public: TenantSchemaGetter(const int64_t tenant_id) : ITenantStatFinder(), tenant_id_(tenant_id) {} virtual ~TenantSchemaGetter() {} - public: +public: virtual uint64_t get_tenant_id() const override { return tenant_id_; @@ -89,12 +89,12 @@ class TenantSchemaGetter : public ITenantStatFinder { virtual int get_gts_switch(bool& on) override; virtual int get_primary_partition_key(const int64_t all_pg_idx, common::ObPartitionKey& pkey) override; - private: +private: uint64_t tenant_id_; }; class StatFinderUtil { - public: +public: // Find the schema of all physical tables from all_tg // NOTE: 1. May return empty set // 2. Filtered tables without partitions, such as virtual tables, views, etc. @@ -109,7 +109,7 @@ class StatFinderUtil { }; class IUnitProvider { - public: +public: // Take the partition position of tablegroup **primary table** from all_tg_ according to all_tg_idx virtual int find_unit(int64_t all_tg_idx, int64_t part_idx, uint64_t& unit_id) const = 0; // Get the number of tenant units in each zone diff --git a/src/rootserver/ob_bootstrap.h b/src/rootserver/ob_bootstrap.h index e9f1d71a0..79a63d90c 100644 --- a/src/rootserver/ob_bootstrap.h +++ b/src/rootserver/ob_bootstrap.h @@ -48,7 +48,7 @@ class ObSysStat; class ObPartitionCreator; class ObBaseBootstrap { - public: +public: explicit ObBaseBootstrap( obrpc::ObSrvRpcProxy& rpc_proxy, const obrpc::ObServerInfoList& rs_list, common::ObServerConfig& config); virtual ~ObBaseBootstrap() @@ -61,7 +61,7 @@ class ObBaseBootstrap { return rpc_proxy_; } - protected: +protected: virtual int check_inner_stat() const; virtual int check_bootstrap_rs_list(const obrpc::ObServerInfoList& rs_list); virtual int check_multiple_zone_deployment_rslist(const obrpc::ObServerInfoList& rs_list); @@ -78,20 +78,20 @@ class ObBaseBootstrap { virtual int check_bootstrap_sys_tenant_primary_zone(); virtual int fill_sys_unit_config(const share::ObUnitConfig& sample_config, share::ObUnitConfig& target_config); - public: +public: int64_t step_id_; - protected: +protected: obrpc::ObSrvRpcProxy& rpc_proxy_; obrpc::ObServerInfoList rs_list_; common::ObServerConfig& config_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBaseBootstrap); }; class ObPreBootstrap : public ObBaseBootstrap { - public: +public: explicit ObPreBootstrap(obrpc::ObSrvRpcProxy& rpc_proxy, const obrpc::ObServerInfoList& rs_list, share::ObPartitionTableOperator& pt_operator, common::ObServerConfig& config, const obrpc::ObBootstrapArg& arg, obrpc::ObCommonRpcProxy& rs_rpc_proxy); @@ -101,7 +101,7 @@ class ObPreBootstrap : public ObBaseBootstrap { int64_t& initial_schema_version, ObIArray& frozen_status, ObIArray& freeze_schema); - private: +private: // wait leader elect time + root service start time static const int64_t WAIT_ELECT_SYS_LEADER_TIMEOUT_US = 30 * 1000 * 1000; static const int64_t NOTIFY_RESOURCE_RPC_TIMEOUT = 9 * 1000 * 1000; // 9 second @@ -112,7 +112,7 @@ class ObPreBootstrap : public ObBaseBootstrap { virtual int notify_sys_tenant_server_unit_resource(); virtual int create_partition(const int64_t initial_frozen_version, const int64_t initial_frozen_ts); - private: +private: volatile bool stop_; share::ObLeaderElectionWaiter leader_waiter_; int64_t begin_ts_; @@ -122,9 +122,9 @@ class ObPreBootstrap : public ObBaseBootstrap { }; class ObBootstrap : public ObBaseBootstrap { - public: +public: class TableIdCompare { - public: + public: TableIdCompare() : ret_(common::OB_SUCCESS) {} ~TableIdCompare() @@ -135,7 +135,7 @@ class ObBootstrap : public ObBaseBootstrap { return ret_; } - private: + private: int ret_; }; explicit ObBootstrap(obrpc::ObSrvRpcProxy& rpc_proxy, ObDDLService& ddl_service, ObUnitManager& unit_mgr, @@ -153,7 +153,7 @@ class ObBootstrap : public ObBaseBootstrap { int check_schema_version(share::schema::ObSchemaGetterGuard& schema_guard, const common::ObIArray& table_schemas, const bool need_update); - private: +private: static const int64_t HEAT_BEAT_INTERVAL_US = 2 * 1000 * 1000; // 2s static const int64_t WAIT_RS_IN_SERVICE_TIMEOUT_US = 40 * 1000 * 1000; // 40s static const int64_t BATCH_INSERT_SCHEMA_CNT = 32; @@ -206,7 +206,7 @@ virtual int set_table_locality( // end create gts service private method int set_in_bootstrap(); - private: +private: ObDDLService& ddl_service_; ObUnitManager& unit_mgr_; ObILeaderCoordinator& leader_coordinator_; @@ -215,7 +215,7 @@ virtual int set_table_locality( obrpc::ObCommonRpcProxy& common_proxy_; int64_t begin_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBootstrap); }; diff --git a/src/rootserver/ob_create_inner_schema_executor.h b/src/rootserver/ob_create_inner_schema_executor.h index 288d50f16..a853e18c0 100644 --- a/src/rootserver/ob_create_inner_schema_executor.h +++ b/src/rootserver/ob_create_inner_schema_executor.h @@ -33,7 +33,7 @@ namespace rootserver { class ObCreateInnerSchemaExecutor; class ObDDLService; class ObCreateInnerSchemaTask : public share::ObAsyncTask { - public: +public: explicit ObCreateInnerSchemaTask(ObCreateInnerSchemaExecutor& executor) : executor_(&executor) {} virtual ~ObCreateInnerSchemaTask() = default; @@ -41,12 +41,12 @@ class ObCreateInnerSchemaTask : public share::ObAsyncTask { share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; virtual int process() override; - private: +private: ObCreateInnerSchemaExecutor* executor_; }; class ObCreateInnerSchemaExecutor { - public: +public: ObCreateInnerSchemaExecutor(); ~ObCreateInnerSchemaExecutor() = default; int init(share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& sql_proxy, @@ -69,12 +69,12 @@ class ObCreateInnerSchemaExecutor { share::schema::ObSchemaGetterGuard& schema_guard, common::ObMySQLProxy* sql_proxy, obrpc::ObCommonRpcProxy* rpc_proxy); - private: +private: int set_execute_mark(); int do_create_inner_schema(); int check_stop(); - private: +private: bool is_inited_; bool is_stopped_; bool execute_; diff --git a/src/rootserver/ob_daily_merge_scheduler.h b/src/rootserver/ob_daily_merge_scheduler.h index 79b54535d..3abc7d76f 100644 --- a/src/rootserver/ob_daily_merge_scheduler.h +++ b/src/rootserver/ob_daily_merge_scheduler.h @@ -41,7 +41,7 @@ class ObDDLService; class ObFreezeInfoManager; class ObIZoneOp { - public: +public: enum Type { SetZoneMergingType = 1, SetFinishZoneMergeType = 2, @@ -58,7 +58,7 @@ class ObIZoneOp { }; class ObSetZoneMergingOp : public ObIZoneOp { - public: +public: ObSetZoneMergingOp(ObZoneManager& zone_mgr, const common::ObZone& zone); virtual ~ObSetZoneMergingOp() {} @@ -78,7 +78,7 @@ class ObSetZoneMergingOp : public ObIZoneOp { VIRTUAL_TO_STRING_KV("OpType", "ObSetZoneMergingOp", K_(zone), K_(is_done)); - private: +private: ObZoneManager& zone_mgr_; common::ObZone zone_; bool is_done_; @@ -86,7 +86,7 @@ class ObSetZoneMergingOp : public ObIZoneOp { }; class ObSetFinishZoneMergeOp : public ObIZoneOp { - public: +public: ObSetFinishZoneMergeOp(ObZoneManager& zone_mgr, const common::ObZone& zone, const int64_t last_merged_version, const int64_t all_merged_version); @@ -108,7 +108,7 @@ class ObSetFinishZoneMergeOp : public ObIZoneOp { VIRTUAL_TO_STRING_KV("OpType", "ObSetFinishZoneMergeOp", K_(zone), K_(is_done)); - private: +private: ObZoneManager& zone_mgr_; common::ObZone zone_; int64_t last_merged_version_; @@ -118,7 +118,7 @@ class ObSetFinishZoneMergeOp : public ObIZoneOp { }; class ObSetZoneMergeTimeOutOp : public ObIZoneOp { - public: +public: ObSetZoneMergeTimeOutOp(ObZoneManager& zone_mgr, const common::ObZone& zone, const int64_t version); virtual ~ObSetZoneMergeTimeOutOp() {} @@ -138,7 +138,7 @@ class ObSetZoneMergeTimeOutOp : public ObIZoneOp { VIRTUAL_TO_STRING_KV("OpType", "ObSetZoneMergeTimeOutOp", K_(zone), K_(is_done)); - private: +private: ObZoneManager& zone_mgr_; common::ObZone zone_; bool is_done_; @@ -147,7 +147,7 @@ class ObSetZoneMergeTimeOutOp : public ObIZoneOp { }; class ObSwitchLeaderMgr { - public: +public: ObSwitchLeaderMgr(); virtual ~ObSwitchLeaderMgr(); @@ -175,14 +175,14 @@ class ObSwitchLeaderMgr { void set_merger_warm_up_duration_time(const int64_t merger_warm_up_duration_time); void set_merge_status(bool is_in_merging); - private: +private: int can_add_new_op(const common::ObZone& zone, bool& can); int check_doing_warm_up(bool& is_doing); bool need_warm_up(); bool need_smooth_coordinate(const ObIZoneOp& zone_op); int start_warm_up(const ObPartitionTableUtil::ObLeaderInfoArray& leader_info_array, const common::ObZone& zone); - private: +private: bool is_inited_; ObILeaderCoordinator* leader_coordinator_; ObZoneManager* zone_mgr_; @@ -194,14 +194,14 @@ class ObSwitchLeaderMgr { }; class ObDailyMergeIdling : public ObThreadIdling { - public: +public: explicit ObDailyMergeIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual int64_t get_idle_interval_us(); }; class ObPartitionChecksumChecker { - public: +public: friend class TestChecksumChecker_test_checksum_error_Test; ObPartitionChecksumChecker() : sql_proxy_(NULL), @@ -224,11 +224,11 @@ class ObPartitionChecksumChecker { static const int64_t MIN_CHECK_INTERVAL = 10 * 1000 * 1000LL; - private: +private: void check_partition_checksum(); int check_global_index_column_checksum(); - private: +private: share::ObSSTableDataChecksumIterator local_data_checksum_iter_; share::ObSSTableDataChecksumIterator remote_data_checksum_iter_; common::ObMySQLProxy* sql_proxy_; @@ -243,7 +243,7 @@ class ObPartitionChecksumChecker { // Schedule daily merge (merge dynamic data to base line data). // Running in a single thread. class ObDailyMergeScheduler : public ObRsReentrantThread { - public: +public: friend class TestDailyMergerScheduler_double_check_Test; const static int64_t DEFAULT_ZONE_COUNT = 5; const static int64_t DEFAULT_IDLE_DURATION = 10 * 1000L * 1000L; @@ -276,7 +276,7 @@ class ObDailyMergeScheduler : public ObRsReentrantThread { int64_t get_schedule_interval() const; - private: +private: // return OB_CANCELED if stopped. int idle(); @@ -323,7 +323,7 @@ class ObDailyMergeScheduler : public ObRsReentrantThread { int try_start_smooth_coordinate(); const int64_t SWITCH_LEADER_CHECK_INTERVAL = 2 * 60 * 1000 * 1000; - private: +private: bool inited_; ObZoneManager* zone_mgr_; common::ObServerConfig* config_; diff --git a/src/rootserver/ob_daily_merge_sequence_generator.h b/src/rootserver/ob_daily_merge_sequence_generator.h index 9096ef4ca..45923d832 100644 --- a/src/rootserver/ob_daily_merge_sequence_generator.h +++ b/src/rootserver/ob_daily_merge_sequence_generator.h @@ -32,7 +32,7 @@ class ObMultiVersionSchemaService; } // namespace share namespace rootserver { class ObDailyMergeSequenceGenerator { - public: +public: friend class TestDailyMergeSequenceGenerator_get_merge_unit_index_Test; friend class TestDailyMergeSequenceGenerator_build_merge_unit_Test; friend class TestDailyMergeSequenceGenerator_calc_distribution_Test; @@ -75,7 +75,7 @@ class ObDailyMergeSequenceGenerator { typedef common::ObSEArray ObMergeUnitArray; typedef common::ObSEArray ObConflictPairs; class ObMergeUnitGenerator { - public: + public: ObMergeUnitGenerator() : inited_(false), zone_mgr_(NULL), server_manager_(NULL) {} ~ObMergeUnitGenerator() @@ -83,32 +83,32 @@ class ObDailyMergeSequenceGenerator { void init(ObZoneManager& zone_manager, ObServerManager& server_manager); int build_merge_unit(ObMergeUnitArray& merge_units); - private: + private: bool inited_; int build_merge_unit_by_zone(ObMergeUnitArray& merge_units); ObZoneManager* zone_mgr_; ObServerManager* server_manager_; }; class ObConflictPairPriorityCmp { - public: + public: ObConflictPairPriorityCmp(ObDailyMergeSequenceGenerator& generator) : generator_(generator) {} ~ObConflictPairPriorityCmp() {} bool operator()(const ObConflictPair& first, const ObConflictPair& second); - private: + private: ObDailyMergeSequenceGenerator& generator_; }; class ObMergePriorityCmp { - public: + public: ObMergePriorityCmp(ObZoneManager* zone_mgr) : zone_mgr_(zone_mgr) {} ~ObMergePriorityCmp() {} bool operator()(const ObConflictPair& first, const ObConflictPair& second); - private: + private: ObZoneManager* zone_mgr_; }; @@ -118,7 +118,7 @@ class ObDailyMergeSequenceGenerator { share::schema::ObMultiVersionSchemaService& schema_service); int get_next_zone(bool merge_by_turn, const int64_t concurrency_count, common::ObIArray& zones); - private: +private: int get_next_zone_by_turn(common::ObIArray& zones); int get_next_zone_no_turn(common::ObIArray& zones); int get_next_zone_by_priority(common::ObIArray& to_merge); @@ -147,7 +147,7 @@ class ObDailyMergeSequenceGenerator { int add_conflict_pair(const ObZone& first, const ObZone& second); int get_leader_count(const ObZone& zone, int64_t& leader_count); - private: +private: ObZoneManager* zone_mgr_; ObServerManager* server_manager_; share::ObPartitionTableOperator* pt_; diff --git a/src/rootserver/ob_ddl_help.h b/src/rootserver/ob_ddl_help.h index f4e3d742b..5f37646cc 100644 --- a/src/rootserver/ob_ddl_help.h +++ b/src/rootserver/ob_ddl_help.h @@ -30,7 +30,7 @@ class ObMultiVersionSchemaService; namespace rootserver { class ObDDLService; class ObTableGroupHelp { - public: +public: ObTableGroupHelp(ObDDLService& ddl_service, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& sql_proxy) : ddl_service_(&ddl_service), schema_service_(&schema_service), sql_proxy_(&sql_proxy) @@ -62,7 +62,7 @@ class ObTableGroupHelp { const share::schema::ObTablegroupSchema* orig_tablegroup_schema, const share::schema::ObTablegroupSchema& alter_tablegroup_schema, ObMySQLTransaction& trans); - private: +private: int check_partition_option(const share::schema::ObTablegroupSchema& tablegroup, share::schema::ObTableSchema& table); int check_partition_option(const share::schema::ObTablegroupSchema& tablegroup, share::schema::ObTableSchema& table, @@ -136,14 +136,14 @@ class ObTableGroupHelp { DISALLOW_COPY_AND_ASSIGN(ObTableGroupHelp); - private: +private: ObDDLService* ddl_service_; share::schema::ObMultiVersionSchemaService* schema_service_; common::ObMySQLProxy* sql_proxy_; }; class ObPartitionSplitHelper { - public: +public: ObPartitionSplitHelper() {} virtual ~ObPartitionSplitHelper() diff --git a/src/rootserver/ob_ddl_operator.h b/src/rootserver/ob_ddl_operator.h index a3c035855..6d987255f 100644 --- a/src/rootserver/ob_ddl_operator.h +++ b/src/rootserver/ob_ddl_operator.h @@ -120,7 +120,7 @@ struct ObSysStat { }; class ObDDLOperator { - public: +public: ObDDLOperator(share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& sql_proxy); virtual ~ObDDLOperator(); @@ -504,7 +504,7 @@ class ObDDLOperator { int construct_new_name_for_recyclebin(const T& schema, common::ObSqlString& new_table_name); static int replace_sys_stat(const uint64_t tenant_id, ObSysStat& sys_stat, common::ObISQLClient& trans); - private: +private: virtual int set_need_flush_ora(share::schema::ObSchemaGetterGuard& schema_guard, const share::schema::ObObjPrivSortKey& obj_priv_key, /* in: obj priv key*/ const uint64_t option, /* in: new option */ @@ -605,7 +605,7 @@ class ObDDLOperator { common::ObString& object_name); int get_user_id_for_inner_ur(share::schema::ObUserInfo& user, bool& is_inner_ur, uint64_t& new_user_id); - private: +private: int drop_fk_cascade(uint64_t tenant_id, share::schema::ObSchemaGetterGuard& schema_guard, bool has_ref_priv, bool has_no_cascade, const common::ObString& grantee_name, const common::ObString& parent_db_name, const common::ObString& parent_tab_name, common::ObMySQLTransaction& trans); @@ -646,7 +646,7 @@ class ObDDLOperator { int check_modify_column_when_upgrade( const share::schema::ObColumnSchemaV2& new_column, const share::schema::ObColumnSchemaV2& orig_column); - private: +private: share::schema::ObMultiVersionSchemaService& schema_service_; common::ObMySQLProxy& sql_proxy_; }; diff --git a/src/rootserver/ob_ddl_service.cpp b/src/rootserver/ob_ddl_service.cpp index 7622261cc..e0bd29291 100644 --- a/src/rootserver/ob_ddl_service.cpp +++ b/src/rootserver/ob_ddl_service.cpp @@ -22286,7 +22286,7 @@ int ObDDLService::get_tenant_primary_zone_entity_count( LOG_WARN("database schema is null", K(ret)); } else if (tablegroup_schema->get_primary_zone().empty()) { // go on next - }else { + } else { ++pz_entity_count; } } diff --git a/src/rootserver/ob_ddl_service.h b/src/rootserver/ob_ddl_service.h index aa93d03d7..52983a4e5 100644 --- a/src/rootserver/ob_ddl_service.h +++ b/src/rootserver/ob_ddl_service.h @@ -75,11 +75,11 @@ class ObSnapshotInfoManager; class ObSinglePartBalance; class ObDDLService { - public: +public: typedef common::hash::ObHashMap PartitionInfoMap; - public: +public: friend class ObTableGroupHelp; friend class ObStandbyClusterSchemaProcessor; ObDDLService(); @@ -449,7 +449,7 @@ class ObDDLService { int modify_schema_in_restore(const obrpc::ObRestoreModifySchemaArg& arg); - private: +private: enum PartitionBornMethod : int64_t { PBM_INVALID = 0, PBM_DIRECTLY_CREATE, @@ -734,7 +734,7 @@ class ObDDLService { int drop_resource_pool_final( const uint64_t tenant_id, const bool is_standby, ObIArray& pool_names); - public: +public: int construct_zone_region_list(common::ObIArray& zone_region_list, const common::ObIArray& zone_list); virtual int create_partitions_for_split(const int64_t schema_version, const share::schema::ObTableSchema& table, @@ -763,7 +763,7 @@ class ObDDLService { bool is_sync_primary_ddl(); int clear_partition_member_list(const int64_t max_schema_version, const int64_t tenant_id, const bool is_inner_table); - private: +private: int do_modify_system_variable( uint64_t tenant_id, const share::schema::ObSysVarSchema& modify_var, share::schema::ObSysVarSchema& new_schema); @@ -816,13 +816,13 @@ class ObDDLService { int get_part_by_id(share::schema::AlterTableSchema& table_schema, const int64_t part_id, const share::schema::ObPartition*& partition); - public: +public: int get_tenant_primary_zone_entity_count( const uint64_t tenant_id, share::schema::ObSchemaGetterGuard& schema_guard, int64_t& pz_entity_count); int refresh_unit_replica_counter(const uint64 tenant_id); int check_restore_point_allow(const int64_t tenant_id, const int64_t table_id); - private: +private: // used only by create normal tenant int check_tenant_schema(const common::ObIArray& pool_list, share::schema::ObTenantSchema& tenant_schema, share::schema::ObSchemaGetterGuard& schema_guard); @@ -1081,7 +1081,7 @@ class ObDDLService { const share::schema::ObTableSchema& orig_table_schema); bool add_sys_table_index(const uint64_t table_id, common::ObIArray& schemas); - private: +private: // gts tenant associated int modify_gts_tenant(const obrpc::ObModifyTenantArg& arg, share::schema::ObSchemaGetterGuard& schema_guard, const share::schema::ObTenantSchema& tenant_schema); @@ -1096,7 +1096,7 @@ class ObDDLService { const share::schema::ObTableSchema& orig_table_schema, share::schema::AlterTableSchema& inc_table_schema); int check_table_pk(const share::schema::ObTableSchema& orig_table_schema); - private: +private: bool inited_; volatile bool stopped_; obrpc::ObSrvRpcProxy* rpc_proxy_; @@ -1114,12 +1114,12 @@ class ObDDLService { ObRebalanceTaskMgr* task_mgr_; mutable common::SpinRWLock pz_entity_cnt_lock_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDDLService); }; class ObDDLSQLTransaction : public common::ObMySQLTransaction { - public: +public: ObDDLSQLTransaction(share::schema::ObMultiVersionSchemaService* schema_service) : schema_service_(schema_service), tenant_id_(OB_INVALID_ID), @@ -1128,7 +1128,7 @@ class ObDDLSQLTransaction : public common::ObMySQLTransaction { {} virtual ~ObDDLSQLTransaction(){}; - public: +public: virtual int start(ObISQLClient* proxy, bool with_snapshot = false) override; // If you commit the transaction, you need to write a line in ddl_operation once, the mark of end virtual int end(const bool commit) override; @@ -1145,10 +1145,10 @@ class ObDDLSQLTransaction : public common::ObMySQLTransaction { return start_operation_schema_version_; } - private: +private: int try_lock_all_ddl_operation(common::ObMySQLTransaction& trans, const uint64_t tenant_id); - private: +private: share::schema::ObMultiVersionSchemaService* schema_service_; int64_t tenant_id_; // Filter out only one 1503 DDL transaction to prevent the schema from being invalidly pushed up diff --git a/src/rootserver/ob_ddl_sql_generator.h b/src/rootserver/ob_ddl_sql_generator.h index c9acb3488..c26f63134 100644 --- a/src/rootserver/ob_ddl_sql_generator.h +++ b/src/rootserver/ob_ddl_sql_generator.h @@ -29,7 +29,7 @@ class ObString; namespace rootserver { class ObDDLSqlGenerator { - public: +public: ObDDLSqlGenerator() {} @@ -59,7 +59,7 @@ class ObDDLSqlGenerator { const share::schema::ObTablePrivSortKey& table_priv_key, const bool revoke_all_flag, const share::ObRawObjPrivArray& obj_priv_array, const bool is_grant, common::ObSqlString& sql_string); - private: +private: static int get_priv_name(const int64_t priv, const char*& name); static int priv_to_name(const ObPrivSet priv, common::ObSqlString& priv_str); static char* adjust_ddl_format_str(char* ori_format_str); diff --git a/src/rootserver/ob_empty_server_checker.h b/src/rootserver/ob_empty_server_checker.h index f203cfe69..4314b4ad8 100644 --- a/src/rootserver/ob_empty_server_checker.h +++ b/src/rootserver/ob_empty_server_checker.h @@ -33,7 +33,7 @@ class ObServerManager; /// Check whether have partitions on non-alive servers. class ObEmptyServerCheckRound { - public: +public: const static int64_t PT_SYNC_TIMEOUT = 10L * 60 * 1000 * 1000; // 10 minutes explicit ObEmptyServerCheckRound(volatile bool& stop); virtual ~ObEmptyServerCheckRound(); @@ -45,11 +45,11 @@ class ObEmptyServerCheckRound { int check(common::ObThreadCond& cond); int pt_sync_finish(const common::ObAddr& server, const int64_t version); - private: +private: int wait_pt_sync_finish(common::ObThreadCond& cond); int update_with_partition_flag(); - private: +private: bool inited_; volatile bool& stop_; int64_t version_; @@ -67,7 +67,7 @@ class ObEmptyServerCheckRound { /// Empty server checker thread. class ObEmptyServerChecker : public ObRsReentrantThread { - public: +public: ObEmptyServerChecker(); virtual ~ObEmptyServerChecker(); @@ -85,7 +85,7 @@ class ObEmptyServerChecker : public ObRsReentrantThread { virtual int notify_check(); virtual int pt_sync_finish(const common::ObAddr& server, const int64_t version); - private: +private: bool inited_; bool need_check_; ObEmptyServerCheckRound check_round_; diff --git a/src/rootserver/ob_freeze_info_manager.h b/src/rootserver/ob_freeze_info_manager.h index e94396908..5c4dc7886 100644 --- a/src/rootserver/ob_freeze_info_manager.h +++ b/src/rootserver/ob_freeze_info_manager.h @@ -39,7 +39,7 @@ class ObRootService; // 1. set_freeze_info() used to rs write clog when major freeze // 2. get_freeze_info() used to get spec version frozen status class ObFreezeInfoManager { - public: +public: ObFreezeInfoManager() : is_inited_(false), freeze_info_proxy_(), @@ -57,9 +57,9 @@ class ObFreezeInfoManager { virtual ~ObFreezeInfoManager() {} - private: +private: struct FreezeInfo { - public: + public: bool is_loaded_; bool fast_loaded_; // local cached latest freeze info, schema_version is not included. @@ -100,18 +100,18 @@ class ObFreezeInfoManager { int assign(const FreezeInfo& other); }; - public: +public: int init( common::ObMySQLProxy* proxy, ObZoneManager* zone_manager, obrpc::ObCommonRpcProxy* common_rpc, ObRootService& rs); void destroy(); - public: +public: int reload(); int load_frozen_status(); void unload(); int try_reload(); - public: +public: int set_freeze_info(const int64_t frozen_version, const int64_t tenant_id, const common::ObAddr& server_addr, const common::ObAddr& rs_addr); int try_update_major_schema_version(); @@ -144,7 +144,7 @@ class ObFreezeInfoManager { int get_latest_merger_frozen_status(share::ObSimpleFrozenStatus& frozen_status); int get_latest_snapshot_gc_ts(int64_t& lastest_snapshot_gc_ts) const; - private: +private: int check_inner_stat() const; int load_multi_version(FreezeInfo& freeze_info); bool is_valid_schema(const common::ObIArray& schema_versions); @@ -175,7 +175,7 @@ class ObFreezeInfoManager { int set_latest_multi_versions(const common::ObIArray& snapshot_infos); int inner_update_major_schema_version(); - public: +public: // no merge of frozen_version 1 will happen, // we stipulate frozen_status of version 1 as follows static const int64_t ORIGIN_FROZEN_VERSION = 1; @@ -185,7 +185,7 @@ class ObFreezeInfoManager { static const int64_t SNAPSHOT_GC_TS_WARN = 30LL * 60LL * 1000LL * 1000LL; static const int64_t SNAPSHOT_GC_TS_ERROR = 2LL * 60LL * 60LL * 1000LL * 1000LL; - private: +private: bool is_inited_; share::ObFreezeInfoProxy freeze_info_proxy_; share::ObSnapshotTableProxy snapshot_proxy_; @@ -197,7 +197,7 @@ class ObFreezeInfoManager { mutable common::SpinRWLock freeze_info_lock_; FreezeInfo freeze_info_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFreezeInfoManager); }; diff --git a/src/rootserver/ob_freeze_info_updater.h b/src/rootserver/ob_freeze_info_updater.h index 025cca442..c8d40bc9b 100644 --- a/src/rootserver/ob_freeze_info_updater.h +++ b/src/rootserver/ob_freeze_info_updater.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace rootserver { class ObFreezeInfoManager; class ObFreezeInfoUpdater : public ObRsReentrantThread { - public: +public: ObFreezeInfoUpdater(); ~ObFreezeInfoUpdater(); int init(ObFreezeInfoManager& freeze_info_manager); @@ -29,7 +29,7 @@ class ObFreezeInfoUpdater : public ObRsReentrantThread { } int64_t get_schedule_interval() const; - private: +private: int try_gc_snapshot(); int try_update_major_schema_version(); int try_reload_freeze_info(); @@ -37,7 +37,7 @@ class ObFreezeInfoUpdater : public ObRsReentrantThread { int calc_weakread_timestamp(); int process_invalid_schema_version(); - private: +private: static const int64_t TRY_UPDATER_INTERVAL_US = 1000 * 1000; // 1s bool inited_; int64_t last_gc_timestamp_; diff --git a/src/rootserver/ob_gc_partition_builder.h b/src/rootserver/ob_gc_partition_builder.h index 86baa4b28..83f3a1862 100644 --- a/src/rootserver/ob_gc_partition_builder.h +++ b/src/rootserver/ob_gc_partition_builder.h @@ -22,7 +22,7 @@ namespace rootserver { class ObGCPartitionBuilder; class ObBuildGCPartitionTask : public share::ObAsyncTask { - public: +public: explicit ObBuildGCPartitionTask(ObGCPartitionBuilder& gc_partition_builder) : gc_partition_builder_(&gc_partition_builder) {} @@ -32,12 +32,12 @@ class ObBuildGCPartitionTask : public share::ObAsyncTask { share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; virtual int process(); - private: +private: ObGCPartitionBuilder* gc_partition_builder_; }; class ObGCPartitionBuilder { - public: +public: ObGCPartitionBuilder(); ~ObGCPartitionBuilder() {} @@ -51,7 +51,7 @@ class ObGCPartitionBuilder { void start(); int stop(); - private: +private: int check_stop(); int set_build_mark(); @@ -60,10 +60,10 @@ class ObGCPartitionBuilder { int batch_insert_partitions(common::ObIArray& partitions); int check_tenant_gc_partition_info(uint64_t tenant_id, int64_t partition_cnt); - private: +private: static const int64_t BATCH_INSERT_COUNT = 100; - private: +private: bool inited_; bool stopped_; bool build_; diff --git a/src/rootserver/ob_global_index_builder.cpp b/src/rootserver/ob_global_index_builder.cpp index a6ec8519f..8403de7b9 100644 --- a/src/rootserver/ob_global_index_builder.cpp +++ b/src/rootserver/ob_global_index_builder.cpp @@ -2661,7 +2661,8 @@ int ObGlobalIndexBuilder::on_build_single_replica_reply(const uint64_t index_tab // error from sql module, for instance:numeric_overflow, do not retry any more task->build_single_replica_stat_ = BSRT_FAILED; LOG_WARN("Detected sql error, stop retrying", K(ret_code)); - } else if (ObIDDLTask::error_need_retry(ret_code) || OB_ENTRY_EXIST == ret_code || OB_ERR_WAIT_REMOTE_SCHEMA_REFRESH == ret_code) { + } else if (ObIDDLTask::error_need_retry(ret_code) || OB_ENTRY_EXIST == ret_code || + OB_ERR_WAIT_REMOTE_SCHEMA_REFRESH == ret_code) { task->build_single_replica_stat_ = BSRT_INVALID_SNAPSHOT; LOG_INFO("ddl error need retry", K(ret_code), K(*task)); } else { diff --git a/src/rootserver/ob_global_index_builder.h b/src/rootserver/ob_global_index_builder.h index ca0b71e1c..94a161026 100644 --- a/src/rootserver/ob_global_index_builder.h +++ b/src/rootserver/ob_global_index_builder.h @@ -60,13 +60,13 @@ class ObRebalanceTask; class ObFreezeInfoManager; class ObGlobalIndexBuilderIdling : public ObThreadIdling { - public: +public: explicit ObGlobalIndexBuilderIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual ~ObGlobalIndexBuilderIdling() {} - public: +public: virtual int64_t get_idle_interval_us() { return 3600LL * 1000LL * 1000LL; @@ -161,7 +161,7 @@ enum BuildSingleReplicaStat { }; struct ObGlobalIndexTask { - public: +public: ObGlobalIndexTask(); virtual ~ObGlobalIndexTask(); @@ -202,46 +202,39 @@ class ObGlobalIndexBuilder : public ObRsReentrantThread, public sql::ObIndexSSTa typedef common::hash::ObHashMap::iterator task_iterator; typedef common::hash::ObHashMap::const_iterator const_task_iterator; - public: +public: ObGlobalIndexBuilder(); virtual ~ObGlobalIndexBuilder(); - public: +public: virtual void run3() override; - virtual int blocking_run() override { BLOCKING_RUN_IMPLEMENT(); } - int init( - obrpc::ObSrvRpcProxy *rpc_proxy, - common::ObMySQLProxy *mysql_proxy, - rootserver::ObServerManager *server_mgr, - share::ObPartitionTableOperator *pt_operator, - rootserver::ObRebalanceTaskMgr *rebalance_task_mgr, - rootserver::ObDDLService *ddl_service, - share::schema::ObMultiVersionSchemaService *schema_service, - rootserver::ObZoneManager *zone_mgr, - rootserver::ObFreezeInfoManager *freeze_info_manager); + virtual int blocking_run() override + { + BLOCKING_RUN_IMPLEMENT(); + } + int init(obrpc::ObSrvRpcProxy* rpc_proxy, common::ObMySQLProxy* mysql_proxy, rootserver::ObServerManager* server_mgr, + share::ObPartitionTableOperator* pt_operator, rootserver::ObRebalanceTaskMgr* rebalance_task_mgr, + rootserver::ObDDLService* ddl_service, share::schema::ObMultiVersionSchemaService* schema_service, + rootserver::ObZoneManager* zone_mgr, rootserver::ObFreezeInfoManager* freeze_info_manager); int reload_building_indexes(); int on_build_single_replica_reply(const uint64_t index_table_id, int64_t snapshot, int ret_code); int on_col_checksum_calculation_reply( const uint64_t index_table_id, const common::ObPartitionKey& pkey, const int ret_code); int on_check_unique_index_reply(const common::ObPartitionKey& pkey, const int ret_code, const bool is_unique); int on_copy_multi_replica_reply(const ObRebalanceTask& rebalance_task); - virtual int pick_data_replica( - const common::ObPartitionKey &pkey, - const common::ObIArray &previous, - common::ObAddr &server) override; - virtual int pick_index_replica( - const common::ObPartitionKey &pkey, - const common::ObIArray &previous, - common::ObAddr &server) override; - int submit_build_global_index_task( - const share::schema::ObTableSchema *index_schema); + virtual int pick_data_replica(const common::ObPartitionKey& pkey, const common::ObIArray& previous, + common::ObAddr& server) override; + virtual int pick_index_replica(const common::ObPartitionKey& pkey, const common::ObIArray& previous, + common::ObAddr& server) override; + int submit_build_global_index_task(const share::schema::ObTableSchema* index_schema); void stop() override; + private: - static const int64_t BUILD_SINGLE_REPLICA_TIMEOUT = 2LL * 3600LL * 1000000LL; // 2h - static const int64_t COPY_MULTI_REPLICA_TIMEOUT = 2LL * 3600LL * 1000000LL; // 2h - static const int64_t UNIQUE_INDEX_CHECK_TIMEOUT = 2LL * 3600LL * 1000000LL; // 2h - static const int64_t UNIQUE_INDEX_CALC_CHECKSUM_TIMEOUT = 2LL * 3600LL * 1000000LL; // 2h - static const int64_t TASK_RETRY_TIME_INTERVAL_US = 10LL * 1000000LL; // 10s + static const int64_t BUILD_SINGLE_REPLICA_TIMEOUT = 2LL * 3600LL * 1000000LL; // 2h + static const int64_t COPY_MULTI_REPLICA_TIMEOUT = 2LL * 3600LL * 1000000LL; // 2h + static const int64_t UNIQUE_INDEX_CHECK_TIMEOUT = 2LL * 3600LL * 1000000LL; // 2h + static const int64_t UNIQUE_INDEX_CALC_CHECKSUM_TIMEOUT = 2LL * 3600LL * 1000000LL; // 2h + static const int64_t TASK_RETRY_TIME_INTERVAL_US = 10LL * 1000000LL; // 10s static const int64_t COPY_MULTI_REPLICA_RETRY_UPPER_LMT = 3; static const int64_t THREAD_CNT = 1; static const int64_t TASK_MAP_BUCKET_NUM = 256; @@ -312,7 +305,7 @@ private: common::ObAddr server_; }; - private: +private: int try_drive(ObGlobalIndexTask* task); int get_task_count_in_lock(int64_t& task_cnt); int fill_global_index_task_result(common::sqlclient::ObMySQLResult* result, ObGlobalIndexTask* task); @@ -383,7 +376,7 @@ private: int do_build_single_replica( ObGlobalIndexTask* task, const share::schema::ObTableSchema* index_schema, const int64_t snapshot); - private: +private: int try_build_single_replica(ObGlobalIndexTask* task); int try_copy_multi_replica(ObGlobalIndexTask* task); int try_unique_index_calc_checksum(ObGlobalIndexTask* task); @@ -392,13 +385,13 @@ private: int try_handle_index_build_failed(ObGlobalIndexTask* task); int try_handle_index_build_finish(ObGlobalIndexTask* task); - private: +private: int clear_intermediate_result(ObGlobalIndexTask* task); int reset_run_condition(); int check_task_dropped(const ObGlobalIndexTask& task, bool& is_dropped); int delete_task_record(const ObGlobalIndexTask& task); - private: +private: bool inited_; bool loaded_; obrpc::ObSrvRpcProxy* rpc_proxy_; diff --git a/src/rootserver/ob_global_max_decided_trans_version_mgr.cpp b/src/rootserver/ob_global_max_decided_trans_version_mgr.cpp index fe4816f68..97b2b91f0 100644 --- a/src/rootserver/ob_global_max_decided_trans_version_mgr.cpp +++ b/src/rootserver/ob_global_max_decided_trans_version_mgr.cpp @@ -47,14 +47,14 @@ ObGlobalMaxDecidedTransVersionMgr::~ObGlobalMaxDecidedTransVersionMgr() } class ObGlobalMaxDecidedTransVersionMgr::InsertPartitionFunctor { - public: +public: explicit InsertPartitionFunctor(const common::ObPartitionKey& partition_key) : partition_key_(partition_key), ret_value_(common::OB_SUCCESS) {} ~InsertPartitionFunctor() {} - public: +public: bool operator()(const common::ObAddr& leader, common::ObPartitionArray& partition_array) { if (OB_SUCCESS != (ret_value_ = partition_array.push_back(partition_key_))) { @@ -67,16 +67,16 @@ class ObGlobalMaxDecidedTransVersionMgr::InsertPartitionFunctor { return ret_value_; } - private: +private: common::ObPartitionKey partition_key_; int ret_value_; - private: +private: DISALLOW_COPY_AND_ASSIGN(InsertPartitionFunctor); }; class ObGlobalMaxDecidedTransVersionMgr::QueryPartitionFunctor { - public: +public: QueryPartitionFunctor(obrpc::ObSrvRpcProxy* rpc_proxy, const int64_t version) : saved_value_array_(), ret_value_(common::OB_SUCCESS), @@ -86,7 +86,7 @@ class ObGlobalMaxDecidedTransVersionMgr::QueryPartitionFunctor { ~QueryPartitionFunctor() {} - public: +public: bool operator()(const common::ObAddr& leader, common::ObPartitionArray& partition_array) { if (OB_SUCCESS != (ret_value_ = handle_partition_array_(leader, partition_array))) { @@ -104,9 +104,9 @@ class ObGlobalMaxDecidedTransVersionMgr::QueryPartitionFunctor { } int get_min(common::ObPartitionKey& pkey, int64_t& value) const; - private: +private: class PartitionValue { - public: + public: PartitionValue(const common::ObPartitionKey& pkey, const int64_t value) : pkey_(pkey), value_(value) {} PartitionValue() : pkey_(), value_(0) @@ -115,19 +115,19 @@ class ObGlobalMaxDecidedTransVersionMgr::QueryPartitionFunctor { {} TO_STRING_KV(K_(pkey), K_(value)); - public: + public: common::ObPartitionKey pkey_; int64_t value_; }; - private: +private: int handle_partition_array_(const common::ObAddr& leader, const common::ObPartitionArray& partition_array); common::ObSEArray saved_value_array_; int ret_value_; obrpc::ObSrvRpcProxy* rpc_proxy_; int64_t last_max_decided_trans_version_; - private: +private: DISALLOW_COPY_AND_ASSIGN(QueryPartitionFunctor); }; diff --git a/src/rootserver/ob_global_max_decided_trans_version_mgr.h b/src/rootserver/ob_global_max_decided_trans_version_mgr.h index 03fbb92da..e9300aeef 100644 --- a/src/rootserver/ob_global_max_decided_trans_version_mgr.h +++ b/src/rootserver/ob_global_max_decided_trans_version_mgr.h @@ -33,11 +33,11 @@ class ObMultiVersionSchemaService; namespace rootserver { class ObGlobalMaxDecidedTransVersionMgr : public ObRsReentrantThread { - public: +public: ObGlobalMaxDecidedTransVersionMgr(); virtual ~ObGlobalMaxDecidedTransVersionMgr(); - public: +public: int init(obrpc::ObSrvRpcProxy* rpc_proxy, share::ObPartitionTableOperator* pt_operator, share::schema::ObMultiVersionSchemaService* schema_service, const common::ObAddr& self_addr); virtual void run3() override; @@ -50,7 +50,7 @@ class ObGlobalMaxDecidedTransVersionMgr : public ObRsReentrantThread { } int get_global_max_decided_trans_version(int64_t& trans_version) const; - private: +private: class InsertPartitionFunctor; class QueryPartitionFunctor; typedef common::ObLinearHashMap ServerPartitionMap; @@ -70,7 +70,7 @@ class ObGlobalMaxDecidedTransVersionMgr : public ObRsReentrantThread { int handle_each_partition_(ServerPartitionMap& server_partition_map); bool cluster_version_before_2000_() const; - private: +private: bool is_inited_; obrpc::ObSrvRpcProxy* rpc_proxy_; share::ObPartitionTableOperator* pt_operator_; @@ -80,7 +80,7 @@ class ObGlobalMaxDecidedTransVersionMgr : public ObRsReentrantThread { int64_t start_ts_; common::ObPartitionKey contributor_pkey_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGlobalMaxDecidedTransVersionMgr); }; diff --git a/src/rootserver/ob_i_backup_scheduler.h b/src/rootserver/ob_i_backup_scheduler.h index 508431686..776367ac8 100644 --- a/src/rootserver/ob_i_backup_scheduler.h +++ b/src/rootserver/ob_i_backup_scheduler.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace rootserver { class ObIBackupScheduler { - public: +public: ObIBackupScheduler() {} virtual ~ObIBackupScheduler() diff --git a/src/rootserver/ob_index_builder.h b/src/rootserver/ob_index_builder.h index 59e0025b3..6b439579f 100644 --- a/src/rootserver/ob_index_builder.h +++ b/src/rootserver/ob_index_builder.h @@ -42,9 +42,9 @@ class ObZoneManager; class ObDDLService; class ObIndexBuildStatus { - public: +public: class PartitionIndexStatus { - public: + public: PartitionIndexStatus(); ~PartitionIndexStatus() {} @@ -67,14 +67,14 @@ class ObIndexBuildStatus { }; class PartitionIndexStatusOrder { - public: + public: explicit PartitionIndexStatusOrder(int& ret) : ret_(ret) {} ~PartitionIndexStatusOrder() {} bool operator()(const PartitionIndexStatus& left, const PartitionIndexStatus& right) const; - private: + private: int& ret_; }; @@ -86,18 +86,18 @@ class ObIndexBuildStatus { int find(const int64_t partition_id, const common::ObAddr& server, PartitionIndexStatus& status) const; TO_STRING_KV(K_(loaded), K_(all_status)); - private: +private: bool loaded_; common::ObArray all_status_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIndexBuildStatus); }; class ObIndexWaitTransStatus { - public: +public: class PartitionWaitTransStatus { - public: + public: PartitionWaitTransStatus(); virtual ~PartitionWaitTransStatus(); bool operator<(const PartitionWaitTransStatus& other) const; @@ -113,14 +113,14 @@ class ObIndexWaitTransStatus { }; class PartitionWaitTransStatusComparator { - public: + public: explicit PartitionWaitTransStatusComparator(int& ret) : ret_(ret) {} virtual ~PartitionWaitTransStatusComparator() {} bool operator()(const PartitionWaitTransStatus& lhs, const PartitionWaitTransStatus& rhs) const; - private: + private: int& ret_; }; ObIndexWaitTransStatus(); @@ -129,14 +129,14 @@ class ObIndexWaitTransStatus { int get_wait_trans_status(const uint64_t index_id, ObMySQLProxy& sql_proxy); int find_status(const int64_t partition_id, PartitionWaitTransStatus& status) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIndexWaitTransStatus); bool loaded_; common::ObArray all_wait_trans_status_; }; class ObRSBuildIndexTask : public share::ObIDDLTask { - public: +public: enum TaskState { WAIT_TRANS_END = 0, WAIT_BUILD_INDEX_END, @@ -166,7 +166,7 @@ class ObRSBuildIndexTask : public share::ObIDDLTask { return data_table_id_; } - private: +private: int wait_trans_end(bool& is_end); int wait_build_index_end(bool& is_end); bool need_print_log(); @@ -175,7 +175,7 @@ class ObRSBuildIndexTask : public share::ObIDDLTask { int release_snapshot(); int remove_index_build_stat_record(); - private: +private: static const int64_t PRINT_LOG_INTERVAL = 600 * 1000000; static const int64_t INDEX_SNAPSHOT_VERSION_DIFF = 100 * 1000; // 100ms TaskState state_; @@ -187,22 +187,22 @@ class ObRSBuildIndexTask : public share::ObIDDLTask { }; class ObRSBuildIndexScheduler { - public: +public: static const int64_t DEFAULT_THREAD_CNT = 1; - public: +public: int init(ObDDLService* ddl_service); static ObRSBuildIndexScheduler& get_instance(); int push_task(ObRSBuildIndexTask& task); void destroy(); - private: +private: ObRSBuildIndexScheduler(); virtual ~ObRSBuildIndexScheduler(); void stop(); void wait(); - private: +private: static const int64_t DEFAULT_BUCKET_NUM = 10000; bool is_inited_; share::ObDDLTaskExecutor task_executor_; @@ -211,7 +211,7 @@ class ObRSBuildIndexScheduler { }; class ObIndexBuilder { - public: +public: explicit ObIndexBuilder(ObDDLService& ddl_service); virtual ~ObIndexBuilder(); @@ -232,10 +232,10 @@ class ObIndexBuilder { int submit_build_global_index_task(const share::schema::ObTableSchema& index_schema); int submit_build_local_index_task(const share::schema::ObTableSchema& index_schema); - private: +private: typedef common::ObArray > OrderFTColumns; class FulltextColumnOrder { - public: + public: FulltextColumnOrder() {} ~FulltextColumnOrder() @@ -259,10 +259,10 @@ class ObIndexBuilder { int update_local_index_status(const volatile bool& stop, const int64_t merged_version, const uint64_t index_table_id); - private: +private: ObDDLService& ddl_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIndexBuilder); }; } // end namespace rootserver diff --git a/src/rootserver/ob_inner_table_monitor.h b/src/rootserver/ob_inner_table_monitor.h index 509236391..68f1a61c9 100644 --- a/src/rootserver/ob_inner_table_monitor.h +++ b/src/rootserver/ob_inner_table_monitor.h @@ -28,13 +28,13 @@ class ObCommonRpcProxy; namespace rootserver { class ObRootService; class ObInnerTableMonitor { - public: +public: ObInnerTableMonitor(); ~ObInnerTableMonitor() = default; int init(common::ObMySQLProxy& sql_proxy, obrpc::ObCommonRpcProxy& rpc_proxy, ObRootService& root_service); int purge_inner_table_history(); - private: +private: const static int N_PARTITION_FOR_COLUMN_HISTORY = 16; const static int N_PARTITION_FOR_TABLE_HISTORY = 16; const static int N_PARTITION_FOR_TABLEGROUP_HISTORY = 16; @@ -46,7 +46,7 @@ class ObInnerTableMonitor { const static int N_PARTITION_FOR_DATABASE_PRIVILEGE_HISTORY = 16; const static int N_PARTITION_FOR_DDL_OPERATION = 1; - private: +private: int check_inner_stat() const; int get_all_tenants_from_stats(common::ObIArray& tenant_ids); @@ -66,7 +66,7 @@ class ObInnerTableMonitor { int check_cancel() const; - private: +private: bool inited_; obrpc::ObCommonRpcProxy* rs_proxy_; common::ObMySQLProxy* sql_proxy_; diff --git a/src/rootserver/ob_leader_coordinator.h b/src/rootserver/ob_leader_coordinator.h index 97bd58083..a6195f010 100644 --- a/src/rootserver/ob_leader_coordinator.h +++ b/src/rootserver/ob_leader_coordinator.h @@ -64,7 +64,7 @@ class ITenantStatFinder; } // namespace balancer class ObRandomZoneSelector { - public: +public: const static int64_t DEFAULT_ZONE_CNT = 7; int init(ObZoneManager& zone_mgr); int update_score(const uint64_t tg_id, const int64_t partition_id); @@ -75,12 +75,12 @@ class ObRandomZoneSelector { return !zones_.empty(); } - private: +private: common::ObSEArray, DEFAULT_ZONE_CNT> zones_; }; class ObILeaderCoordinator { - public: +public: struct ServerLeaderCount { ServerLeaderCount() : server_(), count_(0) {} @@ -128,7 +128,7 @@ class ObILeaderCoordinator { }; class ObServerSwitchLeaderInfoStat { - public: +public: static const int64_t ALL_SWITCH_PERCENT = 100; static const int64_t MIN_SWITCH_TIMEOUT = 5 * 60 * 1000 * 1000; // 5m static const int64_t MIN_SWITCH_INTERVAL = 1 * 1000 * 1000; // 1s @@ -194,7 +194,7 @@ class ObServerSwitchLeaderInfoStat { } int check_smooth_switch_condition(common::ObIArray& candidate_leaders, bool& can_swith_more); - private: +private: virtual int get_server_partition_count(common::ObAddr& server, int64_t& partition_count); virtual int prepare_next_smooth_turn(const volatile bool& is_stop, const common::ObIArray& server_list, const int64_t switch_duration_time, const int64_t now); @@ -211,7 +211,7 @@ class ObServerSwitchLeaderInfoStat { }; class ObLeaderCoordinatorIdling : public ObThreadIdling { - public: +public: explicit ObLeaderCoordinatorIdling(volatile bool& stop) : ObThreadIdling(stop), idle_interval_us_(0) {} virtual ~ObLeaderCoordinatorIdling() @@ -226,25 +226,25 @@ class ObLeaderCoordinatorIdling : public ObThreadIdling { idle_interval_us_ = idle_interval_us; } - private: +private: int64_t idle_interval_us_; }; class ObLeaderCoordinator; class PartitionInfoContainer { - public: +public: typedef common::hash::ObHashMap PartitionInfoMap; const int64_t PART_INFO_MAP_SIZE = 1024 * 1024; - public: +public: PartitionInfoContainer() : host_(nullptr), partition_info_map_(), pt_operator_(NULL), schema_service_(NULL), is_inited_(false) {} ~PartitionInfoContainer() {} // no one shall derive from this class - public: +public: int init(share::ObPartitionTableOperator* pt_operator, share::schema::ObMultiVersionSchemaService* schema_service, ObLeaderCoordinator* host); int build_tenant_partition_info(const uint64_t tenant_id); @@ -252,7 +252,7 @@ class PartitionInfoContainer { const uint64_t tenant_id, const uint64_t partition_entity_id, const int64_t partition_id); int get(const uint64_t table_id, const int64_t phy_partition_id, const share::ObPartitionInfo*& partition_info); - private: +private: ObLeaderCoordinator* host_; PartitionInfoMap partition_info_map_; share::ObPartitionTableOperator* pt_operator_; @@ -265,7 +265,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr friend class ObAllVirtualLeaderStat; friend class PartitionInfoContainer; - public: +public: static const int64_t WAIT_SWITCH_LEADER_TIMEOUT = 16 * 1000 * 1000; // 16s static const int64_t ALL_PARTITIONS = -1; @@ -340,7 +340,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr common::ObIArray& zone_score_array, common::ObIArray& region_score_array) const; - private: +private: enum LastSwitchTurnStat { LAST_SWITCH_TURN_SUCCEED = 0, LAST_SWITCH_TURN_FAILED = 1, @@ -363,13 +363,13 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; class IPartitionEntity { - public: + public: IPartitionEntity() {} virtual ~IPartitionEntity() {} - public: + public: virtual bool has_self_partition() const = 0; virtual uint64_t get_partition_entity_id() const = 0; virtual uint64_t get_tablegroup_id() const = 0; @@ -378,31 +378,31 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; class TablegroupEntity : public IPartitionEntity { - public: + public: TablegroupEntity(const share::schema::ObSimpleTablegroupSchema& tg_schema) : IPartitionEntity(), tg_schema_(tg_schema) {} virtual ~TablegroupEntity() {} - public: + public: virtual bool has_self_partition() const override; virtual uint64_t get_partition_entity_id() const override; virtual uint64_t get_tablegroup_id() const override; - private: + private: const share::schema::ObSimpleTablegroupSchema& tg_schema_; }; class SATableEntity : public IPartitionEntity { - public: + public: SATableEntity(const share::schema::ObSimpleTableSchemaV2& table_schema) : IPartitionEntity(), table_schema_(table_schema) {} virtual ~SATableEntity() {} - public: + public: virtual bool has_self_partition() const override { return table_schema_.has_self_partition(); @@ -416,12 +416,12 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr return table_schema_.get_tablegroup_id(); } - private: + private: const share::schema::ObSimpleTableSchemaV2& table_schema_; }; struct Partition { - public: + public: typedef common::ObSEArray ServerList; typedef common::ObSEArray CandidateStatusList; Partition() : table_id_(0), tg_id_(0), info_(nullptr), candidates_(), prep_candidates_(), candidate_status_array_() @@ -445,12 +445,12 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr CandidateStatusList candidate_status_array_; TO_STRING_KV(K_(table_id), K_(tg_id), K_(info), K_(candidates), K_(prep_candidates), K_(candidate_status_array)); - private: + private: DISALLOW_COPY_AND_ASSIGN(Partition); }; class PartitionArray : public common::ObFixedArrayImpl { - public: + public: PartitionArray(common::ObIAllocator& allocator) : common::ObFixedArrayImpl(allocator), primary_zone_(), @@ -460,7 +460,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr {} ~PartitionArray() {} // no one shall derive from this - public: + public: inline void set_primary_zone(const ObZone& zone) { primary_zone_ = zone; @@ -494,7 +494,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr return advised_leader_; } - private: + private: common::ObZone primary_zone_; uint64_t tablegroup_id_; int64_t anchor_pos_; @@ -584,7 +584,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; struct ServerReplicaCounter { - public: + public: ServerReplicaCounter() : full_replica_cnt_(0), leader_cnt_(0), zone_() {} @@ -596,7 +596,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; struct ZoneReplicaCounter { - public: + public: ZoneReplicaCounter() : max_full_replica_cnt_(0), // The maximum number of full replicas on the server in the zone @@ -642,17 +642,17 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; class ServerReplicaMsgContainer { - public: + public: typedef common::hash::ObHashMap ServerReplicaCounterMap; typedef common::hash::ObHashMap ZoneReplicaCounterMap; - public: + public: ServerReplicaMsgContainer(common::ObIAllocator& allocator, ObLeaderCoordinator& host); virtual ~ServerReplicaMsgContainer(); - public: + public: int init(const int64_t pg_cnt); int check_and_build_available_zones_and_servers(const int64_t balance_group_id, const common::ObIArray& primary_zone_array, const common::ObIArray& tenant_unit, @@ -693,7 +693,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr return zone_replica_counter_map_; } - private: + private: int check_and_build_available_servers( const int64_t balance_group_id, const common::ObIArray& tenant_unit, bool& need_balance); int check_and_build_available_zones(const int64_t balance_group_id, @@ -704,7 +704,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr bool& need_balance); void destroy_and_free_server_leader_msg(ObServerLeaderMsg* msg); - private: + private: common::ObIAllocator& inner_allocator_; ObLeaderCoordinator& host_; ObAllServerLeaderMsg server_leader_info_; @@ -717,16 +717,16 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; class LcBalanceGroupContainer : public balancer::ObLeaderBalanceGroupContainer { - public: + public: typedef common::hash::ObHashMap LcBgInfoMap; typedef common::hash::ObHashMap PkeyIndexMap; - public: + public: LcBalanceGroupContainer(ObLeaderCoordinator& host, share::schema::ObSchemaGetterGuard& schema_guard, balancer::ITenantStatFinder& stat_finder, common::ObIAllocator& allocator); virtual ~LcBalanceGroupContainer(); - public: + public: int init(const uint64_t tenant_id); int build_base_info(); int collect_balance_group_array_index(const common::ObIArray& tenant_partition); @@ -736,7 +736,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr int generate_leader_balance_plan(ServerReplicaMsgContainer& server_replica_msg_container, LcBalanceGroupInfo& bg_info, const common::ObIArray& tenant_partition); - private: + private: int build_valid_zone_locality_map(const common::ObIArray& primary_zone_array, const common::ObIArray& zone_locality, common::hash::ObHashMap& map); @@ -763,7 +763,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr int get_need_balance_addr( ObAllServerLeaderMsg& server_leader_info, ObIArray& addr_arr, int64_t& total_partition_cnt); - private: + private: const int64_t BG_INFO_MAP_SIZE = 1024L * 1024L; ObLeaderCoordinator& host_; common::hash::ObHashMap bg_info_map_; @@ -776,7 +776,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; class NewLeaderStrategy { - public: + public: NewLeaderStrategy(ObIAllocator& allocator, ObAllServerLeaderMsg& all_server_leader_msg, ObAllPartitionSwitchMsg& all_part_switch_msg, ServerReplicaMsgContainer::ServerReplicaCounterMap& server_replica_counter_map, @@ -784,11 +784,11 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr virtual ~NewLeaderStrategy(); - public: + public: virtual int execute(); int init(); - private: + private: int get_sorted_server(ObIArray& server_arr); int switch_to_exp_max_leader(const ObIArray& server_arr); int execute_new_leader_strategy(const common::ObAddr& addr, const bool to_max_exp_leader, bool& is_balance); @@ -830,7 +830,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr int do_map_reuse(const ObAddr& addr, ObSerMapInfo& map_info); int all_map_reuse(); - private: + private: ObIAllocator& allocator_; ObAllServerLeaderMsg& all_server_leader_msg_; // all server ObAllPartitionSwitchMsg& all_part_switch_msg_; @@ -847,13 +847,13 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; class WaitElectionCycleIdling : public ObThreadIdling { - public: + public: explicit WaitElectionCycleIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual ~WaitElectionCycleIdling() {} - public: + public: static const int64_t ELECTION_CYCLE = 1500000; // 1.5s virtual int64_t get_idle_interval_us() { @@ -862,11 +862,11 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; class ExpectedLeaderWaitOperator { - public: + public: typedef common::hash::ObHashMap ServerLeaderCounter; static const int64_t MAX_SERVER_CNT = 256; - public: + public: ExpectedLeaderWaitOperator(share::ObPartitionTableOperator& pt_operator, common::ObMySQLProxy& mysql_proxy, volatile bool& stop, ObLeaderCoordinator& host) : sys_leader_waiter_(pt_operator, stop), @@ -885,7 +885,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr virtual ~ExpectedLeaderWaitOperator() {} - public: + public: int init(const uint64_t tenant_id); int check_can_switch_more_leader( const common::ObAddr& new_leader, const common::ObAddr& old_leader, bool& can_switch); @@ -897,17 +897,17 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr share::ObLeaderElectionWaiter::ExpectedLeader& expected_leader, const bool is_sys_tg_partition); int get_wait_ret() const; - private: + private: int64_t generate_wait_leader_timeout(const bool is_sys); - private: + private: static const int64_t WAIT_LEADER_US_PER_PARTITION = 10 * 1000; // 10ms int get_non_sys_part_leader_cnt(const common::ObIArray& zones, int64_t& leader_cnt); int do_get_non_sys_part_leader_cnt( const uint64_t sql_tenant_id, const common::ObIArray& zones, int64_t& leader_cnt); int do_wait(); - private: + private: share::ObLeaderElectionWaiter sys_leader_waiter_; share::ObUserPartitionLeaderWaiter user_leader_waiter_; common::ObArray sys_tg_expected_leaders_; @@ -921,11 +921,11 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr ObLeaderCoordinator& host_; int wait_ret_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ExpectedLeaderWaitOperator); }; class GetLeaderCandidatesAsyncV2Operator { - public: + public: struct PartIndex { PartIndex() : first_level_idx_(-1), second_level_idx_(-1) {} @@ -959,7 +959,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr typedef common::ObArray PartIndexArray; typedef common::hash::ObHashMap IndexMap; - public: + public: GetLeaderCandidatesAsyncV2Operator( obrpc::ObSrvRpcProxy& rpc_proxy, const AsyncRpcFunc& async_rpc_func, common::ObServerConfig& config) : allocator_(ObModIds::OB_RS_LEADER_COORDINATOR_PA), @@ -973,7 +973,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr {} ~GetLeaderCandidatesAsyncV2Operator() {} // no one will derive from this class - public: + public: int init(); void clear_after_wait(); bool reach_accumulate_threshold(const PartIndexInfo& info) const; @@ -997,7 +997,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr int wait(); int fill_partitions_leader_candidates(common::ObIArray& partition_arrays); - private: + private: static const int64_t MAX_CANDIDATE_INFO_ARRAY_SIZE = 1024; static const int64_t ACCUMULATE_THRESHOLD = 1024; // batch process threshold static const int64_t SEND_TO_WAIT_THRESHOLD = 32; // cnt of send_requests() before wait() @@ -1008,7 +1008,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr static const int64_t MIN_RPC_TIMEOUT = 2L * 1000000L; static const int64_t MAX_RPC_TIMEOUT = 180L * 1000000L; - private: + private: common::ObArenaAllocator allocator_; ObGetLeaderCandidatesAsyncProxyV2 async_proxy_; // max count 1024 @@ -1024,7 +1024,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr typedef int (obrpc::ObSrvRpcProxy::*AsyncRpcFunc)(const obrpc::ObSwitchLeaderListArg&, obrpc::ObSrvRpcProxy::AsyncCB*, const obrpc::ObRpcOpts&); - public: + public: SwitchLeaderListAsyncOperator( obrpc::ObSrvRpcProxy& rpc_proxy, const AsyncRpcFunc& async_rpc_func, common::ObServerConfig& config) : async_proxy_(rpc_proxy, async_rpc_func), @@ -1037,7 +1037,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr {} ~SwitchLeaderListAsyncOperator() {} // no one will derive from this class - public: + public: void reuse(); bool reach_accumulate_threshold() const; bool reach_send_to_wait_threshold() const; @@ -1070,12 +1070,12 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr saved_new_leader_ = leader; } - private: + private: static const int64_t ACCUMULATE_THRESHOLD = 128; // batch process threshold static const int64_t SEND_TO_WAIT_THRESHOLD = 4; // cnt of send_requests() before wait() static const int64_t RPC_TIMEOUT = 9L * 1000000L; - private: + private: ObSwitchLeaderListAsyncProxy async_proxy_; obrpc::ObSwitchLeaderListArg arg_; common::ObArray is_sys_tg_partitions_; @@ -1085,7 +1085,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr common::ObAddr saved_new_leader_; }; struct CandidateZoneInfo { - public: + public: CandidateZoneInfo() : zone_(), region_score_(INT64_MAX), candidate_count_(0) {} TO_STRING_KV(K_(zone), K_(region_score), K_(candidate_count)); @@ -1134,21 +1134,21 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; class ChooseLeaderCmp { - public: + public: ChooseLeaderCmp(const uint64_t tenant_id, const uint64_t tablegroup_id) : tenant_id_(tenant_id), tablegroup_id_(tablegroup_id), ret_(common::OB_SUCCESS) {} ~ChooseLeaderCmp() {} - public: + public: bool operator()(const CandidateLeaderInfo& left, const CandidateLeaderInfo& right); int get_ret() const { return ret_; } - public: + public: bool cmp_region_score(const CandidateLeaderInfo& left, const CandidateLeaderInfo& right); bool cmp_not_merging(const CandidateLeaderInfo& left, const CandidateLeaderInfo& right); bool cmp_start_service(const CandidateLeaderInfo& left, const CandidateLeaderInfo& right); @@ -1163,20 +1163,20 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr bool cmp_random_score(const CandidateLeaderInfo& left, const CandidateLeaderInfo& right); bool cmp_server_addr(const CandidateLeaderInfo& left, const CandidateLeaderInfo& right); - private: + private: const uint64_t tenant_id_; const uint64_t tablegroup_id_; int ret_; }; struct CandidateZoneInfoCmp { - public: + public: CandidateZoneInfoCmp() : ret_(common::OB_SUCCESS) {} ~CandidateZoneInfoCmp() {} - public: + public: bool operator()(const CandidateZoneInfo& left, const CandidateZoneInfo& right); int get_ret() { @@ -1184,10 +1184,10 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr } bool same_level(const CandidateZoneInfo& left, const CandidateZoneInfo& right); - private: + private: int64_t cmp_candidate_cnt(const int64_t left_cnt, const int64_t right_cnt); - private: + private: int ret_; }; @@ -1227,16 +1227,16 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr bool ignore_switch_percent_; }; struct CursorContainer { - public: + public: CursorContainer() : cursor_array_() {} virtual ~CursorContainer() {} - public: + public: int reorganize(); - public: + public: TO_STRING_KV(K(cursor_array_)); common::ObArray cursor_array_; }; @@ -1266,18 +1266,18 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr typedef common::hash::ObHashMap RawLeaderInfoMap; class CandidateLeaderInfoMap : public RawLeaderInfoMap { - public: + public: CandidateLeaderInfoMap(ObLeaderCoordinator& host) : host_(host) {} - public: + public: int locate_candidate_leader_info(const common::ObAddr& advised_leader, const share::ObPartitionReplica& replica, const common::ObIArray& zone_score, const common::ObIArray& region_score, const ObRandomZoneSelector& random_selector, const ObZoneList& excluded_zones, const common::ObIArray& excluded_servers, CandidateLeaderInfo& candidate_leader_info); - private: + private: int build_candidate_basic_statistic(const common::ObAddr& server_addr, const common::ObAddr& advised_leader, const common::ObIArray& zone_score, const common::ObIArray& region_score, @@ -1294,17 +1294,17 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr int build_candidate_balance_group_score( const common::ObAddr& server_addr, const common::ObAddr& advised_leader, CandidateLeaderInfo& info); - private: + private: ObLeaderCoordinator& host_; }; typedef common::hash::ObHashMap ZoneCandidateCountMap; typedef common::hash::ObHashMap RawZoneMigrateCountMap; class ZoneMigrateCountMap : public RawZoneMigrateCountMap { - public: + public: ZoneMigrateCountMap() : RawZoneMigrateCountMap() {} - public: + public: int locate(const common::ObZone& zone, int64_t& count); }; typedef CandidateLeaderInfoMap::iterator leader_info_iter; @@ -1315,7 +1315,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr typedef CandidateZoneInfoMap::const_iterator const_zone_info_iter; typedef common::ObArray TenantUnit; class SwitchLeaderStrategy { - public: + public: SwitchLeaderStrategy(ObLeaderCoordinator& leader_coordinator, common::ObArray& partition_arrays, CursorContainer& cursor_container) : host_(leader_coordinator), partition_arrays_(partition_arrays), cursor_container_(cursor_container) @@ -1323,11 +1323,11 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr virtual ~SwitchLeaderStrategy() {} - public: + public: virtual int execute( TenantUnit& tenant_unit, ExpectedLeaderWaitOperator& leader_wait_operator, const bool force) = 0; - protected: + protected: int coordinate_partitions_per_tg(TenantUnit& tenant_unit, PartitionArray& partition_array, PartitionArrayCursor& cursor, const bool force, ExpectedLeaderWaitOperator& leader_wait_operator, SwitchLeaderListAsyncOperator& async_rpc_operator, bool& do_switch_leader); @@ -1336,7 +1336,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr bool& need_switch); int check_tenant_on_server(const TenantUnit& tenant_unit, const common::ObAddr& server, bool& tenant_on_server); - protected: + protected: ObLeaderCoordinator& host_; common::ObArray& partition_arrays_; CursorContainer& cursor_container_; @@ -1371,7 +1371,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr }; typedef common::hash::ObHashMap CursorQueueMap; - public: + public: ConcurrentSwitchLeaderStrategy(ObLeaderCoordinator& leader_coordinator, common::ObArray& partition_arrays, CursorContainer& cursor_container) : SwitchLeaderStrategy(leader_coordinator, partition_arrays, cursor_container), @@ -1381,10 +1381,10 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr virtual ~ConcurrentSwitchLeaderStrategy() {} - public: + public: virtual int execute(TenantUnit& tenant_unit, ExpectedLeaderWaitOperator& leader_wait_operator, const bool force); - private: + private: int init_cursor_queue_map(); int get_next_cursor_link(ExpectedLeaderWaitOperator& leader_wait_operator, CursorLink*& cursor_link, LinkType& link_type, bool& no_leader_pa); @@ -1394,7 +1394,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr bool is_switch_finished(); int try_reconnect_cursor_queue(CursorLink* cursor_link, const LinkType link_type); - private: + private: CursorQueueMap cursor_queue_map_; common::ObArenaAllocator link_node_allocator_; }; @@ -1545,7 +1545,7 @@ class ObLeaderCoordinator : public ObILeaderCoordinator, public ObRsReentrantThr const CandidateZoneInfoMap& candidate_zone_map, const common::ObIArray& zone_list, common::ObIArray& results); - private: +private: bool inited_; share::ObPartitionTableOperator* pt_operator_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/ob_locality_checker.h b/src/rootserver/ob_locality_checker.h index 517b54143..66f66f781 100644 --- a/src/rootserver/ob_locality_checker.h +++ b/src/rootserver/ob_locality_checker.h @@ -38,7 +38,7 @@ class ObReplicaTypeTransformUtility; class ObServerManager; class ObLeaderCoordinator; class ObLocalityChecker { - public: +public: explicit ObLocalityChecker(); virtual ~ObLocalityChecker(); int init(share::schema::ObMultiVersionSchemaService& schema_service, TenantBalanceStat& tenant_stat, @@ -53,10 +53,10 @@ class ObLocalityChecker { int get_filter_result( const balancer::HashIndexCollection& hash_index_collection, common::ObIArray& results); - private: +private: static const int64_t MAX_BATCH_TYPE_TRANSFORM_COUNT = 128; - private: +private: void reset(); int check_partition_locality_for_modify_quorum(const balancer::HashIndexCollection& hash_index_collection, @@ -111,10 +111,10 @@ class ObLocalityChecker { common::ObIArray& leader_addr_array, const ObTypeTransformTaskInfo& task_info, const Partition* cur_partition, const Replica& cur_replica, const ObReplicaType dst_type, int64_t& task_cnt); - private: +private: static const int64_t DEFAULT_ZONE_CNT = 7; - private: +private: bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; TenantBalanceStat* tenant_stat_; diff --git a/src/rootserver/ob_locality_util.h b/src/rootserver/ob_locality_util.h index 2df20932f..49a6cc0d1 100644 --- a/src/rootserver/ob_locality_util.h +++ b/src/rootserver/ob_locality_util.h @@ -49,7 +49,7 @@ namespace rootserver { * b flush table/tablegroup/table schema locally */ class ObLocalityDistribution { - public: +public: ObLocalityDistribution() : zone_set_replica_dist_array_(), is_inited_(false), can_output_normalized_locality_(false) { reset(); @@ -57,7 +57,7 @@ class ObLocalityDistribution { virtual ~ObLocalityDistribution() {} - public: +public: int init(); void reset(); int parse_multiple_zone(const common::ObString& locality, const common::ObIArray& zone_list, @@ -74,17 +74,17 @@ class ObLocalityDistribution { int get_zone_replica_num(const common::ObZone& zone, share::ObReplicaNumSet& replica_num_set); int get_zone_replica_num(const common::ObZone& zone, share::ObZoneReplicaAttrSet& zone_replica_num_set); - public: +public: static const int64_t ALL_SERVER_CNT = INT64_MAX; - private: +private: typedef int32_t ReplicaTypeID; static const int32_t FULL_REPLICA = 0; static const int32_t LOGONLY_REPLICA = 1; static const int32_t READONLY_REPLICA = 2; static const int32_t REPLICA_TYPE_MAX = 3; - private: +private: static const int64_t MAX_BUCKET_NUM = 2 * common::MAX_ZONE_NUM; static const int64_t INVALID_CURSOR = -1; static const int64_t INVALID_COUNT = -1; @@ -103,21 +103,21 @@ class ObLocalityDistribution { static const int64_t MAX_MEMSTORE_PERCENT = 100; - private: +private: // use to save the replica distribution for zone set // zone set is accumulated using a zone array zone_set_ class ZoneSetReplicaDist { - public: + public: bool operator<(const ZoneSetReplicaDist& that); - public: + public: ZoneSetReplicaDist() : zone_set_(), all_replica_attr_array_() { reset(); } ~ZoneSetReplicaDist() {} // no one shall derive from this - public: + public: typedef common::ObSEArray ReplicaAttrArray; int assign(const ZoneSetReplicaDist& that); void reset(); @@ -162,7 +162,7 @@ class ObLocalityDistribution { return zone_set_; } - public: + public: int format_to_locality_str(char* buf, int64_t buf_len, int64_t& pos) const; bool need_format_to_locality_str() const; int try_set_specific_replica_dist( @@ -173,14 +173,14 @@ class ObLocalityDistribution { "logonly_replica_attr", all_replica_attr_array_[LOGONLY_REPLICA], "readonly_replica_attr", all_replica_attr_array_[READONLY_REPLICA]); - private: + private: bool specific_replica_need_format(const ReplicaTypeID replica_type) const; int replica_type_to_str(const ReplicaTypeID replica_type, const char*& replica_type_str) const; int format_specific_replica( const ReplicaTypeID replica_type, char* buf, int64_t buf_len, int64_t& pos, bool& start_format) const; int format_zone_set(char* buf, int64_t buf_len, int64_t& pos) const; - private: + private: // zone_set_ is a array with the maximum elements of seven common::ObSEArray zone_set_; ReplicaAttrArray all_replica_attr_array_[REPLICA_TYPE_MAX]; @@ -188,17 +188,17 @@ class ObLocalityDistribution { class RawLocalityIter { // we call "F{2},L@zone1" a sub_locality of the locality "F{2},L@zone1, F{1},L{1}@zone2" // and we call 'F{2}' a replica_arrangement of the sub_locality - public: + public: RawLocalityIter(const common::ObString& locality) : locality_(locality), locality_str_(), locality_str_len_(0), pos_(0), output_cnt_(0) {} ~RawLocalityIter() {} // no one shall derive from this - public: + public: int init(); int get_next_zone_set_replica_dist(ZoneSetReplicaDist& zone_replica_dist); - private: + private: static const char AT_TOKEN = '@'; static const char BLANK_TOKEN = ' '; static const char LEFT_BRACE_TOKEN = '{'; @@ -209,7 +209,7 @@ class ObLocalityDistribution { static const char LEFT_BRACKET_TOKEN = '['; static const char RIGHT_BRACKET_TOKEN = ']'; - private: + private: void jump_over_blanks(int64_t& cursor, int64_t end); void inc_cursor(int64_t& cursor); int check_iter_end(int64_t pre_pos); @@ -233,7 +233,7 @@ class ObLocalityDistribution { int get_zone_set_without_bracket(int64_t& cursor, const int64_t end, ZoneSetReplicaDist& zone_set_replica_dist); int get_single_zone_name(int64_t& cursor, const int64_t end, ZoneSetReplicaDist& zone_set_replica_dist); - private: + private: const common::ObString& locality_; char locality_str_[common::MAX_LOCALITY_LENGTH + 1]; int64_t locality_str_len_; @@ -241,7 +241,7 @@ class ObLocalityDistribution { int64_t output_cnt_; }; - private: +private: int check_zone_set_legal(const common::ObIArray& zone_set, const common::ObIArray& zone_list, bool& is_legal); int check_zone_name_duplicate(const ZoneSetReplicaDist& zone_set_replica_dist, @@ -253,7 +253,7 @@ class ObLocalityDistribution { int convert_zone_list( const common::ObIArray& zone_list_input, common::ObIArray& zone_list_output); - private: +private: common::ObArray zone_set_replica_dist_array_; bool is_inited_; bool can_output_normalized_locality_; diff --git a/src/rootserver/ob_log_archive_scheduler.h b/src/rootserver/ob_log_archive_scheduler.h index fa3d283d7..ed59974ca 100644 --- a/src/rootserver/ob_log_archive_scheduler.h +++ b/src/rootserver/ob_log_archive_scheduler.h @@ -41,20 +41,20 @@ class ObServerManager; class ObLeaderCoordinator; class ObLogArchiveThreadIdling final : public ObThreadIdling { - public: +public: explicit ObLogArchiveThreadIdling(volatile bool& stop); const int64_t DEFAULT_IDLE_INTERVAL_US = 10 * 1000 * 1000; // 10s const int64_t MAX_IDLE_INTERVAL_US = 10 * 1000 * 1000; // 60s virtual int64_t get_idle_interval_us(); void set_log_archive_checkpoint_interval(const int64_t interval_us); - private: +private: int64_t idle_time_us_; DISALLOW_COPY_AND_ASSIGN(ObLogArchiveThreadIdling); }; class ObLogArchiveScheduler final : public ObRsReentrantThread, public ObIBackupScheduler { - public: +public: const int64_t OB_START_LOG_ARCHIVE_ROUND = 0; ObLogArchiveScheduler(); @@ -69,11 +69,17 @@ class ObLogArchiveScheduler final : public ObRsReentrantThread, public ObIBackup int handle_enable_log_archive(const bool is_enable); virtual void run3() override; - virtual int blocking_run() override { BLOCKING_RUN_IMPLEMENT(); } + virtual int blocking_run() override + { + BLOCKING_RUN_IMPLEMENT(); + } int start() override; - virtual bool is_working() const override { return is_working_; } + virtual bool is_working() const override + { + return is_working_; + } - private: +private: void cleanup_(); int handle_stop_log_archive_(); int handle_start_log_archive_(); @@ -115,7 +121,7 @@ class ObLogArchiveScheduler final : public ObRsReentrantThread, public ObIBackup int check_can_do_work_(); int check_mount_file_(share::ObLogArchiveBackupInfo& sys_info); - private: +private: bool is_inited_; mutable ObLogArchiveThreadIdling idling_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/ob_lost_replica_checker.h b/src/rootserver/ob_lost_replica_checker.h index 710f65ae4..c0b4077da 100644 --- a/src/rootserver/ob_lost_replica_checker.h +++ b/src/rootserver/ob_lost_replica_checker.h @@ -30,7 +30,7 @@ namespace rootserver { class ObServerManager; class ObLostReplicaChecker { - public: +public: ObLostReplicaChecker(); virtual ~ObLostReplicaChecker(); @@ -38,7 +38,7 @@ class ObLostReplicaChecker { share::schema::ObMultiVersionSchemaService& schema_service); int check_lost_replicas(); - private: +private: int check_lost_replica_by_pt(uint64_t pt_table_id, int64_t pt_partition_id); // (server lost and not in member list) or (server lost and not in schema) int check_lost_replica(const share::ObPartitionInfo& partition_info, const share::ObPartitionReplica& replica, @@ -47,13 +47,13 @@ class ObLostReplicaChecker { int check_cancel(); int delete_pg_partition_meta_table_item_(const uint64_t tg_id, const common::ObAddr& svr_ip); - private: +private: bool inited_; ObServerManager* server_manager_; share::ObPartitionTableOperator* pt_operator_; share::schema::ObMultiVersionSchemaService* schema_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLostReplicaChecker); }; } // end namespace rootserver diff --git a/src/rootserver/ob_major_freeze_launcher.h b/src/rootserver/ob_major_freeze_launcher.h index 084bbda09..78b04ef51 100644 --- a/src/rootserver/ob_major_freeze_launcher.h +++ b/src/rootserver/ob_major_freeze_launcher.h @@ -29,7 +29,7 @@ namespace rootserver { class ObRootService; class ObFreezeInfoManager; class ObMajorFreezeLauncher : public ObRsReentrantThread { - public: +public: ObMajorFreezeLauncher(); virtual ~ObMajorFreezeLauncher(); int init(ObRootService& root_service, obrpc::ObCommonRpcProxy& rpc_proxy, common::ObServerConfig& config, @@ -41,7 +41,7 @@ class ObMajorFreezeLauncher : public ObRsReentrantThread { } int64_t get_schedule_interval() const; - private: +private: static const int64_t TRY_LAUNCH_MAJOR_FREEZE_INTERVAL_US = 1000 * 1000; // 1s // daily major freeze will retry when error is OB_MAJOR_FREEZE_NOT_ALLOW. static const int64_t MAJOR_FREEZE_RETRY_LIMIT = 300; @@ -51,7 +51,7 @@ class ObMajorFreezeLauncher : public ObRsReentrantThread { int try_launch_major_freeze(); int try_gc_freeze_info(); - private: +private: bool inited_; ObRootService* root_service_; obrpc::ObCommonRpcProxy* rpc_proxy_; diff --git a/src/rootserver/ob_migrate_unit.h b/src/rootserver/ob_migrate_unit.h index 0c61420fc..a76da7831 100644 --- a/src/rootserver/ob_migrate_unit.h +++ b/src/rootserver/ob_migrate_unit.h @@ -23,7 +23,7 @@ class ObMigrateTaskInfo; struct TenantBalanceStat; class ObMigrateUnit { - public: +public: ObMigrateUnit(); virtual ~ObMigrateUnit() {} @@ -35,7 +35,7 @@ class ObMigrateUnit { // check unit migrate finish int unit_migrate_finish(int64_t& task_cnt); - private: +private: /* two return value: * 1 task_cnt: task count * 2 do_accumulated: try_accumulate_task_info has the semantic of trying to perform; @@ -45,7 +45,7 @@ class ObMigrateUnit { const ObMigrateTaskInfo& task_info, const Partition* cur_partition, const Replica* cur_replica, const Partition*& first_migrate_p, const Replica*& first_migrate_r, int64_t& task_cnt, bool& do_accumulated); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObMigrateUnit); // function members @@ -55,7 +55,7 @@ class ObMigrateUnit { return check_stop_provider_->check_stop(); } - private: +private: // data members bool inited_; ObUnitManager* unit_mgr_; diff --git a/src/rootserver/ob_partition_backup.h b/src/rootserver/ob_partition_backup.h index 4a4fd75b5..dd6754c1b 100644 --- a/src/rootserver/ob_partition_backup.h +++ b/src/rootserver/ob_partition_backup.h @@ -40,7 +40,7 @@ class ObZoneManager; class ObPartitionBackupProvider; class ObPartitionBackup { - public: +public: ObPartitionBackup(); virtual ~ObPartitionBackup() {} @@ -50,7 +50,7 @@ class ObPartitionBackup { share::ObCheckStopProvider& check_stop_provider); int partition_backup(int64_t& task_cnt, const uint64_t tenant_id); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObPartitionBackup); // function members @@ -73,7 +73,7 @@ class ObPartitionBackup { int cancel_pending_pg_tasks( const share::ObTenantBackupTaskInfo& task_info, const common::ObIArray& pg_tasks); - private: +private: // data members bool is_inited_; common::ObServerConfig* config_; @@ -92,7 +92,7 @@ class ObPartitionBackup { }; struct ObBackupElement { - public: +public: ObBackupElement(); virtual ~ObBackupElement() = default; void reset(); @@ -104,7 +104,7 @@ struct ObBackupElement { }; struct ObReplicaBackupElement { - public: +public: ObReplicaBackupElement(); virtual ~ObReplicaBackupElement() = default; int assign(const ObReplicaBackupElement& element); @@ -117,7 +117,7 @@ struct ObReplicaBackupElement { }; class ObPartitionBackupProvider { - public: +public: ObPartitionBackupProvider(); virtual ~ObPartitionBackupProvider() {} @@ -127,12 +127,12 @@ class ObPartitionBackupProvider { int prepare_choose_src(); int generate_batch_backup_task(const int64_t backup_task_id, common::ObIArray& backup_task); - private: +private: int inner_prepare_choose_src(); int build_physical_backup_arg(const int64_t backup_task_id, share::ObPhysicalBackupArg& arg); int check_can_become_dest(const ObBackupElement& element, bool& can_become); - private: +private: static const int64_t MAX_BUCKET_NUM = 10240; static const int64_t MAX_TASK_NUM = 1024; typedef hash::ObHashMap ReplicaElementMap; diff --git a/src/rootserver/ob_partition_balancer.h b/src/rootserver/ob_partition_balancer.h index 756845275..8ae78ca2f 100644 --- a/src/rootserver/ob_partition_balancer.h +++ b/src/rootserver/ob_partition_balancer.h @@ -37,14 +37,14 @@ class ObZoneManager; // The algorithm to balance the replicas in units of one tenant. class ObPartitionUnitProvider : public balancer::IUnitProvider { - public: +public: ObPartitionUnitProvider(const ZoneUnit& zone_unit, balancer::ITenantStatFinder& stat_finder) : zone_unit_(zone_unit), stat_finder_(stat_finder) {} virtual ~ObPartitionUnitProvider() {} - public: +public: virtual int find_unit(int64_t all_tg_idx, int64_t part_idx, uint64_t& unit_id) const; virtual int64_t count() const; virtual uint64_t get_unit_id(int64_t unit_idx) const; @@ -52,13 +52,13 @@ class ObPartitionUnitProvider : public balancer::IUnitProvider { virtual int get_unit_by_id(const uint64_t unit_id, UnitStat*& unit_stat) const; virtual int get_avg_load(double& avg_load) const; - private: +private: const ZoneUnit& zone_unit_; balancer::ITenantStatFinder& stat_finder_; }; class ObPartitionBalancer { - public: +public: ObPartitionBalancer(); virtual ~ObPartitionBalancer() {} @@ -70,7 +70,7 @@ class ObPartitionBalancer { // as possible, only considering the number of replicas int partition_balance(int64_t& task_cnt, const balancer::HashIndexCollection& hash_index_collection); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObPartitionBalancer); // function members @@ -83,7 +83,7 @@ class ObPartitionBalancer { return check_stop_provider_->check_stop(); } - private: +private: // data members bool inited_; common::ObServerConfig* config_; diff --git a/src/rootserver/ob_partition_count_balancer.h b/src/rootserver/ob_partition_count_balancer.h index 0af0bf918..5b4544f7e 100644 --- a/src/rootserver/ob_partition_count_balancer.h +++ b/src/rootserver/ob_partition_count_balancer.h @@ -26,7 +26,7 @@ namespace rootserver { namespace balancer { class IdMapBalancer { - public: +public: IdMapBalancer() {} virtual ~IdMapBalancer() @@ -35,10 +35,10 @@ class IdMapBalancer { }; class BalanceStat { - public: +public: static const double EPSILON; - public: +public: BalanceStat(SquareIdMap& map, IUnitProvider& unit) : map_(map), unit_(unit), row_unit_() {} virtual int init(); @@ -62,7 +62,7 @@ class BalanceStat { virtual const SquareIdMap::Item* end() = 0; TO_STRING_KV(K_(row_unit)); - protected: +protected: struct UnitCounter { UnitCounter() : unit_id_(common::OB_INVALID_ID), count_(0) {} @@ -77,14 +77,14 @@ class BalanceStat { int get_unit_cnt_value_if_move(const uint64_t left_unit_id, const uint64_t right_unit_id, double& new_left_cnt_value, double& new_right_cnt_value); - protected: +protected: SquareIdMap& map_; IUnitProvider& unit_; common::ObSEArray row_unit_; }; class RowBalanceStat : public BalanceStat { - public: +public: RowBalanceStat(SquareIdMap& map, IUnitProvider& unit, int64_t row_idx) : BalanceStat(map, unit), row_idx_(row_idx) {} virtual const SquareIdMap::Item* begin() @@ -97,12 +97,12 @@ class RowBalanceStat : public BalanceStat { } INHERIT_TO_STRING_KV("stat", BalanceStat, K_(row_idx)); - private: +private: int64_t row_idx_; }; class OverallBalanceStat : public BalanceStat { - public: +public: OverallBalanceStat(SquareIdMap& map, IUnitProvider& unit) : BalanceStat(map, unit) {} virtual const SquareIdMap::Item* begin() @@ -116,7 +116,7 @@ class OverallBalanceStat : public BalanceStat { }; class AverageCountBalancer : public IdMapBalancer { - public: +public: AverageCountBalancer(SquareIdMap& map, IUnitProvider& unit_provider) : map_(map), unit_(unit_provider) {} virtual ~AverageCountBalancer() @@ -125,11 +125,11 @@ class AverageCountBalancer : public IdMapBalancer { // Balance by number partition map virtual int balance() override; - private: +private: int one_row_balance(int64_t row_idx, bool& balanced); int overall_balance(bool& balanced); - protected: +protected: SquareIdMap& map_; IUnitProvider& unit_; }; diff --git a/src/rootserver/ob_partition_creator.h b/src/rootserver/ob_partition_creator.h index 589098778..2f785b2ff 100644 --- a/src/rootserver/ob_partition_creator.h +++ b/src/rootserver/ob_partition_creator.h @@ -31,7 +31,7 @@ namespace rootserver { class ObServerManager; // async create partition class ObPartitionCreator { - public: +public: typedef common::hash::ObHashMap DestArgMap; typedef common::hash::ObHashMap DestMemberArgMap; typedef common::hash::ObHashMap DestCountMap; @@ -83,7 +83,7 @@ class ObPartitionCreator { const int64_t member_cnt, common::ObReplicaType replica_type); int set_tenant_exist_partition_member_list(const uint64_t tenant_id, const int64_t quorum); - private: +private: int update_flag_replica(); int batch_update_flag_replica(); int batch_update_flag_replica(const int64_t begin, const int64_t end); @@ -135,7 +135,7 @@ class ObPartitionCreator { // create partition success, set member_list int send_set_member_list_rpc(); - private: +private: ObCreatePartitionProxy proxy_; share::ObPartitionTableOperator& pt_operator_; ObCreatePartitionBatchProxy proxy_batch_; diff --git a/src/rootserver/ob_partition_disk_balancer.h b/src/rootserver/ob_partition_disk_balancer.h index ae9c20d4a..da1c04d35 100644 --- a/src/rootserver/ob_partition_disk_balancer.h +++ b/src/rootserver/ob_partition_disk_balancer.h @@ -35,7 +35,7 @@ namespace rootserver { namespace balancer { class RowDiskBalanceStat { - public: +public: struct RowItemDiskStat { RowItemDiskStat(int64_t data_size) : key_(0), data_size_(data_size) {} @@ -56,7 +56,7 @@ class RowDiskBalanceStat { typedef RowItemDiskStat Stat; typedef common::hash::ObReferedMap UnitLoadMap; - public: +public: RowDiskBalanceStat(ITenantStatFinder& stat_finder, common::ObZone& zone, SquareIdMap& map, int64_t row_idx) : item_disk_info_(), total_load_(0), @@ -79,7 +79,7 @@ class RowDiskBalanceStat { int get_total_load(int64_t& load) const; TO_STRING_KV(K_(item_disk_info), K_(zone), K_(row_idx), K_(map)); - private: +private: common::ObSEArray item_disk_info_; Stat total_load_; UnitLoadMap unit_load_map_; @@ -90,7 +90,7 @@ class RowDiskBalanceStat { }; class UnitDiskBalanceStat { - public: +public: struct UnitItemDiskStat { UnitItemDiskStat(UnitStat* unit_stat) : key_(0), unit_stat_(unit_stat) {} @@ -111,7 +111,7 @@ class UnitDiskBalanceStat { typedef UnitItemDiskStat Stat; typedef common::hash::ObReferedMap UnitLoadMap; - public: +public: UnitDiskBalanceStat(IUnitProvider& unit_provider) : inited_(false), unit_provider_(unit_provider), unit_load_map_(), avg_load_(0) {} @@ -123,7 +123,7 @@ class UnitDiskBalanceStat { int get_max_min_load_unit(UnitStat*& max_u, UnitStat*& min_u); void debug_dump(); - private: +private: bool inited_; IUnitProvider& unit_provider_; UnitLoadMap unit_load_map_; @@ -132,7 +132,7 @@ class UnitDiskBalanceStat { // Dynamically adjust disk balance class DynamicAverageDiskBalancer : public IdMapBalancer { - public: +public: DynamicAverageDiskBalancer(SquareIdMap& map, ITenantStatFinder& stat_finder, IUnitProvider& unit_provider, common::ObZone& zone, share::schema::ObSchemaGetterGuard& schema_guard, const HashIndexCollection& hash_index_collection) @@ -147,7 +147,7 @@ class DynamicAverageDiskBalancer : public IdMapBalancer { virtual int balance() override; - private: +private: int one_row_balance( UnitDiskBalanceStat& unit_stat, UnitStat& max_u, UnitStat& min_u, int64_t row_idx, int64_t& task_cnt); int test_and_exchange(UnitDiskBalanceStat& unit_stat, UnitStat& max_u, UnitStat& min_u, RowDiskBalanceStat& row_stat, @@ -155,7 +155,7 @@ class DynamicAverageDiskBalancer : public IdMapBalancer { void exchange(SquareIdMap::Item& a, SquareIdMap::Item& b); int update_unit_stat(UnitDiskBalanceStat& unit_stat); - private: +private: SquareIdMap& map_; ITenantStatFinder& stat_finder_; UnitDiskBalanceStat unit_stat_; diff --git a/src/rootserver/ob_partition_group_coordinator.h b/src/rootserver/ob_partition_group_coordinator.h index ca70f523b..d93d61180 100644 --- a/src/rootserver/ob_partition_group_coordinator.h +++ b/src/rootserver/ob_partition_group_coordinator.h @@ -20,7 +20,7 @@ class ObRebalanceTaskMgr; class ObLocalityChecker; class TestPartitionGroupCoordinate; class ObPartitionGroupCoordinator { - public: +public: friend class TestPg_try_coordinate_primary_by_unit1_Test; friend class TestPg_try_coordinate_primary_by_unit2_Test; friend class TestPg_try_coordinate_primary_by_unit3_Test; @@ -42,9 +42,9 @@ class ObPartitionGroupCoordinator { // In each zone, replicas of the same partition group are migrated to the same unit int coordinate_pg_member(int64_t& task_cnt); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObPartitionGroupCoordinator); int prepare(); @@ -119,7 +119,7 @@ class ObPartitionGroupCoordinator { int normal_pg_member_coordinate( common::ObArray::iterator& p, Partition& primary_partition, int64_t& task_cnt); - private: +private: // data members bool inited_; ObRebalanceTaskMgr* task_mgr_; diff --git a/src/rootserver/ob_partition_leader_count_balancer.h b/src/rootserver/ob_partition_leader_count_balancer.h index 7ca0dcbce..afe00ae16 100644 --- a/src/rootserver/ob_partition_leader_count_balancer.h +++ b/src/rootserver/ob_partition_leader_count_balancer.h @@ -50,12 +50,12 @@ enum class BalanceTaskType : int64_t { }; class RowLeaderBalanceStat { - public: +public: RowLeaderBalanceStat(SquareIdMap& map, IUnitProvider& unit_provider, const int64_t row_idx) : map_(map), unit_(unit_provider), row_idx_(row_idx), row_unit_() {} - public: +public: int init(); int prepare_for_next(const BalanceReplicaType bry_type); int64_t get_unit_count() const @@ -72,7 +72,7 @@ class RowLeaderBalanceStat { } TO_STRING_KV(K_(row_idx), K_(row_unit)); - public: +public: struct UnitCounter { UnitCounter() : unit_id_(common::OB_INVALID_ID), accumulated_count_(0), current_count_(0) {} @@ -102,7 +102,7 @@ class RowLeaderBalanceStat { int update_task_count(const uint64_t from_unit_id, const uint64_t to_unit_id, const bool update_accumulated_task); int finish_this_curr_task_balance(); - protected: +protected: static const double EPSILON; SquareIdMap& map_; IUnitProvider& unit_; @@ -111,7 +111,7 @@ class RowLeaderBalanceStat { }; class PartitionLeaderCountBalancer : public IdMapBalancer { - public: +public: PartitionLeaderCountBalancer(SquareIdMap& map, IUnitProvider& unit_provider, common::ObZone& zone, share::schema::ObSchemaGetterGuard& schema_guard, balancer::ITenantStatFinder& stat_finder, const HashIndexCollection& hash_index_collection) @@ -126,10 +126,10 @@ class PartitionLeaderCountBalancer : public IdMapBalancer { virtual ~PartitionLeaderCountBalancer() {} - public: +public: virtual int balance() override; - private: +private: int do_update_map_item_replica_attributes(SquareIdMap::Item& item); int update_map_item_replica_attributes(); int intra_row_balance(); @@ -143,7 +143,7 @@ class PartitionLeaderCountBalancer : public IdMapBalancer { int accumulated_task_one_row_balance(const BalanceReplicaType balance_replica_type, const int64_t row_idx, RowLeaderBalanceStat& leader_balance_stat, bool& balance); - private: +private: SquareIdMap& map_; IUnitProvider& unit_provider_; common::ObZone zone_; diff --git a/src/rootserver/ob_partition_spliter.h b/src/rootserver/ob_partition_spliter.h index 3743f4ae1..c9c536078 100644 --- a/src/rootserver/ob_partition_spliter.h +++ b/src/rootserver/ob_partition_spliter.h @@ -34,14 +34,14 @@ namespace rootserver { class ObRootService; class ObPartitionSpliter; class ObPartitionSpliterIdling : public ObThreadIdling { - public: +public: explicit ObPartitionSpliterIdling(volatile bool& stop, const ObPartitionSpliter& host) : ObThreadIdling(stop), host_(host) {} virtual int64_t get_idle_interval_us(); - private: +private: static const int64_t MIN_CHECK_SPLIT_INTERVAL_US = 50 * 1000LL; static const int64_t MAX_CHECK_SPLIT_INTERVAL_US = 10 * 1000LL * 1000LL; @@ -49,7 +49,7 @@ class ObPartitionSpliterIdling : public ObThreadIdling { }; class ObPartitionSpliter : public ObRsReentrantThread { - public: +public: friend class ObPartitionSpliterIdling; ObPartitionSpliter() : inited_(false), @@ -70,10 +70,10 @@ class ObPartitionSpliter : public ObRsReentrantThread { BLOCKING_RUN_IMPLEMENT(); } - private: +private: int try_split_partition(); - private: +private: bool inited_; obrpc::ObCommonRpcProxy* rpc_proxy_; share::schema::ObMultiVersionSchemaService* schema_service_; @@ -84,7 +84,7 @@ class ObPartitionSpliter : public ObRsReentrantThread { }; class ObPartitionSplitExecutor { - public: +public: ObPartitionSplitExecutor(obrpc::ObSrvRpcProxy& rpc_proxy) : result_row_(0), proxy_batch_(rpc_proxy, &obrpc::ObSrvRpcProxy::batch_split_partition), @@ -102,7 +102,7 @@ class ObPartitionSplitExecutor { share::ObPartitionTableOperator& pt_operator, obrpc::ObSrvRpcProxy& rpc_proxy, obrpc::ObSplitPartitionArg& arg, share::ObSplitProgress& split_process); - private: +private: int check_result(share::ObSplitProgress& split_status); int send_rpc(); int accumulate_split_info(const common::ObAddr& addr, const int64_t table_id, const int64_t partition_id, @@ -111,7 +111,7 @@ class ObPartitionSplitExecutor { int get_split_status(const share::schema::ObPartitionSchema& schema, share::ObPartitionTableOperator& pt_operator, obrpc::ObSrvRpcProxy& rpc_proxy, obrpc::ObSplitPartitionArg& arg, share::ObSplitProgress& split_status); - private: +private: int64_t result_row_; ObSplitPartitionBatchProxy proxy_batch_; common::ObArray dest_addr_; diff --git a/src/rootserver/ob_partition_table_util.h b/src/rootserver/ob_partition_table_util.h index 6c5c16f42..23e916e22 100644 --- a/src/rootserver/ob_partition_table_util.h +++ b/src/rootserver/ob_partition_table_util.h @@ -33,7 +33,7 @@ class ObZoneManager; class ObServerManager; class ObPartitionTableUtil { - public: +public: struct ObZoneLeaderInfo { ObZoneLeaderInfo() : zone_(), leader_count_(0) {} @@ -99,12 +99,12 @@ class ObPartitionTableUtil { // const bool flag, // ObLeaderInfoArray *leader_info_array); - private: +private: template int get_associated_replica_num(share::schema::ObSchemaGetterGuard& schema_guard, const SCHEMA& schema, int64_t& paxos_replica_num, int64_t& full_replica_num, int64_t& all_replica_num, int64_t& majority); - private: +private: bool inited_; ObZoneManager* zone_mgr_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/ob_rebalance_task.h b/src/rootserver/ob_rebalance_task.h index 608363978..d21294617 100644 --- a/src/rootserver/ob_rebalance_task.h +++ b/src/rootserver/ob_rebalance_task.h @@ -185,7 +185,7 @@ enum class RebalanceKeyType : int64_t { * 2.2 a task_type which is used to specify the rebalance task type. */ class ObRebalanceTaskKey { - public: +public: ObRebalanceTaskKey() : key_1_(-1), key_2_(-1), @@ -197,7 +197,7 @@ class ObRebalanceTaskKey { virtual ~ObRebalanceTaskKey() {} - public: +public: bool is_valid() const; bool operator==(const ObRebalanceTaskKey& that) const; ObRebalanceTaskKey& operator=(const ObRebalanceTaskKey& that); @@ -207,10 +207,10 @@ class ObRebalanceTaskKey { int init(const ObRebalanceTaskKey& that); TO_STRING_KV(K_(key_1), K_(key_2), K_(key_3), K_(key_4), K_(key_type)); - private: +private: uint64_t inner_hash() const; - private: +private: uint64_t key_1_; uint64_t key_2_; uint64_t key_3_; @@ -266,7 +266,7 @@ class ObRebalanceTask; * derived classes include Migrate/Add/Type transform/Remove and so on */ class ObRebalanceTaskInfo { - public: +public: friend class ObRebalanceTask; friend class ObMigrateReplicaTask; friend class ObTypeTransformTask; @@ -282,7 +282,7 @@ class ObRebalanceTaskInfo { friend class ObBackupTask; friend class ObValidateTask; - public: +public: ObRebalanceTaskInfo() : task_key_(), pkey_(), @@ -302,7 +302,7 @@ class ObRebalanceTaskInfo { virtual ~ObRebalanceTaskInfo() {} - public: +public: virtual ObRebalanceTaskType get_rebalance_task_type() const = 0; virtual bool need_process_failed_task() const { @@ -327,7 +327,7 @@ class ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const = 0; - public: +public: uint64_t get_tenant_id() const { return pkey_.get_tenant_id(); @@ -403,7 +403,7 @@ class ObRebalanceTaskInfo { const common::ObReplicaType& dst_type, const bool is_restore = false); bool can_accumulate_in_standby(const ObRebalanceTaskInfo& other) const; - public: +public: int assign(const ObRebalanceTaskInfo& task_info); int init_task_key(const uint64_t key_1, const uint64_t key_2, const uint64_t key_3, const uint64_t key_4, const RebalanceKeyType key_type) @@ -423,18 +423,18 @@ class ObRebalanceTaskInfo { return task_key_; } - public: +public: /* disallow copy constructor and operator= */ ObRebalanceTaskInfo(const ObRebalanceTaskInfo&) = delete; ObRebalanceTaskInfo& operator=(const ObRebalanceTaskInfo&) = delete; - public: +public: int check_leader(const ObRebalanceTask& task, const share::ObPartitionInfo& partition, common::ObAddr& leader) const; int update_with_partition(const common::ObAddr& dst) const; int try_update_unit_id(const share::ObPartitionInfo& partition, const OnlineReplica& online_replica) const; int force_check_partition_table(const share::ObPartitionInfo& partition) const; - protected: +protected: ObRebalanceTaskKey task_key_; common::ObPartitionKey pkey_; int64_t cluster_id_; @@ -458,16 +458,16 @@ class ObRebalanceTaskInfo { class ObFastRecoveryTask; class ObFastRecoveryTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObFastRecoveryTask; - public: +public: ObFastRecoveryTaskInfo() : ObRebalanceTaskInfo(), src_(), dst_(), tenant_id_(OB_INVALID_ID), file_id_(-1) {} virtual ~ObFastRecoveryTaskInfo() {} - public: +public: int build(const common::ObAddr& src, const common::ObAddr& dst, const common::ObAddr& rescue_server, const uint64_t tenant_id, const int64_t file_id); int assign(const ObFastRecoveryTaskInfo& task_info); @@ -488,7 +488,7 @@ class ObFastRecoveryTaskInfo : public ObRebalanceTaskInfo { return dst_; } - public: +public: /* virtual method implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -535,7 +535,7 @@ class ObFastRecoveryTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - private: +private: common::ObAddr src_; common::ObAddr dst_; uint64_t tenant_id_; @@ -544,22 +544,22 @@ class ObFastRecoveryTaskInfo : public ObRebalanceTaskInfo { class ObMigrateReplicaTask; class ObMigrateTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObMigrateReplicaTask; - public: +public: ObMigrateTaskInfo() : ObRebalanceTaskInfo(), dst_(), src_(), data_src_(), quorum_(0) {} virtual ~ObMigrateTaskInfo() {} - public: +public: int build(const obrpc::MigrateMode migrate_mode, const OnlineReplica& dst, const common::ObPartitionKey& pkey, const common::ObReplicaMember& src, const common::ObReplicaMember& data_src, const int64_t quorum, const bool is_restore, const bool is_manual = false); int assign(const ObMigrateTaskInfo& task_info); - public: +public: /* virtual method implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -604,7 +604,7 @@ class ObMigrateTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV("ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(src), K_(data_src), K_(quorum), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -628,12 +628,12 @@ class ObMigrateTaskInfo : public ObRebalanceTaskInfo { return quorum_; } - private: +private: int check_quorum(const share::ObPartitionInfo& partition_info) const; int check_online_replica(const share::ObPartitionInfo& partition_info) const; int check_offline_replica(const share::ObPartitionInfo& partition_info) const; - private: +private: OnlineReplica dst_; common::ObReplicaMember src_; common::ObReplicaMember data_src_; @@ -643,23 +643,23 @@ class ObMigrateTaskInfo : public ObRebalanceTaskInfo { class ObTypeTransformTask; class ObTypeTransformTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObTypeTransformTask; - public: +public: ObTypeTransformTaskInfo() : ObRebalanceTaskInfo(), dst_(), src_(), data_src_(), quorum_(0) {} virtual ~ObTypeTransformTaskInfo() {} - public: +public: int build(const OnlineReplica& dst, const common::ObPartitionKey& pkey, const common::ObReplicaMember& src, // replica before this transform const common::ObReplicaMember& data_src, // data source of this task const int64_t quorum, const bool is_restore, const bool is_manual = false); int assign(const ObTypeTransformTaskInfo& task_info); - public: +public: /* virtual methods implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -704,7 +704,7 @@ class ObTypeTransformTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV("ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(src), K_(data_src), K_(quorum), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -728,12 +728,12 @@ class ObTypeTransformTaskInfo : public ObRebalanceTaskInfo { return quorum_; } - protected: +protected: int check_quorum(const share::ObPartitionInfo& partition) const; int check_online_replica(const share::ObPartitionInfo& partition) const; int check_paxos_member(const share::ObPartitionInfo& partition) const; - private: +private: OnlineReplica dst_; common::ObReplicaMember src_; common::ObReplicaMember data_src_; @@ -743,21 +743,21 @@ class ObTypeTransformTaskInfo : public ObRebalanceTaskInfo { class ObAddReplicaTask; class ObAddTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObAddReplicaTask; - public: +public: ObAddTaskInfo() : ObRebalanceTaskInfo(), dst_(), data_src_(), quorum_(0) {} virtual ~ObAddTaskInfo() {} - public: +public: int build(const OnlineReplica& dst, const common::ObPartitionKey& pkey, const common::ObReplicaMember& data_src, const int64_t quorum, const bool is_restore, const bool is_manual = false); int assign(const ObAddTaskInfo& task_info); - public: +public: /* virtual method implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -804,7 +804,7 @@ class ObAddTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV("ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(data_src), K_(quorum), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -824,12 +824,12 @@ class ObAddTaskInfo : public ObRebalanceTaskInfo { return quorum_; } - protected: +protected: int check_quorum(const share::ObPartitionInfo& partition, const bool is_admin_force) const; int check_online_replica(const share::ObPartitionInfo& partition) const; int check_paxos_member(const share::ObPartitionInfo& partition) const; - private: +private: OnlineReplica dst_; common::ObReplicaMember data_src_; int64_t quorum_; @@ -838,10 +838,10 @@ class ObAddTaskInfo : public ObRebalanceTaskInfo { class ObRebuildReplicaTask; class ObRebuildTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObRebuildReplicaTask; - public: +public: ObRebuildTaskInfo() : ObRebalanceTaskInfo(), dst_(), data_src_() { skip_change_member_list_ = true; @@ -849,12 +849,12 @@ class ObRebuildTaskInfo : public ObRebalanceTaskInfo { virtual ~ObRebuildTaskInfo() {} - public: +public: int build(const OnlineReplica& dst, const common::ObPartitionKey& pkey, const common::ObReplicaMember& data_src, const bool is_manual = false); int assign(const ObRebuildTaskInfo& task_info); - public: +public: /* virtual method implment */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -901,7 +901,7 @@ class ObRebuildTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(data_src), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -917,7 +917,7 @@ class ObRebuildTaskInfo : public ObRebalanceTaskInfo { return dst_; } - private: +private: OnlineReplica dst_; common::ObReplicaMember data_src_; }; @@ -925,10 +925,10 @@ class ObRebuildTaskInfo : public ObRebalanceTaskInfo { class ObModifyQuorumTask; class ObModifyQuorumTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObModifiQuorumTask; - public: +public: ObModifyQuorumTaskInfo() : ObRebalanceTaskInfo(), dst_(), quorum_(0), orig_quorum_(0), member_list_() { skip_change_member_list_ = true; @@ -936,12 +936,12 @@ class ObModifyQuorumTaskInfo : public ObRebalanceTaskInfo { virtual ~ObModifyQuorumTaskInfo() {} - public: +public: int build(const OnlineReplica& dst, const common::ObPartitionKey& pkey, const int64_t quorum, const int64_t orig_quorum, ObMemberList& member_list); int assign(const ObModifyQuorumTaskInfo& task_info); - public: +public: /* virtual methods implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -988,7 +988,7 @@ class ObModifyQuorumTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV("ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(quorum), K_(orig_quorum), K_(member_list), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -1012,7 +1012,7 @@ class ObModifyQuorumTaskInfo : public ObRebalanceTaskInfo { return member_list_; } - private: +private: OnlineReplica dst_; int64_t quorum_; int64_t orig_quorum_; @@ -1022,10 +1022,10 @@ class ObModifyQuorumTaskInfo : public ObRebalanceTaskInfo { class ObRestoreTask; class ObRestoreTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObRestoreTask; - public: +public: ObRestoreTaskInfo() : ObRebalanceTaskInfo(), dst_(), restore_arg_() { skip_change_member_list_ = true; @@ -1033,11 +1033,11 @@ class ObRestoreTaskInfo : public ObRebalanceTaskInfo { virtual ~ObRestoreTaskInfo() {} - public: +public: int build(const common::ObPartitionKey& pkey, const share::ObRestoreArgs& restore_arg, const OnlineReplica& dst); int assign(const ObRestoreTaskInfo& task_info); - public: +public: /* virtual methods implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -1084,7 +1084,7 @@ class ObRestoreTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(restore_arg), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -1100,17 +1100,17 @@ class ObRestoreTaskInfo : public ObRebalanceTaskInfo { return restore_arg_; } - private: +private: OnlineReplica dst_; share::ObRestoreArgs restore_arg_; }; class ObPhysicalRestoreTask; class ObPhysicalRestoreTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObPhysicalRestoreTask; - public: +public: ObPhysicalRestoreTaskInfo() : ObRebalanceTaskInfo(), dst_(), restore_arg_() { skip_change_member_list_ = true; @@ -1118,12 +1118,12 @@ class ObPhysicalRestoreTaskInfo : public ObRebalanceTaskInfo { virtual ~ObPhysicalRestoreTaskInfo() {} - public: +public: int build( const common::ObPartitionKey& pkey, const share::ObPhysicalRestoreArg& restore_arg, const OnlineReplica& dst); int assign(const ObPhysicalRestoreTaskInfo& task_info); - public: +public: /* virtual methods implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -1170,7 +1170,7 @@ class ObPhysicalRestoreTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(restore_arg), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -1186,7 +1186,7 @@ class ObPhysicalRestoreTaskInfo : public ObRebalanceTaskInfo { return restore_arg_; } - private: +private: OnlineReplica dst_; share::ObPhysicalRestoreArg restore_arg_; }; @@ -1194,10 +1194,10 @@ class ObPhysicalRestoreTaskInfo : public ObRebalanceTaskInfo { class ObCopySSTableTask; class ObCopySSTableTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObCopySSTableTask; - public: +public: ObCopySSTableTaskInfo() : ObRebalanceTaskInfo(), dst_(), data_src_(), index_table_id_(common::OB_INVALID_ID) { skip_change_member_list_ = true; @@ -1205,12 +1205,12 @@ class ObCopySSTableTaskInfo : public ObRebalanceTaskInfo { virtual ~ObCopySSTableTaskInfo() {} - public: +public: int build(const common::ObPartitionKey& pkey, const OnlineReplica& dst, const common::ObReplicaMember& data_src, const int64_t index_table_id = common::OB_INVALID_ID); int assign(const ObCopySSTableTaskInfo& task_info); - public: +public: /* virtual methods implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -1257,7 +1257,7 @@ class ObCopySSTableTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV("ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(data_src), K_(index_table_id), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -1277,7 +1277,7 @@ class ObCopySSTableTaskInfo : public ObRebalanceTaskInfo { return index_table_id_; } - private: +private: OnlineReplica dst_; common::ObReplicaMember data_src_; uint64_t index_table_id_; @@ -1286,21 +1286,21 @@ class ObCopySSTableTaskInfo : public ObRebalanceTaskInfo { class ObRemoveMemberTask; class ObRemoveMemberTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObRemoveMemberTask; - public: +public: ObRemoveMemberTaskInfo() : ObRebalanceTaskInfo(), dst_(), quorum_(0), orig_quorum_(0), check_leader_(true) {} virtual ~ObRemoveMemberTaskInfo() {} - public: +public: int build(const OnlineReplica& dst, const common::ObPartitionKey& pkey, const int64_t quorum, const int64_t orig_quorum, const bool check_leader = true); int assign(const ObRemoveMemberTaskInfo& task_info); - public: +public: /* virtual methods implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -1345,7 +1345,7 @@ class ObRemoveMemberTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV("ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(quorum), K_(orig_quorum), K_(check_leader), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -1369,7 +1369,7 @@ class ObRemoveMemberTaskInfo : public ObRebalanceTaskInfo { return check_leader_; } - private: +private: OnlineReplica dst_; int64_t quorum_; int64_t orig_quorum_; @@ -1379,10 +1379,10 @@ class ObRemoveMemberTaskInfo : public ObRebalanceTaskInfo { class ObRemoveNonPaxosTask; class ObRemoveNonPaxosTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObRemoveNonPaxosTask; - public: +public: ObRemoveNonPaxosTaskInfo() : ObRebalanceTaskInfo(), dst_() { skip_change_member_list_ = true; @@ -1390,11 +1390,11 @@ class ObRemoveNonPaxosTaskInfo : public ObRebalanceTaskInfo { virtual ~ObRemoveNonPaxosTaskInfo() {} - public: +public: int build(const OnlineReplica& dst, const common::ObPartitionKey& pkey); int assign(const ObRemoveNonPaxosTaskInfo& task_info); - public: +public: /* virtual methods implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -1441,7 +1441,7 @@ class ObRemoveNonPaxosTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -1453,17 +1453,17 @@ class ObRemoveNonPaxosTaskInfo : public ObRebalanceTaskInfo { return dst_; } - private: +private: OnlineReplica dst_; }; class ObRebalanceSqlBKGTask; class ObSqlBKGDDistTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObRebalanceSqlBKGTask; - public: +public: ObSqlBKGDDistTaskInfo() : ObRebalanceTaskInfo(), sql_bkgd_task_(), dst_() { skip_change_member_list_ = true; @@ -1471,11 +1471,11 @@ class ObSqlBKGDDistTaskInfo : public ObRebalanceTaskInfo { virtual ~ObSqlBKGDDistTaskInfo() {} - public: +public: int build(const sql::ObSchedBKGDDistTask& bkgd_task); int assign(const ObSqlBKGDDistTaskInfo& that); - public: +public: /* virtual methods implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -1522,7 +1522,7 @@ class ObSqlBKGDDistTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(sql_bkgd_task), "task_type", get_rebalance_task_type()); const sql::ObSchedBKGDDistTask& get_sql_bkgd_task() const @@ -1534,17 +1534,17 @@ class ObSqlBKGDDistTaskInfo : public ObRebalanceTaskInfo { return sql_bkgd_task_; } - private: +private: sql::ObSchedBKGDDistTask sql_bkgd_task_; common::ObAddr dst_; }; class ObBackupTask; class ObBackupTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObBackupTask; - public: +public: ObBackupTaskInfo() : ObRebalanceTaskInfo(), dst_(), data_src_(), physical_backup_arg_() { skip_change_member_list_ = true; @@ -1552,12 +1552,12 @@ class ObBackupTaskInfo : public ObRebalanceTaskInfo { virtual ~ObBackupTaskInfo() {} - public: +public: int build(const common::ObPartitionKey& pkey, const OnlineReplica& dst, const common::ObReplicaMember& data_src, const share::ObPhysicalBackupArg& physical_backup_arg); int assign(const ObBackupTaskInfo& task_info); - public: +public: /* virtual method implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -1604,7 +1604,7 @@ class ObBackupTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV("ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(dst), K_(data_src), K_(physical_backup_arg), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -1624,17 +1624,17 @@ class ObBackupTaskInfo : public ObRebalanceTaskInfo { return physical_backup_arg_; } - private: +private: OnlineReplica dst_; common::ObReplicaMember data_src_; share::ObPhysicalBackupArg physical_backup_arg_; }; class ObValidateTaskInfo : public ObRebalanceTaskInfo { - public: +public: friend class ObValidateTask; - public: +public: ObValidateTaskInfo() : ObRebalanceTaskInfo(), physical_validate_arg_() { skip_change_member_list_ = true; @@ -1642,12 +1642,12 @@ class ObValidateTaskInfo : public ObRebalanceTaskInfo { virtual ~ObValidateTaskInfo() {} - public: +public: int build(const common::ObPartitionKey& pkey, const common::ObReplicaMember& dst, const share::ObPhysicalValidateArg& physical_validate_arg); int assign(const ObValidateTaskInfo& task_info); - public: +public: /* virtual method implement */ virtual ObRebalanceTaskType get_rebalance_task_type() const override @@ -1694,7 +1694,7 @@ class ObValidateTaskInfo : public ObRebalanceTaskInfo { virtual int get_virtual_rebalance_task_stat_info( common::ObAddr& src, common::ObAddr& data_src, common::ObAddr& dest, common::ObAddr& offline) const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTaskInfo", ObRebalanceTaskInfo, K_(physical_validate_arg), "task_type", get_rebalance_task_type()); const common::ObPartitionKey& get_partition_key() const @@ -1710,23 +1710,23 @@ class ObValidateTaskInfo : public ObRebalanceTaskInfo { return physical_validate_arg_; } - private: +private: share::ObPhysicalValidateArg physical_validate_arg_; common::ObReplicaMember dst_; common::ObAddr addr_; }; class ObRebalanceTask : public common::ObDLinkBase { - public: +public: friend class ObRebalanceTaskMgr; friend class ObRebalanceTaskQueue; - public: +public: typedef common::hash::ObHashMap TaskInfoMap; typedef common::hash::ObHashMap AddrTaskMap; - public: +public: ObRebalanceTask() : generate_time_(common::ObTimeUtility::current_time()), priority_(ObRebalanceTaskPriority::LOW_PRI), @@ -1739,7 +1739,7 @@ class ObRebalanceTask : public common::ObDLinkBase { virtual ~ObRebalanceTask() {} - public: +public: /* general pure interfaces */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -1763,7 +1763,7 @@ class ObRebalanceTask : public common::ObDLinkBase { obrpc::ObSrvRpcProxy& rpc_proxy, const common::ObAddr& leader, common::ObIArray& rc_array) const = 0; virtual int log_execute_start() const = 0; - public: +public: virtual void set_schedule() { for (int64_t i = 0; i < get_sub_task_count(); ++i) { @@ -1846,7 +1846,7 @@ class ObRebalanceTask : public common::ObDLinkBase { virtual TO_STRING_KV( K_(generate_time), K_(priority), K_(comment), K_(schedule_time), K_(executor_time), K_(task_id), K_(dst)); - protected: +protected: typedef common::hash::ObHashMap PartitionInfoMap; bool can_batch_get_partition_info() const; @@ -1857,9 +1857,9 @@ class ObRebalanceTask : public common::ObDLinkBase { PartitionInfoMap& partition_info_map) const; int check_table_schema() const; - protected: +protected: static const int64_t TIMEOUT_US_PER_PARTITION = 5 * 1000000; // 5s - private: +private: int set_tenant_stat(AddrTaskMap& src_server_map, AddrTaskMap& dst_server_map, ObTenantTaskStatMap& tenant_stat_map); int set_server_stat( const AddrTaskMap& src_server_map, const AddrTaskMap& dst_server_map, ObServerTaskStatMap& server_stat_map); @@ -1868,7 +1868,7 @@ class ObRebalanceTask : public common::ObDLinkBase { int accumulate_dst_addr_server_map( AddrTaskMap& add_task_map, const common::ObAddr& dst_addr, ObRebalanceTaskInfo& task_info); - protected: +protected: int64_t generate_time_; ObRebalanceTaskPriority priority_; const char* comment_; @@ -1879,18 +1879,18 @@ class ObRebalanceTask : public common::ObDLinkBase { }; class ObMigrateReplicaTask : public ObRebalanceTask { - public: +public: ObMigrateReplicaTask() : ObRebalanceTask(), task_infos_(), admin_force_(false), migrate_mode_(obrpc::MigrateMode::MT_MAX) {} virtual ~ObMigrateReplicaTask() {} - public: +public: int build(const obrpc::MigrateMode migrate_mode, const common::ObIArray& task_infos, const common::ObAddr& dst, const ObRebalanceTaskPriority priority, const char* comment, bool admin_force = false); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -1941,7 +1941,7 @@ class ObMigrateReplicaTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), K_(admin_force), "task_type", get_rebalance_task_type()); bool is_admin_force() const @@ -1953,27 +1953,27 @@ class ObMigrateReplicaTask : public ObRebalanceTask { int build_by_task_result(const obrpc::ObMigrateReplicaBatchRes& res); int assign(const ObMigrateReplicaTask& that); - private: +private: int get_data_size(int64_t& data_size) const; - private: +private: common::ObArray task_infos_; bool admin_force_; obrpc::MigrateMode migrate_mode_; }; class ObTypeTransformTask : public ObRebalanceTask { - public: +public: ObTypeTransformTask() : ObRebalanceTask(), task_infos_(), admin_force_(false) {} virtual ~ObTypeTransformTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment, bool admin_force = false); - public: +public: /* general pure interfaces */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2024,7 +2024,7 @@ class ObTypeTransformTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), K_(admin_force), "task_type", get_rebalance_task_type()); bool is_admin_force() const @@ -2037,16 +2037,16 @@ class ObTypeTransformTask : public ObRebalanceTask { int assign(const ObTypeTransformTask& that); int add_type_transform_task_info(const ObTypeTransformTaskInfo& task_info); - private: +private: int get_data_size(int64_t& data_size) const; - private: +private: common::ObArray task_infos_; bool admin_force_; }; class ObAddReplicaTask : public ObRebalanceTask { - public: +public: ObAddReplicaTask() : ObRebalanceTask(), task_infos_(), admin_force_(false) { priority_ = HIGH_PRI; @@ -2054,11 +2054,11 @@ class ObAddReplicaTask : public ObRebalanceTask { virtual ~ObAddReplicaTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment, bool admin_force = false); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2109,7 +2109,7 @@ class ObAddReplicaTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), K_(admin_force), "task_type", get_rebalance_task_type()); bool is_admin_force() const @@ -2121,25 +2121,25 @@ class ObAddReplicaTask : public ObRebalanceTask { int build_by_task_result(const obrpc::ObAddReplicaBatchRes& res); int assign(const ObAddReplicaTask& that); - private: +private: int get_data_size(int64_t& data_size) const; - private: +private: common::ObArray task_infos_; bool admin_force_; }; class ObRebuildReplicaTask : public ObRebalanceTask { - public: +public: ObRebuildReplicaTask() : ObRebalanceTask(), task_infos_() {} virtual ~ObRebuildReplicaTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2190,7 +2190,7 @@ class ObRebuildReplicaTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), "task_type", get_rebalance_task_type()); int build_rebuild_replica_rpc_arg(obrpc::ObRebuildReplicaBatchArg& arg) const; @@ -2198,24 +2198,24 @@ class ObRebuildReplicaTask : public ObRebalanceTask { int build_by_task_result(const obrpc::ObRebuildReplicaBatchRes& res); int assign(const ObRebuildReplicaTask& that); - private: +private: int get_data_size(int64_t& data_size) const; - private: +private: common::ObArray task_infos_; }; class ObModifyQuorumTask : public ObRebalanceTask { - public: +public: ObModifyQuorumTask() : ObRebalanceTask(), task_infos_() {} virtual ~ObModifyQuorumTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2266,28 +2266,28 @@ class ObModifyQuorumTask : public ObRebalanceTask { common::ObIArray& rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), "task_type", get_rebalance_task_type()); int build_modify_quorum_rpc_arg(obrpc::ObModifyQuorumBatchArg& arg) const; int add_modify_quorum_task_info(const ObModifyQuorumTaskInfo& task_info); int assign(const ObModifyQuorumTask& that); - private: +private: common::ObArray task_infos_; }; class ObRestoreTask : public ObRebalanceTask { - public: +public: ObRestoreTask() : ObRebalanceTask(), task_infos_() {} virtual ~ObRestoreTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2338,29 +2338,29 @@ class ObRestoreTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), "task_type", get_rebalance_task_type()); int build_restore_rpc_arg(obrpc::ObRestoreReplicaArg& arg) const; int build_by_task_result(const obrpc::ObRestoreReplicaRes& res); int assign(const ObRestoreTask& that); - private: +private: common::ObArray task_infos_; }; class ObPhysicalRestoreTask : public ObRebalanceTask { - public: +public: ObPhysicalRestoreTask() : ObRebalanceTask(), task_infos_() {} virtual ~ObPhysicalRestoreTask() {} - public: +public: int build( const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2411,19 +2411,19 @@ class ObPhysicalRestoreTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), "task_type", get_rebalance_task_type()); int build_restore_rpc_arg(obrpc::ObPhyRestoreReplicaArg& arg) const; int build_by_task_result(const obrpc::ObPhyRestoreReplicaRes& res); int assign(const ObPhysicalRestoreTask& that); - private: +private: common::ObArray task_infos_; }; class ObCopySSTableTask : public ObRebalanceTask { - public: +public: ObCopySSTableTask() : ObRebalanceTask(), task_infos_(), copy_sstable_type_(common::OB_COPY_SSTABLE_TYPE_INVALID) { priority_ = HIGH_PRI; @@ -2431,11 +2431,11 @@ class ObCopySSTableTask : public ObRebalanceTask { virtual ~ObCopySSTableTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObCopySSTableType copy_sstable_type, const common::ObAddr& dst, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2486,7 +2486,7 @@ class ObCopySSTableTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV("ObRebalanceTask", ObRebalanceTask, K_(task_infos), K_(copy_sstable_type), "task_type", get_rebalance_task_type()); int build_copy_sstable_rpc_arg(obrpc::ObCopySSTableBatchArg& arg) const; @@ -2497,26 +2497,26 @@ class ObCopySSTableTask : public ObRebalanceTask { } int assign(const ObCopySSTableTask& that); - private: +private: int get_data_size(int64_t& data_size) const; - private: +private: common::ObArray task_infos_; common::ObCopySSTableType copy_sstable_type_; }; class ObRemoveMemberTask : public ObRebalanceTask { - public: +public: ObRemoveMemberTask() : ObRebalanceTask(), task_infos_(), admin_force_(false) {} virtual ~ObRemoveMemberTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment, const bool admin_force = false); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2567,7 +2567,7 @@ class ObRemoveMemberTask : public ObRebalanceTask { obrpc::ObSrvRpcProxy& rpc_proxy, const common::ObAddr& leader, common::ObIArray& rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), K_(admin_force), "task_type", get_rebalance_task_type()); bool is_admin_force() const @@ -2578,23 +2578,23 @@ class ObRemoveMemberTask : public ObRebalanceTask { int add_remove_member_task_info(const ObRemoveMemberTaskInfo& task_info); int assign(const ObRemoveMemberTask& that); - private: +private: common::ObArray task_infos_; bool admin_force_; }; class ObRemoveNonPaxosTask : public ObRebalanceTask { - public: +public: ObRemoveNonPaxosTask() : ObRebalanceTask(), task_infos_(), admin_force_(false) {} virtual ~ObRemoveNonPaxosTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment, const bool admin_force = false); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2645,7 +2645,7 @@ class ObRemoveNonPaxosTask : public ObRebalanceTask { common::ObIArray& rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), K_(admin_force), "task_type", get_rebalance_task_type()); bool is_admin_force() const @@ -2656,22 +2656,22 @@ class ObRemoveNonPaxosTask : public ObRebalanceTask { int add_remove_non_paxos_replica_task_info(const ObRemoveNonPaxosTaskInfo& task_info); int assign(const ObRemoveNonPaxosTask& that); - private: +private: common::ObArray task_infos_; bool admin_force_; }; class ObRebalanceSqlBKGTask : public ObRebalanceTask { - public: +public: ObRebalanceSqlBKGTask() : ObRebalanceTask(), task_infos_() {} virtual ~ObRebalanceSqlBKGTask() {} - public: +public: int build(const ObSqlBKGDDistTaskInfo& task_info, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2723,19 +2723,19 @@ class ObRebalanceSqlBKGTask : public ObRebalanceTask { int check_task_exist(bool& exist); - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), "task_type", get_rebalance_task_type()); int build_rebalance_sql_bkg_rpc_arg(sql::ObBKGDDistExecuteArg& arg) const; int build_by_task_result(const sql::ObBKGDTaskCompleteArg& arg); int assign(const ObRebalanceSqlBKGTask& that); - private: +private: common::ObArray task_infos_; }; class ObBackupTask : public ObRebalanceTask { - public: +public: ObBackupTask() : ObRebalanceTask(), task_infos_() { priority_ = HIGH_PRI; @@ -2743,10 +2743,10 @@ class ObBackupTask : public ObRebalanceTask { virtual ~ObBackupTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2797,7 +2797,7 @@ class ObBackupTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), "task_type", get_rebalance_task_type()); int build_backup_rpc_arg(obrpc::ObBackupBatchArg& arg) const; @@ -2808,24 +2808,24 @@ class ObBackupTask : public ObRebalanceTask { return task_id_; } - private: +private: int get_data_size(int64_t& data_size) const; - private: +private: common::ObArray task_infos_; }; class ObFastRecoveryTask : public ObRebalanceTask { - public: +public: ObFastRecoveryTask() : ObRebalanceTask(), task_infos_(), dest_unit_id_(common::OB_INVALID_ID) {} virtual ~ObFastRecoveryTask() {} - public: +public: int build(const ObFastRecoveryTaskInfo& task_info, const uint64_t dest_unit_id, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2876,27 +2876,27 @@ class ObFastRecoveryTask : public ObRebalanceTask { common::ObIArray& dummy_rc_array) const override; virtual int log_execute_start() const override; - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), K_(dest_unit_id), "task_type", get_rebalance_task_type()); int assign(const ObFastRecoveryTask& that); - private: +private: common::ObArray task_infos_; uint64_t dest_unit_id_; }; class ObValidateTask : public ObRebalanceTask { - public: +public: ObValidateTask() : ObRebalanceTask(), task_infos_() {} virtual ~ObValidateTask() {} - public: +public: int build(const common::ObIArray& task_infos, const common::ObAddr& dst, const char* comment); - public: +public: /* general pure interfaces override */ virtual int get_timeout(const int64_t network_bandwidth, const int64_t server_concurrency_limit, @@ -2947,7 +2947,7 @@ class ObValidateTask : public ObRebalanceTask { virtual void notify_cancel() const override {} - public: +public: virtual INHERIT_TO_STRING_KV( "ObRebalanceTask", ObRebalanceTask, K_(task_infos), "task_type", get_rebalance_task_type()); int build_validate_rpc_arg(obrpc::ObValidateBatchArg& arg) const; @@ -2959,10 +2959,10 @@ class ObValidateTask : public ObRebalanceTask { return task_id_; } - private: +private: int get_data_size(int64_t& data_size) const; - private: +private: common::ObArray task_infos_; }; diff --git a/src/rootserver/ob_rebalance_task_executor.h b/src/rootserver/ob_rebalance_task_executor.h index c28febc1e..5e8f583af 100644 --- a/src/rootserver/ob_rebalance_task_executor.h +++ b/src/rootserver/ob_rebalance_task_executor.h @@ -35,7 +35,7 @@ class ObLeaderCoordinator; class ObRebalanceTask; class ObRebalanceTaskExecutor { - public: +public: ObRebalanceTaskExecutor() : inited_(false), pt_operator_(NULL), @@ -59,7 +59,7 @@ class ObRebalanceTaskExecutor { } virtual int execute(const ObRebalanceTask& task, common::ObIArray& rc_array); - private: +private: bool inited_; share::ObPartitionTableOperator* pt_operator_; obrpc::ObSrvRpcProxy* rpc_proxy_; @@ -74,7 +74,7 @@ class ObRebalanceTaskExecutor { class ObRebalanceTaskMgr; class ObRebalanceTaskUtil { - public: +public: static const int64_t MAX_BATCH_MODIFY_QUORUM_COUNT = 10000; static const int64_t MAX_BATCH_REMOVE_MEMBER_COUNT = 10000; static const int64_t MAX_BATCH_REMOVE_NON_PAXOS_REPLICA_COUNT = 100; @@ -89,7 +89,7 @@ class ObRebalanceTaskUtil { static int build_batch_modify_quorum_task(ObRebalanceTaskMgr& task_mgr, const ObModifyQuorumTaskInfo& task_info, const char* comment, common::ObIArray& modify_quorum_tasks); - private: +private: static int get_remove_member_leader(const ObRemoveMemberTaskInfo& task_info, ObAddr& leader); }; diff --git a/src/rootserver/ob_rebalance_task_mgr.h b/src/rootserver/ob_rebalance_task_mgr.h index 5ca638279..d3a99c468 100644 --- a/src/rootserver/ob_rebalance_task_mgr.h +++ b/src/rootserver/ob_rebalance_task_mgr.h @@ -40,7 +40,7 @@ class ObRebalanceTaskMgr; class ObServerRecoveryMachine; class ObRebalanceTaskQueue { - public: +public: typedef common::ObDList TaskList; typedef common::hash::ObHashMap TaskInfoMap; @@ -126,14 +126,14 @@ class ObRebalanceTaskQueue { void reuse(); - private: +private: int do_push_task(ObRebalanceTaskMgr& task_mgr, const ObRebalanceTaskQueue& sibling_queue, const ObRebalanceTask& task, bool& has_task_info_in_schedule); int check_balance_task_can_pop(const ObRebalanceTaskInfo* task_info, const int64_t out_cnt_lmt, const int64_t in_cnt_lmt, bool& task_info_can_schedule); int check_backup_task_can_pop(const ObRebalanceTaskInfo* task_info, bool& task_info_can_schedule); - private: +private: static const int64_t BACKUP_IN_CNT_LIMIT = 1; bool is_inited_; common::ObServerConfig* config_; @@ -163,7 +163,7 @@ class ObRebalanceTaskQueue { // task exists. // 3. Only one replication task and one migration task exist for any partition. class ObRebalanceTaskMgr : public ObRsReentrantThread { - public: +public: const static int64_t TASK_QUEUE_LIMIT = 1 << 16; const static int64_t QUEUE_LOW_TASK_CNT = TASK_QUEUE_LIMIT / 4; const static int64_t ONCE_ADD_TASK_CNT = TASK_QUEUE_LIMIT / 2; @@ -257,7 +257,7 @@ class ObRebalanceTaskMgr : public ObRsReentrantThread { ObRebalanceTask*& task); int64_t get_schedule_interval() const; - private: +private: common::ObThreadCond& get_cond() { return cond_; @@ -309,7 +309,7 @@ class ObRebalanceTaskMgr : public ObRsReentrantThread { return true; } - private: +private: bool inited_; common::ObServerConfig* config_; diff --git a/src/rootserver/ob_replica_creator.h b/src/rootserver/ob_replica_creator.h index db7301998..45e3cca57 100644 --- a/src/rootserver/ob_replica_creator.h +++ b/src/rootserver/ob_replica_creator.h @@ -55,7 +55,7 @@ class TenantSchemaGetter; // To create replicas when creating tables class ObReplicaCreator { - public: +public: ObReplicaCreator(); virtual ~ObReplicaCreator() {} @@ -86,14 +86,14 @@ class ObReplicaCreator { const common::ObIArray& keys, obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr, share::schema::ObSchemaGetterGuard& guard); - public: +public: // types and constants typedef common::ObArray UnitArray; typedef common::ObSEArray ZoneUnitArray; typedef common::ObArray UnitPtrArray; typedef common::ObSEArray ZoneUnitPtrArray; - private: +private: struct CmpZoneScore { bool operator()(share::ObRawPrimaryZoneUtil::ZoneScore& left, share::ObRawPrimaryZoneUtil::ZoneScore& right) { @@ -202,7 +202,7 @@ class ObReplicaCreator { const common::ObIArray& logonly_units, ObPartitionAddr& paddr, const obrpc::ObCreateTableMode create_mode); - private: +private: // data members bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; @@ -212,7 +212,7 @@ class ObReplicaCreator { share::ObPartitionTableOperator* pt_operator_; share::ObCheckStopProvider* check_stop_provider_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObReplicaCreator); }; diff --git a/src/rootserver/ob_replica_stat_operator.h b/src/rootserver/ob_replica_stat_operator.h index 959ba15d7..aae793900 100644 --- a/src/rootserver/ob_replica_stat_operator.h +++ b/src/rootserver/ob_replica_stat_operator.h @@ -48,14 +48,14 @@ struct ObReplicaStat { // Access class for oceanbase.__all_virtual_partition_info class ObIReplicaStatIterator { - public: +public: virtual ~ObIReplicaStatIterator() {} virtual int next(ObReplicaStat& replica_stat) = 0; }; class ObReplicaStatIterator : public ObIReplicaStatIterator { - public: +public: ObReplicaStatIterator(); virtual ~ObReplicaStatIterator(); int init(common::ObMySQLProxy& proxy); @@ -63,10 +63,10 @@ class ObReplicaStatIterator : public ObIReplicaStatIterator { int next(ObReplicaStat& replica_stat) override; int close(); - private: +private: int cons_replica_stat(const common::sqlclient::ObMySQLResult& res, ObReplicaStat& replica_stat); - private: +private: bool inited_; common::ObMySQLProxy* sql_proxy_; common::ObMySQLProxy::MySQLResult res_; @@ -78,7 +78,7 @@ class ObReplicaStatIterator : public ObIReplicaStatIterator { // External fault injection case by case is tedious, // it is good to depend on the input data from an external physical table class ObReplicaStatUpdater { - public: +public: static int insert_stat(common::ObISQLClient& sql_client, ObReplicaStat& replica_stat); static int migrate_stat(common::ObISQLClient& sql_client, const common::ObPartitionKey& p, const common::ObAddr& from_svr, const common::ObAddr& to_svr); diff --git a/src/rootserver/ob_rereplication.h b/src/rootserver/ob_rereplication.h index da613c89f..ac02f1cbc 100644 --- a/src/rootserver/ob_rereplication.h +++ b/src/rootserver/ob_rereplication.h @@ -29,7 +29,7 @@ namespace rootserver { class ObRebalanceTaskMgr; class ObZoneManager; class ObRereplication { - public: +public: ObRereplication(); virtual ~ObRereplication() {} @@ -41,7 +41,7 @@ class ObRereplication { int replicate_to_unit(int64_t& task_cnt); int remove_permanent_offline_replicas(int64_t& task_cnt); - private: +private: int check_inner_stat(); int check_stop() const { @@ -57,7 +57,7 @@ class ObRereplication { int get_readonly_all_server_compensation_mode(share::schema::ObSchemaGetterGuard& schema_guard, const Partition& partition, bool& compensate_readonly_all_server) const; - private: +private: // data members bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; @@ -68,7 +68,7 @@ class ObRereplication { share::ObCheckStopProvider* check_stop_provider_; ObUnitManager* unit_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRereplication); }; diff --git a/src/rootserver/ob_resource_weight_parser.h b/src/rootserver/ob_resource_weight_parser.h index 938b02051..1a446a50d 100644 --- a/src/rootserver/ob_resource_weight_parser.h +++ b/src/rootserver/ob_resource_weight_parser.h @@ -19,19 +19,19 @@ namespace oceanbase { namespace rootserver { class ObResourceWeightParser { - public: +public: /* * if weight doesn't not sum to 1, return OB_INVALID_CONFIG */ static int parse(const char* str, ObResourceWeight& weight); - private: +private: class MyCb : public share::ObKVMatchCb { - public: + public: MyCb(ObResourceWeight& weight) : weight_(weight){}; int match(const char* key, const char* value); - private: + private: /* functions */ typedef void (*WeightSetter)(ObResourceWeight& weight, double); static void set_iops(ObResourceWeight& weight, double val) @@ -53,7 +53,7 @@ class ObResourceWeightParser { ObResourceWeight& weight_; }; - private: +private: /* variables */ DISALLOW_COPY_AND_ASSIGN(ObResourceWeightParser); }; diff --git a/src/rootserver/ob_restore_point_service.h b/src/rootserver/ob_restore_point_service.h index 2e8637526..aa3910f0b 100644 --- a/src/rootserver/ob_restore_point_service.h +++ b/src/rootserver/ob_restore_point_service.h @@ -22,7 +22,7 @@ class ObRestorePointService { static const int64_t RETRY_CNT = 10; static const int64_t MAX_RESTORE_POINT = 10; - public: +public: ObRestorePointService(); ~ObRestorePointService(); int init(rootserver::ObDDLService& ddl_service, rootserver::ObFreezeInfoManager& freeze_info_mgr); @@ -32,10 +32,10 @@ class ObRestorePointService { int drop_restore_point(const uint64_t tenant_id, const char* name); int drop_backup_point(const uint64_t tenant_id, const int64_t snapshot_version); - private: +private: void convert_name(const char* name, char* tmp_name, const int64_t length); - private: +private: bool is_inited_; rootserver::ObDDLService* ddl_service_; ObFreezeInfoManager* freeze_info_mgr_; diff --git a/src/rootserver/ob_root_backup.h b/src/rootserver/ob_root_backup.h index e215ae1dc..a1be207c2 100644 --- a/src/rootserver/ob_root_backup.h +++ b/src/rootserver/ob_root_backup.h @@ -98,14 +98,14 @@ struct ObTenantBackupMetaInfo { }; class ORootBackupIdling : public ObThreadIdling { - public: +public: explicit ORootBackupIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual int64_t get_idle_interval_us(); }; class ObRootBackup : public ObRsReentrantThread, public ObIBackupScheduler { - public: +public: ObRootBackup(); virtual ~ObRootBackup(); int init(common::ObServerConfig& cfg, share::schema::ObMultiVersionSchemaService& schema_service, @@ -136,7 +136,7 @@ class ObRootBackup : public ObRsReentrantThread, public ObIBackupScheduler { void reset_tenant_backup_meta_info(); int check_can_backup(); - private: +private: int get_need_backup_tenant_ids(common::ObIArray& tenant_ids); int get_need_backup_info(const uint64_t tenant_id, share::ObBackupInfoManager& info_manager, bool& need_add); int get_all_tenant_ids(common::ObIArray& tenant_ids); @@ -213,7 +213,7 @@ class ObRootBackup : public ObRsReentrantThread, public ObIBackupScheduler { share::ObBackupInfoManager& info_manager); int start_trans(ObTimeoutCtx& timeout_ctx, share::ObBackupItemTransUpdater& updater); - private: +private: bool is_inited_; common::ObServerConfig* config_; share::schema::ObMultiVersionSchemaService* schema_service_; @@ -235,12 +235,12 @@ class ObRootBackup : public ObRsReentrantThread, public ObIBackupScheduler { share::ObIBackupLeaseService* backup_lease_service_; ObRestorePointService* restore_point_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRootBackup); }; class ObTenantBackup { - public: +public: ObTenantBackup(); virtual ~ObTenantBackup() {} @@ -250,7 +250,7 @@ class ObTenantBackup { share::ObIBackupLeaseService& backup_lease_service); int do_backup(); - private: +private: int get_tenant_backup_task_info(share::ObTenantBackupTaskInfo& task_info, common::ObISQLClient& trans); int do_scheduler(); int do_generate(const share::ObTenantBackupTaskInfo& task_info, common::ObISQLClient& trans); @@ -310,11 +310,11 @@ class ObTenantBackup { int commit_trans(ObMySQLTransaction& trans); int start_trans(ObTimeoutCtx& timeout_ctx, ObMySQLTransaction& trans); - private: +private: static const int64_t MAX_CHECK_INTERVAL = 10 * 1000 * 1000; // 10s static const int64_t PG_TASK_MAX_RETRY_NUM = 64; - private: +private: bool is_inited_; share::schema::ObMultiVersionSchemaService* schema_service_; common::ObMySQLProxy* sql_proxy_; @@ -334,12 +334,12 @@ class ObTenantBackup { int64_t total_partition_count_; share::ObIBackupLeaseService* backup_lease_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantBackup); }; class ObBackupUtil { - public: +public: ObBackupUtil() {} virtual ~ObBackupUtil() diff --git a/src/rootserver/ob_root_balancer.h b/src/rootserver/ob_root_balancer.h index 06cf784ae..921fcf658 100644 --- a/src/rootserver/ob_root_balancer.h +++ b/src/rootserver/ob_root_balancer.h @@ -71,18 +71,18 @@ class ObSingleZoneModeMigrateReplica; class ObSinglePartitionBalance; class ObRootBalanceIdling : public ObThreadIdling { - public: +public: explicit ObRootBalanceIdling(volatile bool& stop, const ObRootBalancer& host) : ObThreadIdling(stop), host_(host) {} virtual int64_t get_idle_interval_us(); - private: +private: const ObRootBalancer& host_; }; struct ObBalancerTargetSchemaInfo { - public: +public: ObBalancerTargetSchemaInfo() : lock_(), tenant_schema_versions_() {} ~ObBalancerTargetSchemaInfo() @@ -93,7 +93,7 @@ struct ObBalancerTargetSchemaInfo { void reset(); TO_STRING_KV(K_(tenant_schema_versions)); - private: +private: common::SpinRWLock lock_; common::ObArray tenant_schema_versions_; }; @@ -105,7 +105,7 @@ struct ObBalancerTargetSchemaInfo { // - coordinate partition group members to the same. // - unit load balance. (migrate partition replica) class ObRootBalancer : public ObRsReentrantThread, public share::ObCheckStopProvider { - public: +public: enum TaskStatus { UNKNOWN = 0, HAS_TASK, NO_TASK, MAX }; ObRootBalancer(); virtual ~ObRootBalancer(); @@ -200,7 +200,7 @@ class ObRootBalancer : public ObRsReentrantThread, public share::ObCheckStopProv int create_unit_replica_counter(const uint64_t tenant_id); int destory_tenant_unit_array(); - private: +private: int multiple_zone_deployment_tenant_balance(const uint64_t tenant_id, balancer::ObLeaderBalanceGroupContainer& balance_group_container, ObRootBalanceHelp::BalanceController& balance_controller, int64_t& task_cnt); @@ -210,7 +210,7 @@ class ObRootBalancer : public ObRsReentrantThread, public share::ObCheckStopProv int cancel_unit_migration(int64_t& task_cnt); static const int64_t LOG_INTERVAL = 30 * 1000 * 1000; - private: +private: bool inited_; volatile int64_t active_; mutable ObRootBalanceIdling idling_; @@ -257,7 +257,7 @@ class ObRootBalancer : public ObRsReentrantThread, public share::ObCheckStopProv }; class ObBlacklistProcess : public share::ObAsyncTask { - public: +public: explicit ObBlacklistProcess() : init_(false), count_(0) {} virtual ~ObBlacklistProcess() @@ -269,7 +269,7 @@ class ObBlacklistProcess : public share::ObAsyncTask { virtual int64_t get_deep_copy_size() const; share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: +private: bool init_; int64_t count_; share::ObPartitionTableOperator* pt_; diff --git a/src/rootserver/ob_root_inspection.h b/src/rootserver/ob_root_inspection.h index 7e38b42c2..95e6944eb 100644 --- a/src/rootserver/ob_root_inspection.h +++ b/src/rootserver/ob_root_inspection.h @@ -49,7 +49,7 @@ class ObServerManager; // Interface of all the inspection task class ObInspectionTask { - public: +public: ObInspectionTask() {} virtual ~ObInspectionTask() @@ -58,13 +58,13 @@ class ObInspectionTask { virtual int inspect(bool& passed, const char*& warning_info) = 0; virtual const char* get_task_name() const = 0; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObInspectionTask); }; class ObTenantChecker : public ObInspectionTask { - public: +public: ObTenantChecker(share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& sql_proxy, obrpc::ObCommonRpcProxy& rpc_proxy) : schema_service_(&schema_service), sql_proxy_(&sql_proxy), rpc_proxy_(rpc_proxy) @@ -78,18 +78,18 @@ class ObTenantChecker : public ObInspectionTask { return "tenant_checker"; }; - private: +private: int alter_tenant_primary_zone(); int check_create_tenant_end(); - private: +private: share::schema::ObMultiVersionSchemaService* schema_service_; common::ObMySQLProxy* sql_proxy_; obrpc::ObCommonRpcProxy& rpc_proxy_; }; class ObTableGroupChecker : public ObInspectionTask { - public: +public: explicit ObTableGroupChecker(share::schema::ObMultiVersionSchemaService& schema_service); virtual ~ObTableGroupChecker(); int init(); @@ -99,7 +99,7 @@ class ObTableGroupChecker : public ObInspectionTask { return "tablegroup_checker"; }; - private: +private: int check_primary_zone(const share::schema::ObTableSchema& table, share::schema::ObSchemaGetterGuard& schema_guard); int check_locality(const share::schema::ObTableSchema& table, share::schema::ObSchemaGetterGuard& schema_guard); int check_part_option(const share::schema::ObTableSchema& table, share::schema::ObSchemaGetterGuard& schema_guard); @@ -108,7 +108,7 @@ class ObTableGroupChecker : public ObInspectionTask { template int check_if_part_option_equal_v2(const share::schema::ObTableSchema& table, const SCHEMA& schema, bool& is_matched); - private: +private: static const int TABLEGROUP_BUCKET_NUM = 1024; typedef common::hash::ObHashMap ObTableGroupCheckInfoMap; @@ -123,7 +123,7 @@ class ObTableGroupChecker : public ObInspectionTask { }; class ObDropTenantChecker : public ObInspectionTask { - public: +public: explicit ObDropTenantChecker( share::schema::ObMultiVersionSchemaService& schema_service, obrpc::ObCommonRpcProxy& rpc_proxy) : schema_service_(schema_service), rpc_proxy_(rpc_proxy), is_inited_(false) @@ -136,12 +136,12 @@ class ObDropTenantChecker : public ObInspectionTask { return "drop_tenant_checker"; } - private: +private: int drop_tenant_force(const common::ObString& tenant_name); int record_log_archive_history_(const uint64_t tenant_id, const int64_t drop_schema_version, const int64_t drop_tenant_time, bool& is_delay_delete); - private: +private: static const int64_t CHECK_DROP_TENANT_INTERVAL = 600 * 1000 * 1000L; // 10min share::schema::ObMultiVersionSchemaService& schema_service_; obrpc::ObCommonRpcProxy& rpc_proxy_; @@ -149,7 +149,7 @@ class ObDropTenantChecker : public ObInspectionTask { }; class ObForceDropSchemaChecker : public ObInspectionTask { - public: +public: enum DropSchemaMode { DROP_SCHEMA_ONLY = 0, DROP_PARTITION_ONLY = 1, DROP_SCHEMA_AND_PARTITION = 2 }; enum DropSchemaTaskMode { // Normal inspection mode @@ -160,7 +160,7 @@ class ObForceDropSchemaChecker : public ObInspectionTask { FAILOVER_MODE = 2, }; - public: +public: explicit ObForceDropSchemaChecker(ObRootService& root_service, share::schema::ObMultiVersionSchemaService& schema_service, obrpc::ObCommonRpcProxy& rpc_proxy, common::ObMySQLProxy& sql_proxy, const DropSchemaTaskMode task_mode) @@ -180,7 +180,7 @@ class ObForceDropSchemaChecker : public ObInspectionTask { int force_drop_schema(const uint64_t tenant_id, const int64_t recycle_schema_version, int64_t& task_cnt); int check_dropped_schema_exist(const uint64_t tenant_id, bool& exist); - private: +private: bool schema_need_drop(const int64_t drop_schema_version, const int64_t recycle_schema_version); int get_dropped_partition_ids(const int64_t recycle_schema_version, const share::schema::ObPartitionSchema& schema, common::ObArray& dropped_partition_ids, common::ObArray& dropped_subpartition_ids); @@ -207,10 +207,10 @@ class ObForceDropSchemaChecker : public ObInspectionTask { int try_drop_schema(const share::schema::ObPartitionSchema& partition_schema, const int64_t recycle_schema_version, const DropSchemaMode mode, int64_t& task_cnt); - private: +private: static const int BATCH_DROP_SCHEMA_NUM = 100; static const int64_t DROP_SCHEMA_IDLE_TIME = 100 * 1000; // 100ms - private: +private: ObRootService& root_service_; share::schema::ObMultiVersionSchemaService& schema_service_; obrpc::ObCommonRpcProxy& rpc_proxy_; @@ -221,7 +221,7 @@ class ObForceDropSchemaChecker : public ObInspectionTask { //////////////////////////////////////////////////////////////// // Class I: regular inspection in the background class ObInspector : public common::ObAsyncTimerTask { - public: +public: const static int64_t INSPECT_INTERVAL = 600L * 1000L * 1000L; // 600s explicit ObInspector(ObRootService& rs); virtual ~ObInspector() @@ -234,13 +234,13 @@ class ObInspector : public common::ObAsyncTimerTask { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: +private: ObRootService& rs_; }; // Class I: purge recyclebin in the background class ObPurgeRecyclebinTask : public common::ObAsyncTimerTask { - public: +public: explicit ObPurgeRecyclebinTask(ObRootService& rs); virtual ~ObPurgeRecyclebinTask() {} @@ -252,13 +252,13 @@ class ObPurgeRecyclebinTask : public common::ObAsyncTimerTask { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: +private: ObRootService& root_service_; }; // Class I: purge recylebin in backgroud class ObForceDropSchemaTask : public common::ObAsyncTimerTask { - public: +public: explicit ObForceDropSchemaTask(ObRootService& rs); virtual ~ObForceDropSchemaTask() {} @@ -270,13 +270,13 @@ class ObForceDropSchemaTask : public common::ObAsyncTimerTask { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: +private: ObRootService& root_service_; }; // class 2: trigger inspection by ALTER SYSTEM RUN JOB 'ROOT_INSPECTION' class ObRootInspection : public ObInspectionTask { - public: +public: ObRootInspection(); virtual ~ObRootInspection(); @@ -337,7 +337,7 @@ class ObRootInspection : public ObInspectionTask { const share::schema::ObTableSchema& hard_code_table, const share::schema::ObTableSchema& inner_table); int check_sys_table_schemas(); - private: +private: static const int64_t NAME_BUF_LEN = 64; typedef common::ObFixedLengthString Name; int check_zone(); @@ -363,7 +363,7 @@ class ObRootInspection : public ObInspectionTask { const uint64_t tenant_id, const char* table_name, share::schema::ObRefreshSchemaStatus& schema_status); int check_cancel(); - private: +private: bool inited_; volatile bool stopped_; @@ -380,21 +380,21 @@ class ObRootInspection : public ObInspectionTask { share::schema::ObMultiVersionSchemaService* schema_service_; ObZoneManager* zone_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRootInspection); }; // virtual table __all_virtual_upgrade_inspection // the result of ALTER SYSTEM RUN JOB 'ROOT_INSPECTION' class ObUpgradeInspection : public common::ObVirtualTableProjector { - public: +public: ObUpgradeInspection(); virtual ~ObUpgradeInspection(); int init(share::schema::ObMultiVersionSchemaService& schema_service, ObRootInspection& root_inspection); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int get_full_row( const share::schema::ObTableSchema* table, const char* name, const char* info, common::ObIArray& columns); @@ -402,12 +402,12 @@ class ObUpgradeInspection : public common::ObVirtualTableProjector { share::schema::ObMultiVersionSchemaService* schema_service_; ObRootInspection* root_inspection_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUpgradeInspection); }; class ObPrimaryClusterInspection : public ObInspectionTask { - public: +public: ObPrimaryClusterInspection() : inited_(false), schema_service_(nullptr), @@ -432,12 +432,12 @@ class ObPrimaryClusterInspection : public ObInspectionTask { return inited_; } - private: +private: int check_all_ddl_replay(bool& all_ddl_valid); int check_all_partition_created(bool& all_partition_created); int check_has_replica_in_standby_restore(bool& has_standby_restore_replica); - private: +private: bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; share::ObPartitionTableOperator* pt_operator_; diff --git a/src/rootserver/ob_root_major_freeze_v2.h b/src/rootserver/ob_root_major_freeze_v2.h index 9012548ba..68b0db39c 100644 --- a/src/rootserver/ob_root_major_freeze_v2.h +++ b/src/rootserver/ob_root_major_freeze_v2.h @@ -21,7 +21,7 @@ namespace rootserver { class ObFreezeInfoManager; class ObZoneManager; class ObRootMajorFreezeV2 { - public: +public: ObRootMajorFreezeV2(ObFreezeInfoManager& freeze_info) : inited_(false), freeze_info_manager_(freeze_info), zone_manager_(NULL) {} @@ -38,15 +38,15 @@ class ObRootMajorFreezeV2 { static const int64_t MAX_UNMERGED_VERSION_NUM = 16; - private: +private: static const int64_t UNMERGED_VERSION_LIMIT = 1; - private: +private: bool inited_; ObFreezeInfoManager& freeze_info_manager_; ObZoneManager* zone_manager_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRootMajorFreezeV2); }; } // namespace rootserver diff --git a/src/rootserver/ob_root_minor_freeze.h b/src/rootserver/ob_root_minor_freeze.h index fe7ae6f38..560eb6839 100644 --- a/src/rootserver/ob_root_minor_freeze.h +++ b/src/rootserver/ob_root_minor_freeze.h @@ -37,7 +37,7 @@ class ObServerManager; class ObUnitManager; class ObRootMinorFreeze { - public: +public: ObRootMinorFreeze(); virtual ~ObRootMinorFreeze(); @@ -50,7 +50,7 @@ class ObRootMinorFreeze { int try_minor_freeze(const common::ObIArray& tenant_ids, const common::ObPartitionKey& partition_key_, const common::ObIArray& server_list, const common::ObZone& zone) const; - private: +private: typedef struct MinorFreezeParam { common::ObAddr server; obrpc::ObMinorFreezeArg arg; @@ -59,7 +59,7 @@ class ObRootMinorFreeze { } MinorFreezeParam; class ParamsContainer { - public: + public: void reset() { params_.reset(); @@ -79,7 +79,7 @@ class ObRootMinorFreeze { TO_STRING_KV(K_(params)); - private: + private: common::ObSEArray params_; }; diff --git a/src/rootserver/ob_root_service.h b/src/rootserver/ob_root_service.h index 98e3d2d07..7c2c2c99f 100644 --- a/src/rootserver/ob_root_service.h +++ b/src/rootserver/ob_root_service.h @@ -129,7 +129,7 @@ class ObMajorFreeze; namespace rootserver { class ObSinglePartBalance; class ObRsStatus { - public: +public: ObRsStatus() : rs_status_(share::status::INIT) {} virtual ~ObRsStatus() @@ -146,19 +146,19 @@ class ObRsStatus { int revoke_rs(); int try_set_stopping(); - private: +private: common::SpinRWLock lock_; share::status::ObRootServiceStatus rs_status_; }; // Root Service Entry Class class ObRootService { - public: +public: friend class TestRootServiceCreateTable_check_rs_capacity_Test; friend class ObStandbyIneffectSchemaTask; friend class ObTenantWrsTask; class ObStartStopServerTask : public share::ObAsyncTask { - public: + public: ObStartStopServerTask(ObRootService& root_service, const common::ObAddr& server, const bool start) : root_service_(root_service), server_(server), start_(start) {} @@ -168,14 +168,14 @@ class ObRootService { virtual int64_t get_deep_copy_size() const; share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: + private: ObRootService& root_service_; const common::ObAddr server_; const bool start_; }; class ObOfflineServerTask : public share::ObAsyncTask { - public: + public: ObOfflineServerTask(ObRootService& root_service, const common::ObAddr& server) : root_service_(root_service), server_(server) { @@ -187,13 +187,13 @@ class ObRootService { virtual int64_t get_deep_copy_size() const; share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: + private: ObRootService& root_service_; const common::ObAddr server_; }; class ObMergeErrorTask : public share::ObAsyncTask { - public: + public: explicit ObMergeErrorTask(ObRootService& root_service) : root_service_(root_service) {} virtual ~ObMergeErrorTask() @@ -202,12 +202,12 @@ class ObRootService { virtual int64_t get_deep_copy_size() const; share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: + private: ObRootService& root_service_; }; class ObStatisticPrimaryZoneCountTask : public share::ObAsyncTask { - public: + public: explicit ObStatisticPrimaryZoneCountTask(ObRootService& root_service) : root_service_(root_service) {} virtual ~ObStatisticPrimaryZoneCountTask() @@ -216,12 +216,12 @@ class ObRootService { virtual int64_t get_deep_copy_size() const; share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: + private: ObRootService& root_service_; }; class ObCreateHaGtsUtilTask : public share::ObAsyncTask { - public: + public: explicit ObCreateHaGtsUtilTask(ObRootService& root_service) : root_service_(root_service) {} virtual ~ObCreateHaGtsUtilTask() @@ -230,12 +230,12 @@ class ObRootService { virtual int64_t get_deep_copy_size() const; share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: + private: ObRootService& root_service_; }; class ObRefreshServerTask : public common::ObAsyncTimerTask { - public: + public: const static int64_t REFRESH_SERVER_INTERVAL = 1L * 1000 * 1000; // 1 second explicit ObRefreshServerTask(ObRootService& root_service); virtual ~ObRefreshServerTask(){}; @@ -247,13 +247,13 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& root_service_; DISALLOW_COPY_AND_ASSIGN(ObRefreshServerTask); }; class ObStatusChangeCallback : public ObIStatusChangeCallback { - public: + public: explicit ObStatusChangeCallback(ObRootService& root_service); virtual ~ObStatusChangeCallback(); @@ -264,15 +264,15 @@ class ObRootService { virtual int on_stop_server(const common::ObAddr& server) override; virtual int on_offline_server(const common::ObAddr& server) override; - private: + private: ObRootService& root_service_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObStatusChangeCallback); }; class ObServerChangeCallback : public ObIServerChangeCallback { - public: + public: explicit ObServerChangeCallback(ObRootService& root_service) : root_service_(root_service) {} virtual ~ObServerChangeCallback() @@ -280,15 +280,15 @@ class ObRootService { virtual int on_server_change() override; - private: + private: ObRootService& root_service_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObServerChangeCallback); }; class ObRestartTask : public common::ObAsyncTimerTask { - public: + public: explicit ObRestartTask(ObRootService& root_service); virtual ~ObRestartTask(); @@ -300,20 +300,20 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& root_service_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObRestartTask); }; class ObReportCoreTableReplicaTask : public common::ObAsyncTimerTask { - public: + public: explicit ObReportCoreTableReplicaTask(ObRootService& root_service); virtual ~ObReportCoreTableReplicaTask() {} - public: + public: // interface of AsyncTask virtual int process() override; virtual int64_t get_deep_copy_size() const override @@ -322,18 +322,18 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& root_service_; DISALLOW_COPY_AND_ASSIGN(ObReportCoreTableReplicaTask); }; class ObReloadUnitManagerTask : public common::ObAsyncTimerTask { - public: + public: explicit ObReloadUnitManagerTask(ObRootService& root_service, ObUnitManager& unit_manager); virtual ~ObReloadUnitManagerTask() {} - public: + public: // interface of AsyncTask virtual int process() override; virtual int64_t get_deep_copy_size() const override @@ -342,14 +342,14 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& root_service_; ObUnitManager& unit_manager_; DISALLOW_COPY_AND_ASSIGN(ObReloadUnitManagerTask); }; class ObLoadIndexBuildTask : public common::ObAsyncTimerTask { - public: + public: ObLoadIndexBuildTask(ObRootService& root_service, ObGlobalIndexBuilder& global_index_builder); virtual ~ObLoadIndexBuildTask() = default; virtual int process() override; @@ -359,18 +359,18 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& root_service_; ObGlobalIndexBuilder& global_index_builder_; }; class ObUpdateAllServerConfigTask : public common::ObAsyncTimerTask { - public: + public: explicit ObUpdateAllServerConfigTask(ObRootService& root_service); virtual ~ObUpdateAllServerConfigTask() {} - public: + public: // interface of AsyncTask virtual int process() override; virtual int64_t get_deep_copy_size() const override @@ -379,13 +379,13 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& root_service_; DISALLOW_COPY_AND_ASSIGN(ObUpdateAllServerConfigTask); }; class ObSelfCheckTask : public common::ObAsyncTimerTask { - public: + public: explicit ObSelfCheckTask(ObRootService& root_service); virtual ~ObSelfCheckTask(){}; // interface of AsyncTask @@ -396,16 +396,16 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: void print_error_log(); - private: + private: ObRootService& root_service_; DISALLOW_COPY_AND_ASSIGN(ObSelfCheckTask); }; class ObIndexSSTableBuildTask : public share::ObAsyncTask { - public: + public: ObIndexSSTableBuildTask(const sql::ObIndexSSTableBuilder::BuildIndexJob& job, sql::ObIndexSSTableBuilder::ReplicaPicker& replica_picker, ObGlobalIndexBuilder& global_index_builder, common::ObMySQLProxy& sql_proxy, common::ObOracleSqlProxy& oracle_sql_proxy, const int64_t abs_timeout_us) @@ -439,7 +439,7 @@ class ObRootService { }; class RsListChangeCb : public share::ObIRsListChangeCb { - public: + public: explicit RsListChangeCb(ObRootService& rs) : rs_(rs) {} virtual ~RsListChangeCb() @@ -458,13 +458,13 @@ class ObRootService { return rs_.report_single_replica(key); } - private: + private: ObRootService& rs_; DISALLOW_COPY_AND_ASSIGN(RsListChangeCb); }; class MergeErrorCallback : public share::ObIMergeErrorCb { - public: + public: MergeErrorCallback(ObRootService& rs) : rs_(rs) {} virtual ~MergeErrorCallback() @@ -474,14 +474,14 @@ class ObRootService { return rs_.submit_merge_error_task(); } - private: + private: // data members ObRootService& rs_; DISALLOW_COPY_AND_ASSIGN(MergeErrorCallback); }; class ObInnerTableMonitorTask : public common::ObAsyncTimerTask { - public: + public: const static int64_t PURGE_INTERVAL = 3600L * 1000L * 1000L; // 1h ObInnerTableMonitorTask(ObRootService& rs); virtual ~ObInnerTableMonitorTask() @@ -495,12 +495,12 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& rs_; DISALLOW_COPY_AND_ASSIGN(ObInnerTableMonitorTask); }; class ObSwitchOverToFollowerTask : public share::ObAsyncTask { - public: + public: const static int64_t RETRY_INTERVAL = 1 * 1000L * 1000L; // 1s explicit ObSwitchOverToFollowerTask(ObRootService& rs); virtual ~ObSwitchOverToFollowerTask() @@ -512,13 +512,13 @@ class ObRootService { } virtual share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: + private: ObRootService& rs_; DISALLOW_COPY_AND_ASSIGN(ObSwitchOverToFollowerTask); }; class ObPrimaryClusterInspectionTask : public share::ObAsyncTask { - public: + public: const static int64_t RETRY_INTERVAL = 100 * 1000L * 1000L; // 100s explicit ObPrimaryClusterInspectionTask(ObRootService& rs); virtual ~ObPrimaryClusterInspectionTask() @@ -530,13 +530,13 @@ class ObRootService { } virtual share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: + private: ObRootService& rs_; DISALLOW_COPY_AND_ASSIGN(ObPrimaryClusterInspectionTask); }; class ObGenNextSchemaVersionTask : public common::ObAsyncTimerTask { - public: + public: const static int64_t RETRY_INTERVAL = 2 * 1000L * 1000L; // 2s ObGenNextSchemaVersionTask(ObRootService& rs); virtual ~ObGenNextSchemaVersionTask() @@ -550,13 +550,13 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& rs_; DISALLOW_COPY_AND_ASSIGN(ObGenNextSchemaVersionTask); }; class ObLostReplicaCheckerTask : public share::ObAsyncTask { - public: + public: const static int64_t RETRY_INTERVAL = 3 * 1000L * 1000L; // 10s ObLostReplicaCheckerTask(ObRootService& rs) : rs_(rs) {} @@ -571,13 +571,13 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& rs_; DISALLOW_COPY_AND_ASSIGN(ObLostReplicaCheckerTask); }; class ObMinorFreezeTask : public share::ObAsyncTask { - public: + public: explicit ObMinorFreezeTask(const obrpc::ObRootMinorFreezeArg& arg) : arg_(arg) {} virtual ~ObMinorFreezeTask() @@ -586,12 +586,12 @@ class ObRootService { virtual int64_t get_deep_copy_size() const; share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: + private: obrpc::ObRootMinorFreezeArg arg_; }; class ObUpdateClusterInfoTask : public common::ObAsyncTimerTask { - public: + public: const static int64_t REFRESH_SERVER_INTERVAL = 100L * 1000 * 1000; // 100 second explicit ObUpdateClusterInfoTask(ObRootService& root_service); virtual ~ObUpdateClusterInfoTask(){}; @@ -603,13 +603,13 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& root_service_; DISALLOW_COPY_AND_ASSIGN(ObUpdateClusterInfoTask); }; class ObReloadUnitReplicaCounterTask : public common::ObAsyncTimerTask { - public: + public: const static int64_t REFRESH_UNIT_INTERVAL = 60 * 10L * 1000 * 1000; // 1 second explicit ObReloadUnitReplicaCounterTask(ObRootService& root_service); virtual ~ObReloadUnitReplicaCounterTask(){}; @@ -620,12 +620,12 @@ class ObRootService { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: + private: ObRootService& root_service_; DISALLOW_COPY_AND_ASSIGN(ObReloadUnitReplicaCounterTask); }; - public: +public: ObRootService(); virtual ~ObRootService(); void reset_fail_count(); @@ -1224,7 +1224,7 @@ class ObRootService { int finish_replay_schema(const obrpc::ObFinishReplayArg& arg); //////////////////////////////////////////////////// - private: +private: int check_parallel_ddl_conflict(share::schema::ObSchemaGetterGuard& schema_guard, const obrpc::ObDDLArg& arg); int check_can_start_as_primary(); int fetch_root_partition_info(); @@ -1285,7 +1285,7 @@ class ObRootService { } int handle_cancel_delete_backup(const obrpc::ObBackupManageArg& arg); - private: +private: bool is_sys_tenant(const common::ObString& tenant_name); int table_is_split( uint64_t tenant_id, const ObString& database_name, const ObString& table_name, const bool is_index = false); @@ -1298,7 +1298,7 @@ class ObRootService { void construct_lease_expire_time(const share::ObLeaseRequest& lease_request, share::ObLeaseResponse& lease_response, const share::ObServerStatus& server_status); - private: +private: int update_all_sys_tenant_schema_version(); int finish_schema_split_v1(const obrpc::ObFinishSchemaSplitArg& arg); int finish_schema_split_v2(const obrpc::ObFinishSchemaSplitArg& arg); @@ -1306,7 +1306,7 @@ class ObRootService { int build_range_part_split_arg(const common::ObPartitionKey& partition_key, const common::ObRowkey& rowkey, share::schema::AlterTableSchema& alter_table_schema); - private: +private: static const int64_t OB_MAX_CLUSTER_REPLICA_COUNT = 10000000; static const int64_t OB_ROOT_SERVICE_START_FAIL_COUNT_UPPER_LIMIT = 10; bool inited_; @@ -1457,7 +1457,7 @@ class ObRootService { ObBackupLeaseService backup_lease_service_; ObRestorePointService restore_point_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRootService); }; diff --git a/src/rootserver/ob_root_utils.h b/src/rootserver/ob_root_utils.h index 3a1df86c6..d0599a16a 100644 --- a/src/rootserver/ob_root_utils.h +++ b/src/rootserver/ob_root_utils.h @@ -79,7 +79,7 @@ inline bool is_same_pg(const T& left, const T& right) enum ObResourceType { RES_CPU = 0, RES_MEM = 1, RES_DISK = 2, RES_MAX }; class ObIServerResource { - public: +public: ObIServerResource() = default; virtual ~ObIServerResource() = default; // return -1 if resource_type is invalid @@ -89,7 +89,7 @@ class ObIServerResource { }; class ObIServerResourceDemand { - public: +public: ObIServerResourceDemand() = default; virtual ~ObIServerResourceDemand() = default; // return -1 if resource_type is invalid @@ -97,7 +97,7 @@ class ObIServerResourceDemand { }; class ObResourceUtils { - public: +public: // the weight of the i-th resource is equal to the average usage of i-th resource template static int calc_server_resource_weight(const common::ObArray& servers, double* weights, int64_t count) @@ -216,7 +216,7 @@ class ObResourceUtils { return is_enough; } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObResourceUtils); ObResourceUtils(); @@ -224,7 +224,7 @@ class ObResourceUtils { }; class ObTenantUtils { - public: +public: static int get_tenant_ids( share::schema::ObMultiVersionSchemaService* schema_service, common::ObIArray& tenant_ids); static int get_tenant_ids(share::schema::ObMultiVersionSchemaService* schema_service, int64_t& sys_schema_version, @@ -234,25 +234,25 @@ class ObTenantUtils { static int remove_ineffective_task(common::ObMySQLTransaction& trans, const uint64_t tenant_id); static bool is_balance_target_schema(const share::schema::ObTableSchema& table_schema); - private: +private: static int check_small_tenant_primary_zone_and_locality_condition( share::schema::ObSchemaGetterGuard& schema_guard, const uint64_t tenant_id, bool& small_tenant); }; class ObBalanceTaskBuilder { - public: +public: // check method: F or L paxos replicas are enough to tolerate single server disaster. static bool can_do_type_transform(TenantBalanceStat& ts, const Partition& partition, const Replica& replica, common::ObReplicaType dest_type, int64_t dest_memstore_percent); }; class ObRootServiceRoleChecker { - public: +public: static bool is_rootserver(share::ObIPartPropertyGetter* prop_getter); }; class ObRootBalanceHelp { - public: +public: enum BalanceControllerItem { ENABLE_REBUILD = 0, ENABLE_EMERGENCY_REPLICATE, @@ -272,7 +272,7 @@ class ObRootBalanceHelp { MAX_BALANCE_ITEM }; class BalanceController { - public: + public: BalanceController() { init(); @@ -314,7 +314,7 @@ class ObRootBalanceHelp { infos_[idx] = result; } - private: + private: bool infos_[MAX_BALANCE_ITEM]; }; const static char* BalanceItem[]; @@ -322,7 +322,7 @@ class ObRootBalanceHelp { }; class ObTenantGroupParser { - public: +public: struct TenantNameGroup { TenantNameGroup() : row_(0), column_(0), tenants_() {} @@ -332,16 +332,16 @@ class ObTenantGroupParser { TO_STRING_KV(K_(row), K(column_), K(tenants_)); }; - public: +public: ObTenantGroupParser() : all_tenant_names_() {} virtual ~ObTenantGroupParser() {} - public: +public: int parse_tenant_groups(const common::ObString& ttg_str, common::ObIArray& tenant_groups); - private: +private: int get_next_tenant_name( int64_t& pos, const int64_t end, const common::ObString& ttg_str, common::ObString& tenant_name); int jump_to_next_tenant_name(int64_t& pos, const int64_t end, const common::ObString& ttg_str); @@ -357,18 +357,18 @@ class ObTenantGroupParser { common::ObIArray& tenant_groups); void jump_over_space(int64_t& pos, const int64_t end, const common::ObString& ttg_str); - private: +private: common::ObArray all_tenant_names_; }; class ObLocalityUtil { - public: +public: ObLocalityUtil() {} virtual ~ObLocalityUtil() {} - public: +public: static int parse_zone_list_from_locality_str( common::ObString& locality_locality, common::ObIArray& zone_list); template @@ -396,7 +396,7 @@ class ObLocalityUtil { return my_seed; } - private: +private: /* * the follow interfaces are for generating designated zone locality * interfaces that have ObPartitionKey parameter are for leader_coordinator @@ -440,7 +440,7 @@ int ObLocalityUtil::check_locality_completed_match(share::schema::ObSchemaGetter } class ObLocalityTaskHelp { - public: +public: ObLocalityTaskHelp() {} virtual ~ObLocalityTaskHelp() @@ -483,11 +483,11 @@ struct AlterPaxosLocalityTask { }; class ObLocalityCheckHelp { - public: +public: typedef common::hash::ObHashMap ZoneReplicaMap; - public: +public: ObLocalityCheckHelp() {} virtual ~ObLocalityCheckHelp() @@ -500,7 +500,7 @@ class ObLocalityCheckHelp { static int calc_paxos_replica_num( const common::ObIArray& zone_locality, int64_t& paxos_num); - private: +private: enum class SingleZoneLocalitySearch : int64_t { SZLS_IN_ASSOC_SINGLE = 0, SZLS_IN_ASSOC_MULTI, @@ -597,7 +597,7 @@ inline ObTraceEventRecorder* get_rs_trace_recorder() } class ObQuorumGetter { - public: +public: ObQuorumGetter(share::schema::ObSchemaGetterGuard& schema_guard, const ObUnitManager& unit_manager, const ObZoneManager& zone_manager) : schema_guard_(&schema_guard), unit_mgr_(&unit_manager), zone_mgr_(&zone_manager) @@ -605,7 +605,7 @@ class ObQuorumGetter { virtual ~ObQuorumGetter() {} - public: +public: virtual int get_migrate_replica_quorum_size( const uint64_t table_id, const int64_t orig_quorum, int64_t& quorum) const; virtual int get_add_replica_quorum_size(const uint64_t table_id, const int64_t orig_quorum, const ObZone& zone, @@ -615,7 +615,7 @@ class ObQuorumGetter { virtual int get_remove_replica_quorum_size(const uint64_t table_id, const int64_t orig_quorum, const ObZone& zone, const ObReplicaType type, int64_t& quorum) const; - private: +private: int get_table_alter_quorum_replica_task(const uint64_t table_id, const int64_t orig_quorum, common::ObIArray& alter_paxos_tasks, int64_t& add_paxos_num) const; int get_tablegroup_alter_quorum_replica_task(const uint64_t tablegroup_id, const int64_t orig_quorum, @@ -631,7 +631,7 @@ class ObQuorumGetter { int get_tenant_pool_zone_list(const uint64_t tenant_id, common::ObIArray& pool_zone_list) const; int get_schema_paxos_replica_num(const uint64_t schema_id, int64_t& cur_paxos_count) const; - private: +private: share::schema::ObSchemaGetterGuard* schema_guard_; const ObUnitManager* unit_mgr_; const ObZoneManager* zone_mgr_; @@ -640,7 +640,7 @@ class ObQuorumGetter { }; class ObRootUtils { - public: +public: ObRootUtils() {} virtual ~ObRootUtils() @@ -677,7 +677,7 @@ class ObRootUtils { }; class ObClusterInfoGetter { - public: +public: ObClusterInfoGetter() {} virtual ~ObClusterInfoGetter() diff --git a/src/rootserver/ob_rs_async_rpc_proxy.h b/src/rootserver/ob_rs_async_rpc_proxy.h index 049b179eb..18df4fea7 100644 --- a/src/rootserver/ob_rs_async_rpc_proxy.h +++ b/src/rootserver/ob_rs_async_rpc_proxy.h @@ -30,7 +30,7 @@ class ObRsAsyncCB : public obrpc::ObSrvRpcProxy::AsyncCB, public common::ObDLinkBase > { using AsyncCB = typename obrpc::ObSrvRpcProxy::AsyncCB; - public: +public: ObRsAsyncCB(AsyncRpcProxy& proxy) : proxy_(proxy) {} virtual ~ObRsAsyncCB() @@ -65,7 +65,7 @@ class ObRsAsyncCB : public obrpc::ObSrvRpcProxy::AsyncCB, TO_STRING_KV("dst", get_dst(), "ret_code", get_ret_code(), "result", get_result()); - private: +private: AsyncRpcProxy& proxy_; }; @@ -109,9 +109,9 @@ void ObRsAsyncCB::on_invalid() template class ObRsAsyncRpcProxy { - public: +public: struct EmptyType { - public: + public: bool is_valid() const { return true; @@ -145,7 +145,7 @@ class ObRsAsyncRpcProxy { } int receive_response(); - private: +private: int call_rpc(const common::ObAddr& server, const int64_t timeout, const uint64_t tenant_id, const RpcArg& arg, ObRsAsyncCB* cb); int call_rpc(const common::ObAddr& server, const int64_t timeout, const uint64_t tenant_id, @@ -161,7 +161,7 @@ class ObRsAsyncRpcProxy { int64_t response_count_; common::ObThreadCond cond_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRsAsyncRpcProxy); }; diff --git a/src/rootserver/ob_rs_event_history_table_operator.h b/src/rootserver/ob_rs_event_history_table_operator.h index b62448f2d..cf3ca6303 100644 --- a/src/rootserver/ob_rs_event_history_table_operator.h +++ b/src/rootserver/ob_rs_event_history_table_operator.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace rootserver { class ObRsEventHistoryTableOperator : public share::ObEventHistoryTableOperator { - public: +public: virtual ~ObRsEventHistoryTableOperator() {} @@ -26,7 +26,7 @@ class ObRsEventHistoryTableOperator : public share::ObEventHistoryTableOperator static ObRsEventHistoryTableOperator& get_instance(); - private: +private: ObRsEventHistoryTableOperator() {} DISALLOW_COPY_AND_ASSIGN(ObRsEventHistoryTableOperator); diff --git a/src/rootserver/ob_rs_gts_manager.h b/src/rootserver/ob_rs_gts_manager.h index 8205daca8..0f10c0e63 100644 --- a/src/rootserver/ob_rs_gts_manager.h +++ b/src/rootserver/ob_rs_gts_manager.h @@ -36,7 +36,7 @@ class ObUnitManager; class ObServerManager; class RsGtsInstance { - public: +public: RsGtsInstance() : gts_id_(common::OB_INVALID_ID), gts_name_(), region_(), tenant_id_array_() {} virtual ~RsGtsInstance() @@ -44,7 +44,7 @@ class RsGtsInstance { void reset(); int assign(const RsGtsInstance& other); - public: +public: uint64_t get_gts_id() const { return gts_id_; @@ -78,23 +78,23 @@ class RsGtsInstance { TO_STRING_KV(K_(gts_id), K_(gts_name), K_(region), K_(tenant_id_array)); - private: +private: uint64_t gts_id_; common::ObGtsName gts_name_; common::ObRegion region_; // record all tenants served by this gts instance common::ObArray tenant_id_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(RsGtsInstance); }; class ObRsGtsManager { - public: +public: ObRsGtsManager(); virtual ~ObRsGtsManager(); - public: +public: int init(common::ObMySQLProxy* sql_proxy, rootserver::ObZoneManager* zone_mgr, rootserver::ObUnitManager* unit_mgr, rootserver::ObServerManager* server_mgr); int load(); @@ -105,7 +105,7 @@ class ObRsGtsManager { int upgrade_cluster_create_ha_gts_util(); int check_tenant_ha_gts_exist(const uint64_t tenant_id, bool& ha_gts_exist); - private: +private: int check_inner_stat(); int pick_gts_instance_id(const common::ObRegion& primary_region, uint64_t& gts_id); int load_gts_instance(const common::ObIArray& gts_info_array); @@ -119,7 +119,7 @@ class ObRsGtsManager { const common::ObAddr& standby_server, common::ObGtsInfo& gts_info); int fetch_new_ha_gts_id(uint64_t& new_gts_id); - private: +private: typedef common::hash::ObHashMap GtsInstanceMap; typedef common::hash::ObHashMap TenantGtsMap; typedef common::hash::ObHashMap*, // gts_id array @@ -128,7 +128,7 @@ class ObRsGtsManager { const int64_t MAX_GTS_INSTANCE_CNT = common::OB_DEFAULT_TENANT_COUNT; const int64_t MAX_TENANT_CNT = common::OB_DEFAULT_TENANT_COUNT; - private: +private: common::SpinRWLock lock_; rootserver::ObZoneManager* zone_mgr_; rootserver::ObUnitManager* unit_mgr_; diff --git a/src/rootserver/ob_rs_gts_monitor.h b/src/rootserver/ob_rs_gts_monitor.h index 87d402b30..ed9770a9c 100644 --- a/src/rootserver/ob_rs_gts_monitor.h +++ b/src/rootserver/ob_rs_gts_monitor.h @@ -37,7 +37,7 @@ class ObZoneManager; class ObRsGtsTaskMgr; class ObGtsTaskManagerIdling : public ObThreadIdling { - public: +public: explicit ObGtsTaskManagerIdling(volatile bool& stop) : ObThreadIdling(stop) {} static const int64_t INTERVAL_US = 1000000; @@ -48,13 +48,13 @@ class ObGtsTaskManagerIdling : public ObThreadIdling { }; class UnitInfoStruct : public share::ObUnitInfo { - public: +public: UnitInfoStruct() : ObUnitInfo(), outside_replica_cnt_(0) {} virtual ~UnitInfoStruct() {} - public: +public: int assign(const ObUnitInfo& that) { int ret = common::OB_SUCCESS; @@ -82,12 +82,12 @@ class UnitInfoStruct : public share::ObUnitInfo { ++outside_replica_cnt_; } - private: +private: int64_t outside_replica_cnt_; }; class ObRsGtsInfoCollector { - public: +public: ObRsGtsInfoCollector(rootserver::ObUnitManager& unit_mgr) : inited_(false), sql_proxy_(nullptr), @@ -100,7 +100,7 @@ class ObRsGtsInfoCollector { virtual ~ObRsGtsInfoCollector() {} - public: +public: int init(common::ObMySQLProxy* sql_proxy); void reuse(); int gather_stat(); @@ -114,13 +114,13 @@ class ObRsGtsInfoCollector { return unit_info_array_; } - private: +private: typedef common::hash::ObHashMap UnitInfoMap; static const int64_t UNIT_MAP_BUCKET_CNT = 50000; static int append_unit_info_array( common::ObIArray& dst_array, const common::ObIArray& src_array); - private: +private: bool inited_; common::ObMySQLProxy* sql_proxy_; share::ObGtsTableOperator gts_table_operator_; @@ -154,7 +154,7 @@ class ObRsGtsInfoCollector { * processing according the above principles. */ class ObRsGtsUnitDistributor { - public: +public: ObRsGtsUnitDistributor(rootserver::ObUnitManager& unit_mgr, rootserver::ObServerManager& server_mgr, rootserver::ObZoneManager& zone_mgr, volatile bool& stop) : inited_(false), @@ -168,18 +168,18 @@ class ObRsGtsUnitDistributor { virtual ~ObRsGtsUnitDistributor() {} - public: +public: int init(common::ObMySQLProxy* sql_proxy); int distribute_unit_for_server_status_change(); int unit_migrate_finish(); int check_shrink_resource_pool(); - private: +private: int check_stop() const; int check_single_pool_shrinking_finished(const uint64_t tenant_id, const uint64_t pool_id, bool& is_finished); int commit_shrink_resource_pool(const uint64_t pool_id); - private: +private: bool inited_; common::ObMySQLProxy* sql_proxy_; rootserver::ObUnitManager& unit_mgr_; @@ -197,13 +197,13 @@ enum class GtsReplicaTaskType : int64_t { }; class ObGtsReplicaTaskKey { - public: +public: ObGtsReplicaTaskKey() : gts_id_(common::OB_INVALID_ID), hash_value_(0) {} virtual ~ObGtsReplicaTaskKey() {} - public: +public: bool is_valid() const; bool operator==(const ObGtsReplicaTaskKey& that) const; ObGtsReplicaTaskKey& operator=(const ObGtsReplicaTaskKey& that); @@ -212,22 +212,22 @@ class ObGtsReplicaTaskKey { int init(const ObGtsReplicaTaskKey& that); TO_STRING_KV(K_(gts_id)); - private: +private: uint64_t inner_hash() const; - private: +private: uint64_t gts_id_; uint64_t hash_value_; }; class ObGtsReplicaTask : public common::ObDLinkBase { - public: +public: ObGtsReplicaTask() {} virtual ~ObGtsReplicaTask() {} - public: +public: virtual int64_t get_deep_copy_size() const = 0; virtual int clone_new(void* ptr, ObGtsReplicaTask*& output_ptr) const = 0; virtual int execute(rootserver::ObServerManager& server_mgr, share::ObGtsTableOperator& gts_table_operator, @@ -236,7 +236,7 @@ class ObGtsReplicaTask : public common::ObDLinkBase { share::ObGtsTableOperator& gts_table_operator, bool& can_execute) = 0; virtual GtsReplicaTaskType get_task_type() = 0; - public: +public: int assign(const ObGtsReplicaTask& that) { task_key_ = that.task_key_; @@ -248,12 +248,12 @@ class ObGtsReplicaTask : public common::ObDLinkBase { } TO_STRING_KV(K(task_key_)); - protected: +protected: ObGtsReplicaTaskKey task_key_; }; class GtsMigrateReplicaTask : public ObGtsReplicaTask { - public: +public: enum class MigrateType : int64_t { MT_INVALID = 0, MT_MIGRATE_REPLICA, @@ -262,13 +262,13 @@ class GtsMigrateReplicaTask : public ObGtsReplicaTask { MT_MAX }; - public: +public: GtsMigrateReplicaTask() : gts_info_(), src_(), dst_(), migrate_type_(MigrateType::MT_INVALID) {} virtual ~GtsMigrateReplicaTask() {} - public: +public: virtual int64_t get_deep_copy_size() const override { return sizeof(GtsMigrateReplicaTask); @@ -283,15 +283,15 @@ class GtsMigrateReplicaTask : public ObGtsReplicaTask { return GtsReplicaTaskType::GTS_RTY_MIGRATE; } - public: +public: int init(const common::ObGtsInfo& gts_info, const common::ObAddr& src, const common::ObAddr& dst, const MigrateType migrate_type); int assign(const GtsMigrateReplicaTask& that); - private: +private: int try_remove_migrate_src(rootserver::ObServerManager& server_mgr, obrpc::ObSrvRpcProxy& rpc_proxy); - private: +private: common::ObGtsInfo gts_info_; common::ObAddr src_; common::ObAddr dst_; @@ -299,13 +299,13 @@ class GtsMigrateReplicaTask : public ObGtsReplicaTask { }; class GtsAllocStandbyTask : public ObGtsReplicaTask { - public: +public: GtsAllocStandbyTask() : gts_info_(), new_standby_() {} virtual ~GtsAllocStandbyTask() {} - public: +public: virtual int64_t get_deep_copy_size() const override { return sizeof(GtsAllocStandbyTask); @@ -320,17 +320,17 @@ class GtsAllocStandbyTask : public ObGtsReplicaTask { return GtsReplicaTaskType::GTS_RTY_ALLOC_STANDBY; } - public: +public: int init(const common::ObGtsInfo& gts_info, const common::ObAddr& new_standby); int assign(const GtsAllocStandbyTask& that); - private: +private: common::ObGtsInfo gts_info_; common::ObAddr new_standby_; }; class ObRsGtsReplicaTaskGenerator { - public: +public: ObRsGtsReplicaTaskGenerator(rootserver::ObUnitManager& unit_mgr, rootserver::ObServerManager& server_mgr, rootserver::ObZoneManager& zone_mgr, volatile bool& stop) : inited_(false), @@ -346,12 +346,12 @@ class ObRsGtsReplicaTaskGenerator { virtual ~ObRsGtsReplicaTaskGenerator() {} - public: +public: int init(common::ObMySQLProxy* sql_proxy); int output_gts_replica_task_array(common::ObIArray& output_task_array); void reuse(); - private: +private: struct ZoneReplicaCnt { ZoneReplicaCnt() : zone_(), cnt_(0) {} @@ -374,7 +374,7 @@ class ObRsGtsReplicaTaskGenerator { common::ObZone zone_; }; - private: +private: int check_stop(); int check_can_migrate(const common::ObAddr& myself, const common::ObGtsInfo& gts_info, bool& can_migrate); int try_generate_gts_replica_task(const common::ObGtsInfo& gts_info, ObGtsReplicaTask*& gts_replica_task); @@ -397,10 +397,10 @@ class ObRsGtsReplicaTaskGenerator { const common::ObGtsInfo& gts_info, const bool count_standby, common::ObIArray& zone_replica_cnts); int try_generate_server_or_zone_stopped_task(const common::ObGtsInfo& gts_info, ObGtsReplicaTask*& gts_replica_task); - public: +public: static const int64_t GTS_QUORUM = 3; - private: +private: bool inited_; common::ObMySQLProxy* sql_proxy_; common::ObArenaAllocator allocator_; // output task allocator @@ -413,13 +413,13 @@ class ObRsGtsReplicaTaskGenerator { }; class ObRsGtsMonitor : public ObRsReentrantThread { - public: +public: ObRsGtsMonitor(rootserver::ObUnitManager& unit_mgr, rootserver::ObServerManager& server_mgr, rootserver::ObZoneManager& zone_mgr, rootserver::ObRsGtsTaskMgr& gts_task_mgr); virtual ~ObRsGtsMonitor() {} - public: +public: int init(common::ObMySQLProxy* sql_proxy); virtual void run3() override; void wakeup(); @@ -432,10 +432,10 @@ class ObRsGtsMonitor : public ObRsReentrantThread { const common::ObIArray& servers_need_stopped, bool& can_stop); int check_gts_replica_enough_when_stop_zone(const common::ObZone& zone_need_stopped, bool& can_stop); - public: +public: static const int64_t GTS_QUORUM = 3; - private: +private: bool inited_; mutable ObGtsTaskManagerIdling idling_; ObRsGtsUnitDistributor gts_unit_distributor_; diff --git a/src/rootserver/ob_rs_gts_task_mgr.h b/src/rootserver/ob_rs_gts_task_mgr.h index 5987ac674..56fb1c699 100644 --- a/src/rootserver/ob_rs_gts_task_mgr.h +++ b/src/rootserver/ob_rs_gts_task_mgr.h @@ -30,11 +30,11 @@ class ObServerManager; class ObZoneManager; class ObRsGtsTaskQueue { - public: +public: ObRsGtsTaskQueue() : inited_(false), task_alloc_(), wait_list_(), task_map_() {} - public: +public: int init(const int64_t bucket_num); int push_task(const ObGtsReplicaTask* task); int pop_task(ObGtsReplicaTask*& task); @@ -44,23 +44,23 @@ class ObRsGtsTaskQueue { return task_alloc_; } - private: +private: typedef common::ObDList TaskList; typedef common::hash::ObHashMap TaskInfoMap; - private: +private: bool inited_; common::ObFIFOAllocator task_alloc_; TaskList wait_list_; TaskInfoMap task_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRsGtsTaskQueue); }; class ObRsGtsTaskMgr : public ObRsReentrantThread { - public: +public: ObRsGtsTaskMgr( rootserver::ObUnitManager& unit_mgr, rootserver::ObServerManager& server_mgr, rootserver::ObZoneManager& zone_mgr) : inited_(false), @@ -73,7 +73,7 @@ class ObRsGtsTaskMgr : public ObRsReentrantThread { sql_proxy_(nullptr) {} - public: +public: int init(obrpc::ObSrvRpcProxy* rpc_proxy, common::ObMySQLProxy* sql_proxy); int push_task(const ObGtsReplicaTask* task); @@ -84,12 +84,12 @@ class ObRsGtsTaskMgr : public ObRsReentrantThread { } void stop(); - private: +private: const static int64_t TASK_QUEUE_LIMIT = 1 << 16; int pop_task(ObGtsReplicaTask*& task); int get_task_cnt(int64_t& task_cnt); - private: +private: bool inited_; common::ObThreadCond cond_; ObRsGtsTaskQueue rs_gts_task_queue_; @@ -100,7 +100,7 @@ class ObRsGtsTaskMgr : public ObRsReentrantThread { obrpc::ObSrvRpcProxy* rpc_proxy_; common::ObMySQLProxy* sql_proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRsGtsTaskMgr); }; diff --git a/src/rootserver/ob_rs_job_table_operator.h b/src/rootserver/ob_rs_job_table_operator.h index 06258e04e..fdc808d4c 100644 --- a/src/rootserver/ob_rs_job_table_operator.h +++ b/src/rootserver/ob_rs_job_table_operator.h @@ -162,17 +162,17 @@ struct ObRsJobInfo { K_(database_name), K_(table_id), K_(table_name), K_(partition_id), K_(svr_addr), K_(unit_id), K_(rs_addr), K_(sql_text), K_(extra_info), K_(resource_pool_id)); - private: +private: common::ObArenaAllocator allocator_; }; class ObRsJobTableOperator { - public: +public: static const char* get_job_type_str(ObRsJobType job_type); static ObRsJobType get_job_type(const common::ObString& job_type_str); static ObRsJobStatus get_job_status(const common::ObString& job_status_str); - public: +public: ObRsJobTableOperator(); virtual ~ObRsJobTableOperator() = default; int init(common::ObMySQLProxy* sql_client, const common::ObAddr& rs_addr); @@ -207,12 +207,12 @@ class ObRsJobTableOperator { return sql_client_; } - private: +private: // types and constants static const char* const TABLE_NAME; static const int64_t MAX_ROW_COUNT = 100000; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRsJobTableOperator); // function members @@ -223,7 +223,7 @@ class ObRsJobTableOperator { int delete_rows_if_necessary(); int delete_rows(); - private: +private: // data members bool inited_; int64_t max_job_id_; @@ -234,7 +234,7 @@ class ObRsJobTableOperator { }; class ObRsJobTableOperatorSingleton { - public: +public: static ObRsJobTableOperator& get_instance(); }; diff --git a/src/rootserver/ob_rs_reentrant_thread.h b/src/rootserver/ob_rs_reentrant_thread.h index ea0c670b6..5179bd6d4 100644 --- a/src/rootserver/ob_rs_reentrant_thread.h +++ b/src/rootserver/ob_rs_reentrant_thread.h @@ -22,7 +22,7 @@ namespace rootserver { // before real running and after running class CheckThreadSet; class ObRsReentrantThread : public share::ObReentrantThread { - public: +public: ObRsReentrantThread(); explicit ObRsReentrantThread(bool need_check); virtual ~ObRsReentrantThread(); @@ -37,14 +37,20 @@ class ObRsReentrantThread : public share::ObReentrantThread { } virtual void run3() = 0; - //Set RS thread properties + // Set RS thread properties virtual int before_blocking_run() override - { common::ObThreadFlags::set_rs_flag(); return common::OB_SUCCESS; } + { + common::ObThreadFlags::set_rs_flag(); + return common::OB_SUCCESS; + } virtual int after_blocking_run() override - { common::ObThreadFlags::cancel_rs_flag(); return common::OB_SUCCESS; } - - //check thread + { + common::ObThreadFlags::cancel_rs_flag(); + return common::OB_SUCCESS; + } + + // check thread static CheckThreadSet check_thread_set_; static void check_alert(const ObRsReentrantThread& thread); @@ -63,7 +69,7 @@ class ObRsReentrantThread : public share::ObReentrantThread { void wait() override; TO_STRING_KV("name", get_thread_name()); - private: +private: // >0 :last run timestamp; // =0 :pause check thread; // =-1 :close check thread; @@ -76,7 +82,7 @@ class ObRsReentrantThread : public share::ObReentrantThread { }; class CheckThreadSet { - public: +public: CheckThreadSet(); virtual ~CheckThreadSet(); void reset(); @@ -84,7 +90,7 @@ class CheckThreadSet { int add(ObRsReentrantThread* thread); void loop_operation(void (*func)(const ObRsReentrantThread&)); - private: +private: static const int MAX_LEN = 16; const ObRsReentrantThread* arr_[MAX_LEN]; common::SpinRWLock rwlock_; diff --git a/src/rootserver/ob_rs_rpc_processor.h b/src/rootserver/ob_rs_rpc_processor.h index a6d79d066..734497b57 100644 --- a/src/rootserver/ob_rs_rpc_processor.h +++ b/src/rootserver/ob_rs_rpc_processor.h @@ -82,7 +82,7 @@ bool is_allow_when_drop_tenant(const obrpc::ObRpcPacketCode pcode) } class ObRootServerRPCProcessorBase { - public: +public: ObRootServerRPCProcessorBase(ObRootService& rs, const bool full_service, const bool major_freeze_done, const bool is_ddl_like, obrpc::ObDDLArg* arg) : root_service_(rs), @@ -92,7 +92,7 @@ class ObRootServerRPCProcessorBase { ddl_arg_(arg) {} - protected: +protected: int process_(const obrpc::ObRpcPacketCode pcode) __attribute__((noinline)) { int ret = common::OB_SUCCESS; @@ -221,7 +221,7 @@ class ObRootServerRPCProcessorBase { return common::OB_RS_NOT_MASTER; } - protected: +protected: ObRootService& root_service_; const bool full_service_; const bool major_freeze_done_; @@ -231,13 +231,13 @@ class ObRootServerRPCProcessorBase { template class ObRootServerRPCProcessor : public obrpc::ObCommonRpcProxy::Processor, public ObRootServerRPCProcessorBase { - public: +public: ObRootServerRPCProcessor(ObRootService& rs, const bool full_service, const bool major_freeze_done, const bool is_ddl_like, obrpc::ObDDLArg* arg = NULL) : ObRootServerRPCProcessorBase(rs, full_service, major_freeze_done, is_ddl_like, arg) {} - protected: +protected: virtual int before_process() { common::ObThreadFlags::set_rs_flag(); @@ -258,12 +258,12 @@ class ObRootServerRPCProcessor : public obrpc::ObCommonRpcProxy::Processor { \ - public: \ + public: \ explicit pname(ObRootService& rs) \ : ObRootServerRPCProcessor(rs, full_service, major_freeze_done, is_ddl_like, arg) \ {} \ \ - protected: \ + protected: \ virtual int leader_process() \ { \ return root_service_.stmt; \ diff --git a/src/rootserver/ob_rs_thread_checker.h b/src/rootserver/ob_rs_thread_checker.h index b28c0ab0b..efce4271e 100644 --- a/src/rootserver/ob_rs_thread_checker.h +++ b/src/rootserver/ob_rs_thread_checker.h @@ -20,18 +20,21 @@ namespace oceanbase { namespace rootserver { /// thread checker thread. class ObRsThreadChecker : public ObRsReentrantThread { - public: +public: ObRsThreadChecker(); virtual ~ObRsThreadChecker(); virtual void run3() override; - virtual int blocking_run() override { BLOCKING_RUN_IMPLEMENT(); } + virtual int blocking_run() override + { + BLOCKING_RUN_IMPLEMENT(); + } int init(); void check_loop(); int destroy(); - private: +private: bool inited_; #ifdef ERRSIM // for obtest static const int64_t CHECK_TIMEVAL_US = 1000LL * 1000LL; diff --git a/src/rootserver/ob_schema2ddl_sql.h b/src/rootserver/ob_schema2ddl_sql.h index ba93f38fc..c8d2d19d3 100644 --- a/src/rootserver/ob_schema2ddl_sql.h +++ b/src/rootserver/ob_schema2ddl_sql.h @@ -28,13 +28,13 @@ namespace rootserver { // Convert table schema to create table sql for creating table in mysql server. class ObSchema2DDLSql { - public: +public: ObSchema2DDLSql(); virtual ~ObSchema2DDLSql(); static int convert(const share::schema::ObTableSchema& table_schema, char* sql_buf, const int64_t buf_size); - private: +private: static int type2str(const share::schema::ObColumnSchemaV2& column_schema, char* buf, const int64_t buf_size); }; } // namespace rootserver diff --git a/src/rootserver/ob_schema_history_recycler.h b/src/rootserver/ob_schema_history_recycler.h index fa6cddd19..c31d391af 100644 --- a/src/rootserver/ob_schema_history_recycler.h +++ b/src/rootserver/ob_schema_history_recycler.h @@ -25,17 +25,17 @@ namespace oceanbase { namespace rootserver { class ObSchemaHistoryRecyclerIdling : public ObThreadIdling { - public: +public: explicit ObSchemaHistoryRecyclerIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual int64_t get_idle_interval_us(); - public: +public: const static int64_t DEFAULT_SCHEMA_HISTORY_RECYCLE_INTERVAL = 60 * 60 * 1000 * 1000L; // 1h }; struct ObFirstSchemaKey { - public: +public: ObFirstSchemaKey(); ~ObFirstSchemaKey(); bool operator==(const ObFirstSchemaKey& other) const; @@ -48,7 +48,7 @@ struct ObFirstSchemaKey { uint64_t hash() const; TO_STRING_KV(K_(first_schema_id)); - public: +public: union { uint64_t first_schema_id_; // without tenant_id uint64_t tenant_id_; @@ -70,7 +70,7 @@ struct ObFirstSchemaKey { }; struct ObSecondSchemaKey : public ObFirstSchemaKey { - public: +public: ObSecondSchemaKey(); ~ObSecondSchemaKey(); int assign(const ObSecondSchemaKey& other); @@ -83,7 +83,7 @@ struct ObSecondSchemaKey : public ObFirstSchemaKey { uint64_t hash() const; TO_STRING_KV(K_(first_schema_id), K_(second_schema_id)); - public: +public: union { uint64_t second_schema_id_; uint64_t column_id_; @@ -95,7 +95,7 @@ struct ObSecondSchemaKey : public ObFirstSchemaKey { }; struct ObThirdSchemaKey : public ObSecondSchemaKey { - public: +public: ObThirdSchemaKey(); ~ObThirdSchemaKey(); int assign(const ObThirdSchemaKey& other); @@ -108,7 +108,7 @@ struct ObThirdSchemaKey : public ObSecondSchemaKey { uint64_t hash() const; TO_STRING_KV(K_(first_schema_id), K_(second_schema_id), K_(third_schema_id)); - public: +public: union { uint64_t third_schema_id_; uint64_t sub_part_id_; @@ -117,7 +117,7 @@ struct ObThirdSchemaKey : public ObSecondSchemaKey { }; struct ObSystemVariableSchemaKey { - public: +public: ObSystemVariableSchemaKey(); ~ObSystemVariableSchemaKey(); bool operator==(const ObSystemVariableSchemaKey& other) const; @@ -130,26 +130,26 @@ struct ObSystemVariableSchemaKey { uint64_t hash() const; TO_STRING_KV(K_(zone), K_(name)); - public: +public: common::ObString zone_; common::ObString name_; }; struct ObSystemVariableCompressSchemaInfo { - public: +public: ObSystemVariableCompressSchemaInfo() : key_(), max_schema_version_(common::OB_INVALID_VERSION) {} ~ObSystemVariableCompressSchemaInfo() {} TO_STRING_KV(K_(key), K_(max_schema_version)); - public: +public: ObSystemVariableSchemaKey key_; int64_t max_schema_version_; }; struct ObRecycleSchemaValue { - public: +public: ObRecycleSchemaValue(); ~ObRecycleSchemaValue(); ObRecycleSchemaValue& operator=(const ObRecycleSchemaValue& other); @@ -158,28 +158,28 @@ struct ObRecycleSchemaValue { bool is_valid() const; TO_STRING_KV(K_(is_deleted), K_(max_schema_version), K_(record_cnt)); - public: +public: bool is_deleted_; int64_t max_schema_version_; int64_t record_cnt_; }; struct ObFirstCompressSchemaInfo { - public: +public: ObFirstCompressSchemaInfo() : key_(), max_schema_version_(common::OB_INVALID_VERSION) {} ~ObFirstCompressSchemaInfo() {} TO_STRING_KV(K_(key), K_(max_schema_version)); - public: +public: ObFirstSchemaKey key_; int64_t max_schema_version_; }; // Running in a single thread. class ObSchemaHistoryRecycler : public ObRsReentrantThread { - public: +public: ObSchemaHistoryRecycler(); virtual ~ObSchemaHistoryRecycler(); @@ -196,7 +196,7 @@ class ObSchemaHistoryRecycler : public ObRsReentrantThread { int get_recycle_schema_versions( const obrpc::ObGetRecycleSchemaVersionsArg& arg, obrpc::ObGetRecycleSchemaVersionsResult& result); - private: +private: int check_inner_stat(); bool is_valid_recycle_schema_version(const int64_t recycle_schema_version); int idle(); @@ -217,10 +217,10 @@ class ObSchemaHistoryRecycler : public ObRsReentrantThread { int update_recycle_schema_versions(const common::ObIArray& tenant_ids, common::hash::ObHashMap& recycle_schema_versions); - public: +public: static const int64_t BUCKET_NUM = 10; - private: +private: bool inited_; mutable ObSchemaHistoryRecyclerIdling idling_; share::schema::ObMultiVersionSchemaService* schema_service_; @@ -233,7 +233,7 @@ class ObSchemaHistoryRecycler : public ObRsReentrantThread { }; class ObIRecycleSchemaExecutor { - public: +public: enum RecycleMode { NONE = 0, RECYCLE_ONLY = 1, @@ -249,7 +249,7 @@ class ObIRecycleSchemaExecutor { static const int64_t COMPRESS_RECORD_THREHOLD = 10; static const int64_t BUCKET_NUM = 10000; - public: +public: ObIRecycleSchemaExecutor() = delete; ObIRecycleSchemaExecutor(const uint64_t tenant_id, const int64_t schema_version, const char* table_name, common::ObMySQLProxy* sql_proxy, ObSchemaHistoryRecycler* recycler); @@ -259,7 +259,7 @@ class ObIRecycleSchemaExecutor { static bool need_recycle(RecycleMode mode); static bool need_compress(RecycleMode mode); - protected: +protected: virtual bool is_valid() const = 0; int check_stop(); @@ -267,7 +267,7 @@ class ObIRecycleSchemaExecutor { virtual int recycle_schema_history() = 0; virtual int compress_schema_history() = 0; - protected: +protected: uint64_t tenant_id_; int64_t schema_version_; const char* table_name_; @@ -277,7 +277,7 @@ class ObIRecycleSchemaExecutor { }; class ObRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { - public: +public: ObRecycleSchemaExecutor() = delete; ObRecycleSchemaExecutor(const uint64_t tenant_id, const int64_t schema_version, const char* table_name, const char* schema_key_name, const RecycleMode mode, common::ObMySQLProxy* sql_proxy, @@ -285,7 +285,7 @@ class ObRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { virtual ~ObRecycleSchemaExecutor(); virtual int execute(); - private: +private: virtual bool is_valid() const; virtual int fill_schema_history_map(); virtual int recycle_schema_history(); @@ -305,7 +305,7 @@ class ObRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { const ObIArray& compress_schema_infos, common::ObSqlString& sql); virtual int batch_compress_schema_history(const common::ObIArray& compress_schema_infos); - private: +private: const char* schema_key_name_; const RecycleMode mode_; common::hash::ObHashMap @@ -314,14 +314,14 @@ class ObRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { }; class ObSecondRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { - public: +public: ObSecondRecycleSchemaExecutor() = delete; ObSecondRecycleSchemaExecutor(const uint64_t tenant_id, const int64_t schema_version, const char* table_name, const char* schema_key_name, const char* second_schema_key_name, common::ObMySQLProxy* sql_proxy, ObSchemaHistoryRecycler* recycler); virtual ~ObSecondRecycleSchemaExecutor(); - private: +private: virtual bool is_valid() const; virtual int fill_schema_history_map(); virtual int recycle_schema_history(); @@ -337,7 +337,7 @@ class ObSecondRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { const common::ObIArray& dropped_schema_keys, common::ObSqlString& sql); virtual int batch_recycle_schema_history(const common::ObIArray& dropped_schema_ids); - private: +private: const char* schema_key_name_; const char* second_schema_key_name_; common::hash::ObHashMap @@ -346,14 +346,14 @@ class ObSecondRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { }; class ObThirdRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { - public: +public: ObThirdRecycleSchemaExecutor() = delete; ObThirdRecycleSchemaExecutor(const uint64_t tenant_id, const int64_t schema_version, const char* table_name, const char* schema_key_name, const char* second_schema_key_name, const char* third_schema_key_name, common::ObMySQLProxy* sql_proxy, ObSchemaHistoryRecycler* recycler); virtual ~ObThirdRecycleSchemaExecutor(); - private: +private: virtual bool is_valid() const; virtual int fill_schema_history_map(); virtual int recycle_schema_history(); @@ -369,7 +369,7 @@ class ObThirdRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { const common::ObIArray& dropped_schema_keys, common::ObSqlString& sql); virtual int batch_recycle_schema_history(const common::ObIArray& dropped_schema_ids); - private: +private: const char* schema_key_name_; const char* second_schema_key_name_; const char* third_schema_key_name_; @@ -379,13 +379,13 @@ class ObThirdRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { }; class ObSystemVariableRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { - public: +public: ObSystemVariableRecycleSchemaExecutor() = delete; ObSystemVariableRecycleSchemaExecutor(const uint64_t tenant_id, const int64_t schema_version, const char* table_name, common::ObMySQLProxy* sql_proxy, ObSchemaHistoryRecycler* recycler); virtual ~ObSystemVariableRecycleSchemaExecutor(); - private: +private: virtual bool is_valid() const; virtual int fill_schema_history_map(); virtual int recycle_schema_history(); @@ -402,7 +402,7 @@ class ObSystemVariableRecycleSchemaExecutor : public ObIRecycleSchemaExecutor { virtual int batch_compress_schema_history( const common::ObIArray& compress_schema_infos); - private: +private: common::hash::ObHashMap schema_history_map_; common::ObArenaAllocator allocator_; diff --git a/src/rootserver/ob_schema_revise_executor.h b/src/rootserver/ob_schema_revise_executor.h index 8a6e806fa..83b258c73 100644 --- a/src/rootserver/ob_schema_revise_executor.h +++ b/src/rootserver/ob_schema_revise_executor.h @@ -30,7 +30,7 @@ namespace rootserver { class ObSchemaReviseExecutor; class ObDDLService; class ObSchemaReviseTask : public share::ObAsyncTask { - public: +public: explicit ObSchemaReviseTask(ObSchemaReviseExecutor& executor) : executor_(&executor) {} virtual ~ObSchemaReviseTask() = default; @@ -38,12 +38,12 @@ class ObSchemaReviseTask : public share::ObAsyncTask { share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; virtual int process() override; - private: +private: ObSchemaReviseExecutor* executor_; }; class ObSchemaReviseExecutor { - public: +public: ObSchemaReviseExecutor(); ~ObSchemaReviseExecutor() = default; int init(share::schema::ObMultiVersionSchemaService& schema_service, ObDDLService& ddl_service, @@ -53,7 +53,7 @@ class ObSchemaReviseExecutor { void start(); int stop(); - private: +private: int set_execute_mark(); int check_stop(); int check_schema_sync(); @@ -70,7 +70,7 @@ class ObSchemaReviseExecutor { const uint64_t tenant_id, ObIAllocator& allocator, share::schema::ObSchemaGetterGuard& schema_guard); int flush_schema_kv_cache(); - private: +private: bool is_inited_; bool is_stopped_; bool execute_; diff --git a/src/rootserver/ob_schema_split_executor.h b/src/rootserver/ob_schema_split_executor.h index af57619f9..e82c5fc1e 100644 --- a/src/rootserver/ob_schema_split_executor.h +++ b/src/rootserver/ob_schema_split_executor.h @@ -23,7 +23,7 @@ namespace rootserver { class ObSchemaSplitExecutor; class ObSchemaSplitTask : public share::ObAsyncTask { - public: +public: explicit ObSchemaSplitTask(ObSchemaSplitExecutor& schema_split_executor, ObRsJobType type) : schema_split_executor_(&schema_split_executor), type_(type) {} @@ -33,13 +33,13 @@ class ObSchemaSplitTask : public share::ObAsyncTask { share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; virtual int process(); - private: +private: ObSchemaSplitExecutor* schema_split_executor_; ObRsJobType type_; }; class ObSchemaSplitExecutor { - public: +public: ObSchemaSplitExecutor(); ~ObSchemaSplitExecutor() {} @@ -54,7 +54,7 @@ class ObSchemaSplitExecutor { void start(); int stop(); - private: +private: int set_execute_mark(); int do_execute(); @@ -76,7 +76,7 @@ class ObSchemaSplitExecutor { obrpc::ObTenantSchemaVersions& standby_schema_versions, bool& schema_sync); int migrate_core_table_schema(); - private: +private: bool inited_; bool stopped_; bool execute_; diff --git a/src/rootserver/ob_schema_spliter.h b/src/rootserver/ob_schema_spliter.h index 22fdf1aac..de0c458df 100644 --- a/src/rootserver/ob_schema_spliter.h +++ b/src/rootserver/ob_schema_spliter.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace rootserver { class ObSchemaSplitExecutor; class ObTableSchemaSpliter { - public: +public: ObTableSchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema, bool iter_sys) : executor_(executor), @@ -44,7 +44,7 @@ class ObTableSchemaSpliter { virtual int process(); virtual int process(const uint64_t tenant_id); - protected: +protected: typedef int (*convert_func_t)(const common::ObObj& src, common::ObObj& dst, common::ObIAllocator&); struct MapItem { @@ -57,7 +57,7 @@ class ObTableSchemaSpliter { }; class ObSplitTableIterator { - public: + public: ObSplitTableIterator(ObSchemaSplitExecutor& executor, common::ObMySQLProxy* sql_proxy) : executor_(executor), sql_proxy_(sql_proxy), @@ -76,12 +76,12 @@ class ObTableSchemaSpliter { int init(common::ObSqlString& base_sql, const uint64_t exec_tenant_id); int get_next_row(const common::ObNewRow*& row); - private: + private: void destroy(); int get_next_batch(); int check_stop(); - private: + private: static const int64_t MAX_FETCH_ROW_COUNT = 5000; ObSchemaSplitExecutor& executor_; common::ObMySQLProxy* sql_proxy_; @@ -94,7 +94,7 @@ class ObTableSchemaSpliter { bool is_inited_; }; - protected: +protected: virtual int build_column_mapping(); virtual int construct_base_sql(); virtual int add_extra_condition(); @@ -107,12 +107,12 @@ class ObTableSchemaSpliter { virtual int init_sys_iterator(const uint64_t tenant_id, ObSplitTableIterator& iter); virtual int init_tenant_iterator(const uint64_t tenant_id, ObSplitTableIterator& iter); - private: +private: virtual int add_convert_func(const share::schema::ObColumnSchemaV2& column, MapItem& item); virtual int batch_replace_rows(const uint64_t tenant_id, common::ObIArray& replace_rows); virtual int compare_obj(const common::ObObj& obj1, const common::ObObj& obj2); - protected: +protected: static const int64_t BATCH_REPLACE_ROW_COUNT = 10; static const int64_t DEFAULT_COLUMN_NUM = 10; ObSchemaSplitExecutor& executor_; @@ -129,7 +129,7 @@ class ObTableSchemaSpliter { #define DEF_SIMPLE_SCHEMA_SPLITER(TID, SchemaSpliter) \ class SchemaSpliter : public ObTableSchemaSpliter { \ - public: \ + public: \ SchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, \ common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema) \ : ObTableSchemaSpliter(executor, schema_service, sql_proxy, table_schema, false) \ @@ -207,7 +207,7 @@ DEF_SIMPLE_SCHEMA_SPLITER(OB_ALL_TENANT_PROFILE_HISTORY_TID, ObAllTenantProfileH #define DEF_SCHEMA_SPLITER_FILTER_INNER_TABLE(TID, SchemaSpliter) \ class SchemaSpliter : public ObTableSchemaSpliter { \ - public: \ + public: \ SchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, \ common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema) \ : ObTableSchemaSpliter(executor, schema_service, sql_proxy, table_schema, false) \ @@ -215,7 +215,7 @@ DEF_SIMPLE_SCHEMA_SPLITER(OB_ALL_TENANT_PROFILE_HISTORY_TID, ObAllTenantProfileH virtual ~SchemaSpliter() \ {} \ \ - private: \ + private: \ virtual int add_extra_condition() override; \ }; // migrate table by tenant_id & filter inner_table info @@ -228,7 +228,7 @@ DEF_SCHEMA_SPLITER_FILTER_INNER_TABLE(OB_ALL_DDL_OPERATION_TID, ObAllDdlOperatio #define DEF_SCHEMA_SPLITER_FILTER_TENANT_ID(TID, SchemaSpliter) \ class SchemaSpliter : public ObTableSchemaSpliter { \ - public: \ + public: \ SchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, \ common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema) \ : ObTableSchemaSpliter(executor, schema_service, sql_proxy, table_schema, false) \ @@ -236,7 +236,7 @@ DEF_SCHEMA_SPLITER_FILTER_INNER_TABLE(OB_ALL_DDL_OPERATION_TID, ObAllDdlOperatio virtual ~SchemaSpliter() \ {} \ \ - private: \ + private: \ virtual int quick_check(const uint64_t tenant_id, bool& passed) override; \ virtual int migrate(const uint64_t tenant_id) override; \ virtual int check(const uint64_t tenant_id) override; \ @@ -247,7 +247,7 @@ DEF_SCHEMA_SPLITER_FILTER_TENANT_ID(OB_ALL_TENANT_GC_PARTITION_INFO_TID, ObAllTe // split system variable schema from tenant schema class ObSysVarDDLOperationSchemaSpliter : public ObTableSchemaSpliter { - public: +public: ObSysVarDDLOperationSchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema) @@ -256,13 +256,13 @@ class ObSysVarDDLOperationSchemaSpliter : public ObTableSchemaSpliter { virtual ~ObSysVarDDLOperationSchemaSpliter() {} - private: +private: virtual int build_column_mapping() override; virtual int add_extra_condition() override; }; class ObAllClogHistoryInfoV2SchemaSpliter : public ObTableSchemaSpliter { - public: +public: ObAllClogHistoryInfoV2SchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema) @@ -271,12 +271,12 @@ class ObAllClogHistoryInfoV2SchemaSpliter : public ObTableSchemaSpliter { virtual ~ObAllClogHistoryInfoV2SchemaSpliter() {} - private: +private: virtual int quick_check(const uint64_t tenant_id, bool& passed) override; virtual int construct_sql(const uint64_t tenant_id, ObSqlString& sql) override; }; class ObAllTenantPartitionMetaTableSchemaSpliter : public ObTableSchemaSpliter { - public: +public: ObAllTenantPartitionMetaTableSchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema) @@ -285,14 +285,14 @@ class ObAllTenantPartitionMetaTableSchemaSpliter : public ObTableSchemaSpliter { virtual ~ObAllTenantPartitionMetaTableSchemaSpliter() {} - private: +private: virtual int quick_check(const uint64_t tenant_id, bool& passed) override; virtual int construct_sql(const uint64_t tenant_id, ObSqlString& sql) override; virtual int process(); }; class ObAllTableV2SchemaSpliter : public ObTableSchemaSpliter { - public: +public: ObAllTableV2SchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema) : ObTableSchemaSpliter(executor, schema_service, sql_proxy, table_schema, true) @@ -300,7 +300,7 @@ class ObAllTableV2SchemaSpliter : public ObTableSchemaSpliter { virtual ~ObAllTableV2SchemaSpliter() {} - private: +private: virtual int add_convert_func(const share::schema::ObColumnSchemaV2& column_schema, MapItem& item) override; virtual int construct_base_sql() override; virtual int construct_sql(const uint64_t tenant_id, const char* tname, common::ObSqlString& sql); @@ -310,7 +310,7 @@ class ObAllTableV2SchemaSpliter : public ObTableSchemaSpliter { }; class ObAllTableV2HistorySchemaSpliter : public ObTableSchemaSpliter { - public: +public: ObAllTableV2HistorySchemaSpliter(ObSchemaSplitExecutor& executor, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy* sql_proxy, share::schema::ObTableSchema& table_schema) @@ -319,7 +319,7 @@ class ObAllTableV2HistorySchemaSpliter : public ObTableSchemaSpliter { virtual ~ObAllTableV2HistorySchemaSpliter() {} - private: +private: virtual int add_convert_func(const share::schema::ObColumnSchemaV2& column_schema, MapItem& item) override; virtual int construct_base_sql() override; virtual int construct_sql(const uint64_t tenant_id, const char* tname, common::ObSqlString& sql); diff --git a/src/rootserver/ob_sequence_migrator.h b/src/rootserver/ob_sequence_migrator.h index a1e6e6649..5ebaf58a0 100644 --- a/src/rootserver/ob_sequence_migrator.h +++ b/src/rootserver/ob_sequence_migrator.h @@ -28,7 +28,7 @@ class ObMultiVersionSchemaService; namespace rootserver { class ObSequenceMigrator { - public: +public: ObSequenceMigrator(); virtual ~ObSequenceMigrator(); @@ -46,14 +46,14 @@ class ObSequenceMigrator { void start(); int stop(); - private: +private: int check_stop(); int set_migrate_mark(); int migrate(); int do_migrate(const uint64_t tenant_id); - private: +private: bool inited_; bool stopped_; bool migrate_; @@ -61,7 +61,7 @@ class ObSequenceMigrator { common::ObMySQLProxy* sql_proxy_; share::schema::ObMultiVersionSchemaService* schema_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSequenceMigrator); }; diff --git a/src/rootserver/ob_server_balance_plan.h b/src/rootserver/ob_server_balance_plan.h index 892191306..670453f9b 100644 --- a/src/rootserver/ob_server_balance_plan.h +++ b/src/rootserver/ob_server_balance_plan.h @@ -36,51 +36,51 @@ struct ServerBalancePlanTask { }; class ServerManager : public ObServerManager { - public: +public: ServerManager() : ObServerManager() {} virtual ~ServerManager() {} - public: +public: virtual int get_servers_of_zone( const common::ObZone& zone, common::ObArray& server_list) const override; virtual int get_server_status(const common::ObAddr& server, share::ObServerStatus& server_status) const override; - public: +public: int clone(ObServerManager& server_mgr); int reduce_disk_use(const common::ObAddr& server, const int64_t size); int add_disk_use(const common::ObAddr& server, const int64_t size); - private: +private: int find_server_status(const ObAddr& server, share::ObServerStatus*& status) const; }; class UnitManager : public ObUnitManager { - public: +public: UnitManager(ObServerManager& server_mgr, ObZoneManager& zone_mgr) : ObUnitManager(server_mgr, zone_mgr) {} virtual ~UnitManager() {} - private: +private: int migrate_unit(const uint64_t unit_id, const common::ObAddr& dst, const bool is_manual = false) override; int end_migrate_unit(const uint64_t unit_id, const EndMigrateOp end_migrate_op = COMMIT) override; }; class ServerBalancer : public ObServerBalancer { - public: +public: ServerBalancer() : ObServerBalancer(), task_iter_idx_(0), task_array_(), unit_iter_idx_(0), unit_distribution_() {} virtual ~ServerBalancer() {} - public: +public: int get_next_task(ServerBalancePlanTask& task); int get_next_unit_distribution(share::ObUnitInfo& unit); int generate_server_balance_plan(common::ObZone& zone); - private: +private: struct UnitIdCmp { UnitIdCmp() : ret_(common::OB_SUCCESS) {} @@ -105,7 +105,7 @@ class ServerBalancer : public ObServerBalancer { int ret_; }; - private: +private: virtual int do_migrate_unit_task(const common::ObIArray& task_array) override; virtual int do_migrate_unit_task(const common::ObIArray& task_array) override; int get_all_zone_units(const common::ObZone& zone, common::ObIArray& units); @@ -114,7 +114,7 @@ class ServerBalancer : public ObServerBalancer { int do_generate_server_balance_plan(const common::ObZone& zone); int execute_migrate_unit(const share::ObUnit& unit, const ObServerBalancer::UnitMigrateStat& task); - private: +private: int64_t task_iter_idx_; common::ObArray task_array_; int64_t unit_iter_idx_; @@ -122,7 +122,7 @@ class ServerBalancer : public ObServerBalancer { }; class CheckStopProvider : public share::ObCheckStopProvider { - public: +public: CheckStopProvider() {} virtual ~CheckStopProvider() @@ -134,7 +134,7 @@ class CheckStopProvider : public share::ObCheckStopProvider { }; class ObServerBalancePlan { - public: +public: ObServerBalancePlan(ObUnitManager& unit_mgr, ObILeaderCoordinator& leader_coordinator, ObServerManager& server_mgr, ObZoneManager& zone_mgr) : unit_mgr_(unit_mgr), @@ -154,17 +154,17 @@ class ObServerBalancePlan { virtual ~ObServerBalancePlan() {} - public: +public: int init(common::ObMySQLProxy& proxy, common::ObServerConfig& server_config, share::schema::ObMultiVersionSchemaService& schema_service, ObRootBalancer& root_balance); int generate_server_balance_plan(); int get_next_task(ServerBalancePlanTask& task); int get_next_unit_distribution(share::ObUnitInfo& unit); - private: +private: int clone_fake_unit_mgr(); - private: +private: ObUnitManager& unit_mgr_; ObILeaderCoordinator& leader_coordinator_; ObServerManager& server_mgr_; @@ -183,7 +183,7 @@ class ObServerBalancePlan { bool is_inited_; bool plan_generated_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObServerBalancePlan); }; diff --git a/src/rootserver/ob_server_balancer.h b/src/rootserver/ob_server_balancer.h index fdcc9b62b..9b166a7a7 100644 --- a/src/rootserver/ob_server_balancer.h +++ b/src/rootserver/ob_server_balancer.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace rootserver { template class Matrix { - public: +public: Matrix() : inner_array_(), row_count_(0), column_count_(0), is_inited_(false) {} virtual ~Matrix() {} int init(const int64_t row_count, const int64_t column_count); - public: +public: int set(const int64_t row, const int64_t column, const T& element); int get(const int64_t row, const int64_t column, T& element) const; const T* get(const int64_t row, const int64_t column) const; @@ -38,7 +38,7 @@ class Matrix { int sort_column_group(const int64_t start_column_idx, const int64_t column_count, Func& func); TO_STRING_KV(K(is_inited_), K(row_count_), K(column_count_), K(inner_array_)); - private: +private: ObArray inner_array_; int64_t row_count_; int64_t column_count_; @@ -210,7 +210,7 @@ class ObZoneManager; class ObUnitStatManager; // To balance the load of servers by migrating units. class ObServerBalancer { - public: +public: struct UnitMigrateStat { UnitMigrateStat() : tenant_id_(common::OB_INVALID_ID), original_pos_(), arranged_pos_(), unit_load_() {} @@ -224,7 +224,7 @@ class ObServerBalancer { TO_STRING_KV(K(tenant_id_), K(original_pos_), K(arranged_pos_), K(unit_load_)); }; - public: +public: ObServerBalancer(); virtual ~ObServerBalancer(); @@ -247,7 +247,7 @@ class ObServerBalancer { int check_tenant_group_config_legality( common::ObIArray& tenant_groups, bool& legal); - private: +private: bool check_inner_stat() const { return inited_; @@ -278,7 +278,7 @@ class ObServerBalancer { int try_cancel_migrate_unit(const share::ObUnit& unit, bool& is_canceled); // the new version server balance - private: +private: static const double CPU_EPSILON; static const double EPSILON; struct UnitMigrateStatCmp { @@ -652,7 +652,7 @@ class ObServerBalancer { }; class InnerTenantGroupBalanceStrategy { - public: + public: InnerTenantGroupBalanceStrategy(ObServerBalancer& host) : host_(host) {} virtual ~InnerTenantGroupBalanceStrategy() @@ -665,7 +665,7 @@ class ObServerBalancer { int coordinate_all_column_unit_group(const common::ObIArray& column_unit_num_array, Matrix& unit_migrate_stat_matrix, const common::ObIArray& unitgroup_loads); - protected: + protected: int coordinate_single_column_unit_group(const int64_t start_column_idx, const int64_t column_count, Matrix& unit_migrate_stat_matrix, const common::ObIArray& unitgroup_loads); int do_coordinate_single_column_unit_group(const int64_t start_column_idx, const int64_t column_count, @@ -681,12 +681,12 @@ class ObServerBalancer { int exchange_ug_between_server_loads(UnitGroupLoad& left_ug, const int64_t left_idx, ServerLoad& left_server, UnitGroupLoad& right_ug, const int64_t right_idx, ServerLoad& right_server); - protected: + protected: ObServerBalancer& host_; }; class CountBalanceStrategy : public InnerTenantGroupBalanceStrategy { - public: + public: CountBalanceStrategy(ObServerBalancer& host) : InnerTenantGroupBalanceStrategy(host) {} virtual ~CountBalanceStrategy() @@ -697,7 +697,7 @@ class ObServerBalancer { virtual int amend_ug_inter_ttg_server_load(ServerLoad* over_server_load, ServerLoad* under_server_load, TenantGroupBalanceInfo* balance_info, const double inter_ttg_upper_limit) override; - private: + private: int make_count_balanced(TenantGroupBalanceInfo& balance_info, Matrix& unit_migrate_stat_matrix, common::ObIArray& unitgroup_loads, common::ObIArray& server_loads); int do_make_count_balanced( @@ -730,7 +730,7 @@ class ObServerBalancer { UnitGroupLoad& right_ug, ServerLoad& right_server, bool& can_exchange); }; - protected: +protected: int check_can_execute_rebalance(const common::ObZone& zone, bool& can_execute_rebalance); int rebalance_servers_v2(const common::ObZone& zone); int generate_single_tenant_group( @@ -1022,7 +1022,7 @@ class ObServerBalancer { int get_server_balance_critical_disk_waterlevel(double& server_balance_critical_disk_waterlevel) const; int get_server_data_disk_usage_limit(double& data_disk_usage_limit) const; - protected: +protected: bool inited_; bool unit_migrated_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/ob_server_checker.h b/src/rootserver/ob_server_checker.h index 4343ae347..8fda7fe4a 100644 --- a/src/rootserver/ob_server_checker.h +++ b/src/rootserver/ob_server_checker.h @@ -22,7 +22,7 @@ class ObServerManager; class ObEmptyServerChecker; class ObServerChecker { - public: +public: ObServerChecker(); virtual ~ObServerChecker() {} @@ -32,15 +32,15 @@ class ObServerChecker { int try_delete_server(); int try_notify_empty_server_checker(); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObServerChecker); // function members int reuse_replica_count_mgr(); - private: +private: // data members bool inited_; ObServerManager* server_mgr_; diff --git a/src/rootserver/ob_server_manager.h b/src/rootserver/ob_server_manager.h index c383f901b..a0f43365d 100644 --- a/src/rootserver/ob_server_manager.h +++ b/src/rootserver/ob_server_manager.h @@ -39,7 +39,7 @@ class ObILeaderCoordinator; class ObFreezeInfoManager; class ObRebalanceTaskMgr; class ObIStatusChangeCallback { - public: +public: virtual int wakeup_balancer() = 0; virtual int wakeup_daily_merger() = 0; // FIXME(): make it suitable for different task type, this is just a sample iterface @@ -49,11 +49,11 @@ class ObIStatusChangeCallback { virtual int on_offline_server(const common::ObAddr& server) = 0; }; class ObIServerChangeCallback { - public: +public: virtual int on_server_change() = 0; }; class ObServerManager : public share::ObIServerTrace { - public: +public: typedef common::ObIArray ObIServerArray; typedef common::ObArray ObServerArray; typedef common::ObArray ObServerStatusArray; @@ -155,7 +155,7 @@ class ObServerManager : public share::ObIServerTrace { bool have_server_deleting() const; int check_all_server_active(bool& all_active) const; - protected: +protected: int construct_not_empty_server_set(common::hash::ObHashSet& not_empty_server_set); // update server status by lease_request; int process_report_status_change(const share::ObLeaseRequest& lease_request, share::ObServerStatus& server_status); @@ -178,7 +178,7 @@ class ObServerManager : public share::ObIServerTrace { virtual int start_server(const common::ObAddr& server, const common::ObZone& zone); virtual int stop_server(const common::ObAddr& server, const common::ObZone& zone); - protected: +protected: bool inited_; bool has_build_; // has been loaded from __all_server table @@ -206,16 +206,20 @@ ObIStatusChangeCallback& ObServerManager::get_status_change_callback() const } class ObHeartbeatChecker : public ObRsReentrantThread { - public: +public: ObHeartbeatChecker(); int init(ObServerManager& server_manager); virtual ~ObHeartbeatChecker(); virtual void run3() override; - virtual int blocking_run() override { BLOCKING_RUN_IMPLEMENT(); } + virtual int blocking_run() override + { + BLOCKING_RUN_IMPLEMENT(); + } int64_t get_schedule_interval() const override; + private: - static const int64_t CHECK_INTERVAL_US = 100 * 1000L; //100ms + static const int64_t CHECK_INTERVAL_US = 100 * 1000L; // 100ms bool inited_; ObServerManager* server_manager_; }; diff --git a/src/rootserver/ob_server_recovery_machine.h b/src/rootserver/ob_server_recovery_machine.h index 3756bfae1..4e0bc97de 100644 --- a/src/rootserver/ob_server_recovery_machine.h +++ b/src/rootserver/ob_server_recovery_machine.h @@ -62,13 +62,13 @@ class ObFreezeInfoManager; class ObUnitManager; class ObServerRecoveryMachineIdling : public ObThreadIdling { - public: +public: explicit ObServerRecoveryMachineIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual ~ObServerRecoveryMachineIdling() {} - public: +public: virtual int64_t get_idle_interval_us() { return 3600LL * 1000LL * 1000LL; @@ -115,7 +115,7 @@ enum class FileRecoveryStatus : int64_t { class ObServerRecoveryMachine; class CheckPgRecoveryFinishedTask : public common::IObDedupTask { - public: +public: CheckPgRecoveryFinishedTask(const common::ObAddr& server, const volatile bool& is_stopped, ObServerRecoveryMachine& host, share::ObPartitionTableOperator& pt_operator, share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& mysql_proxy) @@ -130,7 +130,7 @@ class CheckPgRecoveryFinishedTask : public common::IObDedupTask { virtual ~CheckPgRecoveryFinishedTask() {} - public: +public: // virtual interface virtual int64_t hash() const; virtual bool operator==(const common::IObDedupTask& other) const; @@ -144,10 +144,10 @@ class CheckPgRecoveryFinishedTask : public common::IObDedupTask { TO_STRING_KV(K(server_), K(is_stopped_)); - private: +private: int do_check_pg_recovery_finished(bool& is_finished); - private: +private: const common::ObAddr server_; const volatile bool& is_stopped_; ObServerRecoveryMachine& host_; @@ -155,12 +155,12 @@ class CheckPgRecoveryFinishedTask : public common::IObDedupTask { share::schema::ObMultiVersionSchemaService& schema_service_; common::ObMySQLProxy& mysql_proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(CheckPgRecoveryFinishedTask); }; class UpdateFileRecoveryStatusTask : public common::IObDedupTask { - public: +public: UpdateFileRecoveryStatusTask(const common::ObAddr& server, const common::ObAddr& dest_server, const uint64_t tenant_id, const int64_t file_id, const FileRecoveryStatus pre_status, const FileRecoveryStatus cur_status, const volatile bool& is_stopped, ObServerRecoveryMachine& host) @@ -177,7 +177,7 @@ class UpdateFileRecoveryStatusTask : public common::IObDedupTask { virtual ~UpdateFileRecoveryStatusTask() {} - public: +public: // virtual interface virtual int64_t hash() const; virtual bool operator==(const common::IObDedupTask& other) const; @@ -191,7 +191,7 @@ class UpdateFileRecoveryStatusTask : public common::IObDedupTask { TO_STRING_KV(K(server_), K(is_stopped_)); - private: +private: const common::ObAddr server_; const common::ObAddr dest_server_; const uint64_t tenant_id_; @@ -201,7 +201,7 @@ class UpdateFileRecoveryStatusTask : public common::IObDedupTask { const volatile bool& is_stopped_; ObServerRecoveryMachine& host_; - private: +private: DISALLOW_COPY_AND_ASSIGN(UpdateFileRecoveryStatusTask); }; @@ -230,7 +230,7 @@ struct RefugeeInfo { }; struct ObServerRecoveryTask { - public: +public: ObServerRecoveryTask(); virtual ~ObServerRecoveryTask(); TO_STRING_KV(K(server_), K(rescue_server_), K(progress_), K(refugee_infos_), K(split_server_log_status_), @@ -238,7 +238,7 @@ struct ObServerRecoveryTask { int get_refugee_info( const uint64_t tenant_id, const int64_t file_id, const common::ObAddr& dest_server, RefugeeInfo*& refugee_info); - public: +public: common::ObAddr server_; common::ObAddr rescue_server_; ServerRecoveryProgress progress_; @@ -258,7 +258,7 @@ struct SimpleSeqGenerator { return seq_++; } - private: +private: int64_t seq_; }; @@ -268,11 +268,11 @@ class ObServerRecoveryMachine : public ObRsReentrantThread { typedef common::hash::ObHashMap::iterator task_iterator; typedef common::hash::ObHashMap::const_iterator const_task_iterator; - public: +public: ObServerRecoveryMachine(); virtual ~ObServerRecoveryMachine(); - public: +public: virtual void run3() override; virtual int blocking_run() { @@ -291,7 +291,7 @@ class ObServerRecoveryMachine : public ObRsReentrantThread { const uint64_t tenant_id, const int64_t file_id, FileRecoveryStatus pre_status, FileRecoveryStatus cur_status); void stop(); - private: +private: // Machine const static const int64_t TASK_MAP_BUCKET_NUM = 2048; static const int64_t THREAD_CNT = 1; @@ -335,7 +335,7 @@ class ObServerRecoveryMachine : public ObRsReentrantThread { int launch_new_check_pg_recovery_finished(ObServerRecoveryTask* task); int submit_check_pg_recovery_finished_task(const common::ObAddr& server); - private: +private: bool inited_; bool loaded_; obrpc::ObSrvRpcProxy* rpc_proxy_; diff --git a/src/rootserver/ob_server_table_operator.h b/src/rootserver/ob_server_table_operator.h index ce5a3709f..40d44430d 100644 --- a/src/rootserver/ob_server_table_operator.h +++ b/src/rootserver/ob_server_table_operator.h @@ -31,7 +31,7 @@ class ObMySQLResult; } // namespace common namespace rootserver { class ObServerTableOperator { - public: +public: ObServerTableOperator(); virtual ~ObServerTableOperator(); @@ -50,10 +50,10 @@ class ObServerTableOperator { virtual int update_stop_time(const common::ObAddr& server, const int64_t stop_time); virtual int update_with_partition(const common::ObAddr& server, bool with_partition); - private: +private: int build_server_status(const common::sqlclient::ObMySQLResult& res, share::ObServerStatus& server_status) const; - private: +private: bool inited_; common::ObISQLClient* proxy_; }; diff --git a/src/rootserver/ob_shrink_resource_pool_checker.h b/src/rootserver/ob_shrink_resource_pool_checker.h index 96cd3c943..32ff8af8f 100644 --- a/src/rootserver/ob_shrink_resource_pool_checker.h +++ b/src/rootserver/ob_shrink_resource_pool_checker.h @@ -37,7 +37,7 @@ class ObLeaderCoordinator; class ObUnitManager; struct TenantBalanceStat; class ObShrinkResourcePoolChecker { - public: +public: ObShrinkResourcePoolChecker(volatile bool& is_stop) : is_stop_(is_stop), leader_coordinator_(NULL), @@ -54,17 +54,17 @@ class ObShrinkResourcePoolChecker { virtual ~ObShrinkResourcePoolChecker() {} - public: +public: int init(share::schema::ObMultiVersionSchemaService* schema_service, rootserver::ObLeaderCoordinator* leader_coordinator, obrpc::ObSrvRpcProxy* srv_rpc_proxy, common::ObAddr& addr, rootserver::ObUnitManager* unit_mgr, share::ObPartitionTableOperator* pt_operator, TenantBalanceStat* tenant_stat, ObRebalanceTaskMgr* rebalance_task_mgr, ObServerManager* server_mgr); - public: +public: int check_shrink_resource_pool_finished(); int try_shrink_tenant_resource_pools(int64_t& task_cnt); - private: +private: const int64_t NOT_IN_POOL_NON_PAXOS_SAFE_REMOVE_INTERVAL = 120 * 1000000; // 120s struct ZoneReplicas { common::ObZone zone_; @@ -81,7 +81,7 @@ class ObShrinkResourcePoolChecker { } }; - private: +private: int check_stop(); int check_shrink_resource_pool_finished_by_tenant( share::schema::ObSchemaGetterGuard& schema_guard, const uint64_t tenant_id); @@ -107,7 +107,7 @@ class ObShrinkResourcePoolChecker { bool is_non_paxos_replica(const int32_t replica_type); bool is_paxos_replica_V2(const int32_t replica_type); - private: +private: const volatile bool& is_stop_; rootserver::ObLeaderCoordinator* leader_coordinator_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/ob_single_partition_balance.h b/src/rootserver/ob_single_partition_balance.h index 112fc4472..23dca75f3 100644 --- a/src/rootserver/ob_single_partition_balance.h +++ b/src/rootserver/ob_single_partition_balance.h @@ -35,7 +35,7 @@ class ObZoneManager; class ObSinglePartBalance { // Outer calls need lock protection - public: +public: ObSinglePartBalance(); virtual ~ObSinglePartBalance() { @@ -54,7 +54,7 @@ class ObSinglePartBalance { int update_tenant_unit_replica_capacity( const uint64_t tenant_id, const common::ObIArray& tmp_ten_unit_reps); - private: +private: inline static bool compare_with_tenant_id( const share::TenantUnitRepCnt* lhs, const share::TenantUnitRepCnt& ten_unit_rep); inline static bool compare_with_tenant_id_up( @@ -74,7 +74,7 @@ class ObSinglePartBalance { const common::ObIArray& unit_infos, common::ObArray& unit_ids); int create_tenant_unit_rep(const common::ObIArray& unit_ids, const uint64_t tenant_id); - private: +private: bool inited_; ObUnitManager* unit_mgr_; ObZoneManager* zone_mgr_; diff --git a/src/rootserver/ob_single_zone_mode_migrate_replica.h b/src/rootserver/ob_single_zone_mode_migrate_replica.h index 72e8d84ff..048bfdd1c 100644 --- a/src/rootserver/ob_single_zone_mode_migrate_replica.h +++ b/src/rootserver/ob_single_zone_mode_migrate_replica.h @@ -36,7 +36,7 @@ class HashIndexCollection; } class ObSingleZoneModeMigrateReplica { - public: +public: ObSingleZoneModeMigrateReplica(); virtual ~ObSingleZoneModeMigrateReplica() {} @@ -45,7 +45,7 @@ class ObSingleZoneModeMigrateReplica { TenantBalanceStat& tenant_stat, share::ObCheckStopProvider& check_stop_provider); int migrate_replica(int64_t& task_cnt); - private: +private: int migrate_not_inner_table_replica(const Partition& p, const Partition*& first_migrate_p, Replica& dest_replica, bool& small_tenant, common::ObIArray& task_info_array, int64_t& task_cnt); int get_random_dest(const Partition& partition, const Replica& pr, Replica& dest_replica, Replica& dest); @@ -60,7 +60,7 @@ class ObSingleZoneModeMigrateReplica { return check_stop_provider_->check_stop(); } - private: +private: bool inited_; common::ObServerConfig* config_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/ob_snapshot_info_manager.h b/src/rootserver/ob_snapshot_info_manager.h index ea7f890b3..416af4d7c 100644 --- a/src/rootserver/ob_snapshot_info_manager.h +++ b/src/rootserver/ob_snapshot_info_manager.h @@ -22,7 +22,7 @@ class ObSnapshotInfo; namespace rootserver { class ObZoneManager; class ObSnapshotInfoManager { - public: +public: ObSnapshotInfoManager() : self_addr_() {} virtual ~ObSnapshotInfoManager() @@ -41,13 +41,13 @@ class ObSnapshotInfoManager { int get_snapshot_count( common::ObMySQLProxy& proxy, const int64_t tenant_id, share::ObSnapShotType snapshot_type, int64_t& count); - private: +private: int set_index_building_snapshot( common::ObMySQLTransaction& trans, const int64_t index_table_id, const int64_t snapshot_ts); DISALLOW_COPY_AND_ASSIGN(ObSnapshotInfoManager); - private: +private: common::ObAddr self_addr_; }; } // namespace rootserver diff --git a/src/rootserver/ob_startup_progress_tracker.h b/src/rootserver/ob_startup_progress_tracker.h index 62f8fd18d..185df7343 100644 --- a/src/rootserver/ob_startup_progress_tracker.h +++ b/src/rootserver/ob_startup_progress_tracker.h @@ -31,14 +31,14 @@ class ObMultiVersionSchemaService; namespace rootserver { class ObServerManager; class ObStartupProgressTracker { - public: +public: ObStartupProgressTracker(); virtual ~ObStartupProgressTracker(); int init(ObServerManager& server_manager, obrpc::ObSrvRpcProxy& rpc_proxy, share::schema::ObMultiVersionSchemaService& schema_service); int track_startup_progress(bool& is_finished); - private: +private: typedef common::hash::ObHashMap LeaderStatusMap; static const int64_t LEADER_STATUS_MAP_BUCKT_NUM = 1024 * 512; @@ -53,14 +53,14 @@ class ObStartupProgressTracker { const int64_t writable_count, const int64_t recovering_count, const int64_t without_leader_count); int check_cancel() const; - private: +private: bool inited_; ObServerManager* server_manager_; obrpc::ObSrvRpcProxy* rpc_proxy_; share::schema::ObMultiVersionSchemaService* schema_service_; LeaderStatusMap leader_status_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStartupProgressTracker); }; } // end namespace rootserver diff --git a/src/rootserver/ob_system_admin_util.h b/src/rootserver/ob_system_admin_util.h index 15f3b3377..41fc62992 100644 --- a/src/rootserver/ob_system_admin_util.h +++ b/src/rootserver/ob_system_admin_util.h @@ -158,7 +158,7 @@ struct ObSystemAdminCtx { }; class ObSystemAdminUtil { - public: +public: const static int64_t WAIT_LEADER_SWITCH_TIMEOUT_US = 10 * 1000 * 1000; // 10s const static int64_t WAIT_LEADER_SWITCH_INTERVAL_US = 300 * 1000; // 300ms @@ -176,15 +176,15 @@ class ObSystemAdminUtil { const common::ObZone& zone, const share::ObPartitionInfo& partition, share::ObPartitionReplica*& replica, const ObRebalanceTaskType& task_type); - protected: +protected: const ObSystemAdminCtx& ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSystemAdminUtil); }; class ObAdminSwitchReplicaRole : public ObSystemAdminUtil { - public: +public: explicit ObAdminSwitchReplicaRole(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminSwitchReplicaRole() @@ -192,7 +192,7 @@ class ObAdminSwitchReplicaRole : public ObSystemAdminUtil { int execute(const obrpc::ObAdminSwitchReplicaRoleArg& arg); - private: +private: static const int64_t TENANT_BUCKET_NUM = 1000; static int alloc_tenant_id_set(common::hash::ObHashSet& tenant_id_set); @@ -212,12 +212,12 @@ class ObAdminSwitchReplicaRole : public ObSystemAdminUtil { int switch_replica_by_server(const common::ObAddr& server, const uint64_t& tenant_id, const common::ObRole role); int switch_replica_by_zone(const common::ObZone& zone, const uint64_t& tenant_id, const common::ObRole role); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminSwitchReplicaRole); }; class ObAdminChangeReplica : public ObSystemAdminUtil { - public: +public: explicit ObAdminChangeReplica(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminChangeReplica() @@ -225,7 +225,7 @@ class ObAdminChangeReplica : public ObSystemAdminUtil { int execute(const obrpc::ObAdminChangeReplicaArg& arg); - private: +private: int build_task(const obrpc::ObAdminChangeReplicaArg& arg, const share::ObPartitionInfo& info, ObTypeTransformTask& task, bool force_cmd); int check_parameters(const obrpc::ObAdminChangeReplicaArg& arg, const share::ObPartitionInfo& info); @@ -234,7 +234,7 @@ class ObAdminChangeReplica : public ObSystemAdminUtil { }; class ObAdminDropReplica : public ObSystemAdminUtil { - public: +public: explicit ObAdminDropReplica(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminDropReplica() @@ -242,7 +242,7 @@ class ObAdminDropReplica : public ObSystemAdminUtil { int execute(const obrpc::ObAdminDropReplicaArg& arg); - private: +private: int before_process(const obrpc::ObAdminDropReplicaArg& arg, const share::ObPartitionInfo& info); int build_task(const obrpc::ObAdminDropReplicaArg& arg, const share::ObPartitionInfo& info, const share::ObPartitionReplica* replica, bool force_cmd); @@ -252,12 +252,12 @@ class ObAdminDropReplica : public ObSystemAdminUtil { const OnlineReplica& remove_member, const common::ObPartitionKey& key, bool force_cmd); int wait_remove_member_finish(const obrpc::ObAdminDropReplicaArg& arg, const OnlineReplica& remove_member); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminDropReplica); }; class ObAdminMigrateReplica : public ObSystemAdminUtil { - public: +public: explicit ObAdminMigrateReplica(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminMigrateReplica() @@ -265,16 +265,16 @@ class ObAdminMigrateReplica : public ObSystemAdminUtil { int execute(const obrpc::ObAdminMigrateReplicaArg& arg); - private: +private: int build_task(const obrpc::ObAdminMigrateReplicaArg& arg, const share::ObPartitionInfo& info, bool force_cmd); int check_parameters(const obrpc::ObAdminMigrateReplicaArg& arg, const share::ObPartitionInfo& info); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminMigrateReplica); }; class ObAdminCallServer : public ObSystemAdminUtil { - public: +public: explicit ObAdminCallServer(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminCallServer() @@ -284,12 +284,12 @@ class ObAdminCallServer : public ObSystemAdminUtil { virtual int call_server(const common::ObAddr& server) = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminCallServer); }; class ObAdminReportReplica : public ObAdminCallServer { - public: +public: explicit ObAdminReportReplica(const ObSystemAdminCtx& ctx) : ObAdminCallServer(ctx) {} virtual ~ObAdminReportReplica() @@ -299,12 +299,12 @@ class ObAdminReportReplica : public ObAdminCallServer { virtual int call_server(const common::ObAddr& server); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminReportReplica); }; class ObAdminRecycleReplica : public ObAdminCallServer { - public: +public: explicit ObAdminRecycleReplica(const ObSystemAdminCtx& ctx) : ObAdminCallServer(ctx) {} virtual ~ObAdminRecycleReplica() @@ -314,12 +314,12 @@ class ObAdminRecycleReplica : public ObAdminCallServer { virtual int call_server(const common::ObAddr& server); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminRecycleReplica); }; class ObAdminClearLocationCache : public ObAdminCallServer { - public: +public: explicit ObAdminClearLocationCache(const ObSystemAdminCtx& ctx) : ObAdminCallServer(ctx) {} virtual ~ObAdminClearLocationCache() @@ -329,12 +329,12 @@ class ObAdminClearLocationCache : public ObAdminCallServer { virtual int call_server(const common::ObAddr& server); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminClearLocationCache); }; class ObAdminReloadGts : public ObSystemAdminUtil { - public: +public: explicit ObAdminReloadGts(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminReloadGts() @@ -342,12 +342,12 @@ class ObAdminReloadGts : public ObSystemAdminUtil { int execute(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminReloadGts); }; class ObAdminRefreshMemStat : public ObAdminCallServer { - public: +public: explicit ObAdminRefreshMemStat(const ObSystemAdminCtx& ctx) : ObAdminCallServer(ctx) {} virtual ~ObAdminRefreshMemStat() @@ -356,12 +356,12 @@ class ObAdminRefreshMemStat : public ObAdminCallServer { int execute(const obrpc::ObAdminRefreshMemStatArg& arg); virtual int call_server(const common::ObAddr& server); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminRefreshMemStat); }; class ObAdminReloadUnit : public ObSystemAdminUtil { - public: +public: explicit ObAdminReloadUnit(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminReloadUnit() @@ -369,12 +369,12 @@ class ObAdminReloadUnit : public ObSystemAdminUtil { int execute(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminReloadUnit); }; class ObAdminReloadServer : public ObSystemAdminUtil { - public: +public: explicit ObAdminReloadServer(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminReloadServer() @@ -382,12 +382,12 @@ class ObAdminReloadServer : public ObSystemAdminUtil { int execute(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminReloadServer); }; class ObAdminReloadZone : public ObSystemAdminUtil { - public: +public: explicit ObAdminReloadZone(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminReloadZone() @@ -395,12 +395,12 @@ class ObAdminReloadZone : public ObSystemAdminUtil { int execute(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminReloadZone); }; class ObAdminClearMergeError : public ObSystemAdminUtil { - public: +public: explicit ObAdminClearMergeError(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminClearMergeError() @@ -408,12 +408,12 @@ class ObAdminClearMergeError : public ObSystemAdminUtil { int execute(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminClearMergeError); }; class ObAdminMerge : public ObSystemAdminUtil { - public: +public: explicit ObAdminMerge(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminMerge() @@ -421,12 +421,12 @@ class ObAdminMerge : public ObSystemAdminUtil { int execute(const obrpc::ObAdminMergeArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminMerge); }; class ObAdminClearRoottable : public ObSystemAdminUtil { - public: +public: explicit ObAdminClearRoottable(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminClearRoottable() @@ -434,12 +434,12 @@ class ObAdminClearRoottable : public ObSystemAdminUtil { int execute(const obrpc::ObAdminClearRoottableArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminClearRoottable); }; class ObAdminRefreshSchema : public ObAdminCallServer { - public: +public: explicit ObAdminRefreshSchema(const ObSystemAdminCtx& ctx) : ObAdminCallServer(ctx), schema_version_(0), schema_info_() {} @@ -450,16 +450,16 @@ class ObAdminRefreshSchema : public ObAdminCallServer { virtual int call_server(const common::ObAddr& server); - private: +private: int64_t schema_version_; share::schema::ObRefreshSchemaInfo schema_info_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminRefreshSchema); }; class ObAdminSetConfig : public ObSystemAdminUtil { - public: +public: static const uint64_t OB_PARAMETER_SEED_ID = UINT64_MAX; explicit ObAdminSetConfig(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} @@ -468,20 +468,20 @@ class ObAdminSetConfig : public ObSystemAdminUtil { int execute(obrpc::ObAdminSetConfigArg& arg); - private: +private: class ObServerConfigChecker : public common::ObServerConfig {}; class ObTenantConfigChecker : public omt::ObTenantConfig {}; - private: +private: int verify_config(obrpc::ObAdminSetConfigArg& arg); int update_config(obrpc::ObAdminSetConfigArg& arg, int64_t new_version); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminSetConfig); }; class ObAdminMigrateUnit : public ObSystemAdminUtil { - public: +public: explicit ObAdminMigrateUnit(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminMigrateUnit() @@ -489,12 +489,12 @@ class ObAdminMigrateUnit : public ObSystemAdminUtil { int execute(const obrpc::ObAdminMigrateUnitArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminMigrateUnit); }; class ObAdminSchemaSplitExecutor : public ObSystemAdminUtil { - public: +public: explicit ObAdminSchemaSplitExecutor(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminSchemaSplitExecutor() @@ -502,12 +502,12 @@ class ObAdminSchemaSplitExecutor : public ObSystemAdminUtil { int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminSchemaSplitExecutor); }; class ObAdminUpgradeVirtualSchema : public ObSystemAdminUtil { - public: +public: explicit ObAdminUpgradeVirtualSchema(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminUpgradeVirtualSchema() @@ -516,15 +516,15 @@ class ObAdminUpgradeVirtualSchema : public ObSystemAdminUtil { int execute(); int execute(const share::schema::ObSchemaOperation& operation); - private: +private: int upgrade(share::schema::ObTableSchema& table); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminUpgradeVirtualSchema); }; class ObAdminUpgradeCmd : public ObSystemAdminUtil { - public: +public: explicit ObAdminUpgradeCmd(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminUpgradeCmd() @@ -532,12 +532,12 @@ class ObAdminUpgradeCmd : public ObSystemAdminUtil { int execute(const obrpc::Bool& upgrade); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminUpgradeCmd); }; class ObAdminRollingUpgradeCmd : public ObSystemAdminUtil { - public: +public: explicit ObAdminRollingUpgradeCmd(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminRollingUpgradeCmd() @@ -545,7 +545,7 @@ class ObAdminRollingUpgradeCmd : public ObSystemAdminUtil { int execute(const obrpc::ObAdminRollingUpgradeArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminRollingUpgradeCmd); }; @@ -577,7 +577,7 @@ class ObAdminRollingUpgradeCmd : public ObSystemAdminUtil { DECLARE_ENUM(ObInnerJob, inner_job, OB_INNER_JOB_DEF); class ObAdminRunJob : public ObSystemAdminUtil { - public: +public: explicit ObAdminRunJob(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminRunJob() @@ -585,12 +585,12 @@ class ObAdminRunJob : public ObSystemAdminUtil { int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminRunJob); }; class ObAdminCheckPartitionTable : public ObAdminCallServer { - public: +public: explicit ObAdminCheckPartitionTable(const ObSystemAdminCtx& ctx) : ObAdminCallServer(ctx) {} virtual ~ObAdminCheckPartitionTable() @@ -600,12 +600,12 @@ class ObAdminCheckPartitionTable : public ObAdminCallServer { virtual int call_server(const common::ObAddr& server); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminCheckPartitionTable); }; class ObAdminRootInspection : public ObSystemAdminUtil { - public: +public: explicit ObAdminRootInspection(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminRootInspection() @@ -613,12 +613,12 @@ class ObAdminRootInspection : public ObSystemAdminUtil { int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminRootInspection); }; class ObAdminStatisticPrimaryZoneEntityCount : public ObSystemAdminUtil { - public: +public: explicit ObAdminStatisticPrimaryZoneEntityCount(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminStatisticPrimaryZoneEntityCount() @@ -626,12 +626,12 @@ class ObAdminStatisticPrimaryZoneEntityCount : public ObSystemAdminUtil { int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminStatisticPrimaryZoneEntityCount); }; class ObAdminCreateHaGtsUtil : public ObSystemAdminUtil { - public: +public: explicit ObAdminCreateHaGtsUtil(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminCreateHaGtsUtil() @@ -639,12 +639,12 @@ class ObAdminCreateHaGtsUtil : public ObSystemAdminUtil { int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminCreateHaGtsUtil); }; class ObAdminCreateInnerSchema : public ObSystemAdminUtil { - public: +public: explicit ObAdminCreateInnerSchema(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminCreateInnerSchema() @@ -652,12 +652,12 @@ class ObAdminCreateInnerSchema : public ObSystemAdminUtil { int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminCreateInnerSchema); }; class ObAdminSchemaRevise : public ObSystemAdminUtil { - public: +public: explicit ObAdminSchemaRevise(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminSchemaRevise() @@ -665,46 +665,46 @@ class ObAdminSchemaRevise : public ObSystemAdminUtil { int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminSchemaRevise); }; class ObTenantServerAdminUtil : public ObSystemAdminUtil { - public: +public: explicit ObTenantServerAdminUtil(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} int get_all_servers(common::ObIArray& servers); int get_tenant_servers(const uint64_t tenant_id, common::ObIArray& servers); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantServerAdminUtil); }; class ObAdminUpgradeStorageFormatVersionExecutor : public ObSystemAdminUtil { - public: +public: explicit ObAdminUpgradeStorageFormatVersionExecutor(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminUpgradeStorageFormatVersionExecutor() = default; int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminUpgradeStorageFormatVersionExecutor); }; class ObAdminUpdateTableSchemaVersion : public ObSystemAdminUtil { - public: +public: explicit ObAdminUpdateTableSchemaVersion(const ObSystemAdminCtx& ctx) : ObSystemAdminUtil(ctx) {} virtual ~ObAdminUpdateTableSchemaVersion() = default; int execute(const obrpc::ObRunJobArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminUpdateTableSchemaVersion); }; class ObAdminFlushCache : public ObTenantServerAdminUtil { - public: +public: explicit ObAdminFlushCache(const ObSystemAdminCtx& ctx) : ObTenantServerAdminUtil(ctx) {} virtual ~ObAdminFlushCache() @@ -714,12 +714,12 @@ class ObAdminFlushCache : public ObTenantServerAdminUtil { int execute(const obrpc::ObAdminFlushCacheArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminFlushCache); }; class ObAdminLoadBaseline : public ObTenantServerAdminUtil { - public: +public: explicit ObAdminLoadBaseline(const ObSystemAdminCtx& ctx) : ObTenantServerAdminUtil(ctx) {} virtual ~ObAdminLoadBaseline() @@ -729,12 +729,12 @@ class ObAdminLoadBaseline : public ObTenantServerAdminUtil { int execute(const obrpc::ObAdminLoadBaselineArg& arg); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAdminLoadBaseline); }; class ObAdminSetTP : public ObAdminCallServer { - public: +public: explicit ObAdminSetTP(const ObSystemAdminCtx& ctx, obrpc::ObAdminSetTPArg arg) : ObAdminCallServer(ctx), arg_(arg) {} virtual ~ObAdminSetTP() @@ -743,7 +743,7 @@ class ObAdminSetTP : public ObAdminCallServer { int execute(const obrpc::ObAdminSetTPArg& arg); virtual int call_server(const common::ObAddr& server); - private: +private: obrpc::ObAdminSetTPArg arg_; DISALLOW_COPY_AND_ASSIGN(ObAdminSetTP); }; diff --git a/src/rootserver/ob_thread_idling.h b/src/rootserver/ob_thread_idling.h index 70fe88a6b..97a597dd9 100644 --- a/src/rootserver/ob_thread_idling.h +++ b/src/rootserver/ob_thread_idling.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace rootserver { class ObThreadIdling { - public: +public: explicit ObThreadIdling(volatile bool& stop); virtual ~ObThreadIdling() {} @@ -30,7 +30,7 @@ class ObThreadIdling { virtual int64_t get_idle_interval_us() = 0; - private: +private: common::ObThreadCond cond_; volatile bool& stop_; int64_t wakeup_cnt_; diff --git a/src/rootserver/ob_unit_balancer.h b/src/rootserver/ob_unit_balancer.h index 925393202..448f14282 100644 --- a/src/rootserver/ob_unit_balancer.h +++ b/src/rootserver/ob_unit_balancer.h @@ -30,7 +30,7 @@ class ObRebalanceTaskMgr; class ObZoneManager; // The algorithm to balance the replicas in units of one tenant. class ObUnitBalancer { - public: +public: ObUnitBalancer(); virtual ~ObUnitBalancer() {} @@ -47,9 +47,9 @@ class ObUnitBalancer { disable_random_behavior_ = disable; } - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUnitBalancer); // function members @@ -64,7 +64,7 @@ class ObUnitBalancer { // debug int print_pg_distribution(); - private: +private: // data members bool inited_; bool disable_random_behavior_; diff --git a/src/rootserver/ob_unit_load_history_table_operator.h b/src/rootserver/ob_unit_load_history_table_operator.h index 0a8b4afe7..756da2091 100644 --- a/src/rootserver/ob_unit_load_history_table_operator.h +++ b/src/rootserver/ob_unit_load_history_table_operator.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace rootserver { class ObUnitLoadHistoryTableOperator : public share::ObEventHistoryTableOperator { - public: +public: virtual ~ObUnitLoadHistoryTableOperator() {} @@ -29,7 +29,7 @@ class ObUnitLoadHistoryTableOperator : public share::ObEventHistoryTableOperator int add_load(int64_t tenant_id, ObResourceWeight& weight, UnitStat& us); - private: +private: ObUnitLoadHistoryTableOperator() {} DISALLOW_COPY_AND_ASSIGN(ObUnitLoadHistoryTableOperator); diff --git a/src/rootserver/ob_unit_manager.h b/src/rootserver/ob_unit_manager.h index 4802bb46e..e19fb6dd0 100644 --- a/src/rootserver/ob_unit_manager.h +++ b/src/rootserver/ob_unit_manager.h @@ -45,7 +45,7 @@ class UnitStat; class ObFetchPrimaryDDLOperator; class ObRootBalancer; class ObUnitManager { - public: +public: friend class ServerBalancer; friend class ObServerBalancer; friend class ObRsGtsUnitDistributor; @@ -68,11 +68,11 @@ class ObUnitManager { TO_STRING_KV(K_(zone), K_(unit_infos)); - public: + public: common::ObZone zone_; common::ObArray unit_infos_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ZoneUnit); }; @@ -94,7 +94,7 @@ class ObUnitManager { } TO_STRING_KV(KP_(unit), KP_(unit_config), KP_(pool)); - public: + public: share::ObUnit* unit_; share::ObUnitConfig* unit_config_; share::ObResourcePool* pool_; @@ -147,7 +147,7 @@ class ObUnitManager { common::ObArray mark_delete_indexes_; bool all_normal_unit_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObServerLoad); }; @@ -173,7 +173,7 @@ class ObUnitManager { typedef common::hash::ObHashMap IdPoolMap; typedef common::hash::ObHashMap*> TenantPoolsMap; - public: +public: ObUnitManager(ObServerManager& server_mgr, ObZoneManager& zone_mgr); virtual ~ObUnitManager(); @@ -320,7 +320,7 @@ class ObUnitManager { int distrubte_for_unit_intersect(const uint64_t tenant_id, const common::ObIArray& pools); //////////////////////////////////////////////////////////////// - private: +private: static const int64_t UNIT_MAP_BUCKET_NUM = 1024 * 64; static const int64_t CONFIG_MAP_BUCKET_NUM = 1024; static const int64_t CONFIG_REF_COUNT_MAP_BUCKET_NUM = 1024; @@ -351,16 +351,16 @@ class ObUnitManager { TO_STRING_KV(K_(zone), K_(unit_ptrs)); - public: + public: common::ObZone zone_; common::ObSEArray unit_ptrs_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ZoneUnitPtr); }; class UnitGroupIdCmp { - public: + public: UnitGroupIdCmp() : ret_(common::OB_SUCCESS) {} ~UnitGroupIdCmp() @@ -383,7 +383,7 @@ class ObUnitManager { return ret_; } - private: + private: int ret_; }; @@ -396,7 +396,7 @@ class ObUnitManager { }; enum AlterResourceErr { MIN_CPU = 0, MAX_CPU, MIN_MEM, MAX_MEM, ALT_ERR }; - protected: +protected: static const int64_t NOTIFY_RESOURCE_RPC_TIMEOUT = 9 * 1000000; // 9 second // for ObServerBalancer IdPoolMap& get_id_pool_map() @@ -737,7 +737,7 @@ class ObUnitManager { int sum_servers_resources( ObUnitPlacementStrategy::ObServerResource& server_resource, const share::ObUnitConfig& unit_config); - protected: +protected: int inner_try_notify_tenant_server_unit_resource(const uint64_t tenant_id, const bool is_delete, /*Expansion of semantics, possibly deleting resources*/ ObNotifyTenantServerResourceProxy& notify_proxy, const share::ObResourcePool& new_pool, @@ -804,7 +804,7 @@ class ObUnitManager { const bool grant, const ObIArray& pool_names, const uint64_t tenant_id); int inner_try_delete_migrate_unit_resource(const uint64_t unit_id, const common::ObAddr& migrate_from_server); - private: +private: bool inited_; bool loaded_; common::ObMySQLProxy* proxy_; diff --git a/src/rootserver/ob_unit_placement_strategy.h b/src/rootserver/ob_unit_placement_strategy.h index 5761bded3..02c5f50a7 100644 --- a/src/rootserver/ob_unit_placement_strategy.h +++ b/src/rootserver/ob_unit_placement_strategy.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace rootserver { class ObUnitPlacementStrategy { - public: +public: struct ObServerResource : public ObIServerResource { common::ObAddr addr_; double capacity_[RES_MAX]; @@ -55,7 +55,7 @@ class ObUnitPlacementStrategy { virtual int choose_server(common::ObArray& servers, const share::ObUnitConfig& unit_config, common::ObAddr& server, const common::ObZone& zone, int64_t& find_index) = 0; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUnitPlacementStrategy); }; @@ -63,7 +63,7 @@ class ObUnitPlacementStrategy { // New strategy of V1.4 // Dot-Product Greedy Vector Balancing class ObUnitPlacementDPStrategy : public ObUnitPlacementStrategy { - public: +public: ObUnitPlacementDPStrategy(double hard_limit = 1.0) : hard_limit_(hard_limit) {} virtual ~ObUnitPlacementDPStrategy() = default; @@ -72,18 +72,18 @@ class ObUnitPlacementDPStrategy : public ObUnitPlacementStrategy { virtual int choose_server(common::ObArray& servers, const share::ObUnitConfig& unit_config, common::ObAddr& server, const common::ObZone& zone, int64_t& find_index) override; - private: +private: bool have_enough_resource(const ObServerResource& server, const share::ObUnitConfig& unit_config); // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUnitPlacementDPStrategy); - private: +private: double hard_limit_; }; // Old Best Fit of V1.3, only consider cpu resource class ObUnitPlacementBestFitStrategy : public ObUnitPlacementStrategy { - public: +public: ObUnitPlacementBestFitStrategy(double soft_limit) : soft_limit_(soft_limit) {} virtual ~ObUnitPlacementBestFitStrategy() = default; @@ -91,44 +91,44 @@ class ObUnitPlacementBestFitStrategy : public ObUnitPlacementStrategy { virtual int choose_server(common::ObArray& servers, const share::ObUnitConfig& unit_config, common::ObAddr& server, const common::ObZone& zone, int64_t& find_index) override; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUnitPlacementBestFitStrategy); // function members bool have_enough_resource(const ObServerResource& server, const share::ObUnitConfig& unit_config); - private: +private: // data members double soft_limit_; }; // Old Least Load First of V1.3, only consider cpu resource class ObUnitPlacementFFDStrategy : public ObUnitPlacementStrategy { - public: +public: ObUnitPlacementFFDStrategy(double hard_limit) : hard_limit_(hard_limit) {} virtual ~ObUnitPlacementFFDStrategy() = default; virtual int choose_server(common::ObArray& servers, const share::ObUnitConfig& unit_config, common::ObAddr& server, const common::ObZone& zone, int64_t& find_index) override; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUnitPlacementFFDStrategy); // function members bool have_enough_resource(const ObServerResource& server, const share::ObUnitConfig& unit_config); - private: +private: // data members double hard_limit_; }; // Old strategy of V1.3 class ObUnitPlacementHybridStrategy : public ObUnitPlacementStrategy { - public: +public: ObUnitPlacementHybridStrategy(double soft_limit, double hard_limit) : best_fit_first_(soft_limit), least_load_first_(hard_limit) {} @@ -138,13 +138,13 @@ class ObUnitPlacementHybridStrategy : public ObUnitPlacementStrategy { virtual int choose_server(common::ObArray& servers, const share::ObUnitConfig& unit_config, common::ObAddr& server, const common::ObZone& zone, int64_t& find_index) override; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUnitPlacementHybridStrategy); // function members - private: +private: // data members ObUnitPlacementBestFitStrategy best_fit_first_; ObUnitPlacementFFDStrategy least_load_first_; diff --git a/src/rootserver/ob_unit_stat_manager.h b/src/rootserver/ob_unit_stat_manager.h index e64b646f9..82b1c448d 100644 --- a/src/rootserver/ob_unit_stat_manager.h +++ b/src/rootserver/ob_unit_stat_manager.h @@ -25,7 +25,7 @@ class ObMultiVersionSchemaService; namespace rootserver { class ObUnitManager; class ObUnitStatManager { - public: +public: ObUnitStatManager(); virtual ~ObUnitStatManager() = default; @@ -35,7 +35,7 @@ class ObUnitStatManager { virtual int gather_stat(); virtual int get_unit_stat(uint64_t unit_id, share::ObUnitStat& unit_stat); - private: +private: bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; ObUnitManager* unit_mgr_; diff --git a/src/rootserver/ob_update_rs_list_task.h b/src/rootserver/ob_update_rs_list_task.h index b6a59abfe..3a6b2af8e 100644 --- a/src/rootserver/ob_update_rs_list_task.h +++ b/src/rootserver/ob_update_rs_list_task.h @@ -30,7 +30,7 @@ class ObServerManager; class ObMultiClusterManager; class ObZoneManager; class ObUpdateRsListTask : public share::ObAsyncTask { - public: +public: ObUpdateRsListTask(); virtual ~ObUpdateRsListTask(); @@ -47,21 +47,21 @@ class ObUpdateRsListTask : public share::ObAsyncTask { static int check_rs_list_diff(const share::ObIAddrList& l, const share::ObIAddrList& r, bool& different); static int check_rs_list_subset(const share::ObIAddrList& l, const share::ObIAddrList& r, bool& is_subset); - private: +private: int check_need_update(const share::ObIAddrList& rs_list, const share::ObIAddrList& readonly_rs_list, const common::ObClusterType cluster_type, const bool rs_list_diff_member_list, bool& need_update, bool& inner_need_update); - public: +public: // encapsulate the operation of g_wait_cnt_ static bool try_lock(); static void unlock(); static void clear_lock(); - private: +private: static volatile int64_t g_wait_cnt_; - private: +private: bool inited_; share::ObPartitionTableOperator* pt_operator_; share::ObRootAddrAgent* root_addr_agent_; @@ -71,12 +71,12 @@ class ObUpdateRsListTask : public share::ObAsyncTask { bool force_update_; common::ObAddr self_addr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUpdateRsListTask); }; class ObUpdateRsListTimerTask : public common::ObAsyncTimerTask { - public: +public: const static int64_t RETRY_INTERVAL = 600 * 1000L * 1000L; // 10min ObUpdateRsListTimerTask(ObRootService& rs); virtual ~ObUpdateRsListTimerTask() @@ -90,7 +90,7 @@ class ObUpdateRsListTimerTask : public common::ObAsyncTimerTask { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: +private: ObRootService& rs_; DISALLOW_COPY_AND_ASSIGN(ObUpdateRsListTimerTask); }; diff --git a/src/rootserver/ob_upgrade_executor.h b/src/rootserver/ob_upgrade_executor.h index eca306fc5..4e6fac0a6 100644 --- a/src/rootserver/ob_upgrade_executor.h +++ b/src/rootserver/ob_upgrade_executor.h @@ -24,7 +24,7 @@ namespace rootserver { class ObUpgradeExecutor; class ObUpgradeTask : public share::ObAsyncTask { - public: +public: explicit ObUpgradeTask(ObUpgradeExecutor& upgrade_executor, const int64_t version) : upgrade_executor_(&upgrade_executor), version_(version) {} @@ -34,13 +34,13 @@ class ObUpgradeTask : public share::ObAsyncTask { share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; virtual int process(); - private: +private: ObUpgradeExecutor* upgrade_executor_; int64_t version_; }; class ObUpgradeExecutor : public share::ObCheckStopProvider { - public: +public: ObUpgradeExecutor(); ~ObUpgradeExecutor() {} @@ -55,7 +55,7 @@ class ObUpgradeExecutor : public share::ObCheckStopProvider { void start(); int stop(); - private: +private: int set_execute_mark(); int check_schema_sync(); @@ -63,7 +63,7 @@ class ObUpgradeExecutor : public share::ObCheckStopProvider { int run_upgrade_job(const int64_t version); - private: +private: bool inited_; bool stopped_; bool execute_; diff --git a/src/rootserver/ob_upgrade_storage_format_version_executor.h b/src/rootserver/ob_upgrade_storage_format_version_executor.h index d066f5871..46dcbe9bc 100644 --- a/src/rootserver/ob_upgrade_storage_format_version_executor.h +++ b/src/rootserver/ob_upgrade_storage_format_version_executor.h @@ -23,7 +23,7 @@ class ObUpgradeStorageFormatVersionExecutor; class ObRootService; class ObDDLService; class ObUpgradeStorageFormatVersionTask : public share::ObAsyncTask { - public: +public: explicit ObUpgradeStorageFormatVersionTask(ObUpgradeStorageFormatVersionExecutor& executor) : executor_(&executor) {} virtual ~ObUpgradeStorageFormatVersionTask() = default; @@ -31,12 +31,12 @@ class ObUpgradeStorageFormatVersionTask : public share::ObAsyncTask { share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; virtual int process() override; - private: +private: ObUpgradeStorageFormatVersionExecutor* executor_; }; class ObUpgradeStorageFormatVersionExecutor { - public: +public: ObUpgradeStorageFormatVersionExecutor(); ~ObUpgradeStorageFormatVersionExecutor() = default; int init(ObRootService& root_service, ObDDLService& ddl_service); @@ -45,13 +45,13 @@ class ObUpgradeStorageFormatVersionExecutor { void start(); int stop(); - private: +private: int set_execute_mark(); int check_stop(); int upgrade_storage_format_version(); int check_schema_sync(); - private: +private: bool is_inited_; bool is_stopped_; bool execute_; diff --git a/src/rootserver/ob_vtable_location_getter.h b/src/rootserver/ob_vtable_location_getter.h index 44515aafd..023dd239d 100644 --- a/src/rootserver/ob_vtable_location_getter.h +++ b/src/rootserver/ob_vtable_location_getter.h @@ -25,12 +25,12 @@ class ObServerManager; class ObUnitManager; class ObVTableLocationGetter { - public: +public: ObVTableLocationGetter(ObServerManager& server_mgr, ObUnitManager& unit_mgr); virtual ~ObVTableLocationGetter(); int get(const uint64_t table_id, common::ObSArray& locations); - private: +private: int get_only_rs_vtable_location(const uint64_t table_id, common::ObSArray& locations); int get_global_vtable_location(const uint64_t table_id, common::ObSArray& locations); int get_tenant_vtable_location(const uint64_t table_id, common::ObSArray& locations); @@ -40,7 +40,7 @@ class ObVTableLocationGetter { ObServerManager& server_mgr_; ObUnitManager& unit_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVTableLocationGetter); }; diff --git a/src/rootserver/ob_zone_manager.h b/src/rootserver/ob_zone_manager.h index ab7ff5a2f..f67dcca6f 100644 --- a/src/rootserver/ob_zone_manager.h +++ b/src/rootserver/ob_zone_manager.h @@ -38,7 +38,7 @@ class ObILeaderCoordinator; class FakeZoneManager; class ObLocalityDistribution; class ObZoneManagerBase : public share::ObIZoneTrace { - public: +public: friend class FakeZoneMgr; ObZoneManagerBase(); virtual ~ObZoneManagerBase(); @@ -128,7 +128,7 @@ class ObZoneManagerBase : public share::ObIZoneTrace { DECLARE_TO_STRING; - private: +private: int update_zone_status(const common::ObZone& zone, const share::ObZoneStatus::Status& status); int inner_try_update_global_last_merged_version(); @@ -145,13 +145,13 @@ class ObZoneManagerBase : public share::ObIZoneTrace { int construct_zone_region_list(common::ObIArray& zone_region_list, const common::ObIArray& zone_list); - protected: +protected: common::SpinRWLock lock_; // only used for copying data to/from shadow_ static int copy_infos(ObZoneManagerBase& dest, const ObZoneManagerBase& src); friend class FakeZoneManager; - private: +private: bool inited_; bool loaded_; share::ObZoneInfo zone_infos_[common::MAX_ZONE_NUM]; @@ -162,76 +162,80 @@ class ObZoneManagerBase : public share::ObIZoneTrace { common::ObMySQLProxy* proxy_; ObILeaderCoordinator* leader_coordinator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObZoneManagerBase); }; class ObZoneManager : public ObZoneManagerBase { - public: +public: ObZoneManager(); virtual ~ObZoneManager(); - int init(common::ObMySQLProxy &proxy, - ObILeaderCoordinator &leader_coordinator); + int init(common::ObMySQLProxy& proxy, ObILeaderCoordinator& leader_coordinator); virtual int reload() override; - virtual int add_zone(const common::ObZone &zone, const common::ObRegion ®ion, - const common::ObIDC &idc, const common::ObZoneType &zone_type) override; - virtual int delete_zone(const common::ObZone &zone) override; - virtual int start_zone(const common::ObZone &zone) override; - virtual int stop_zone(const common::ObZone &zone) override; - virtual int alter_zone(const obrpc::ObAdminZoneArg &arg) override; + virtual int add_zone(const common::ObZone& zone, const common::ObRegion& region, const common::ObIDC& idc, + const common::ObZoneType& zone_type) override; + virtual int delete_zone(const common::ObZone& zone) override; + virtual int start_zone(const common::ObZone& zone) override; + virtual int stop_zone(const common::ObZone& zone) override; + virtual int alter_zone(const obrpc::ObAdminZoneArg& arg) override; virtual int set_merge_error(const int64_t merge_error) override; virtual int try_update_global_last_merged_version() override; virtual int generate_next_global_broadcast_version() override; - virtual int set_zone_merging(const common::ObZone &zone) override; - virtual int inc_start_merge_fail_times(const common::ObZone &zone) override; - virtual int clear_zone_merging(const common::ObZone &zone) override; - virtual int start_zone_merge(const common::ObZone &zone) override; - virtual int finish_zone_merge(const common::ObZone &zone, - const int64_t merged_version, const int64_t all_merged_version) override; - virtual int set_zone_merge_timeout(const common::ObZone &zone) override; + virtual int set_zone_merging(const common::ObZone& zone) override; + virtual int inc_start_merge_fail_times(const common::ObZone& zone) override; + virtual int clear_zone_merging(const common::ObZone& zone) override; + virtual int start_zone_merge(const common::ObZone& zone) override; + virtual int finish_zone_merge( + const common::ObZone& zone, const int64_t merged_version, const int64_t all_merged_version) override; + virtual int set_zone_merge_timeout(const common::ObZone& zone) override; virtual int update_privilege_version(const int64_t privilege_version) override; virtual int update_config_version(const int64_t config_version) override; virtual int update_proposal_frozen_version(const int64_t proposal_frozen_version) override; virtual int set_frozen_info(const int64_t frozen_version, const int64_t frozen_time) override; - virtual int set_frozen_info(common::ObISQLClient &sql_client, const int64_t frozen_version, const int64_t frozen_time) override; + virtual int set_frozen_info( + common::ObISQLClient& sql_client, const int64_t frozen_version, const int64_t frozen_time) override; virtual int set_try_frozen_version(const int64_t try_frozen_version) override; - virtual int check_merge_order(const common::ObString &list_str) override; - virtual int check_merge_order(const common::ObIArray &merge_list) override; + virtual int check_merge_order(const common::ObString& list_str) override; + virtual int check_merge_order(const common::ObIArray& merge_list) override; - virtual int suspend_merge(const common::ObZone &zone) override; - virtual int resume_merge(const common::ObZone &zone) override; + virtual int suspend_merge(const common::ObZone& zone) override; + virtual int resume_merge(const common::ObZone& zone) override; virtual int reset_global_merge_status() override; virtual int set_warm_up_start_time(const int64_t time_ts) override; - std::default_random_engine &get_random_engine() { return random_; } + std::default_random_engine& get_random_engine() + { + return random_; + } virtual int renew_snapshot_gc_ts() override; virtual int set_storage_format_version(const int64_t version) override; + public: class ObZoneManagerShadowGuard { - public: + public: ObZoneManagerShadowGuard( const common::SpinRWLock& lock, ObZoneManagerBase& zone_mgr, ObZoneManagerBase& shadow, int& ret); ~ObZoneManagerShadowGuard(); - private: + private: common::SpinRWLock& lock_; ObZoneManagerBase& zone_mgr_; ObZoneManagerBase& shadow_; int& ret_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObZoneManagerShadowGuard); }; friend class FakeZoneManager; - private: +private: common::SpinRWLock write_lock_; ObZoneManagerBase shadow_; // this proxy is not inited and diff --git a/src/rootserver/ob_zone_recovery_task_mgr.h b/src/rootserver/ob_zone_recovery_task_mgr.h index 753205903..1092bbdcc 100644 --- a/src/rootserver/ob_zone_recovery_task_mgr.h +++ b/src/rootserver/ob_zone_recovery_task_mgr.h @@ -31,13 +31,13 @@ class ObZoneRecoveryTaskMgr; class ObZoneServerRecoveryMachine; class ObZoneRecoveryTaskKey { - public: +public: ObZoneRecoveryTaskKey() : tenant_id_(OB_INVALID_ID), file_id_(-1), hash_value_(0) {} virtual ~ObZoneRecoveryTaskKey() {} - public: +public: bool is_valid() const; bool operator==(const ObZoneRecoveryTaskKey& that) const; bool operator!=(const ObZoneRecoveryTaskKey& that) const @@ -49,10 +49,10 @@ class ObZoneRecoveryTaskKey { int init(const uint64_t tenant_id, const int64_t file_id, const common::ObAddr& server); TO_STRING_KV(K_(tenant_id), K_(file_id), K_(server)); - private: +private: uint64_t inner_hash() const; - private: +private: uint64_t tenant_id_; int64_t file_id_; common::ObAddr server_; @@ -64,12 +64,12 @@ typedef common::hash::ObReferedMap ObServerTas typedef common::hash::ObReferedMap ObTenantTaskStatMap; class ObZoneRecoveryTask : public common::ObDLinkBase { - public: +public: typedef common::hash::ObHashMap TaskMap; friend class ObZoneRecoveryTaskMgr; - public: +public: ObZoneRecoveryTask() : task_id_(), task_key_(), @@ -90,7 +90,7 @@ class ObZoneRecoveryTask : public common::ObDLinkBase { virtual ~ObZoneRecoveryTask() {} - public: +public: int build(const common::ObAddr& src_server, const int64_t src_svr_seq, const common::ObAddr& dest_server, const int64_t dest_svr_seq, const uint64_t tenant_id, const int64_t file_id, const uint64_t dest_unit_id); int build_by_task_result(const obrpc::ObFastRecoveryTaskReplyBatchArg& arg, int& ret_code); @@ -176,10 +176,10 @@ class ObZoneRecoveryTask : public common::ObDLinkBase { TO_STRING_KV(K(task_id_), K(task_key_), K(generate_time_), K(schedule_time_), K(execute_time_), K(src_server_), K(src_svr_seq_), K(dest_server_), K(dest_svr_seq_), K(tenant_id_), K(file_id_), K(dest_unit_id_)); - private: +private: int set_task_id(const common::ObAddr& addr); - private: +private: share::ObTaskId task_id_; ObZoneRecoveryTaskKey task_key_; ObServerTaskStatMap::Item* src_server_stat_; @@ -198,7 +198,7 @@ class ObZoneRecoveryTask : public common::ObDLinkBase { }; class ObZoneRecoveryTaskQueue { - public: +public: typedef common::ObDList TaskList; typedef common::hash::ObHashMap TaskMap; @@ -258,10 +258,10 @@ class ObZoneRecoveryTaskQueue { } void reuse(); - private: +private: int do_push_task(ObZoneRecoveryTaskMgr& task_mgr, const ObZoneRecoveryTask& task); - private: +private: bool is_inited_; common::ObServerConfig* config_; ObTenantTaskStatMap* tenant_stat_map_; @@ -271,12 +271,12 @@ class ObZoneRecoveryTaskQueue { TaskList schedule_list_; TaskMap task_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObZoneRecoveryTaskQueue); }; class ObZoneRecoveryTaskMgr : public ObRsReentrantThread { - public: +public: const static int64_t TASK_QUEUE_LIMIT = 1 << 16; const static int64_t QUEUE_LOW_TASK_CNT = TASK_QUEUE_LIMIT / 4; const static int64_t ONCE_ADD_TASK_CNT = TASK_QUEUE_LIMIT / 2; @@ -284,10 +284,10 @@ class ObZoneRecoveryTaskMgr : public ObRsReentrantThread { const static int64_t DATA_IN_CLEAR_INTERVAL = 20 * 60 * 1000000; // 60 min; const static int64_t CHECK_IN_PROGRESS_INTERVAL_PER_TASK = 5 * 1000000; // task 5s every task - public: +public: ObZoneRecoveryTaskMgr(); - public: +public: virtual void run3() override; virtual int blocking_run() { @@ -295,7 +295,7 @@ class ObZoneRecoveryTaskMgr : public ObRsReentrantThread { } void stop(); - public: +public: int init(common::ObServerConfig& config, ObServerManager* server_mgr, ObUnitManager* unit_mgr, obrpc::ObSrvRpcProxy* rpc_proxy, ObZoneServerRecoveryMachine* server_recovery_machine); @@ -323,7 +323,7 @@ class ObZoneRecoveryTaskMgr : public ObRsReentrantThread { } int get_all_tasks(common::ObIAllocator& allocator, common::ObIArray& tasks); - private: +private: common::ObThreadCond& get_cond() { return cond_; @@ -345,7 +345,7 @@ class ObZoneRecoveryTaskMgr : public ObRsReentrantThread { void try_clear_server_data_in_limit(const ObAddr& addr); int notify_server_recovery_machine(const ObZoneRecoveryTask& task, const int ret_code); - private: +private: bool inited_; volatile bool reach_concurrency_limited_; common::ObServerConfig* config_; @@ -359,7 +359,7 @@ class ObZoneRecoveryTaskMgr : public ObRsReentrantThread { obrpc::ObSrvRpcProxy* rpc_proxy_; ObZoneServerRecoveryMachine* server_recovery_machine_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObZoneRecoveryTaskMgr); }; diff --git a/src/rootserver/ob_zone_server_recovery_machine.h b/src/rootserver/ob_zone_server_recovery_machine.h index 512e065a8..5ebd88d69 100644 --- a/src/rootserver/ob_zone_server_recovery_machine.h +++ b/src/rootserver/ob_zone_server_recovery_machine.h @@ -71,7 +71,7 @@ enum class ZoneFileRecoveryStatus : int64_t { class ObServerRecoveryInstance; class UpdateFileRecoveryStatusTaskV2 : public common::IObDedupTask { - public: +public: UpdateFileRecoveryStatusTaskV2(const common::ObZone& zone, const common::ObAddr& server, const int64_t svr_seq, const common::ObAddr& dest_server, const int64_t dest_svr_seq, const uint64_t tenant_id, const int64_t file_id, const ZoneFileRecoveryStatus pre_status, const ZoneFileRecoveryStatus cur_status, const volatile bool& is_stopped, @@ -92,7 +92,7 @@ class UpdateFileRecoveryStatusTaskV2 : public common::IObDedupTask { virtual ~UpdateFileRecoveryStatusTaskV2() {} - public: +public: virtual int64_t hash() const; virtual bool operator==(const common::IObDedupTask& other) const; virtual int64_t get_deep_copy_size() const; @@ -106,7 +106,7 @@ class UpdateFileRecoveryStatusTaskV2 : public common::IObDedupTask { TO_STRING_KV( K(zone_), K(server_), K(svr_seq_), K(dest_server_), K(dest_svr_seq_), K(tenant_id_), K(file_id_), K(is_stopped_)); - private: +private: const common::ObZone zone_; const common::ObAddr server_; const int64_t svr_seq_; @@ -119,12 +119,12 @@ class UpdateFileRecoveryStatusTaskV2 : public common::IObDedupTask { const volatile bool& is_stopped_; ObServerRecoveryInstance& host_; - private: +private: DISALLOW_COPY_AND_ASSIGN(UpdateFileRecoveryStatusTaskV2); }; struct RefugeeServerInfo { - public: +public: RefugeeServerInfo() : zone_(), server_(), @@ -135,13 +135,13 @@ struct RefugeeServerInfo { virtual ~RefugeeServerInfo() {} - public: +public: int init(const common::ObZone& zone, const common::ObAddr& server, const int64_t svr_seq, const common::ObAddr& rescue_server, ZoneServerRecoveryProgress progress); TO_STRING_KV(K_(zone), K_(server), K_(svr_seq), K_(rescue_server), K_(rescue_progress)); int assign(const RefugeeServerInfo& that); - public: +public: common::ObZone zone_; common::ObAddr server_; int64_t svr_seq_; @@ -150,7 +150,7 @@ struct RefugeeServerInfo { }; struct RefugeeFileInfo { - public: +public: RefugeeFileInfo() : server_(), svr_seq_(OB_INVALID_SVR_SEQ), @@ -168,7 +168,7 @@ struct RefugeeFileInfo { K_(file_recovery_status)); int assign(const RefugeeFileInfo& that); - public: +public: common::ObAddr server_; int64_t svr_seq_; uint64_t tenant_id_; @@ -180,7 +180,7 @@ struct RefugeeFileInfo { }; struct ObRecoveryTask { - public: +public: ObRecoveryTask(); virtual ~ObRecoveryTask(); TO_STRING_KV(K(zone_), K(server_), K(svr_seq_), K(rescue_server_), K(progress_), K(refugee_file_infos_), @@ -188,7 +188,7 @@ struct ObRecoveryTask { int get_refugee_datafile_info(const uint64_t tenant_id, const int64_t file_id, const common::ObAddr& dest_server, RefugeeFileInfo*& refugee_info); - public: +public: common::ObZone zone_; common::ObAddr server_; int64_t svr_seq_; @@ -209,18 +209,18 @@ struct ThisSimpleSeqGenerator { return seq_++; } - private: +private: int64_t seq_; }; class RecoveryPersistenceProxy { - public: +public: RecoveryPersistenceProxy() {} virtual ~RecoveryPersistenceProxy() {} - public: +public: int get_server_recovery_persistence_status(common::ObIArray& refugee_server_array); int get_server_datafile_recovery_persistence_status(const common::ObZone& zone, const common::ObAddr& refugee_server, @@ -253,11 +253,11 @@ class ObServerRecoveryInstance { typedef common::hash::ObHashMap::iterator task_iterator; typedef common::hash::ObHashMap::const_iterator const_task_iterator; - public: +public: explicit ObServerRecoveryInstance(volatile bool& stop); virtual ~ObServerRecoveryInstance(); - public: +public: int init(obrpc::ObSrvRpcProxy* rpc_proxy, rootserver::ObServerManager* server_mgr, rootserver::ObZoneManager* zone_mgr, rootserver::ObUnitManager* unit_mgr, rootserver::ObEmptyServerChecker* empty_server_checker, ObZoneRecoveryTaskMgr* zone_recovery_task_mgr); @@ -276,7 +276,7 @@ class ObServerRecoveryInstance { int modify_server_status(ObRecoveryTask* task); int finish_recover_server_takenover_by_rs(ObRecoveryTask* task); - public: +public: int on_pre_process_server_reply( const common::ObAddr& server, const common::ObAddr& rescue_server, const int ret_code); int on_recover_pg_file_reply(const ObZoneRecoveryTask& task, const int ret_code); @@ -284,14 +284,14 @@ class ObServerRecoveryInstance { const common::ObAddr& dest_server, const int64_t dest_svr_seq, const uint64_t tenant_id, const int64_t file_id, ZoneFileRecoveryStatus pre_status, ZoneFileRecoveryStatus cur_status); - private: +private: bool check_stop() { return stop_; } int main_round(); - private: +private: // main round sub recovery task int discover_new_server_recovery_task(); int drive_existing_server_recovery_task(); @@ -303,7 +303,7 @@ class ObServerRecoveryInstance { int reload_file_recovery_status(); int reload_file_recovery_status_by_server(ObRecoveryTask* task); - private: +private: // Machine const static const int64_t TASK_MAP_BUCKET_NUM = 2048; static const int64_t PG_RECOVERY_TIMEOUT = 10 * 60 * 1000000; // 10min @@ -331,7 +331,7 @@ class ObServerRecoveryInstance { const uint64_t dest_unit_id, RefugeeFileInfo& refugee_info); int trigger_recover_file_task(ObRecoveryTask* task, RefugeeFileInfo& refugee_info); - private: +private: bool inited_; bool loaded_; obrpc::ObSrvRpcProxy* rpc_proxy_; @@ -350,13 +350,13 @@ class ObServerRecoveryInstance { }; class ObZoneServerRecoveryMachineIdling : public ObThreadIdling { - public: +public: explicit ObZoneServerRecoveryMachineIdling(volatile bool& stop) : ObThreadIdling(stop) {} virtual ~ObZoneServerRecoveryMachineIdling() {} - public: +public: virtual int64_t get_idle_interval_us() { return 3600LL * 1000LL * 1000LL; @@ -364,21 +364,21 @@ class ObZoneServerRecoveryMachineIdling : public ObThreadIdling { }; class ObZoneServerRecoveryMachine : public ObRsReentrantThread { - public: +public: ObZoneServerRecoveryMachine(ObZoneRecoveryTaskMgr& recovery_task_mgr) : inited_(false), recovery_task_mgr_(recovery_task_mgr), server_recovery_instance_(stop_), idling_(stop_) {} virtual ~ObZoneServerRecoveryMachine() {} - public: +public: virtual void run3() override; virtual int blocking_run() { BLOCKING_RUN_IMPLEMENT(); } - public: +public: int init(obrpc::ObSrvRpcProxy* rpc_proxy, rootserver::ObServerManager* server_mgr, rootserver::ObZoneManager* zone_mgr, rootserver::ObUnitManager* unit_mgr, rootserver::ObEmptyServerChecker* empty_server_checker); @@ -392,13 +392,13 @@ class ObZoneServerRecoveryMachine : public ObRsReentrantThread { int check_can_recover_server(const common::ObAddr& server, bool& can_recover); int recover_server_takenover_by_rs(const common::ObAddr& server); - private: +private: int process_daemon_recovery(); int reset_run_condition(); - private: +private: static const int64_t INTRA_RUNNING_IDLING_US = 1 * 1000000; // 1s - private: +private: bool inited_; ObZoneRecoveryTaskMgr& recovery_task_mgr_; ObServerRecoveryInstance server_recovery_instance_; diff --git a/src/rootserver/ob_zone_unit_provider.h b/src/rootserver/ob_zone_unit_provider.h index b564803b4..255abc777 100644 --- a/src/rootserver/ob_zone_unit_provider.h +++ b/src/rootserver/ob_zone_unit_provider.h @@ -31,7 +31,7 @@ typedef common::ObSEArray ZoneUnitPtrArray; typedef common::ObSEArray ZoneUnitArray; class ObZoneUnitAdaptor { - public: +public: virtual const share::ObUnitInfo* at(int64_t idx) const = 0; virtual int64_t count() const = 0; virtual int get_target_unit_idx(const int64_t unit_offset, common::hash::ObHashSet& unit_set, @@ -40,7 +40,7 @@ class ObZoneUnitAdaptor { }; class ObZoneUnitsProvider { - public: +public: virtual int find_zone(const common::ObZone& zone, const ObZoneUnitAdaptor*& zua) = 0; virtual int get_all_zone_units(ZoneUnitArray& zone_unit) const = 0; virtual int get_all_ptr_zone_units(ZoneUnitPtrArray& ptr_zone_unit) const = 0; @@ -58,7 +58,7 @@ class ObZoneUnitsProvider { }; class ObAliveZoneUnitAdaptor : public ObZoneUnitAdaptor { - public: +public: ObAliveZoneUnitAdaptor() {} void set_zone_unit(const UnitPtrArray* my_zu) @@ -71,7 +71,7 @@ class ObAliveZoneUnitAdaptor : public ObZoneUnitAdaptor { const bool is_primary_partition, int64_t& unit_idx) const override; virtual int update_tg_pg_count(const int64_t unit_idx, const bool is_primary_partition) override; - private: +private: const UnitPtrArray* zu_; DISALLOW_COPY_AND_ASSIGN(ObAliveZoneUnitAdaptor); @@ -79,7 +79,7 @@ class ObAliveZoneUnitAdaptor : public ObZoneUnitAdaptor { /* for ObReplicaCreator */ class ObAliveZoneUnitsProvider : public ObZoneUnitsProvider { - public: +public: ObAliveZoneUnitsProvider() : all_zone_unit_ptrs_(), zone_unit_adaptor_(), inited_(false) {} virtual ~ObAliveZoneUnitsProvider() @@ -88,13 +88,13 @@ class ObAliveZoneUnitsProvider : public ObZoneUnitsProvider { virtual int get_all_ptr_zone_units(ZoneUnitPtrArray& zone_unit_ptr) const override; virtual int find_zone(const common::ObZone& zone, const ObZoneUnitAdaptor*& zua) override; - public: +public: int init(const ZoneUnitPtrArray& all_zone_units); virtual int prepare_for_next_partition(const common::hash::ObHashSet& unit_set) override; - private: +private: class UnitSortOp final { - public: + public: UnitSortOp() : ret_(common::OB_SUCCESS) {} ~UnitSortOp() @@ -105,11 +105,11 @@ class ObAliveZoneUnitsProvider : public ObZoneUnitsProvider { return ret_; } - private: + private: int ret_; }; class ZoneUnitSortOp final { - public: + public: ZoneUnitSortOp() : ret_(common::OB_SUCCESS) {} ~ZoneUnitSortOp() @@ -120,11 +120,11 @@ class ObAliveZoneUnitsProvider : public ObZoneUnitsProvider { return ret_; } - private: + private: int ret_; }; - private: +private: ZoneUnitPtrArray all_zone_unit_ptrs_; ZoneUnitPtrArray available_zone_unit_ptrs_; ObAliveZoneUnitAdaptor zone_unit_adaptor_; @@ -134,7 +134,7 @@ class ObAliveZoneUnitsProvider : public ObZoneUnitsProvider { }; class ObAllZoneUnitAdaptor : public ObZoneUnitAdaptor { - public: +public: ObAllZoneUnitAdaptor() {} void set_zone_unit(const UnitStatArray* all_unit) @@ -147,7 +147,7 @@ class ObAllZoneUnitAdaptor : public ObZoneUnitAdaptor { const bool is_primary_partition, int64_t& unit_idx) const override; virtual int update_tg_pg_count(const int64_t unit_idx, const bool is_primary_partition) override; - private: +private: const UnitStatArray* all_unit_; DISALLOW_COPY_AND_ASSIGN(ObAllZoneUnitAdaptor); @@ -156,7 +156,7 @@ class ObAllZoneUnitAdaptor : public ObZoneUnitAdaptor { /* for ObRereplication */ // only provide logonly unit class ObZoneLogonlyUnitProvider : public ObZoneUnitsProvider { - public: +public: ObZoneLogonlyUnitProvider(const ZoneUnitArray& all_zone_units) : all_zone_units_(all_zone_units) {} virtual ~ObZoneLogonlyUnitProvider() @@ -166,7 +166,7 @@ class ObZoneLogonlyUnitProvider : public ObZoneUnitsProvider { virtual int get_all_ptr_zone_units(ZoneUnitPtrArray& zone_unit_ptr) const override; virtual bool exist(const ObZone& zone, const uint64_t unit_id) const override; - private: +private: const ZoneUnitArray& all_zone_units_; UnitStatArray all_unit_; ObAllZoneUnitAdaptor zone_unit_adaptor_; @@ -177,7 +177,7 @@ class ObZoneLogonlyUnitProvider : public ObZoneUnitsProvider { /* for ObRereplication */ // filter the logonly unit class ObZoneUnitsWithoutLogonlyProvider : public ObZoneUnitsProvider { - public: +public: ObZoneUnitsWithoutLogonlyProvider(const ZoneUnitArray& all_zone_units) : all_zone_units_(all_zone_units) {} virtual ~ObZoneUnitsWithoutLogonlyProvider() @@ -186,7 +186,7 @@ class ObZoneUnitsWithoutLogonlyProvider : public ObZoneUnitsProvider { virtual int get_all_ptr_zone_units(ZoneUnitPtrArray& zone_unit_ptr) const override; virtual int find_zone(const common::ObZone& zone, const ObZoneUnitAdaptor*& zua); - private: +private: const ZoneUnitArray& all_zone_units_; UnitStatArray all_unit_; ObAllZoneUnitAdaptor zone_unit_adaptor_; @@ -196,7 +196,7 @@ class ObZoneUnitsWithoutLogonlyProvider : public ObZoneUnitsProvider { /* for ObRereplication */ class ObAllZoneUnitsProvider : public ObZoneUnitsProvider { - public: +public: ObAllZoneUnitsProvider(const ZoneUnitArray& all_zone_units) : all_zone_units_(all_zone_units) {} virtual ~ObAllZoneUnitsProvider() @@ -205,7 +205,7 @@ class ObAllZoneUnitsProvider : public ObZoneUnitsProvider { virtual int get_all_zone_units(ZoneUnitArray& zone_unit) const override; virtual int get_all_ptr_zone_units(ZoneUnitPtrArray& zone_unit_ptr) const override; - private: +private: const ZoneUnitArray& all_zone_units_; UnitStatArray all_unit_; ObAllZoneUnitAdaptor zone_unit_adaptor_; diff --git a/src/rootserver/restore/ob_restore_info.h b/src/rootserver/restore/ob_restore_info.h index d6de6a09e..c5226e623 100644 --- a/src/rootserver/restore/ob_restore_info.h +++ b/src/rootserver/restore/ob_restore_info.h @@ -40,7 +40,7 @@ namespace rootserver { enum RestoreTaskStatus { RESTORE_INIT = 0, RESTORE_DOING, RESTORE_DONE, RESTORE_STOP, RESTORE_FAIL }; struct RestoreJob { - public: +public: RestoreJob() : job_id_(common::OB_INVALID_ID), level_(0), @@ -69,14 +69,14 @@ struct RestoreJob { common::ObString backup_uri_; common::ObString tenant_name_; - private: +private: uint64_t tenant_id_; /* valid if level_ >= 0 */ uint64_t database_id_; /* valid if level_ >= 1 */ uint64_t table_id_; /* valid if level_ >= 2 */ uint64_t backup_table_id_; /* valid if level_ >= 2 */ uint64_t partition_id_; /* valid if level_ >= 3 */ - public: +public: bool is_valid() { return common::OB_INVALID_ID != job_id_; @@ -111,12 +111,12 @@ struct RestoreJob { TO_STRING_KV(K_(job_id), K_(level), K_(status), K_(start_time), K_(backup_end_time), K_(recycle_end_time), K_(backup_uri), K_(tenant_name), K_(tenant_id), K_(table_id), K_(backup_table_id), K_(partition_id)); - private: +private: common::ObArenaAllocator allocator_; }; struct PartitionRestoreTask { - public: +public: typedef common::ObSEArray ObSchemaIdPairs; PartitionRestoreTask() : tenant_id_(common::OB_INVALID_TENANT_ID), @@ -131,7 +131,7 @@ struct PartitionRestoreTask { {} ~PartitionRestoreTask() = default; - public: +public: uint64_t tenant_id_; union { uint64_t table_id_; @@ -155,7 +155,7 @@ struct PartitionRestoreTask { // not used class ObRestoreProgressTracker { - public: +public: ObRestoreProgressTracker() : cond_(), has_task_(true), lock_(false) {} ~ObRestoreProgressTracker() @@ -211,7 +211,7 @@ class ObRestoreProgressTracker { lock_ = false; } - private: +private: common::ObThreadCond cond_; volatile bool has_task_; volatile bool lock_; @@ -222,7 +222,7 @@ class TenantBalanceStat; class ObDDLService; class ObRootBalancer; class ObRestoreMgrCtx { - public: +public: ObRestoreMgrCtx() : conn_env_(NULL), task_mgr_(NULL), diff --git a/src/rootserver/restore/ob_restore_meta.h b/src/rootserver/restore/ob_restore_meta.h index 8f55de5ca..0aa6c587d 100644 --- a/src/rootserver/restore/ob_restore_meta.h +++ b/src/rootserver/restore/ob_restore_meta.h @@ -36,7 +36,7 @@ namespace rootserver { class ObSystemAdminCtx; class ObRestoreMeta { - private: +private: struct TablegroupIdPair { TablegroupIdPair() : tablegroup_id_(common::OB_INVALID_ID), backup_tablegroup_id_(common::OB_INVALID_ID) {} @@ -82,12 +82,12 @@ class ObRestoreMeta { TO_STRING_KV(K_(table_id), K_(index_id), K_(backup_index_id)); }; - public: +public: explicit ObRestoreMeta(observer::ObRestoreCtx& restore_ctx, RestoreJob& job_info, const volatile bool& is_stop); ~ObRestoreMeta(); int execute(); - private: +private: /* functions */ int check_stop() { diff --git a/src/rootserver/restore/ob_restore_mgr.h b/src/rootserver/restore/ob_restore_mgr.h index fd2eaa5ff..edf1f326c 100644 --- a/src/rootserver/restore/ob_restore_mgr.h +++ b/src/rootserver/restore/ob_restore_mgr.h @@ -19,13 +19,13 @@ namespace oceanbase { namespace rootserver { class ObRestoreMgr { - public: +public: ObRestoreMgr(const volatile bool& is_stop); ~ObRestoreMgr(); int init(ObRestoreMgrCtx* restore_ctx); int restore(); - private: +private: /* functions */ int check_stop() { diff --git a/src/rootserver/restore/ob_restore_replica.h b/src/rootserver/restore/ob_restore_replica.h index 2d535b8d1..41167e040 100644 --- a/src/rootserver/restore/ob_restore_replica.h +++ b/src/rootserver/restore/ob_restore_replica.h @@ -37,12 +37,12 @@ class OnlineReplica; class Partition; class Replica; class ObRestoreReplica { - public: +public: explicit ObRestoreReplica(ObRestoreMgrCtx& restore_ctx, RestoreJob& job_info, const volatile bool& is_stop); ~ObRestoreReplica(); int restore(); - private: +private: /* functions */ int check_stop() { diff --git a/src/rootserver/restore/ob_restore_scheduler.cpp b/src/rootserver/restore/ob_restore_scheduler.cpp index b2fdc241a..e4bf641dc 100644 --- a/src/rootserver/restore/ob_restore_scheduler.cpp +++ b/src/rootserver/restore/ob_restore_scheduler.cpp @@ -2759,7 +2759,7 @@ int ObRestoreScheduler::do_upgrade_post(const ObPhysicalRestoreJob& job_info) return ret; } -int ObRestoreScheduler::drop_tenant_force_if_necessary(const ObPhysicalRestoreJob &job_info) +int ObRestoreScheduler::drop_tenant_force_if_necessary(const ObPhysicalRestoreJob& job_info) { int ret = OB_SUCCESS; const bool need_force_drop = GCONF._auto_drop_tenant_if_restore_failed; @@ -2775,8 +2775,8 @@ int ObRestoreScheduler::drop_tenant_force_if_necessary(const ObPhysicalRestoreJo arg.if_exist_ = true; arg.delay_to_drop_ = false; ObSqlString sql; - const int64_t TIMEOUT_PER_RPC = GCONF.rpc_timeout; // default 2s - const int64_t DEFAULT_TIMEOUT = 10 * 1000 * 1000L; // 10s + const int64_t TIMEOUT_PER_RPC = GCONF.rpc_timeout; // default 2s + const int64_t DEFAULT_TIMEOUT = 10 * 1000 * 1000L; // 10s int64_t rpc_timeout = max(TIMEOUT_PER_RPC, DEFAULT_TIMEOUT); if (OB_FAIL(sql.append_fmt("DROP TENANT IF EXISTS %s FORCE", arg.tenant_name_.ptr()))) { LOG_WARN("fail to generate sql", K(ret), K(arg)); @@ -2792,5 +2792,5 @@ int ObRestoreScheduler::drop_tenant_force_if_necessary(const ObPhysicalRestoreJo return ret; } -} // end namespace rootserver -} // end namespace oceanbase +} // end namespace rootserver +} // end namespace oceanbase diff --git a/src/rootserver/restore/ob_restore_scheduler.h b/src/rootserver/restore/ob_restore_scheduler.h index 09bbfa73a..dece1f3cb 100644 --- a/src/rootserver/restore/ob_restore_scheduler.h +++ b/src/rootserver/restore/ob_restore_scheduler.h @@ -30,7 +30,7 @@ namespace oceanbase { namespace rootserver { class ObRestoreIdling : public ObThreadIdling { - public: +public: explicit ObRestoreIdling(volatile bool& stop) : ObThreadIdling(stop) { reset(); @@ -39,18 +39,18 @@ class ObRestoreIdling : public ObThreadIdling { void set_idle_interval_us(int64_t idle_us); void reset(); - private: +private: int64_t idle_us_; }; // Schedule daily merge (merge dynamic data to base line data). // Running in a single thread. class ObRestoreScheduler : public ObRsReentrantThread, public share::ObCheckStopProvider { - public: +public: static const int64_t MAX_RESTORE_TASK_CNT = 10000; enum SetMemberListAction { BALANCE, SET_MEMBER_LIST, DONE }; - public: +public: ObRestoreScheduler(); virtual ~ObRestoreScheduler(); @@ -67,11 +67,11 @@ class ObRestoreScheduler : public ObRsReentrantThread, public share::ObCheckStop BLOCKING_RUN_IMPLEMENT(); } - public: +public: int mark_job_failed(const int64_t job_id, int return_ret, share::PhysicalRestoreMod mod, const common::ObCurTraceId::TraceId& trace_id, const common::ObAddr& addr); - private: +private: int idle(); int check_stop() const; @@ -165,9 +165,10 @@ class ObRestoreScheduler : public ObRsReentrantThread, public share::ObCheckStop void record_rs_event(const share::ObPhysicalRestoreJob& job, const share::PhysicalRestoreStatus next_status); share::PhysicalRestoreStatus get_next_status(int return_ret, share::PhysicalRestoreStatus current_status); - private: - int drop_tenant_force_if_necessary(const share::ObPhysicalRestoreJob &job_info); - private: +private: + int drop_tenant_force_if_necessary(const share::ObPhysicalRestoreJob& job_info); + +private: bool inited_; mutable ObRestoreIdling idling_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/restore/ob_restore_sql_modifier_impl.h b/src/rootserver/restore/ob_restore_sql_modifier_impl.h index 785e5f453..86b21e86a 100644 --- a/src/rootserver/restore/ob_restore_sql_modifier_impl.h +++ b/src/rootserver/restore/ob_restore_sql_modifier_impl.h @@ -36,7 +36,7 @@ class ObRestoreArgs; namespace rootserver { class ObServerManager; class ObRestoreSQLModifierImpl : public observer::ObRestoreSQLModifier { - public: +public: ObRestoreSQLModifierImpl(share::ObRestoreArgs& restore_args, common::hash::ObHashSet& dropped_index_ids); virtual ~ObRestoreSQLModifierImpl(); int modify(sql::ObResultSet& rs); @@ -45,7 +45,7 @@ class ObRestoreSQLModifierImpl : public observer::ObRestoreSQLModifier { tenant_name_ = name; } - private: +private: /* functions */ int handle_create_tenant(sql::ObCreateTenantStmt* stmt); int handle_create_database(sql::ObCreateDatabaseStmt* stmt); diff --git a/src/rootserver/restore/ob_restore_stat.h b/src/rootserver/restore/ob_restore_stat.h index 1742a51f4..8c44d0ab6 100644 --- a/src/rootserver/restore/ob_restore_stat.h +++ b/src/rootserver/restore/ob_restore_stat.h @@ -30,7 +30,7 @@ namespace rootserver { struct PhysicalRestorePartition { friend class ObPhysicalRestoreStat; - public: +public: PhysicalRestorePartition() : schema_id_(common::OB_INVALID_ID), partition_id_(common::OB_INVALID_INDEX), @@ -54,7 +54,7 @@ struct PhysicalRestorePartition { return end_ - begin_; } - public: +public: uint64_t schema_id_; int64_t partition_id_; int64_t partition_cnt_; // partition_cnt in meta_table @@ -65,16 +65,16 @@ struct PhysicalRestorePartition { }; class ObRestoreStat { - public: +public: ObRestoreStat(RestoreJob& job_info, common::ObMySQLProxy* sql_proxy); virtual ~ObRestoreStat(); int gather_stat(); - public: +public: RestoreJob& job_info_; common::ObArray partition_task_; - private: +private: /* functions */ int fill_partitions(); /* variables */ @@ -84,15 +84,15 @@ class ObRestoreStat { }; class ObPhysicalRestoreStat { - public: - public: +public: +public: ObPhysicalRestoreStat(share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& sql_proxy, share::ObPartitionTableOperator& pt_operator, const share::ObPhysicalRestoreJob& job_info, bool sys_only, volatile bool& stop); virtual ~ObPhysicalRestoreStat(); int gather_stat(); - private: +private: int check_stop(); int fill_sys_partitions(); int fill_user_partitions(); @@ -101,14 +101,14 @@ class ObPhysicalRestoreStat { int add_partition(const int64_t partition_cnt, const int64_t paxos_replica_cnt, const int64_t table_cnt, const share::ObPartitionInfo& info); - public: +public: const share::ObPhysicalRestoreJob& job_info_; common::ObArray partitions_; common::ObArray replicas_; share::ObRestoreProgressInfo statistic_; bool only_sys_; - private: +private: common::ObMySQLProxy& sql_proxy_; share::schema::ObSchemaGetterGuard guard_; share::schema::ObMultiVersionSchemaService& schema_service_; diff --git a/src/rootserver/restore/ob_restore_table_operator.cpp b/src/rootserver/restore/ob_restore_table_operator.cpp index dea5a7805..6f2e9a817 100644 --- a/src/rootserver/restore/ob_restore_table_operator.cpp +++ b/src/rootserver/restore/ob_restore_table_operator.cpp @@ -57,7 +57,7 @@ int ObSchemaMapSerializer::serialize( } class SchemaMapParserCb : public ObKVMatchCb { - public: +public: SchemaMapParserCb(ObIArray& id_pair) : id_pair_(id_pair) {} virtual ~SchemaMapParserCb() @@ -80,7 +80,7 @@ class SchemaMapParserCb : public ObKVMatchCb { return ret; } - private: +private: int get_int_val(const char* nptr, int64_t& int_val) { int ret = OB_SUCCESS; @@ -98,7 +98,7 @@ class SchemaMapParserCb : public ObKVMatchCb { return ret; } - private: +private: ObIArray& id_pair_; }; diff --git a/src/rootserver/restore/ob_restore_table_operator.h b/src/rootserver/restore/ob_restore_table_operator.h index 3d763ef75..fd3118123 100644 --- a/src/rootserver/restore/ob_restore_table_operator.h +++ b/src/rootserver/restore/ob_restore_table_operator.h @@ -34,7 +34,7 @@ class ObDMLSqlSplicer; namespace rootserver { class ObSchemaMapSerializer { - public: +public: static int serialize(common::ObIAllocator& allocator, const common::ObIArray& id_pair, common::ObString& schema_map_str); @@ -42,7 +42,7 @@ class ObSchemaMapSerializer { }; class ObRestoreTableOperator { - public: +public: ObRestoreTableOperator(); virtual ~ObRestoreTableOperator() = default; int init(common::ObISQLClient* sql_client); @@ -70,7 +70,7 @@ class ObRestoreTableOperator { // recycle task int recycle_job(int64_t job_id, int64_t status); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRestoreTableOperator); // function members @@ -83,7 +83,7 @@ class ObRestoreTableOperator { int record_job_in_history(int64_t job_id); int fill_dml_splicer(share::ObDMLSqlSplicer& dml, const RestoreJob& job_info); - private: +private: // data members bool inited_; common::ObISQLClient* sql_client_; diff --git a/src/rootserver/restore/ob_restore_util.h b/src/rootserver/restore/ob_restore_util.h index 3143bc480..cbcdb7930 100644 --- a/src/rootserver/restore/ob_restore_util.h +++ b/src/rootserver/restore/ob_restore_util.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace rootserver { class ObRecoveryHelper { - public: +public: struct PkeyInfo { int64_t pkey_index_; bool part_valid_; @@ -43,7 +43,7 @@ class ObRecoveryHelper { }; struct ObMemberListPkeyInfo { - public: + public: ObMemberListPkeyInfo() { reset(); @@ -56,7 +56,7 @@ class ObRecoveryHelper { common::ObArray pkey_info_; }; struct ObMemberListPkeyList { - public: + public: ObMemberListPkeyList() { reset(); @@ -73,13 +73,13 @@ class ObRecoveryHelper { TO_STRING_KV(K_(epoch), K_(pkey_array), K_(ml_pk_array)); - public: + public: common::ObArray pkey_array_; common::ObArray ml_pk_array_; int64_t epoch_; }; struct ObLeaderPkeyList { - public: + public: ObLeaderPkeyList() : leader_(), pkey_list_() {} ~ObLeaderPkeyList() @@ -87,13 +87,13 @@ class ObRecoveryHelper { void reset(); TO_STRING_KV(K_(leader), K_(pkey_list)); - public: + public: ObAddr leader_; common::ObArray pkey_list_; }; struct ObLeaderPkeyLists { - public: + public: ObLeaderPkeyLists() : user_leader_pkeys_(), inner_leader_pkeys_() {} ~ObLeaderPkeyLists() @@ -110,20 +110,20 @@ class ObRecoveryHelper { return inner_leader_pkeys_.count(); } - public: + public: common::ObArray user_leader_pkeys_; common::ObArray inner_leader_pkeys_; }; }; class ObRestoreUtil { - public: +public: ObRestoreUtil(); ~ObRestoreUtil(); int init(observer::ObRestoreCtx& restore_ctx, int64_t job_id); int execute(const obrpc::ObRestoreTenantArg& arg); - public: +public: static int check_has_job(common::ObMySQLProxy* sql_client, const obrpc::ObRestoreTenantArg& arg, bool& has_job); static int check_has_job(common::ObMySQLProxy* sql_client, bool& has_job); static int fill_physical_restore_job( @@ -134,12 +134,12 @@ class ObRestoreUtil { static int check_has_physical_restore_job( common::ObISQLClient& sql_client, const common::ObString& tenant_name, bool& has_job); - private: +private: int record_job(const obrpc::ObRestoreTenantArg& arg); static int check_has_job_without_lock( common::ObISQLClient& sql_client, const common::ObString& tenant_name, bool& has_job); - private: +private: /* variables */ bool inited_; int64_t job_id_; diff --git a/src/rootserver/virtual_table/ob_all_cluster.h b/src/rootserver/virtual_table/ob_all_cluster.h index c6f69cc25..89f7c61a9 100644 --- a/src/rootserver/virtual_table/ob_all_cluster.h +++ b/src/rootserver/virtual_table/ob_all_cluster.h @@ -34,7 +34,7 @@ class ObZoneManager; class ObServerManager; class ObAllVirtualCluster : public common::ObVirtualTableProjector { - public: +public: ObAllVirtualCluster() : inited_(false), zone_manager_(NULL), @@ -53,12 +53,12 @@ class ObAllVirtualCluster : public common::ObVirtualTableProjector { obrpc::ObSrvRpcProxy& rpc_proxy, ObServerManager& server_manager, ObRootService& root_service); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int get_full_row(const share::schema::ObTableSchema* table, common::ObIArray& columns, bool& full_columns); - private: +private: static const int64_t RPC_TIMEOOUT = 1 * 1000 * 1000; // 1s - private: +private: bool inited_; ObZoneManager* zone_manager_; share::schema::ObMultiVersionSchemaService* schema_service_; @@ -70,7 +70,7 @@ class ObAllVirtualCluster : public common::ObVirtualTableProjector { ObRootService* root_service_; ObArenaAllocator arena_allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualCluster); }; } // namespace rootserver diff --git a/src/rootserver/virtual_table/ob_all_partition_table.h b/src/rootserver/virtual_table/ob_all_partition_table.h index 8d17afb0e..0002a9f10 100644 --- a/src/rootserver/virtual_table/ob_all_partition_table.h +++ b/src/rootserver/virtual_table/ob_all_partition_table.h @@ -34,7 +34,7 @@ namespace rootserver { class ObServerManager; class ObAllPartitionTable : public common::ObVirtualTableProjector { - public: +public: ObAllPartitionTable(); virtual ~ObAllPartitionTable(); @@ -45,10 +45,10 @@ class ObAllPartitionTable : public common::ObVirtualTableProjector { virtual int inner_get_next_row(common::ObNewRow*& row); - protected: +protected: virtual int get_condition(uint64_t& specific_tenant_id, uint64_t& specific_table_id); - private: +private: int get_full_row(const share::schema::ObTableSchema* table, const share::ObPartitionReplica& replica, common::ObIArray& columns); bool inited_; @@ -64,7 +64,7 @@ class ObAllPartitionTable : public common::ObVirtualTableProjector { share::ObIPartitionTableIterator* pt_iter_; ObArenaAllocator arena_allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllPartitionTable); }; diff --git a/src/rootserver/virtual_table/ob_all_rebalance_map_item_stat.h b/src/rootserver/virtual_table/ob_all_rebalance_map_item_stat.h index cd1ca8507..c5f6d04a4 100644 --- a/src/rootserver/virtual_table/ob_all_rebalance_map_item_stat.h +++ b/src/rootserver/virtual_table/ob_all_rebalance_map_item_stat.h @@ -31,7 +31,7 @@ namespace balancer { class SquareIdMap; } class ObAllRebalanceMapItemStat : public common::ObVirtualTableProjector { - public: +public: ObAllRebalanceMapItemStat(); virtual ~ObAllRebalanceMapItemStat(); @@ -42,7 +42,7 @@ class ObAllRebalanceMapItemStat : public common::ObVirtualTableProjector { virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: int get_table_schema(uint64_t tid); int get_all_tenant(); int init_tenant_balance_stat(uint64_t tenant_id); @@ -56,7 +56,7 @@ class ObAllRebalanceMapItemStat : public common::ObVirtualTableProjector { int calc_leader_balance_statistic(const common::ObZone& zone, const balancer::HashIndexCollection& hash_index_collection, balancer::SquareIdMap& id_map); - private: +private: // data members bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/virtual_table/ob_all_rebalance_map_stat.h b/src/rootserver/virtual_table/ob_all_rebalance_map_stat.h index 4dfd4b198..8f3f74b6a 100644 --- a/src/rootserver/virtual_table/ob_all_rebalance_map_stat.h +++ b/src/rootserver/virtual_table/ob_all_rebalance_map_stat.h @@ -29,7 +29,7 @@ namespace balancer { class SquareIdMap; } class ObAllRebalanceMapStat : public common::ObVirtualTableProjector { - public: +public: ObAllRebalanceMapStat(); virtual ~ObAllRebalanceMapStat(); @@ -40,7 +40,7 @@ class ObAllRebalanceMapStat : public common::ObVirtualTableProjector { virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: int get_table_schema(uint64_t tid); int get_all_tenant(); int init_tenant_balance_stat(uint64_t tenant_id); @@ -48,7 +48,7 @@ class ObAllRebalanceMapStat : public common::ObVirtualTableProjector { int next(); int get_full_row(const share::schema::ObTableSchema* table, common::ObIArray& columns); - private: +private: // data members bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/virtual_table/ob_all_rebalance_replica_stat.h b/src/rootserver/virtual_table/ob_all_rebalance_replica_stat.h index 2fb57eb93..2b3d266c9 100644 --- a/src/rootserver/virtual_table/ob_all_rebalance_replica_stat.h +++ b/src/rootserver/virtual_table/ob_all_rebalance_replica_stat.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace rootserver { class ObAllRebalanceReplicaStat : public common::ObVirtualTableProjector { - public: +public: ObAllRebalanceReplicaStat(); virtual ~ObAllRebalanceReplicaStat(); @@ -27,7 +27,7 @@ class ObAllRebalanceReplicaStat : public common::ObVirtualTableProjector { virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAllRebalanceReplicaStat); // function members @@ -35,7 +35,7 @@ class ObAllRebalanceReplicaStat : public common::ObVirtualTableProjector { int next(); int get_full_row(const share::schema::ObTableSchema* table, common::ObIArray& columns); - private: +private: // data members ObAllRebalanceTenantStat impl_; int64_t cur_partition_idx_; diff --git a/src/rootserver/virtual_table/ob_all_rebalance_task_stat.h b/src/rootserver/virtual_table/ob_all_rebalance_task_stat.h index ac34357d4..5be480559 100644 --- a/src/rootserver/virtual_table/ob_all_rebalance_task_stat.h +++ b/src/rootserver/virtual_table/ob_all_rebalance_task_stat.h @@ -28,14 +28,14 @@ class ObRebalanceTask; class ObRebalanceTaskMgr; class ObAllRebalanceTaskStat : public common::ObVirtualTableProjector { - public: +public: ObAllRebalanceTaskStat(); virtual ~ObAllRebalanceTaskStat(); int init(share::schema::ObMultiVersionSchemaService& schema_service, ObRebalanceTaskMgr& rebalance_task_mgr); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: struct Display { void reset(); uint64_t tenant_id_; @@ -60,12 +60,12 @@ class ObAllRebalanceTaskStat : public common::ObVirtualTableProjector { int get_full_row(const share::schema::ObTableSchema* table, const ObRebalanceTask& task_stat, const ObRebalanceTaskInfo& task_info, common::ObIArray& columns); - private: +private: bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; ObRebalanceTaskMgr* rebalance_task_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllRebalanceTaskStat); }; } // end namespace rootserver diff --git a/src/rootserver/virtual_table/ob_all_rebalance_tenant_stat.h b/src/rootserver/virtual_table/ob_all_rebalance_tenant_stat.h index c92970658..427dada43 100644 --- a/src/rootserver/virtual_table/ob_all_rebalance_tenant_stat.h +++ b/src/rootserver/virtual_table/ob_all_rebalance_tenant_stat.h @@ -29,7 +29,7 @@ class ObAllRebalanceUnitStat; class ObAllRebalanceReplicaStat; class ObAllRebalanceTenantStat : public common::ObVirtualTableProjector { - public: +public: ObAllRebalanceTenantStat(); virtual ~ObAllRebalanceTenantStat(); @@ -40,7 +40,7 @@ class ObAllRebalanceTenantStat : public common::ObVirtualTableProjector { virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: int get_table_schema(uint64_t tid); int get_all_tenant(); int init_tenant_balance_stat(uint64_t tenant_id); @@ -48,7 +48,7 @@ class ObAllRebalanceTenantStat : public common::ObVirtualTableProjector { int next(); int get_full_row(const share::schema::ObTableSchema* table, common::ObIArray& columns); - private: +private: // data members bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/rootserver/virtual_table/ob_all_rebalance_unit_distribution_stat.h b/src/rootserver/virtual_table/ob_all_rebalance_unit_distribution_stat.h index 159485081..ba6f0e69b 100644 --- a/src/rootserver/virtual_table/ob_all_rebalance_unit_distribution_stat.h +++ b/src/rootserver/virtual_table/ob_all_rebalance_unit_distribution_stat.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace rootserver { class ObRootBalancer; class ObAllRebalanceUnitDistributionStat : public common::ObVirtualTableProjector { - public: +public: ObAllRebalanceUnitDistributionStat(ObUnitManager& unit_mgr, ObILeaderCoordinator& leader_coordinator, ObServerManager& server_mgr, ObZoneManager& zone_mgr); virtual ~ObAllRebalanceUnitDistributionStat(); @@ -30,11 +30,11 @@ class ObAllRebalanceUnitDistributionStat : public common::ObVirtualTableProjecto virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: int get_full_row(const share::ObUnitInfo& unit_info, common::ObIArray& columns); int get_table_schema(uint64_t tid); - private: +private: // data members ObServerBalancePlan server_balance_plan_; share::schema::ObSchemaGetterGuard schema_guard_; diff --git a/src/rootserver/virtual_table/ob_all_rebalance_unit_migrate_stat.h b/src/rootserver/virtual_table/ob_all_rebalance_unit_migrate_stat.h index 483e80e60..f7fb0628d 100644 --- a/src/rootserver/virtual_table/ob_all_rebalance_unit_migrate_stat.h +++ b/src/rootserver/virtual_table/ob_all_rebalance_unit_migrate_stat.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace rootserver { class ObRootBalancer; class ObAllRebalanceUnitMigrateStat : public common::ObVirtualTableProjector { - public: +public: ObAllRebalanceUnitMigrateStat(ObUnitManager& unit_mgr, ObILeaderCoordinator& leader_coordinator, ObServerManager& server_mgr, ObZoneManager& zone_mgr); virtual ~ObAllRebalanceUnitMigrateStat(); @@ -29,11 +29,11 @@ class ObAllRebalanceUnitMigrateStat : public common::ObVirtualTableProjector { virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: int get_full_row(const ServerBalancePlanTask& task, common::ObIArray& columns); int get_table_schema(uint64_t tid); - private: +private: // data members ObServerBalancePlan server_balance_plan_; share::schema::ObSchemaGetterGuard schema_guard_; diff --git a/src/rootserver/virtual_table/ob_all_rebalance_unit_stat.h b/src/rootserver/virtual_table/ob_all_rebalance_unit_stat.h index c2aec4269..d79fea3cc 100644 --- a/src/rootserver/virtual_table/ob_all_rebalance_unit_stat.h +++ b/src/rootserver/virtual_table/ob_all_rebalance_unit_stat.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace rootserver { class ObAllRebalanceUnitStat : public common::ObVirtualTableProjector { - public: +public: ObAllRebalanceUnitStat(); virtual ~ObAllRebalanceUnitStat(); @@ -27,7 +27,7 @@ class ObAllRebalanceUnitStat : public common::ObVirtualTableProjector { virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAllRebalanceUnitStat); // function members @@ -35,7 +35,7 @@ class ObAllRebalanceUnitStat : public common::ObVirtualTableProjector { int next(); int get_full_row(const share::schema::ObTableSchema* table, common::ObIArray& columns); - private: +private: // data members ObAllRebalanceTenantStat impl_; int64_t cur_unit_idx_; diff --git a/src/rootserver/virtual_table/ob_all_replica_task.h b/src/rootserver/virtual_table/ob_all_replica_task.h index 309ed0d88..d529fd0af 100644 --- a/src/rootserver/virtual_table/ob_all_replica_task.h +++ b/src/rootserver/virtual_table/ob_all_replica_task.h @@ -42,7 +42,7 @@ namespace rootserver { class ObServerManager; class ObAllReplicaTask : public common::ObVirtualTableProjector { - public: +public: ObAllReplicaTask(); virtual ~ObAllReplicaTask(); @@ -55,10 +55,10 @@ class ObAllReplicaTask : public common::ObVirtualTableProjector { virtual int inner_get_next_row(common::ObNewRow*& row); - protected: +protected: virtual int get_condition(uint64_t& specific_tenant_id); - private: +private: int get_full_row(const share::schema::ObTableSchema* table, ObReplicaTask& task, common::ObIArray& columns); bool inited_; TenantBalanceStat tenant_stat_; @@ -70,19 +70,19 @@ class ObAllReplicaTask : public common::ObVirtualTableProjector { ObArenaAllocator arena_allocator_; int64_t index_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllReplicaTask); }; class ObAllReplicaTaskI1 : public ObAllReplicaTask { - public: +public: ObAllReplicaTaskI1(); virtual ~ObAllReplicaTaskI1(); - protected: +protected: virtual int get_condition(uint64_t& specific_tenant_id) override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllReplicaTaskI1); }; diff --git a/src/rootserver/virtual_table/ob_all_server_stat.h b/src/rootserver/virtual_table/ob_all_server_stat.h index cf6f70217..b0c0d3094 100644 --- a/src/rootserver/virtual_table/ob_all_server_stat.h +++ b/src/rootserver/virtual_table/ob_all_server_stat.h @@ -30,7 +30,7 @@ class ObServerManager; class ObZoneManager; class ObAllServerStat : public common::ObVirtualTableProjector { - public: +public: ObAllServerStat(); virtual ~ObAllServerStat(); @@ -38,7 +38,7 @@ class ObAllServerStat : public common::ObVirtualTableProjector { ObServerManager& server_mgr, ObILeaderCoordinator& leader_coordinator); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: static constexpr double EPSLISON = 0.000000001; static const int64_t INVALID_TOTAL_RESOURCE = 0; static const int64_t INVALID_ASSIGNED_PERCENT = -1; @@ -146,7 +146,7 @@ class ObAllServerStat : public common::ObVirtualTableProjector { TO_STRING_KV(K_(server_load), K_(cpu_assigned_percent), K_(disk_assigned_percent), K_(unit_num), K_(migrating_unit_num), K_(merged_version), K_(leader_count)); - private: + private: DISALLOW_COPY_AND_ASSIGN(ServerStat); }; @@ -158,7 +158,7 @@ class ObAllServerStat : public common::ObVirtualTableProjector { int get_full_row( const share::schema::ObTableSchema* table, ServerStat& server_stat, common::ObIArray& columns); - private: +private: bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; ObUnitManager* unit_mgr_; diff --git a/src/rootserver/virtual_table/ob_all_tenant_stat.h b/src/rootserver/virtual_table/ob_all_tenant_stat.h index 971de67eb..c000effca 100644 --- a/src/rootserver/virtual_table/ob_all_tenant_stat.h +++ b/src/rootserver/virtual_table/ob_all_tenant_stat.h @@ -31,14 +31,14 @@ class ObTableSchema; } // namespace share namespace rootserver { class ObAllTenantStat : public common::ObVirtualTableProjector { - public: +public: ObAllTenantStat(); virtual ~ObAllTenantStat(); int init(share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& proxy); virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: struct PartitionStat { uint64_t table_id_; int64_t partition_id_; @@ -125,12 +125,12 @@ class ObAllTenantStat : public common::ObVirtualTableProjector { int get_full_row( const share::schema::ObTableSchema* table, const TenantStat& tenant_stat, common::ObIArray& columns); - private: +private: bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; common::ObMySQLProxy* proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAllTenantStat); }; diff --git a/src/rootserver/virtual_table/ob_all_virtual_leader_stat.h b/src/rootserver/virtual_table/ob_all_virtual_leader_stat.h index 27a47845f..08f146302 100644 --- a/src/rootserver/virtual_table/ob_all_virtual_leader_stat.h +++ b/src/rootserver/virtual_table/ob_all_virtual_leader_stat.h @@ -23,7 +23,7 @@ class ObMultiVersionSchemaService; } // namespace share namespace rootserver { class ObAllVirtualLeaderStat : public common::ObVirtualTableProjector { - public: +public: ObAllVirtualLeaderStat() : schema_guard_(), all_tenants_(), @@ -44,13 +44,13 @@ class ObAllVirtualLeaderStat : public common::ObVirtualTableProjector { virtual ~ObAllVirtualLeaderStat() {} - public: +public: int init( rootserver::ObLeaderCoordinator& leader_coordinator, share::schema::ObMultiVersionSchemaService& schema_service); virtual int inner_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; - private: +private: // get all_virtual_leader_stat's table_schema int get_table_schema(uint64_t table_id); int get_all_tenant(); @@ -66,9 +66,9 @@ class ObAllVirtualLeaderStat : public common::ObVirtualTableProjector { int construct_tenant_partition(); int do_construct_tenant_partition(uint64_t tenant_id); - private: +private: static const int64_t MAX_COLUMN_NUM = 32; // all_virtual_leader_stat column number now will not be greater than 32 - private: +private: share::schema::ObSchemaGetterGuard schema_guard_; common::ObArray all_tenants_; // cur_tenant_idx_ is current idx of all_tenants_; @@ -88,7 +88,7 @@ class ObAllVirtualLeaderStat : public common::ObVirtualTableProjector { common::ObArenaAllocator inner_allocator_; bool is_inited_; - private: +private: // disallow copy and assign DISALLOW_COPY_AND_ASSIGN(ObAllVirtualLeaderStat); }; diff --git a/src/rootserver/virtual_table/ob_all_virtual_rootservice_stat.h b/src/rootserver/virtual_table/ob_all_virtual_rootservice_stat.h index 803fea3c0..df2098799 100644 --- a/src/rootserver/virtual_table/ob_all_virtual_rootservice_stat.h +++ b/src/rootserver/virtual_table/ob_all_virtual_rootservice_stat.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace rootserver { class ObRootService; class ObAllVirtualRootserviceStat : public common::ObSimpleVirtualTableIterator { - public: +public: ObAllVirtualRootserviceStat(); virtual ~ObAllVirtualRootserviceStat() {} @@ -29,13 +29,13 @@ class ObAllVirtualRootserviceStat : public common::ObSimpleVirtualTableIterator virtual int init_all_data() override; virtual int get_next_full_row(const share::schema::ObTableSchema* table, common::ObIArray& columns) override; - private: +private: // data members ObRootService* rootservice_; common::ObDiagnoseTenantInfo sys_tenant_di_; int32_t stat_iter_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAllVirtualRootserviceStat); }; diff --git a/src/rootserver/virtual_table/ob_core_meta_table.h b/src/rootserver/virtual_table/ob_core_meta_table.h index c5c09f80a..0a0febd75 100644 --- a/src/rootserver/virtual_table/ob_core_meta_table.h +++ b/src/rootserver/virtual_table/ob_core_meta_table.h @@ -27,7 +27,7 @@ class ObColumnSchemaV2; } // namespace share namespace rootserver { class ObCoreMetaTable : public common::ObVirtualTableProjector { - public: +public: ObCoreMetaTable(); virtual ~ObCoreMetaTable(); @@ -35,14 +35,14 @@ class ObCoreMetaTable : public common::ObVirtualTableProjector { virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int get_full_row(const share::schema::ObTableSchema* table, const share::ObPartitionReplica& replica, common::ObIArray& columns); bool inited_; share::ObPartitionTableOperator* pt_operator_; share::schema::ObSchemaGetterGuard* schema_guard_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCoreMetaTable); }; diff --git a/src/rootserver/virtual_table/ob_virtual_core_inner_table.h b/src/rootserver/virtual_table/ob_virtual_core_inner_table.h index 76f695c4c..4573c712c 100644 --- a/src/rootserver/virtual_table/ob_virtual_core_inner_table.h +++ b/src/rootserver/virtual_table/ob_virtual_core_inner_table.h @@ -27,7 +27,7 @@ class ObSchemaGetterGuard; } // namespace share namespace rootserver { class ObVritualCoreInnerTable : public common::ObVirtualTableProjector { - public: +public: ObVritualCoreInnerTable(); virtual ~ObVritualCoreInnerTable(); @@ -36,7 +36,7 @@ class ObVritualCoreInnerTable : public common::ObVirtualTableProjector { virtual int inner_get_next_row(common::ObNewRow*& row); - private: +private: int get_full_row(const share::schema::ObTableSchema* table, const share::ObCoreTableProxy& core_table, common::ObIArray& columns); @@ -46,7 +46,7 @@ class ObVritualCoreInnerTable : public common::ObVirtualTableProjector { uint64_t table_id_; share::schema::ObSchemaGetterGuard* schema_guard_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVritualCoreInnerTable); }; diff --git a/src/share/allocator/ob_fifo_arena.h b/src/share/allocator/ob_fifo_arena.h index 73162a88f..e9546db97 100644 --- a/src/share/allocator/ob_fifo_arena.h +++ b/src/share/allocator/ob_fifo_arena.h @@ -24,7 +24,7 @@ namespace common { class ObMemstoreAllocatorMgr; class ObActiveList; class ObFifoArena { - public: +public: static int64_t total_hold_; struct Page; struct Ref { @@ -159,7 +159,7 @@ class ObFifoArena { int64_t allocated_; }; - public: +public: enum { MAX_CACHED_GROUP_COUNT = 16, MAX_CACHED_PAGE_COUNT = MAX_CACHED_GROUP_COUNT * Handle::MAX_NWAY, @@ -183,7 +183,7 @@ class ObFifoArena { reset(); } - public: +public: int init(uint64_t tenant_id); void reset(); void update_nway_per_group(int64_t nway); @@ -211,7 +211,7 @@ class ObFifoArena { void set_memstore_threshold(int64_t memstore_threshold); bool need_do_writing_throttle() const; - private: +private: ObQSync& get_qs() { static ObQSync s_qs; @@ -227,7 +227,7 @@ class ObFifoArena { } struct ObWriteThrottleInfo { - public: + public: ObWriteThrottleInfo() { reset(); @@ -241,7 +241,7 @@ class ObFifoArena { TO_STRING_KV(K(decay_factor_), K(alloc_duration_), K(trigger_percentage_), K(memstore_threshold_), K(period_throttled_count_), K(period_throttled_time_), K(total_throttled_count_), K(total_throttled_time_)); - public: + public: // control info double decay_factor_; int64_t alloc_duration_; @@ -254,7 +254,7 @@ class ObFifoArena { int64_t total_throttled_time_; }; - private: +private: void release_ref(Ref* ref); Page* alloc_page(int64_t size); void free_page(Page* ptr); @@ -267,7 +267,7 @@ class ObFifoArena { int64_t get_writing_throttling_trigger_percentage_() const; int64_t get_writing_throttling_maximum_duration_() const; - private: +private: static const int64_t MAX_WAIT_INTERVAL = 20 * 1000 * 1000; // 20s static const int64_t MEM_SLICE_SIZE = 2 * 1024 * 1024; // Bytes per usecond static const int64_t MIN_INTERVAL = 20000; diff --git a/src/share/allocator/ob_gmemstore_allocator.h b/src/share/allocator/ob_gmemstore_allocator.h index b402a029f..7c0a9df39 100644 --- a/src/share/allocator/ob_gmemstore_allocator.h +++ b/src/share/allocator/ob_gmemstore_allocator.h @@ -32,7 +32,7 @@ struct FrozenMemstoreInfoLogger { int64_t pos_; }; class ObGMemstoreAllocator { - public: +public: typedef ObSpinLock Lock; typedef ObSpinLockGuard LockGuard; typedef ObGMemstoreAllocator GAlloc; @@ -42,7 +42,7 @@ class ObGMemstoreAllocator { typedef Arena::Handle ArenaHandle; class AllocHandle : public ListHandle, public ObIAllocator { - public: + public: memtable::ObMemtable& mt_; GAlloc* host_; ArenaHandle arena_handle_; @@ -118,17 +118,17 @@ class ObGMemstoreAllocator { } INHERIT_TO_STRING_KV("ListHandle", ListHandle, KP_(host), K_(arena_handle), K_(last_freeze_timestamp)); - private: + private: int64_t last_freeze_timestamp_; }; - public: +public: ObGMemstoreAllocator() : hlist_(), arena_(), last_freeze_timestamp_(0) {} ~ObGMemstoreAllocator() {} - public: +public: int init(uint64_t tenant_id) { update_last_freeze_timestamp(); @@ -150,7 +150,7 @@ class ObGMemstoreAllocator { return ret; } - public: +public: int64_t get_mem_active_memstore_used() { int64_t hazard = hlist_.hazard(); @@ -169,7 +169,7 @@ class ObGMemstoreAllocator { } } - public: +public: int set_memstore_threshold(uint64_t tenant_id); bool need_do_writing_throttle() const { @@ -192,11 +192,11 @@ class ObGMemstoreAllocator { ATOMIC_STORE(&last_freeze_timestamp_, ObTimeUtility::current_time()); } - private: +private: int64_t nway_per_group(); int set_memstore_threshold_without_lock(uint64_t tenant_id); - private: +private: Lock lock_; HandleList hlist_; Arena arena_; diff --git a/src/share/allocator/ob_handle_list.h b/src/share/allocator/ob_handle_list.h index 0babf4dca..38e6b086c 100644 --- a/src/share/allocator/ob_handle_list.h +++ b/src/share/allocator/ob_handle_list.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace common { class ObFifoArena; class ObHandleList { - public: +public: typedef ObDLink DLink; struct DList { DLink head_; @@ -163,18 +163,18 @@ class ObHandleList { return total_list_.next(iter); } - protected: +protected: void set_frozen_(Handle& handle); int64_t alloc_id() { return ATOMIC_AAF(&id_, 1); } - private: +private: void update_hazard(); int64_t calc_hazard(); - private: +private: int64_t id_; DList total_list_; DList active_list_; diff --git a/src/share/allocator/ob_memstore_allocator_mgr.h b/src/share/allocator/ob_memstore_allocator_mgr.h index a4a6be7a7..e66f22892 100644 --- a/src/share/allocator/ob_memstore_allocator_mgr.h +++ b/src/share/allocator/ob_memstore_allocator_mgr.h @@ -25,7 +25,7 @@ namespace common { class ObGMemstoreAllocator; class ObMemstoreAllocatorMgr { - public: +public: typedef ObGMemstoreAllocator TAllocator; typedef common::hash::ObHashMap TenantMemostoreAllocatorMap; ObMemstoreAllocatorMgr(); @@ -35,13 +35,13 @@ class ObMemstoreAllocatorMgr { int64_t get_all_tenants_memstore_used(); static ObMemstoreAllocatorMgr& get_instance(); - public: +public: void set_malloc_allocator(lib::ObMallocAllocator* malloc_allocator) { malloc_allocator_ = malloc_allocator; } - private: +private: static const uint64_t PRESERVED_TENANT_COUNT = 10000; static const uint64_t ALLOCATOR_MAP_BUCKET_NUM = 64; bool is_inited_; @@ -50,7 +50,7 @@ class ObMemstoreAllocatorMgr { lib::ObMallocAllocator* malloc_allocator_; int64_t all_tenants_memstore_used_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemstoreAllocatorMgr); }; // end of class ObMemstoreAllocatorMgr diff --git a/src/share/allocator/ob_tenant_mutil_allocator.h b/src/share/allocator/ob_tenant_mutil_allocator.h index ea5c79dd7..53c0e7005 100644 --- a/src/share/allocator/ob_tenant_mutil_allocator.h +++ b/src/share/allocator/ob_tenant_mutil_allocator.h @@ -35,13 +35,13 @@ namespace oceanbase { namespace common { // Interface for Clog module class ObILogAllocator { - public: +public: ObILogAllocator() {} virtual ~ObILogAllocator() {} - public: +public: virtual void* alloc_log_task_buf() = 0; virtual void free_log_task_buf(void* ptr) = 0; virtual void* ge_alloc(const int64_t size) = 0; @@ -65,13 +65,13 @@ class ObILogAllocator { // Interface for ReplayEngine module class ObIReplayTaskAllocator { - public: +public: ObIReplayTaskAllocator() {} virtual ~ObIReplayTaskAllocator() {} - public: +public: virtual void* alloc_replay_task_buf(const bool is_inner_table, const int64_t size) = 0; virtual void free_replay_task(const bool is_inner_table, void* ptr) = 0; virtual bool can_alloc_replay_task(const bool is_inner_table, int64_t size) const = 0; @@ -81,7 +81,7 @@ class ObIReplayTaskAllocator { }; class ObTenantMutilAllocator : public ObILogAllocator, public ObIReplayTaskAllocator, public common::ObLink { - public: +public: const int LOG_TASK_SIZE = sizeof(clog::ObLogTask); const int LOG_FLUSH_TASK_SIZE = sizeof(clog::ObLogFlushTask); const int LOG_FETCH_TASK_SIZE = sizeof(clog::ObFetchLogTask); @@ -102,7 +102,7 @@ class ObTenantMutilAllocator : public ObILogAllocator, public ObIReplayTaskAlloc const int64_t INNER_TABLE_REPLAY_MEM_PERCENT = 20; static int choose_blk_size(int obj_size); - public: +public: explicit ObTenantMutilAllocator(uint64_t tenant_id) : tenant_id_(tenant_id), total_limit_(INT64_MAX), @@ -200,7 +200,7 @@ class ObTenantMutilAllocator : public ObILogAllocator, public ObIReplayTaskAlloc void dec_pending_replay_mutator_size(int64_t size); int64_t get_pending_replay_mutator_size() const; - private: +private: uint64_t tenant_id_ CACHE_ALIGNED; int64_t total_limit_; int64_t log_task_alloc_count_; diff --git a/src/share/allocator/ob_tenant_mutil_allocator_mgr.h b/src/share/allocator/ob_tenant_mutil_allocator_mgr.h index c047eea04..cdc60dcdc 100644 --- a/src/share/allocator/ob_tenant_mutil_allocator_mgr.h +++ b/src/share/allocator/ob_tenant_mutil_allocator_mgr.h @@ -25,7 +25,7 @@ class ObIReplayTaskAllocator; class ObTenantMutilAllocator; class ObTenantMutilAllocatorMgr { - public: +public: typedef ObTenantMutilAllocator TMA; ObTenantMutilAllocatorMgr() : is_inited_(false), @@ -56,24 +56,24 @@ class ObTenantMutilAllocatorMgr { void free_log_task_buf(void* ptr); int update_tenant_mem_limit(const share::TenantUnits& all_tenant_units); - public: +public: static ObTenantMutilAllocatorMgr& get_instance(); - private: +private: int construct_allocator_(const uint64_t tenant_id, TMA*& out_allocator); int create_tenant_mutil_allocator_(const uint64_t tenant_id, TMA*& out_allocator); - private: +private: static const uint64_t PRESERVED_TENANT_COUNT = 10000; - private: +private: bool is_inited_; obsys::CRWLock locks_[PRESERVED_TENANT_COUNT]; ObTenantMutilAllocator* tma_array_[PRESERVED_TENANT_COUNT]; ObBlockAllocMgr clog_body_blk_alloc_; ObVSliceAlloc clog_entry_alloc_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantMutilAllocatorMgr); }; // end of class ObTenantMutilAllocatorMgr diff --git a/src/share/backup/ob_backup_file_lock_mgr.h b/src/share/backup/ob_backup_file_lock_mgr.h index c74e0febc..60f33263e 100644 --- a/src/share/backup/ob_backup_file_lock_mgr.h +++ b/src/share/backup/ob_backup_file_lock_mgr.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace share { class ObBackupFileLockMgr { - public: +public: ObBackupFileLockMgr(); virtual ~ObBackupFileLockMgr(); static ObBackupFileLockMgr& get_instance(); @@ -35,11 +35,11 @@ class ObBackupFileLockMgr { int try_lock(const ObBackupPath& path); int unlock(const ObBackupPath& path); - private: +private: int low_try_lock(const ObBackupPath& path, const int64_t max_spin_cnt, uint64_t& spin_cnt); int wait(const ObBackupPath& path, const int64_t abs_timeout_us); - private: +private: static const int64_t MAX_BUCKET_NUM = 1024; static const int64_t MAX_SPIN_TIMES = 1024; static const int64_t MAX_YIELD_CNT = 2; @@ -50,7 +50,7 @@ class ObBackupFileLockMgr { }; class ObBackupFileSpinLock { - public: +public: ObBackupFileSpinLock(); ~ObBackupFileSpinLock(); int init(const ObBackupPath& path); @@ -63,13 +63,13 @@ class ObBackupFileSpinLock { return path_; } - private: +private: // data members bool is_inited_; bool is_locked_; ObBackupPath path_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupFileSpinLock); }; diff --git a/src/share/backup/ob_backup_info_mgr.h b/src/share/backup/ob_backup_info_mgr.h index c512a2312..3af78db3c 100644 --- a/src/share/backup/ob_backup_info_mgr.h +++ b/src/share/backup/ob_backup_info_mgr.h @@ -22,7 +22,7 @@ namespace share { class ObRsMgr; class ObBackupDestDetector; class ObLogArchiveInfoMgr final { - public: +public: struct ObLogArchiveSimpleInfo final { int64_t update_ts_; int64_t checkpoint_ts_; @@ -41,14 +41,14 @@ class ObLogArchiveInfoMgr final { int get_log_archive_status(const uint64_t tenant_id, const int64_t need_ts, ObLogArchiveSimpleInfo& status); TO_STRING_KV(K_(update_count)); - private: +private: ObLogArchiveInfoMgr(); ~ObLogArchiveInfoMgr(); int get_log_archive_status_(const uint64_t tenant_id, ObLogArchiveSimpleInfo& status); int try_retire_status_(); int renew_log_archive_status_(const uint64_t tenant_id, ObLogArchiveSimpleInfo& status); - private: +private: typedef common::hash::ObHashMap STATUS_MAP; bool is_inited_; common::ObMySQLProxy* sql_proxy_; @@ -60,7 +60,7 @@ class ObLogArchiveInfoMgr final { }; class ObBackupInfoMgr final { - public: +public: typedef common::ObArray RestoreJobArray; static ObBackupInfoMgr& get_instance(); @@ -83,18 +83,18 @@ class ObBackupInfoMgr final { int is_base_backup_start(bool& is_started); int get_base_data_restore_schema_version(const uint64_t tenant_id, int64_t& schema_version); - private: +private: static const int64_t DEFAULT_UPDATE_INTERVAL_US = 10 * 1000 * 1000; // 10s int get_restore_info_from_cache(const uint64_t tenant_id, ObSimplePhysicalRestoreJob& simple_job_info); int get_restore_status_from_cache(const uint64_t tenant_id, PhysicalRestoreStatus& status); int check_backup_dest_(ObLogArchiveBackupInfo& backup_info); - private: +private: ObBackupInfoMgr(); ~ObBackupInfoMgr(); class ObBackupInfoUpdateTask : public common::ObTimerTask { - public: + public: ObBackupInfoUpdateTask() {} virtual ~ObBackupInfoUpdateTask() @@ -102,7 +102,7 @@ class ObBackupInfoMgr final { virtual void runTimerTask() override; }; - private: +private: bool is_inited_; common::ObMySQLProxy* sql_proxy_; common::ObTimer timer_; @@ -121,7 +121,7 @@ class ObBackupInfoMgr final { }; class ObRestoreBackupInfoUtil final { - public: +public: struct GetRestoreBackupInfoParam final { GetRestoreBackupInfoParam(); const char* backup_dest_; @@ -139,7 +139,7 @@ class ObRestoreBackupInfoUtil final { }; class ObRestoreFatalErrorReporter : public share::ObThreadPool { - public: +public: static ObRestoreFatalErrorReporter& get_instance(); int init(obrpc::ObCommonRpcProxy& rpc_proxy, share::ObRsMgr& rs_mgr); @@ -149,7 +149,7 @@ class ObRestoreFatalErrorReporter : public share::ObThreadPool { virtual void stop() override; virtual void wait() override; - private: +private: ObRestoreFatalErrorReporter(); virtual ~ObRestoreFatalErrorReporter(); virtual void run1() override; @@ -157,7 +157,7 @@ class ObRestoreFatalErrorReporter : public share::ObThreadPool { int report_restore_error_(const obrpc::ObPhysicalRestoreResult& result); int remove_restore_error_task_(const obrpc::ObPhysicalRestoreResult& result); - private: +private: bool is_inited_; obrpc::ObCommonRpcProxy* rpc_proxy_; share::ObRsMgr* rs_mgr_; @@ -167,7 +167,7 @@ class ObRestoreFatalErrorReporter : public share::ObThreadPool { }; class ObBackupDestDetector : public share::ObThreadPool { - public: +public: static ObBackupDestDetector& get_instance(); int init(); virtual int start() override; @@ -177,7 +177,7 @@ class ObBackupDestDetector : public share::ObThreadPool { int get_is_backup_dest_bad(const int64_t round_id, bool& is_bad); int update_backup_info(const ObLogArchiveBackupInfo& info); - private: +private: ObBackupDestDetector(); virtual ~ObBackupDestDetector(); virtual void run1() override; @@ -185,7 +185,7 @@ class ObBackupDestDetector : public share::ObThreadPool { int check_backup_dest_(ObLogArchiveBackupInfo& backup_info, bool& is_bad); void idle(); - private: +private: bool is_inited_; common::SpinRWLock lock_; ObLogArchiveBackupInfo info_; diff --git a/src/share/backup/ob_backup_lease_info_mgr.h b/src/share/backup/ob_backup_lease_info_mgr.h index 0b8079b2c..dd83e46c9 100644 --- a/src/share/backup/ob_backup_lease_info_mgr.h +++ b/src/share/backup/ob_backup_lease_info_mgr.h @@ -46,7 +46,7 @@ struct ObBackupLeaseInfo { }; class ObBackupLeaseInfoMgr { - public: +public: ObBackupLeaseInfoMgr(); virtual ~ObBackupLeaseInfoMgr(); int init(const common::ObAddr& addr, common::ObMySQLProxy& sql_proxy); @@ -55,7 +55,7 @@ class ObBackupLeaseInfoMgr { int clean_backup_lease_info( const int64_t next_round, const ObBackupLeaseInfo& old_lease_info, ObBackupLeaseInfo& new_lease_info); - private: +private: int get_backup_scheduler_leader( common::ObISQLClient& sql_client, common::ObAddr& backup_leader_addr, bool& has_leader); int update_backup_scheduler_leader(const common::ObAddr& backup_leader_addr, common::ObISQLClient& sql_client); @@ -65,7 +65,7 @@ class ObBackupLeaseInfoMgr { const char*& msg); int get_core_table_info_(ObRole& role, int64_t& leader_epoch, int64_t& takeover_time); - private: +private: bool is_inited_; common::ObPartitionKey all_core_table_key_; common::ObAddr local_addr_; @@ -75,7 +75,7 @@ class ObBackupLeaseInfoMgr { }; class ObIBackupLeaseService { - public: +public: virtual ~ObIBackupLeaseService() {} virtual int check_lease() = 0; @@ -84,7 +84,7 @@ class ObIBackupLeaseService { }; class ObFakeBackupLeaseService : public ObIBackupLeaseService { - public: +public: virtual int check_lease(); virtual int get_lease_status(bool& is_lease_valid); }; diff --git a/src/share/backup/ob_backup_manager.h b/src/share/backup/ob_backup_manager.h index a8170e091..84ba92c03 100644 --- a/src/share/backup/ob_backup_manager.h +++ b/src/share/backup/ob_backup_manager.h @@ -26,7 +26,7 @@ class ObBackupItemTransUpdater; class ObIBackupLeaseService; struct ObBackupInfoItem : public common::ObDLinkBase { - public: +public: typedef common::ObFixedLengthString Value; typedef common::ObDList ItemList; @@ -55,7 +55,7 @@ struct ObBackupInfoItem : public common::ObDLinkBase { // insert int insert(common::ObISQLClient& sql_client, const uint64_t tenant_id); - public: +public: const char* name_; Value value_; }; @@ -63,7 +63,7 @@ struct ObBackupInfoItem : public common::ObDLinkBase { // Update item in transaction, if transaction rollback or commit failed the item value // value will be rollback too. class ObBackupItemTransUpdater { - public: +public: ObBackupItemTransUpdater(); ~ObBackupItemTransUpdater(); @@ -76,7 +76,7 @@ class ObBackupItemTransUpdater { return trans_; } - private: +private: const static int64_t PTR_OFFSET = sizeof(void*); bool started_; @@ -85,7 +85,7 @@ class ObBackupItemTransUpdater { }; struct ObBaseBackupInfo { - public: +public: ObBaseBackupInfo(); ObBaseBackupInfo(const ObBaseBackupInfo& other); ObBaseBackupInfo& operator=(const ObBaseBackupInfo& other); @@ -100,7 +100,7 @@ struct ObBaseBackupInfo { } int get_backup_info_status(); - public: +public: uint64_t tenant_id_; ObBackupInfoItem::ItemList list_; // base data backup info @@ -120,7 +120,7 @@ struct ObBaseBackupInfo { }; class ObBackupInfoManager { - public: +public: // friend class FakeZoneMgr; ObBackupInfoManager(); virtual ~ObBackupInfoManager(); @@ -164,7 +164,7 @@ class ObBackupInfoManager { int update_last_delete_expired_data_snapshot( const uint64_t tenant_id, const int64_t last_delete_expired_data_snapshot, common::ObISQLClient& trans); - private: +private: int convert_info_to_struct(const ObBaseBackupInfo& info, ObBaseBackupInfoStruct& info_struct); int convert_struct_to_info(const ObBaseBackupInfoStruct& info_struct, ObBaseBackupInfo& info); int find_tenant_id(const uint64_t tenant_id); @@ -173,12 +173,12 @@ class ObBackupInfoManager { int check_can_update_( const ObBackupInfoStatus::BackupStatus& src_status, const ObBackupInfoStatus::BackupStatus& dest_status); - private: +private: bool inited_; common::ObArray tenant_ids_; common::ObMySQLProxy* proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupInfoManager); }; @@ -191,7 +191,7 @@ struct ObBackupInfoSimpleItem { }; class ObBackupInfoChecker final { - public: +public: ObBackupInfoChecker(); ~ObBackupInfoChecker(); @@ -199,7 +199,7 @@ class ObBackupInfoChecker final { int check(const common::ObIArray& tenant_ids, share::ObIBackupLeaseService& backup_lease_service); int check(const uint64_t tenant_id); - private: +private: int get_item_count_(const uint64_t tenant_id, int64_t& item_count); int get_status_line_count_(const uint64_t tenant_id, int64_t& status_count); int get_new_items_(common::ObISQLClient& trans, const uint64_t tenant_id, const bool for_update, @@ -209,7 +209,7 @@ class ObBackupInfoChecker final { int insert_new_item_(common::ObMySQLTransaction& trans, const uint64_t tenant_id, ObBackupInfoSimpleItem& item); int insert_log_archive_status_(common::ObMySQLTransaction& trans, const uint64_t tenant_id); - private: +private: bool is_inited_; common::ObMySQLProxy* sql_proxy_; DISALLOW_COPY_AND_ASSIGN(ObBackupInfoChecker); diff --git a/src/share/backup/ob_backup_operator.h b/src/share/backup/ob_backup_operator.h index 14eb81ed2..93f97c36d 100644 --- a/src/share/backup/ob_backup_operator.h +++ b/src/share/backup/ob_backup_operator.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace share { class ObITenantBackupTaskOperator { - public: +public: ObITenantBackupTaskOperator() = default; virtual ~ObITenantBackupTaskOperator() = default; static int get_tenant_backup_task(const uint64_t tenant_id, const common::ObSqlString& sql, @@ -40,12 +40,12 @@ class ObITenantBackupTaskOperator { static int fill_task_clean_history(const ObTenantBackupTaskItem& item, ObDMLSqlSplicer& dml); static int extract_tenant_backup_task(sqlclient::ObMySQLResult* result, ObTenantBackupTaskItem& item); - private: +private: static int fill_one_item(const ObTenantBackupTaskItem& item, ObDMLSqlSplicer& dml); }; class ObTenantBackupTaskOperator { - public: +public: ObTenantBackupTaskOperator() = default; virtual ~ObTenantBackupTaskOperator() = default; static int get_tenant_backup_task(const uint64_t tenant_id, const int64_t backup_set_id, const int64_t incarnation, @@ -57,13 +57,13 @@ class ObTenantBackupTaskOperator { static int get_tenant_backup_task( const uint64_t tenant_id, ObTenantBackupTaskItem& item, common::ObISQLClient& proxy); - private: +private: static int remove_one_item(const uint64_t tenant_id, const int64_t incarnation, const int64_t backup_set_id, common::ObISQLClient& sql_proxy); }; class ObPGBackupTaskOperator { - public: +public: ObPGBackupTaskOperator() = default; virtual ~ObPGBackupTaskOperator() = default; static int get_pg_backup_task(ObPGBackupTaskItem& item, common::ObISQLClient& sql_proxy); @@ -96,7 +96,7 @@ class ObPGBackupTaskOperator { static int update_result_and_status_and_statics( common::ObISQLClient& sql_proxy, const ObPGBackupTaskInfo& pg_task_info); - private: +private: static int fill_one_item(const ObPGBackupTaskItem& item, ObDMLSqlSplicer& dml); static int get_pg_backup_task(const uint64_t tenant_id, const common::ObSqlString& sql, common::ObIArray& items, common::ObISQLClient& sql_proxy); @@ -105,7 +105,7 @@ class ObPGBackupTaskOperator { }; class ObTenantBackupInfoOperation { - public: +public: static int update_info_item(common::ObISQLClient& sql_client, const uint64_t tenant_id, const ObBackupInfoItem& item); static int get_tenant_list(common::ObISQLClient& sql_client, common::ObIArray& tenant_id_list); static int load_base_backup_info(common::ObISQLClient& sql_client, ObBaseBackupInfo& info); @@ -124,7 +124,7 @@ class ObTenantBackupInfoOperation { static int clean_backup_scheduler_leader( common::ObISQLClient& sql_client, const uint64_t tenant_id, const common::ObAddr& scheduler_leader); - private: +private: template static int set_info_item(const char* name, const char* info_str, T& info); template @@ -135,7 +135,7 @@ class ObTenantBackupInfoOperation { }; class ObBackupTaskHistoryOperator { - public: +public: ObBackupTaskHistoryOperator() = default; virtual ~ObBackupTaskHistoryOperator() = default; static int get_tenant_backup_task(const uint64_t tenant_id, const int64_t backup_set_id, const int64_t incarnation, @@ -168,13 +168,13 @@ class ObBackupTaskHistoryOperator { const uint64_t tenant_id, common::ObISQLClient& proxy, ObTenantBackupTaskItem& item); static int get_all_tenant_backup_tasks(common::ObISQLClient& proxy, common::ObIArray& items); - private: +private: static int remove_one_item(const uint64_t tenant_id, const int64_t incarnation, const int64_t backup_set_id, common::ObISQLClient& sql_proxy); }; class ObTenantBackupCleanInfoOperator { - public: +public: ObTenantBackupCleanInfoOperator() = default; virtual ~ObTenantBackupCleanInfoOperator() = default; static int insert_clean_info( @@ -189,7 +189,7 @@ class ObTenantBackupCleanInfoOperator { static int get_deleted_tenant_clean_infos( common::ObISQLClient& sql_proxy, common::ObIArray& deleted_tenant_clean_infos); - private: +private: static int fill_one_item(const ObBackupCleanInfo& clean_info, ObDMLSqlSplicer& dml); static int get_tenant_clean_info(const uint64_t tenant_id, const common::ObSqlString& sql, common::ObIArray& clean_infos, common::ObISQLClient& sql_proxy); @@ -198,26 +198,26 @@ class ObTenantBackupCleanInfoOperator { }; class ObBackupCleanInfoHistoryOperator { - public: +public: ObBackupCleanInfoHistoryOperator() = default; virtual ~ObBackupCleanInfoHistoryOperator() = default; static int insert_clean_info(const ObBackupCleanInfo& clean_info, common::ObISQLClient& proxy); static int remove_tenant_clean_info(const uint64_t tenant_id, common::ObISQLClient& sql_proxy); - private: +private: static int fill_one_item(const ObBackupCleanInfo& clean_info, ObDMLSqlSplicer& dml); static int remove_one_item(const uint64_t tenant_id, common::ObISQLClient& sql_proxy); }; class ObBackupTaskCleanHistoryOpertor { - public: +public: ObBackupTaskCleanHistoryOpertor() = default; virtual ~ObBackupTaskCleanHistoryOpertor() = default; static int insert_task_info( const int64_t job_id, const ObTenantBackupTaskInfo& tenant_backup_task, common::ObISQLClient& proxy); static int remove_task_info(const uint64_t tenant_id, const int64_t job_id, common::ObISQLClient& sql_proxy); - private: +private: static int fill_one_item( const int64_t job_id, const ObTenantBackupTaskInfo& tenant_backup_task, ObDMLSqlSplicer& dml); static int remove_one_item(const uint64_t tenant_id, const int64_t job_id, common::ObISQLClient& sql_proxy); diff --git a/src/share/backup/ob_backup_path.h b/src/share/backup/ob_backup_path.h index 4473ba2e0..b7cacd0ee 100644 --- a/src/share/backup/ob_backup_path.h +++ b/src/share/backup/ob_backup_path.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace share { struct ObBackupPath final { - public: +public: ObBackupPath(); ~ObBackupPath(); void reset(); @@ -55,7 +55,7 @@ struct ObBackupPath final { uint64_t hash() const; TO_STRING_KV(K_(cur_pos), K_(path)); - private: +private: int64_t cur_pos_; char path_[OB_MAX_BACKUP_PATH_LENGTH]; }; @@ -145,14 +145,14 @@ struct ObBackupPathUtil { }; class ObBackupMountFile final { - public: +public: static int get_mount_file_path( const ObLogArchiveBackupInfo& backup_info, ObClusterBackupDest& cluster_dest, share::ObBackupPath& path); static int create_mount_file(const ObLogArchiveBackupInfo& info); static int check_mount_file(const ObLogArchiveBackupInfo& info); static int need_check_mount_file(const ObLogArchiveBackupInfo& info, bool& need_check); - private: +private: ObBackupMountFile(); DISALLOW_COPY_AND_ASSIGN(ObBackupMountFile); }; diff --git a/src/share/backup/ob_backup_scheduler.h b/src/share/backup/ob_backup_scheduler.h index 404e602a7..dbe1f3088 100644 --- a/src/share/backup/ob_backup_scheduler.h +++ b/src/share/backup/ob_backup_scheduler.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace share { class ObBackupScheduler { - public: +public: ObBackupScheduler(); virtual ~ObBackupScheduler(); int init(const obrpc::ObBackupDatabaseArg& arg, schema::ObMultiVersionSchemaService& schema_service, @@ -33,7 +33,7 @@ class ObBackupScheduler { rootserver::ObFreezeInfoManager& freeze_info_manager, rootserver::ObRestorePointService& restore_point_service); int start_schedule_backup(); - private: +private: int get_tenant_ids(common::ObIArray& tenant_ids); int check_can_backup(const common::ObIArray& infos); int schedule_backup(const common::ObIArray& tenant_ids, ObBackupInfoManager& info_manager); @@ -61,7 +61,7 @@ class ObBackupScheduler { int create_backup_point(const uint64_t tenant_id); int check_log_archive_status(); - private: +private: static const int64_t MAX_TENANT_BUCKET = 1024; bool is_inited_; obrpc::ObBackupDatabaseArg arg_; diff --git a/src/share/backup/ob_backup_struct.h b/src/share/backup/ob_backup_struct.h index 4f977c36c..19fd75905 100644 --- a/src/share/backup/ob_backup_struct.h +++ b/src/share/backup/ob_backup_struct.h @@ -188,7 +188,7 @@ struct ObBackupMetaIndex { static const uint8_t META_INDEX_VERSION = 1; OB_UNIS_VERSION(META_INDEX_VERSION); - public: +public: ObBackupMetaIndex(); void reset(); int check_valid() const; @@ -205,7 +205,7 @@ struct ObBackupMacroIndex { static const int64_t MACRO_INDEX_VERSION = 1; OB_UNIS_VERSION(MACRO_INDEX_VERSION); - public: +public: ObBackupMacroIndex(); void reset(); int check_valid() const; @@ -276,7 +276,7 @@ struct ObLogArchiveStatus final { struct ObGetTenantLogArchiveStatusArg final { OB_UNIS_VERSION(1); - public: +public: uint64_t incarnation_; uint64_t round_; bool is_valid() const @@ -293,7 +293,7 @@ struct ObTenantLogArchiveStatus final { OB_UNIS_VERSION(1); - public: +public: ObTenantLogArchiveStatus(); void reset(); bool is_valid() const; @@ -312,7 +312,7 @@ struct ObTenantLogArchiveStatus final { TO_STRING_KV(K_(tenant_id), K_(start_ts), K_(checkpoint_ts), K_(status), K_(incarnation), K_(round), "status_str", ObLogArchiveStatus::get_str(status_), K_(is_mark_deleted), K_(is_mount_file_created), K_(compatible)); - private: +private: int update_stop_(const ObTenantLogArchiveStatus& new_status); int update_beginning_(const ObTenantLogArchiveStatus& new_status); int update_doing_(const ObTenantLogArchiveStatus& new_status); @@ -323,7 +323,7 @@ struct ObTenantLogArchiveStatus final { struct ObTenantLogArchiveStatusWrapper final { OB_UNIS_VERSION(1); - public: +public: ObTenantLogArchiveStatusWrapper(); int32_t result_code_; common::ObSArray status_array_; @@ -490,7 +490,7 @@ struct ObBackupDeviceType final { }; struct ObBaseBackupInfoStruct { - public: +public: typedef common::ObFixedLengthString BackupDest; ObBaseBackupInfoStruct(); virtual ~ObBaseBackupInfoStruct() = default; @@ -523,7 +523,7 @@ struct ObBaseBackupInfoStruct { // TODO() add compatible and cluster_version // to TenantBackupTaskItem struct ObTenantBackupTaskItem { - public: +public: enum BackupStatus { GENERATE = 0, DOING = 1, @@ -532,7 +532,7 @@ struct ObTenantBackupTaskItem { MAX, }; - public: +public: ObTenantBackupTaskItem(); virtual ~ObTenantBackupTaskItem() = default; void reset(); @@ -586,7 +586,7 @@ typedef ObTenantBackupTaskItem ObTenantBackupTaskInfo; // pg backup task item struct ObPGBackupTaskItem { - public: +public: enum BackupStatus { PENDING = 0, DOING = 1, @@ -595,7 +595,7 @@ struct ObPGBackupTaskItem { MAX, }; - public: +public: ObPGBackupTaskItem(); virtual ~ObPGBackupTaskItem() = default; void reset(); @@ -653,7 +653,7 @@ struct ObBackupValidateTenant { }; struct ObBackupValidateTaskItem { - public: +public: enum ValidateStatus { SCHEDULE = 0, DOING = 1, @@ -662,7 +662,7 @@ struct ObBackupValidateTaskItem { MAX, }; - public: +public: ObBackupValidateTaskItem(); virtual ~ObBackupValidateTaskItem(); void reset(); @@ -687,7 +687,7 @@ struct ObBackupValidateTaskItem { typedef ObBackupValidateTaskItem ObBackupValidateTaskInfo; struct ObTenantValidateTaskItem { - public: +public: enum ValidateStatus { SCHEDULE = 0, DOING = 1, @@ -696,7 +696,7 @@ struct ObTenantValidateTaskItem { MAX, }; - public: +public: ObTenantValidateTaskItem(); virtual ~ObTenantValidateTaskItem(); void reset(); @@ -734,7 +734,7 @@ struct ObTenantValidateTaskItem { typedef ObTenantValidateTaskItem ObTenantValidateTaskInfo; struct ObPGValidateTaskItem { - public: +public: enum ValidateStatus { PENDING = 0, DOING = 1, @@ -742,7 +742,7 @@ struct ObPGValidateTaskItem { MAX, }; - public: +public: ObPGValidateTaskItem(); virtual ~ObPGValidateTaskItem(); void reset(); @@ -782,7 +782,7 @@ struct ObPGValidateTaskItem { typedef ObPGValidateTaskItem ObPGValidateTaskInfo; struct ObPGValidateTaskRowKey { - public: +public: ObPGValidateTaskRowKey(); virtual ~ObPGValidateTaskRowKey(); int set(const ObPGValidateTaskInfo* pg_task); @@ -825,7 +825,7 @@ struct ObBackupBackupsetType final { }; struct ObBackupBackupsetJobItem { - public: +public: enum JobStatus { SCHEDULE, BACKUP, @@ -834,7 +834,7 @@ struct ObBackupBackupsetJobItem { MAX, }; - public: +public: ObBackupBackupsetJobItem(); virtual ~ObBackupBackupsetJobItem(); @@ -860,7 +860,7 @@ struct ObBackupBackupsetJobItem { typedef ObBackupBackupsetJobItem ObBackupBackupsetJobInfo; struct ObTenantBackupBackupsetTaskItem { - public: +public: enum TaskStatus { GENERATE, BACKUP, @@ -869,7 +869,7 @@ struct ObTenantBackupBackupsetTaskItem { MAX, }; - public: +public: ObTenantBackupBackupsetTaskItem(); virtual ~ObTenantBackupBackupsetTaskItem(); @@ -921,7 +921,7 @@ struct ObTenantBackupBackupsetTaskItem { typedef ObTenantBackupBackupsetTaskItem ObTenantBackupBackupsetTaskInfo; struct ObPGBackupBackupsetTaskRowKey { - public: +public: ObPGBackupBackupsetTaskRowKey(); ~ObPGBackupBackupsetTaskRowKey(); @@ -943,7 +943,7 @@ struct ObPGBackupBackupsetTaskRowKey { }; struct ObPGBackupBackupsetTaskStat { - public: +public: ObPGBackupBackupsetTaskStat(); ~ObPGBackupBackupsetTaskStat(); @@ -962,7 +962,7 @@ struct ObPGBackupBackupsetTaskStat { }; struct ObPGBackupBackupsetTaskItem { - public: +public: enum TaskStatus { PENDING, DOING, @@ -970,7 +970,7 @@ struct ObPGBackupBackupsetTaskItem { MAX, }; - public: +public: ObPGBackupBackupsetTaskItem(); virtual ~ObPGBackupBackupsetTaskItem(); @@ -1008,7 +1008,7 @@ typedef ObPGBackupBackupsetTaskItem ObPGBackupBackupsetTaskInfo; class ObBackupPath; class ObIBackupLeaseService; class ObBackupUtils { - public: +public: ObBackupUtils() {} virtual ~ObBackupUtils() @@ -1020,7 +1020,7 @@ class ObBackupUtils { schema::ObMultiVersionSchemaService& schema_service, const int64_t tenant_schema_version, schema::ObSchemaGetterGuard& schema_guard); - private: +private: static const int64_t RETRY_INTERVAL = 10 * 1000 * 1000; static const int64_t MAX_RETRY_TIMES = 3; }; @@ -1062,7 +1062,7 @@ struct ObBackupBaseDataPathInfo final { struct ObPhysicalRestoreInfo final { OB_UNIS_VERSION(1); - public: +public: char backup_dest_[OB_MAX_BACKUP_DEST_LENGTH]; char cluster_name_[common::OB_MAX_CLUSTER_NAME_LENGTH]; int64_t cluster_id_; @@ -1107,7 +1107,7 @@ struct ObRestoreBackupInfo final { struct ObPhysicalRestoreArg final { OB_UNIS_VERSION(1); - public: +public: ObPhysicalRestoreArg(); ObPhysicalRestoreArg(const ObPhysicalRestoreArg& other); virtual ~ObPhysicalRestoreArg() @@ -1128,7 +1128,7 @@ struct ObPhysicalRestoreArg final { } TO_STRING_KV(K_(restore_info), K_(pg_key), K_(restore_data_version)); - public: +public: ObPhysicalRestoreInfo restore_info_; common::ObPartitionKey pg_key_; int64_t restore_data_version_; @@ -1137,7 +1137,7 @@ struct ObPhysicalRestoreArg final { struct ObPhysicalValidateArg final { OB_UNIS_VERSION(1); - public: +public: ObPhysicalValidateArg(); virtual ~ObPhysicalValidateArg() {} @@ -1156,7 +1156,7 @@ struct ObPhysicalValidateArg final { K_(clog_end_timestamp), K_(start_log_id), K_(end_log_id), K_(log_size), K_(is_dropped_tenant), K_(need_validate_clog), K_(full_backup_set_id), K_(inc_backup_set_id), K_(cluster_version)); - public: +public: char backup_dest_[OB_MAX_BACKUP_DEST_LENGTH]; char cluster_name_[common::OB_MAX_CLUSTER_NAME_LENGTH]; char uri_header_[common::OB_MAX_URI_HEADER_LENGTH]; @@ -1189,7 +1189,7 @@ struct ObPhysicalValidateArg final { struct ObPhysicalBackupArg final { OB_UNIS_VERSION(1); - public: +public: ObPhysicalBackupArg(); void reset(); bool is_valid() const; @@ -1217,7 +1217,7 @@ struct ObPhysicalBackupArg final { struct ObBackupBackupsetArg final { OB_UNIS_VERSION(1); - public: +public: ObBackupBackupsetArg(); void reset(); bool is_valid() const; @@ -1255,14 +1255,14 @@ struct ObBackupBackupsetArg final { struct ObExternBackupInfo { OB_UNIS_VERSION(1); - public: +public: enum ExternBackupInfoStatus { SUCCESS = 0, DOING = 1, FAILED = 2, }; - public: +public: ObExternBackupInfo(); virtual ~ObExternBackupInfo() {} @@ -1297,7 +1297,7 @@ struct ObExternBackupInfo { struct ObExternBackupSetInfo { OB_UNIS_VERSION(1); - public: +public: ObExternBackupSetInfo(); virtual ~ObExternBackupSetInfo() = default; void reset(); @@ -1321,7 +1321,7 @@ struct ObExternBackupSetInfo { struct ObExternTenantInfo { OB_UNIS_VERSION(1); - public: +public: ObExternTenantInfo(); virtual ~ObExternTenantInfo() = default; void reset(); @@ -1341,7 +1341,7 @@ struct ObExternTenantInfo { struct ObExternTenantLocalityInfo { OB_UNIS_VERSION(1); - public: +public: ObExternTenantLocalityInfo(); virtual ~ObExternTenantLocalityInfo() = default; void reset(); @@ -1363,7 +1363,7 @@ struct ObExternTenantLocalityInfo { }; struct ObExternBackupDiagnoseInfo { - public: +public: ObExternBackupDiagnoseInfo(); virtual ~ObExternBackupDiagnoseInfo() = default; void reset(); @@ -1408,7 +1408,7 @@ struct ObBackupCleanType final { }; struct ObBackupCleanInfo { - public: +public: ObBackupCleanInfo(); virtual ~ObBackupCleanInfo() = default; void reset(); diff --git a/src/share/backup/ob_extern_backup_info_mgr.h b/src/share/backup/ob_extern_backup_info_mgr.h index 9a227a9d5..3c42bfff6 100644 --- a/src/share/backup/ob_extern_backup_info_mgr.h +++ b/src/share/backup/ob_extern_backup_info_mgr.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace share { class ObIExternInfos { - public: +public: ObIExternInfos() {} virtual ~ObIExternInfos() @@ -32,7 +32,7 @@ class ObIExternInfos { virtual int read_buf(const char* buf, const int64_t buf_len) = 0; virtual int64_t get_write_buf_size() const = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIExternInfos); }; @@ -40,7 +40,7 @@ class ObExternBackupInfos : public ObIExternInfos { static const uint8_t VERSION = 1; OB_UNIS_VERSION(VERSION); - public: +public: ObExternBackupInfos(); virtual ~ObExternBackupInfos(); @@ -78,7 +78,7 @@ class ObExternBackupInfos : public ObIExternInfos { TO_STRING_KV(K_(extern_backup_info_array)); - private: +private: common::ObSArray extern_backup_info_array_; // no need serialize bool is_modified_; @@ -86,7 +86,7 @@ class ObExternBackupInfos : public ObIExternInfos { }; class ObExternBackupInfoMgr { - public: +public: ObExternBackupInfoMgr(); virtual ~ObExternBackupInfoMgr(); int init(const uint64_t tenant_id, const ObClusterBackupDest& backup_dest, @@ -113,14 +113,14 @@ class ObExternBackupInfoMgr { int upload_backup_info(); int get_last_info(ObExternBackupInfo& last_backup_info); - private: +private: int get_extern_backup_infos(const uint64_t tenant_id, const ObClusterBackupDest& backup_dest); int get_last_succeed_info(); int get_backup_path(const uint64_t tenant_id, const ObClusterBackupDest& backup_dest, ObBackupPath& path); int try_finish_extern_backup_info(const int64_t backup_set_id); int get_lastest_incremental_backup_count(int32_t& incremental_backup_count); - private: +private: bool is_inited_; uint64_t tenant_id_; ObClusterBackupDest backup_dest_; @@ -135,7 +135,7 @@ class ObExternBackupSetInfos : public ObIExternInfos { static const uint8_t VERSION = 1; OB_UNIS_VERSION(VERSION); - public: +public: ObExternBackupSetInfos(); virtual ~ObExternBackupSetInfos(); @@ -149,13 +149,13 @@ class ObExternBackupSetInfos : public ObIExternInfos { TO_STRING_KV(K_(extern_backup_set_info_array)); - private: +private: common::ObSArray extern_backup_set_info_array_; DISALLOW_COPY_AND_ASSIGN(ObExternBackupSetInfos); }; class ObExternBackupSetInfoMgr { - public: +public: ObExternBackupSetInfoMgr(); virtual ~ObExternBackupSetInfoMgr(); int init(const uint64_t tenant_id, const int64_t full_backup_set_id, const ObClusterBackupDest& backup_dest, @@ -165,11 +165,11 @@ class ObExternBackupSetInfoMgr { int touch_extern_backup_set_info(); int delete_extern_backup_set_info(); - private: +private: int get_extern_backup_set_infos( const uint64_t tenant_id, const int64_t full_backup_set_id, const ObClusterBackupDest& backup_dest); - private: +private: bool is_inited_; uint64_t tenant_id_; int64_t full_backup_set_id_; @@ -184,7 +184,7 @@ class ObExternPGList : public ObIExternInfos { static const uint8_t VERSION = 1; OB_UNIS_VERSION(VERSION); - public: +public: ObExternPGList(); virtual ~ObExternPGList() = default; void reset(); @@ -199,7 +199,7 @@ class ObExternPGList : public ObIExternInfos { }; class ObExternPGListMgr { - public: +public: ObExternPGListMgr(); virtual ~ObExternPGListMgr(); int init(const uint64_t tenant_id, const int64_t full_backup_set_id, const int64_t inc_backup_set_id, @@ -209,13 +209,13 @@ class ObExternPGListMgr { int get_sys_pg_list(common::ObIArray& pg_keys); int get_normal_pg_list(common::ObIArray& pg_keys); - private: +private: int upload_sys_pg_list(); int upload_normal_pg_list(); int get_extern_sys_pg_list(); int get_extern_normal_pg_list(); - private: +private: bool is_inited_; uint64_t tenant_id_; int64_t full_backup_set_id_; @@ -231,7 +231,7 @@ class ObExternTenantInfos : public ObIExternInfos { static const uint8_t VERSION = 1; OB_UNIS_VERSION(VERSION); - public: +public: ObExternTenantInfos(); virtual ~ObExternTenantInfos(); @@ -255,7 +255,7 @@ class ObExternTenantInfos : public ObIExternInfos { TO_STRING_KV(K_(extern_tenant_info_array)); - private: +private: common::ObSArray extern_tenant_info_array_; // no need serialize bool is_modified_; @@ -263,7 +263,7 @@ class ObExternTenantInfos : public ObIExternInfos { }; class ObExternTenantInfoMgr { - public: +public: ObExternTenantInfoMgr(); virtual ~ObExternTenantInfoMgr(); int init(const ObClusterBackupDest& backup_dest, share::ObIBackupLeaseService& backup_lease_service); @@ -278,10 +278,10 @@ class ObExternTenantInfoMgr { return extern_tenant_infos_.is_extern_tenant_infos_modified(); } - private: +private: int get_extern_tenant_infos(const ObClusterBackupDest& backup_dest); - private: +private: bool is_inited_; ObClusterBackupDest backup_dest_; ObExternTenantInfos extern_tenant_infos_; @@ -294,7 +294,7 @@ class ObExternTenantLocality : public ObIExternInfos { static const uint8_t VERSION = 1; OB_UNIS_VERSION(VERSION); - public: +public: ObExternTenantLocality(); virtual ~ObExternTenantLocality(); @@ -310,13 +310,13 @@ class ObExternTenantLocality : public ObIExternInfos { int set_tenant_locality_info(const ObExternTenantLocalityInfo& tenant_locality_info); TO_STRING_KV(K_(extern_tenant_locality_info)); - private: +private: ObExternTenantLocalityInfo extern_tenant_locality_info_; DISALLOW_COPY_AND_ASSIGN(ObExternTenantLocality); }; class ObExternTenantLocalityInfoMgr { - public: +public: ObExternTenantLocalityInfoMgr(); virtual ~ObExternTenantLocalityInfoMgr(); int init(const uint64_t tenant_id, const int64_t full_backup_set_id, const int64_t inc_backup_set_id, @@ -324,7 +324,7 @@ class ObExternTenantLocalityInfoMgr { int upload_tenant_locality_info(const ObExternTenantLocalityInfo& tenant_locality_info); int get_extern_tenant_locality_info(ObExternTenantLocalityInfo& tenant_locality_info); - private: +private: bool is_inited_; uint64_t tenant_id_; int64_t full_backup_set_id_; @@ -336,18 +336,18 @@ class ObExternTenantLocalityInfoMgr { }; class ObExternTenantBackupDiagnoseMgr { - public: +public: ObExternTenantBackupDiagnoseMgr(); virtual ~ObExternTenantBackupDiagnoseMgr(); int init(const uint64_t tenant_id, const int64_t full_backup_set_id, const int64_t inc_backup_set_id, const ObClusterBackupDest& backup_dest, share::ObIBackupLeaseService& backup_lease_service); int upload_tenant_backup_diagnose_info(const ObExternBackupDiagnoseInfo& diagnose_info); - private: +private: int64_t get_write_buf_size() const; int write_buf(const ObExternBackupDiagnoseInfo& diagnose_info, char* buf, const int64_t buf_len, int64_t& pos) const; - private: +private: bool is_inited_; uint64_t tenant_id_; int64_t full_backup_set_id_; diff --git a/src/share/backup/ob_log_archive_backup_info_mgr.h b/src/share/backup/ob_log_archive_backup_info_mgr.h index 368ef3cee..c85e96602 100644 --- a/src/share/backup/ob_log_archive_backup_info_mgr.h +++ b/src/share/backup/ob_log_archive_backup_info_mgr.h @@ -28,7 +28,7 @@ class ObExternLogArchiveBackupInfo final { static const uint8_t LOG_ARCHIVE_BACKUP_INFO_CONTENT_VERSION = 1; OB_UNIS_VERSION(VERSION); - public: +public: ObExternLogArchiveBackupInfo(); ~ObExternLogArchiveBackupInfo(); @@ -47,13 +47,13 @@ class ObExternLogArchiveBackupInfo final { TO_STRING_KV(K_(status_array)); - private: +private: common::ObSArray status_array_; DISALLOW_COPY_AND_ASSIGN(ObExternLogArchiveBackupInfo); }; class ObLogArchiveBackupInfoMgr final { - public: +public: ObLogArchiveBackupInfoMgr(); ~ObLogArchiveBackupInfoMgr(); @@ -91,7 +91,7 @@ class ObLogArchiveBackupInfoMgr final { int delete_marked_extern_log_archive_backup_info(const ObClusterBackupDest& cluster_backup_dest, const uint64_t tenant_id, share::ObIBackupLeaseService& backup_lease_service); - private: +private: int get_log_archive_backup_info_with_lock_( common::ObISQLClient& sql_client, const uint64_t tenant_id, ObLogArchiveBackupInfo& info); int get_log_archive_status_( @@ -113,11 +113,11 @@ class ObLogArchiveBackupInfoMgr final { const char* get_cur_table_name_() const; const char* get_his_table_name_() const; - private: +private: bool deal_with_copy_; int64_t copy_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogArchiveBackupInfoMgr); }; diff --git a/src/share/backup/ob_pg_backup_task_updater.h b/src/share/backup/ob_pg_backup_task_updater.h index 03f625573..85f70c02e 100644 --- a/src/share/backup/ob_pg_backup_task_updater.h +++ b/src/share/backup/ob_pg_backup_task_updater.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace share { class ObPGBackupTaskUpdater { - public: +public: ObPGBackupTaskUpdater(); virtual ~ObPGBackupTaskUpdater() = default; int init(common::ObISQLClient& sql_proxy); @@ -55,7 +55,7 @@ class ObPGBackupTaskUpdater { ObPGBackupTaskInfo& pg_task_info); int update_status_and_result_and_statics(const common::ObIArray& pg_task_info_array); - private: +private: static const int64_t MAX_BATCH_COUNT = 1024; bool is_inited_; common::ObISQLClient* sql_proxy_; diff --git a/src/share/backup/ob_pg_validate_task_updater.h b/src/share/backup/ob_pg_validate_task_updater.h index 8b01a827e..e681687bf 100644 --- a/src/share/backup/ob_pg_validate_task_updater.h +++ b/src/share/backup/ob_pg_validate_task_updater.h @@ -25,7 +25,7 @@ class ObISQLClient; namespace share { class ObPGValidateTaskUpdater { - public: +public: ObPGValidateTaskUpdater(); virtual ~ObPGValidateTaskUpdater(); int init(common::ObISQLClient& sql_client, bool dropped_tenant = false); @@ -65,13 +65,13 @@ class ObPGValidateTaskUpdater { int batch_report_pg_task(const common::ObIArray& pg_task_infos); - private: +private: static const int64_t MAX_BATCH_SIZE = 1024; bool is_inited_; bool is_dropped_tenant_; common::ObISQLClient* sql_client_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPGValidateTaskUpdater); }; diff --git a/src/share/backup/ob_physical_restore_info.h b/src/share/backup/ob_physical_restore_info.h index e6408fb31..87b06dec7 100644 --- a/src/share/backup/ob_physical_restore_info.h +++ b/src/share/backup/ob_physical_restore_info.h @@ -45,7 +45,7 @@ enum PhysicalRestoreStatus { struct ObSimplePhysicalRestoreJob; struct ObPhysicalRestoreJob final { - public: +public: ObPhysicalRestoreJob(); ~ObPhysicalRestoreJob() {} @@ -73,7 +73,7 @@ struct ObPhysicalRestoreJob final { K_(schema_version), K_(frozen_data_version), K_(frozen_snapshot_version), K_(frozen_schema_version), K_(passwd_array), K_(source_cluster_version), K_(pre_cluster_version), K_(post_cluster_version), K_(compatible)); - public: +public: /* from rs */ int64_t job_id_; uint64_t tenant_id_; @@ -117,7 +117,7 @@ struct ObPhysicalRestoreJob final { /* physical restore related end */ struct ObSimplePhysicalRestoreJob final { - public: +public: ObPhysicalRestoreInfo restore_info_; int64_t snapshot_version_; int64_t schema_version_; @@ -133,7 +133,7 @@ struct ObSimplePhysicalRestoreJob final { }; struct ObRestoreProgressInfo { - public: +public: ObRestoreProgressInfo() { reset(); @@ -143,7 +143,7 @@ struct ObRestoreProgressInfo { void reset(); TO_STRING_KV(K_(total_pg_cnt), K_(finish_pg_cnt), K_(total_partition_cnt), K_(finish_partition_cnt)); - public: +public: int64_t total_pg_cnt_; // standalone pg cnt int64_t finish_pg_cnt_; int64_t total_partition_cnt_; // partition cnt (sql view) diff --git a/src/share/backup/ob_physical_restore_table_operator.h b/src/share/backup/ob_physical_restore_table_operator.h index fb106a642..f761a1908 100644 --- a/src/share/backup/ob_physical_restore_table_operator.h +++ b/src/share/backup/ob_physical_restore_table_operator.h @@ -28,7 +28,7 @@ class ObMySQLResult; } // namespace common namespace share { class ObPhysicalRestoreTableOperator { - public: +public: ObPhysicalRestoreTableOperator(); virtual ~ObPhysicalRestoreTableOperator() = default; int init(common::ObISQLClient* sql_client); @@ -56,12 +56,12 @@ class ObPhysicalRestoreTableOperator { int get_restore_progress_statistic( const share::ObPhysicalRestoreJob& job_info, share::ObRestoreProgressInfo& statistic); - public: +public: static const char* get_physical_restore_mod_str(PhysicalRestoreMod mod); static const char* get_restore_status_str(PhysicalRestoreStatus status); static PhysicalRestoreStatus get_restore_status(const common::ObString& status_str); - private: +private: int fill_dml_splicer(share::ObDMLSqlSplicer& dml, const ObPhysicalRestoreJob& job_info); static int retrieve_restore_option(common::sqlclient::ObMySQLResult& result, ObPhysicalRestoreJob& job); static int retrieve_int_value(common::sqlclient::ObMySQLResult& result, int64_t& value); @@ -71,7 +71,7 @@ class ObPhysicalRestoreTableOperator { int remove_job(int64_t job_id); int record_job_in_history(int64_t job_id); - private: +private: bool inited_; common::ObISQLClient* sql_client_; DISALLOW_COPY_AND_ASSIGN(ObPhysicalRestoreTableOperator); diff --git a/src/share/backup/ob_tenant_backup_clean_info_updater.h b/src/share/backup/ob_tenant_backup_clean_info_updater.h index d1d5f9c83..9e52409a1 100644 --- a/src/share/backup/ob_tenant_backup_clean_info_updater.h +++ b/src/share/backup/ob_tenant_backup_clean_info_updater.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace share { class ObTenantBackupCleanInfoUpdater { - public: +public: ObTenantBackupCleanInfoUpdater(); virtual ~ObTenantBackupCleanInfoUpdater() = default; int init(common::ObISQLClient& sql_proxy); @@ -34,25 +34,25 @@ class ObTenantBackupCleanInfoUpdater { const uint64_t tenant_id, common::ObISQLClient& trans, ObBackupCleanInfoStatus::STATUS& status); int get_deleted_tenant_clean_infos(common::ObIArray& deleted_tenant_clean_infos); - private: +private: int check_can_update_backup_clean_info( const ObBackupCleanInfoStatus::STATUS& src_status, const ObBackupCleanInfoStatus::STATUS& dest_status); - private: +private: bool is_inited_; common::ObISQLClient* sql_proxy_; DISALLOW_COPY_AND_ASSIGN(ObTenantBackupCleanInfoUpdater); }; class ObBackupCleanInfoHistoryUpdater { - public: +public: ObBackupCleanInfoHistoryUpdater(); virtual ~ObBackupCleanInfoHistoryUpdater() = default; int init(common::ObISQLClient& sql_proxy); int insert_backup_clean_info(const ObBackupCleanInfo& clean_info); int remove_backup_clean_info(const uint64_t tenant_id); - private: +private: bool is_inited_; common::ObISQLClient* sql_proxy_; DISALLOW_COPY_AND_ASSIGN(ObBackupCleanInfoHistoryUpdater); diff --git a/src/share/backup/ob_tenant_backup_task_updater.h b/src/share/backup/ob_tenant_backup_task_updater.h index 9aa6855eb..0f268317d 100644 --- a/src/share/backup/ob_tenant_backup_task_updater.h +++ b/src/share/backup/ob_tenant_backup_task_updater.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace share { class ObTenantBackupTaskUpdater { - public: +public: ObTenantBackupTaskUpdater(); virtual ~ObTenantBackupTaskUpdater() = default; int init(common::ObISQLClient& sql_proxy); @@ -37,18 +37,18 @@ class ObTenantBackupTaskUpdater { int remove_task(const uint64_t tenant_id, const int64_t incarnation, const int64_t backup_set_id); int insert_tenant_backup_task(const ObTenantBackupTaskInfo& tenant_backup_task); - private: +private: int check_can_update_backup_task( const ObTenantBackupTaskInfo::BackupStatus& src_status, const ObTenantBackupTaskInfo::BackupStatus& dest_status); - private: +private: bool is_inited_; common::ObISQLClient* sql_proxy_; DISALLOW_COPY_AND_ASSIGN(ObTenantBackupTaskUpdater); }; class ObBackupTaskHistoryUpdater { - public: +public: ObBackupTaskHistoryUpdater(); virtual ~ObBackupTaskHistoryUpdater() = default; int init(common::ObISQLClient& sql_proxy); @@ -74,7 +74,7 @@ class ObBackupTaskHistoryUpdater { int get_tenant_max_succeed_backup_task(const uint64_t tenant_id, ObTenantBackupTaskInfo& tenant_backup_task); int get_all_tenant_backup_tasks(common::ObIArray& tenant_backup_tasks); - private: +private: bool is_inited_; common::ObISQLClient* sql_proxy_; DISALLOW_COPY_AND_ASSIGN(ObBackupTaskHistoryUpdater); diff --git a/src/share/backup/ob_tenant_name_mgr.h b/src/share/backup/ob_tenant_name_mgr.h index 7b8b14d57..e4c92a01b 100644 --- a/src/share/backup/ob_tenant_name_mgr.h +++ b/src/share/backup/ob_tenant_name_mgr.h @@ -33,13 +33,13 @@ class ObMultiVersionSchemaService; // only manager tenant name and id mapping class ObTenantNameSimpleMgr final { - public: +public: const int64_t TENANT_NAME_SIMPLE_MGR_VERSION = 1; struct ObTenantIdItem final { static const uint8_t VERSION = 1; OB_UNIS_VERSION(VERSION); - public: + public: ObTenantIdItem(); uint64_t tenant_id_; int64_t timestamp_; @@ -54,7 +54,7 @@ class ObTenantNameSimpleMgr final { static const uint8_t VERSION = 1; OB_UNIS_VERSION(VERSION); - public: + public: static const int64_t DEFAULT_TENANT_ID_ITEM_COUNT = 1; // most tenant won't use rename ObTenantNameInfo(); ~ObTenantNameInfo(); @@ -71,7 +71,7 @@ class ObTenantNameSimpleMgr final { static const uint8_t VERSION = 1; OB_UNIS_VERSION(VERSION); - public: + public: ObTenantNameMeta(); void reset(); int64_t schema_version_; // 0 for not ready @@ -100,12 +100,12 @@ class ObTenantNameSimpleMgr final { int get_infos(ObTenantNameMeta& meta, common::ObIArray& infos) const; int get_tenant_ids(hash::ObHashSet& tenant_id_set); - private: +private: int get_info_(const common::ObString& tenant_name, ObTenantNameInfo*& info); int write_buf_(char* buf, const int64_t buf_size, int64_t& pos) const; int alloc_tenant_name_info_(const common::ObString& tenant_name, ObTenantNameInfo*& info); - private: +private: bool is_inited_; ObTenantNameMeta meta_; TenantNameHashMap tenant_name_infos_; @@ -115,7 +115,7 @@ class ObTenantNameSimpleMgr final { // deal with schema class ObTenantNameMgr final { - public: +public: ObTenantNameMgr(); ~ObTenantNameMgr(); @@ -125,13 +125,13 @@ class ObTenantNameMgr final { int do_update(const bool is_force); int get_tenant_ids(common::ObIArray& tenant_ids, int64_t& last_update_ts); - private: +private: int update_backup_simple_mgr_(const int64_t schema_version); int add_new_tenant_name_(const int64_t schema_version, ObTenantNameSimpleMgr& new_mgr); ObTenantNameSimpleMgr* get_next_mgr_(); int get_backup_tenant_ids_from_schema_(share::schema::ObSchemaGetterGuard& schema_guard); - private: +private: bool is_inited_; oceanbase::common::ObMySQLProxy* sql_proxy_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/share/backup/ob_tenant_validate_task_updater.h b/src/share/backup/ob_tenant_validate_task_updater.h index bda2d6f9c..e9e752e20 100644 --- a/src/share/backup/ob_tenant_validate_task_updater.h +++ b/src/share/backup/ob_tenant_validate_task_updater.h @@ -24,7 +24,7 @@ class ObISQLClient; namespace share { class ObTenantValidateTaskUpdater { - public: +public: ObTenantValidateTaskUpdater(); virtual ~ObTenantValidateTaskUpdater() = default; @@ -48,17 +48,17 @@ class ObTenantValidateTaskUpdater { int update_task(const ObTenantValidateTaskInfo& src_task_info, const ObTenantValidateTaskInfo& dst_task_info); int remove_task(const int64_t job_id, const uint64_t task_tenant_id, const int64_t incarnation); - private: +private: bool is_inited_; bool is_dropped_tenant_; common::ObISQLClient* sql_proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantValidateTaskUpdater); }; class ObTenantValidateHistoryUpdater { - public: +public: ObTenantValidateHistoryUpdater(); virtual ~ObTenantValidateHistoryUpdater() = default; @@ -71,11 +71,11 @@ class ObTenantValidateHistoryUpdater { int remove_task( const int64_t job_id, const uint64_t tenant_id, const int64_t incarnation, const int64_t backup_set_id); - private: +private: bool is_inited_; common::ObISQLClient* sql_proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantValidateHistoryUpdater); }; diff --git a/src/share/backup/ob_validate_operator.h b/src/share/backup/ob_validate_operator.h index a07fc7d00..a0a9cf76d 100644 --- a/src/share/backup/ob_validate_operator.h +++ b/src/share/backup/ob_validate_operator.h @@ -31,19 +31,19 @@ class ObMySQLResult; namespace share { class ObIBackupValidateOperator { - public: +public: ObIBackupValidateOperator() = default; virtual ~ObIBackupValidateOperator() = default; static int fill_one_item(const ObBackupValidateTaskItem& item, share::ObDMLSqlSplicer& splicer); static int get_backup_validate_task(const common::ObSqlString& sql, common::ObISQLClient& sql_proxy, common::ObIArray& items); - private: +private: static int extract_validate_task(common::sqlclient::ObMySQLResult* result, ObBackupValidateTaskItem& item); }; class ObBackupValidateOperator { - public: +public: ObBackupValidateOperator() = default; virtual ~ObBackupValidateOperator() = default; static int insert_task(const ObBackupValidateTaskItem& item, common::ObISQLClient& sql_client); @@ -60,7 +60,7 @@ class ObBackupValidateOperator { }; class ObBackupValidateHistoryOperator { - public: +public: ObBackupValidateHistoryOperator() = default; virtual ~ObBackupValidateHistoryOperator() = default; static int insert_task(const ObBackupValidateTaskItem& item, common::ObISQLClient& sql_client); @@ -72,19 +72,19 @@ class ObBackupValidateHistoryOperator { }; class ObITenantValidateTaskOperator { - public: +public: ObITenantValidateTaskOperator() = default; virtual ~ObITenantValidateTaskOperator() = default; static int fill_one_item(const ObTenantValidateTaskItem& item, share::ObDMLSqlSplicer& splicer); static int get_tenant_validate_task(const uint64_t tenant_id, const common::ObSqlString& sql, common::ObISQLClient& sql_proxy, common::ObIArray& items); - private: +private: static int extract_tenant_task(common::sqlclient::ObMySQLResult* result, ObTenantValidateTaskItem& item); }; class ObTenantValidateTaskOperator { - public: +public: ObTenantValidateTaskOperator() = default; virtual ~ObTenantValidateTaskOperator() = default; static int insert_task( @@ -109,7 +109,7 @@ class ObTenantValidateTaskOperator { }; class ObTenantValidateHistoryOperator { - public: +public: ObTenantValidateHistoryOperator() = default; virtual ~ObTenantValidateHistoryOperator() = default; static int insert_task(const ObTenantValidateTaskItem& item, common::ObISQLClient& sql_client); @@ -122,7 +122,7 @@ class ObTenantValidateHistoryOperator { }; class ObPGValidateTaskOperator { - public: +public: ObPGValidateTaskOperator() = default; virtual ~ObPGValidateTaskOperator() = default; @@ -160,7 +160,7 @@ class ObPGValidateTaskOperator { common::ObISQLClient& sql_client, const common::ObPartitionKey& pkey, const ObPGValidateTaskInfo::ValidateStatus& status, const int32_t result); - private: +private: static int fill_one_item(const ObPGValidateTaskItem& item, share::ObDMLSqlSplicer& splicer); static int get_pg_validate_task(const uint64_t tenant_id, const common::ObSqlString& sql, common::ObISQLClient& sql_proxy, common::ObIArray& items); diff --git a/src/share/backup/ob_validate_scheduler.h b/src/share/backup/ob_validate_scheduler.h index c0347c884..f8eaa53f5 100644 --- a/src/share/backup/ob_validate_scheduler.h +++ b/src/share/backup/ob_validate_scheduler.h @@ -33,19 +33,19 @@ namespace share { class ObValidateInfoManager; class ObValidateScheduler { - public: +public: ObValidateScheduler(); virtual ~ObValidateScheduler(); int init(const uint64_t tenant_id, const int64_t backup_set_id_, common::ObMySQLProxy& sql_proxy, rootserver::ObRootValidate& root_validate); int start_schedule_validate(); - private: +private: int get_log_archive_time_range(const uint64_t tenant_id, int64_t& start_ts, int64_t& checkpoint_ts); int check_backup_set_id_valid(const uint64_t tenant_id, const int64_t backup_set_id); int start_validate(); - private: +private: bool is_inited_; share::ObBackupValidateTaskInfo task_info_; common::ObMySQLProxy* sql_proxy_; @@ -55,7 +55,7 @@ class ObValidateScheduler { share::ObLogArchiveBackupInfoMgr log_archive_mgr_; share::ObBackupTaskHistoryUpdater backup_history_updater_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObValidateScheduler); }; diff --git a/src/share/backup/ob_validate_task_updater.h b/src/share/backup/ob_validate_task_updater.h index eeceb8514..69614ec70 100644 --- a/src/share/backup/ob_validate_task_updater.h +++ b/src/share/backup/ob_validate_task_updater.h @@ -24,7 +24,7 @@ class ObISQLClient; namespace share { class ObBackupValidateTaskUpdater { - public: +public: ObBackupValidateTaskUpdater(); virtual ~ObBackupValidateTaskUpdater(); @@ -40,16 +40,16 @@ class ObBackupValidateTaskUpdater { int update_task(const ObBackupValidateTaskInfo& src_task_info, const ObBackupValidateTaskInfo& dst_task_info); int remove_task(const int64_t job_id); - private: +private: bool is_inited_; common::ObISQLClient* sql_proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupValidateTaskUpdater); }; class ObBackupValidateHistoryUpdater { - public: +public: ObBackupValidateHistoryUpdater(); virtual ~ObBackupValidateHistoryUpdater(); @@ -61,11 +61,11 @@ class ObBackupValidateHistoryUpdater { const int64_t job_id, const uint64_t tenant_id, common::ObIArray& validate_tasks); int remove_task(const int64_t job_id); - private: +private: bool is_inited_; common::ObISQLClient* sql_proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupValidateHistoryUpdater); }; diff --git a/src/share/cache/ob_cache_utils.h b/src/share/cache/ob_cache_utils.h index 68671fe42..05b8b1317 100644 --- a/src/share/cache/ob_cache_utils.h +++ b/src/share/cache/ob_cache_utils.h @@ -38,7 +38,7 @@ class ObFixedHashMap; template > class ObFixedHashMapIterator { - public: +public: typedef ObFixedHashMap HashMap; typedef ObFixedHashMapIterator Iterator; @@ -98,7 +98,7 @@ class ObFixedHashMapIterator { return iter; } - private: +private: const HashMap* hash_map_; int64_t bucket_pos_; MapNode* node_; @@ -106,7 +106,7 @@ class ObFixedHashMapIterator { template class ObFixedHashMap { - public: +public: typedef MapNode Node; typedef ObFixedHashMapIterator iterator; friend class ObFixedHashMapIterator; @@ -124,7 +124,7 @@ class ObFixedHashMap { iterator begin(); iterator end(); - private: +private: void push_free_node(Node* node); Node* pop_free_node(); @@ -362,7 +362,7 @@ typename ObFixedHashMap::Node* ObFixedHashMap class ObFreeHeap { - public: +public: ObFreeHeap(); virtual ~ObFreeHeap(); int init(const int64_t count, const char* label); @@ -372,7 +372,7 @@ class ObFreeHeap { int sbrk(const int64_t count, T*& buf); void reuse(); - private: +private: bool inited_; common::ObArenaAllocator allocator_; T* buf_; @@ -476,7 +476,7 @@ void ObFreeHeap::reuse() template class ObSimpleFixedArray final : public common::ObFixedArrayImpl { - public: +public: ObSimpleFixedArray(); virtual ~ObSimpleFixedArray(); @@ -484,12 +484,12 @@ class ObSimpleFixedArray final : public common::ObFixedArrayImpl::data_; using ObIArray::count_; using ObFixedArrayImpl::init_cnt_; - private: +private: bool is_destructor_safe() const { // no need to call destructor diff --git a/src/share/cache/ob_kv_storecache.h b/src/share/cache/ob_kv_storecache.h index e21139ea5..4b1823bd9 100644 --- a/src/share/cache/ob_kv_storecache.h +++ b/src/share/cache/ob_kv_storecache.h @@ -34,7 +34,7 @@ class ObKVCacheIterator; template class ObIKVCache { - public: +public: virtual int put(const Key& key, const Value& value, bool overwrite = true) = 0; virtual int put_and_fetch( const Key& key, const Value& value, const Value*& pvalue, ObKVCacheHandle& handle, bool overwrite = true) = 0; @@ -48,29 +48,20 @@ class ObIKVCache { template class ObKVCache : public ObIKVCache { - public: +public: ObKVCache(); virtual ~ObKVCache(); int init(const char* cache_name, const int64_t priority = 1); void destroy(); int set_priority(const int64_t priority); - virtual int put(const Key &key, const Value &value, bool overwrite = true) override; - virtual int put_and_fetch( - const Key &key, - const Value &value, - const Value *&pvalue, - ObKVCacheHandle &handle, - bool overwrite = true) override; - virtual int get(const Key &key, const Value *&pvalue, ObKVCacheHandle &handle) override; - int get_iterator(ObKVCacheIterator &iter); - virtual int erase(const Key &key) override; - virtual int alloc( - const uint64_t tenant_id, - const int64_t key_size, - const int64_t value_size, - ObKVCachePair *&kvpair, - ObKVCacheHandle &handle, - ObKVCacheInstHandle &inst_handle) override; + virtual int put(const Key& key, const Value& value, bool overwrite = true) override; + virtual int put_and_fetch(const Key& key, const Value& value, const Value*& pvalue, ObKVCacheHandle& handle, + bool overwrite = true) override; + virtual int get(const Key& key, const Value*& pvalue, ObKVCacheHandle& handle) override; + int get_iterator(ObKVCacheIterator& iter); + virtual int erase(const Key& key) override; + virtual int alloc(const uint64_t tenant_id, const int64_t key_size, const int64_t value_size, ObKVCachePair*& kvpair, + ObKVCacheHandle& handle, ObKVCacheInstHandle& inst_handle) override; int64_t size(const uint64_t tenant_id = OB_SYS_TENANT_ID) const; int64_t count(const uint64_t tenant_id = OB_SYS_TENANT_ID) const; int64_t get_hit_cnt(const uint64_t tenant_id = OB_SYS_TENANT_ID) const; @@ -82,7 +73,7 @@ class ObKVCache : public ObIKVCache { return cache_id_; } - private: +private: bool inited_; int64_t cache_id_; }; @@ -90,7 +81,7 @@ class ObKVCache : public ObIKVCache { // working set is a special cache that limit memory used template class ObCacheWorkingSet : public ObIKVCache { - public: +public: ObCacheWorkingSet(); virtual ~ObCacheWorkingSet(); @@ -107,14 +98,13 @@ class ObCacheWorkingSet : public ObIKVCache { { return working_set_->get_used(); } - int64_t get_limit() const { return working_set_->get_limit(); } - virtual int alloc( - const uint64_t tenant_id, - const int64_t key_size, - const int64_t value_size, - ObKVCachePair *&kvpair, - ObKVCacheHandle &handle, - ObKVCacheInstHandle &inst_handle) override; + int64_t get_limit() const + { + return working_set_->get_limit(); + } + virtual int alloc(const uint64_t tenant_id, const int64_t key_size, const int64_t value_size, ObKVCachePair*& kvpair, + ObKVCacheHandle& handle, ObKVCacheInstHandle& inst_handle) override; + private: bool inited_; uint64_t tenant_id_; @@ -126,7 +116,7 @@ class ObKVCacheHandle; class ObKVGlobalCache : public lib::ObICacheWasher { friend class observer::ObServerMemoryCutter; - public: +public: static ObKVGlobalCache& get_instance(); int init(const int64_t bucket_num = DEFAULT_BUCKET_NUM, const int64_t max_cache_size = DEFAULT_MAX_CACHE_SIZE, const int64_t block_size = lib::ACHUNK_SIZE, const int64_t cache_wash_interval = 0); @@ -149,7 +139,7 @@ class ObKVGlobalCache : public lib::ObICacheWasher { virtual int sync_wash_mbs(const uint64_t tenant_id, const int64_t wash_size, const bool wash_single_mb, lib::ObICacheWasher::ObCacheMemBlock*& wash_blocks); - private: +private: template friend class ObIKVCache; template @@ -188,7 +178,7 @@ class ObKVGlobalCache : public lib::ObICacheWasher { void replace_map(); int get_cache_id(const char* cache_name, int64_t& cache_id); - private: +private: static const int64_t DEFAULT_BUCKET_NUM = 10000000L; static const int64_t DEFAULT_MAX_CACHE_SIZE = 1024L * 1024L * 1024L * 1024L; // 1T static const int64_t MAP_ONCE_CLEAN_NUM = 100000; @@ -200,9 +190,9 @@ class ObKVGlobalCache : public lib::ObICacheWasher { static const int64_t MAX_BUCKET_NUM_LEVEL = 6; static const int64_t bucket_num_array_[MAX_BUCKET_NUM_LEVEL]; - private: +private: class KVStoreWashTask : public ObTimerTask { - public: + public: KVStoreWashTask() {} virtual ~KVStoreWashTask() @@ -213,7 +203,7 @@ class ObKVGlobalCache : public lib::ObICacheWasher { } }; class KVMapReplaceTask : public ObTimerTask { - public: + public: KVMapReplaceTask() {} virtual ~KVMapReplaceTask() @@ -224,7 +214,7 @@ class ObKVGlobalCache : public lib::ObICacheWasher { } }; - private: +private: bool inited_; // map ObKVCacheMap map_; @@ -248,7 +238,7 @@ class ObKVGlobalCache : public lib::ObICacheWasher { }; class ObKVCacheHandle { - public: +public: ObKVCacheHandle(); virtual ~ObKVCacheHandle(); ObKVCacheHandle(const ObKVCacheHandle& other); @@ -260,7 +250,7 @@ class ObKVCacheHandle { } TO_STRING_KV(KP_(mb_handle)); - private: +private: template friend class ObIKVCache; template @@ -272,7 +262,7 @@ class ObKVCacheHandle { }; class ObKVCacheIterator { - public: +public: ObKVCacheIterator(); virtual ~ObKVCacheIterator(); int init(const int64_t cache_id, ObKVCacheMap* map); @@ -288,7 +278,7 @@ class ObKVCacheIterator { int get_next_kvpair(const Key*& key, const Value*& value, ObKVCacheHandle& handle); void reset(); - private: +private: int64_t cache_id_; ObKVCacheMap* map_; int64_t pos_; diff --git a/src/share/cache/ob_kvcache_inst_map.h b/src/share/cache/ob_kvcache_inst_map.h index a531bcef7..073286854 100644 --- a/src/share/cache/ob_kvcache_inst_map.h +++ b/src/share/cache/ob_kvcache_inst_map.h @@ -137,7 +137,7 @@ struct ObKVCacheInst { }; class ObKVCacheInstHandle { - public: +public: ObKVCacheInstHandle(); virtual ~ObKVCacheInstHandle(); void reset(); @@ -149,14 +149,14 @@ class ObKVCacheInstHandle { ObKVCacheInstHandle& operator=(const ObKVCacheInstHandle& other); VIRTUAL_TO_STRING_KV(K_(inst_->status)); - private: +private: friend class ObKVCacheInstMap; ObKVCacheInstMap* map_; ObKVCacheInst* inst_; }; class ObKVCacheInstMap { - public: +public: ObKVCacheInstMap(); virtual ~ObKVCacheInstMap(); int init(const int64_t max_entry_cnt, const ObKVCacheConfig* configs, const ObITenantMgr& tenant_mgr); @@ -174,7 +174,7 @@ class ObKVCacheInstMap { int get_mb_list(const uint64_t tenant_id, ObTenantMBListHandle& list_handle); int dec_mb_list_ref(ObTenantMBList* list); - private: +private: friend class ObKVCacheInstHandle; typedef hash::ObHashMap KVCacheInstMap; typedef ObFixedHashMap TenantMBListMap; diff --git a/src/share/cache/ob_kvcache_map.h b/src/share/cache/ob_kvcache_map.h index 9cacfee8f..50242071b 100644 --- a/src/share/cache/ob_kvcache_map.h +++ b/src/share/cache/ob_kvcache_map.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace common { class ObKVCacheIterator; class ObKVCacheMap { - public: +public: ObKVCacheMap(); virtual ~ObKVCacheMap(); int init(const int64_t bucket_num, ObKVCacheStore* store); @@ -39,7 +39,7 @@ class ObKVCacheMap { ObKVMemBlockHandle*& out_handle); int erase(ObKVCacheInst& inst, const ObIKVCacheKey& key); - private: +private: friend class ObKVCacheIterator; struct Node { ObKVCacheInst* inst_; @@ -59,7 +59,7 @@ class ObKVCacheMap { Node* nodes_[BUCKET_SIZE]; }; - private: +private: int multi_get(const int64_t cache_id, const int64_t pos, common::ObList& list); void internal_map_erase(Node*& prev, Node*& iter, const uint64_t bucket_pos); void internal_map_replace(Node*& prev, Node*& iter, const uint64_t bucket_pos); @@ -78,7 +78,7 @@ class ObKVCacheMap { } Node*& get_bucket_node(const int64_t idx); - private: +private: bool is_inited_; ObMalloc bucket_allocator_; int64_t bucket_num_; diff --git a/src/share/cache/ob_kvcache_store.h b/src/share/cache/ob_kvcache_store.h index caf9cb42e..53f8d1cbb 100644 --- a/src/share/cache/ob_kvcache_store.h +++ b/src/share/cache/ob_kvcache_store.h @@ -26,13 +26,13 @@ class ObServerMemoryCutter; namespace common { template class ObIKVCacheStore { - public: +public: int store(ObKVCacheInst& inst, const ObIKVCacheKey& key, const ObIKVCacheValue& value, ObKVCachePair*& kvpair, MBWrapper*& mb_wrapper, const enum ObKVCachePolicy policy = LRU); int alloc_kvpair(ObKVCacheInst& inst, const int64_t key_size, const int64_t value_size, ObKVCachePair*& kvpair, MBWrapper*& mb_wrapper, const enum ObKVCachePolicy policy = LRU); - protected: +protected: virtual bool add_handle_ref(MBWrapper* mb_wrapper) = 0; virtual void de_handle_ref(MBWrapper* mb_wrapper) = 0; virtual int alloc( @@ -46,7 +46,7 @@ class ObIKVCacheStore { class ObKVCacheStore : public ObIKVCacheStore, public ObIMBHandleAllocator { friend class observer::ObServerMemoryCutter; - public: +public: ObKVCacheStore(); virtual ~ObKVCacheStore(); int init( @@ -80,7 +80,7 @@ class ObKVCacheStore : public ObIKVCacheStore, public ObIMBH virtual ObKVMemBlockHandle*& get_curr_mb(ObKVCacheInst& inst, const enum ObKVCachePolicy policy); virtual bool mb_status_match(ObKVCacheInst& inst, const enum ObKVCachePolicy policy, ObKVMemBlockHandle* mb_handle); - private: +private: static const int64_t SYNC_WASH_MB_TIMEOUT_US = 100 * 1000; // 100ms static const int64_t RETIRE_LIMIT = 16; static const int64_t WASH_THREAD_RETIRE_LIMIT = 2048; @@ -89,7 +89,7 @@ class ObKVCacheStore : public ObIKVCacheStore, public ObIMBH bool operator()(const ObKVMemBlockHandle* a, const ObKVMemBlockHandle* b) const; }; struct WashHeap { - public: + public: WashHeap(); virtual ~WashHeap(); ObKVMemBlockHandle* add(ObKVMemBlockHandle* mb_handle); @@ -99,7 +99,7 @@ class ObKVCacheStore : public ObIKVCacheStore, public ObIMBH int64_t mb_cnt_; }; struct TenantWashInfo { - public: + public: TenantWashInfo(); int add(ObKVMemBlockHandle* mb_handle); // put wash memblocks in cache_wash_heaps_ to wash_heap_ @@ -115,7 +115,7 @@ class ObKVCacheStore : public ObIKVCacheStore, public ObIMBH }; typedef ObFixedHashMap WashMap; - private: +private: ObKVMemBlockHandle* alloc_mbhandle(ObKVCacheInst& inst, const enum ObKVCachePolicy policy, const int64_t block_size); int alloc_mbhandle( ObKVCacheInst& inst, const enum ObKVCachePolicy policy, const int64_t block_size, ObKVMemBlockHandle*& mb_handle); @@ -150,7 +150,7 @@ class ObKVCacheStore : public ObIKVCacheStore, public ObIMBH void reuse_mb_handles(HazardList& reclaim_list); bool try_supply_mb(const int64_t mb_count); - private: +private: bool inited_; ObKVCacheInstMap* insts_; // data structures for store diff --git a/src/share/cache/ob_kvcache_struct.h b/src/share/cache/ob_kvcache_struct.h index ae09b8373..e86f4bb01 100644 --- a/src/share/cache/ob_kvcache_struct.h +++ b/src/share/cache/ob_kvcache_struct.h @@ -32,7 +32,7 @@ static const int32_t MAX_CACHE_NAME_LENGTH = 127; static const double CACHE_SCORE_DECAY_FACTOR = 0.9; class ObIKVCacheKey { - public: +public: ObIKVCacheKey() {} virtual ~ObIKVCacheKey() @@ -45,7 +45,7 @@ class ObIKVCacheKey { }; class ObIKVCacheValue { - public: +public: ObIKVCacheValue() {} virtual ~ObIKVCacheValue() @@ -67,7 +67,7 @@ struct ObKVCachePair { enum ObKVCachePolicy { LRU = 0, LFU = 1, MAX_POLICY = 2 }; class ObKVStoreMemBlock { - public: +public: ObKVStoreMemBlock(char* buffer, const int64_t size); virtual ~ObKVStoreMemBlock(); void reuse(); @@ -93,7 +93,7 @@ class ObKVStoreMemBlock { return atomic_pos_.pairs; } - private: +private: static const int64_t ALIGN_SIZE = sizeof(size_t); AtomicInt64 atomic_pos_; int64_t payload_size_; @@ -179,7 +179,7 @@ struct ObKVCacheInstKey { }; struct ObKVCacheConfig { - public: +public: ObKVCacheConfig(); void reset(); bool is_valid_; @@ -188,7 +188,7 @@ struct ObKVCacheConfig { }; struct ObKVCacheStatus { - public: +public: ObKVCacheStatus(); void refresh(const int64_t period_us); double get_hit_ratio() const; @@ -228,7 +228,7 @@ struct ObKVCacheInfo { }; class ObIMBHandleAllocator { - public: +public: virtual int alloc_mbhandle(ObKVCacheInst& inst, const int64_t block_size, ObKVMemBlockHandle*& mb_handle) = 0; virtual int alloc_mbhandle(ObKVCacheInst& inst, ObKVMemBlockHandle*& mb_handle) = 0; virtual int alloc_mbhandle(const ObKVCacheInstKey& inst_key, ObKVMemBlockHandle*& mb_handle) = 0; diff --git a/src/share/cache/ob_working_set_mgr.h b/src/share/cache/ob_working_set_mgr.h index 0a5e466ae..147379635 100644 --- a/src/share/cache/ob_working_set_mgr.h +++ b/src/share/cache/ob_working_set_mgr.h @@ -74,10 +74,10 @@ struct WorkingSetMB { }; class ObWorkingSet : public ObDLinkBase, public ObIKVCacheStore { - private: +private: friend class ObWorkingSetMgr; - public: +public: ObWorkingSet(); virtual ~ObWorkingSet(); @@ -124,7 +124,7 @@ class ObWorkingSet : public ObDLinkBase, public ObIKVCacheStore, public ObIKVCacheStore& ws_mb_pool, HazardList& retire_list); static void reuse_ws_mbs(ObFixedQueue& ws_mb_pool, HazardList& reclaim_list); - private: +private: bool inited_; WSListKey ws_list_key_; int64_t used_; @@ -160,7 +160,7 @@ class ObWorkingSet : public ObDLinkBase, public ObIKVCacheStore WSListMap; - private: +private: int get_ws_list(const WSListKey& key, const bool create_not_exist, WorkingSetList*& list); int create_ws_list(const WSListKey& key, WorkingSetList*& list); int alloc_mb(WorkingSetList* list, ObKVMemBlockHandle*& mb_handle); int free_mb(WorkingSetList* list, ObKVMemBlockHandle* mb_handle); - private: +private: bool inited_; DRWLock lock_; WSListMap ws_list_map_; diff --git a/src/share/client_feedback/ob_client_feedback_basic.h b/src/share/client_feedback/ob_client_feedback_basic.h index 26af50e96..7656fe525 100644 --- a/src/share/client_feedback/ob_client_feedback_basic.h +++ b/src/share/client_feedback/ob_client_feedback_basic.h @@ -176,7 +176,7 @@ extern const char* get_feedback_element_type_str(const ObFeedbackElementType typ extern bool is_valid_fb_element_type(const int64_t type); class ObSeriPosGuard { - public: +public: ObSeriPosGuard(int64_t& pos, int& ret) : pos_(pos), orig_pos_(pos), ret_(ret) {} @@ -187,7 +187,7 @@ class ObSeriPosGuard { } } - private: +private: int64_t& pos_; int64_t orig_pos_; int& ret_; @@ -200,7 +200,7 @@ class ObSeriPosGuard { template class ObAbstractFeedbackObject { - public: +public: ObAbstractFeedbackObject(const ObFeedbackElementType type) : type_(type) {} virtual ~ObAbstractFeedbackObject() @@ -237,7 +237,7 @@ class ObAbstractFeedbackObject { TO_STRING_KV("type", get_feedback_element_type_str(type_)); - protected: +protected: // when MIN_FB_ELE == type_ means this class just a common obj without ObFeedbackElementType // , so no need seri or deseri type_, just like ObFeedbackReplicaLocation. ObFeedbackElementType type_; diff --git a/src/share/client_feedback/ob_client_feedback_manager.h b/src/share/client_feedback/ob_client_feedback_manager.h index e3d6aa212..1426d988f 100644 --- a/src/share/client_feedback/ob_client_feedback_manager.h +++ b/src/share/client_feedback/ob_client_feedback_manager.h @@ -31,7 +31,7 @@ struct ObReplicaLocation; } while (0) struct ObFBPartitionParam { - public: +public: int64_t schema_version_; ObPartitionLocation pl_; int64_t original_partition_id_; @@ -59,7 +59,7 @@ struct ObFBPartitionParam { // C/S feedback protocol class ObFeedbackManager { - public: +public: ObFeedbackManager() : follower_first_feedback_(NULL), pl_feedback_(NULL), arena_(common::ObModIds::SHARE_CS_FEEDBACKS) {} virtual ~ObFeedbackManager() @@ -143,7 +143,7 @@ class ObFeedbackManager { return ret; } - private: +private: ObFollowerFirstFeedback* follower_first_feedback_; ObFeedbackPartitionLocation* pl_feedback_; common::ObArenaAllocator arena_; // use to alloc feedback element diff --git a/src/share/client_feedback/ob_feedback_int_struct.h b/src/share/client_feedback/ob_feedback_int_struct.h index 34890e06c..c6443e93c 100644 --- a/src/share/client_feedback/ob_feedback_int_struct.h +++ b/src/share/client_feedback/ob_feedback_int_struct.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace share { class ObFeedbackIntStruct : public ObAbstractFeedbackObject { - public: +public: ObFeedbackIntStruct(ObFeedbackElementType type) : ObAbstractFeedbackObject(type), int_value_(0) {} virtual ~ObFeedbackIntStruct() @@ -53,7 +53,7 @@ class ObFeedbackIntStruct : public ObAbstractFeedbackObject TO_STRING_KV("type", get_feedback_element_type_str(type_), K_(int_value)); - protected: +protected: int64_t int_value_; }; @@ -64,7 +64,7 @@ inline bool ObFeedbackIntStruct::is_valid_obj() const #define INT_FB_STRUCT(name, type) \ class name : public ObFeedbackIntStruct { \ - public: \ + public: \ name() : ObFeedbackIntStruct(type) \ {} \ virtual ~name() \ diff --git a/src/share/client_feedback/ob_feedback_partition_struct.h b/src/share/client_feedback/ob_feedback_partition_struct.h index b59ea6f62..d966a7bcf 100644 --- a/src/share/client_feedback/ob_feedback_partition_struct.h +++ b/src/share/client_feedback/ob_feedback_partition_struct.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace share { class ObFeedbackReplicaLocation : public ObAbstractFeedbackObject { - public: +public: common::ObAddr server_; common::ObRole role_; // ip && sql_port common::ObReplicaType replica_type_; @@ -62,7 +62,7 @@ inline bool ObFeedbackReplicaLocation::is_valid_obj() const } class ObFeedbackPartitionLocation : public ObAbstractFeedbackObject { - public: +public: typedef common::ObSEArray ObFeedbackReplicaLocationArray; ObFeedbackPartitionLocation() : ObAbstractFeedbackObject(PARTITION_LOCATION_FB_ELE) @@ -158,7 +158,7 @@ class ObFeedbackPartitionLocation : public ObAbstractFeedbackObject { - public: +public: ObFeedbackRerouteInfo() : ObAbstractFeedbackObject(MIN_FB_ELE) { reset(); @@ -193,7 +193,7 @@ class ObFeedbackRerouteInfo : public ObAbstractFeedbackObject class __ObConfigContainer : public hash::ObHashMap { - public: +public: __ObConfigContainer() { this->create(num, @@ -455,31 +455,31 @@ class __ObConfigContainer : public hash::ObHashMap { virtual ~__ObConfigContainer() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(__ObConfigContainer); }; class ObConfigIntParser { - public: +public: ObConfigIntParser() {} virtual ~ObConfigIntParser() {} static int64_t get(const char* str, bool& valid); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObConfigIntParser); }; class ObConfigCapacityParser { - public: +public: ObConfigCapacityParser() {} virtual ~ObConfigCapacityParser() {} static int64_t get(const char* str, bool& valid); - private: +private: enum CAP_UNIT { // shift bits between unit of byte and that CAP_B = 0, @@ -493,14 +493,14 @@ class ObConfigCapacityParser { }; class ObConfigReadableIntParser { - public: +public: ObConfigReadableIntParser() {} virtual ~ObConfigReadableIntParser() {} static int64_t get(const char* str, bool& valid); - private: +private: enum INT_UNIT { UNIT_K = 1000, UNIT_M = 1000000, @@ -509,14 +509,14 @@ class ObConfigReadableIntParser { }; class ObConfigTimeParser { - public: +public: ObConfigTimeParser() {} ~ObConfigTimeParser() {} static int64_t get(const char* str, bool& valid); - private: +private: enum TIME_UNIT { TIME_MICROSECOND = 1UL, TIME_MILLISECOND = 1000UL, diff --git a/src/share/config/ob_config_manager.h b/src/share/config/ob_config_manager.h index 43b48ff55..f24fb604d 100644 --- a/src/share/config/ob_config_manager.h +++ b/src/share/config/ob_config_manager.h @@ -25,7 +25,7 @@ class ObMySQLProxy; class ObConfigManager { friend class UpdateTask; - public: +public: static const int64_t DEFAULT_VERSION = 1; ObConfigManager(ObServerConfig& server_config, ObReloadConfig& reload_config); @@ -59,9 +59,9 @@ class ObConfigManager { int update_local(int64_t expected_version); virtual int got_version(int64_t version, const bool remove_repeat = false); - private: +private: class UpdateTask : public ObTimerTask { - public: + public: UpdateTask() : config_mgr_(NULL), update_local_(false), version_(0), scheduled_time_(0) {} virtual ~UpdateTask() @@ -73,7 +73,7 @@ class ObConfigManager { volatile int64_t version_; volatile int64_t scheduled_time_; - private: + private: DISALLOW_COPY_AND_ASSIGN(UpdateTask); }; diff --git a/src/share/config/ob_reload_config.h b/src/share/config/ob_reload_config.h index 2a7d840e1..994f891f2 100644 --- a/src/share/config/ob_reload_config.h +++ b/src/share/config/ob_reload_config.h @@ -20,16 +20,16 @@ namespace oceanbase { namespace common { class ObReloadConfig { - public: +public: explicit ObReloadConfig(ObServerConfig* conf) : conf_(conf){}; virtual ~ObReloadConfig() {} virtual int operator()(); - protected: +protected: ObServerConfig* conf_; - private: +private: int reload_ob_logger_set(); DISALLOW_COPY_AND_ASSIGN(ObReloadConfig); }; diff --git a/src/share/config/ob_server_config.h b/src/share/config/ob_server_config.h index 5baab1dc2..24beb1196 100644 --- a/src/share/config/ob_server_config.h +++ b/src/share/config/ob_server_config.h @@ -52,7 +52,7 @@ const char* const CLOG_DISK_USAGE_LIMIT_PERCENTAGE = "clog_disk_usage_limit_perc const char* const CLOG_DISK_UTILIZATION_THRESHOLD = "clog_disk_utilization_threshold"; class ObServerConfig : public ObCommonConfig { - public: +public: int init(const ObSystemConfig& config); static ObServerConfig& get_instance(); @@ -152,11 +152,11 @@ class ObServerConfig : public ObCommonConfig { int deserialize_with_compat(const char* buf, const int64_t data_len, int64_t& pos); OB_UNIS_VERSION(1); - public: +public: int64_t disk_actual_space_; ObAddr self_addr_; - public: +public: /////////////////////////////////////////////////////////////////////////////// // use MACRO 'OB_CLUSTER_PARAMETER' to define new cluster parameters // in ob_parameter_seed.ipp: @@ -166,14 +166,14 @@ class ObServerConfig : public ObCommonConfig { #include "share/parameter/ob_parameter_seed.ipp" #undef OB_CLUSTER_PARAMETER - protected: +protected: ObServerConfig(); virtual ~ObServerConfig(); const ObSystemConfig* system_config_; static const int16_t OB_CONFIG_MAGIC = static_cast(0XBCDE); static const int16_t OB_CONFIG_VERSION = 1; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObServerConfig); }; } // namespace common diff --git a/src/share/config/ob_system_config.h b/src/share/config/ob_system_config.h index ead32662c..9f534bfcf 100644 --- a/src/share/config/ob_system_config.h +++ b/src/share/config/ob_system_config.h @@ -24,11 +24,11 @@ namespace common { class ObConfigItem; class ObSystemConfig { - public: +public: static const int64_t INIT_VERSION = 2; typedef hash::ObHashMap hashmap; - public: +public: ObSystemConfig() : map_(), version_(0){}; virtual ~ObSystemConfig(){}; @@ -55,7 +55,7 @@ class ObSystemConfig { return version_; } - private: +private: static const int64_t MAP_SIZE = 512; int find_all_matched(const ObSystemConfigKey& key, ObArray& all_config) const; hashmap map_; diff --git a/src/share/config/ob_system_config_key.h b/src/share/config/ob_system_config_key.h index 1b9a3c39f..fb2bdd5cc 100644 --- a/src/share/config/ob_system_config_key.h +++ b/src/share/config/ob_system_config_key.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace common { class ObSystemConfigKey { - public: +public: ObSystemConfigKey(); virtual ~ObSystemConfigKey() {} @@ -51,7 +51,7 @@ class ObSystemConfigKey { int64_t get_version() const; int64_t to_string(char* buf, const int64_t len) const; - private: +private: static const char* DEFAULT_VALUE; ObZone zone_; int64_t server_port_; diff --git a/src/share/config/ob_system_config_value.h b/src/share/config/ob_system_config_value.h index a442f4ec1..614b49a45 100644 --- a/src/share/config/ob_system_config_value.h +++ b/src/share/config/ob_system_config_value.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObSystemConfigValue { - public: +public: ObSystemConfigValue(); virtual ~ObSystemConfigValue() {} @@ -60,7 +60,7 @@ class ObSystemConfigValue { return edit_level_; } - private: +private: char value_[OB_MAX_CONFIG_VALUE_LEN]; char info_[OB_MAX_CONFIG_INFO_LEN]; char section_[OB_MAX_CONFIG_SECTION_LEN]; diff --git a/src/share/datum/ob_datum_funcs.h b/src/share/datum/ob_datum_funcs.h index fd7592566..51aea1685 100644 --- a/src/share/datum/ob_datum_funcs.h +++ b/src/share/datum/ob_datum_funcs.h @@ -27,7 +27,7 @@ typedef int (*ObDatumCmpFuncType)(const ObDatum& datum1, const ObDatum& datum2); typedef uint64_t (*ObDatumHashFuncType)(const ObDatum& datum, const uint64_t seed); class ObDatumFuncs { - public: +public: static ObDatumCmpFuncType get_nullsafe_cmp_func(const ObObjType type1, const ObObjType type2, const ObCmpNullPos null_pos, const ObCollationType cs_type, const bool is_oracle_mode); static bool is_string_type(const ObObjType type); @@ -74,7 +74,7 @@ class ObDatumFuncs { return sizeof(EXPR_BASIC_STR_FUNCS) / static_cast(sizeof(void*)); } - private: +private: template friend class InitTypeCmpArray; template @@ -97,7 +97,7 @@ class ObDatumFuncs { struct ObCmpFunc { OB_UNIS_VERSION(1); - public: +public: ObCmpFunc() : cmp_func_(NULL) {} union { @@ -110,7 +110,7 @@ struct ObCmpFunc { struct ObHashFunc { OB_UNIS_VERSION(1); - public: +public: ObHashFunc() : hash_func_(NULL) {} union { diff --git a/src/share/diagnosis/ob_sql_monitor_statname.h b/src/share/diagnosis/ob_sql_monitor_statname.h index b79aaaafb..b6c734b5e 100644 --- a/src/share/diagnosis/ob_sql_monitor_statname.h +++ b/src/share/diagnosis/ob_sql_monitor_statname.h @@ -59,7 +59,7 @@ struct ObSqlMonitorStatIds { // static const int64_t MAX_MONITOR_STAT_DESC_LENGTH = 200; struct ObMonitorStat { - public: +public: const char* name_; const char* description_; }; diff --git a/src/share/diagnosis/ob_sql_plan_monitor_node_list.h b/src/share/diagnosis/ob_sql_plan_monitor_node_list.h index 00d5fe86c..ad632286c 100644 --- a/src/share/diagnosis/ob_sql_plan_monitor_node_list.h +++ b/src/share/diagnosis/ob_sql_plan_monitor_node_list.h @@ -28,7 +28,7 @@ namespace oceanbase { namespace sql { class TimingGuard { - public: +public: explicit TimingGuard(int64_t& v) : v_(v), begin_(common::ObTimeUtility::fast_current_time()) {} ~TimingGuard() @@ -36,7 +36,7 @@ class TimingGuard { v_ = v_ + common::ObTimeUtility::fast_current_time() - begin_; } - private: +private: int64_t& v_; int64_t begin_; }; @@ -44,7 +44,7 @@ class TimingGuard { class ObMonitorNode : public common::ObDLinkBase { friend class ObPlanMonitorNodeList; - public: +public: ObMonitorNode() : tenant_id_(0), op_id_(0), @@ -130,17 +130,17 @@ class ObMonitorNode : public common::ObDLinkBase { } TO_STRING_KV(K_(tenant_id), K_(op_id), "op_name", get_operator_name(), K_(thread_id)); - public: +public: int64_t tenant_id_; int64_t op_id_; int64_t plan_depth_; ObPhyOperatorType op_type_; - private: +private: int64_t thread_id_; uint64_t trace_id_[2]; - public: +public: // information each operator need to record. int64_t open_time_; int64_t first_row_time_; @@ -168,18 +168,18 @@ class ObMonitorNode : public common::ObDLinkBase { class ObPlanMonitorNodeList; class ObSqlPlanMonitorRecycleTask : public common::ObTimerTask { - public: +public: ObSqlPlanMonitorRecycleTask() : node_list_(nullptr){}; virtual ~ObSqlPlanMonitorRecycleTask() = default; void runTimerTask(); int init(ObPlanMonitorNodeList* node_list); - private: +private: ObPlanMonitorNodeList* node_list_; }; class ObPlanMonitorNodeList { - public: +public: static const int64_t MONITOR_NODE_PAGE_SIZE = (1LL << 21) - (1LL << 13); // 2M - 8k static const int64_t EVICT_INTERVAL = 1000000; // 1s static const int32_t BATCH_RELEASE_COUNT = 5000; @@ -189,7 +189,7 @@ class ObPlanMonitorNodeList { static const char* MOD_LABEL; typedef common::ObRaQueue::Ref Ref; - public: +public: ObPlanMonitorNodeList() = default; ~ObPlanMonitorNodeList(); static int mtl_init(ObPlanMonitorNodeList*& node_list); @@ -256,11 +256,11 @@ class ObPlanMonitorNodeList { ptr = NULL; } - private: +private: int init(uint64_t tenant_id, const int64_t max_mem_size, const int64_t queue_size); void destroy(); - private: +private: common::ObConcurrentFIFOAllocator allocator_; // alloc mem for string buf common::ObRaQueue queue_; ObSqlPlanMonitorRecycleTask task_; // release memory of sql plan monitor periodically. @@ -271,7 +271,7 @@ class ObPlanMonitorNodeList { uint64_t tenant_id_; int tg_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlanMonitorNodeList); }; diff --git a/src/share/inner_table/ob_inner_table_schema.h b/src/share/inner_table/ob_inner_table_schema.h index efe461a78..13967c1aa 100644 --- a/src/share/inner_table/ob_inner_table_schema.h +++ b/src/share/inner_table/ob_inner_table_schema.h @@ -264,7 +264,7 @@ struct ALL_VIRTUAL_TENANT_PARAMETER_STAT_ORA_CDE { class ObInnerTableSchema { - public: +public: static int all_core_table_schema(share::schema::ObTableSchema& table_schema); static int all_root_table_schema(share::schema::ObTableSchema& table_schema); static int all_table_schema(share::schema::ObTableSchema& table_schema); @@ -1275,7 +1275,7 @@ class ObInnerTableSchema { static int all_virtual_sql_plan_monitor_ora_all_virtual_sql_plan_monitor_i1_schema( share::schema::ObTableSchema& table_schema); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObInnerTableSchema); }; diff --git a/src/share/interrupt/ob_global_interrupt_call.h b/src/share/interrupt/ob_global_interrupt_call.h index 487675e1c..9c965e1aa 100644 --- a/src/share/interrupt/ob_global_interrupt_call.h +++ b/src/share/interrupt/ob_global_interrupt_call.h @@ -36,7 +36,7 @@ namespace common { struct ObInterruptibleTaskID { OB_UNIS_VERSION(1); - public: +public: ObInterruptibleTaskID() : first_(0), last_(0) {} @@ -98,7 +98,7 @@ class ObInterruptChecker { friend class ObGlobalInterruptManager; - public: +public: /// Only the interface is provided externally: /// is_interrupted(): Determine whether to receive interrupt information /// is_set_and_interrupted(): Determine whether the interrupt information is received, if the interrupt is not @@ -125,7 +125,7 @@ class ObInterruptChecker { void interrupt(ObInterruptCode& interrupt_code); - private: +private: /* * T_ARRAY_SIZE represents the maximum number of interrupts that an execution unit can receive during execution. * These interrupt information are stored in an array of fixed size T_ARRAY_SIZE. @@ -133,7 +133,7 @@ class ObInterruptChecker { static const uint64_t T_ARRAY_SIZE = 16; DISALLOW_COPY_AND_ASSIGN(ObInterruptChecker); - private: +private: bool interrupted_; ObInterruptCode interrupt_code_array_[T_ARRAY_SIZE]; int64_t array_pos_; @@ -164,7 +164,7 @@ struct ObInterruptCheckerNode { /// Atomic insertion callback, used when taskid is registered by multiple interrupt checkers class ObInterruptCheckerAddCall { - public: +public: void operator()(hash::HashMapPair& entry); ObInterruptCheckerAddCall(ObInterruptCheckerNode* checker_node) : checker_node_(checker_node), is_empty_(false){}; @@ -174,14 +174,14 @@ class ObInterruptCheckerAddCall { return is_empty_; } - private: +private: ObInterruptCheckerNode* checker_node_; bool is_empty_; }; /// Atomic removal callback, lock the bucket to avoid reading and inserting operations during removal class ObInterruptCheckerRemoveCall { - public: +public: void operator()(hash::HashMapPair& entry); ObInterruptCheckerRemoveCall(ObInterruptCheckerNode* checker_node) : checker_node_(checker_node), is_empty_(false){}; @@ -191,7 +191,7 @@ class ObInterruptCheckerRemoveCall { return is_empty_; } - private: +private: ObInterruptCheckerNode* checker_node_; bool is_empty_; }; @@ -199,18 +199,18 @@ class ObInterruptCheckerRemoveCall { /// Atomic write callback of map /// Modify the semaphore state in the checker by callback when acquiring the bucket read lock class ObInterruptCheckerUpdateCall { - public: +public: void operator()(hash::HashMapPair& entry); ObInterruptCheckerUpdateCall(ObInterruptCode& code) : code_(code){}; - private: +private: ObInterruptCode code_; }; // Get checker_node_ through map class ObInterruptGetCheckerNodeCall { - public: +public: void operator()(hash::HashMapPair& entry); ObInterruptGetCheckerNodeCall(ObInterruptChecker* checker) @@ -225,7 +225,7 @@ class ObInterruptGetCheckerNodeCall { return checker_node_; } - private: +private: ObInterruptChecker* checker_; ObInterruptCheckerNode* checker_node_; bool checker_exist_; @@ -235,12 +235,12 @@ class ObInterruptGetCheckerNodeCall { /// Exist in singleton mode to provide /// Interface for remote interrupt signal transmission class ObGlobalInterruptManager { - private: +private: /// Use 100W as the bucket initialization parameter of Map static const int64_t DEFAULT_HASH_MAP_BUCKETS_COUNT = 1000000; // 100w static const int64_t MINI_MODE_HASH_MAP_BUCKETS_COUNT = 10000; // 1w static const int64_t DEFAULT_NODE_NUM = 1000000; // 100w - public: +public: /// Hashmap with SpinLock, because the coroutine interrupt signal lock time is short, and there is almost no resource /// conflict, so SpinLock is used typedef hash::ObHashMap> MAP; - public: +public: static ObGlobalInterruptManager* getInstance(); /// The initialization method is used to obtain the host and rpc transmitter of the current machine, and initialize @@ -280,14 +280,14 @@ class ObGlobalInterruptManager { return map_; } - private: +private: ObGlobalInterruptManager() : rpc_proxy_(nullptr), map_(), is_inited_(false){}; ObGlobalInterruptManager(const ObGlobalInterruptManager&){}; - private: +private: static ObGlobalInterruptManager* instance_; - private: +private: ObAddr local_; ObInterruptRpcProxy* rpc_proxy_; MAP map_; diff --git a/src/share/interrupt/ob_interrupt_rpc_proxy.h b/src/share/interrupt/ob_interrupt_rpc_proxy.h index 99f297b7d..61c1343a8 100644 --- a/src/share/interrupt/ob_interrupt_rpc_proxy.h +++ b/src/share/interrupt/ob_interrupt_rpc_proxy.h @@ -24,10 +24,10 @@ namespace obrpc { struct ObInterruptStackInfo { static constexpr int64_t BUF1_SIZE = 128; - public: +public: OB_UNIS_VERSION(1); - public: +public: ObInterruptStackInfo() : pos1_(0) { buf1_[0] = '\0'; @@ -55,7 +55,7 @@ struct ObInterruptStackInfo { } TO_STRING_KV("msg", buf1_); - private: +private: char buf1_[BUF1_SIZE]; // Allow to piggyback text messages up to 128 letters long and end with 0 int64_t pos1_; // writable position of buf1_ // NOTE: @@ -72,10 +72,10 @@ namespace common { // In order to make the diagnosis of interrupts simpler and clearer, // Need to add the interrupt number, interrupt source, and auxiliary copy in the interrupt information struct ObInterruptCode { - public: +public: OB_UNIS_VERSION(1); - public: +public: ObInterruptCode() : code_(0), info_() {} ObInterruptCode(int code) : code_(code), info_() @@ -96,7 +96,7 @@ namespace obrpc { struct ObInterruptMessage { OB_UNIS_VERSION(1); - public: +public: ObInterruptMessage() : first_(0), last_(0), code_(0), info_(){}; ObInterruptMessage(uint64_t first, uint64_t last, int code) : first_(first), last_(last), code_(code), info_(){}; ObInterruptMessage(uint64_t first, uint64_t last, common::ObInterruptCode& code) @@ -111,13 +111,13 @@ struct ObInterruptMessage { class ObInterruptRpcProxy : public ObRpcProxy { - public: +public: DEFINE_TO(ObInterruptRpcProxy); RPC_AP(PR1 remote_interrupt_call, OB_REMOTE_INTERRUPT_CALL, (ObInterruptMessage)); }; class ObInterruptProcessor : public ObRpcProcessor> { - protected: +protected: int process(); }; } // namespace obrpc diff --git a/src/share/ob_alive_server_tracer.h b/src/share/ob_alive_server_tracer.h index fa49d086f..1d48bfe2a 100644 --- a/src/share/ob_alive_server_tracer.h +++ b/src/share/ob_alive_server_tracer.h @@ -28,13 +28,13 @@ class ObCommonRpcProxy; } namespace share { class ObILocalityManager { - public: +public: virtual int is_local_zone_read_only(bool& is_readonly) = 0; virtual int is_local_server(const common::ObAddr& server, bool& is_local) = 0; }; class ObIAliveServerTracer { - public: +public: virtual int is_alive(const common::ObAddr& addr, bool& alive, int64_t& trace_time) const = 0; virtual int get_server_status( const common::ObAddr& addr, bool& alive, bool& is_server_exist, int64_t& trace_time) const = 0; @@ -43,7 +43,7 @@ class ObIAliveServerTracer { }; class ObAliveServerMap : public ObIAliveServerTracer { - public: +public: const static int64_t HASH_SERVER_CNT = 2048; ObAliveServerMap(); @@ -62,11 +62,11 @@ class ObAliveServerMap : public ObIAliveServerTracer { return common::OB_OP_NOT_ALLOW; } - private: +private: virtual int refresh_server_list(const common::ObIArray& server_list, common::hash::ObHashSet& servers); - private: +private: bool is_inited_; mutable common::ObLatch lock_; int64_t trace_time_; @@ -78,7 +78,7 @@ class ObAliveServerMap : public ObIAliveServerTracer { class ObAliveServerTracer; class ObAliveServerRefreshTask : public common::ObTimerTask { - public: +public: const static int64_t REFRESH_INTERVAL_US = 5L * 1000 * 1000; // 5 second explicit ObAliveServerRefreshTask(ObAliveServerTracer& tracker); virtual ~ObAliveServerRefreshTask(); @@ -86,7 +86,7 @@ class ObAliveServerRefreshTask : public common::ObTimerTask { int init(); virtual void runTimerTask(); - private: +private: ObAliveServerTracer& tracer_; bool is_inited_; ; @@ -95,7 +95,7 @@ class ObAliveServerRefreshTask : public common::ObTimerTask { }; class ObAliveServerTracer : public ObIAliveServerTracer { - public: +public: ObAliveServerTracer(); virtual ~ObAliveServerTracer(); @@ -107,10 +107,10 @@ class ObAliveServerTracer : public ObIAliveServerTracer { virtual int get_primary_cluster_id(int64_t& cluster_id) const; virtual int refresh(); - private: +private: int refresh_primary_cluster_id(); - private: +private: const static int64_t SERVER_MAP_CNT = 2; bool is_inited_; diff --git a/src/share/ob_autoincrement_service.h b/src/share/ob_autoincrement_service.h index 5b1b77a4b..12fb56edd 100644 --- a/src/share/ob_autoincrement_service.h +++ b/src/share/ob_autoincrement_service.h @@ -151,12 +151,12 @@ inline void atomic_update(T& v, T new_v) } class ObAutoincrementService { - public: +public: static const int64_t DEFAULT_TABLE_NODE_NUM = 1024; // static const int64_t BATCH_FETCH_COUNT = 1024; typedef common::ObLinkHashMap NodeMap; - public: +public: ObAutoincrementService(); ~ObAutoincrementService(); static ObAutoincrementService& get_instance(); @@ -193,7 +193,7 @@ class ObAutoincrementService { int get_leader_epoch_id(const common::ObPartitionKey& part_key, int64_t& epoch_id) const; - private: +private: uint64_t get_max_value(const common::ObObjType type); int get_table_node(const AutoincParam& param, TableNode*& table_node); int fetch_table_node(const AutoincParam& param, TableNode* table_node, const bool fetch_prefetch = false); @@ -209,7 +209,7 @@ class ObAutoincrementService { int get_schema(share::schema::ObSchemaGetterGuard& schema_guard, const uint64_t schema_id, const std::function get_schema_func, const SchemaType*& schema); - private: +private: common::ObSmallAllocator node_allocator_; common::ObSmallAllocator handle_allocator_; common::ObAddr my_addr_; diff --git a/src/share/ob_bg_thread_monitor.h b/src/share/ob_bg_thread_monitor.h index 40ba4da60..c867f88e2 100644 --- a/src/share/ob_bg_thread_monitor.h +++ b/src/share/ob_bg_thread_monitor.h @@ -25,7 +25,7 @@ namespace share { using namespace common; class ObTSIBGMonitorSlotInfo { - public: +public: ObTSIBGMonitorSlotInfo() : slot_idx_(-1) {} ~ObTSIBGMonitorSlotInfo() @@ -47,7 +47,7 @@ class ObTSIBGMonitorSlotInfo { return -1 == slot_idx_; } - private: +private: int64_t slot_idx_; DISALLOW_COPY_AND_ASSIGN(ObTSIBGMonitorSlotInfo); }; @@ -82,7 +82,7 @@ class ObTSIBGMonitorSlotInfo { // @brief Used to alloc callback class ObTSIBGMonitorMemory { - public: +public: ObTSIBGMonitorMemory() : ptr_(NULL), pos_(0) {} ~ObTSIBGMonitorMemory(); @@ -110,13 +110,13 @@ class ObTSIBGMonitorMemory { } static const int64_t MEMORY_SIZE = 128; - private: +private: char* ptr_; int64_t pos_; }; class IBGCallback : public common::ObICallback { - public: +public: void set_class_size(const int64_t size) { size_ = size; @@ -127,26 +127,26 @@ class IBGCallback : public common::ObICallback { } virtual void destroy() = 0; - protected: +protected: int64_t size_; }; class MonitorCallbackWrapper { - public: +public: MonitorCallbackWrapper(); MonitorCallbackWrapper(common::ObICallback* callback, bool is_idempotent); ~MonitorCallbackWrapper(); int handle_callback(); void reset(); - private: +private: bool is_idempotent_; bool has_called_; common::ObICallback* callback_; }; class BGDummyCallback : public IBGCallback { - public: +public: BGDummyCallback() : function_name_() {} BGDummyCallback(const char* function_name) : function_name_(function_name) @@ -166,7 +166,7 @@ class BGDummyCallback : public IBGCallback { void destroy() {} - private: +private: common::ObString function_name_; }; @@ -185,14 +185,14 @@ struct MonitorEntry { }; class MonitorEntryStack { - public: +public: MonitorEntryStack(); ~MonitorEntryStack(); int push(const int64_t start_ts, const int64_t warn_ts, const MonitorCallbackWrapper& callback); void pop(); void check_and_handle_timeout_task(const int64_t current_ts); - private: +private: static const int64_t NEST_LIMIT = 5; int64_t curr_idx_; MonitorEntry inner_entry_[NEST_LIMIT]; @@ -203,7 +203,7 @@ class MonitorEntryStack { }; class ObBGThreadMonitor : public share::ObThreadPool { - public: +public: ObBGThreadMonitor(); ~ObBGThreadMonitor(); int init(); @@ -213,27 +213,27 @@ class ObBGThreadMonitor : public share::ObThreadPool { void stop(); void destroy(); - public: +public: int set(const int64_t start_ts, const int64_t warn_ts, const MonitorCallbackWrapper& callback); void reset(); static ObBGThreadMonitor& get_instance(); - public: +public: const int64_t MONITOR_LIMIT = 500; const int64_t CHECK_INTERVAL = 1000 * 1000; - private: +private: void run_loop_(); int register_slot_idx_(ObTSIBGMonitorSlotInfo*& slot_info); int get_slot_idx_(int64_t& slot_idx); - private: +private: bool is_inited_; int64_t seq_; MonitorEntryStack* monitor_entry_stack_; common::ObMalloc allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBGThreadMonitor); }; @@ -290,16 +290,16 @@ class ObBGThreadMonitor : public share::ObThreadPool { // BG_MONITOR_GUARD(warn_ts, is_idempotent, cb); // class MonitorGuard { - public: +public: explicit MonitorGuard(const int64_t warn_ts, const char* function_name); explicit MonitorGuard(const int64_t warn_ts, const bool is_idempotent, IBGCallback* callback); ~MonitorGuard(); - private: +private: int ret_code_; IBGCallback* callback_; - private: +private: DISALLOW_COPY_AND_ASSIGN(MonitorGuard); }; diff --git a/src/share/ob_cascad_member.h b/src/share/ob_cascad_member.h index 9db2be89c..ed7285d3f 100644 --- a/src/share/ob_cascad_member.h +++ b/src/share/ob_cascad_member.h @@ -25,11 +25,11 @@ namespace share { class ObCascadMember { OB_UNIS_VERSION(1); - public: +public: ObCascadMember(); explicit ObCascadMember(const common::ObAddr& server, const int64_t cluster_id); - public: +public: const common::ObAddr get_server() const { return server_; @@ -54,7 +54,7 @@ class ObCascadMember { TO_STRING_KV(K_(server), K_(cluster_id)); TO_YSON_KV(Y_(server), OB_ID(cluster_id), cluster_id_); - protected: +protected: common::ObAddr server_; int64_t cluster_id_; }; diff --git a/src/share/ob_cascad_member_list.h b/src/share/ob_cascad_member_list.h index 24fbf9ffb..5f1bbc2ab 100644 --- a/src/share/ob_cascad_member_list.h +++ b/src/share/ob_cascad_member_list.h @@ -23,11 +23,11 @@ namespace share { class ObCascadMemberList { OB_UNIS_VERSION(1); - public: +public: ObCascadMemberList(); ~ObCascadMemberList(); - public: +public: void reset(); bool is_valid() const; int add_member(const ObCascadMember& member); @@ -45,7 +45,7 @@ class ObCascadMemberList { int deep_copy(const ObCascadMemberList& member_list); TO_STRING_KV(K(member_array_)); - private: +private: typedef common::ObSEArray ObCascadMemberArray; ObCascadMemberArray member_array_; }; diff --git a/src/share/ob_check_stop_provider.h b/src/share/ob_check_stop_provider.h index 783d38f20..391e46b8a 100644 --- a/src/share/ob_check_stop_provider.h +++ b/src/share/ob_check_stop_provider.h @@ -15,7 +15,7 @@ namespace oceanbase { namespace share { class ObCheckStopProvider { - public: +public: virtual ~ObCheckStopProvider() {} // return OB_CANCELED if stop, else return OB_SUCCESS diff --git a/src/share/ob_cluster_info_proxy.h b/src/share/ob_cluster_info_proxy.h index 00f7b723b..a64b228df 100644 --- a/src/share/ob_cluster_info_proxy.h +++ b/src/share/ob_cluster_info_proxy.h @@ -22,7 +22,7 @@ namespace share { class ObClusterInfo { OB_UNIS_VERSION(1); - public: +public: static const int64_t MAX_PASSWD_LENGTH = common::OB_MAX_PASSWORD_LENGTH; typedef common::ObFixedLengthString UserNameString; typedef common::ObFixedLengthString PassWdString; @@ -127,7 +127,7 @@ class ObClusterInfo { persistent_switchover_status_to_str(switchover_status_), K_(cluster_status), K_(switch_timestamp), K_(is_sync), K_(gc_snapshot_ts), K_(protection_mode), K_(version), K_(protection_level)); - public: +public: static const char* IN_MEMORY_SWITCHOVER_STATUS_ARRAY[]; static const char* PERSISTENT_SWITCHOVER_STATUS_ARRAY[]; static const char* CLUSTER_STATUS_ARRAY[]; @@ -139,15 +139,15 @@ class ObClusterInfo { PersistentSwitchOverStatus switchover_status_; common::ObClusterStatus cluster_status_; - private: +private: // It can avoid the backoff of switching state, and can switch 1000 times at most in one switching process; // The last 10 bits are used to indicate the number of state changes in a switching process; each state change will // inc_switch_timestamp int64_t switch_timestamp_; - public: +public: bool is_sync_; // the cluster is sync with primary - public: +public: int64_t gc_snapshot_ts_; common::ObProtectionMode protection_mode_; int64_t version_; // Mark the change of each variable in cluster info to avoid state fallback @@ -155,7 +155,7 @@ class ObClusterInfo { }; class ObClusterInfoProxy { - public: +public: ObClusterInfoProxy(); virtual ~ObClusterInfoProxy(); // the cluster's create timestamp @@ -164,7 +164,7 @@ class ObClusterInfoProxy { static int update( common::ObISQLClient& sql_proxy, const ObClusterInfo& cluster_info, const bool with_login_info = false); - private: +private: static const char* OB_ALL_CLUSTER_INFO_TNAME; static const char* LOGIN_NAME; static const char* LOGIN_PASSWD; diff --git a/src/share/ob_cluster_switchover_info.h b/src/share/ob_cluster_switchover_info.h index 2e59fe7da..81d3db289 100644 --- a/src/share/ob_cluster_switchover_info.h +++ b/src/share/ob_cluster_switchover_info.h @@ -119,7 +119,7 @@ const char* switchover_info_to_str(const ObClusterSwitchoverInfo so_info); struct ObClusterSwitchoverInfoWrap { OB_UNIS_VERSION(1); - public: +public: static const int64_t DEFAULT_SYNCED_CLUSTER_COUNT = 5; typedef common::ObSEArray ClusterIdArray; diff --git a/src/share/ob_cluster_sync_status.h b/src/share/ob_cluster_sync_status.h index 5b37395ae..d16e0e51e 100644 --- a/src/share/ob_cluster_sync_status.h +++ b/src/share/ob_cluster_sync_status.h @@ -48,7 +48,7 @@ enum ObClusterSyncStatus { }; class ObClusterSyncStatusHelp { - public: +public: static const char* cluster_sync_status_strs[]; static const char* cluster_sync_status_to_str(const share::ObClusterSyncStatus sync_status, const int64_t last_hb_ts); static bool cluster_sync_status_is_valid(const int64_t last_ts); diff --git a/src/share/ob_cluster_version.h b/src/share/ob_cluster_version.h index 3e725c0aa..d2ffb9b1f 100644 --- a/src/share/ob_cluster_version.h +++ b/src/share/ob_cluster_version.h @@ -21,7 +21,7 @@ class ObServerConfig; class ObString; class ObClusterVersion { - public: +public: ObClusterVersion(); ~ObClusterVersion() { @@ -36,7 +36,7 @@ class ObClusterVersion { uint64_t get_cluster_version(); void update_cluster_version(const uint64_t cluster_version); - public: +public: static ObClusterVersion& get_instance(); static int is_valid(const char* verstr); static int get_version(const char* verstr, uint64_t& version); @@ -45,7 +45,7 @@ class ObClusterVersion { static int64_t print_version_str(char* buf, const int64_t buf_len, uint64_t version); static const int64_t MAX_VERSION_ITEM = 16; - private: +private: bool is_inited_; const common::ObServerConfig* config_; uint64_t cluster_version_; diff --git a/src/share/ob_common_rpc_proxy.h b/src/share/ob_common_rpc_proxy.h index eaa45e38f..c899ab012 100644 --- a/src/share/ob_common_rpc_proxy.h +++ b/src/share/ob_common_rpc_proxy.h @@ -28,7 +28,7 @@ namespace oceanbase { namespace obrpc { class ObCommonRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObCommonRpcProxy); // rootservice provided @@ -284,7 +284,7 @@ class ObCommonRpcProxy : public obrpc::ObRpcProxy { RPC_S(PRD create_restore_point, obrpc::OB_CREATE_RESTORE_POINT, (ObCreateRestorePointArg)); RPC_S(PRD drop_restore_point, obrpc::OB_DROP_RESTORE_POINT, (ObDropRestorePointArg)); - public: +public: void set_rs_mgr(share::ObRsMgr& rs_mgr) { rs_mgr_ = &rs_mgr; @@ -307,13 +307,13 @@ class ObCommonRpcProxy : public obrpc::ObRpcProxy { return proxy; } - private: +private: void reset_rs_mgr() { rs_mgr_ = NULL; } - protected: +protected: #define CALL_WITH_RETRY(call_stmt) \ common::ObAddr rs; \ do { \ @@ -392,7 +392,7 @@ class ObCommonRpcProxy : public obrpc::ObRpcProxy { } #undef CALL_WIRTH_RETRY - private: +private: share::ObRsMgr* rs_mgr_; }; // end of class ObCommonRpcProxy diff --git a/src/share/ob_core_table_proxy.h b/src/share/ob_core_table_proxy.h index 94e08d72c..f098c7b9e 100644 --- a/src/share/ob_core_table_proxy.h +++ b/src/share/ob_core_table_proxy.h @@ -71,7 +71,7 @@ namespace share { // } // class ObCoreTableProxy { - public: +public: friend class ObFreezeInfoProxy; struct Cell { Cell() : is_hex_value_(false) @@ -110,7 +110,7 @@ class ObCoreTableProxy { }; class Row { - public: + public: Row() : inited_(false), row_id_(common::OB_INVALID_INDEX), cells_(NULL), cell_cnt_(0), kv_proxy_(NULL) {} @@ -154,10 +154,10 @@ class ObCoreTableProxy { DECLARE_TO_STRING; - private: + private: int extend_cell_array(const int64_t cnt); - private: + private: bool inited_; int64_t row_id_; // cells are sorted by name @@ -240,7 +240,7 @@ class ObCoreTableProxy { TO_STRING_KV(K_(table_name), K_(load_for_update), K_(cur_idx), K_(all_row)); - private: +private: int store_string(const common::ObString& src, common::ObString& dest); int load(const bool for_update, const int64_t frozen_version); @@ -263,7 +263,7 @@ class ObCoreTableProxy { // choose the minimal non exist row_id (started with 0) int generate_row_id(int64_t& row_id) const; - private: +private: const char* table_name_; common::ObISQLClient* sql_client_; diff --git a/src/share/ob_ddl_task_executor.h b/src/share/ob_ddl_task_executor.h index 23a93d068..7154744a6 100644 --- a/src/share/ob_ddl_task_executor.h +++ b/src/share/ob_ddl_task_executor.h @@ -34,7 +34,7 @@ enum ObIDDLTaskType { }; class ObIDDLTask : public common::ObDLinkBase { - public: +public: explicit ObIDDLTask(const ObIDDLTaskType task_type) : need_retry_(false), task_id_(), is_inited_(false), type_(task_type) {} @@ -65,7 +65,7 @@ class ObIDDLTask : public common::ObDLinkBase { common::OB_REPLICA_NOT_READABLE == ret_code; } - protected: +protected: typedef common::ObCurTraceId::TraceId TaskId; bool need_retry_; TaskId task_id_; @@ -74,7 +74,7 @@ class ObIDDLTask : public common::ObDLinkBase { }; class ObDDLTaskQueue { - public: +public: ObDDLTaskQueue(); virtual ~ObDDLTaskQueue(); int init( @@ -85,7 +85,7 @@ class ObDDLTaskQueue { int add_task_to_last(ObIDDLTask* task); void destroy(); - private: +private: typedef common::ObDList TaskList; typedef common::hash::ObHashSet, common::hash::equal_to > @@ -98,7 +98,7 @@ class ObDDLTaskQueue { }; class ObDDLTaskExecutor : public lib::TGRunnable { - public: +public: ObDDLTaskExecutor(); virtual ~ObDDLTaskExecutor(); int init(const int64_t task_num, int tg_id); @@ -109,7 +109,7 @@ class ObDDLTaskExecutor : public lib::TGRunnable { void stop(); void wait(); - private: +private: static const int64_t BATCH_EXECUTE_COUNT = 1000; static const int64_t CHECK_TASK_INTERVAL = 100; // 100ms static const int64_t TOTAL_LIMIT = 1024L * 1024L * 1024L; diff --git a/src/share/ob_debug_sync.h b/src/share/ob_debug_sync.h index 8f87d632c..8607c5a40 100644 --- a/src/share/ob_debug_sync.h +++ b/src/share/ob_debug_sync.h @@ -30,10 +30,10 @@ class ObString; typedef common::ObFixedLengthString<32> ObSyncEventName; struct ObDebugSyncAction { - public: +public: OB_UNIS_VERSION(1); - public: +public: ObDebugSyncAction() : sync_point_(INVALID_DEBUG_SYNC_POINT), timeout_(0), execute_(0), no_clear_() {} TO_STRING_KV(K_(sync_point), K_(timeout), K_(execute), K_(signal), K_(wait), K_(no_clear), K_(broadcast)); @@ -54,10 +54,10 @@ struct ObDebugSyncAction { }; class ObDSActionArray { - public: +public: OB_UNIS_VERSION(1); - public: +public: // const action array will always be empty explicit ObDSActionArray(const bool is_const = false); @@ -77,7 +77,7 @@ class ObDSActionArray { bool is_active(const ObDebugSyncPoint sync_point) const; int copy_action(const ObDebugSyncPoint sync_point, ObDebugSyncAction& action) const; - private: +private: ObDebugSyncAction* action_ptrs_[MAX_DEBUG_SYNC_POINT]; ObDebugSyncAction actions_[MAX_DEBUG_SYNC_POINT]; volatile int64_t active_cnt_; @@ -87,12 +87,12 @@ class ObDSActionArray { }; class ObDSActionNode : public ObDLinkBase { - public: +public: ObDebugSyncAction action_; }; class ObDSSessionActions { - public: +public: ObDSSessionActions() : inited_(false), block_head_(NULL), page_size_(0), allocator_(NULL) {} virtual ~ObDSSessionActions(); @@ -115,11 +115,11 @@ class ObDSSessionActions { int to_thread_local(ObDSActionArray& local) const; int get_thread_local_result(const ObDSActionArray& local); - private: +private: ObDSActionNode* alloc_node(); void free_node(ObDSActionNode* node); - private: +private: bool inited_; void* block_head_; int64_t page_size_; @@ -132,7 +132,7 @@ class ObDSSessionActions { }; class ObDSEventControl { - public: +public: const static int64_t MIN_EVENT_CNT = 512; const static int64_t MAX_EVENT_CNT = MAX_DEBUG_SYNC_POINT <= MIN_EVENT_CNT / 10 ? MIN_EVENT_CNT : MAX_DEBUG_SYNC_POINT * 10; @@ -160,7 +160,7 @@ class ObDSEventControl { void stop(); - private: +private: // return NULL for alloc failed Event* alloc_event(); void free_event(Event* e); @@ -169,7 +169,7 @@ class ObDSEventControl { // locate event by name (if not exist create one) int locate(const ObSyncEventName& name, Event*& e); - private: +private: volatile bool stop_; Event events_[MAX_EVENT_CNT]; @@ -182,7 +182,7 @@ class ObDSEventControl { }; class ObDebugSync { - public: +public: static ObDebugSync& instance(); void set_rpc_proxy(obrpc::ObCommonRpcProxy* rpc_proxy); @@ -202,14 +202,14 @@ class ObDebugSync { void stop(); - private: +private: ObDebugSync() : stop_(false), rpc_proxy_(NULL) {} int parse_action(const ObString& str, ObDebugSyncAction& action, bool& clear, bool& reset); static ObString get_token(ObString& str); - private: +private: volatile bool stop_; ObSpinLock lock_; // protect global action access ObDSActionArray global_actions_; diff --git a/src/share/ob_dml_sql_splicer.h b/src/share/ob_dml_sql_splicer.h index 90c10a43f..9271e0f97 100644 --- a/src/share/ob_dml_sql_splicer.h +++ b/src/share/ob_dml_sql_splicer.h @@ -49,7 +49,7 @@ struct ObPartitionReplica; // ret = dml_splicer.splice_update_sql("tname", sql); // class ObRealUInt64 { - public: +public: ObRealUInt64(const uint64_t v) : v_(v) {} uint64_t value() const @@ -58,12 +58,12 @@ class ObRealUInt64 { } TO_STRING_KV(K_(v)); - private: +private: uint64_t v_; }; class ObDMLSqlSplicer { - public: +public: friend class ObPTSqlSplicer; // for columns with NULL value static const char* const NULL_VALUE; @@ -145,7 +145,7 @@ class ObDMLSqlSplicer { // "(c1, c2, c3) IN ((v11, v12, v13), (v21, v22, v23))" int splice_batch_predicates_sql(common::ObSqlString& sql) const; - private: +private: struct Column { const char* name_; // end position of %ObDMLSqlSplicer::values_ @@ -220,7 +220,7 @@ class ObDMLSqlSplicer { int splice_batch_predicates(const common::ObArray& all_names, const common::ObArray& rows_matrix, common::ObSqlString& sql) const; - private: +private: Mode mode_; common::ObSqlString values_; common::ObSEArray columns_; @@ -233,7 +233,7 @@ class ObDMLSqlSplicer { }; class ObPTSqlSplicer : public ObDMLSqlSplicer { - public: +public: ObPTSqlSplicer() {} ~ObPTSqlSplicer() @@ -244,7 +244,7 @@ class ObPTSqlSplicer : public ObDMLSqlSplicer { const char* table_name, const bool with_role, common::ObSqlString& sql) const; int splice_insert_update_replica_sql(const char* table_name, common::ObSqlString& sql) const; - private: +private: int splice_batch_insert_update_replica_column(const bool with_role, const common::ObString& sep, const common::ObIArray& names, common::ObSqlString& sql) const; int splice_insert_update_replica_column(const char* sep, common::ObSqlString& sql) const; @@ -255,7 +255,7 @@ class ObPTSqlSplicer : public ObDMLSqlSplicer { // help execute dml sql class ObDMLExecHelper { - public: +public: friend class ObNormalPartitionUpdateHelper; ObDMLExecHelper(common::ObISQLClient& sql_client, const uint64_t tenant_id) : tenant_id_(tenant_id), sql_client_(sql_client) @@ -270,7 +270,7 @@ class ObDMLExecHelper { int exec_update(const char* table_name, const ObDMLSqlSplicer& splicer, int64_t& affected_rows); int exec_delete(const char* table_name, const ObDMLSqlSplicer& splicer, int64_t& affected_rows); - private: +private: int check_row_exist(const char* table_name, const ObDMLSqlSplicer& splicer, bool& exist); uint64_t tenant_id_; common::ObISQLClient& sql_client_; diff --git a/src/share/ob_duplicate_scope_define.h b/src/share/ob_duplicate_scope_define.h index 4e0d89788..81dd68daa 100644 --- a/src/share/ob_duplicate_scope_define.h +++ b/src/share/ob_duplicate_scope_define.h @@ -35,7 +35,7 @@ const char* const duplicate_scope_strings[] = {"none", "cluster"}; class ObDuplicateScopeChecker { - public: +public: static bool is_valid_replicate_scope(ObDuplicateScope duplicate_scope) { return duplicate_scope < ObDuplicateScope::DUPLICATE_SCOPE_MAX && diff --git a/src/share/ob_encrypt_kms.h b/src/share/ob_encrypt_kms.h index a67a87d56..b61b728af 100644 --- a/src/share/ob_encrypt_kms.h +++ b/src/share/ob_encrypt_kms.h @@ -34,13 +34,13 @@ struct ObKmsResult { }; class ObKmsClient { - public: +public: ObKmsClient() {} virtual ~ObKmsClient() {} - public: +public: virtual int init(const char* kms_info, int64_t kms_len); virtual int check_param_valid(); common::ObString get_root_ca() const @@ -51,18 +51,18 @@ class ObKmsClient { }; class ObSSLClient : public ObKmsClient { - public: +public: ObSSLClient() : ObKmsClient(), private_key_(), public_cert_() {} virtual ~ObSSLClient(){}; - public: +public: bool is_bkmi_mode() const { return false; } - public: +public: ObKmsResult private_key_; // private ObKmsResult public_cert_; }; diff --git a/src/share/ob_encryption_struct.h b/src/share/ob_encryption_struct.h index a1919ac5c..c49d6f852 100644 --- a/src/share/ob_encryption_struct.h +++ b/src/share/ob_encryption_struct.h @@ -26,7 +26,7 @@ namespace share { template class ObEncryptKey { - public: +public: ObEncryptKey() : str_(BUFSIZE, 0, buf_) {} ~ObEncryptKey() @@ -63,7 +63,7 @@ class ObEncryptKey { TO_STRING_KV(K_(str)); OB_UNIS_VERSION(1); - private: +private: char buf_[BUFSIZE]; ObString str_; }; @@ -166,7 +166,7 @@ enum CLogEncryptStatBitIndex { // Use scenarios to ensure no concurrency issues struct ObCLogEncryptStatMap { - public: +public: ObCLogEncryptStatMap() : val_(0) {} ~ObCLogEncryptStatMap() @@ -177,7 +177,7 @@ struct ObCLogEncryptStatMap { void set_map(const int64_t idx); bool test_map(const int64_t idx) const; - public: +public: uint16_t val_; }; diff --git a/src/share/ob_encryption_util.h b/src/share/ob_encryption_util.h index e55bcbf35..17b83476d 100644 --- a/src/share/ob_encryption_util.h +++ b/src/share/ob_encryption_util.h @@ -38,7 +38,7 @@ const int64_t OB_CLOG_ENCRYPT_MASTER_KEY_LEN = 32; const int64_t OB_CLOG_ENCRYPT_TABLE_KEY_LEN = 32; class ObEncryptionUtil { - public: +public: static bool need_encrypt(int64_t encrypt_id); static int parse_encryption_algorithm(const common::ObString& str, ObAesOpMode& encryption_algorithm); static int parse_encryption_algorithm(const char* str, ObAesOpMode& encryption_algorithm); diff --git a/src/share/ob_event_history_table_operator.h b/src/share/ob_event_history_table_operator.h index 6a5cb84f3..d36a998c0 100644 --- a/src/share/ob_event_history_table_operator.h +++ b/src/share/ob_event_history_table_operator.h @@ -31,7 +31,7 @@ class ObMySQLProxy; namespace share { class ObEventHistoryTableOperator; class ObEventTableClearTask : public common::ObAsyncTimerTask { - public: +public: ObEventTableClearTask(ObEventHistoryTableOperator& rs_event_operator, ObEventHistoryTableOperator& server_event_operator, common::ObWorkQueue& work_queue); virtual ~ObEventTableClearTask() @@ -45,16 +45,16 @@ class ObEventTableClearTask : public common::ObAsyncTimerTask { } virtual ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const override; - private: +private: ObEventHistoryTableOperator& rs_event_operator_; ObEventHistoryTableOperator& server_event_operator_; }; class ObEventHistoryTableOperator { - public: +public: static const int64_t EVENT_TABLE_CLEAR_INTERVAL = 2L * 3600L * 1000L * 1000L; // 2 Hours class ObEventTableUpdateTask : public common::IObDedupTask { - public: + public: ObEventTableUpdateTask(ObEventHistoryTableOperator& table_operator, const bool is_delete); virtual ~ObEventTableUpdateTask() {} @@ -73,7 +73,7 @@ class ObEventHistoryTableOperator { } virtual int process(); - public: + public: void assign_ptr(char* ptr, const int64_t buf_size) { sql_.assign_ptr(ptr, static_cast(buf_size)); @@ -81,7 +81,7 @@ class ObEventHistoryTableOperator { TO_STRING_KV(K_(sql), K_(is_delete)); - private: + private: ObEventHistoryTableOperator& table_operator_; common::ObString sql_; bool is_delete_; @@ -123,7 +123,7 @@ class ObEventHistoryTableOperator { virtual int async_delete() = 0; - protected: +protected: void set_addr(const common::ObAddr self_addr, bool is_rs_ev) { self_addr_ = self_addr; @@ -144,7 +144,7 @@ class ObEventHistoryTableOperator { int add_task(const common::ObSqlString& sql, const bool is_delete = false); int gen_event_ts(int64_t& event_ts); - protected: +protected: static const int64_t TOTAL_LIMIT = 320L * 1024L * 1024L; // 320MB static const int64_t HOLD_LIMIT = 160L * 1024L * 1024L; // 160MB static const int64_t PAGE_SIZE = common::OB_MALLOC_NORMAL_BLOCK_SIZE; @@ -156,7 +156,7 @@ class ObEventHistoryTableOperator { virtual int process_task(const common::ObString& sql, const bool is_delete); - private: +private: bool inited_; volatile bool stopped_; int64_t last_event_ts_; @@ -167,10 +167,10 @@ class ObEventHistoryTableOperator { common::ObAddr self_addr_; bool is_rootservice_event_history_; - protected: +protected: ObEventHistoryTableOperator(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObEventHistoryTableOperator); }; diff --git a/src/share/ob_freeze_info_proxy.h b/src/share/ob_freeze_info_proxy.h index a24df2363..5df7154b3 100644 --- a/src/share/ob_freeze_info_proxy.h +++ b/src/share/ob_freeze_info_proxy.h @@ -95,7 +95,7 @@ struct ObSimpleFrozenStatus { struct TenantIdAndSchemaVersion { OB_UNIS_VERSION(1); - public: +public: TenantIdAndSchemaVersion() : tenant_id_(common::OB_INVALID_TENANT_ID), schema_version_(0) {} TenantIdAndSchemaVersion(const int64_t tenant_id, const int64_t schema_version) @@ -127,20 +127,20 @@ struct TenantIdAndSchemaVersion { }; class ObFreezeInfoProxy { - public: +public: ObFreezeInfoProxy() {} virtual ~ObFreezeInfoProxy() {} static const char* OB_ALL_FREEZE_INFO_TNAME; - public: +public: // freeze status static const int64_t INVALID_TIMESTAMP = storage::ObFrozenStatus::INVALID_TIMESTAMP; static const int64_t INVALID_FROZEN_VERSION = storage::ObFrozenStatus::INVALID_FROZEN_VERSION; static const int64_t INVALID_SCHEMA_VERSION = storage::ObFrozenStatus::INVALID_SCHEMA_VERSION; - public: +public: // major_version = 0: Get latest freeze info int get_freeze_info( common::ObISQLClient& sql_proxy, const int64_t major_version, ObSimpleFrozenStatus& frozen_status); @@ -204,7 +204,7 @@ class ObFreezeInfoProxy { int get_frozen_status_less_than(common::ObISQLClient& sql_proxy, const int64_t tenant_id, const int64_t schema_version, ObSimpleFrozenStatus& frozen_status); - private: +private: int get_freeze_info_larger_than_inner(common::ObISQLClient& sql_proxy, const int64_t major_version, common::ObIArray& frozen_statuses); int get_min_major_available_and_larger_info_inner(common::ObISQLClient& sql_proxy, const int64_t major_version, @@ -217,7 +217,7 @@ class ObFreezeInfoProxy { int get_max_frozen_status_with_schema_version_v2_inner( common::ObISQLClient& sql_proxy, common::ObSqlString& sql, ObSimpleFrozenStatus& frozen_status); - private: +private: inline bool is_valid_frozen_version_(int64_t frozen_version) { return INVALID_FROZEN_VERSION != frozen_version && frozen_version > 0; @@ -241,7 +241,7 @@ class ObFreezeInfoProxy { return ((cur_ts > old_ts) ? cur_ts : (old_ts + 1)); } - private: +private: // table name and column name static const char* FROZEN_VERSION_CNAME; static const char* FROZEN_TIMESTAMP_CNAME; diff --git a/src/share/ob_get_compat_mode.h b/src/share/ob_get_compat_mode.h index d046a1684..92ceca546 100644 --- a/src/share/ob_get_compat_mode.h +++ b/src/share/ob_get_compat_mode.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace share { class ObCompatModeGetter { - public: +public: static ObCompatModeGetter& instance(); // Provide global function interface static int get_tenant_mode(const uint64_t tenant_id, ObWorker::CompatMode& mode); @@ -38,16 +38,16 @@ class ObCompatModeGetter { int set_tenant_compat_mode(const uint64_t tenant_id, ObWorker::CompatMode& mode); int reset_compat_getter_map(); - private: +private: typedef common::hash::ObHashMap MAP; static const int64_t bucket_num = common::OB_DEFAULT_TENANT_COUNT; - private: +private: MAP id_mode_map_; common::ObMySQLProxy* sql_proxy_; bool is_inited_; - private: +private: ObCompatModeGetter(); ~ObCompatModeGetter(); DISALLOW_COPY_AND_ASSIGN(ObCompatModeGetter); diff --git a/src/share/ob_global_stat_proxy.h b/src/share/ob_global_stat_proxy.h index 151c5a8b1..5f416afbd 100644 --- a/src/share/ob_global_stat_proxy.h +++ b/src/share/ob_global_stat_proxy.h @@ -36,7 +36,7 @@ struct ObGlobalStatItem : public common::ObDLinkBase { static const char* OB_ALL_GLOBAL_STAT_TNAME = "__all_global_stat"; class ObGlobalStatProxy { - public: +public: ObGlobalStatProxy(common::ObISQLClient& client) : core_table_(OB_ALL_GLOBAL_STAT_TNAME, client) {} virtual ~ObGlobalStatProxy() @@ -91,16 +91,16 @@ class ObGlobalStatProxy { int set_next_schema_version(const int64_t next_schema_version); int get_next_schema_version(int64_t& next_schema_version); - private: +private: int update(const ObGlobalStatItem::ItemList& list, const bool is_incremental = false); int get(ObGlobalStatItem::ItemList& list, const int64_t frozen_version = -1); - private: +private: static const char* OB_ALL_GC_SCHEMA_VERSION_TNAME; static const char* TENANT_ID_CNAME; static const char* GC_SCHEMA_VERSION_CNAME; - private: +private: ObCoreTableProxy core_table_; }; diff --git a/src/share/ob_gts_info.h b/src/share/ob_gts_info.h index fa5a6ac1c..1997bcfd4 100644 --- a/src/share/ob_gts_info.h +++ b/src/share/ob_gts_info.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObGtsInfo { - public: +public: ObGtsInfo(); ~ObGtsInfo() {} @@ -28,7 +28,7 @@ class ObGtsInfo { bool is_valid() const; int assign(const ObGtsInfo& that); - public: +public: uint64_t gts_id_; common::ObGtsName gts_name_; common::ObRegion region_; @@ -41,14 +41,14 @@ class ObGtsInfo { }; class ObGtsTenantInfo { - public: +public: ObGtsTenantInfo(); ~ObGtsTenantInfo() {} void reset(); bool is_valid() const; - public: +public: uint64_t gts_id_; uint64_t tenant_id_; common::ObMemberList member_list_; diff --git a/src/share/ob_gts_table_operator.h b/src/share/ob_gts_table_operator.h index 0f29b5a18..1668016c8 100644 --- a/src/share/ob_gts_table_operator.h +++ b/src/share/ob_gts_table_operator.h @@ -21,11 +21,11 @@ namespace oceanbase { namespace share { class ObGtsTableOperator { - public: +public: ObGtsTableOperator(); ~ObGtsTableOperator(); - public: +public: int init(common::ObMySQLProxy* proxy); int get_gts_infos(common::ObIArray& gts_infos) const; int get_gts_tenant_infos(common::ObIArray& gts_tenant_infos) const; @@ -40,7 +40,7 @@ class ObGtsTableOperator { int get_gts_info(const uint64_t gts_id, common::ObGtsInfo& gts_info) const; int try_update_standby(const common::ObGtsInfo& gts_info, const common::ObAddr& new_standby, bool& do_update); - private: +private: int read_gts_infos_(const common::ObSqlString& sql, common::ObIArray& gts_infos) const; int read_gts_info_(const common::sqlclient::ObMySQLResult& result, common::ObGtsInfo& gts_info) const; int read_gts_tenant_infos_( @@ -54,11 +54,11 @@ class ObGtsTableOperator { static int convert_member_list_( const common::ObMemberList& orig_member_list, ObPartitionReplica::MemberList& curr_member_list); - private: +private: bool is_inited_; common::ObMySQLProxy* proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGtsTableOperator); }; } // namespace share diff --git a/src/share/ob_i_data_access_service.h b/src/share/ob_i_data_access_service.h index f19575b4e..e2018eecf 100644 --- a/src/share/ob_i_data_access_service.h +++ b/src/share/ob_i_data_access_service.h @@ -177,7 +177,7 @@ typedef common::ObSEArray& key) const = 0; virtual int get_tenant_mem_limit(const uint64_t tenant_id, int64_t& lower_limit, int64_t& upper_limit) const = 0; diff --git a/src/share/ob_index_build_stat.h b/src/share/ob_index_build_stat.h index 395ceeee5..fbd5826a7 100644 --- a/src/share/ob_index_build_stat.h +++ b/src/share/ob_index_build_stat.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace share { class ObIndexBuildStatOperator { - public: +public: static int get_snapshot_version(const uint64_t data_table_id, const uint64_t index_table_id, common::ObMySQLProxy& proxy, int64_t& snapshot_version); }; diff --git a/src/share/ob_index_builder_util.h b/src/share/ob_index_builder_util.h index 04f4acb52..239198420 100644 --- a/src/share/ob_index_builder_util.h +++ b/src/share/ob_index_builder_util.h @@ -38,7 +38,7 @@ class ObTableSchema; class ObColumnSchemaV2; }; // namespace schema class ObIndexBuilderUtil { - public: +public: static int adjust_expr_index_args(obrpc::ObCreateIndexArg& arg, share::schema::ObTableSchema& data_schema, common::ObIArray& gen_columns); static int generate_ordinary_generated_column(sql::ObRawExpr& expr, share::schema::ObTableSchema& data_schema, @@ -50,10 +50,10 @@ class ObIndexBuilderUtil { const common::ObOrderType order_type, common::ObRowDesc& row_desc, share::schema::ObTableSchema& table_schema, const bool is_hidden = false); - private: +private: typedef common::ObArray > OrderFTColumns; class FulltextColumnOrder { - public: + public: FulltextColumnOrder() {} ~FulltextColumnOrder() diff --git a/src/share/ob_index_checksum.h b/src/share/ob_index_checksum.h index cc1e03c6a..3d09b850f 100644 --- a/src/share/ob_index_checksum.h +++ b/src/share/ob_index_checksum.h @@ -52,7 +52,7 @@ struct ObIndexChecksumItem { }; class ObIndexChecksumOperator { - public: +public: static int update_checksum( const common::ObIArray& checksum_items, common::ObMySQLProxy& sql_proxy); static int get_partition_column_checksum(const uint64_t execution_id, const uint64_t table_id, @@ -65,7 +65,7 @@ class ObIndexChecksumOperator { static int get_checksum_method( const uint64_t execution_id, const uint64_t table_id, int64_t& checksum_method, common::ObMySQLProxy& sql_proxy); - private: +private: static int fill_one_item(const ObIndexChecksumItem& item, share::ObDMLSqlSplicer& dml); static int get_column_checksum(const common::ObSqlString& sql, common::hash::ObHashMap& column_checksum_map, common::ObMySQLProxy& sql_proxy); diff --git a/src/share/ob_index_status_table_operator.h b/src/share/ob_index_status_table_operator.h index b06ac6c0b..c3b6147be 100644 --- a/src/share/ob_index_status_table_operator.h +++ b/src/share/ob_index_status_table_operator.h @@ -21,9 +21,9 @@ namespace oceanbase { namespace share { class ObIndexStatusTableOperator { - public: +public: struct ObBuildIndexStatus { - public: + public: ObBuildIndexStatus() : index_status_(share::schema::ObIndexStatus::INDEX_STATUS_NOT_FOUND), ret_code_(common::OB_SUCCESS), diff --git a/src/share/ob_index_task_table_operator.h b/src/share/ob_index_task_table_operator.h index ebb9043f0..5ffbb89fd 100644 --- a/src/share/ob_index_task_table_operator.h +++ b/src/share/ob_index_task_table_operator.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace share { class ObIndexTaskTableOperator { - public: +public: ObIndexTaskTableOperator(); virtual ~ObIndexTaskTableOperator(); static int get_build_index_server( diff --git a/src/share/ob_index_trans_status_reporter.h b/src/share/ob_index_trans_status_reporter.h index c18671b71..8b3b9d34b 100644 --- a/src/share/ob_index_trans_status_reporter.h +++ b/src/share/ob_index_trans_status_reporter.h @@ -43,7 +43,7 @@ struct ObIndexTransStatus { }; class ObIndexTransStatusReporter { - public: +public: enum ServerType { INVALID_SERVER_TYPE = 0, OB_SERVER = 1, diff --git a/src/share/ob_inner_config_root_addr.h b/src/share/ob_inner_config_root_addr.h index 9a1111051..fe9857190 100644 --- a/src/share/ob_inner_config_root_addr.h +++ b/src/share/ob_inner_config_root_addr.h @@ -26,7 +26,7 @@ namespace share { // store and dispatch root server address list by oceanbase config mechanism. // same with oceanbase 0.5 class ObInnerConfigRootAddr : public ObRootAddrAgent { - public: +public: ObInnerConfigRootAddr() : inited_(false), proxy_(NULL) {} virtual ~ObInnerConfigRootAddr() @@ -34,25 +34,25 @@ class ObInnerConfigRootAddr : public ObRootAddrAgent { int init(common::ObMySQLProxy& sql_proxy, common::ObServerConfig& config); - - virtual int store(const ObIAddrList &addr_list, const ObIAddrList &readonly_addr_list, - const bool force, const common::ObClusterType cluster_type, - const int64_t timestamp) override; - virtual int fetch(ObIAddrList &add_list, ObIAddrList &readonly_addr_list, - common::ObClusterType &cluster_typ) override; - //innerconfig does not need to support delete cluster operations - virtual int delete_cluster(const int64_t cluster_id) override { UNUSED(cluster_id); return common::OB_SUCCESS; } - virtual int fetch_remote_rslist(const int64_t cluster_id, - ObIAddrList &addr_list, - ObIAddrList &readonly_addr_list, - common::ObClusterType &cluster_type) override; + virtual int store(const ObIAddrList& addr_list, const ObIAddrList& readonly_addr_list, const bool force, + const common::ObClusterType cluster_type, const int64_t timestamp) override; + virtual int fetch( + ObIAddrList& add_list, ObIAddrList& readonly_addr_list, common::ObClusterType& cluster_typ) override; + // innerconfig does not need to support delete cluster operations + virtual int delete_cluster(const int64_t cluster_id) override + { + UNUSED(cluster_id); + return common::OB_SUCCESS; + } + virtual int fetch_remote_rslist(const int64_t cluster_id, ObIAddrList& addr_list, ObIAddrList& readonly_addr_list, + common::ObClusterType& cluster_type) override; static int format_rootservice_list(const ObIAddrList& addr_list, common::ObSqlString& str); - private: +private: static int parse_rs_addr(char* addr_buf, common::ObAddr& addr, int64_t& sql_port); - private: +private: bool inited_; common::ObMySQLProxy* proxy_; diff --git a/src/share/ob_kv_parser.h b/src/share/ob_kv_parser.h index cfc1698bf..c36b4b8ac 100644 --- a/src/share/ob_kv_parser.h +++ b/src/share/ob_kv_parser.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace share { class ObKVMatchCb { - public: +public: virtual int match(const char* key, const char* value) = 0; virtual bool check() const { @@ -28,7 +28,7 @@ class ObKVMatchCb { }; class ObKVParser { - public: +public: ObKVParser() : SYM_KV_SEP(':'), SYM_PAIR_SEP(','), @@ -61,13 +61,13 @@ class ObKVParser { int parse(const char* data); int parse(const char* data, int64_t data_length); - private: +private: int match(int sym); int emit(int sym); int get_token(); // Pre-reading symbol int kv_pair(); - private: +private: static const int MAX_TOKEN_SIZE = 1024; // Symbol table static const int SYM_END = 0; diff --git a/src/share/ob_leader_election_waiter.h b/src/share/ob_leader_election_waiter.h index daa372ac1..225fa31c3 100644 --- a/src/share/ob_leader_election_waiter.h +++ b/src/share/ob_leader_election_waiter.h @@ -35,7 +35,7 @@ class ObTablegroupSchema; class ObPartitionTableOperator; class ObLeaderElectionWaiter { - public: +public: struct ExpectedLeader { common::ObPartitionKey partition_; common::ObAddr exp_leader_; @@ -71,7 +71,7 @@ class ObLeaderElectionWaiter { return pt_operator_; } - private: +private: static const int64_t CHECK_LEADER_ELECT_INTERVAL_US = 500 * 1000L; // 500ms static const int64_t CHECK_LEADER_CHANGE_INTERVAL_US = 3000 * 1000L; // 3s @@ -79,7 +79,7 @@ class ObLeaderElectionWaiter { const int64_t abs_timeout, common::ObAddr& leader); int check_sleep(const int64_t interval_us); - private: +private: volatile bool& stop_; common::ObArenaAllocator allocator_; share::ObPartitionTableOperator& pt_operator_; @@ -96,22 +96,22 @@ inline void ObLeaderElectionWaiter::ExpectedLeader::reset() } class ObUserPartitionLeaderWaiter { - public: +public: typedef ObLeaderElectionWaiter::ExpectedLeader ExpectedLeader; - public: +public: ObUserPartitionLeaderWaiter(common::ObMySQLProxy& mysql_proxy, volatile bool& stop) : mysql_proxy_(mysql_proxy), stop_(stop) {} virtual ~ObUserPartitionLeaderWaiter() {} - public: +public: // leader wait interface for user partition, invoked by leader coordinator int tenant_user_partition_wait( const uint64_t tenant_id, common::ObIArray& expected_leaders, const int64_t timeout); - private: +private: static const int64_t CHECK_LEADER_CHANGE_INTERVAL_BASE_US = 100 * 1000; // 100ms static const int64_t CHECK_LEADER_CHANGE_INTERVAL_MAX_US = 4 * 1000000; // 4s typedef common::hash::ObHashMap @@ -128,7 +128,7 @@ class ObUserPartitionLeaderWaiter { void interval_sleep(const int64_t sleep_interval); int check_cancel(); - private: +private: common::ObMySQLProxy& mysql_proxy_; volatile bool& stop_; }; diff --git a/src/share/ob_lease_struct.h b/src/share/ob_lease_struct.h index 41a7fb94f..bb22c534d 100644 --- a/src/share/ob_lease_struct.h +++ b/src/share/ob_lease_struct.h @@ -66,7 +66,7 @@ enum LeaseRequestServerStatus { struct ObServerResourceInfo { OB_UNIS_VERSION(1); - public: +public: double cpu_; int64_t mem_in_use_; // in KB int64_t mem_total_; @@ -92,7 +92,7 @@ struct ObServerResourceInfo { struct ObLeaseRequest { OB_UNIS_VERSION(1); - public: +public: static const int64_t LEASE_VERSION = 1; // Server lease length, 50s static const int64_t SERVICE_LEASE = 40 * 1000000; @@ -131,7 +131,7 @@ struct ObLeaseRequest { struct ObLeaseResponse { OB_UNIS_VERSION(1); - public: +public: static const int64_t LEASE_VERSION = 1; int64_t version_; int64_t lease_expire_time_; @@ -168,32 +168,32 @@ struct ObLeaseResponse { struct ObInZoneHbRequest { OB_UNIS_VERSION(1); - public: +public: ObInZoneHbRequest() : server_() {} - public: +public: bool is_valid() const; void reset(); TO_STRING_KV(K_(server)); - public: +public: common::ObAddr server_; }; struct ObInZoneHbResponse { OB_UNIS_VERSION(1); - public: +public: ObInZoneHbResponse() : in_zone_hb_expire_time_(-1) {} - public: +public: bool is_valid() const; void reset(); TO_STRING_KV(K_(in_zone_hb_expire_time)); - public: +public: int64_t in_zone_hb_expire_time_; }; diff --git a/src/share/ob_list_parser.h b/src/share/ob_list_parser.h index 4c7cb1648..7a69b4c8b 100644 --- a/src/share/ob_list_parser.h +++ b/src/share/ob_list_parser.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace share { class ObListMatchCb { - public: +public: virtual int match(const char* value) = 0; virtual bool finish() { @@ -28,7 +28,7 @@ class ObListMatchCb { }; class ObListParser { - public: +public: ObListParser() : SYM_LIST_SEP(','), allow_space_(false), token_(0), cur_(NULL), cb_(NULL) {} ObListParser(char list_sep) : SYM_LIST_SEP(list_sep), token_(0), cur_(NULL), cb_(NULL) @@ -45,10 +45,10 @@ class ObListParser { } int parse(const char* data); - private: +private: int match(int sym); int get_token(); // Pre-reading symbol - private: +private: static const int MAX_TOKEN_SIZE = 1024; // Symbol table static const int SYM_END = 0; diff --git a/src/share/ob_locality_info.h b/src/share/ob_locality_info.h index db09c90b5..efc755a85 100644 --- a/src/share/ob_locality_info.h +++ b/src/share/ob_locality_info.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace share { struct ObLocalityZone { - public: +public: ObLocalityZone() { reset(); @@ -38,7 +38,7 @@ struct ObLocalityZone { ObLocalityZone& operator=(const ObLocalityZone& item); TO_STRING_KV(K_(tenant_id), K_(region_priority)); - public: +public: uint64_t get_tenant_id() { return tenant_id_; @@ -48,13 +48,13 @@ struct ObLocalityZone { return region_priority_; } - public: +public: uint64_t tenant_id_; uint64_t region_priority_; }; struct ObLocalityRegion { - public: +public: ObLocalityRegion() { reset(); @@ -63,19 +63,19 @@ struct ObLocalityRegion { {} void reset(); - public: +public: typedef common::ObFixedLengthString Zone; typedef common::ObSEArray OneZoneArray; TO_STRING_KV(K_(region), K_(region_priority), K_(zone_array)); - public: +public: common::ObRegion region_; uint64_t region_priority_; OneZoneArray zone_array_; }; struct ObLocalityInfo { - public: +public: ObLocalityInfo() { reset(); @@ -102,12 +102,12 @@ struct ObLocalityInfo { K_(local_merge_status), K_(local_zone_status), K_(locality_region_array), K_(locality_zone_array)); bool is_valid(); - public: +public: typedef common::ObFixedLengthString Zone; typedef common::ObSEArray ObLocalityZoneArray; typedef common::ObSEArray ObLocalityRegionArray; - public: +public: int64_t version_; common::ObRegion local_region_; // local region Zone local_zone_; // local zone diff --git a/src/share/ob_locality_parser.h b/src/share/ob_locality_parser.h index 7e83c542f..140f84df9 100644 --- a/src/share/ob_locality_parser.h +++ b/src/share/ob_locality_parser.h @@ -18,10 +18,10 @@ namespace oceanbase { namespace share { class ObLocalityParser { - public: +public: static int parse_type(const char* str, int64_t len, common::ObReplicaType& type); - private: +private: // full replica static const char* FULL_REPLICA_STR; static const char* F_REPLICA_STR; diff --git a/src/share/ob_locality_priority.h b/src/share/ob_locality_priority.h index b6e0432b0..c33f6f960 100644 --- a/src/share/ob_locality_priority.h +++ b/src/share/ob_locality_priority.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace share { class ObLocalityPriority { - public: +public: static int get_primary_region_prioriry(const char* primary_zone, const common::ObIArray& locality_region_array, common::ObIArray& tenant_region_array); diff --git a/src/share/ob_locality_table_operator.cpp b/src/share/ob_locality_table_operator.cpp index 1e94ece52..9b0a287c0 100644 --- a/src/share/ob_locality_table_operator.cpp +++ b/src/share/ob_locality_table_operator.cpp @@ -30,7 +30,7 @@ using namespace common::sqlclient; namespace share { class LocalityQueryResult { - public: +public: LocalityQueryResult() : svr_ip_(""), svr_port_(0), diff --git a/src/share/ob_locality_table_operator.h b/src/share/ob_locality_table_operator.h index 449034d4e..2d66fbf43 100644 --- a/src/share/ob_locality_table_operator.h +++ b/src/share/ob_locality_table_operator.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace share { class ObLocalityTableOperator { - public: +public: int load_region(const common::ObAddr& addr, const bool& is_self_cluster, common::ObISQLClient& sql_client, ObLocalityInfo& locality_info, ObServerLocalityCache& server_locality_cache); int load_zone(const common::ObAddr& addr, common::ObISQLClient& sql_client, ObLocalityInfo& locality_info); diff --git a/src/share/ob_max_id_fetcher.h b/src/share/ob_max_id_fetcher.h index 894a9690c..7622c1709 100644 --- a/src/share/ob_max_id_fetcher.h +++ b/src/share/ob_max_id_fetcher.h @@ -54,7 +54,7 @@ enum ObMaxIdType { }; class ObMaxIdFetcher { - public: +public: explicit ObMaxIdFetcher(common::ObMySQLProxy& proxy); virtual ~ObMaxIdFetcher(); @@ -67,7 +67,7 @@ class ObMaxIdFetcher { static const char* get_max_id_info(const ObMaxIdType max_id_type); static int str_to_uint(const common::ObString& str, uint64_t& value); - private: +private: static bool valid_max_id_type(const ObMaxIdType max_id_type) { return max_id_type >= 0 && max_id_type < OB_MAX_ID_TYPE; @@ -76,10 +76,10 @@ class ObMaxIdFetcher { int insert_initial_value( common::ObISQLClient& sql_client, uint64_t tenant_id, ObMaxIdType max_id_type, const uint64_t initial_value); - private: +private: static const char* max_id_name_info_[OB_MAX_ID_TYPE][2]; - private: +private: common::ObMySQLProxy& proxy_; DISALLOW_COPY_AND_ASSIGN(ObMaxIdFetcher); diff --git a/src/share/ob_multi_cluster_util.h b/src/share/ob_multi_cluster_util.h index f97ec8a34..d087f41e4 100644 --- a/src/share/ob_multi_cluster_util.h +++ b/src/share/ob_multi_cluster_util.h @@ -28,7 +28,7 @@ namespace share { class ObClusterInfo; class ObMultiClusterUtil { - public: +public: ObMultiClusterUtil() {} virtual ~ObMultiClusterUtil() @@ -78,7 +78,7 @@ struct ObTenantFlashbackSCN { OB_UNIS_VERSION(1); - public: +public: int64_t tenant_id_; int64_t inner_scn_; int64_t user_scn_; diff --git a/src/share/ob_partition_modify.h b/src/share/ob_partition_modify.h index fcd85475b..c29878902 100644 --- a/src/share/ob_partition_modify.h +++ b/src/share/ob_partition_modify.h @@ -32,7 +32,7 @@ enum ObSplitProgress { }; struct ObSplitInfo { - public: +public: PartitionSplitType split_type_; schema::ObPartitionFuncType part_type_; uint64_t table_id_; @@ -59,7 +59,7 @@ struct ObSplitInfo { class ObSplitPartitionPair { OB_UNIS_VERSION(1); - public: +public: ObSplitPartitionPair() : src_pkey_(), dest_pkey_array_() {} ~ObSplitPartitionPair() @@ -93,7 +93,7 @@ class ObSplitPartitionPair { int replace_tenant_id(const uint64_t new_tenant_id); TO_STRING_KV(K_(src_pkey), K_(dest_pkey_array)); - private: +private: // Split source common::ObPartitionKey src_pkey_; // Split destination @@ -103,7 +103,7 @@ class ObSplitPartitionPair { class ObSplitPartition { OB_UNIS_VERSION(1); - public: +public: ObSplitPartition() : split_info_(), schema_version_(0) {} ~ObSplitPartition() @@ -130,7 +130,7 @@ class ObSplitPartition { int replace_tenant_id(const uint64_t new_tenant_id); TO_STRING_KV(K_(split_info), K_(schema_version)); - private: +private: // All copies of information that need to be split; common::ObSArray split_info_; // The bottom layer needs to check that the schema_version is consistent with the schema_verion of the partition; @@ -140,7 +140,7 @@ class ObSplitPartition { class ObPartitionSplitProgress { OB_UNIS_VERSION(1); - public: +public: ObPartitionSplitProgress() : pkey_(), progress_(static_cast(UNKNOWN_SPLIT_PROGRESS)) {} ObPartitionSplitProgress(const common::ObPartitionKey& pkey, const int progress) : pkey_(pkey), progress_(progress) @@ -157,7 +157,7 @@ class ObPartitionSplitProgress { } TO_STRING_KV(K_(pkey), K_(progress)); - private: +private: common::ObPartitionKey pkey_; int progress_; }; diff --git a/src/share/ob_pg_partition_meta_table_operator.h b/src/share/ob_pg_partition_meta_table_operator.h index 296aecba5..0f77035eb 100644 --- a/src/share/ob_pg_partition_meta_table_operator.h +++ b/src/share/ob_pg_partition_meta_table_operator.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace share { struct ObPGPartitionMTUpdateItem { - public: +public: ObPGPartitionMTUpdateItem() { reset(); @@ -53,7 +53,7 @@ struct ObPGPartitionMTUpdateItem { }; class ObPGPartitionMTUpdateOperator { - public: +public: ObPGPartitionMTUpdateOperator() = default; virtual ~ObPGPartitionMTUpdateOperator() = default; static int batch_update(const common::ObIArray& items, common::ObMySQLProxy& proxy); @@ -67,7 +67,7 @@ class ObPGPartitionMTUpdateOperator { static int check_table_checksum( const uint64_t data_table_id, const uint64_t index_id, common::ObMySQLProxy& sql_proxy, bool& is_checksum_valid); - private: +private: static int fill_one_item_(const ObPGPartitionMTUpdateItem& item, share::ObDMLSqlSplicer& dml); static int remove_one_item_(const ObPGPartitionMTUpdateItem& item, common::ObMySQLProxy& sql_proxy); static int get_checksum(const common::ObSqlString& sql, common::ObIArray& items, diff --git a/src/share/ob_primary_zone_util.h b/src/share/ob_primary_zone_util.h index d483db0d0..dd3053211 100644 --- a/src/share/ob_primary_zone_util.h +++ b/src/share/ob_primary_zone_util.h @@ -79,7 +79,7 @@ class ObTableSchema; * the normalized primary zone is "zone1;zone2;zone3;zone4" */ class ObPrimaryZoneUtil { - public: +public: // when invoked by ddl zone_region_list is a valid pointer, // when invoked by schema, zone_region_list is NULL ObPrimaryZoneUtil(const common::ObString& primary_zone, @@ -99,7 +99,7 @@ class ObPrimaryZoneUtil { {} ~ObPrimaryZoneUtil() {} // no one shall derive from this - public: +public: // when invoked by DDL, zones in primary zone string is not confirmed to be a valid zone, // zone_list is an essential input argument to check if all zones in primary zone is valid; int init(const common::ObIArray& zone_list); @@ -108,7 +108,7 @@ class ObPrimaryZoneUtil { // zone_list is not an essential input argument any more. int init(); - public: +public: // check if the zone exists, if so parse it based on the priority int check_and_parse_primary_zone(); // when primary zone is "zone1, zone2; zone3", is is normalized to "zone1,zone2;zone3"; @@ -119,7 +119,7 @@ class ObPrimaryZoneUtil { return full_zone_array_; } - private: +private: struct ZoneRegionScore { ZoneRegionScore() : zone_region_(), zone_score_(INT64_MAX), region_score_(INT64_MAX) {} @@ -159,7 +159,7 @@ class ObPrimaryZoneUtil { }; typedef common::ObSEArray ZoneRegionScoreArray; - private: +private: int get_next_zone_score(int64_t& cursor, const int64_t end, share::schema::ObZoneScore& zone_score); void jump_over_blanks(int64_t& cursor, const int64_t end); int check_zone_exist(const common::ObString& zone, bool& zone_exist); @@ -179,12 +179,12 @@ class ObPrimaryZoneUtil { int update_region_score(); // related to the comments 4.f and 4.g int construct_full_zone_array(); // construct full_zone_array_ - private: +private: static const char BLANK_TOKEN = ' '; static const char COMMA_TOKEN = ','; static const char SEMI_COLON_TOKEN = ';'; static const int64_t ZONE_COUNT = 5; // usually no more than five - private: +private: const common::ObString& primary_zone_; // this is a list indeed common::ObSEArray zone_list_; const common::ObIArray* zone_region_list_; @@ -209,7 +209,7 @@ class ObPrimaryZoneUtil { /* static method */ - public: +public: static bool check_primary_zone_equal( const share::schema::ObPrimaryZone& left, const share::schema::ObPrimaryZone& right); static int check_primary_zone_equal(share::schema::ObSchemaGetterGuard& schema_guard, @@ -225,7 +225,7 @@ class ObPrimaryZoneUtil { return primary_zone_str == common::ObString(common::OB_RANDOM_PRIMARY_ZONE) || primary_zone_str.empty(); } - public: +public: /* this method will get primary zone based on the inheriting rule: * 1 based on the locality, reserve the zone with full replica * for instance:if primary zone = "z1,z2"; locality="F@z1,R@z2"; @@ -240,7 +240,7 @@ class ObPrimaryZoneUtil { static int get_pg_integrated_primary_zone(share::schema::ObSchemaGetterGuard& schema_guard, const share::schema::ObPartitionSchema& partition_schema, common::ObZone& primary_zone); - private: +private: static int generate_integrated_primary_zone_str(const share::schema::ObPrimaryZone& primary_zone, const common::ObIArray& zone_list, const common::ObIArray& zone_locality, common::ObZone& primary_zone_str); @@ -262,7 +262,7 @@ class ObPrimaryZoneUtil { * shall know the implications */ class ObRawPrimaryZoneUtil { - public: +public: struct ZoneScore { ZoneScore() : zone_(), zone_score_(INT64_MAX) { @@ -325,29 +325,29 @@ class ObRawPrimaryZoneUtil { int64_t region_score_; }; - public: +public: ObRawPrimaryZoneUtil(const rootserver::ObZoneManager& zone_mgr) : zone_mgr_(zone_mgr), current_score_(0) {} ~ObRawPrimaryZoneUtil() {} // no one shall derive - public: +public: int build(const common::ObZone& primary, common::ObIArray& zone_score_array, common::ObIArray& region_score_array); - private: +private: int get_next_zone_score(const char* ptr, int64_t& cursor, const int64_t end, ZoneScore& zone_score); void jump_over_blanks(const char* ptr, int64_t& cursor, const int64_t end); - private: +private: static const char BLANK_TOKEN = ' '; static const char COMMA_TOKEN = ','; static const char SEMI_COLON_TOKEN = ';'; - private: +private: const rootserver::ObZoneManager& zone_mgr_; int64_t current_score_; // static member func - public: +public: static int generate_high_priority_zone_array( const common::ObIArray& zone_score_array, common::ObIArray& high_priority_zone_array); }; diff --git a/src/share/ob_priv_common.h b/src/share/ob_priv_common.h index 2070eb370..79e606c07 100644 --- a/src/share/ob_priv_common.h +++ b/src/share/ob_priv_common.h @@ -51,7 +51,7 @@ typedef ObPrivSet ObPackedObjPriv; // used in obj priv in priv schema packed class ObPrivPacker { - public: +public: static int init_packed_array(ObPackedPrivArray& array); static int raw_priv_to_packed_info( @@ -87,7 +87,7 @@ class ObPrivPacker { static int get_total_privs(const ObPackedPrivArray& packed_array, int& n_cnt); - private: +private: static int has_raw_priv(const ObRawPriv raw_priv, const ObPrivSet priv_set, bool& exists, uint64_t& option); static int push_back_raw_priv_array(ObRawPriv raw_priv, bool exists, uint64_t option, ObRawPrivArray& raw_priv_array, @@ -95,7 +95,7 @@ class ObPrivPacker { }; class ObOraPrivCheck { - public: +public: /* check if rawsyspriv exists */ static int raw_sys_priv_exists( const uint64_t option, const ObRawPriv priv, const ObPackedPrivArray& packed_array, bool& exists); diff --git a/src/share/ob_remote_server_provider.h b/src/share/ob_remote_server_provider.h index 39e5648d7..33a73452d 100644 --- a/src/share/ob_remote_server_provider.h +++ b/src/share/ob_remote_server_provider.h @@ -29,7 +29,7 @@ namespace share { // fetch remote server list across cluster class ObRemoteServerProvider : public common::sqlclient::ObMySQLServerProvider { struct ServerAddr { - public: + public: ServerAddr() : server_(), sql_port_(common::OB_INVALID_ID) {} virtual ~ServerAddr() @@ -37,13 +37,13 @@ class ObRemoteServerProvider : public common::sqlclient::ObMySQLServerProvider { void reset(); TO_STRING_KV(K_(server), K_(sql_port)); - public: + public: common::ObAddr server_; int64_t sql_port_; }; typedef common::ObSEArray ServerAddrList; struct ServerInfo { - public: + public: ServerInfo() = delete; ServerInfo(common::ObIAllocator& allocator) : server_list_(common::OB_MALLOC_NORMAL_BLOCK_SIZE, common::ModulePageAllocator(allocator)), @@ -53,20 +53,18 @@ class ObRemoteServerProvider : public common::sqlclient::ObMySQLServerProvider { {} TO_STRING_KV("server_cnt", server_list_.count(), K_(cluster_id)); - public: + public: ServerAddrList server_list_; int64_t cluster_id_; DISALLOW_COPY_AND_ASSIGN(ServerInfo); }; - public: +public: ObRemoteServerProvider(); virtual ~ObRemoteServerProvider(); - int init(obrpc::ObCommonRpcProxy &rpc_proxy, common::ObMySQLProxy &sql_proxy); - virtual int get_cluster_list(common::ObIArray &cluster_list) override; - virtual int get_server(const int64_t cluster_id, - const int64_t svr_idx, - common::ObAddr &server) override; + int init(obrpc::ObCommonRpcProxy& rpc_proxy, common::ObMySQLProxy& sql_proxy); + virtual int get_cluster_list(common::ObIArray& cluster_list) override; + virtual int get_server(const int64_t cluster_id, const int64_t svr_idx, common::ObAddr& server) override; virtual int64_t get_cluster_count() const override; virtual int64_t get_server_count() const override; virtual int64_t get_server_count(const int64_t cluster_id) const override; diff --git a/src/share/ob_remote_sql_proxy.h b/src/share/ob_remote_sql_proxy.h index 4c1e178d9..d29de546b 100644 --- a/src/share/ob_remote_sql_proxy.h +++ b/src/share/ob_remote_sql_proxy.h @@ -21,26 +21,29 @@ namespace oceanbase { namespace share { class ObRemoteSqlProxy : public ObISQLClient { - public: +public: ObRemoteSqlProxy(); ~ObRemoteSqlProxy(); int init(ObRemoteServerProvider* server_provider); int set_login_info(const char* usr_info, const char* passwd); void destroy(); - virtual int escape(const char *from, const int64_t from_size, - char *to, const int64_t to_size, int64_t &out_size) override; - void signal_refresh() {connection_pool_.signal_refresh(); } - virtual int read(ReadResult &res, const uint64_t tenant_id, const char *sql) override; - virtual int read(ReadResult &res, const int64_t cluster_id, const uint64_t tenant_id, const char *sql) override; - virtual int write(const uint64_t tenant_id, const char *sql, int64_t &affected_rows) override; - virtual sqlclient::ObISQLConnectionPool *get_pool() override; + virtual int escape( + const char* from, const int64_t from_size, char* to, const int64_t to_size, int64_t& out_size) override; + void signal_refresh() + { + connection_pool_.signal_refresh(); + } + virtual int read(ReadResult& res, const uint64_t tenant_id, const char* sql) override; + virtual int read(ReadResult& res, const int64_t cluster_id, const uint64_t tenant_id, const char* sql) override; + virtual int write(const uint64_t tenant_id, const char* sql, int64_t& affected_rows) override; + virtual sqlclient::ObISQLConnectionPool* get_pool() override; virtual bool is_oracle_mode() const override { return mysql_proxy_.is_oracle_mode(); } - private: +private: bool inited_; ObMySQLProxy mysql_proxy_; common::sqlclient::ObMySQLConnectionPool connection_pool_; diff --git a/src/share/ob_replica_info.h b/src/share/ob_replica_info.h index 1ade6a398..ec2c2333c 100644 --- a/src/share/ob_replica_info.h +++ b/src/share/ob_replica_info.h @@ -66,13 +66,13 @@ struct ReplicaAttr { }; class BaseReplicaAttrSet { - public: +public: BaseReplicaAttrSet() {} virtual ~BaseReplicaAttrSet() {} - public: +public: virtual const common::ObIArray& get_full_replica_attr_array() const = 0; virtual const common::ObIArray& get_logonly_replica_attr_array() const = 0; virtual const common::ObIArray& get_readonly_replica_attr_array() const = 0; @@ -94,7 +94,7 @@ typedef common::ObArrayHelper SchemaReplicaAttrArray; typedef common::ObSEArray ReplicaAttrArray; class SchemaReplicaAttrSet : public BaseReplicaAttrSet { - public: +public: SchemaReplicaAttrSet() : BaseReplicaAttrSet(), full_replica_attr_array_(), logonly_replica_attr_array_(), readonly_replica_attr_array_() {} @@ -102,7 +102,7 @@ class SchemaReplicaAttrSet : public BaseReplicaAttrSet { {} int64_t get_convert_size() const; - public: +public: virtual const common::ObIArray& get_full_replica_attr_array() const override { return full_replica_attr_array_; @@ -128,7 +128,7 @@ class SchemaReplicaAttrSet : public BaseReplicaAttrSet { return readonly_replica_attr_array_; } - public: +public: void reset() { full_replica_attr_array_.reset(); @@ -136,14 +136,14 @@ class SchemaReplicaAttrSet : public BaseReplicaAttrSet { readonly_replica_attr_array_.reset(); } - private: +private: SchemaReplicaAttrArray full_replica_attr_array_; SchemaReplicaAttrArray logonly_replica_attr_array_; SchemaReplicaAttrArray readonly_replica_attr_array_; }; class ObReplicaAttrSet : public BaseReplicaAttrSet { - public: +public: ObReplicaAttrSet() : BaseReplicaAttrSet(), full_replica_attr_array_(), logonly_replica_attr_array_(), readonly_replica_attr_array_() {} @@ -237,7 +237,7 @@ class ObReplicaAttrSet : public BaseReplicaAttrSet { bool is_allserver_readonly_replica() const; bool is_specific_replica_attr() const; - private: +private: ReplicaAttrArray full_replica_attr_array_; ReplicaAttrArray logonly_replica_attr_array_; ReplicaAttrArray readonly_replica_attr_array_; diff --git a/src/share/ob_replica_wrs_info.h b/src/share/ob_replica_wrs_info.h index eef29c248..f7cd47448 100644 --- a/src/share/ob_replica_wrs_info.h +++ b/src/share/ob_replica_wrs_info.h @@ -23,14 +23,14 @@ namespace share { struct ObReplicaWrsInfo { OB_UNIS_VERSION(1); - public: +public: ObReplicaWrsInfo(); ObReplicaWrsInfo(const common::ObPartitionKey& pkey, const int64_t wrs, const int32_t pstate, const int32_t replica_type, const int32_t replica_status); TO_STRING_KV(K_(pkey), K_(weak_read_timestamp), K_(part_state), K_(replica_type), K_(replica_status)); - public: +public: common::ObPartitionKey pkey_; int64_t weak_read_timestamp_; diff --git a/src/share/ob_root_addr_agent.h b/src/share/ob_root_addr_agent.h index 2ac1002df..1e15ddfba 100644 --- a/src/share/ob_root_addr_agent.h +++ b/src/share/ob_root_addr_agent.h @@ -29,7 +29,7 @@ typedef common::ObIArray ObIAddrList; // store and fetch root server address list interface. class ObRootAddrAgent { - public: +public: ObRootAddrAgent() : inited_(false), config_(NULL) {} virtual ~ObRootAddrAgent() @@ -45,11 +45,11 @@ class ObRootAddrAgent { virtual int fetch_remote_rslist(const int64_t cluster_id, ObIAddrList& addr_list, ObIAddrList& readonly_addr_list, common::ObClusterType& cluster_type) = 0; - protected: +protected: bool inited_; common::ObServerConfig* config_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRootAddrAgent); }; diff --git a/src/share/ob_rpc_struct.h b/src/share/ob_rpc_struct.h index 99e1f1a49..29655770e 100644 --- a/src/share/ob_rpc_struct.h +++ b/src/share/ob_rpc_struct.h @@ -97,7 +97,7 @@ enum ObDefaultRoleFlag { struct Bool { OB_UNIS_VERSION(1); - public: +public: Bool(bool v = false) : v_(v) {} @@ -111,14 +111,14 @@ struct Bool { } DEFINE_TO_STRING(BUF_PRINTO(v_)); - private: +private: bool v_; }; struct Int64 { OB_UNIS_VERSION(1); - public: +public: Int64(int64_t v = common::OB_INVALID_ID) : v_(v) {} @@ -137,14 +137,14 @@ struct Int64 { } DEFINE_TO_STRING(BUF_PRINTO(v_)); - private: +private: int64_t v_; }; struct UInt64 { OB_UNIS_VERSION(1); - public: +public: UInt64(uint64_t v = common::OB_INVALID_ID) : v_(v) {} @@ -158,14 +158,14 @@ struct UInt64 { } DEFINE_TO_STRING(BUF_PRINTO(v_)); - private: +private: uint64_t v_; }; struct ObGetRootserverRoleResult { OB_UNIS_VERSION(1); - public: +public: ObGetRootserverRoleResult() : role_(0), zone_(), type_(common::REPLICA_TYPE_MAX), status_(share::status::MAX), replica_(), partition_info_() {} @@ -183,7 +183,7 @@ struct ObGetRootserverRoleResult { struct ObServerInfo { OB_UNIS_VERSION(1); - public: +public: common::ObZone zone_; common::ObAddr server_; common::ObRegion region_; @@ -200,7 +200,7 @@ struct ObServerInfo { struct ObPartitionId { OB_UNIS_VERSION(1); - public: +public: int64_t table_id_; int64_t partition_id_; @@ -213,7 +213,7 @@ struct ObPartitionId { struct ObPartitionStat { OB_UNIS_VERSION(1); - public: +public: enum PartitionStat { RECOVERING = 0, WRITABLE = 1, @@ -239,7 +239,7 @@ typedef common::ObArray ObPartitionServerList; struct ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDDLArg() : ddl_stmt_str_(), exec_tenant_id_(common::OB_INVALID_TENANT_ID), @@ -278,7 +278,7 @@ struct ObDDLArg { struct ObCreateResourceUnitArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateResourceUnitArg() : ObDDLArg(), min_cpu_(0), @@ -316,7 +316,7 @@ struct ObCreateResourceUnitArg : public ObDDLArg { struct ObAlterResourceUnitArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObAlterResourceUnitArg() : ObDDLArg(), min_cpu_(0), @@ -352,7 +352,7 @@ struct ObAlterResourceUnitArg : public ObDDLArg { struct ObDropResourceUnitArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropResourceUnitArg() : ObDDLArg(), if_exist_(false) {} virtual ~ObDropResourceUnitArg() @@ -372,7 +372,7 @@ struct ObDropResourceUnitArg : public ObDDLArg { struct ObCreateResourcePoolArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateResourcePoolArg() : ObDDLArg(), unit_num_(0), if_not_exist_(0), replica_type_(common::REPLICA_TYPE_FULL), is_tenant_sys_pool_(false) {} @@ -398,7 +398,7 @@ struct ObCreateResourcePoolArg : public ObDDLArg { struct ObSplitResourcePoolArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObSplitResourcePoolArg() : ObDDLArg(), pool_name_(), zone_list_(), split_pool_list_() {} virtual ~ObSplitResourcePoolArg() @@ -419,7 +419,7 @@ struct ObSplitResourcePoolArg : public ObDDLArg { struct ObMergeResourcePoolArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObMergeResourcePoolArg() : ObDDLArg(), old_pool_list_(), // Before the merger @@ -440,7 +440,7 @@ struct ObMergeResourcePoolArg : public ObDDLArg { struct ObAlterResourcePoolArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObAlterResourcePoolArg() : ObDDLArg(), pool_name_(), unit_(), unit_num_(0), zone_list_(), delete_unit_id_array_() {} virtual ~ObAlterResourcePoolArg() @@ -463,7 +463,7 @@ struct ObAlterResourcePoolArg : public ObDDLArg { struct ObDropResourcePoolArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropResourcePoolArg() : ObDDLArg(), if_exist_(false) {} virtual ~ObDropResourcePoolArg() @@ -483,7 +483,7 @@ struct ObDropResourcePoolArg : public ObDDLArg { struct ObCmdArg { OB_UNIS_VERSION(1); - public: +public: common::ObString& get_sql_stmt() { return sql_text_; @@ -493,14 +493,14 @@ struct ObCmdArg { return sql_text_; } - public: +public: common::ObString sql_text_; }; struct ObSysVarIdValue { OB_UNIS_VERSION(1); - public: +public: ObSysVarIdValue() : sys_id_(share::SYS_VAR_INVALID), value_() {} ObSysVarIdValue(share::ObSysVarClassType sys_id, common::ObString& value) : sys_id_(sys_id), value_(value) @@ -517,7 +517,7 @@ struct ObSysVarIdValue { struct ObCreateTenantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateTenantArg() : ObDDLArg(), tenant_schema_(), @@ -546,7 +546,7 @@ struct ObCreateTenantArg : public ObDDLArg { struct ObCreateTenantEndArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateTenantEndArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_TENANT_ID) {} virtual ~ObCreateTenantEndArg() @@ -565,7 +565,7 @@ struct ObCreateTenantEndArg : public ObDDLArg { struct ObModifyTenantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: enum ModifiableOptions { REPLICA_NUM = 1, CHARSET_TYPE, @@ -605,7 +605,7 @@ struct ObModifyTenantArg : public ObDDLArg { struct ObLockTenantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObLockTenantArg() : ObDDLArg(), is_locked_(false) {} bool is_valid() const; @@ -618,7 +618,7 @@ struct ObLockTenantArg : public ObDDLArg { struct ObDropTenantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropTenantArg() : ObDDLArg(), if_exist_(false), @@ -664,7 +664,7 @@ struct ObDropTenantArg : public ObDDLArg { struct ObSequenceDDLArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObSequenceDDLArg() : ObDDLArg(), stmt_type_(common::OB_INVALID_ID), option_bitset_(), seq_schema_(), database_name_() {} bool is_valid() const @@ -721,7 +721,7 @@ struct ObSequenceDDLArg : public ObDDLArg { } TO_STRING_KV(K_(stmt_type), K_(seq_schema), K_(database_name)); - public: +public: int64_t stmt_type_; common::ObBitSet<> option_bitset_; share::schema::ObSequenceSchema seq_schema_; @@ -731,7 +731,7 @@ struct ObSequenceDDLArg : public ObDDLArg { struct ObAddSysVarArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObAddSysVarArg() : sysvar_(), if_not_exist_(false) {} DECLARE_TO_STRING; @@ -747,7 +747,7 @@ struct ObAddSysVarArg : public ObDDLArg { struct ObModifySysVarArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObModifySysVarArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), is_inner_(false) {} DECLARE_TO_STRING; @@ -769,7 +769,7 @@ struct ObModifySysVarArg : public ObDDLArg { struct ObCreateDatabaseArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateDatabaseArg() : ObDDLArg(), if_not_exist_(false) {} bool is_valid() const; @@ -788,7 +788,7 @@ struct ObCreateDatabaseArg : public ObDDLArg { struct ObAlterDatabaseArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: enum ModifiableOptions { REPLICA_NUM = 1, CHARSET_TYPE, @@ -799,7 +799,7 @@ struct ObAlterDatabaseArg : public ObDDLArg { MAX_OPTION }; - public: +public: ObAlterDatabaseArg() : ObDDLArg() {} bool is_valid() const; @@ -821,7 +821,7 @@ struct ObAlterDatabaseArg : public ObDDLArg { struct ObDropDatabaseArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropDatabaseArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), if_exist_(false), to_recyclebin_(false) {} bool is_valid() const; @@ -840,7 +840,7 @@ struct ObDropDatabaseArg : public ObDDLArg { struct ObCreateTablegroupArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateTablegroupArg() : ObDDLArg(), if_not_exist_(false), create_mode_(obrpc::OB_CREATE_TABLE_MODE_STRICT) {} bool is_valid() const; @@ -858,7 +858,7 @@ struct ObCreateTablegroupArg : public ObDDLArg { struct ObDropTablegroupArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropTablegroupArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), if_exist_(false) {} bool is_valid() const; @@ -877,7 +877,7 @@ struct ObTableItem; struct ObAlterTablegroupArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObAlterTablegroupArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -916,7 +916,7 @@ struct ObAlterTablegroupArg : public ObDDLArg { struct ObReachPartitionLimitArg { OB_UNIS_VERSION(1); - public: +public: ObReachPartitionLimitArg() : batch_cnt_(0), tenant_id_(common::OB_INVALID_ID), is_pg_arg_(false) {} @@ -930,7 +930,7 @@ struct ObReachPartitionLimitArg { bool is_valid() const; TO_STRING_KV(K_(batch_cnt), K_(tenant_id), K_(is_pg_arg)); - public: +public: int64_t batch_cnt_; uint64_t tenant_id_; bool is_pg_arg_; @@ -939,7 +939,7 @@ struct ObReachPartitionLimitArg { struct ObCheckFrozenVersionArg { OB_UNIS_VERSION(1); - public: +public: ObCheckFrozenVersionArg() : frozen_version_(0) {} @@ -952,14 +952,14 @@ struct ObCheckFrozenVersionArg { } TO_STRING_KV(K_(frozen_version)); - public: +public: int64_t frozen_version_; }; struct ObGetMinSSTableSchemaVersionArg { OB_UNIS_VERSION(1); - public: +public: ObGetMinSSTableSchemaVersionArg() { tenant_id_arg_list_.reuse(); @@ -976,7 +976,7 @@ struct ObGetMinSSTableSchemaVersionArg { } TO_STRING_KV(K_(tenant_id_arg_list)); - public: +public: common::ObSArray tenant_id_arg_list_; }; @@ -985,7 +985,7 @@ struct ObCreateForeignKeyArg; // Forward declaration struct ObCreateTableArg : ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateTableArg() : ObDDLArg(), if_not_exist_(false), @@ -1014,7 +1014,7 @@ struct ObCreateTableArg : ObDDLArg { struct ObCreateTableLikeArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateTableLikeArg() : ObDDLArg(), if_not_exist_(false), @@ -1044,7 +1044,7 @@ struct ObCreateTableLikeArg : public ObDDLArg { struct ObCreateSynonymArg : ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateSynonymArg() : or_replace_(false), synonym_info_(), db_name_() {} TO_STRING_KV(K_(synonym_info), K_(db_name), K_(obj_db_name)); @@ -1057,7 +1057,7 @@ struct ObCreateSynonymArg : ObDDLArg { struct ObDropSynonymArg : ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropSynonymArg() : tenant_id_(common::OB_INVALID_ID), is_force_(false), db_name_(), synonym_name_() {} virtual ~ObDropSynonymArg() @@ -1078,7 +1078,7 @@ struct ObDropSynonymArg : ObDDLArg { struct ObAlterPlanBaselineArg : ObDDLArg { OB_UNIS_VERSION(1); - public: +public: enum FieldUpdated { FIXED = 0x1, ENABLED = 0x02, @@ -1098,7 +1098,7 @@ struct ObAlterPlanBaselineArg : ObDDLArg { struct ObCreatePlanBaselineArg : ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreatePlanBaselineArg() : plan_baseline_info_(), is_replace_(false) {} TO_STRING_KV(K_(plan_baseline_info), K(is_replace_)); @@ -1109,7 +1109,7 @@ struct ObCreatePlanBaselineArg : ObDDLArg { struct ObDropPlanBaselineArg : ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropPlanBaselineArg() : tenant_id_(common::OB_INVALID_ID), sql_id_(), @@ -1136,7 +1136,7 @@ struct ObDropPlanBaselineArg : ObDDLArg { struct ObIndexArg : public ObDDLArg { OB_UNIS_VERSION_V(1); - public: +public: enum IndexActionType { INVALID_ACTION = 1, ADD_INDEX, @@ -1196,7 +1196,7 @@ struct ObIndexArg : public ObDDLArg { struct ObUpdateStatCacheArg : public ObDDLArg { OB_UNIS_VERSION_V(1); - public: +public: ObUpdateStatCacheArg() : tenant_id_(common::OB_INVALID_ID), table_id_(common::OB_INVALID_ID), partition_ids_(), column_ids_() {} @@ -1238,7 +1238,7 @@ struct ObUpdateStatCacheArg : public ObDDLArg { struct ObDropIndexArg : public ObIndexArg { OB_UNIS_VERSION(1); // if add new member,should add to_string and serialize function - public: +public: ObDropIndexArg() { index_action_type_ = DROP_INDEX; @@ -1269,7 +1269,7 @@ struct ObDropIndexArg : public ObIndexArg { struct ObRebuildIndexArg : public ObIndexArg { OB_UNIS_VERSION(1); // if add new member,should add to_string and serialize function - public: +public: ObRebuildIndexArg() : ObIndexArg() { create_mode_ = OB_CREATE_TABLE_MODE_STRICT; @@ -1309,7 +1309,7 @@ struct ObRebuildIndexArg : public ObIndexArg { struct ObAlterIndexParallelArg : public ObIndexArg { OB_UNIS_VERSION_V(1); - public: +public: ObAlterIndexParallelArg() : ObIndexArg(), new_parallel_(common::OB_DEFAULT_TABLE_DOP) { index_action_type_ = ALTER_INDEX_PARALLEL; @@ -1336,7 +1336,7 @@ struct ObAlterIndexParallelArg : public ObIndexArg { struct ObRenameIndexArg : public ObIndexArg { OB_UNIS_VERSION_V(1); - public: +public: ObRenameIndexArg() : ObIndexArg(), origin_index_name_(), new_index_name_() { index_action_type_ = RENAME_INDEX; @@ -1360,7 +1360,7 @@ struct ObRenameIndexArg : public ObIndexArg { struct ObAlterIndexArg : public ObIndexArg { OB_UNIS_VERSION_V(1); - public: +public: ObAlterIndexArg() : ObIndexArg(), index_visibility_(common::OB_DEFAULT_INDEX_VISIBILITY) { index_action_type_ = ALTER_INDEX; @@ -1382,7 +1382,7 @@ struct ObAlterIndexArg : public ObIndexArg { struct ObTruncateTableArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObTruncateTableArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -1406,7 +1406,7 @@ struct ObTruncateTableArg : public ObDDLArg { struct ObRenameTableItem { OB_UNIS_VERSION(1); - public: +public: ObRenameTableItem() : origin_db_name_(), new_db_name_(), @@ -1427,7 +1427,7 @@ struct ObRenameTableItem { struct ObRenameTableArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObRenameTableArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), rename_table_items_() {} bool is_valid() const; @@ -1440,7 +1440,7 @@ struct ObRenameTableArg : public ObDDLArg { struct ObAlterTableArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: enum ModifiableTableColumns { AUTO_INCREMENT = 1, BLOCK_SIZE, @@ -1575,7 +1575,7 @@ struct ObAlterTableArg : public ObDDLArg { struct ObTableItem { OB_UNIS_VERSION(1); - public: +public: ObTableItem() : mode_(common::OB_NAME_CASE_INVALID), // for compare database_name_(), @@ -1609,7 +1609,7 @@ inline uint64_t ObTableItem::hash(uint64_t seed) const struct ObDropTableArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropTableArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -1639,7 +1639,7 @@ struct ObDropTableArg : public ObDDLArg { struct ObOptimizeTableArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObOptimizeTableArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), tables_() {} DECLARE_TO_STRING; @@ -1651,7 +1651,7 @@ struct ObOptimizeTableArg : public ObDDLArg { struct ObOptimizeTenantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObOptimizeTenantArg() : ObDDLArg(), tenant_name_() {} bool is_valid() const; @@ -1663,7 +1663,7 @@ struct ObOptimizeTenantArg : public ObDDLArg { struct ObOptimizeAllArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObOptimizeAllArg() : ObDDLArg() {} bool is_valid() const @@ -1676,7 +1676,7 @@ struct ObOptimizeAllArg : public ObDDLArg { struct ObColumnSortItem { OB_UNIS_VERSION(1); - public: +public: ObColumnSortItem() : column_name_(), prefix_len_(0), @@ -1709,7 +1709,7 @@ struct ObColumnSortItem { struct ObTableOption { OB_UNIS_VERSION_V(1); - public: +public: ObTableOption() : block_size_(-1), replica_num_(0), @@ -1761,7 +1761,7 @@ struct ObTableOption { struct ObIndexOption : public ObTableOption { OB_UNIS_VERSION(1); - public: +public: ObIndexOption() : ObTableOption(), parser_name_(common::OB_DEFAULT_FULLTEXT_PARSER_NAME), @@ -1783,7 +1783,7 @@ struct ObIndexOption : public ObTableOption { struct ObCreateIndexArg : public ObIndexArg { OB_UNIS_VERSION_V(1); - public: +public: ObCreateIndexArg() : index_type_(share::schema::INDEX_TYPE_IS_NOT), index_columns_(), @@ -1879,7 +1879,7 @@ struct ObCreateIndexArg : public ObIndexArg { struct ObCreateForeignKeyArg : public ObIndexArg { OB_UNIS_VERSION_V(1); - public: +public: ObCreateForeignKeyArg() : ObIndexArg(), parent_database_(), @@ -1925,7 +1925,7 @@ struct ObCreateForeignKeyArg : public ObIndexArg { bool is_valid() const; DECLARE_VIRTUAL_TO_STRING; - public: +public: common::ObString parent_database_; common::ObString parent_table_; common::ObSEArray child_columns_; @@ -1947,7 +1947,7 @@ struct ObCreateForeignKeyArg : public ObIndexArg { struct ObDropForeignKeyArg : public ObIndexArg { OB_UNIS_VERSION_V(1); - public: +public: ObDropForeignKeyArg() : ObIndexArg(), foreign_key_name_() { index_action_type_ = DROP_FOREIGN_KEY; @@ -1963,14 +1963,14 @@ struct ObDropForeignKeyArg : public ObIndexArg { bool is_valid() const; DECLARE_VIRTUAL_TO_STRING; - public: +public: common::ObString foreign_key_name_; }; struct ObFlashBackTableFromRecyclebinArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObFlashBackTableFromRecyclebinArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -1995,7 +1995,7 @@ struct ObFlashBackTableFromRecyclebinArg : public ObDDLArg { struct ObFlashBackTableToScnArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObFlashBackTableToScnArg() : tenant_id_(common::OB_INVALID_ID), time_point_(-1), tables_(), query_end_time_(-1) {} bool is_valid() const; @@ -2011,7 +2011,7 @@ struct ObFlashBackTableToScnArg : public ObDDLArg { struct ObFlashBackIndexArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObFlashBackIndexArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -2033,7 +2033,7 @@ struct ObFlashBackIndexArg : public ObDDLArg { struct ObFlashBackDatabaseArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObFlashBackDatabaseArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), origin_db_name_(), new_db_name_() {} bool is_valid() const; @@ -2047,7 +2047,7 @@ struct ObFlashBackDatabaseArg : public ObDDLArg { struct ObFlashBackTenantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObFlashBackTenantArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), origin_tenant_name_(), new_tenant_name_() {} bool is_valid() const; @@ -2061,7 +2061,7 @@ struct ObFlashBackTenantArg : public ObDDLArg { struct ObPurgeTableArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObPurgeTableArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), table_name_() {} bool is_valid() const; @@ -2077,7 +2077,7 @@ struct ObPurgeTableArg : public ObDDLArg { struct ObPurgeIndexArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObPurgeIndexArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), table_name_(), table_id_(common::OB_INVALID_ID) {} bool is_valid() const; @@ -2095,7 +2095,7 @@ struct ObPurgeIndexArg : public ObDDLArg { struct ObPurgeDatabaseArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObPurgeDatabaseArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), db_name_() {} bool is_valid() const; @@ -2111,7 +2111,7 @@ struct ObPurgeDatabaseArg : public ObDDLArg { struct ObPurgeTenantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObPurgeTenantArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), tenant_name_() {} bool is_valid() const; @@ -2127,7 +2127,7 @@ struct ObPurgeTenantArg : public ObDDLArg { struct ObPurgeRecycleBinArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: static const int DEFAULT_PURGE_EACH_TIME = 10; ObPurgeRecycleBinArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), purge_num_(0), expire_time_(0), auto_purge_(false) @@ -2161,7 +2161,7 @@ struct ObPurgeRecycleBinArg : public ObDDLArg { struct ObCreatePartitionArg { OB_UNIS_VERSION(1); - public: +public: ObCreatePartitionArg() { reset(); @@ -2230,14 +2230,14 @@ struct ObCreatePartitionArg { share::ObSplitPartition split_info_; // It makes sense when dismantling tables and splitting to build partiton bool ignore_member_list_; // Used to mark whether the partition needs to be created repeatedly, currently only used // in the creation of replicas synchronized from the standby database - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreatePartitionArg); }; struct ObCreatePartitionStorageArg { OB_UNIS_VERSION(1); - public: +public: ObCreatePartitionStorageArg() { reset(); @@ -2261,7 +2261,7 @@ struct ObCreatePartitionStorageArg { struct ObCreatePartitionBatchArg { OB_UNIS_VERSION(1); - public: +public: ObCreatePartitionBatchArg() { reset(); @@ -2280,14 +2280,14 @@ struct ObCreatePartitionBatchArg { common::ObSArray args_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreatePartitionBatchArg); }; struct ObSetMemberListArg { OB_UNIS_VERSION(1); - public: +public: ObSetMemberListArg() : key_(), member_list_(), quorum_(0), lease_start_(0), leader_() {} ~ObSetMemberListArg() @@ -2305,14 +2305,14 @@ struct ObSetMemberListArg { int64_t lease_start_; common::ObAddr leader_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetMemberListArg); }; struct ObSetMemberListBatchArg { OB_UNIS_VERSION(1); - public: +public: ObSetMemberListBatchArg() { reset(); @@ -2335,14 +2335,14 @@ struct ObSetMemberListBatchArg { common::ObSArray args_; int64_t timestamp_; // Used to verify asynchronous rpc return packets - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetMemberListBatchArg); }; struct ObCreatePartitionBatchRes { OB_UNIS_VERSION(1); - public: +public: ObCreatePartitionBatchRes() : ret_list_(), timestamp_(common::OB_INVALID_TIMESTAMP) {} ~ObCreatePartitionBatchRes() @@ -2356,14 +2356,14 @@ struct ObCreatePartitionBatchRes { common::ObSArray ret_list_; int64_t timestamp_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreatePartitionBatchRes); }; struct ObGetMinSSTableSchemaVersionRes { OB_UNIS_VERSION(1); - public: +public: ObGetMinSSTableSchemaVersionRes() : ret_list_() {} ~ObGetMinSSTableSchemaVersionRes() @@ -2383,14 +2383,14 @@ struct ObGetMinSSTableSchemaVersionRes { // response includes all rets common::ObSArray ret_list_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGetMinSSTableSchemaVersionRes); }; struct ObCheckUniqueIndexRequestArg { OB_UNIS_VERSION(1); - public: +public: ObCheckUniqueIndexRequestArg() { reset(); @@ -2400,19 +2400,19 @@ struct ObCheckUniqueIndexRequestArg { void reset(); TO_STRING_KV(K_(pkey), K_(index_id), K_(schema_version)); - public: +public: common::ObPartitionKey pkey_; uint64_t index_id_; int64_t schema_version_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCheckUniqueIndexRequestArg); }; struct ObCheckUniqueIndexResponseArg { OB_UNIS_VERSION(1); - public: +public: ObCheckUniqueIndexResponseArg() { reset(); @@ -2422,20 +2422,20 @@ struct ObCheckUniqueIndexResponseArg { void reset(); TO_STRING_KV(K_(pkey), K_(index_id), K_(ret_code), K_(is_valid)); - public: +public: common::ObPartitionKey pkey_; uint64_t index_id_; int ret_code_; bool is_valid_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCheckUniqueIndexResponseArg); }; struct ObCalcColumnChecksumRequestArg { OB_UNIS_VERSION(1); - public: +public: ObCalcColumnChecksumRequestArg() { reset(); @@ -2445,21 +2445,21 @@ struct ObCalcColumnChecksumRequestArg { void reset(); TO_STRING_KV(K_(pkey), K_(index_id), K_(schema_version), K_(execution_id), K_(snapshot_version)); - public: +public: common::ObPartitionKey pkey_; uint64_t index_id_; int64_t schema_version_; uint64_t execution_id_; int64_t snapshot_version_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCalcColumnChecksumRequestArg); }; struct ObCalcColumnChecksumResponseArg { OB_UNIS_VERSION(1); - public: +public: ObCalcColumnChecksumResponseArg() { reset(); @@ -2469,19 +2469,19 @@ struct ObCalcColumnChecksumResponseArg { void reset(); TO_STRING_KV(K_(pkey), K_(index_id), K_(ret_code)); - public: +public: common::ObPartitionKey pkey_; uint64_t index_id_; int ret_code_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCalcColumnChecksumResponseArg); }; struct ObCheckSingleReplicaMajorSSTableExistArg { OB_UNIS_VERSION(1); - public: +public: ObCheckSingleReplicaMajorSSTableExistArg() { reset(); @@ -2493,14 +2493,14 @@ struct ObCheckSingleReplicaMajorSSTableExistArg { common::ObPartitionKey pkey_; uint64_t index_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCheckSingleReplicaMajorSSTableExistArg); }; struct ObCheckSingleReplicaMajorSSTableExistResult { OB_UNIS_VERSION(1); - public: +public: ObCheckSingleReplicaMajorSSTableExistResult() { reset(); @@ -2514,7 +2514,7 @@ struct ObCheckSingleReplicaMajorSSTableExistResult { struct ObCheckAllReplicaMajorSSTableExistArg { OB_UNIS_VERSION(1); - public: +public: ObCheckAllReplicaMajorSSTableExistArg() { reset(); @@ -2526,14 +2526,14 @@ struct ObCheckAllReplicaMajorSSTableExistArg { common::ObPartitionKey pkey_; uint64_t index_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCheckAllReplicaMajorSSTableExistArg); }; struct ObCheckAllReplicaMajorSSTableExistResult { OB_UNIS_VERSION(1); - public: +public: ObCheckAllReplicaMajorSSTableExistResult() { reset(); @@ -2548,7 +2548,7 @@ struct ObCheckAllReplicaMajorSSTableExistResult { struct ObMigrateArg { OB_UNIS_VERSION(1); - public: +public: ObMigrateArg() : keep_src_(false) {} bool is_valid() const @@ -2568,7 +2568,7 @@ struct ObMigrateArg { struct ObCopySSTableArg { OB_UNIS_VERSION(1); - public: +public: ObCopySSTableArg() : key_(), src_(), @@ -2608,7 +2608,7 @@ struct ObCopySSTableArg { struct ObCopySSTableRes { OB_UNIS_VERSION(1); - public: +public: ObCopySSTableRes() : key_(), src_(), @@ -2638,7 +2638,7 @@ struct ObCopySSTableRes { struct ObAddReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObAddReplicaArg() : key_(), src_(), @@ -2682,7 +2682,7 @@ struct ObAddReplicaArg { struct ObAddReplicaRes { OB_UNIS_VERSION(2); - public: +public: ObAddReplicaRes() : key_(), src_(), dst_(), data_src_(), quorum_(0), result_(0) {} bool is_valid() const @@ -2702,7 +2702,7 @@ struct ObAddReplicaRes { struct ObRebuildReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObRebuildReplicaArg() : key_(), src_(), @@ -2737,7 +2737,7 @@ struct ObRebuildReplicaArg { struct ObRebuildReplicaRes { OB_UNIS_VERSION(1); - public: +public: ObRebuildReplicaRes() : key_(), src_(), dst_(), data_src_(), result_(0) {} bool is_valid() const @@ -2757,7 +2757,7 @@ struct ObRebuildReplicaRes { struct ObRemoveNonPaxosReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObRemoveNonPaxosReplicaArg() : key_(), dst_(), task_id_(), skip_change_member_list_(false), switch_epoch_(common::OB_INVALID_VERSION) {} @@ -2781,14 +2781,14 @@ struct ObRemoveNonPaxosReplicaArg { }; struct ObRemoveNonPaxosReplicaBatchResult { - public: +public: ObRemoveNonPaxosReplicaBatchResult() : return_array_() {} - public: +public: TO_STRING_KV(K_(return_array)); - public: +public: common::ObSArray return_array_; OB_UNIS_VERSION(3); @@ -2797,7 +2797,7 @@ struct ObRemoveNonPaxosReplicaBatchResult { struct ObRestoreReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObRestoreReplicaArg() : key_(), src_(), @@ -2831,7 +2831,7 @@ struct ObRestoreReplicaArg { struct ObRestoreReplicaRes { OB_UNIS_VERSION(1); - public: +public: ObRestoreReplicaRes() : key_(), src_(), dst_(), result_(0) {} bool is_valid() const @@ -2850,7 +2850,7 @@ struct ObRestoreReplicaRes { struct ObPhyRestoreReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObPhyRestoreReplicaArg(); bool is_valid() const; TO_STRING_KV(K_(key), K_(src), K_(dst), K_(task_id), K_(priority)); @@ -2865,7 +2865,7 @@ struct ObPhyRestoreReplicaArg { struct ObPhyRestoreReplicaRes { OB_UNIS_VERSION(1); - public: +public: ObPhyRestoreReplicaRes(); bool is_valid() const; @@ -2880,7 +2880,7 @@ struct ObPhyRestoreReplicaRes { struct ObMigrateReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObMigrateReplicaArg() : key_(), src_(), @@ -2923,7 +2923,7 @@ struct ObMigrateReplicaArg { struct ObMigrateReplicaRes { OB_UNIS_VERSION(2); - public: +public: ObMigrateReplicaRes() : key_(), src_(), dst_(), data_src_(), result_(0) {} bool is_valid() const @@ -2942,7 +2942,7 @@ struct ObMigrateReplicaRes { struct ObChangeReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObChangeReplicaArg() : key_(), src_(), @@ -2971,7 +2971,7 @@ struct ObChangeReplicaArg { struct ObChangeReplicaRes { OB_UNIS_VERSION(1); - public: +public: ObChangeReplicaRes() : key_(), src_(), dst_(), data_src_(), quorum_(0), result_(0) {} bool is_valid() const @@ -2992,7 +2992,7 @@ struct ObChangeReplicaRes { struct ObBackupArg { OB_UNIS_VERSION(1); - public: +public: ObBackupArg() : key_(), src_(), @@ -3029,7 +3029,7 @@ struct ObBackupArg { struct ObValidateArg { OB_UNIS_VERSION(1); - public: +public: ObValidateArg() : trace_id_(), dst_(), physical_validate_arg_(), priority_(common::ObReplicaOpPriority::PRIO_LOW) {} int assign(const ObValidateArg& arg); @@ -3048,7 +3048,7 @@ struct ObValidateArg { struct ObStandbyCutDataTaskArg { OB_UNIS_VERSION(1); - public: +public: ObStandbyCutDataTaskArg() : dst_(), pkey_() {} bool is_valid() const @@ -3063,7 +3063,7 @@ struct ObStandbyCutDataTaskArg { struct ObBackupRes { OB_UNIS_VERSION(1); - public: +public: ObBackupRes() : key_(), src_(), dst_(), data_src_(), physical_backup_arg_(), result_(0) {} bool is_valid() const @@ -3084,7 +3084,7 @@ struct ObBackupRes { struct ObValidateRes { OB_UNIS_VERSION(1); - public: +public: ObValidateRes() : key_(), dst_(), validate_arg_(), result_(0) {} int assign(const ObValidateRes& res); @@ -3105,45 +3105,45 @@ struct ObValidateRes { struct ObAddReplicaBatchRes { OB_UNIS_VERSION(2); - public: +public: ObAddReplicaBatchRes() : res_array_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(res_array)); - public: +public: common::ObSArray res_array_; }; struct ObRebuildReplicaBatchRes { OB_UNIS_VERSION(1); - public: +public: ObRebuildReplicaBatchRes() : res_array_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(res_array)); - public: +public: common::ObSArray res_array_; }; struct ObCopySSTableBatchRes { OB_UNIS_VERSION(1); - public: +public: ObCopySSTableBatchRes() : res_array_(), type_(common::OB_COPY_SSTABLE_TYPE_INVALID) {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(res_array), K_(type)); - public: +public: common::ObSArray res_array_; common::ObCopySSTableType type_; }; @@ -3151,35 +3151,35 @@ struct ObCopySSTableBatchRes { struct ObMigrateReplicaBatchRes { OB_UNIS_VERSION(2); - public: +public: ObMigrateReplicaBatchRes() : res_array_() {} bool is_valid() const; TO_STRING_KV(K_(res_array)); - public: +public: common::ObSArray res_array_; }; struct ObChangeReplicaBatchRes { OB_UNIS_VERSION(1); - public: +public: ObChangeReplicaBatchRes() : res_array_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(res_array)); - public: +public: common::ObSArray res_array_; }; struct ObStandbyCutDataTaskRes { OB_UNIS_VERSION(1); - public: +public: ObStandbyCutDataTaskRes() : key_(), dst_(), result_(0) {} bool is_valid() const @@ -3196,47 +3196,47 @@ struct ObStandbyCutDataTaskRes { struct ObStandbyCutDataBatchTaskRes { OB_UNIS_VERSION(1); - public: +public: ObStandbyCutDataBatchTaskRes() : res_array_() {} - public: +public: int assign(const struct ObStandbyCutDataBatchTaskRes& res); bool is_valid() const; TO_STRING_KV(K_(res_array)); - public: +public: common::ObSArray res_array_; }; struct ObBackupBatchRes { OB_UNIS_VERSION(1); - public: +public: ObBackupBatchRes() : res_array_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(res_array)); - public: +public: common::ObSArray res_array_; }; struct ObValidateBatchRes { OB_UNIS_VERSION(1); - public: +public: ObValidateBatchRes() : res_array_() {} - public: +public: int assign(const ObValidateBatchRes& res); bool is_valid() const; TO_STRING_KV(K_(res_array)); - public: +public: common::ObSArray res_array_; }; @@ -3244,16 +3244,16 @@ struct ObValidateBatchRes { struct ObAddReplicaBatchArg { OB_UNIS_VERSION(1); - public: +public: ObAddReplicaBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -3262,15 +3262,15 @@ struct ObAddReplicaBatchArg { struct ObRemoveNonPaxosReplicaBatchArg { OB_UNIS_VERSION(1); - public: +public: ObRemoveNonPaxosReplicaBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -3279,15 +3279,15 @@ struct ObRemoveNonPaxosReplicaBatchArg { struct ObMigrateReplicaBatchArg { OB_UNIS_VERSION(1); - public: +public: ObMigrateReplicaBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -3296,15 +3296,15 @@ struct ObMigrateReplicaBatchArg { struct ObChangeReplicaBatchArg { OB_UNIS_VERSION(1); - public: +public: ObChangeReplicaBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -3313,15 +3313,15 @@ struct ObChangeReplicaBatchArg { struct ObCopySSTableBatchArg { OB_UNIS_VERSION(1); - public: +public: ObCopySSTableBatchArg() : arg_array_(), timeout_ts_(0), task_id_(), type_(common::OB_COPY_SSTABLE_TYPE_INVALID) {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id), K_(type)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -3331,15 +3331,15 @@ struct ObCopySSTableBatchArg { struct ObRebuildReplicaBatchArg { OB_UNIS_VERSION(1); - public: +public: ObRebuildReplicaBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -3348,16 +3348,16 @@ struct ObRebuildReplicaBatchArg { struct ObServerCopyLocalIndexSSTableArg { OB_UNIS_VERSION(1); - public: +public: ObServerCopyLocalIndexSSTableArg() : data_src_(), dst_(), pkey_(), index_table_id_(common::OB_INVALID_ID), cluster_id_(common::OB_INVALID_ID) {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(data_src), K_(dst), K_(pkey), K_(index_table_id), K_(cluster_id)); - public: +public: common::ObAddr data_src_; common::ObAddr dst_; common::ObPartitionKey pkey_; @@ -3368,15 +3368,15 @@ struct ObServerCopyLocalIndexSSTableArg { struct ObBackupBatchArg { OB_UNIS_VERSION(1); - public: +public: ObBackupBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -3392,13 +3392,13 @@ enum ObReplicaMovingType : int8_t { struct ObAuthReplicaMovingkArg { OB_UNIS_VERSION(1); - public: +public: ObAuthReplicaMovingkArg() : file_id_(0), type_(REPLICA_MOVING_TYPE_INVALID) {} bool is_valid() const; TO_STRING_KV(K(pg_key_), K(addr_), K(file_id_), K(type_)); - public: +public: common::ObPGKey pg_key_; common::ObAddr addr_; int64_t file_id_; @@ -3408,16 +3408,16 @@ struct ObAuthReplicaMovingkArg { struct ObValidateBatchArg { OB_UNIS_VERSION(1); - public: +public: ObValidateBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: int assign(const ObValidateBatchArg& arg); bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -3426,18 +3426,18 @@ struct ObValidateBatchArg { struct ObStandbyCutDataBatchTaskArg { OB_UNIS_VERSION(1); - public: +public: ObStandbyCutDataBatchTaskArg() : arg_array_(), timeout_ts_(0), trace_id_(), fo_trace_id_(), flashback_ts_(0), switchover_epoch_(0) {} - public: +public: int init(const int64_t timeout, const share::ObTaskId& task_id, const common::ObCurTraceId::TraceId& fo_trace_id, const int64_t flashback_ts, const int64_t switchover_epoch); bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(trace_id), K_(flashback_ts), K_(switchover_epoch), K_(fo_trace_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId trace_id_; @@ -3451,7 +3451,7 @@ struct ObStandbyCutDataBatchTaskArg { struct ObMajorFreezeArg { OB_UNIS_VERSION(1); - public: +public: ObMajorFreezeArg() : frozen_version_(0), schema_version_(0), frozen_timestamp_(0) {} inline void reset(); @@ -3463,14 +3463,14 @@ struct ObMajorFreezeArg { int64_t schema_version_; int64_t frozen_timestamp_; - private: +private: // DISALLOW_COPY_AND_ASSIGN(ObMajorFreezeArg); }; struct ObSetReplicaNumArg { OB_UNIS_VERSION(1); - public: +public: ObSetReplicaNumArg() : partition_key_(), replica_num_(0) {} ~ObSetReplicaNumArg() @@ -3490,7 +3490,7 @@ struct ObSetReplicaNumArg { struct ObSetParentArg { OB_UNIS_VERSION(1); - public: +public: ObSetParentArg() : partition_key_(), parent_addr_() {} ~ObSetParentArg() @@ -3510,7 +3510,7 @@ struct ObSetParentArg { struct ObSwitchLeaderArg { OB_UNIS_VERSION(1); - public: +public: ObSwitchLeaderArg() : partition_key_(), leader_addr_() {} ~ObSwitchLeaderArg() @@ -3530,7 +3530,7 @@ struct ObSwitchLeaderArg { struct ObSwitchSchemaArg { OB_UNIS_VERSION(1); - public: +public: explicit ObSwitchSchemaArg() : schema_info_(), force_refresh_(false) {} explicit ObSwitchSchemaArg(const share::schema::ObRefreshSchemaInfo& schema_info, bool force_refresh) @@ -3553,7 +3553,7 @@ struct ObSwitchSchemaArg { struct ObCheckSchemaVersionElapsedArg { OB_UNIS_VERSION(1); - public: +public: ObCheckSchemaVersionElapsedArg() : pkey_(), schema_version_(0) {} bool is_valid() const @@ -3574,7 +3574,7 @@ struct ObCheckSchemaVersionElapsedArg { struct ObCheckCtxCreateTimestampElapsedArg { OB_UNIS_VERSION(1); - public: +public: ObCheckCtxCreateTimestampElapsedArg() : pkey_(), sstable_exist_ts_(0) {} bool is_valid() const @@ -3595,7 +3595,7 @@ struct ObCheckCtxCreateTimestampElapsedArg { struct ObCheckSchemaVersionElapsedResult { OB_UNIS_VERSION(1); - public: +public: ObCheckSchemaVersionElapsedResult() : snapshot_(common::OB_INVALID_TIMESTAMP) {} bool is_valid() const @@ -3613,7 +3613,7 @@ struct ObCheckSchemaVersionElapsedResult { struct ObCheckCtxCreateTimestampElapsedResult { OB_UNIS_VERSION(1); - public: +public: ObCheckCtxCreateTimestampElapsedResult() : snapshot_(common::OB_INVALID_TIMESTAMP) {} bool is_valid() const @@ -3631,7 +3631,7 @@ struct ObCheckCtxCreateTimestampElapsedResult { struct ObGetLeaderCandidatesArg { OB_UNIS_VERSION(1); - public: +public: ObGetLeaderCandidatesArg() : partitions_() {} void reuse() @@ -3651,7 +3651,7 @@ struct ObGetLeaderCandidatesArg { struct ObGetLeaderCandidatesV2Arg { OB_UNIS_VERSION(1); - public: +public: ObGetLeaderCandidatesV2Arg() : partitions_(), prep_candidates_() {} void reuse() @@ -3673,13 +3673,13 @@ struct ObGetLeaderCandidatesV2Arg { class CandidateStatus { OB_UNIS_VERSION(1); - public: +public: CandidateStatus() : candidate_status_(0) {} virtual ~CandidateStatus() {} - public: +public: void set_in_black_list(const bool in_black_list) { if (in_black_list) { @@ -3699,7 +3699,7 @@ class CandidateStatus { } TO_STRING_KV("in_black_list", get_in_black_list()); - private: +private: union { uint64_t candidate_status_; struct { @@ -3714,7 +3714,7 @@ typedef common::ObSArray CandidateStatusList; struct ObGetLeaderCandidatesResult { OB_UNIS_VERSION(1); - public: +public: ObGetLeaderCandidatesResult() : candidates_() {} void reuse() @@ -3733,7 +3733,7 @@ struct ObGetLeaderCandidatesResult { struct ObAccountArg { OB_UNIS_VERSION(1); - public: +public: ObAccountArg() : user_name_(), host_name_(), is_role_(false) {} ObAccountArg(const common::ObString& user_name, const common::ObString& host_name) @@ -3766,7 +3766,7 @@ struct ObAccountArg { struct ObCreateUserArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateUserArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -3790,7 +3790,7 @@ struct ObCreateUserArg : public ObDDLArg { struct ObDropUserArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropUserArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), is_role_(false) {} virtual ~ObDropUserArg() @@ -3811,7 +3811,7 @@ struct ObDropUserArg : public ObDDLArg { struct ObRenameUserArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObRenameUserArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID) {} virtual ~ObRenameUserArg() @@ -3829,7 +3829,7 @@ struct ObRenameUserArg : public ObDDLArg { struct ObSetPasswdArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObSetPasswdArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), ssl_type_(share::schema::ObSSLType::SSL_TYPE_NOT_SPECIFIED) {} @@ -3852,7 +3852,7 @@ struct ObSetPasswdArg : public ObDDLArg { struct ObLockUserArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObLockUserArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), locked_(false) {} virtual ~ObLockUserArg() @@ -3869,7 +3869,7 @@ struct ObLockUserArg : public ObDDLArg { struct ObAlterUserProfileArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObAlterUserProfileArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_TENANT_ID), @@ -3898,7 +3898,7 @@ struct ObAlterUserProfileArg : public ObDDLArg { struct ObGrantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObGrantArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -3959,7 +3959,7 @@ struct ObGrantArg : public ObDDLArg { struct ObStandbyGrantArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObStandbyGrantArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -3985,7 +3985,7 @@ struct ObStandbyGrantArg : public ObDDLArg { struct ObRevokeUserArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObRevokeUserArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -4008,7 +4008,7 @@ struct ObRevokeUserArg : public ObDDLArg { struct ObRevokeDBArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObRevokeDBArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), user_id_(common::OB_INVALID_ID), priv_set_(0) {} bool is_valid() const; @@ -4023,7 +4023,7 @@ struct ObRevokeDBArg : public ObDDLArg { struct ObRevokeTableArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObRevokeTableArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), @@ -4056,7 +4056,7 @@ struct ObRevokeTableArg : public ObDDLArg { struct ObRevokeSysPrivArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObRevokeSysPrivArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), grantee_id_(common::OB_INVALID_ID), sys_priv_array_() {} @@ -4071,7 +4071,7 @@ struct ObRevokeSysPrivArg : public ObDDLArg { struct ObCreateRoleArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateRoleArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID) {} bool is_valid() const; @@ -4088,7 +4088,7 @@ struct ObCreateRoleArg : public ObDDLArg { struct ObAdminServerArg { OB_UNIS_VERSION(1); - public: +public: enum AdminServerOp { INVALID_OP = 0, ADD = 1, @@ -4120,7 +4120,7 @@ struct ObAdminServerArg { struct ObAdminZoneArg { OB_UNIS_VERSION(1); - public: +public: enum AdminZoneOp { ADD = 1, DELETE = 2, @@ -4137,7 +4137,7 @@ struct ObAdminZoneArg { ALTER_ZONE_MAX = 128, }; - public: +public: ObAdminZoneArg() : zone_(), region_(), idc_(), zone_type_(common::ObZoneType::ZONE_TYPE_INVALID), force_stop_(false), op_(ADD) {} @@ -4164,7 +4164,7 @@ struct ObAdminZoneArg { struct ObAdminSwitchReplicaRoleArg { OB_UNIS_VERSION(1); - public: +public: ObAdminSwitchReplicaRoleArg() : role_(common::FOLLOWER), partition_key_(), server_(), zone_(), tenant_name_() {} ~ObAdminSwitchReplicaRoleArg() @@ -4183,7 +4183,7 @@ struct ObAdminSwitchReplicaRoleArg { struct ObAdminSwitchRSRoleArg { OB_UNIS_VERSION(1); - public: +public: ObAdminSwitchRSRoleArg() : role_(common::FOLLOWER), server_(), zone_() {} ~ObAdminSwitchRSRoleArg() @@ -4200,7 +4200,7 @@ struct ObAdminSwitchRSRoleArg { struct ObAdminChangeReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObAdminChangeReplicaArg() : partition_key_(), member_(), force_cmd_(false) {} ~ObAdminChangeReplicaArg() @@ -4217,7 +4217,7 @@ struct ObAdminChangeReplicaArg { struct ObCheckGtsReplicaStopServer { OB_UNIS_VERSION(1); - public: +public: ObCheckGtsReplicaStopServer() : servers_() {} TO_STRING_KV(K_(servers)); @@ -4235,14 +4235,14 @@ struct ObCheckGtsReplicaStopServer { return servers_.count() > 0; } - public: +public: common::ObSArray servers_; }; struct ObCheckGtsReplicaStopZone { OB_UNIS_VERSION(1); - public: +public: ObCheckGtsReplicaStopZone() : zone_() {} ObCheckGtsReplicaStopZone(const common::ObZone& zone) : zone_(zone) @@ -4253,14 +4253,14 @@ struct ObCheckGtsReplicaStopZone { return !zone_.is_empty(); } - public: +public: common::ObZone zone_; }; struct ObAdminDropReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObAdminDropReplicaArg() : partition_key_(), server_(), zone_(), create_timestamp_(0), force_cmd_(false) {} ~ObAdminDropReplicaArg() @@ -4279,7 +4279,7 @@ struct ObAdminDropReplicaArg { struct ObAdminAddDiskArg { OB_UNIS_VERSION(1); - public: +public: ObAdminAddDiskArg() : diskgroup_name_(), disk_path_(), alias_name_(), server_(), zone_() {} ~ObAdminAddDiskArg() @@ -4298,7 +4298,7 @@ struct ObAdminAddDiskArg { struct ObAdminDropDiskArg { OB_UNIS_VERSION(1); - public: +public: ObAdminDropDiskArg() : diskgroup_name_(), alias_name_(), server_(), zone_() {} ~ObAdminDropDiskArg() @@ -4315,7 +4315,7 @@ struct ObAdminDropDiskArg { struct ObAdminMigrateReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObAdminMigrateReplicaArg() : is_copy_(false), partition_key_(), src_(), dest_(), force_cmd_(false) {} ~ObAdminMigrateReplicaArg() @@ -4334,7 +4334,7 @@ struct ObAdminMigrateReplicaArg { struct ObPhysicalRestoreTenantArg : public ObCmdArg { OB_UNIS_VERSION(1); - public: +public: ObPhysicalRestoreTenantArg(); bool is_valid() const; TO_STRING_KV( @@ -4351,7 +4351,7 @@ struct ObPhysicalRestoreTenantArg : public ObCmdArg { struct ObRestoreTenantArg : public ObCmdArg { OB_UNIS_VERSION(1); - public: +public: ObRestoreTenantArg() : ObCmdArg(), tenant_name_(), oss_uri_() {} bool is_valid() const @@ -4367,7 +4367,7 @@ struct ObRestoreTenantArg : public ObCmdArg { struct ObRestorePartitionsArg { OB_UNIS_VERSION(1); - public: +public: ObRestorePartitionsArg() : schema_id_(common::OB_INVALID_ID), mode_(OB_CREATE_TABLE_MODE_RESTORE), @@ -4387,7 +4387,7 @@ struct ObRestorePartitionsArg { struct ObServerZoneArg { OB_UNIS_VERSION(1); - public: +public: ObServerZoneArg() : server_(), zone_() {} @@ -4415,7 +4415,7 @@ struct ObAdminClearLocationCacheArg : public ObServerZoneArg {}; struct ObRunJobArg : public ObServerZoneArg { OB_UNIS_VERSION(1); - public: +public: ObRunJobArg() : ObServerZoneArg(), job_() {} @@ -4431,16 +4431,16 @@ struct ObRunJobArg : public ObServerZoneArg { struct ObUpgradeJobArg { OB_UNIS_VERSION(1); - public: +public: enum Action { INVALID_ACTION, RUN_UPGRADE_JOB, STOP_UPGRADE_JOB }; - public: +public: ObUpgradeJobArg(); bool is_valid() const; int assign(const ObUpgradeJobArg& other); TO_STRING_KV(K_(action), K_(version)); - public: +public: Action action_; int64_t version_; }; @@ -4448,7 +4448,7 @@ struct ObUpgradeJobArg { struct ObAdminMergeArg { OB_UNIS_VERSION(1); - public: +public: enum Type { START_MERGE = 1, SUSPEND_MERGE = 2, @@ -4467,7 +4467,7 @@ struct ObAdminMergeArg { struct ObAdminClearRoottableArg { OB_UNIS_VERSION(1); - public: +public: ObAdminClearRoottableArg() : tenant_name_() {} @@ -4484,7 +4484,7 @@ struct ObAdminClearRoottableArg { struct ObAdminSetConfigItem { OB_UNIS_VERSION(1); - public: +public: ObAdminSetConfigItem() : name_(), value_(), @@ -4511,7 +4511,7 @@ struct ObAdminSetConfigItem { struct ObAdminSetConfigArg { OB_UNIS_VERSION(1); - public: +public: ObAdminSetConfigArg() : items_(), is_inner_(false) {} ~ObAdminSetConfigArg() @@ -4530,7 +4530,7 @@ struct ObAdminSetConfigArg { struct ObAdminLoadBaselineArg { OB_UNIS_VERSION(1); - public: +public: ObAdminLoadBaselineArg() : tenant_ids_(), sql_id_(), plan_hash_value_(common::OB_INVALID_ID), fixed_(false), enabled_(true) {} @@ -4552,7 +4552,7 @@ struct ObAdminLoadBaselineArg { struct ObAdminFlushCacheArg { OB_UNIS_VERSION(1); - public: +public: ObAdminFlushCacheArg() : cache_type_(CACHE_TYPE_INVALID) {} virtual ~ObAdminFlushCacheArg() @@ -4574,7 +4574,7 @@ struct ObAdminFlushCacheArg { struct ObAdminMigrateUnitArg { OB_UNIS_VERSION(1); - public: +public: ObAdminMigrateUnitArg() : unit_id_(0), is_cancel_(false), destination_() {} ~ObAdminMigrateUnitArg() @@ -4594,7 +4594,7 @@ struct ObAdminMigrateUnitArg { struct ObAutoincSyncArg { OB_UNIS_VERSION(1); - public: +public: ObAutoincSyncArg() : tenant_id_(common::OB_INVALID_ID), table_id_(common::OB_INVALID_ID), @@ -4618,7 +4618,7 @@ struct ObAutoincSyncArg { struct ObDropReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObDropReplicaArg() : partition_key_(), member_() {} bool is_valid() const @@ -4635,7 +4635,7 @@ struct ObDropReplicaArg { struct ObUpdateIndexStatusArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObUpdateIndexStatusArg() : ObDDLArg(), index_table_id_(common::OB_INVALID_ID), @@ -4660,7 +4660,7 @@ struct ObUpdateIndexStatusArg : public ObDDLArg { struct ObMergeFinishArg { OB_UNIS_VERSION(1); - public: +public: ObMergeFinishArg() : frozen_version_(0) {} @@ -4677,7 +4677,7 @@ struct ObMergeFinishArg { struct ObMergeErrorArg { OB_UNIS_VERSION(1); - public: +public: ObMergeErrorArg() : error_code_(0) {} @@ -4692,7 +4692,7 @@ struct ObMergeErrorArg { struct ObAdminRebuildReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObAdminRebuildReplicaArg() : key_(), server_() {} @@ -4709,7 +4709,7 @@ struct ObAdminRebuildReplicaArg { struct ObDebugSyncActionArg { OB_UNIS_VERSION(1); - public: +public: ObDebugSyncActionArg() : reset_(false), clear_(false) {} @@ -4727,7 +4727,7 @@ struct ObDebugSyncActionArg { struct ObRootMajorFreezeArg { OB_UNIS_VERSION(1); - public: +public: ObRootMajorFreezeArg() : try_frozen_version_(0), launch_new_round_(false), @@ -4756,7 +4756,7 @@ struct ObRootMajorFreezeArg { struct ObMinorFreezeArg { OB_UNIS_VERSION(1); - public: +public: ObMinorFreezeArg() {} @@ -4780,7 +4780,7 @@ struct ObMinorFreezeArg { struct ObRootMinorFreezeArg { OB_UNIS_VERSION(2); - public: +public: ObRootMinorFreezeArg() {} @@ -4808,7 +4808,7 @@ struct ObRootMinorFreezeArg { struct ObSyncPartitionTableFinishArg { OB_UNIS_VERSION(1); - public: +public: ObSyncPartitionTableFinishArg() : server_(), version_(0) {} @@ -4825,7 +4825,7 @@ struct ObSyncPartitionTableFinishArg { struct ObSyncPGPartitionMTFinishArg { OB_UNIS_VERSION(1); - public: +public: ObSyncPGPartitionMTFinishArg() : server_(), version_(0) {} @@ -4842,7 +4842,7 @@ struct ObSyncPGPartitionMTFinishArg { struct ObCheckDanglingReplicaFinishArg { OB_UNIS_VERSION(1); - public: +public: ObCheckDanglingReplicaFinishArg() : server_(), version_(0), dangling_count_(common::OB_INVALID_ID) {} @@ -4860,7 +4860,7 @@ struct ObCheckDanglingReplicaFinishArg { struct ObGetMemberListAndLeaderResult final { OB_UNIS_VERSION(1); - public: +public: ObGetMemberListAndLeaderResult() : member_list_(), leader_(), self_(), lower_list_(), replica_type_(common::REPLICA_TYPE_MAX), property_() {} @@ -4887,7 +4887,7 @@ struct ObGetMemberListAndLeaderResult final { struct ObMemberListAndLeaderArg { OB_UNIS_VERSION(1); - public: +public: ObMemberListAndLeaderArg() : member_list_(), leader_(), @@ -4917,7 +4917,7 @@ struct ObMemberListAndLeaderArg { struct ObBatchGetRoleArg { OB_UNIS_VERSION(1); - public: +public: ObBatchGetRoleArg() : keys_() {} virtual ~ObBatchGetRoleArg() @@ -4931,7 +4931,7 @@ struct ObBatchGetRoleArg { struct ObBatchGetRoleResult { OB_UNIS_VERSION(1); - public: +public: ObBatchGetRoleResult() : results_() {} virtual ~ObBatchGetRoleResult() @@ -4945,7 +4945,7 @@ struct ObBatchGetRoleResult { struct ObSwitchLeaderListArg { OB_UNIS_VERSION(1); - public: +public: ObSwitchLeaderListArg() : partition_key_list_(), leader_addr_() {} ~ObSwitchLeaderListArg() @@ -4970,7 +4970,7 @@ struct ObSwitchLeaderListArg { struct ObCheckFlashbackInfoArg { OB_UNIS_VERSION(1); - public: +public: ObCheckFlashbackInfoArg() : min_weak_read_timestamp_(common::OB_INVALID_TIMESTAMP) {} ~ObCheckFlashbackInfoArg() @@ -4987,7 +4987,7 @@ struct ObCheckFlashbackInfoArg { struct ObCheckFlashbackInfoResult { OB_UNIS_VERSION(1); - public: +public: ObCheckFlashbackInfoResult() : addr_(), pkey_(), @@ -5009,7 +5009,7 @@ struct ObCheckFlashbackInfoResult { struct ObGetPartitionCountResult { OB_UNIS_VERSION(1); - public: +public: ObGetPartitionCountResult() : partition_count_(0) {} void reset() @@ -5104,7 +5104,7 @@ inline void ObRootMajorFreezeArg::reset() struct ObCreateUserDefinedFunctionArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateUserDefinedFunctionArg() : ObDDLArg(), udf_() {} virtual ~ObCreateUserDefinedFunctionArg() @@ -5121,7 +5121,7 @@ struct ObCreateUserDefinedFunctionArg : public ObDDLArg { struct ObDropUserDefinedFunctionArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropUserDefinedFunctionArg() : tenant_id_(common::OB_INVALID_ID), name_(), if_exist_(false) {} virtual ~ObDropUserDefinedFunctionArg() @@ -5144,7 +5144,7 @@ struct ObDropUserDefinedFunctionArg : public ObDDLArg { struct ObCreateOutlineArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateOutlineArg() : ObDDLArg(), or_replace_(false), outline_info_(), db_name_() {} virtual ~ObCreateOutlineArg() @@ -5160,7 +5160,7 @@ struct ObCreateOutlineArg : public ObDDLArg { struct ObAlterOutlineArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: enum AlterOutlineOptions { ADD_OUTLINE_CONTENT = 1, ADD_CONCURRENT_LIMIT, MAX_OPTION }; ObAlterOutlineArg() : ObDDLArg(), alter_outline_info_(), db_name_() {} @@ -5180,7 +5180,7 @@ struct ObAlterOutlineArg : public ObDDLArg { struct ObDropOutlineArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropOutlineArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), db_name_(), outline_name_() {} virtual ~ObDropOutlineArg() @@ -5200,7 +5200,7 @@ struct ObDropOutlineArg : public ObDDLArg { struct ObCreateDbLinkArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObCreateDbLinkArg() : ObDDLArg(), dblink_info_() {} virtual ~ObCreateDbLinkArg() @@ -5213,7 +5213,7 @@ struct ObCreateDbLinkArg : public ObDDLArg { struct ObDropDbLinkArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDropDbLinkArg() : ObDDLArg(), tenant_id_(common::OB_INVALID_ID), dblink_name_() {} virtual ~ObDropDbLinkArg() @@ -5227,7 +5227,7 @@ struct ObDropDbLinkArg : public ObDDLArg { struct ObUseDatabaseArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObUseDatabaseArg() : ObDDLArg() {} }; @@ -5235,7 +5235,7 @@ struct ObUseDatabaseArg : public ObDDLArg { struct ObFetchAliveServerArg { OB_UNIS_VERSION(1); - public: +public: ObFetchAliveServerArg() : cluster_id_(0) {} TO_STRING_KV(K_(cluster_id)); @@ -5250,7 +5250,7 @@ struct ObFetchAliveServerArg { struct ObFetchAliveServerResult { OB_UNIS_VERSION(1); - public: +public: TO_STRING_KV(K_(active_server_list)); bool is_valid() const { @@ -5264,7 +5264,7 @@ struct ObFetchAliveServerResult { struct ObLoadBaselineArg { OB_UNIS_VERSION(1); - public: +public: ObLoadBaselineArg() : is_all_tenant_(false), tenant_id_(common::OB_INVALID_TENANT_ID), @@ -5288,7 +5288,7 @@ struct ObLoadBaselineArg { struct ObFlushCacheArg { OB_UNIS_VERSION(1); - public: +public: ObFlushCacheArg() : is_all_tenant_(false), tenant_id_(common::OB_INVALID_TENANT_ID), cache_type_(CACHE_TYPE_INVALID) {} virtual ~ObFlushCacheArg() @@ -5307,7 +5307,7 @@ struct ObFlushCacheArg { struct ObGetAllSchemaArg { OB_UNIS_VERSION(1); - public: +public: ObGetAllSchemaArg() : schema_version_(common::OB_INVALID_VERSION) {} TO_STRING_KV(K_(schema_version), K_(tenant_name)); @@ -5319,7 +5319,7 @@ struct ObGetAllSchemaArg { struct ObAdminSetTPArg : public ObServerZoneArg { OB_UNIS_VERSION(1); - public: +public: ObAdminSetTPArg() : event_no_(0), occur_(0), trigger_freq_(1), error_code_(0) {} @@ -5340,7 +5340,7 @@ struct ObAdminSetTPArg : public ObServerZoneArg { struct ObCancelTaskArg : public ObServerZoneArg { OB_UNIS_VERSION(2); - public: +public: ObCancelTaskArg() : task_id_() {} TO_STRING_KV(K_(task_id)); @@ -5350,7 +5350,7 @@ struct ObCancelTaskArg : public ObServerZoneArg { struct ObReportSingleReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObReportSingleReplicaArg() : partition_key_() {} bool is_valid() const @@ -5366,7 +5366,7 @@ struct ObReportSingleReplicaArg { struct ObSetDiskValidArg { OB_UNIS_VERSION(1); - public: +public: ObSetDiskValidArg() {} bool is_valid() const @@ -5378,7 +5378,7 @@ struct ObSetDiskValidArg { struct ObAdminClearBalanceTaskArg { OB_UNIS_VERSION(1); - public: +public: enum TaskType { AUTO = 0, MANUAL, ALL, MAX_TYPE }; ObAdminClearBalanceTaskArg() : tenant_ids_(), type_(ALL), zone_names_() @@ -5395,7 +5395,7 @@ struct ObAdminClearBalanceTaskArg { class ObMCLogInfo { OB_UNIS_VERSION(1); - public: +public: ObMCLogInfo() : log_id_(common::OB_INVALID_ID), timestamp_(common::OB_INVALID_TIMESTAMP) {} ~ObMCLogInfo(){}; @@ -5404,7 +5404,7 @@ class ObMCLogInfo { return common::OB_INVALID_ID != log_id_ && common::OB_INVALID_TIMESTAMP != timestamp_; } - public: +public: uint64_t log_id_; int64_t timestamp_; TO_STRING_KV(K_(log_id), K_(timestamp)); @@ -5413,7 +5413,7 @@ class ObMCLogInfo { struct ObChangeMemberArg { OB_UNIS_VERSION(1); - public: +public: ObChangeMemberArg() : partition_key_(), member_(), quorum_(), switch_epoch_(common::OB_INVALID_VERSION) {} common::ObPartitionKey partition_key_; @@ -5426,7 +5426,7 @@ struct ObChangeMemberArg { struct ObChangeMemberCtx { OB_UNIS_VERSION(1); - public: +public: ObChangeMemberCtx() : partition_key_(), ret_value_(common::OB_SUCCESS), log_info_() {} common::ObPartitionKey partition_key_; @@ -5441,7 +5441,7 @@ typedef common::ObSArray ObChangeMemberCtxs; struct ObChangeMemberCtxsWrapper { OB_UNIS_VERSION(1); - public: +public: ObChangeMemberCtxsWrapper() : result_code_(common::OB_SUCCESS), ctxs_() {} int32_t result_code_; @@ -5452,7 +5452,7 @@ struct ObChangeMemberCtxsWrapper { struct ObMemberMajorSSTableCheckArg { OB_UNIS_VERSION(1); - public: +public: ObMemberMajorSSTableCheckArg() : pkey_(), table_ids_() {} TO_STRING_KV(K_(pkey), K_(table_ids)); @@ -5463,7 +5463,7 @@ struct ObMemberMajorSSTableCheckArg { struct ObForceSwitchILogFileArg { OB_UNIS_VERSION(1); - public: +public: ObForceSwitchILogFileArg() : force_(true) {} ~ObForceSwitchILogFileArg() @@ -5476,7 +5476,7 @@ struct ObForceSwitchILogFileArg { struct ObForceSetAllAsSingleReplicaArg { OB_UNIS_VERSION(1); - public: +public: ObForceSetAllAsSingleReplicaArg() : force_(true) {} ~ObForceSetAllAsSingleReplicaArg() @@ -5489,7 +5489,7 @@ struct ObForceSetAllAsSingleReplicaArg { struct ObForceSetServerListArg { OB_UNIS_VERSION(1); - public: +public: ObForceSetServerListArg() : server_list_(), replica_num_(0) {} ~ObForceSetServerListArg() @@ -5503,7 +5503,7 @@ struct ObForceSetServerListArg { struct ObForceCreateSysTableArg { OB_UNIS_VERSION(1); - public: +public: ObForceCreateSysTableArg() : tenant_id_(common::OB_INVALID_TENANT_ID), table_id_(common::OB_INVALID_ID), @@ -5522,7 +5522,7 @@ struct ObForceCreateSysTableArg { struct ObForceSetLocalityArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObForceSetLocalityArg() : ObDDLArg(), locality_() {} virtual ~ObForceSetLocalityArg() @@ -5540,7 +5540,7 @@ struct ObForceSetLocalityArg : public ObDDLArg { struct ObRootSplitPartitionArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObRootSplitPartitionArg() : ObDDLArg(), table_id_(common::OB_INVALID_ID) {} virtual ~ObRootSplitPartitionArg() @@ -5562,7 +5562,7 @@ struct ObRootSplitPartitionArg : public ObDDLArg { struct ObSplitPartitionArg { OB_UNIS_VERSION(1); - public: +public: ObSplitPartitionArg() : split_info_() {} ~ObSplitPartitionArg() @@ -5577,14 +5577,14 @@ struct ObSplitPartitionArg { split_info_.reset(); } - public: +public: share::ObSplitPartition split_info_; }; struct ObSplitPartitionResult { OB_UNIS_VERSION(1); - public: +public: ObSplitPartitionResult() : results_() {} ~ObSplitPartitionResult() @@ -5603,14 +5603,14 @@ struct ObSplitPartitionResult { } TO_STRING_KV(K_(results)); - private: +private: common::ObSArray results_; }; struct ObSplitPartitionBatchArg { OB_UNIS_VERSION(1); - public: +public: ObSplitPartitionBatchArg() {} ~ObSplitPartitionBatchArg() @@ -5624,14 +5624,14 @@ struct ObSplitPartitionBatchArg { DECLARE_TO_STRING; share::ObSplitPartition split_info_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSplitPartitionBatchArg); }; struct ObSplitPartitionBatchRes { OB_UNIS_VERSION(1); - public: +public: ObSplitPartitionBatchRes() : ret_list_() {} ~ObSplitPartitionBatchRes() @@ -5647,14 +5647,14 @@ struct ObSplitPartitionBatchRes { // response includes all rets common::ObSArray ret_list_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSplitPartitionBatchRes); }; struct ObQueryMaxDecidedTransVersionRequest { OB_UNIS_VERSION(1); - public: +public: ObQueryMaxDecidedTransVersionRequest() : partition_array_(), last_max_decided_trans_version_(0) {} ~ObQueryMaxDecidedTransVersionRequest() @@ -5673,7 +5673,7 @@ struct ObQueryMaxDecidedTransVersionRequest { struct ObQueryMaxDecidedTransVersionResponse { OB_UNIS_VERSION(1); - public: +public: ObQueryMaxDecidedTransVersionResponse() : ret_value_(common::OB_SUCCESS), trans_version_(0) {} ~ObQueryMaxDecidedTransVersionResponse() @@ -5693,7 +5693,7 @@ struct ObQueryMaxDecidedTransVersionResponse { struct ObQueryIsValidMemberRequest { OB_UNIS_VERSION(1); - public: +public: ObQueryIsValidMemberRequest() : self_addr_(), partition_array_() {} ~ObQueryIsValidMemberRequest() @@ -5712,7 +5712,7 @@ struct ObQueryIsValidMemberRequest { struct ObQueryIsValidMemberResponse { OB_UNIS_VERSION(1); - public: +public: ObQueryIsValidMemberResponse() : ret_value_(common::OB_SUCCESS), partition_array_(), candidates_status_(), ret_array_() {} @@ -5736,7 +5736,7 @@ struct ObQueryIsValidMemberResponse { struct ObQueryMaxFlushedILogIdRequest { OB_UNIS_VERSION(1); - public: +public: ObQueryMaxFlushedILogIdRequest() : partition_array_() {} ~ObQueryMaxFlushedILogIdRequest() @@ -5753,7 +5753,7 @@ struct ObQueryMaxFlushedILogIdRequest { struct ObQueryMaxFlushedILogIdResponse { OB_UNIS_VERSION(1); - public: +public: ObQueryMaxFlushedILogIdResponse() : err_code_(common::OB_SUCCESS), partition_array_(), max_flushed_ilog_ids_() {} ~ObQueryMaxFlushedILogIdResponse() @@ -5774,7 +5774,7 @@ struct ObQueryMaxFlushedILogIdResponse { struct ObBootstrapArg { OB_UNIS_VERSION(1); - public: +public: ObBootstrapArg() : server_list_(), cluster_type_(common::PRIMARY_CLUSTER), @@ -5803,7 +5803,7 @@ struct ObBootstrapArg { struct ObBatchStartElectionArg { OB_UNIS_VERSION(1); - public: +public: enum SwitchType { INVALID_TYPE = -1, SWITCHOVER, @@ -5897,14 +5897,14 @@ struct ObBatchStartElectionArg { TO_STRING_KV(K_(trace_id), "count", pkeys_.count(), K_(member_list), K_(lease_start_time), K_(leader), K_(switch_timestamp), K_(switch_type), K_(pkeys), K_(quorum)); - public: +public: static bool is_valid_switch_type(const int32_t switch_type) { return (switch_type >= SWITCHOVER && switch_type <= FAILOVER); } ObPkeyArray pkeys_; - private: +private: int64_t lease_start_time_; common::ObAddr leader_; common::ObMemberList member_list_; @@ -5913,14 +5913,14 @@ struct ObBatchStartElectionArg { int64_t quorum_; // In the failover process, there may be a single copy, so quorum needs to be specified by rs common::ObCurTraceId::TraceId trace_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBatchStartElectionArg); }; struct ObBatchFlashbackArg { OB_UNIS_VERSION(1); - public: +public: static const int64_t MAX_COUNT = 128; ObBatchFlashbackArg() : switchover_timestamp_(0), @@ -6014,7 +6014,7 @@ struct ObBatchFlashbackArg { TO_STRING_KV(K_(switchover_timestamp), K_(flashback_to_ts), K_(flashback_from_ts), K_(leader), K_(is_logical_flashback), K_(pkeys), K_(frozen_timestamp), K_(query_end_time), K_(schema_version)); - public: +public: int64_t switchover_timestamp_; int64_t flashback_to_ts_; common::ObAddr leader_; @@ -6029,7 +6029,7 @@ struct ObBatchFlashbackArg { struct ObAlterClusterInfoArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: enum OpType { INVALID_TYPE = -1, SWITCH_TO_STANDBY = 0, @@ -6087,7 +6087,7 @@ struct ObAlterClusterInfoArg : public ObDDLArg { return cstr; } - public: +public: OpType op_type_; common::ObProtectionMode mode_; bool is_force_; @@ -6097,7 +6097,7 @@ struct ObAlterClusterInfoArg : public ObDDLArg { struct ObAdminClusterArg { OB_UNIS_VERSION(1); - public: +public: enum AlterClusterType { INVALID_TYPE = -1, ADD_CLUSTER = 0, @@ -6107,7 +6107,7 @@ struct ObAdminClusterArg { ALTER_CLUSTER, }; - public: +public: ObAdminClusterArg() : cluster_name_(), cluster_id_(common::OB_INVALID_ID), @@ -6190,13 +6190,13 @@ struct ObAdminClusterArg { struct ObClusterActionVerifyArg { OB_UNIS_VERSION(1); - public: +public: enum VerifyType { INVALID_TYPE = -1, ADD_CLUSTER_VERIFY = 0, }; - public: +public: ObClusterActionVerifyArg() : verify_type_(INVALID_TYPE) {} ~ObClusterActionVerifyArg() @@ -6216,13 +6216,13 @@ struct ObClusterActionVerifyArg { struct ObDDLNopOpreatorArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObDDLNopOpreatorArg() : schema_operation_() {} ~ObDDLNopOpreatorArg() {} - public: +public: share::schema::ObSchemaOperation schema_operation_; bool is_valid() const { @@ -6238,7 +6238,7 @@ struct ObDDLNopOpreatorArg : public ObDDLArg { } TO_STRING_KV(K_(schema_operation)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDDLNopOpreatorArg); }; @@ -6373,7 +6373,7 @@ struct ObEstPartRes { }; struct TenantServerUnitConfig { - public: +public: TenantServerUnitConfig() : tenant_id_(common::OB_INVALID_ID), compat_mode_(share::ObWorker::CompatMode::INVALID), @@ -6400,7 +6400,7 @@ struct TenantServerUnitConfig { struct ObGetWRSArg { OB_UNIS_VERSION(1); - public: +public: enum Scope { INVALID_RANGE = 0, INNER_TABLE, USER_TABLE, ALL_TABLE }; TO_STRING_KV(K_(tenant_id), K_(scope), K_(need_filter)); bool is_valid() const; @@ -6425,7 +6425,7 @@ struct ObGetWRSArg { struct ObGetWRSResult { OB_UNIS_VERSION(1); - public: +public: ObGetWRSResult() : self_addr_(), err_code_(0), replica_wrs_info_list_() {} @@ -6436,7 +6436,7 @@ struct ObGetWRSResult { replica_wrs_info_list_.reset(); } - public: +public: common::ObAddr self_addr_; int err_code_; // error code @@ -6450,7 +6450,7 @@ struct ObGetWRSResult { struct ObTenantSchemaVersions { OB_UNIS_VERSION(1); - public: +public: ObTenantSchemaVersions() : tenant_schema_versions_() {} common::ObSArray tenant_schema_versions_; @@ -6477,7 +6477,7 @@ struct ObTenantSchemaVersions { struct ObGetSchemaArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObGetSchemaArg() : reserve_(0), ignore_fail_(false) {} virtual bool is_allow_when_upgrade() const @@ -6491,7 +6491,7 @@ struct ObGetSchemaArg : public ObDDLArg { struct TenantIdAndStats { OB_UNIS_VERSION(1); - public: +public: TenantIdAndStats() : tenant_id_(common::OB_INVALID_TENANT_ID), refreshed_schema_version_(0), @@ -6530,7 +6530,7 @@ struct TenantIdAndStats { struct ObClusterTenantStats { OB_UNIS_VERSION(1); - public: +public: void reset() { return tenant_stats_array_.reset(); @@ -6550,7 +6550,7 @@ struct ObClusterTenantStats { struct ObFinishSchemaSplitArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObFinishSchemaSplitArg() : tenant_id_(common::OB_INVALID_TENANT_ID), type_(rootserver::ObRsJobType::JOB_TYPE_SCHEMA_SPLIT_V2) {} @@ -6564,7 +6564,7 @@ struct ObFinishSchemaSplitArg : public ObDDLArg { } TO_STRING_KV(K_(tenant_id), K_(type)); - public: +public: uint64_t tenant_id_; rootserver::ObRsJobType type_; }; @@ -6572,12 +6572,12 @@ struct ObFinishSchemaSplitArg : public ObDDLArg { struct ObBroadcastSchemaArg { OB_UNIS_VERSION(1); - public: +public: ObBroadcastSchemaArg() : tenant_id_(common::OB_INVALID_TENANT_ID), schema_version_(common::OB_INVALID_VERSION) {} void reset(); - public: +public: uint64_t tenant_id_; int64_t schema_version_; TO_STRING_KV(K_(tenant_id), K_(schema_version)); @@ -6586,12 +6586,12 @@ struct ObBroadcastSchemaArg { struct ObCheckMergeFinishArg { OB_UNIS_VERSION(1); - public: +public: ObCheckMergeFinishArg() : frozen_version_(0) {} bool is_valid() const; - public: +public: int64_t frozen_version_; TO_STRING_KV(K_(frozen_version)); }; @@ -6599,7 +6599,7 @@ struct ObCheckMergeFinishArg { struct ObGetRecycleSchemaVersionsArg { OB_UNIS_VERSION(1); - public: +public: ObGetRecycleSchemaVersionsArg() : tenant_ids_() {} virtual ~ObGetRecycleSchemaVersionsArg() @@ -6608,7 +6608,7 @@ struct ObGetRecycleSchemaVersionsArg { void reset(); int assign(const ObGetRecycleSchemaVersionsArg& other); - public: +public: common::ObSArray tenant_ids_; TO_STRING_KV(K_(tenant_ids)); }; @@ -6616,7 +6616,7 @@ struct ObGetRecycleSchemaVersionsArg { struct ObGetRecycleSchemaVersionsResult { OB_UNIS_VERSION(1); - public: +public: ObGetRecycleSchemaVersionsResult() : recycle_schema_versions_() {} virtual ~ObGetRecycleSchemaVersionsResult() @@ -6625,7 +6625,7 @@ struct ObGetRecycleSchemaVersionsResult { void reset(); int assign(const ObGetRecycleSchemaVersionsResult& other); - public: +public: common::ObSArray recycle_schema_versions_; TO_STRING_KV(K_(recycle_schema_versions)); }; @@ -6633,7 +6633,7 @@ struct ObGetRecycleSchemaVersionsResult { struct ObGetClusterInfoArg { OB_UNIS_VERSION(1); - public: +public: ObGetClusterInfoArg() : need_check_sync_(false), max_primary_schema_version_(common::OB_INVALID_VERSION), @@ -6646,7 +6646,7 @@ struct ObGetClusterInfoArg { TO_STRING_KV(K_(need_check_sync), K_(max_primary_schema_version), K_(primary_schema_versions), K_(cluster_version), K_(standby_became_primary_scn)); - public: +public: bool need_check_sync_; int64_t max_primary_schema_version_; // The largest schema version of the main library system tenant ObTenantSchemaVersions primary_schema_versions_; // The schema version of all tenants of the main library, used to @@ -6658,7 +6658,7 @@ struct ObGetClusterInfoArg { struct ObCheckAddStandbyArg { OB_UNIS_VERSION(1); - public: +public: ObCheckAddStandbyArg() : cluster_version_(common::OB_INVALID_ID) {} bool is_valid() const @@ -6671,14 +6671,14 @@ struct ObCheckAddStandbyArg { } TO_STRING_KV(K_(cluster_version)); - public: +public: uint64_t cluster_version_; }; class ObHaGtsPingRequest { OB_UNIS_VERSION(1); - public: +public: ObHaGtsPingRequest() : gts_id_(common::OB_INVALID_ID), req_id_(common::OB_INVALID_ID), @@ -6688,7 +6688,7 @@ class ObHaGtsPingRequest { ~ObHaGtsPingRequest() {} - public: +public: void reset() { gts_id_ = common::OB_INVALID_ID; @@ -6725,7 +6725,7 @@ class ObHaGtsPingRequest { } TO_STRING_KV(K(gts_id_), K(req_id_), K(epoch_id_), K(request_ts_)); - private: +private: uint64_t gts_id_; uint64_t req_id_; int64_t epoch_id_; @@ -6735,7 +6735,7 @@ class ObHaGtsPingRequest { class ObHaGtsPingResponse { OB_UNIS_VERSION(1); - public: +public: ObHaGtsPingResponse() : gts_id_(common::OB_INVALID_ID), req_id_(common::OB_INVALID_ID), @@ -6745,7 +6745,7 @@ class ObHaGtsPingResponse { ~ObHaGtsPingResponse() {} - public: +public: void reset() { gts_id_ = common::OB_INVALID_ID; @@ -6782,7 +6782,7 @@ class ObHaGtsPingResponse { } TO_STRING_KV(K(gts_id_), K(req_id_), K(epoch_id_), K(response_ts_)); - private: +private: uint64_t gts_id_; uint64_t req_id_; int64_t epoch_id_; @@ -6792,7 +6792,7 @@ class ObHaGtsPingResponse { class ObHaGtsGetRequest { OB_UNIS_VERSION(1); - public: +public: ObHaGtsGetRequest() : gts_id_(common::OB_INVALID_ID), self_addr_(), @@ -6802,7 +6802,7 @@ class ObHaGtsGetRequest { ~ObHaGtsGetRequest() {} - public: +public: void reset() { gts_id_ = common::OB_INVALID_ID; @@ -6840,7 +6840,7 @@ class ObHaGtsGetRequest { } TO_STRING_KV(K(gts_id_), K(self_addr_), K(tenant_id_), K(srr_)); - private: +private: uint64_t gts_id_; common::ObAddr self_addr_; // TODO: To be deleted @@ -6851,7 +6851,7 @@ class ObHaGtsGetRequest { class ObHaGtsGetResponse { OB_UNIS_VERSION(1); - public: +public: ObHaGtsGetResponse() : gts_id_(common::OB_INVALID_ID), tenant_id_(common::OB_INVALID_TENANT_ID), @@ -6861,7 +6861,7 @@ class ObHaGtsGetResponse { ~ObHaGtsGetResponse() {} - public: +public: void reset() { gts_id_ = common::OB_INVALID_ID; @@ -6898,7 +6898,7 @@ class ObHaGtsGetResponse { } TO_STRING_KV(K(gts_id_), K(tenant_id_), K(srr_), K(gts_)); - private: +private: uint64_t gts_id_; // TODO: To be deleted uint64_t tenant_id_; @@ -6909,13 +6909,13 @@ class ObHaGtsGetResponse { class ObHaGtsHeartbeat { OB_UNIS_VERSION(1); - public: +public: ObHaGtsHeartbeat() : gts_id_(common::OB_INVALID_ID), addr_() {} ~ObHaGtsHeartbeat() {} - public: +public: bool is_valid() const { return common::is_valid_gts_id(gts_id_) && addr_.is_valid(); @@ -6935,7 +6935,7 @@ class ObHaGtsHeartbeat { } TO_STRING_KV(K(gts_id_), K(addr_)); - private: +private: uint64_t gts_id_; common::ObAddr addr_; }; @@ -6943,7 +6943,7 @@ class ObHaGtsHeartbeat { class ObHaGtsUpdateMetaRequest { OB_UNIS_VERSION(1); - public: +public: ObHaGtsUpdateMetaRequest() : gts_id_(common::OB_INVALID_ID), epoch_id_(common::OB_INVALID_TIMESTAMP), @@ -6953,7 +6953,7 @@ class ObHaGtsUpdateMetaRequest { ~ObHaGtsUpdateMetaRequest() {} - public: +public: bool is_valid() const { return common::is_valid_gts_id(gts_id_) && epoch_id_ > 0 && member_list_.get_member_number() > 0 && @@ -6985,7 +6985,7 @@ class ObHaGtsUpdateMetaRequest { } TO_STRING_KV(K(gts_id_), K(epoch_id_), K(member_list_), K(local_ts_)); - private: +private: uint64_t gts_id_; int64_t epoch_id_; common::ObMemberList member_list_; @@ -6995,13 +6995,13 @@ class ObHaGtsUpdateMetaRequest { class ObHaGtsUpdateMetaResponse { OB_UNIS_VERSION(1); - public: +public: ObHaGtsUpdateMetaResponse() : local_ts_(common::OB_INVALID_TIMESTAMP) {} ~ObHaGtsUpdateMetaResponse() {} - public: +public: bool is_valid() const { return local_ts_ > 0; @@ -7016,20 +7016,20 @@ class ObHaGtsUpdateMetaResponse { } TO_STRING_KV(K(local_ts_)); - private: +private: int64_t local_ts_; }; class ObHaGtsChangeMemberRequest { OB_UNIS_VERSION(1); - public: +public: ObHaGtsChangeMemberRequest() : gts_id_(common::OB_INVALID_ID), offline_replica_() {} ~ObHaGtsChangeMemberRequest() {} - public: +public: bool is_valid() const { return common::is_valid_gts_id(gts_id_) && offline_replica_.is_valid(); @@ -7049,7 +7049,7 @@ class ObHaGtsChangeMemberRequest { } TO_STRING_KV(K(gts_id_), K(offline_replica_)); - private: +private: uint64_t gts_id_; common::ObAddr offline_replica_; }; @@ -7057,13 +7057,13 @@ class ObHaGtsChangeMemberRequest { class ObHaGtsChangeMemberResponse { OB_UNIS_VERSION(1); - public: +public: ObHaGtsChangeMemberResponse() : ret_value_(common::OB_SUCCESS) {} ~ObHaGtsChangeMemberResponse() {} - public: +public: void set(const int ret_value) { ret_value_ = ret_value; @@ -7074,14 +7074,14 @@ class ObHaGtsChangeMemberResponse { } TO_STRING_KV(K(ret_value_)); - private: +private: int ret_value_; }; struct ObClusterInfoArg { OB_UNIS_VERSION(1); - public: +public: ObClusterInfoArg() : cluster_info_(), server_status_(share::OBSERVER_INVALID_STATUS), sync_cluster_ids_(), redo_options_() {} @@ -7089,7 +7089,7 @@ struct ObClusterInfoArg { TO_STRING_KV(K_(cluster_info), K_(server_status), K_(sync_cluster_ids), K_(redo_options)); int assign(const ObClusterInfoArg& other); - public: +public: share::ObClusterInfo cluster_info_; share::ServerServiceStatus server_status_; common::ObSEArray sync_cluster_ids_; @@ -7099,7 +7099,7 @@ struct ObClusterInfoArg { struct ObSchemaSnapshotArg { OB_UNIS_VERSION(1); - public: +public: ObSchemaSnapshotArg() : schema_version_(0), frozen_version_(0) {} bool is_valid() const @@ -7112,7 +7112,7 @@ struct ObSchemaSnapshotArg { } TO_STRING_KV(K_(schema_version), K_(frozen_version)); - public: +public: int64_t schema_version_; int64_t frozen_version_; }; @@ -7122,7 +7122,7 @@ struct ObSchemaSnapshotArg { struct ObSchemaSnapshotRes { OB_UNIS_VERSION(1); - public: +public: ObSchemaSnapshotRes(); bool is_valid() const; void reset(); @@ -7131,7 +7131,7 @@ struct ObSchemaSnapshotRes { K_(tenant_flashback_scn), K_(failover_timestamp), K_(frozen_status), K_(cluster_name)); int assign(const ObSchemaSnapshotRes& res); - public: +public: int64_t schema_version_; int64_t frozen_version_; common::ObSArray table_schemas_; @@ -7152,7 +7152,7 @@ struct ObSchemaSnapshotRes { struct ObRegistClusterArg { OB_UNIS_VERSION(1); - public: +public: ObRegistClusterArg() : cluster_name_(), cluster_id_(common::OB_INVALID_ID), pre_regist_(false), cluster_addr_() {} bool is_valid() const @@ -7160,7 +7160,7 @@ struct ObRegistClusterArg { return cluster_id_ > 0 && !cluster_name_.empty(); } - public: +public: common::ObString cluster_name_; uint64_t cluster_id_; bool pre_regist_; @@ -7171,7 +7171,7 @@ struct ObRegistClusterArg { struct ObAlterTableResArg { OB_UNIS_VERSION(1); - public: +public: ObAlterTableResArg() : schema_type_(share::schema::OB_MAX_SCHEMA), schema_id_(common::OB_INVALID_ID), @@ -7183,7 +7183,7 @@ struct ObAlterTableResArg { {} void reset(); - public: +public: TO_STRING_KV(K_(schema_type), K_(schema_id), K_(schema_version)); share::schema::ObSchemaType schema_type_; uint64_t schema_id_; @@ -7193,7 +7193,7 @@ struct ObAlterTableResArg { struct ObAlterTableRes { OB_UNIS_VERSION(1); - public: +public: ObAlterTableRes() : index_table_id_(common::OB_INVALID_ID), constriant_id_(common::OB_INVALID_ID), @@ -7202,7 +7202,7 @@ struct ObAlterTableRes { {} void reset(); - public: +public: TO_STRING_KV(K_(index_table_id), K_(constriant_id), K_(schema_version), K_(res_arg_array)); uint64_t index_table_id_; uint64_t constriant_id_; @@ -7213,7 +7213,7 @@ struct ObAlterTableRes { struct ObRegistClusterRes { OB_UNIS_VERSION(1); - public: +public: ObRegistClusterRes() : cluster_idx_(common::OB_INVALID_INDEX) {} bool is_valid() const @@ -7231,7 +7231,7 @@ struct ObRegistClusterRes { int set_primary_cluster(const share::ObClusterAddr& primary_cluster); void reset(); - public: +public: TO_STRING_KV(K_(cluster_idx), K_(login_name)); int64_t cluster_idx_; share::ObClusterInfo::UserNameString login_name_; @@ -7242,7 +7242,7 @@ struct ObRegistClusterRes { struct ObStandbyHeartBeatRes { OB_UNIS_VERSION(1); - public: +public: ObStandbyHeartBeatRes() : primary_addr_(), standby_addr_(), @@ -7276,7 +7276,7 @@ struct ObStandbyHeartBeatRes { protection_mode_ = common::MAXIMUM_PROTECTION_MODE; } - public: +public: TO_STRING_KV(K_(primary_addr), K_(standby_addr), K_(primary_schema_info), K_(protection_mode)); share::ObClusterAddr primary_addr_; share::ObClusterAddr standby_addr_; @@ -7288,13 +7288,13 @@ struct ObStandbyHeartBeatRes { struct ObGetSwitchoverStatusRes { OB_UNIS_VERSION(1); - public: +public: ObGetSwitchoverStatusRes() : switchover_status_(share::ObClusterInfo::I_INVALID), switchover_info_() {} ~ObGetSwitchoverStatusRes() {} - public: +public: TO_STRING_KV(K_(switchover_status), K_(switchover_info)); share::ObClusterInfo::InMemorySwitchOverStatus switchover_status_; share::ObClusterSwitchoverInfoWrap switchover_info_; @@ -7303,7 +7303,7 @@ struct ObGetSwitchoverStatusRes { struct ObGetTenantSchemaVersionArg { OB_UNIS_VERSION(1); - public: +public: ObGetTenantSchemaVersionArg() : tenant_id_(common::OB_INVALID_TENANT_ID) {} bool is_valid() const @@ -7318,7 +7318,7 @@ struct ObGetTenantSchemaVersionArg { struct ObGetTenantSchemaVersionResult { OB_UNIS_VERSION(1); - public: +public: ObGetTenantSchemaVersionResult() : schema_version_(common::OB_INVALID_VERSION) {} bool is_valid() const @@ -7333,7 +7333,7 @@ struct ObGetTenantSchemaVersionResult { struct ObFinishReplayArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObFinishReplayArg() : schema_version_(common::OB_INVALID_VERSION) {} bool is_valid() const @@ -7352,7 +7352,7 @@ struct ObFinishReplayArg : public ObDDLArg { struct ObTenantMemoryArg { OB_UNIS_VERSION(1); - public: +public: ObTenantMemoryArg() : tenant_id_(0), memory_size_(0), refresh_interval_(0) {} bool is_valid() const @@ -7369,7 +7369,7 @@ struct ObTenantMemoryArg { struct ObProfileDDLArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObProfileDDLArg() : ObDDLArg(), schema_(), ddl_type_(), is_cascade_(false) {} virtual bool is_allow_when_upgrade() const @@ -7386,7 +7386,7 @@ struct ObProfileDDLArg : public ObDDLArg { struct ObCheckServerEmptyArg { OB_UNIS_VERSION(1); - public: +public: enum Mode { BOOTSTRAP, ADD_SERVER }; ObCheckServerEmptyArg() : mode_(BOOTSTRAP) @@ -7398,7 +7398,7 @@ struct ObCheckServerEmptyArg { struct ObForceDropSchemaArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObForceDropSchemaArg() : ObDDLArg(), recycle_schema_version_(common::OB_INVALID_VERSION), @@ -7431,7 +7431,7 @@ struct ObForceDropSchemaArg : public ObDDLArg { struct ObArchiveLogArg { OB_UNIS_VERSION(1); - public: +public: ObArchiveLogArg() : enable_(true) {} TO_STRING_KV(K_(enable)); @@ -7441,7 +7441,7 @@ struct ObArchiveLogArg { struct ObBackupDatabaseArg { OB_UNIS_VERSION(1); - public: +public: ObBackupDatabaseArg(); bool is_valid() const; TO_STRING_KV(K_(tenant_id), K_(is_incremental), K_(passwd), K_(encryption_mode)); @@ -7454,7 +7454,7 @@ struct ObBackupDatabaseArg { struct ObBackupManageArg { OB_UNIS_VERSION(1); - public: +public: enum Type { CANCEL_BACKUP = 0, SUSPEND_BACKUP = 1, @@ -7480,7 +7480,7 @@ struct ObBackupManageArg { struct ObCheckStandbyCanAccessArg { OB_UNIS_VERSION(1); - public: +public: ObCheckStandbyCanAccessArg() : failover_epoch_(common::OB_INVALID_VERSION), last_merged_version_(common::OB_INVALID_VERSION), @@ -7504,7 +7504,7 @@ struct ObCheckStandbyCanAccessArg { struct ObPhysicalFlashbackResultArg { OB_UNIS_VERSION(1); - public: +public: ObPhysicalFlashbackResultArg() : min_version_(common::OB_INVALID_VERSION), max_version_(common::OB_INVALID_VERSION), enable_result_(false) {} @@ -7519,7 +7519,7 @@ struct ObPhysicalFlashbackResultArg { struct ObCheckPhysicalFlashbackArg { OB_UNIS_VERSION(1); - public: +public: ObCheckPhysicalFlashbackArg() : merged_version_(common::OB_INVALID_VERSION), flashback_scn_(common::OB_INVALID_VERSION) {} @@ -7527,7 +7527,7 @@ struct ObCheckPhysicalFlashbackArg { {} TO_STRING_KV(K_(merged_version), K_(flashback_scn)); - public: +public: int64_t merged_version_; int64_t flashback_scn_; }; @@ -7535,7 +7535,7 @@ struct ObCheckPhysicalFlashbackArg { struct CheckLeaderRpcIndex { OB_UNIS_VERSION(1); - public: +public: int64_t switchover_timestamp_; // Switch logo int64_t epoch_; //(switchover_timestamp, epoch) uniquely identifies a statistical information during a switching // process @@ -7560,7 +7560,7 @@ struct CheckLeaderRpcIndex { struct ObBatchWriteCutdataClogArg { OB_UNIS_VERSION(1); - public: +public: ObBatchWriteCutdataClogArg() { reset(); @@ -7631,7 +7631,7 @@ struct ObBatchWriteCutdataClogArg { TO_STRING_KV( K_(switchover_timestamp), K_(pkeys), K_(flashback_ts), K_(schema_version), K_(trace_id), K_(query_end_time)); - public: +public: static const int64_t MAX_COUNT = 1024; int64_t switchover_timestamp_; ObPkeyArray pkeys_; @@ -7645,7 +7645,7 @@ struct ObBatchWriteCutdataClogArg { struct ObBatchCheckLeaderArg { OB_UNIS_VERSION(1); - public: +public: ObPkeyArray pkeys_; CheckLeaderRpcIndex index_; common::ObCurTraceId::TraceId trace_id_; // TODO: set trace to facilitate tracking @@ -7675,7 +7675,7 @@ struct ObBatchCheckLeaderArg { struct ObBatchCheckRes { OB_UNIS_VERSION(1); - public: +public: common::ObSArray results_; // Corresponding to the above pkeys--, true means there is a master, false means no // master CheckLeaderRpcIndex index_; // Same value as ObBatchCheckLeaderArg @@ -7693,7 +7693,7 @@ struct ObBatchCheckRes { struct ObRebuildIndexInRestoreArg { OB_UNIS_VERSION(1); - public: +public: ObRebuildIndexInRestoreArg() : tenant_id_(common::OB_INVALID_TENANT_ID) {} ~ObRebuildIndexInRestoreArg() @@ -7707,7 +7707,7 @@ struct ObRebuildIndexInRestoreArg { tenant_id_ = common::OB_INVALID_TENANT_ID; } - public: +public: uint64_t tenant_id_; TO_STRING_KV(K_(tenant_id)); }; @@ -7715,7 +7715,7 @@ struct ObRebuildIndexInRestoreArg { struct ObUpdateTableSchemaVersionArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObUpdateTableSchemaVersionArg() : tenant_id_(common::OB_INVALID_TENANT_ID), table_id_(common::OB_INVALID_ID), @@ -7733,7 +7733,7 @@ struct ObUpdateTableSchemaVersionArg : public ObDDLArg { TO_STRING_KV(K_(tenant_id), K_(table_id), K_(schema_version)); void reset(); - public: +public: uint64_t tenant_id_; uint64_t table_id_; int64_t schema_version_; @@ -7742,7 +7742,7 @@ struct ObUpdateTableSchemaVersionArg : public ObDDLArg { struct ObRestoreModifySchemaArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: enum TYPE { INVALID_TYPE, RESET_DATABASE_PRIMARY_ZONE, @@ -7755,7 +7755,7 @@ struct ObRestoreModifySchemaArg : public ObDDLArg { MAX_TYPE, }; - public: +public: ObRestoreModifySchemaArg() : type_(INVALID_TYPE), schema_id_(common::OB_INVALID_ID) {} ~ObRestoreModifySchemaArg() @@ -7763,7 +7763,7 @@ struct ObRestoreModifySchemaArg : public ObDDLArg { bool is_valid() const; TO_STRING_KV(K_(type), K_(schema_id)); - public: +public: TYPE type_; uint64_t schema_id_; }; @@ -7771,7 +7771,7 @@ struct ObRestoreModifySchemaArg : public ObDDLArg { struct ObCheckDeploymentModeArg { OB_UNIS_VERSION(1); - public: +public: ObCheckDeploymentModeArg() : single_zone_deployment_on_(false) {} TO_STRING_KV(K_(single_zone_deployment_on)); @@ -7781,7 +7781,7 @@ struct ObCheckDeploymentModeArg { struct ObPreProcessServerArg { OB_UNIS_VERSION(1); - public: +public: ObPreProcessServerArg() : server_(), rescue_server_() {} TO_STRING_KV(K_(server)); @@ -7791,7 +7791,7 @@ struct ObPreProcessServerArg { } int init(const common::ObAddr& server, const common::ObAddr& rescue_server); - public: +public: common::ObAddr server_; common::ObAddr rescue_server_; }; @@ -7799,7 +7799,7 @@ struct ObPreProcessServerArg { struct ObAdminRollingUpgradeArg { OB_UNIS_VERSION(1); - public: +public: ObAdminRollingUpgradeArg() : stage_(OB_UPGRADE_STAGE_MAX) {} ~ObAdminRollingUpgradeArg() @@ -7813,7 +7813,7 @@ struct ObAdminRollingUpgradeArg { struct ObPreProcessServerReplyArg { OB_UNIS_VERSION(1); - public: +public: ObPreProcessServerReplyArg() : server_(), rescue_server_(), ret_code_(common::OB_SUCCESS) {} TO_STRING_KV(K_(server), K_(rescue_server), K_(ret_code)); @@ -7823,7 +7823,7 @@ struct ObPreProcessServerReplyArg { } int init(const common::ObAddr& server, const common::ObAddr& rescue_server, const int ret_code); - public: +public: common::ObAddr server_; common::ObAddr rescue_server_; int ret_code_; @@ -7832,7 +7832,7 @@ struct ObPreProcessServerReplyArg { struct ObRsListArg { OB_UNIS_VERSION(1); - public: +public: ObRsListArg() : rs_list_(), master_rs_() {} ~ObRsListArg() @@ -7849,7 +7849,7 @@ struct ObRsListArg { struct ObLocationRpcRenewArg { OB_UNIS_VERSION(1); - public: +public: ObLocationRpcRenewArg() : keys_() {} ObLocationRpcRenewArg(common::ObIAllocator& allocator); @@ -7867,7 +7867,7 @@ struct ObLocationRpcRenewArg { struct ObLocationRpcRenewResult { OB_UNIS_VERSION(1); - public: +public: ObLocationRpcRenewResult() : results_() {} ~ObLocationRpcRenewResult() @@ -7884,7 +7884,7 @@ struct ObLocationRpcRenewResult { struct ObGetMasterKeyResultArg { OB_UNIS_VERSION(1); - public: +public: ObGetMasterKeyResultArg() : str_(share::OB_CLOG_ENCRYPT_MASTER_KEY_LEN, 0, buf_) {} ~ObGetMasterKeyResultArg() @@ -7901,7 +7901,7 @@ struct ObGetMasterKeyResultArg { struct ObKillPartTransCtxArg { OB_UNIS_VERSION(1); - public: +public: ObKillPartTransCtxArg() {} ~ObKillPartTransCtxArg() @@ -7918,7 +7918,7 @@ struct ObKillPartTransCtxArg { struct ObPhysicalRestoreResult { OB_UNIS_VERSION(1); - public: +public: ObPhysicalRestoreResult(); virtual ~ObPhysicalRestoreResult() {} @@ -7937,7 +7937,7 @@ struct ObPhysicalRestoreResult { struct ObExecuteRangePartSplitArg : public ObDDLArg { OB_UNIS_VERSION(1); - public: +public: ObExecuteRangePartSplitArg() : ObDDLArg(), partition_key_(), rowkey_() {} virtual ~ObExecuteRangePartSplitArg() @@ -7958,7 +7958,7 @@ struct ObExecuteRangePartSplitArg : public ObDDLArg { struct ObRefreshTimezoneArg { OB_UNIS_VERSION(1); - public: +public: ObRefreshTimezoneArg() : tenant_id_(common::OB_INVALID_TENANT_ID) {} ObRefreshTimezoneArg(uint64_t tenant_id) : tenant_id_(tenant_id) @@ -7976,7 +7976,7 @@ struct ObRefreshTimezoneArg { struct ObCreateRestorePointArg { OB_UNIS_VERSION(1); - public: +public: ObCreateRestorePointArg() : tenant_id_(0), name_() {} int assign(const ObCreateRestorePointArg& arg) @@ -7998,7 +7998,7 @@ struct ObCreateRestorePointArg { struct ObDropRestorePointArg { OB_UNIS_VERSION(1); - public: +public: ObDropRestorePointArg() : tenant_id_(0), name_() {} int assign(const ObDropRestorePointArg& arg) @@ -8020,7 +8020,7 @@ struct ObDropRestorePointArg { struct ObCheckBuildIndexTaskExistArg { OB_UNIS_VERSION(1); - public: +public: ObCheckBuildIndexTaskExistArg() : tenant_id_(0), task_id_(), scheduler_id_(0) {} diff --git a/src/share/ob_rs_mgr.h b/src/share/ob_rs_mgr.h index 748a92726..6fb4bfa3f 100644 --- a/src/share/ob_rs_mgr.h +++ b/src/share/ob_rs_mgr.h @@ -36,23 +36,17 @@ namespace share { class IHeartBeatProcess; class ObUnifiedAddrAgent : public ObRootAddrAgent { - public: +public: ObUnifiedAddrAgent(); - int init(common::ObMySQLProxy &sql_proxy, common::ObServerConfig &config); - virtual int store(const ObIAddrList &addr_list, const ObIAddrList &readonly_addr_list, - const bool force, const common::ObClusterType cluster_type, - const int64_t timestamp) override; - virtual int fetch(ObIAddrList &addr_list, ObIAddrList &readonly_addr_list, - common::ObClusterType &cluster_typ) override; - virtual int fetch_remote_rslist(const int64_t cluster_id, - ObIAddrList &addr_list, - ObIAddrList &readonly_addr_list, - common::ObClusterType &cluster_type) override; - int fetch_rslist_by_agent_idx(const int64_t index, - const int64_t cluster_id, - ObIAddrList &addr_list, - ObIAddrList &readonly_addr_list, - common::ObClusterType &cluster_type); + int init(common::ObMySQLProxy& sql_proxy, common::ObServerConfig& config); + virtual int store(const ObIAddrList& addr_list, const ObIAddrList& readonly_addr_list, const bool force, + const common::ObClusterType cluster_type, const int64_t timestamp) override; + virtual int fetch( + ObIAddrList& addr_list, ObIAddrList& readonly_addr_list, common::ObClusterType& cluster_typ) override; + virtual int fetch_remote_rslist(const int64_t cluster_id, ObIAddrList& addr_list, ObIAddrList& readonly_addr_list, + common::ObClusterType& cluster_type) override; + int fetch_rslist_by_agent_idx(const int64_t index, const int64_t cluster_id, ObIAddrList& addr_list, + ObIAddrList& readonly_addr_list, common::ObClusterType& cluster_type); int64_t get_agent_num() const { return AGENT_NUM; @@ -61,7 +55,7 @@ class ObUnifiedAddrAgent : public ObRootAddrAgent { int reload(); bool is_valid() override; - private: +private: const static int64_t AGENT_NUM = 3; bool is_inited_; // ObWebServiceRootAddr and ObInnerConfigRootAddr @@ -82,7 +76,7 @@ class ObUnifiedAddrAgent : public ObRootAddrAgent { * 2 detect master rs if needed */ class ObRsMgr { - public: +public: friend class ObLeaseStateMgr; ObRsMgr(); virtual ~ObRsMgr(); @@ -102,14 +96,14 @@ class ObRsMgr { int do_detect_master_rs_v3(const common::ObIArray& server_list, ObPartitionInfo& partition_info); int fetch_rs_list(ObIAddrList& addr_list, ObIAddrList& readonly_addr_list); - private: +private: int renew_master_rootserver_v2(); int do_detect_master_rs_v2(common::ObIArray& rs_list); int renew_master_rootserver_v3(); int do_detect_master_rs_v3( const common::ObAddr& dst_server, const int64_t cluster_id, obrpc::ObGetRootserverRoleResult& result); - private: +private: static const int64_t DETECT_MASTER_TIMEOUT = 1 * 1000 * 1000; // 1s typedef common::ObSEArray RsList; diff --git a/src/share/ob_scanner.h b/src/share/ob_scanner.h index a3d9faedc..877dfc246 100644 --- a/src/share/ob_scanner.h +++ b/src/share/ob_scanner.h @@ -34,11 +34,11 @@ class ObIAllocator; class ObScanner { OB_UNIS_VERSION(1); - public: +public: static const int64_t DEFAULT_MAX_SERIALIZE_SIZE = (OB_MAX_PACKET_LENGTH - OB_MAX_ROW_KEY_LENGTH * 2 - 1024); typedef ObRowStore::Iterator Iterator; - public: +public: ObScanner(const char* label = ObModIds::OB_NEW_SCANNER, ObIAllocator* allocator = NULL, int64_t mem_size_limit = DEFAULT_MAX_SERIALIZE_SIZE, uint64_t tenant_id = common::OB_SERVER_TENANT_ID, bool use_row_compact = true); @@ -260,7 +260,7 @@ class ObScanner { last_insert_id_to_client_, N_LAST_INSERT_ID_SESSION, last_insert_id_session_, K_(is_result_accurate), K_(trans_result), K_(implicit_cursors), K_(rcode)); - protected: +protected: ObRowStore row_store_; int64_t mem_size_limit_; /**< memory size of row store */ uint64_t tenant_id_; @@ -287,12 +287,12 @@ class ObScanner { sql::ObChunkDatumStore datum_store_; obrpc::ObRpcResultCode rcode_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObScanner); }; class ObScannerable { - public: +public: ObScannerable(){}; virtual ~ObScannerable(){}; virtual int get_scanner(ObIAllocator& allocator, ObScanner& scanner) = 0; diff --git a/src/share/ob_schema_status_proxy.h b/src/share/ob_schema_status_proxy.h index 886b03578..2f2dd4dd3 100644 --- a/src/share/ob_schema_status_proxy.h +++ b/src/share/ob_schema_status_proxy.h @@ -32,7 +32,7 @@ class ObMySQLResult; namespace share { class ObSchemaStatusSnapshotUpdater { - public: +public: ObSchemaStatusSnapshotUpdater(int64_t snapshot_timestamp) : snapshot_timestamp_(snapshot_timestamp) {} virtual ~ObSchemaStatusSnapshotUpdater() @@ -40,13 +40,13 @@ class ObSchemaStatusSnapshotUpdater { int operator()(common::hash::HashMapPair& entry); - private: +private: int64_t snapshot_timestamp_; DISALLOW_COPY_AND_ASSIGN(ObSchemaStatusSnapshotUpdater); }; class ObSchemaStatusVersionUpdater { - public: +public: ObSchemaStatusVersionUpdater(int64_t readable_schema_version) : readable_schema_version_(readable_schema_version) {} virtual ~ObSchemaStatusVersionUpdater() @@ -54,13 +54,13 @@ class ObSchemaStatusVersionUpdater { int operator()(common::hash::HashMapPair& entry); - private: +private: int64_t readable_schema_version_; DISALLOW_COPY_AND_ASSIGN(ObSchemaStatusVersionUpdater); }; class ObSchemaStatusCreatedVersionUpdater { - public: +public: ObSchemaStatusCreatedVersionUpdater(int64_t created_schema_version) : created_schema_version_(created_schema_version) {} virtual ~ObSchemaStatusCreatedVersionUpdater() @@ -68,13 +68,13 @@ class ObSchemaStatusCreatedVersionUpdater { int operator()(common::hash::HashMapPair& entry); - private: +private: int64_t created_schema_version_; DISALLOW_COPY_AND_ASSIGN(ObSchemaStatusCreatedVersionUpdater); }; class ObSchemaStatusUpdater { - public: +public: ObSchemaStatusUpdater(share::schema::ObRefreshSchemaStatus schema_status) : schema_status_(schema_status) {} virtual ~ObSchemaStatusUpdater() @@ -82,14 +82,14 @@ class ObSchemaStatusUpdater { int operator()(common::hash::HashMapPair& entry); - private: +private: share::schema::ObRefreshSchemaStatus schema_status_; DISALLOW_COPY_AND_ASSIGN(ObSchemaStatusUpdater); }; // all operation of __all_core_table must be single partition transaction class ObSchemaStatusProxy { - public: +public: static const char* OB_ALL_SCHEMA_STATUS_TNAME; static const char* TENANT_ID_CNAME; static const char* SNAPSHOT_TIMESTAMP_CNAME; @@ -97,7 +97,7 @@ class ObSchemaStatusProxy { static const char* CREATED_SCHEMA_VERSION_CNAME; static const int64_t TENANT_SCHEMA_STATUS_BUCKET_NUM = 100; - public: +public: ObSchemaStatusProxy(common::ObISQLClient& sql_proxy) : sql_proxy_(sql_proxy), schema_status_cache_(), is_inited_(false) {} @@ -128,10 +128,10 @@ class ObSchemaStatusProxy { int update_schema_status(const share::schema::ObRefreshSchemaStatus& curr_schema_status); - private: +private: int check_inner_stat(); - private: +private: common::ObISQLClient& sql_proxy_; common::hash::ObHashMap schema_status_cache_; diff --git a/src/share/ob_server_blacklist.h b/src/share/ob_server_blacklist.h index a3faa6b15..08a964ca5 100644 --- a/src/share/ob_server_blacklist.h +++ b/src/share/ob_server_blacklist.h @@ -37,7 +37,7 @@ namespace share { class ObIPSCb; struct ObDstServerInfo { - public: +public: ObDstServerInfo() : last_send_timestamp_(common::OB_INVALID_TIMESTAMP), last_recv_timestamp_(common::OB_INVALID_TIMESTAMP), @@ -66,7 +66,7 @@ struct ObDstServerInfo { }; struct ObBlacklistInfo { - public: +public: ObBlacklistInfo() {} ~ObBlacklistInfo() @@ -91,11 +91,11 @@ struct ObBlacklistInfo { }; class ObServerBlacklist : public lib::TGRunnable { - public: +public: ObServerBlacklist(); ~ObServerBlacklist(); - public: +public: typedef common::ObSimpleIterator ObBlacklistInfoIterator; static ObServerBlacklist& get_instance(); int init(const common::ObAddr& self, rpc::frame::ObReqTransport* transport, obrpc::ObBatchRpc* batch_rpc); @@ -113,17 +113,17 @@ class ObServerBlacklist : public lib::TGRunnable { void enable_blacklist(); void clear_blacklist(); - private: +private: void run1(); void blacklist_loop_(); int send_req_(const share::ObCascadMember& member, const obrpc::ObBlacklistReq& req); int send_resp_(const common::ObAddr& server, const int64_t dst_cluster_id, const obrpc::ObBlacklistResp& resp); - private: +private: typedef common::ObLinearHashMap DstInfoMap; class ObMapRemoveFunctor { - public: + public: ObMapRemoveFunctor(common::ObIArray& dst_list) : remove_cnt_(0), dst_list_(dst_list) {} ~ObMapRemoveFunctor() @@ -134,13 +134,13 @@ class ObServerBlacklist : public lib::TGRunnable { return remove_cnt_; } - private: + private: int64_t remove_cnt_; common::ObIArray& dst_list_; }; class ObMapResetFunctor { - public: + public: ObMapResetFunctor() : reset_cnt_(0) {} ~ObMapResetFunctor() @@ -151,12 +151,12 @@ class ObServerBlacklist : public lib::TGRunnable { return reset_cnt_; } - private: + private: int64_t reset_cnt_; }; class ObMapMarkBlackFunctor { - public: + public: explicit ObMapMarkBlackFunctor(const int64_t curr_ts) : mark_cnt_(0), curr_ts_(curr_ts) {} ~ObMapMarkBlackFunctor() @@ -167,25 +167,25 @@ class ObServerBlacklist : public lib::TGRunnable { return mark_cnt_; } - private: + private: int64_t mark_cnt_; int64_t curr_ts_; }; class ObMapRespFunctor { - public: + public: explicit ObMapRespFunctor(const obrpc::ObBlacklistResp& resp) : resp_(resp) {} ~ObMapRespFunctor() {} bool operator()(const share::ObCascadMember& member, ObDstServerInfo& info); - private: + private: obrpc::ObBlacklistResp resp_; }; class ObMapSendReqFunctor { - public: + public: explicit ObMapSendReqFunctor(ObServerBlacklist* blacklist, const common::ObAddr& self) : blacklist_(blacklist), self_(self), send_cnt_(0) {} @@ -197,28 +197,28 @@ class ObServerBlacklist : public lib::TGRunnable { return send_cnt_; } - private: + private: ObServerBlacklist* blacklist_; common::ObAddr self_; int64_t send_cnt_; }; class ObMapIterFunctor { - public: + public: ObMapIterFunctor(ObBlacklistInfoIterator& info_iter) : info_iter_(info_iter) {} ~ObMapIterFunctor() {} bool operator()(const share::ObCascadMember& ObCascadMember, ObDstServerInfo& info); - private: + private: ObBlacklistInfoIterator& info_iter_; }; - public: +public: static uint64_t black_svr_cnt_; - private: +private: // RPC latency threshold static const int64_t RPC_TRANS_TIME_THRESHOLD = 500 * 1000; // Clock skew threshold @@ -230,7 +230,7 @@ class ObServerBlacklist : public lib::TGRunnable { // Timeout threshold used to mark one server in blacklist static const int32_t BLACKLIST_MARK_THRESHOLD = 10 * 1000 * 1000; - private: +private: bool is_inited_; bool is_enabled_; common::ObAddr self_; diff --git a/src/share/ob_server_locality_cache.h b/src/share/ob_server_locality_cache.h index c1271ebcf..1c83b1f78 100644 --- a/src/share/ob_server_locality_cache.h +++ b/src/share/ob_server_locality_cache.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace share { class ObServerLocality { - public: +public: ObServerLocality(); virtual ~ObServerLocality(); void reset(); @@ -89,7 +89,7 @@ class ObServerLocality { TO_STRING_KV(K_(inited), K_(addr), K_(zone), K_(zone_type), K_(idc), K_(region), K_(is_idle), K_(is_active), K_(start_service_time), K_(server_stop_time), K_(server_status)); - private: +private: bool inited_; bool is_idle_; bool is_active_; @@ -102,12 +102,12 @@ class ObServerLocality { int64_t server_stop_time_; ObServerStatus::DisplayStatus server_status_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObServerLocality); }; class ObServerLocalityCache { - public: +public: ObServerLocalityCache(); virtual ~ObServerLocalityCache(); int init(); @@ -127,11 +127,11 @@ class ObServerLocalityCache { int record_server_idc(const common::ObAddr& server, const common::ObIDC& idc); TO_STRING_KV(K_(server_locality_array), K_(has_readonly_zone)); - private: +private: int get_server_region_from_map_(const common::ObAddr& server, common::ObRegion& region) const; int get_server_idc_from_map_(const common::ObAddr& server, common::ObIDC& idc) const; - private: +private: mutable common::SpinRWLock rwlock_; common::ObSEArray server_locality_array_; common::ObLinearHashMap server_cid_map_; // store @@ -140,7 +140,7 @@ class ObServerLocalityCache { bool has_readonly_zone_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObServerLocalityCache); }; } // namespace share diff --git a/src/share/ob_server_status.h b/src/share/ob_server_status.h index 0268490dd..1f81b0faa 100644 --- a/src/share/ob_server_status.h +++ b/src/share/ob_server_status.h @@ -179,7 +179,7 @@ struct ObServerStatus { int64_t ssl_key_expired_time_; bool in_recovery_for_takenover_by_rs_; - private: +private: static int get_status_str(const char* strs[], const int64_t strs_len, const int64_t status, const char*& str); }; diff --git a/src/share/ob_snapshot_table_proxy.h b/src/share/ob_snapshot_table_proxy.h index 34d5c5602..f87321fc0 100644 --- a/src/share/ob_snapshot_table_proxy.h +++ b/src/share/ob_snapshot_table_proxy.h @@ -24,7 +24,7 @@ class ObISQLClient; } namespace share { struct ObSnapshotInfo { - public: +public: share::ObSnapShotType snapshot_type_; int64_t snapshot_ts_; int64_t schema_version_; @@ -40,7 +40,7 @@ struct ObSnapshotInfo { }; struct TenantSnapshot { - public: +public: uint64_t tenant_id_; int64_t snapshot_ts_; TenantSnapshot() @@ -55,7 +55,7 @@ struct TenantSnapshot { }; class ObSnapshotTableProxy { - public: +public: ObSnapshotTableProxy() : lock_(), last_event_ts_(0) {} virtual ~ObSnapshotTableProxy() @@ -81,13 +81,13 @@ class ObSnapshotTableProxy { int get_snapshot_count( common::ObISQLClient& proxy, const int64_t tenant_id, share::ObSnapShotType snapshot_type, int64_t& count); - private: +private: int inner_add_snapshot(common::ObMySQLTransaction& trans, const ObSnapshotInfo& info, const bool& insert_update); int gen_event_ts(int64_t& event_ts); int check_snapshot_valid( common::ObISQLClient& client, const ObSnapshotInfo& info, const bool& need_lock_gc_snapshot, bool& is_valid); - private: +private: lib::ObMutex lock_; int64_t last_event_ts_; }; diff --git a/src/share/ob_srv_rpc_proxy.h b/src/share/ob_srv_rpc_proxy.h index 5ceed6053..f1a04b8b1 100644 --- a/src/share/ob_srv_rpc_proxy.h +++ b/src/share/ob_srv_rpc_proxy.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace obrpc { class ObSrvRpcProxy : public ObRpcProxy { - public: +public: DEFINE_TO(ObSrvRpcProxy); // special usage when can't deliver request. diff --git a/src/share/ob_sstable_checksum_iterator.h b/src/share/ob_sstable_checksum_iterator.h index c77a7e231..f4e4f2f6a 100644 --- a/src/share/ob_sstable_checksum_iterator.h +++ b/src/share/ob_sstable_checksum_iterator.h @@ -21,7 +21,7 @@ namespace share { class ObIMergeErrorCb; class ObSSTableDataChecksumInfo { - public: +public: ObSSTableDataChecksumInfo() = default; virtual ~ObSSTableDataChecksumInfo() = default; void reset(); @@ -35,26 +35,26 @@ class ObSSTableDataChecksumInfo { } TO_STRING_KV(K_(replicas)); - private: +private: static const int64_t DEFAULT_REPLICA_COUNT = 7; common::ObSEArray replicas_; }; class ObSSTableDataChecksumIterator { class ObIDataChecksumItemFiter : public common::ObDLinkBase { - public: + public: ObIDataChecksumItemFiter() {} virtual ~ObIDataChecksumItemFiter() {} virtual int filter(const ObSSTableDataChecksumItem& item, bool& is_filtered) = 0; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObIDataChecksumItemFiter); }; class ObOnlyUserTenantChecksumItemFilter : public ObIDataChecksumItemFiter { - public: + public: ObOnlyUserTenantChecksumItemFilter() = default; virtual ~ObOnlyUserTenantChecksumItemFilter() = default; int filter(const ObSSTableDataChecksumItem& item, bool& is_filtered) override @@ -69,12 +69,12 @@ class ObSSTableDataChecksumIterator { return ret; } - private: + private: DISALLOW_COPY_AND_ASSIGN(ObOnlyUserTenantChecksumItemFilter); }; class ObSpecialTableChecksumItemFilter : public ObIDataChecksumItemFiter { - public: + public: ObSpecialTableChecksumItemFilter() = default; virtual ~ObSpecialTableChecksumItemFilter() = default; int filter(const ObSSTableDataChecksumItem& item, bool& is_filtered) override @@ -89,11 +89,11 @@ class ObSSTableDataChecksumIterator { return ret; } - private: + private: DISALLOW_COPY_AND_ASSIGN(ObSpecialTableChecksumItemFilter); }; - public: +public: ObSSTableDataChecksumIterator() : cur_idx_(0), sql_proxy_(nullptr), merge_error_cb_(nullptr) {} virtual ~ObSSTableDataChecksumIterator() @@ -106,11 +106,11 @@ class ObSSTableDataChecksumIterator { int set_only_user_tenant_filter(); void reset(); - private: +private: int fetch_next_batch_(); int filter_(const ObSSTableDataChecksumItem& item, bool& is_filtered); - private: +private: static const int64_t BATCH_CNT = 999; common::ObSEArray fetched_checksum_items_; int64_t cur_idx_; diff --git a/src/share/ob_sstable_checksum_operator.h b/src/share/ob_sstable_checksum_operator.h index e8e6a47bb..f2f223558 100644 --- a/src/share/ob_sstable_checksum_operator.h +++ b/src/share/ob_sstable_checksum_operator.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace share { // sstable data checksum item struct ObSSTableDataChecksumItem { - public: +public: ObSSTableDataChecksumItem(); virtual ~ObSSTableDataChecksumItem() = default; void reset(); @@ -46,7 +46,7 @@ struct ObSSTableDataChecksumItem { }; class ObSSTableDataChecksumOperator { - public: +public: ObSSTableDataChecksumOperator() = default; virtual ~ObSSTableDataChecksumOperator() = default; static int get_checksum(ObSSTableDataChecksumItem& item, common::ObISQLClient& proxy); @@ -67,7 +67,7 @@ class ObSSTableDataChecksumOperator { static int check_table_checksum( const uint64_t data_table_id, const uint64_t index_id, common::ObISQLClient& sql_proxy, bool& is_checksum_valid); - private: +private: static int fill_one_item(const ObSSTableDataChecksumItem& item, share::ObDMLSqlSplicer& dml); static int get_checksum(const common::ObSqlString& sql, common::ObIArray& items, common::ObISQLClient& sql_proxy); @@ -75,7 +75,7 @@ class ObSSTableDataChecksumOperator { }; struct ObSSTableColumnChecksumItem { - public: +public: ObSSTableColumnChecksumItem() : tenant_id_(common::OB_INVALID_ID), data_table_id_(common::OB_INVALID_ID), @@ -115,7 +115,7 @@ struct ObSSTableColumnChecksumItem { }; class ObSSTableColumnChecksumOperator { - public: +public: ObSSTableColumnChecksumOperator() = default; virtual ~ObSSTableColumnChecksumOperator() = default; static int batch_report_checksum( @@ -128,13 +128,13 @@ class ObSSTableColumnChecksumOperator { const share::schema::ObTableSchema& index_table_schema, const int64_t global_snapshot_version, common::ObMySQLProxy& sql_proxy); - private: +private: static int fill_one_item(const ObSSTableColumnChecksumItem& item, share::ObDMLSqlSplicer& dml); static int remove_one_item(const ObSSTableColumnChecksumItem& item, common::ObMySQLProxy& sql_proxy); static int get_checksum(const uint64_t tenant_id, const common::ObSqlString& sql, common::ObIArray& items, common::ObMySQLProxy& sql_proxy); - private: +private: static int get_table_column_checksum(const share::schema::ObTableSchema& data_table_schema, const share::schema::ObTableSchema& index_table_schema, const int64_t global_snapshot_version, common::ObMySQLProxy& mysql_proxy, int64_t& snapshot_version, @@ -142,7 +142,7 @@ class ObSSTableColumnChecksumOperator { }; struct ObSSTableChecksumItem { - public: +public: ObSSTableChecksumItem() : data_checksum_(), column_checksum_() {} ~ObSSTableChecksumItem() diff --git a/src/share/ob_task_define.cpp b/src/share/ob_task_define.cpp index f1ffa068b..bac13f094 100644 --- a/src/share/ob_task_define.cpp +++ b/src/share/ob_task_define.cpp @@ -24,7 +24,7 @@ namespace share { class ObLogRateLimiter : public lib::ObSimpleRateLimiter { friend class ObTaskController; - public: +public: bool is_force_allows() const override { return OB_UNLIKELY(allows_ > 0); @@ -36,7 +36,7 @@ class ObLogRateLimiter : public lib::ObSimpleRateLimiter { } } - private: +private: static RLOCAL(int64_t, allows_); }; diff --git a/src/share/ob_task_define.h b/src/share/ob_task_define.h index 9b9490e1d..1c6eafa4b 100644 --- a/src/share/ob_task_define.h +++ b/src/share/ob_task_define.h @@ -32,7 +32,7 @@ class ObTaskController { static constexpr auto MAX_TASK_ID = toUType(ObTaskType::MAX); static constexpr int64_t LOG_RATE_LIMIT = 10 << 20; - public: +public: ObTaskController(); virtual ~ObTaskController(); @@ -45,7 +45,7 @@ class ObTaskController { static ObTaskController& get(); - private: +private: template void set_log_rate(int64_t rate) { @@ -69,7 +69,7 @@ class ObTaskController { return limiters_[toUType(id)]; }; - private: +private: RateLimiter* limiters_[MAX_TASK_ID]; double rate_pctgs_[MAX_TASK_ID]; int64_t log_rate_limit_; diff --git a/src/share/ob_tenant_memstore_info_operator.h b/src/share/ob_tenant_memstore_info_operator.h index c72b67206..7b7da963a 100644 --- a/src/share/ob_tenant_memstore_info_operator.h +++ b/src/share/ob_tenant_memstore_info_operator.h @@ -24,7 +24,7 @@ class ObMySQLProxy; namespace share { class ObResourcePool; class ObTenantMemstoreInfoOperator { - public: +public: struct TenantServerMemInfo { TenantServerMemInfo() : tenant_id_(common::OB_INVALID_ID), @@ -58,7 +58,7 @@ class ObTenantMemstoreInfoOperator { int get(const uint64_t tenant_id, const common::ObIArray& servers, common::ObIArray& mem_infos); - private: +private: common::ObMySQLProxy& proxy_; }; } // end namespace share diff --git a/src/share/ob_tenant_mgr.h b/src/share/ob_tenant_mgr.h index 8fc76292b..913a8135d 100644 --- a/src/share/ob_tenant_mgr.h +++ b/src/share/ob_tenant_mgr.h @@ -55,13 +55,13 @@ struct ObTenantFreezeArg { }; class ObTenantMgrRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObTenantMgrRpcProxy); RPC_AP(@PR5 post_freeze_request, OB_TENANT_MGR, (ObTenantFreezeArg)); }; class ObTenantMgrP : public ObRpcProcessor > { - public: +public: ObTenantMgrP( obrpc::ObCommonRpcProxy* rpc_proxy, const share::ObRsMgr* rs_mgr, storage::ObPartitionService* partition_service) : rpc_proxy_(rpc_proxy), rs_mgr_(rs_mgr), partition_service_(partition_service) @@ -75,28 +75,28 @@ class ObTenantMgrP : public ObRpcProcessor { - public: +public: ObTenantMgrRpcCb() {} virtual ~ObTenantMgrRpcCb() {} - public: +public: int process(); void on_timeout(); rpc::frame::ObReqTransport::AsyncCB* clone(const rpc::frame::SPAlloc& alloc) const @@ -113,7 +113,7 @@ class ObTenantMgrRpcCb : public ObTenantMgrRpcProxy::AsyncCB { UNUSED(arg); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantMgrRpcCb); }; @@ -122,30 +122,30 @@ class ObTenantMgrRpcCb : public ObTenantMgrRpcProxy::AsyncCB { namespace common { class ObTenantMgrTimerTask : public ObTimerTask { - public: +public: ObTenantMgrTimerTask() {} virtual ~ObTenantMgrTimerTask() {} - public: +public: virtual void runTimerTask(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantMgrTimerTask); }; class ObPrintTenantMemstoreUsage : public ObTimerTask { - public: +public: ObPrintTenantMemstoreUsage() {} virtual ~ObPrintTenantMemstoreUsage() {} - public: +public: virtual void runTimerTask(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPrintTenantMemstoreUsage); }; @@ -168,12 +168,12 @@ struct ObRetryMajorInfo { TO_STRING_KV(K_(tenant_id), K_(major_version)); }; class ObTenantInfo : public ObDLinkBase { - public: +public: ObTenantInfo(); virtual ~ObTenantInfo() {} - public: +public: uint64_t tenant_id_; int64_t mem_lower_limit_; int64_t mem_upper_limit_; @@ -192,14 +192,14 @@ class ObTenantInfo : public ObDLinkBase { int64_t mem_memstore_left() const; void reset(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantInfo); }; class ObServerConfig; class ObTenantManager : public ObITenantMgr { - public: +public: // this init is for obproxy only int init(const int64_t tenant_cnt = OB_ONLY_SYS_TENANT_COUNT); // in observer we only use this init func @@ -258,10 +258,10 @@ class ObTenantManager : public ObITenantMgr { retry_major_info_ = retry_major_info; } - private: +private: static const int64_t BUCKET_NUM = 1373; - private: +private: ObTenantManager(); virtual ~ObTenantManager(); int init_tenant_map(const int64_t tenant_cnt); @@ -328,12 +328,12 @@ class ObTenantManager : public ObITenantMgr { common::ObMemstoreAllocatorMgr* allocator_mgr_; lib::ObMutex print_mutex_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantManager); }; class ObTenantCpuShare { - public: +public: /* Return value: The number of px threads assigned to tenant_id tenant */ static int64_t calc_px_pool_share(uint64_t tenant_id, int64_t cpu_count); }; diff --git a/src/share/ob_thread_mgr.h b/src/share/ob_thread_mgr.h index 5bddc1763..1425d759d 100644 --- a/src/share/ob_thread_mgr.h +++ b/src/share/ob_thread_mgr.h @@ -36,7 +36,7 @@ template class ObTG; class MyObThreadPool : public share::ObThreadPool { - public: +public: void run1() override { runnable_->set_thread_idx(get_thread_idx()); @@ -47,12 +47,18 @@ class MyObThreadPool : public share::ObThreadPool { template <> class ObTG : public ITG { - public: +public: ObTG(lib::ThreadCountPair pair) : thread_cnt_(pair.get_thread_cnt()) {} - ~ObTG() { destroy(); } - int64_t thread_cnt() override { return thread_cnt_; } - int set_runnable(lib::TGRunnable &runnable) override + ~ObTG() + { + destroy(); + } + int64_t thread_cnt() override + { + return thread_cnt_; + } + int set_runnable(lib::TGRunnable& runnable) override { int ret = common::OB_SUCCESS; if (th_ != nullptr) { @@ -100,7 +106,7 @@ class ObTG : public ITG { } } - private: +private: char buf_[sizeof(MyObThreadPool)]; MyObThreadPool* th_ = nullptr; int thread_cnt_; diff --git a/src/share/ob_thread_pool.h b/src/share/ob_thread_pool.h index acc2fb85d..3c91fa07b 100644 --- a/src/share/ob_thread_pool.h +++ b/src/share/ob_thread_pool.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace share { class ObThreadPool : public lib::ThreadPool { - public: +public: void run0() override { // Create worker for current thread. diff --git a/src/share/ob_time_utility2.h b/src/share/ob_time_utility2.h index f093212d5..f12df9eba 100644 --- a/src/share/ob_time_utility2.h +++ b/src/share/ob_time_utility2.h @@ -29,12 +29,12 @@ class ObTimeUtility2 { using ObString = common::ObString; enum ObHourFlag { HOUR_UNUSE, HOUR_AM, HOUR_PM }; - public: +public: enum DecimalDigts { DIGTS_INSENSITIVE, DIGTS_SENSITIVE }; static const char* STD_TS_FORMAT_WITH_USEC; static const char* STD_TS_FORMAT_WITHOUT_USEC; - public: +public: // call mktime() to make seconds from strcut tm, and check seconds whether valid static int make_second(struct tm& t, time_t& second); static int timestamp_to_usec(struct tm& base_tm, int64_t base_usec, int64_t& result_usec); @@ -69,7 +69,7 @@ class ObTimeUtility2 { static bool is_leap_year(int year); static int64_t timediff(const struct timeval& tv1, const struct timeval& tv2); - private: +private: static bool is_valid_year(int year); static bool is_valid_month(int month); // day of the month @@ -94,14 +94,14 @@ class ObTimeUtility2 { */ static bool check_in_next_critical_week(int yday, int wday, int year, uint8_t flag_mask); - private: +private: static const char* mday_name_[31]; static const char* weekday_name_[7]; static const char* weekday_abbr_name_[7]; static const char* month_name_[12]; static const char* month_abbr_name_[12]; - private: +private: ObTimeUtility2() = delete; }; diff --git a/src/share/ob_time_zone_info_manager.h b/src/share/ob_time_zone_info_manager.h index aa12d9d73..d1415a2ee 100644 --- a/src/share/ob_time_zone_info_manager.h +++ b/src/share/ob_time_zone_info_manager.h @@ -36,7 +36,7 @@ namespace common { class ObRequestTZInfoArg { OB_UNIS_VERSION(1); - public: +public: explicit ObRequestTZInfoArg(const common::ObAddr& addr, uint64_t tenant_id) : obs_addr_(addr), tenant_id_(tenant_id) {} ObRequestTZInfoArg() : obs_addr_() @@ -44,7 +44,7 @@ class ObRequestTZInfoArg { ~ObRequestTZInfoArg() {} - public: +public: common::ObAddr obs_addr_; uint64_t tenant_id_; }; @@ -52,13 +52,13 @@ class ObRequestTZInfoArg { class ObRequestTZInfoResult { OB_UNIS_VERSION(1); - public: +public: ObRequestTZInfoResult() : last_version_(-1), tz_array_() {} ~ObRequestTZInfoResult() {} - public: +public: int64_t last_version_; common::ObSArray tz_array_; }; @@ -71,38 +71,38 @@ class ObTimeZoneInfoManager { const int64_t TASK_NUM_LIMIT = 512; static const char* UPDATE_TZ_INFO_VERSION_SQL; - private: +private: class TaskProcessThread : public common::ObSimpleThreadPool { - public: + public: virtual void handle(void* task); }; class TZInfoTask { - public: + public: explicit TZInfoTask(ObTimeZoneInfoManager& tz_mgr) : tz_mgr_(tz_mgr) {} virtual ~TZInfoTask() {} virtual int run_task() = 0; - protected: + protected: ObTimeZoneInfoManager& tz_mgr_; - private: + private: DISALLOW_COPY_AND_ASSIGN(TZInfoTask); }; class FillRequestTZInfoResult { - public: + public: FillRequestTZInfoResult(ObRequestTZInfoResult& tz_result) : tz_result_(tz_result) {} bool operator()(ObTZIDKey key, ObTimeZoneInfoPos* tz_info); - private: + private: ObRequestTZInfoResult& tz_result_; }; - public: +public: ObTimeZoneInfoManager(obrpc::ObCommonRpcProxy& rs_rpc_proxy, common::ObMySQLProxy& sql_proxy, rootserver::ObRootService& root_service, ObTZInfoMap& tz_info_map, int64_t tenant_id) : rs_rpc_proxy_(rs_rpc_proxy), @@ -154,7 +154,7 @@ class ObTimeZoneInfoManager { static const char* FETCH_LATEST_TZ_VERSION_SQL; static int fill_tz_info_map(common::sqlclient::ObMySQLResult& result, ObTZInfoMap& tz_info_map); - private: +private: int fetch_time_zone_info_from_tenant_table(const int64_t current_tz_version); int fetch_time_zone_info_from_sys_table(); static int calc_default_tran_type( @@ -166,7 +166,7 @@ class ObTimeZoneInfoManager { int fill_tz_info_map(ObRequestTZInfoResult& tz_result); int print_tz_info_map(); - private: +private: obrpc::ObCommonRpcProxy& rs_rpc_proxy_; common::ObMySQLProxy& sql_proxy_; rootserver::ObRootService& root_service_; @@ -181,7 +181,7 @@ class ObTimeZoneInfoManager { // record tenant_id_ for getting tz_info_version. int64_t tenant_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTimeZoneInfoManager); }; diff --git a/src/share/ob_truncated_string.h b/src/share/ob_truncated_string.h index 717f16b18..702c27d27 100644 --- a/src/share/ob_truncated_string.h +++ b/src/share/ob_truncated_string.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class ObTruncatedString { - public: +public: ObTruncatedString(const ObString& str, const int32_t limit) { const int32_t len = (limit < str.length()) ? (limit < 0 ? 0 : limit) : str.length(); @@ -62,7 +62,7 @@ class ObTruncatedString { return pos; } - private: +private: ObString str_; DISALLOW_COPY_AND_ASSIGN(ObTruncatedString); diff --git a/src/share/ob_unique_index_row_transformer.h b/src/share/ob_unique_index_row_transformer.h index e1c1d3a27..375313a7b 100644 --- a/src/share/ob_unique_index_row_transformer.h +++ b/src/share/ob_unique_index_row_transformer.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace share { class ObUniqueIndexRowTransformer { - public: +public: static int check_need_shadow_columns(const common::ObNewRow& row, const common::ObCompatibilityMode sql_mode, const int64_t unique_key_cnt, const common::ObIArray* projector, bool& need_shadow_columns); static int convert_to_unique_index_row(const common::ObNewRow& row, const common::ObCompatibilityMode sql_mode, @@ -30,7 +30,7 @@ class ObUniqueIndexRowTransformer { const int64_t unique_key_cnt, const int64_t shadow_column_cnt, const common::ObIArray* projector, bool& need_shadow_columns, common::ObNewRow& result_row, const bool need_copy_cell = false); - private: +private: static int check_oracle_need_shadow_columns(const common::ObNewRow& row, const int64_t unique_key_cnt, const common::ObIArray* projector, bool& need_shadow_columns); static int check_mysql_need_shadow_columns(const common::ObNewRow& row, const int64_t unique_key_cnt, diff --git a/src/share/ob_unit_getter.h b/src/share/ob_unit_getter.h index 5a200583e..68de75be1 100644 --- a/src/share/ob_unit_getter.h +++ b/src/share/ob_unit_getter.h @@ -29,7 +29,7 @@ class ObServerConfig; namespace share { class ObUnitInfoGetter { - public: +public: enum ObUnitStatus { UNIT_NORMAL = 0, UNIT_MIGRATE_IN, @@ -40,7 +40,7 @@ class ObUnitInfoGetter { struct ObTenantConfig { OB_UNIS_VERSION(1); - public: + public: ObTenantConfig() : tenant_id_(common::OB_INVALID_ID), unit_stat_(UNIT_ERROR_STAT), @@ -110,7 +110,7 @@ class ObUnitInfoGetter { virtual int check_tenant_small(const uint64_t tenant_id, bool& small_tenant); int get_pools_of_tenant(const uint64_t tenant_id, common::ObIArray& pools); - private: +private: int get_units_of_server(const common::ObAddr& server, common::ObIArray& units); int get_pools_of_units(const common::ObIArray& units, common::ObIArray& pools); int get_configs_of_pools(const common::ObIArray& pools, common::ObIArray& configs); @@ -130,18 +130,18 @@ class ObUnitInfoGetter { int get_compat_mode(const int64_t tenant_id, ObWorker::CompatMode& compat_mode) const; - private: +private: bool inited_; ObUnitTableOperator ut_operator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUnitInfoGetter); }; typedef common::ObSEArray TenantUnits; class ObUnitStatGetter { - public: +public: ObUnitStatGetter(); virtual ~ObUnitStatGetter(); int init(share::ObPartitionTableOperator& pt_operator, share::schema::ObMultiVersionSchemaService& schema_service, @@ -149,11 +149,11 @@ class ObUnitStatGetter { virtual int get_unit_stat(uint64_t tenant_id, uint64_t unit_id, ObUnitStat& unit_stat) const; virtual int get_unit_stat(uint64_t tenant_id, share::ObUnitStatMap& unit_stat_map) const; - private: +private: bool inited_; ObUnitStatTableOperator ut_stat_operator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUnitStatGetter); }; diff --git a/src/share/ob_unit_replica_counter.h b/src/share/ob_unit_replica_counter.h index aa5ed1495..e8533f9a7 100644 --- a/src/share/ob_unit_replica_counter.h +++ b/src/share/ob_unit_replica_counter.h @@ -26,7 +26,7 @@ struct UnitReplicaCounter { int64_t index_num_; int64_t leader_cnt_; - public: +public: UnitReplicaCounter() : f_replica_cnt_(0), d_replica_cnt_(0), l_replica_cnt_(0), r_replica_cnt_(0), index_num_(0), leader_cnt_(0) {} @@ -118,7 +118,7 @@ struct TenantUnitRepCnt { int64_t non_table_cnt_; int64_t now_time_; - public: +public: TenantUnitRepCnt() : unit_rep_cnt_(), unit_id_(common::OB_INVALID_ID), diff --git a/src/share/ob_unit_stat_table_operator.h b/src/share/ob_unit_stat_table_operator.h index f7d7e86a4..d1f19383c 100644 --- a/src/share/ob_unit_stat_table_operator.h +++ b/src/share/ob_unit_stat_table_operator.h @@ -25,7 +25,7 @@ namespace schema { class ObMultiVersionSchemaService; } class ObUnitStatTableOperator { - public: +public: ObUnitStatTableOperator(); virtual ~ObUnitStatTableOperator(); @@ -35,19 +35,19 @@ class ObUnitStatTableOperator { int get_unit_stat(uint64_t tenant_id, share::ObUnitStatMap& unit_stat_map) const; - private: +private: int check_stop() const { return check_stop_provider_->check_stop(); } - private: +private: bool inited_; share::ObPartitionTableOperator* pt_operator_; share::schema::ObMultiVersionSchemaService* schema_service_; share::ObCheckStopProvider* check_stop_provider_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUnitStatTableOperator); }; } // end namespace share diff --git a/src/share/ob_unit_table_operator.h b/src/share/ob_unit_table_operator.h index 5cce8fdb1..1a39303f3 100644 --- a/src/share/ob_unit_table_operator.h +++ b/src/share/ob_unit_table_operator.h @@ -23,7 +23,7 @@ class ObServerConfig; } // end namespace common namespace share { class ObUnitTableOperator { - public: +public: ObUnitTableOperator(); virtual ~ObUnitTableOperator(); @@ -51,7 +51,7 @@ class ObUnitTableOperator { virtual int remove_unit_config(common::ObISQLClient& client, const uint64_t unit_config_id); virtual int get_tenants(common::ObIArray& tenants) const; - private: +private: static int zone_list2str(const common::ObIArray& zone_list, char* str, const int64_t buf_size); static int str2zone_list(const char* str, common::ObIArray& zone_list); @@ -64,12 +64,12 @@ class ObUnitTableOperator { int read_tenant(const common::sqlclient::ObMySQLResult& result, uint64_t& tenant_id) const; int read_tenants(common::ObSqlString& sql, common::ObIArray& tenants) const; - private: +private: bool inited_; common::ObMySQLProxy* proxy_; common::ObServerConfig* config_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUnitTableOperator); }; } // end namespace share diff --git a/src/share/ob_upgrade_utils.h b/src/share/ob_upgrade_utils.h index 9451dc8f3..45da0dd0e 100644 --- a/src/share/ob_upgrade_utils.h +++ b/src/share/ob_upgrade_utils.h @@ -32,7 +32,7 @@ static const rootserver::ObRsJobType upgrade_job_type_array[UPGRADE_JOB_TYPE_COU }; class ObUpgradeUtils { - public: +public: ObUpgradeUtils() {} virtual ~ObUpgradeUtils() @@ -50,7 +50,7 @@ class ObUpgradeUtils { static int upgrade_sys_variable(common::ObISQLClient& sql_client, const uint64_t tenant_id); static int upgrade_sys_stat(common::ObISQLClient& sql_client, const uint64_t tenant_id); /* ----------------------- */ - private: +private: static int check_table_exist(uint64_t table_id, bool& exist); static int check_table_partition_exist(uint64_t table_id, bool& exist); static int check_rs_job_exist(rootserver::ObRsJobType job_type, bool& exist); @@ -79,7 +79,7 @@ class ObUpgradeUtils { static int filter_sys_stat( common::ObISQLClient& sql_client, const uint64_t tenant_id, rootserver::ObSysStat& sys_stat); - private: +private: typedef common::ObFixedLengthString Name; }; @@ -88,14 +88,14 @@ class ObUpgradeUtils { // Special upgrade actions for specific cluster version, // which should be stateless and reentrant. class ObBaseUpgradeProcessor { - public: +public: enum UpgradeMode { UPGRADE_MODE_INVALID, UPGRADE_MODE_OB, UPGRADE_MODE_PHYSICAL_RESTORE }; - public: +public: ObBaseUpgradeProcessor(); virtual ~ObBaseUpgradeProcessor(){}; - public: +public: int init(int64_t cluster_version, UpgradeMode mode, common::ObMySQLProxy& sql_proxy, obrpc::ObSrvRpcProxy& rpc_proxy, share::schema::ObMultiVersionSchemaService& schema_service, share::ObCheckStopProvider& check_server_provider); int64_t get_version() const @@ -114,10 +114,10 @@ class ObBaseUpgradeProcessor { virtual int post_upgrade() = 0; TO_STRING_KV(K_(inited), K_(cluster_version), K_(tenant_id), K_(mode)); - protected: +protected: virtual int check_inner_stat() const; - protected: +protected: bool inited_; int64_t cluster_version_; uint64_t tenant_id_; @@ -127,12 +127,12 @@ class ObBaseUpgradeProcessor { share::schema::ObMultiVersionSchemaService* schema_service_; share::ObCheckStopProvider* check_stop_provider_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBaseUpgradeProcessor); }; class ObUpgradeProcesserSet { - public: +public: ObUpgradeProcesserSet(); virtual ~ObUpgradeProcesserSet(); int init(ObBaseUpgradeProcessor::UpgradeMode mode, common::ObMySQLProxy& sql_proxy, obrpc::ObSrvRpcProxy& rpc_proxy, @@ -142,11 +142,11 @@ class ObUpgradeProcesserSet { int get_processor_idx_by_range( const int64_t start_version, const int64_t end_version, int64_t& start_idx, int64_t& end_idx); - private: +private: virtual int check_inner_stat() const; int get_processor_idx_by_version(const int64_t version, int64_t& idx) const; - private: +private: bool inited_; common::ObArenaAllocator allocator_; common::ObArray processor_list_; @@ -155,7 +155,7 @@ class ObUpgradeProcesserSet { #define DEF_SIMPLE_UPGRARD_PROCESSER(MAJOR, MINOR, PATCH) \ class ObUpgradeFor##MAJOR##MINOR##PATCH##Processor : public ObBaseUpgradeProcessor { \ - public: \ + public: \ ObUpgradeFor##MAJOR##MINOR##PATCH##Processor() : ObBaseUpgradeProcessor() \ {} \ virtual ~ObUpgradeFor##MAJOR##MINOR##PATCH##Processor() \ @@ -177,10 +177,10 @@ class ObUpgradeProcesserSet { * 3. Modify int ObUpgradeProcesserSet::init(). */ class ObUpgradeChecker { - public: +public: static bool check_cluster_version_exist(const uint64_t version); - public: +public: static const int64_t CLUTER_VERSION_NUM = 32; static const uint64_t UPGRADE_PATH[CLUTER_VERSION_NUM]; }; @@ -189,7 +189,7 @@ class ObUpgradeChecker { DEF_SIMPLE_UPGRARD_PROCESSER(2, 2, 60); // 2.2.70 class ObUpgradeFor2270Processor : public ObBaseUpgradeProcessor { - public: +public: ObUpgradeFor2270Processor() : ObBaseUpgradeProcessor() {} virtual ~ObUpgradeFor2270Processor() @@ -197,7 +197,7 @@ class ObUpgradeFor2270Processor : public ObBaseUpgradeProcessor { virtual int pre_upgrade() override; virtual int post_upgrade() override; - private: +private: int modify_trigger_package_source_body(); int modify_oracle_public_database_name(); @@ -214,7 +214,7 @@ DEF_SIMPLE_UPGRARD_PROCESSER(2, 2, 73); DEF_SIMPLE_UPGRARD_PROCESSER(2, 2, 74); class ObUpgradeFor2275Processor : public ObBaseUpgradeProcessor { - public: +public: ObUpgradeFor2275Processor() : ObBaseUpgradeProcessor() {} virtual ~ObUpgradeFor2275Processor() diff --git a/src/share/ob_virtual_table_iterator.h b/src/share/ob_virtual_table_iterator.h index 4f05c422f..f5e2ffa4d 100644 --- a/src/share/ob_virtual_table_iterator.h +++ b/src/share/ob_virtual_table_iterator.h @@ -35,25 +35,26 @@ class ObVTableScanParam; class ObVirtualTableIterator : public ObNewRowIterator { static const int64_t VT_COLUMN_COUNT = 64; - public: +public: ObVirtualTableIterator() - : allocator_(NULL), - output_column_ids_(), - reserved_column_cnt_(0), - schema_guard_(NULL), - table_schema_(NULL), - index_schema_(NULL), - cur_row_(), - session_(NULL), - convert_alloc_(), - cast_ctx_(), - convert_row_(), - need_convert_(false), - scan_param_(NULL) - {} - virtual ~ObVirtualTableIterator() {} + : allocator_(NULL), + output_column_ids_(), + reserved_column_cnt_(0), + schema_guard_(NULL), + table_schema_(NULL), + index_schema_(NULL), + cur_row_(), + session_(NULL), + convert_alloc_(), + cast_ctx_(), + convert_row_(), + need_convert_(false), + scan_param_(NULL) + {} + virtual ~ObVirtualTableIterator() + {} virtual void reset() override; - inline void set_allocator(common::ObIAllocator *allocator); + inline void set_allocator(common::ObIAllocator* allocator); inline void set_reserved_column_cnt(int64_t count); inline int set_output_column_ids(const common::ObIArray& column_ids); inline void set_schema_guard(share::schema::ObSchemaGetterGuard* schema_guard); @@ -65,10 +66,13 @@ class ObVirtualTableIterator : public ObNewRowIterator { scan_param_ = scan_param; } virtual int open(); - virtual int inner_open() { return common::OB_SUCCESS; }; - virtual int get_next_row(common::ObNewRow *&row) override; - virtual int inner_get_next_row(common::ObNewRow *&row) = 0; - virtual int get_next_row() override; // interface for static typing engine. + virtual int inner_open() + { + return common::OB_SUCCESS; + }; + virtual int get_next_row(common::ObNewRow*& row) override; + virtual int inner_get_next_row(common::ObNewRow*& row) = 0; + virtual int get_next_row() override; // interface for static typing engine. virtual int close(); virtual int inner_close() { @@ -100,7 +104,7 @@ class ObVirtualTableIterator : public ObNewRowIterator { } VIRTUAL_TO_STRING_KV(K_(output_column_ids)); - private: +private: int init_convert_ctx(); int convert_key_ranges(); int get_key_cols(common::ObIArray& key_cols); @@ -111,7 +115,7 @@ class ObVirtualTableIterator : public ObNewRowIterator { int convert_output_row(ObNewRow*& cur_row); int get_all_columns_schema(); - protected: +protected: common::ObIAllocator* allocator_; common::ObSEArray output_column_ids_; int64_t reserved_column_cnt_; @@ -124,7 +128,7 @@ class ObVirtualTableIterator : public ObNewRowIterator { common::ObSEArray key_ranges_; common::ObSEArray saved_key_ranges_; - private: +private: common::ObArenaAllocator convert_alloc_; common::ObCastCtx cast_ctx_; common::ObNewRow convert_row_; @@ -132,7 +136,7 @@ class ObVirtualTableIterator : public ObNewRowIterator { common::ObSEArray cols_schema_; const ObVTableScanParam* scan_param_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVirtualTableIterator); }; diff --git a/src/share/ob_virtual_table_projector.h b/src/share/ob_virtual_table_projector.h index ffa6e69b1..bbf0aaba6 100644 --- a/src/share/ob_virtual_table_projector.h +++ b/src/share/ob_virtual_table_projector.h @@ -25,13 +25,13 @@ class ObMultiVersionSchemaService; } // namespace share namespace common { class ObVirtualTableProjector : public common::ObVirtualTableScannerIterator { - public: +public: ObVirtualTableProjector() {} virtual ~ObVirtualTableProjector() {} - protected: +protected: struct Column { Column() : column_id_(common::OB_INVALID_ID), column_value_() {} @@ -45,7 +45,7 @@ class ObVirtualTableProjector : public common::ObVirtualTableScannerIterator { const common::ObIArray& columns, common::ObNewRow& row, const bool full_columns = true); virtual int check_column_exist(const share::schema::ObTableSchema* table, const char* column_name, bool& exist) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVirtualTableProjector); }; @@ -109,7 +109,7 @@ class ObVirtualTableProjector : public common::ObVirtualTableScannerIterator { } while (false) class ObSimpleVirtualTableIterator : public ObVirtualTableProjector { - public: +public: ObSimpleVirtualTableIterator(uint64_t tenant_id, uint64_t table_id); virtual ~ObSimpleVirtualTableIterator() {} @@ -125,17 +125,17 @@ class ObSimpleVirtualTableIterator : public ObVirtualTableProjector { return common::OB_SUCCESS; } - private: +private: // types and constants static const int64_t MAX_COLUMN_NUM = 32; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSimpleVirtualTableIterator); // function members int get_table_schema(uint64_t tenant_id, uint64_t table_id); - private: +private: // data members uint64_t tenant_id_; uint64_t table_id_; diff --git a/src/share/ob_virtual_table_scanner_iterator.h b/src/share/ob_virtual_table_scanner_iterator.h index aa1c15ac9..21365daf4 100644 --- a/src/share/ob_virtual_table_scanner_iterator.h +++ b/src/share/ob_virtual_table_scanner_iterator.h @@ -21,17 +21,17 @@ namespace oceanbase { namespace common { class ObVirtualTableScannerIterator : public common::ObVirtualTableIterator { - public: +public: ObVirtualTableScannerIterator(); virtual ~ObVirtualTableScannerIterator(); virtual void reset(); - protected: +protected: common::ObScanner scanner_; common::ObScanner::Iterator scanner_it_; bool start_to_read_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVirtualTableScannerIterator); }; } // namespace common diff --git a/src/share/ob_web_service_root_addr.h b/src/share/ob_web_service_root_addr.h index 840e3c701..229e4bb3f 100644 --- a/src/share/ob_web_service_root_addr.h +++ b/src/share/ob_web_service_root_addr.h @@ -50,7 +50,7 @@ namespace share { struct ObRedoTransportOption { OB_UNIS_VERSION(1); - public: +public: static const int64_t DEFAULT_NET_TIMEOUT = 30 * 1000 * 1000; // 30s static const int64_t DEFAULT_REOPEN = 300 * 1000 * 1000; // 300s static const int64_t DEFAULT_MAX_FAILURE = 0; // 0 always retry @@ -84,14 +84,14 @@ struct ObRedoTransportOption { int get_redo_transport_options_str(common::ObSqlString& str) const; TO_STRING_KV(K_(net_timeout), K_(reopen), K_(max_failure), K_(is_sync)); - private: +private: RedoOptionProfile str_to_redo_transport_options(const char* str); }; struct ObClusterRsAddr { OB_UNIS_VERSION(1); - public: +public: ObClusterRsAddr() : cluster_id_(common::OB_INVALID_ID), addr_() {} virtual ~ObClusterRsAddr() @@ -101,7 +101,7 @@ struct ObClusterRsAddr { int assign(const ObClusterRsAddr& other); TO_STRING_KV(K_(cluster_id), K_(addr)); - public: +public: int64_t cluster_id_; common::ObAddr addr_; }; @@ -109,7 +109,7 @@ struct ObClusterRsAddr { struct ObClusterAddr { OB_UNIS_VERSION(1); - public: +public: int64_t cluster_id_; common::ObClusterType cluster_type_; common::ObClusterStatus cluster_status_; @@ -158,7 +158,7 @@ typedef common::ObIArray ObClusterIAddrList; typedef common::ObSArray ObClusterAddrList; // store and fetch root server address list via REST style web service. class ObWebServiceRootAddr : public ObRootAddrAgent { - public: +public: static const int64_t MAX_RECV_CONTENT_LEN = 512 * 1024; // 512KB ObWebServiceRootAddr() @@ -166,15 +166,12 @@ class ObWebServiceRootAddr : public ObRootAddrAgent { virtual ~ObWebServiceRootAddr() {} - virtual int store(const ObIAddrList &addr_list, const ObIAddrList &readonly_addr_list, - const bool force, const common::ObClusterType cluster_type, - const int64_t timestamp) override; - virtual int fetch(ObIAddrList &add_list, ObIAddrList &readonly_addr_list, - common::ObClusterType &cluster_typ) override; - virtual int fetch_remote_rslist(const int64_t cluster_id, - ObIAddrList &addr_list, - ObIAddrList &readonly_addr_list, - common::ObClusterType &cluster_type) override; + virtual int store(const ObIAddrList& addr_list, const ObIAddrList& readonly_addr_list, const bool force, + const common::ObClusterType cluster_type, const int64_t timestamp) override; + virtual int fetch( + ObIAddrList& add_list, ObIAddrList& readonly_addr_list, common::ObClusterType& cluster_typ) override; + virtual int fetch_remote_rslist(const int64_t cluster_id, ObIAddrList& addr_list, ObIAddrList& readonly_addr_list, + common::ObClusterType& cluster_type) override; virtual int delete_cluster(const int64_t cluster_id) override; /// get RS_LIST from URL /// @@ -196,7 +193,7 @@ class ObWebServiceRootAddr : public ObRootAddrAgent { static int from_json(const char* json_str, const char* appname, ObClusterAddr& cluster); static int parse_data(const json::Value* data, ObClusterAddr& cluster); - private: +private: /// store rs_list to URL /// /// @param rs_list RS address list @@ -227,7 +224,7 @@ class ObWebServiceRootAddr : public ObRootAddrAgent { int fetch_rslist_by_id(const int64_t cluster_id, ObIAddrList& addr_list, ObIAddrList& readonly_addr_list, common::ObClusterType& cluster_type); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObWebServiceRootAddr); }; diff --git a/src/share/ob_worker.h b/src/share/ob_worker.h index 0daed584e..a21495d8a 100644 --- a/src/share/ob_worker.h +++ b/src/share/ob_worker.h @@ -30,7 +30,7 @@ using common::ObFIFOAllocator; using common::ObIAllocator; class ObWorker : public lib::Worker { - public: +public: enum RunStatus { RS_RUN, RS_WAIT, RS_PAUSED }; enum Status { WS_WAIT, WS_NOWAIT, WS_FREQUENT, WS_INVALID, WS_OUT_OF_THROTTLE }; using lib::Worker::CompatMode; @@ -133,16 +133,16 @@ class ObWorker : public lib::Worker { set_sql_throttle_current_priority(100); } - public: +public: // static variables static ObWorker& self(); - protected: +protected: volatile RunStatus run_status_; int64_t st_current_priority_; sql::ObSQLSessionInfo* session_; - private: +private: int64_t timeout_ts_; uint64_t rpc_tenant_id_; @@ -217,7 +217,7 @@ inline bool ObWorker::get_disable_wait_flag() const #define THIS_WORKER oceanbase::share::ObWorker::self() class DisableSchedInterGuard { - public: +public: DisableSchedInterGuard() { last_flag_ = THIS_WORKER.get_disable_wait_flag(); @@ -228,12 +228,12 @@ class DisableSchedInterGuard { THIS_WORKER.set_disable_wait_flag(last_flag_); } - private: +private: bool last_flag_; }; class CompatModeGuard { - public: +public: CompatModeGuard(ObWorker::CompatMode mode) { last_compat_mode_ = THIS_WORKER.get_compatibility_mode(); @@ -245,7 +245,7 @@ class CompatModeGuard { THIS_WORKER.set_compatibility_mode(last_compat_mode_); } - private: +private: ObWorker::CompatMode last_compat_mode_; }; diff --git a/src/share/ob_zone_info.h b/src/share/ob_zone_info.h index 521e02260..1c73e7de6 100644 --- a/src/share/ob_zone_info.h +++ b/src/share/ob_zone_info.h @@ -32,7 +32,7 @@ namespace share { class ObZoneItemTransUpdater; struct ObZoneInfoItem : public common::ObDLinkBase { - public: +public: typedef common::ObFixedLengthString Info; typedef common::ObDList ItemList; @@ -60,7 +60,7 @@ struct ObZoneInfoItem : public common::ObDLinkBase { // update %value_ and %info_. (set %info_ to empty) int update(ObZoneItemTransUpdater& updater, const common::ObZone& zone, const int64_t value); - public: +public: const char* name_; int64_t value_; Info info_; @@ -69,7 +69,7 @@ struct ObZoneInfoItem : public common::ObDLinkBase { // Update item in transaction, if transaction rollback or commit failed the item value // value will be rollback too. class ObZoneItemTransUpdater { - public: +public: ObZoneItemTransUpdater(); ~ObZoneItemTransUpdater(); @@ -81,7 +81,7 @@ class ObZoneItemTransUpdater { return trans_; } - private: +private: const static int64_t PTR_OFFSET = sizeof(void*); bool started_; @@ -93,7 +93,7 @@ class ObZoneItemTransUpdater { }; struct ObGlobalInfo { - public: +public: ObGlobalInfo(); ObGlobalInfo(const ObGlobalInfo& other); ObGlobalInfo& operator=(const ObGlobalInfo& other); @@ -101,7 +101,7 @@ struct ObGlobalInfo { bool is_valid() const; DECLARE_TO_STRING; - public: +public: const common::ObZone zone_; // always be default value ObZoneInfoItem::ItemList list_; @@ -125,7 +125,7 @@ struct ObGlobalInfo { }; struct ObZoneInfo { - public: +public: enum MergeStatus { MERGE_STATUS_IDLE, MERGE_STATUS_MERGING, @@ -171,7 +171,7 @@ struct ObZoneInfo { static const char* get_storage_type_str(const StorageType storage_type); static StorageType get_storage_type(const char* storage_type_str); - public: +public: common::ObZone zone_; ObZoneInfoItem::ItemList list_; diff --git a/src/share/ob_zone_table_operation.h b/src/share/ob_zone_table_operation.h index 3bbe8e998..6556c2f1c 100644 --- a/src/share/ob_zone_table_operation.h +++ b/src/share/ob_zone_table_operation.h @@ -25,7 +25,7 @@ class ObZoneInfo; class ObGlobalInfo; class ObZoneTableOperation { - public: +public: static int update_info_item( common::ObISQLClient& sql_client, const common::ObZone& zone, const ObZoneInfoItem& item, bool insert = false); @@ -42,7 +42,7 @@ class ObZoneTableOperation { static int remove_zone_info(common::ObISQLClient& sql_client, const common::ObZone& zone); static int select_gc_timestamp_for_update(common::ObISQLClient& sql_client, int64_t& gc_timestmp); - private: +private: template static int set_info_item(const char* name, const int64_t value, const char* info_str, T& info); template diff --git a/src/share/object/ob_obj_cast.h b/src/share/object/ob_obj_cast.h index 9edcbbc4e..ff1991020 100644 --- a/src/share/object/ob_obj_cast.h +++ b/src/share/object/ob_obj_cast.h @@ -189,7 +189,7 @@ struct ObObjCastParams { }; class ObExpectType { - public: +public: ObExpectType() : type_(ObMaxType), cs_type_(CS_TYPE_INVALID), type_infos_(NULL) {} explicit ObExpectType(const ObObjType type) : type_(type), cs_type_(CS_TYPE_INVALID), type_infos_(NULL) @@ -238,10 +238,10 @@ class ObExpectType { TO_STRING_KV(K(type_), K(cs_type_), KPC(type_infos_)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExpectType); - private: +private: ObObjType type_; ObCollationType cs_type_; const ObIArray* type_infos_; @@ -272,7 +272,7 @@ int common_string_integer(const ObCastMode& cast_mode, const ObObjType& in_type, typedef ObObjCastParams ObCastCtx; class ObHexUtils { - public: +public: // text can be odd number, like 'aaa', treat as '0aaa' static int unhex(const common::ObString& text, common::ObCastCtx& cast_ctx, common::ObObj& result); static int hex(const common::ObString& text, common::ObCastCtx& cast_ctx, common::ObObj& result); @@ -282,7 +282,7 @@ class ObHexUtils { static int get_uint(const common::ObObj& obj, common::ObCastCtx& cast_ctx, common::number::ObNumber& out); static int copy_raw(const common::ObObj& obj, common::ObCastCtx& cast_ctx, common::ObObj& result); - private: +private: static int uint_to_raw(const common::number::ObNumber& text, common::ObCastCtx& cast_ctx, common::ObObj& result); }; @@ -295,7 +295,7 @@ int get_bit_len(const ObString& str, int32_t& bit_len); int get_bit_len(uint64_t value, int32_t& bit_len); int ob_obj_accuracy_check_only(const ObAccuracy& accuracy, const ObCollationType cs_type, const ObObj& obj); class ObObjCaster { - public: +public: /* * Please note that, * @@ -331,7 +331,7 @@ class ObObjCaster { const int16_t scale, const int64_t len, char* buf, int64_t& pos); static int can_cast_in_oracle_mode(const ObObjTypeClass expect_type, const ObObjTypeClass obj_type); - private: +private: inline static int64_t get_idx_of_collate(ObCollationType cs_type) { int64_t idx = -1; @@ -351,7 +351,7 @@ class ObObjCaster { return idx; } - private: +private: static const bool CAST_MONOTONIC[ObMaxTC][ObMaxTC]; static const bool ORDER_CONSISTENT[ObMaxTC][ObMaxTC]; static const bool ORDER_CONSISTENT_WITH_BOTH_STRING[ObCharset::VALID_COLLATION_TYPES] @@ -363,7 +363,7 @@ class ObObjCaster { }; class ObObjEvaluator { - public: +public: inline static int is_true(const ObObj& obj, bool& result) { return ObObjEvaluator::is_true(obj, CM_WARN_ON_FAIL, result); @@ -385,14 +385,14 @@ int number_range_check_v2(ObObjCastParams& params, const ObAccuracy& accuracy, c const ObObj*& res_obj, const ObCastMode cast_mode); class ObNumberConstValue { - public: +public: ObNumberConstValue() {} ~ObNumberConstValue() {} static int init(ObIAllocator& allocator, const lib::ObMemAttr& attr); - public: +public: static const ObScale MAX_ORACLE_SCALE_DELTA = 0 - number::ObNumber::MIN_SCALE; static const ObScale MAX_ORACLE_SCALE_SIZE = number::ObNumber::MAX_SCALE - number::ObNumber::MIN_SCALE; diff --git a/src/share/parameter/ob_parameter_attr.h b/src/share/parameter/ob_parameter_attr.h index ec9e866ae..a439b9f92 100644 --- a/src/share/parameter/ob_parameter_attr.h +++ b/src/share/parameter/ob_parameter_attr.h @@ -39,7 +39,7 @@ struct InfluencePlan {}; struct NeedSerialize {}; class ObParameterAttr { - public: +public: ObParameterAttr() : section_(Section::OBSERVER), scope_(Scope::CLUSTER), @@ -99,7 +99,7 @@ class ObParameterAttr { bool is_readonly() const; bool is_invisible() const; - private: +private: Section::SectionInfo section_; Scope::ScopeInfo scope_; Source::SourceInfo source_; diff --git a/src/share/parameter/ob_parameter_macro.h b/src/share/parameter/ob_parameter_macro.h index f41dfb5a8..10a888b4e 100644 --- a/src/share/parameter/ob_parameter_macro.h +++ b/src/share/parameter/ob_parameter_macro.h @@ -36,7 +36,7 @@ // TODO: use parameter instead of config #define _DEF_PARAMETER_EASY(param, scope, name, args...) \ class ObConfig##param##Item##_##name : public common::ObConfig##param##Item { \ - public: \ + public: \ ObConfig##param##Item##_##name() : common::ObConfig##param##Item(local_container(), scope, #name, args) \ {} \ template \ @@ -49,7 +49,7 @@ #define _DEF_PARAMETER_RANGE_EASY(param, scope, name, args...) \ class ObConfig##param##Item##_##name : public common::ObConfig##param##Item { \ - public: \ + public: \ ObConfig##param##Item##_##name() : common::ObConfig##param##Item(local_container(), scope, #name, args) \ {} \ template \ @@ -62,7 +62,7 @@ #define _DEF_PARAMETER_CHECKER_EASY(param, scope, name, def, checker, args...) \ class ObConfig##param##Item##_##name : public common::ObConfig##param##Item { \ - public: \ + public: \ ObConfig##param##Item##_##name() : common::ObConfig##param##Item(local_container(), scope, #name, def, args) \ { \ add_checker(new (std::nothrow) checker()); \ diff --git a/src/share/parameter/ob_parameter_seed.ipp b/src/share/parameter/ob_parameter_seed.ipp index 83631b6a5..32b705a79 100644 --- a/src/share/parameter/ob_parameter_seed.ipp +++ b/src/share/parameter/ob_parameter_seed.ipp @@ -1430,7 +1430,7 @@ DEF_TIME(ilog_index_expire_time, OB_CLUSTER_PARAMETER, "7d", "[0s, 60d]", "specifies the expire time of ilog_index, can use this parameter to limit the" "memory usage of file_id_cache", ObParameterAttr(Section::CLOG, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE)); -//auto drop restoring tenant if physical restore fails +// auto drop restoring tenant if physical restore fails DEF_BOOL(_auto_drop_tenant_if_restore_failed, OB_CLUSTER_PARAMETER, "True", - "auto drop restoring tenant if physical restore fails", - ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE)); + "auto drop restoring tenant if physical restore fails", + ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE)); diff --git a/src/share/part/ob_part_mgr.h b/src/share/part/ob_part_mgr.h index 1e61130c4..1c094e7dc 100644 --- a/src/share/part/ob_part_mgr.h +++ b/src/share/part/ob_part_mgr.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace common { class ObPartMgr { - public: +public: ObPartMgr() {} virtual ~ObPartMgr() diff --git a/src/share/part/ob_part_mgr_ad.h b/src/share/part/ob_part_mgr_ad.h index 68b00aa5e..55b9c00af 100644 --- a/src/share/part/ob_part_mgr_ad.h +++ b/src/share/part/ob_part_mgr_ad.h @@ -30,7 +30,7 @@ namespace sql { static const int64_t COUNT = 200; class ObPartMgrAD { - public: +public: // for hash/key/range_func part or insert statement static int get_part(common::ObPartMgr* part_mgr, const int64_t table_id, const share::schema::ObPartitionLevel part_level, const share::schema::ObPartitionFuncType part_type, @@ -54,7 +54,7 @@ class ObPartMgrAD { const share::schema::ObPartitionLevel part_level, const int64_t p_id, ObOrderDirection direction, common::ObIArray& part_ids); - private: +private: // Get point values range partition id static int get_part(common::ObPartMgr* part_mgr, const int64_t table_id, const share::schema::ObPartitionLevel part_level, const share::schema::ObPartitionFuncType part_type, diff --git a/src/share/partition_table/ob_inmemory_partition_table.h b/src/share/partition_table/ob_inmemory_partition_table.h index 305bf7d89..f9666fff7 100644 --- a/src/share/partition_table/ob_inmemory_partition_table.h +++ b/src/share/partition_table/ob_inmemory_partition_table.h @@ -25,14 +25,14 @@ class ObPartitionKey; namespace share { class ObIRsListChangeCb { - public: +public: virtual int submit_update_rslist_task(const bool force_update = false) = 0; virtual int submit_report_replica() = 0; virtual int submit_report_replica(const common::ObPartitionKey& key) = 0; }; class ObInMemoryPartitionTable : public ObIPartitionTable { - public: +public: friend class TestInMemoryPartitionTable_common_Test; friend class TestInMemoryPartitionTable_to_leader_time_Test; friend class TestInMemoryPartitionTable_leader_update_Test; @@ -40,12 +40,13 @@ class ObInMemoryPartitionTable : public ObIPartitionTable { explicit ObInMemoryPartitionTable(ObIPartPropertyGetter& prop_getter); virtual ~ObInMemoryPartitionTable(); - int init(ObIRsListChangeCb &rs_list_change_cb); - inline bool is_inited() const { return inited_; } - virtual int get(const uint64_t table_id, const int64_t partition_id, - ObPartitionInfo &partition_info, - const bool need_fetch_faillist = false, - const int64_t cluster_id = common::OB_INVALID_ID) override; + int init(ObIRsListChangeCb& rs_list_change_cb); + inline bool is_inited() const + { + return inited_; + } + virtual int get(const uint64_t table_id, const int64_t partition_id, ObPartitionInfo& partition_info, + const bool need_fetch_faillist = false, const int64_t cluster_id = common::OB_INVALID_ID) override; virtual int prefetch_by_table_id(const uint64_t tenant_id, const uint64_t start_table_id, const int64_t start_partition_id, common::ObIArray& partition_infos, @@ -59,42 +60,37 @@ class ObInMemoryPartitionTable : public ObIPartitionTable { const int64_t start_partition_id, common::ObIArray& partition_infos, const bool need_fetch_faillist = false) override; - virtual int batch_fetch_partition_infos( - const common::ObIArray &keys, - common::ObIAllocator &allocator, - common::ObArray &partitions, + virtual int batch_fetch_partition_infos(const common::ObIArray& keys, + common::ObIAllocator& allocator, common::ObArray& partitions, const int64_t cluster_id = common::OB_INVALID_ID) override; - virtual int batch_execute(const common::ObIArray &replicas) override; + virtual int batch_execute(const common::ObIArray& replicas) override; virtual int batch_report_with_optimization( - const common::ObIArray &replicas, - const bool with_role) override; + const common::ObIArray& replicas, const bool with_role) override; virtual int batch_report_partition_role( - const common::ObIArray &pkey_array, - const common::ObRole new_role) override; - virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const uint64_t unit_id) override; + const common::ObIArray& pkey_array, const common::ObRole new_role) override; + virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const uint64_t unit_id) override; - virtual int set_original_leader(const uint64_t table_id, const int64_t partition_id, - const bool is_original_leader) override; + virtual int set_original_leader( + const uint64_t table_id, const int64_t partition_id, const bool is_original_leader) override; - virtual int update_rebuild_flag(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const bool rebuild) override; + virtual int update_rebuild_flag( + const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, const bool rebuild) override; - virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const ObPartitionReplica::FailList &fail_list) - override; + virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const ObPartitionReplica::FailList& fail_list) override; - virtual int handover_partition(const common::ObPGKey &pg_key, - const common::ObAddr &src_addr, const common::ObAddr &dest_addr) override; + virtual int handover_partition( + const common::ObPGKey& pg_key, const common::ObAddr& src_addr, const common::ObAddr& dest_addr) override; - virtual int replace_partition(const ObPartitionReplica &replica, - const common::ObAddr &src_addr, const common::ObAddr &dest_addr) override; + virtual int replace_partition( + const ObPartitionReplica& replica, const common::ObAddr& src_addr, const common::ObAddr& dest_addr) override; void reuse(); - private: +private: // holds mutex_ int inner_get(const uint64_t table_id, const int64_t partition_id, const bool filter_flag_replica, ObPartitionInfo& partition_info); @@ -102,9 +98,8 @@ class ObInMemoryPartitionTable : public ObIPartitionTable { int inner_prefetch(const uint64_t tenant_id, const uint64_t start_table_id, const int64_t start_partition_id, const bool filter_flag_replica, common::ObIArray& partition_infos, const bool need_fetch_faillist = false); - virtual int update(const ObPartitionReplica &replica) override; - virtual int remove(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server) override; + virtual int update(const ObPartitionReplica& replica) override; + virtual int remove(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server) override; // holds mutex_ int update_leader_replica(const ObPartitionReplica& replica); @@ -113,7 +108,7 @@ class ObInMemoryPartitionTable : public ObIPartitionTable { int check_leader(); - private: +private: bool inited_; ObPartitionInfo partition_info_; lib::ObMutex mutex_; diff --git a/src/share/partition_table/ob_ipartition_table.h b/src/share/partition_table/ob_ipartition_table.h index 6dcdf4212..3935f0420 100644 --- a/src/share/partition_table/ob_ipartition_table.h +++ b/src/share/partition_table/ob_ipartition_table.h @@ -30,7 +30,7 @@ class ObPartitionKey; namespace share { class ObIMergeErrorCb { - public: +public: virtual int submit_merge_error_task() = 0; }; @@ -39,7 +39,7 @@ class ObPartitionInfo; // Partition property getter, get partition member list class ObIPartPropertyGetter { - public: +public: ObIPartPropertyGetter(){}; virtual ~ObIPartPropertyGetter() {} @@ -55,7 +55,7 @@ class ObIPartPropertyGetter { }; class ObIPartitionTable { - public: +public: const static int64_t ALL_CORE_TABLE_PARTITION_ID = 0; const static int64_t ALL_CORE_TABLE_PARTITION_NUM = 1; // partition table levels: __all_tenant_meta_table, __all_root_table, __all_core_table, memory table @@ -158,7 +158,7 @@ class ObIPartitionTable { static int partition_table_id_to_name(const uint64_t pt_table_id, const char*& table_name); - protected: +protected: ObIPartPropertyGetter* prop_getter_; ObIMergeErrorCb* merge_error_cb_; }; diff --git a/src/share/partition_table/ob_iserver_trace.h b/src/share/partition_table/ob_iserver_trace.h index effaabad7..cb6a2fe67 100644 --- a/src/share/partition_table/ob_iserver_trace.h +++ b/src/share/partition_table/ob_iserver_trace.h @@ -23,7 +23,7 @@ namespace share { // trace server alive status class ObIServerTrace { - public: +public: ObIServerTrace() {} virtual ~ObIServerTrace(){}; @@ -37,7 +37,7 @@ class ObIServerTrace { }; class ObIZoneTrace { - public: +public: ObIZoneTrace() {} virtual ~ObIZoneTrace() diff --git a/src/share/partition_table/ob_location_update_task.h b/src/share/partition_table/ob_location_update_task.h index 0a154cb68..8450e95b7 100644 --- a/src/share/partition_table/ob_location_update_task.h +++ b/src/share/partition_table/ob_location_update_task.h @@ -21,7 +21,7 @@ namespace share { class ObPartitionLocationCache; struct TSILocationCacheStatistics { - public: +public: TSILocationCacheStatistics() : suc_cnt_(0), fail_cnt_(0), sql_suc_cnt_(0), sql_fail_cnt_(0), total_wait_us_(0), total_exec_us_(0) {} @@ -31,7 +31,7 @@ struct TSILocationCacheStatistics { void calc(ObLocationCacheQueueSet::Type type, int ret, bool sql_renew, int64_t wait_us, int64_t exec_us); void dump(); - public: +public: int64_t suc_cnt_; int64_t fail_cnt_; int64_t sql_suc_cnt_; @@ -42,7 +42,7 @@ struct TSILocationCacheStatistics { }; // partition location update task class ObLocationUpdateTask : public common::IObDedupTask { - public: +public: static const int64_t WAIT_PROCESS_WARN_TIME = 3 * 1000 * 1000; // 3s ObLocationUpdateTask(ObPartitionLocationCache& loc_cache, const volatile bool& is_stopped, const uint64_t table_id, const int64_t partition_id, const int64_t add_timestamp, const int64_t cluster_id); @@ -83,7 +83,7 @@ class ObLocationUpdateTask : public common::IObDedupTask { TO_STRING_KV(KT_(table_id), K_(partition_id), K_(add_timestamp), K_(cluster_id), K_(force_sql_renew)); - private: +private: ObPartitionLocationCache& loc_cache_; const volatile bool& is_stopped_; diff --git a/src/share/partition_table/ob_partition_info.h b/src/share/partition_table/ob_partition_info.h index 83fc65e4f..eb81f00a2 100644 --- a/src/share/partition_table/ob_partition_info.h +++ b/src/share/partition_table/ob_partition_info.h @@ -62,11 +62,11 @@ int get_replica_status(const char* str, ObReplicaStatus& status); struct ObPartitionReplica { OB_UNIS_VERSION(1); - public: +public: struct Member { OB_UNIS_VERSION(1); - public: + public: Member() : timestamp_(0) {} Member(const common::ObAddr& server, const int64_t timestamp) : server_(server), timestamp_(timestamp) @@ -93,7 +93,7 @@ struct ObPartitionReplica { struct FailMsg { OB_UNIS_VERSION(1); - public: + public: FailMsg() : task_type_(-1), start_pos_(0), count_(0) {} virtual ~FailMsg() @@ -126,7 +126,7 @@ struct ObPartitionReplica { int64_t count_; }; - public: +public: static const int64_t DEFAULT_REPLICA_COUNT = 7; typedef common::ObSEArray MemberList; static const int64_t DEFAULT_FAIL_LIST_COUNT = 100; @@ -241,7 +241,7 @@ struct ObPartitionReplica { return common::is_sys_table(table_id_) || in_physical_restore_status() || in_standby_restore(); } - public: +public: uint64_t table_id_; int64_t partition_id_; int64_t partition_cnt_; @@ -300,7 +300,7 @@ struct ObPartitionReplica { class ObPartitionInfo { OB_UNIS_VERSION(1); - public: +public: typedef common::ObIArray ReplicaArray; ObPartitionInfo(); @@ -388,7 +388,7 @@ class ObPartitionInfo { static int alloc_new_partition_info(common::ObIAllocator& alloctor, ObPartitionInfo*& partition); - private: +private: // found: // return OB_SUCCESS, set %idx to array index of %replicas_ // @@ -399,13 +399,13 @@ class ObPartitionInfo { int verify_checksum(const ObPartitionReplica& replica) const; - private: +private: uint64_t table_id_; int64_t partition_id_; common::ObIAllocator* allocator_; common::ObSEArray replicas_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionInfo); }; diff --git a/src/share/partition_table/ob_partition_location.h b/src/share/partition_table/ob_partition_location.h index 6daa73a10..5d4433df5 100644 --- a/src/share/partition_table/ob_partition_location.h +++ b/src/share/partition_table/ob_partition_location.h @@ -28,7 +28,7 @@ class ObOptPartLoc; namespace share { struct ObPidAddrPair { - public: +public: int64_t pid_; common::ObAddr addr_; @@ -47,7 +47,7 @@ class ObPartitionReplicaLocation; struct ObReplicaLocation { OB_UNIS_VERSION(1); - public: +public: common::ObAddr server_; common::ObRole role_; int64_t sql_port_; @@ -117,7 +117,7 @@ class ObPartitionLocation { friend class ObPartitionReplicaLocation; friend class sql::ObOptPartLoc; - public: +public: typedef common::ObSEArray ObReplicaLocationArray; ObPartitionLocation(); @@ -225,11 +225,11 @@ class ObPartitionLocation { TO_STRING_KV(KT_(table_id), K_(partition_id), K_(partition_cnt), K_(pg_key), K_(replica_locations), K_(renew_time), K_(sql_renew_time), K_(is_mark_fail)); - private: +private: // return OB_ENTRY_NOT_EXIST for not found. int find(const common::ObAddr& server, int64_t& idx) const; - private: +private: uint64_t table_id_; int64_t partition_id_; int64_t partition_cnt_; @@ -244,11 +244,11 @@ class ObPartitionReplicaLocation final { OB_UNIS_VERSION(1); friend class ObPartitionLocation; - public: +public: static bool compare_part_loc_asc(const ObPartitionReplicaLocation& left, const ObPartitionReplicaLocation& right); static bool compare_part_loc_desc(const ObPartitionReplicaLocation& left, const ObPartitionReplicaLocation& right); - public: +public: ObPartitionReplicaLocation(); void reset(); @@ -317,7 +317,7 @@ class ObPartitionReplicaLocation final { TO_STRING_KV(KT_(table_id), K_(partition_id), K_(partition_cnt), K_(pg_key), K_(replica_location), K_(renew_time)); - private: +private: uint64_t table_id_; int64_t partition_id_; int64_t partition_cnt_; diff --git a/src/share/partition_table/ob_partition_location_cache.h b/src/share/partition_table/ob_partition_location_cache.h index 23b375d9e..4824f1ba6 100644 --- a/src/share/partition_table/ob_partition_location_cache.h +++ b/src/share/partition_table/ob_partition_location_cache.h @@ -72,7 +72,7 @@ struct ObLocationCacheKey : public common::ObIKVCacheKey { }; struct LocationInfo { - public: +public: LocationInfo() : server_(), renew_ts_(0) {} LocationInfo(const common::ObAddr& server, const int64_t renew_ts) : server_(server), renew_ts_(renew_ts) @@ -80,14 +80,14 @@ struct LocationInfo { virtual ~LocationInfo() {} - public: +public: bool is_valid() const { return server_.is_valid() && renew_ts_ > 0; } TO_STRING_KV(K_(server), K_(renew_ts)); - public: +public: int assign(const LocationInfo& that) { int ret = common::OB_SUCCESS; @@ -113,13 +113,13 @@ struct LocationInfo { renew_ts_ = renew_ts; } - public: +public: common::ObAddr server_; int64_t renew_ts_; }; class ObLocationLeader { - public: +public: ObLocationLeader() : key_(), leader_info_() {} virtual ~ObLocationLeader() @@ -143,7 +143,7 @@ class ObLocationLeader { } TO_STRING_KV(K_(key), K_(leader_info)); - private: +private: ObLocationCacheKey key_; LocationInfo leader_info_; }; @@ -160,7 +160,7 @@ struct ObLocationCacheValue : public common::ObIKVCacheValue { }; struct ObTenantSqlRenewStat { - public: +public: uint64_t tenant_id_; int64_t start_sql_renew_ts_; int64_t sql_renew_count_; @@ -191,7 +191,7 @@ typedef common::ObArray TenantSqlRenewInfoArray; typedef common::ObIArray TenantSqlRenewInfoIArray; class ObTenantStatGuard { - public: +public: ObTenantStatGuard() = delete; ObTenantStatGuard(const uint64_t tenant_id, TenantSqlRenewInfoMap& map, common::ObCachedAllocator& object_pool, common::ObSpinLock& lock) @@ -213,11 +213,11 @@ class ObTenantStatGuard { } TO_STRING_KV(KP_(tenant_stat), K_(tenant_id)); - private: +private: int set_tenant_stat(const uint64_t tenant_id, TenantSqlRenewInfoMap& map, common::ObCachedAllocator& object_pool, common::ObSpinLock& lock); - private: +private: ObTenantSqlRenewStat* tenant_stat_; uint64_t tenant_id_; DISALLOW_COPY_AND_ASSIGN(ObTenantStatGuard); @@ -226,7 +226,7 @@ class ObTenantStatGuard { class ObIPartitionLocationCache; // partition table update task class ObLocationAsyncUpdateTask : public common::ObDLinkBase { - public: +public: friend class ObLocationFetcher; static const int64_t WAIT_PROCESS_WARN_TIME = 3 * 1000 * 1000; // 3s enum Type { MODE_AUTO = 0, MODE_SQL_ONLY = 1 }; @@ -274,7 +274,7 @@ class ObLocationAsyncUpdateTask : public common::ObDLinkBasekeys_.count(), "idx_cnt", OB_ISNULL(idx_array_) ? 0 : idx_array_->count()); - public: +public: ObAddr addr_; obrpc::ObLocationRpcRenewArg* arg_; common::ObArray* idx_array_; }; struct ObReplicaRenewKey { - public: +public: ObReplicaRenewKey(); ObReplicaRenewKey(const uint64_t table_id, const int64_t partition_id, const ObAddr& addr); ~ObReplicaRenewKey(); @@ -444,14 +444,14 @@ struct ObReplicaRenewKey { bool operator==(const ObReplicaRenewKey& other) const; TO_STRING_KV(K_(table_id), K_(partition_id), K_(addr)); - public: +public: uint64_t table_id_; int64_t partition_id_; ObAddr addr_; }; class ObILocationFetcher { - public: +public: virtual ~ObILocationFetcher() {} virtual int fetch_location( @@ -470,7 +470,7 @@ class ObILocationFetcher { common::ObIAllocator& allocator, common::ObIArray& new_locations) = 0; static uint64_t get_rpc_tenant_id(const uint64_t table_id); - protected: +protected: virtual int partition_table_fetch_location(ObPartitionTableOperator* pt, const int64_t cluster_id, const uint64_t table_id, const int64_t partition_id, ObPartitionLocation& location); virtual int partition_table_batch_fetch_location(ObPartitionTableOperator* pt, const int64_t cluster_id, @@ -481,79 +481,50 @@ class ObILocationFetcher { // used by observer class ObLocationFetcher : public ObILocationFetcher { - public: +public: static const int64_t OB_FETCH_LOCATION_TIMEOUT = 1 * 1000 * 1000; // 1s static const int64_t OB_FETCH_MEMBER_LIST_AND_LEADER_TIMEOUT = 500 * 1000; // 500ms ObLocationFetcher(); virtual ~ObLocationFetcher(); - int init(common::ObServerConfig &config, - share::ObPartitionTableOperator &pt, - share::ObRemotePartitionTableOperator &remote_pt, - ObRsMgr &rs_mgr, - obrpc::ObCommonRpcProxy &rpc_proxy, - obrpc::ObSrvRpcProxy &srv_rpc_proxy, - ObILocalityManager *locality_manager, - //ObIRemoteLocatonGetter *remote_location_getter, - const int64_t cluster_id); - virtual int fetch_location(const uint64_t table_id, - const int64_t partition_id, - const int64_t cluster_id, - ObPartitionLocation &location) override; - virtual int fetch_vtable_location(const uint64_t table_id, - common::ObSArray &locations) override; + int init(common::ObServerConfig& config, share::ObPartitionTableOperator& pt, + share::ObRemotePartitionTableOperator& remote_pt, ObRsMgr& rs_mgr, obrpc::ObCommonRpcProxy& rpc_proxy, + obrpc::ObSrvRpcProxy& srv_rpc_proxy, ObILocalityManager* locality_manager, + // ObIRemoteLocatonGetter *remote_location_getter, + const int64_t cluster_id); + virtual int fetch_location(const uint64_t table_id, const int64_t partition_id, const int64_t cluster_id, + ObPartitionLocation& location) override; + virtual int fetch_vtable_location(const uint64_t table_id, common::ObSArray& locations) override; virtual int renew_location_with_rpc_v2( - common::hash::ObHashMap *result_map, - const ObPartitionLocation &cached_location, - ObPartitionLocation &new_location, - bool &is_new_location_valid) override; - virtual int batch_renew_sys_table_location_by_rpc( - const ObPartitionLocation &core_table_location, - const common::ObIArray &keys, - common::ObIArray &results) override; + common::hash::ObHashMap* result_map, + const ObPartitionLocation& cached_location, ObPartitionLocation& new_location, + bool& is_new_location_valid) override; + virtual int batch_renew_sys_table_location_by_rpc(const ObPartitionLocation& core_table_location, + const common::ObIArray& keys, common::ObIArray& results) override; + + virtual int batch_fetch_location(const common::ObIArray& keys, const int64_t cluster_id, + common::ObIAllocator& allocator, common::ObIArray& new_locations) override; + virtual int batch_renew_location_with_rpc(const common::ObIArray& rpc_locations, + common::ObIAllocator& allocator, common::ObIArray& new_locations) override; - virtual int batch_fetch_location( - const common::ObIArray &keys, - const int64_t cluster_id, - common::ObIAllocator &allocator, - common::ObIArray &new_locations) override; - virtual int batch_renew_location_with_rpc( - const common::ObIArray &rpc_locations, - common::ObIAllocator &allocator, - common::ObIArray &new_locations) override; private: - static int check_member_list(const common::ObIArray &cached_member_list, - const common::ObIArray &server_list, - bool &is_same); - int check_non_paxos_replica( - const common::ObIArray &cached_member_list, - const common::ObIArray &non_paxos_replicas, - bool &is_same); - int deal_with_replica_type_changed( - const bool new_mode, - const common::ObPartitionKey &pkey, - const ObReplicaLocation &old_replica_location, - const obrpc::ObMemberListAndLeaderArg &member_info, - ObPartitionLocation &new_location, - bool &is_new_location_valid); - int add_non_paxos_replica( - const obrpc::ObMemberListAndLeaderArg &member_info, - common::ObIArray &non_paxos_replicas); - int check_leader_and_member_list( - const bool new_mode, - const ObPartitionKey &pkey, - const common::ObAddr &addr, - const common::ObIArray &location_array, - const obrpc::ObMemberListAndLeaderArg &member_info, - ObReplicaLocation &new_leader, - bool &is_new_location_valid); + static int check_member_list(const common::ObIArray& cached_member_list, + const common::ObIArray& server_list, bool& is_same); + int check_non_paxos_replica(const common::ObIArray& cached_member_list, + const common::ObIArray& non_paxos_replicas, bool& is_same); + int deal_with_replica_type_changed(const bool new_mode, const common::ObPartitionKey& pkey, + const ObReplicaLocation& old_replica_location, const obrpc::ObMemberListAndLeaderArg& member_info, + ObPartitionLocation& new_location, bool& is_new_location_valid); + int add_non_paxos_replica(const obrpc::ObMemberListAndLeaderArg& member_info, + common::ObIArray& non_paxos_replicas); + int check_leader_and_member_list(const bool new_mode, const ObPartitionKey& pkey, const common::ObAddr& addr, + const common::ObIArray& location_array, const obrpc::ObMemberListAndLeaderArg& member_info, + ObReplicaLocation& new_leader, bool& is_new_location_valid); + virtual int init_batch_rpc_renew_struct(const common::ObIArray& rpc_locations, + common::ObIAllocator& allocator, common::ObArray& infos, + common::ObArray& key_results, + common::hash::ObHashMap& result_map); - virtual int init_batch_rpc_renew_struct( - const common::ObIArray &rpc_locations, - common::ObIAllocator &allocator, - common::ObArray &infos, - common::ObArray &key_results, - common::hash::ObHashMap &result_map); private: bool inited_; common::ObServerConfig* config_; @@ -567,7 +538,7 @@ private: }; class ObLocationCacheQueueSet { - public: +public: enum Type { LOC_QUEUE_SYS_CORE, LOC_QUEUE_SYS_RESTART_RELATED, @@ -578,13 +549,13 @@ class ObLocationCacheQueueSet { LOC_QUEUE_MAX }; - public: +public: ObLocationCacheQueueSet(); virtual ~ObLocationCacheQueueSet(); int init(common::ObServerConfig& config); int add_task(const ObLocationUpdateTask& task); - public: +public: static const int32_t ALL_ROOT_THREAD_CNT = 1; static const int32_t SYS_THREAD_CNT = 1; static const int64_t PLC_TASK_QUEUE_SIZE = 10 * 1000; @@ -596,7 +567,7 @@ class ObLocationCacheQueueSet { static const char* get_str_by_queue_type(Type type); static ObLocationCacheQueueSet::Type get_queue_type(const uint64_t table_id, const int64_t partition_id); - private: +private: bool is_inited_; // all core table's location don't need a queue because it fetch location through rpc common::ObDedupQueue all_root_update_queue_; // __all_core_table, __all_root_table, __all_tenant_gts, __all_gts @@ -608,9 +579,9 @@ class ObLocationCacheQueueSet { }; class ObLocationLeaderCache { - public: +public: class ObLocationLeaderInfo { - public: + public: ObLocationLeaderInfo() : lock_(), value_(NULL) {} virtual ~ObLocationLeaderInfo() @@ -624,12 +595,12 @@ class ObLocationLeaderCache { return value_; } - private: + private: common::SpinRWLock lock_; ObLocationLeader* value_; }; - public: +public: ObLocationLeaderCache() : allocator_(), buffer_() {} virtual ~ObLocationLeaderCache() @@ -637,7 +608,7 @@ class ObLocationLeaderCache { int get_strong_leader_info(const ObLocationCacheKey& key, LocationInfo& location_info); int set_strong_leader_info(const ObLocationCacheKey& key, const LocationInfo& location_info, bool force_update); - private: +private: static const int64_t CACHE_NUM = 10000; common::ObArenaAllocator allocator_; ObLocationLeaderInfo buffer_[CACHE_NUM]; @@ -646,7 +617,7 @@ class ObLocationLeaderCache { typedef observer::ObUniqTaskQueue ObLocationAsyncUpdateQueue; class ObLocationAsyncUpdateQueueSet { - public: +public: ObLocationAsyncUpdateQueueSet(ObIPartitionLocationCache* loc_cache_); virtual ~ObLocationAsyncUpdateQueueSet(); int init(common::ObServerConfig& config); @@ -654,12 +625,12 @@ class ObLocationAsyncUpdateQueueSet { void stop(); void wait(); - public: +public: const static int64_t MINI_MODE_UPDATE_THREAD_CNT = 1; static const int64_t PLC_TASK_QUEUE_SIZE = 10 * 1000; static const int64_t USER_TASK_QUEUE_SIZE = 200 * 1000; // 20W partitions static const int64_t MINI_MODE_USER_TASK_QUEUE_SIZE = 10 * 1000; // 1W partitions - private: +private: bool is_inited_; ObIPartitionLocationCache* loc_cache_; // all core table's location don't need a queue because it fetch location through rpc @@ -672,18 +643,18 @@ class ObLocationAsyncUpdateQueueSet { }; class ObPartitionLocationCache : public ObIPartitionLocationCache { - public: +public: friend class ObLocationUpdateTask; class LocationSem { - public: + public: LocationSem(); ~LocationSem(); void set_max_count(const int64_t max_count); int acquire(const int64_t abs_timeout_us); int release(); - private: + private: int64_t cur_count_; int64_t max_count_; common::ObThreadCond cond_; @@ -691,7 +662,7 @@ class ObPartitionLocationCache : public ObIPartitionLocationCache { // limit the concurrency of location cache updates class RenewLimiter { - public: + public: const static int64_t RENEW_INTERVAL = 1000000; // 1s const static int64_t PARTITION_HASH_BUCKET_COUNT = 10000; @@ -709,7 +680,7 @@ class ObPartitionLocationCache : public ObIPartitionLocationCache { return last_renew_timestamps_[idx]; } - private: + private: int64_t last_renew_timestamps_[PARTITION_HASH_BUCKET_COUNT]; }; @@ -790,8 +761,7 @@ class ObPartitionLocationCache : public ObIPartitionLocationCache { virtual int nonblock_renew_with_limiter( const common::ObPartitionKey& partition, const int64_t expire_renew_time, bool& is_limited) override; // link table. - virtual int get_link_table_location(const uint64_t table_id, - ObPartitionLocation &location) override; + virtual int get_link_table_location(const uint64_t table_id, ObPartitionLocation& location) override; /*-----batch async renew location-----*/ virtual int batch_process_tasks(const common::ObIArray& tasks, bool& stopped) override; @@ -805,7 +775,7 @@ class ObPartitionLocationCache : public ObIPartitionLocationCache { const ObPartitionLocation& location, char* buf, const int64_t buf_size, ObLocationCacheValue& cache_value); static const int64_t OB_MAX_LOCATION_SERIALIZATION_SIZE = common::OB_MALLOC_BIG_BLOCK_SIZE; - private: +private: int remote_get(const common::ObPartitionKey& pkey, ObPartitionLocation& location); bool is_duty_time(const ObPartitionLocation& location); @@ -818,7 +788,7 @@ class ObPartitionLocationCache : public ObIPartitionLocationCache { common::ObIAllocator& allocator, common::ObIArray& new_locations); int set_batch_timeout_ctx(const int64_t task_cnt, ObLocationAsyncUpdateTask::Type type, common::ObTimeoutCtx& ctx); /*-----batch async renew location end -----*/ - private: +private: const static int64_t DEFAULT_FETCH_LOCATION_TIMEOUT_US = ObLocationFetcher::OB_FETCH_LOCATION_TIMEOUT + ObLocationFetcher::OB_FETCH_MEMBER_LIST_AND_LEADER_TIMEOUT; // 4s static const int64_t OB_SYS_LOCATION_CACHE_BUCKET_NUM = 512; @@ -878,7 +848,7 @@ class ObPartitionLocationCache : public ObIPartitionLocationCache { bool use_sys_cache(const uint64_t table_id) const; bool use_sys_leader_cache(const uint64_t table_id, const int64_t cluster_id) const; - private: +private: const int64_t FORCE_SQL_RENEW_WINDOW = 1000000; // 1s const int64_t LC_VALID_THRESHOLD_TS = 10 * 1000000; // 10s bool is_reliable(const int64_t renew_time) @@ -886,7 +856,7 @@ class ObPartitionLocationCache : public ObIPartitionLocationCache { return renew_time + LC_VALID_THRESHOLD_TS > common::ObTimeUtility::current_time(); } - private: +private: bool is_inited_; bool is_stopped_; ObILocationFetcher& location_fetcher_; @@ -908,7 +878,7 @@ class ObPartitionLocationCache : public ObIPartitionLocationCache { ObLocationAsyncUpdateQueueSet local_async_queue_set_; ObLocationAsyncUpdateQueueSet remote_async_queue_set_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionLocationCache); }; diff --git a/src/share/partition_table/ob_partition_table_iterator.h b/src/share/partition_table/ob_partition_table_iterator.h index a3fa7a406..d3422e01d 100644 --- a/src/share/partition_table/ob_partition_table_iterator.h +++ b/src/share/partition_table/ob_partition_table_iterator.h @@ -30,7 +30,7 @@ class ObPartitionInfo; class ObPartitionTableOperator; class ObIPartitionTableIterator { - public: +public: ObIPartitionTableIterator() : need_fetch_faillist_(false) {} virtual ~ObIPartitionTableIterator() @@ -43,7 +43,7 @@ class ObIPartitionTableIterator { } virtual ObReplicaFilterHolder& get_filters() = 0; - protected: +protected: bool need_fetch_faillist_; }; @@ -56,13 +56,13 @@ enum CheckType { INVALID_REPLICA = 0, LEGAL_REPLICA, REDUNDANT_REPLICA, LOST_REP * or a binding tablegroup, this need to be guaranteed by the upper level */ class ObPartIdAscIterator { - public: +public: ObPartIdAscIterator() : sorted_part_id_array_(), part_level_(share::schema::PARTITION_LEVEL_MAX), cur_idx_(0) {} virtual ~ObPartIdAscIterator() {} - public: +public: void reset(); int build(const uint64_t partition_entity_id, const share::schema::ObPartitionSchema& partition_schema, const bool filter_dropped_schema); @@ -71,7 +71,7 @@ class ObPartIdAscIterator { void inc_iter(); int check_out_of_part_id_range(const int64_t partition_id, bool& out_of_range) const; - private: +private: common::ObArray sorted_part_id_array_; share::schema::ObPartitionLevel part_level_; int64_t cur_idx_; @@ -79,12 +79,12 @@ class ObPartIdAscIterator { // iterator partition for one standlone table or binding tablegroup class ObTablePartitionIterator : public ObIPartitionTableIterator { - public: +public: class ObPrefetchInfo { - public: + public: friend class ObTablePartitionIterator; - public: + public: ObPrefetchInfo() : prefetch_idx_(0), table_id_(0), @@ -119,7 +119,7 @@ class ObTablePartitionIterator : public ObIPartitionTableIterator { need_fetch_faillist_ = need_fetch_faillist; } - private: + private: int64_t prefetch_idx_; uint64_t table_id_; ObPartitionTableOperator* pt_operator_; @@ -148,12 +148,12 @@ class ObTablePartitionIterator : public ObIPartitionTableIterator { int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: int mock_next_partition(ObPartitionInfo& info); // check if the partition_id is in a rational range int check_replica(ObPartitionInfo& info, CheckType& check_type); - private: +private: bool inited_; uint64_t table_id_; // may be a binding tablegroup id schema::ObPartitionLevel part_level_; @@ -163,14 +163,14 @@ class ObTablePartitionIterator : public ObIPartitionTableIterator { ObPrefetchInfo prefetch_info_; ObReplicaFilterHolder filters_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTablePartitionIterator); }; // iterator partition for one tenant, // include standlone partition and binding tablegroup class ObTenantPartitionIterator : public ObIPartitionTableIterator { - public: +public: ObTenantPartitionIterator(); virtual ~ObTenantPartitionIterator(); @@ -194,13 +194,13 @@ class ObTenantPartitionIterator : public ObIPartitionTableIterator { int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: int next_partition_entity(); int inner_next(ObPartitionInfo& partition); int prefetch(); int prefetch(const uint64_t last_table_id, const int64_t last_partition_id); - private: +private: bool inited_; ObPartitionTableOperator* pt_operator_; schema::ObMultiVersionSchemaService* schema_service_; @@ -221,14 +221,14 @@ class ObTenantPartitionIterator : public ObIPartitionTableIterator { ObPartitionEntityFilterHolder partition_entity_filters_; bool filter_dropped_schema_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantPartitionIterator); }; /* iterate all partition infos of all tenants */ class ObPartitionTableIterator : public ObIPartitionTableIterator { - public: +public: ObPartitionTableIterator(); virtual ~ObPartitionTableIterator(); @@ -251,10 +251,10 @@ class ObPartitionTableIterator : public ObIPartitionTableIterator { int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: int next_tenant(); - private: +private: bool inited_; ObPartitionTableOperator* pt_operator_; schema::ObMultiVersionSchemaService* schema_service_; @@ -270,7 +270,7 @@ class ObPartitionTableIterator : public ObIPartitionTableIterator { * for the specific partitions */ class ObPTPartPartitionIterator : public ObIPartitionTableIterator { - public: +public: ObPTPartPartitionIterator(); virtual ~ObPTPartPartitionIterator(); @@ -295,10 +295,10 @@ class ObPTPartPartitionIterator : public ObIPartitionTableIterator { TO_STRING_KV(K_(inited), K_(pt_table_id), K_(pt_partition_id), K_(prefetch_partitions), K_(prefetch_idx)); - private: +private: int prefetch(); - private: +private: bool inited_; ObPartitionTableOperator* pt_operator_; uint64_t pt_table_id_; @@ -319,7 +319,7 @@ class ObPTPartPartitionIterator : public ObIPartitionTableIterator { * __all_tenant_meta_table of all tenants */ class ObPartitionTableIdIterator { - public: +public: ObPartitionTableIdIterator(); virtual ~ObPartitionTableIdIterator(); @@ -327,11 +327,11 @@ class ObPartitionTableIdIterator { virtual int get_next_partition(uint64_t& pt_table_id, int64_t& pt_partition_id); TO_STRING_KV(K_(inited), K_(tenant_iter), K_(pt_tables), K_(pt_table_id), K_(pt_partition_id)); - private: +private: int get_part_num(const uint64_t table_id, int64_t& part_num); static const int PT_TYPE_NUM = 4; - private: +private: bool inited_; schema::ObMultiVersionSchemaService* schema_service_; schema::ObTenantIterator tenant_iter_; @@ -344,7 +344,7 @@ class ObPartitionTableIdIterator { /* iterate all partitions of all partition tables */ class ObFullPartitionTableIterator : public ObIPartitionTableIterator { - public: +public: ObFullPartitionTableIterator(); virtual ~ObFullPartitionTableIterator(); @@ -358,10 +358,10 @@ class ObFullPartitionTableIterator : public ObIPartitionTableIterator { TO_STRING_KV(K_(inited), K_(part_iter), K_(pt_part_iter)); - private: +private: int next_partition(); - private: +private: bool inited_; ObPartitionTableOperator* pt_operator_; ObPTPartPartitionIterator part_iter_; @@ -371,7 +371,7 @@ class ObFullPartitionTableIterator : public ObIPartitionTableIterator { // iterate __all_tenant_meta_table only class ObFullMetaTableIterator : public ObIPartitionTableIterator { - public: +public: ObFullMetaTableIterator(); virtual ~ObFullMetaTableIterator(); @@ -385,11 +385,11 @@ class ObFullMetaTableIterator : public ObIPartitionTableIterator { TO_STRING_KV(K_(inited), K_(part_iter), K_(tenant_iter), K_(pt_table)); - private: +private: int next_partition(); int get_part_num(const uint64_t table_id, int64_t& part_num); - private: +private: bool inited_; ObPartitionTableOperator* pt_operator_; schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/share/partition_table/ob_partition_table_operator.h b/src/share/partition_table/ob_partition_table_operator.h index a2c9aee9a..50dc2294f 100644 --- a/src/share/partition_table/ob_partition_table_operator.h +++ b/src/share/partition_table/ob_partition_table_operator.h @@ -32,7 +32,7 @@ namespace share { class ObIMergeErrorCb; class ObPartitionTableOperator : public ObIPartitionTable { - public: +public: explicit ObPartitionTableOperator(ObIPartPropertyGetter& prop_getter); virtual ~ObPartitionTableOperator(); @@ -44,10 +44,8 @@ class ObPartitionTableOperator : public ObIPartitionTable { int set_callback_for_rs(ObIRsListChangeCb& rs_list_change_cb, ObIMergeErrorCb& merge_error_cb); int set_callback_for_obs(obrpc::ObCommonRpcProxy& rpc_proxy, ObRsMgr& rs_mgr, common::ObServerConfig& config); - virtual int get(const uint64_t table_id, const int64_t partition_id, - ObPartitionInfo &partition_info, - const bool need_fetch_faillist = false, - const int64_t cluster_id = common::OB_INVALID_ID) override; + virtual int get(const uint64_t table_id, const int64_t partition_id, ObPartitionInfo& partition_info, + const bool need_fetch_faillist = false, const int64_t cluster_id = common::OB_INVALID_ID) override; virtual int prefetch_by_table_id(const uint64_t tenant_id, const uint64_t start_table_id, const int64_t set_partition_id, common::ObIArray& partition_infos, @@ -64,35 +62,32 @@ class ObPartitionTableOperator : public ObIPartitionTable { virtual int batch_fetch_partition_infos(const common::ObIArray& keys, common::ObIAllocator& allocator, common::ObArray& partitions, const int64_t cluster_id = common::OB_INVALID_ID) override; - virtual int update(const ObPartitionReplica &replica) override; + virtual int update(const ObPartitionReplica& replica) override; - virtual int batch_execute(const common::ObIArray &replicas) override; + virtual int batch_execute(const common::ObIArray& replicas) override; virtual int batch_report_with_optimization( - const common::ObIArray &replicas, - const bool with_role) override; + const common::ObIArray& replicas, const bool with_role) override; virtual int batch_report_partition_role( - const common::ObIArray &pkey_array, - const ObRole new_role) override; - virtual int remove(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server) override; + const common::ObIArray& pkey_array, const ObRole new_role) override; + virtual int remove(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server) override; - virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const uint64_t unit_id) override; + virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const uint64_t unit_id) override; - virtual int set_original_leader(const uint64_t table_id, int64_t partition_id, - const bool is_original_leader) override; + virtual int set_original_leader( + const uint64_t table_id, int64_t partition_id, const bool is_original_leader) override; - virtual int update_rebuild_flag(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const bool rebuild) override; + virtual int update_rebuild_flag( + const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, const bool rebuild) override; - virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const ObPartitionReplica::FailList &fail_list) override; + virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const ObPartitionReplica::FailList& fail_list) override; - virtual int handover_partition(const common::ObPGKey &pg_key, - const common::ObAddr &src_addr, const common::ObAddr &dest_addr) override; + virtual int handover_partition( + const common::ObPGKey& pg_key, const common::ObAddr& src_addr, const common::ObAddr& dest_addr) override; - virtual int replace_partition(const ObPartitionReplica &replica, - const common::ObAddr &src_addr, const common::ObAddr &dest_addr) override; + virtual int replace_partition( + const ObPartitionReplica& replica, const common::ObAddr& src_addr, const common::ObAddr& dest_addr) override; ObInMemoryPartitionTable& get_inmemory_table() { @@ -105,14 +100,14 @@ class ObPartitionTableOperator : public ObIPartitionTable { } static uint64_t get_partition_table_id(const uint64_t tid); - private: +private: int get_partition_table(const uint64_t table_id, ObIPartitionTable*& partition_table); // with_rootserver means that the observer with rootserver module int set_use_memory_table(ObIRsListChangeCb& rs_list_change_cb); int set_use_rpc_table(obrpc::ObCommonRpcProxy& rpc_proxy, ObRsMgr& rs_mgr, common::ObServerConfig& config); - private: +private: bool inited_; ObIPartitionTable* root_meta_table_; ObInMemoryPartitionTable inmemory_table_; diff --git a/src/share/partition_table/ob_partition_table_proxy.cpp b/src/share/partition_table/ob_partition_table_proxy.cpp index 35518faf6..fdf595166 100644 --- a/src/share/partition_table/ob_partition_table_proxy.cpp +++ b/src/share/partition_table/ob_partition_table_proxy.cpp @@ -37,7 +37,7 @@ using namespace common::sqlclient; namespace partition_table { class ColNames { - public: +public: int update(const char* name, const char* new_name); int append_name_list(common::ObSqlString& sql); @@ -45,7 +45,7 @@ class ColNames { }; class PartitionTableColNames : public ColNames { - public: +public: PartitionTableColNames(); virtual ~PartitionTableColNames() {} @@ -55,7 +55,7 @@ class PartitionTableColNames : public ColNames { return cols_; } - protected: +protected: static const int64_t MAX_COL_CNT = 256; const char* col_names_[MAX_COL_CNT]; common::ObArrayHelper cols_; @@ -63,7 +63,7 @@ class PartitionTableColNames : public ColNames { template class IndexToIndex : public T { - public: +public: int64_t index(const int64_t idx) const { return idx; @@ -72,7 +72,7 @@ class IndexToIndex : public T { template class IndexToName : public T { - public: +public: const char* index(const int64_t idx) const; }; diff --git a/src/share/partition_table/ob_partition_table_proxy.h b/src/share/partition_table/ob_partition_table_proxy.h index ebda95aa0..6feb8fe30 100644 --- a/src/share/partition_table/ob_partition_table_proxy.h +++ b/src/share/partition_table/ob_partition_table_proxy.h @@ -36,7 +36,7 @@ class ObDMLSqlSplicer; class ObIMergeErrorCb; // partition table (__all_core_table, __all_root_table, __all_tenant_meta_table) query && dml proxy class ObPartitionTableProxy { - public: +public: ObPartitionTableProxy(common::ObISQLClient& sql_proxy) : sql_proxy_(sql_proxy), merge_error_cb_(NULL), config_(NULL) {} virtual ~ObPartitionTableProxy() @@ -118,7 +118,7 @@ class ObPartitionTableProxy { static int fill_dml_splicer(const ObPartitionReplica& replica, ObDMLSqlSplicer& dml_splicer); TO_STRING_EMPTY(); - protected: +protected: common::ObISQLClient& get_sql_client(); template @@ -138,7 +138,7 @@ class ObPartitionTableProxy { int construct_partition_infos(RESULT& res, const COLS& cols, common::ObIAllocator& allocator, common::ObIArray& partition_infos); - protected: +protected: common::ObISQLClient& sql_proxy_; common::ObMySQLTransaction trans_; ObIMergeErrorCb* merge_error_cb_; @@ -147,7 +147,7 @@ class ObPartitionTableProxy { // for __all_core_table class ObKVPartitionTableProxy : public ObPartitionTableProxy { - public: +public: ObKVPartitionTableProxy(common::ObISQLClient& sql_proxy) : ObPartitionTableProxy(sql_proxy), core_table_(OB_ALL_ROOT_TABLE_TNAME, sql_proxy), @@ -212,11 +212,11 @@ class ObKVPartitionTableProxy : public ObPartitionTableProxy { static int fill_dml_splicer_for_update(const ObPartitionReplica& replica, ObDMLSqlSplicer& dml_splicer); - private: +private: // start transaction and load __all_root_table for update int load_for_update(); - private: +private: ObCoreTableProxy core_table_; bool is_loaded_; bool implicit_trans_started_; @@ -224,11 +224,11 @@ class ObKVPartitionTableProxy : public ObPartitionTableProxy { // for __all_root_table, __all_tenant_meta_table class ObNormalPartitionTableProxy : public ObPartitionTableProxy { - public: +public: const char* const NORMAL_STATUS = "REPLICA_STATUS_NORMAL"; const char* const UNMERGED_STATUS = "REPLICA_STATUS_UNMERGED"; - public: +public: ObNormalPartitionTableProxy(common::ObISQLClient& sql_proxy) : ObPartitionTableProxy(sql_proxy) {} virtual ~ObNormalPartitionTableProxy() @@ -289,7 +289,7 @@ class ObNormalPartitionTableProxy : public ObPartitionTableProxy { static int fill_dml_splicer_for_update(const ObPartitionReplica& replica, ObDMLSqlSplicer& dml_splicer); - private: +private: virtual int init_empty_string(common::ObSqlString& sql_string); virtual int fetch_partition_infos_impl(const char* pt_name, const uint64_t start_table_id, const int64_t start_partition_id, const bool filter_flag_replica, const int64_t max_fetch_count, @@ -309,7 +309,7 @@ class ObNormalPartitionTableProxy : public ObPartitionTableProxy { }; class ObNormalPartitionUpdateHelper : public ObDMLExecHelper { - public: +public: ObNormalPartitionUpdateHelper(common::ObISQLClient& sql_client, const uint64_t tenant_id) : ObDMLExecHelper(sql_client, tenant_id) {} @@ -324,7 +324,7 @@ class ObNormalPartitionUpdateHelper : public ObDMLExecHelper { }; class ObPartitionTableProxyFactory { - public: +public: ObPartitionTableProxyFactory(common::ObISQLClient& sql_proxy, ObIMergeErrorCb* cb, common::ObServerConfig* config) : kv_proxy_(sql_proxy), normal_proxy_(sql_proxy), merge_error_cb_(cb), config_(config) {} @@ -337,11 +337,11 @@ class ObPartitionTableProxyFactory { // return NULL for invalid %pt_table_id virtual int get_proxy_of_partition_table(const uint64_t pt_table_id, ObPartitionTableProxy*& proxy); - private: +private: // this factory can only be allocated on stack void* operator new(size_t); - private: +private: ObKVPartitionTableProxy kv_proxy_; ObNormalPartitionTableProxy normal_proxy_; ObIMergeErrorCb* merge_error_cb_; diff --git a/src/share/partition_table/ob_persistent_partition_table.h b/src/share/partition_table/ob_persistent_partition_table.h index 47c8817d8..2b2de4c4e 100644 --- a/src/share/partition_table/ob_persistent_partition_table.h +++ b/src/share/partition_table/ob_persistent_partition_table.h @@ -28,21 +28,20 @@ class ObPartitionTableProxy; // for partition table store in __all_core_table __all_root_table and __all_tenant_meta_table class ObPersistentPartitionTable : public ObIPartitionTable { - public: +public: explicit ObPersistentPartitionTable(ObIPartPropertyGetter& prop_getter); virtual ~ObPersistentPartitionTable(); - int init(common::ObISQLClient &sql_proxy, common::ObServerConfig *config); - bool is_inited() const { return inited_; } + int init(common::ObISQLClient& sql_proxy, common::ObServerConfig* config); + bool is_inited() const + { + return inited_; + } - virtual int get(const uint64_t table_id, const int64_t partition_id, - ObPartitionInfo &partition_info, - const bool need_fetch_faillist = false, - const int64_t cluster_id = common::OB_INVALID_ID) override; - virtual int batch_fetch_partition_infos( - const common::ObIArray &keys, - common::ObIAllocator &allocator, - common::ObArray &partitions, + virtual int get(const uint64_t table_id, const int64_t partition_id, ObPartitionInfo& partition_info, + const bool need_fetch_faillist = false, const int64_t cluster_id = common::OB_INVALID_ID) override; + virtual int batch_fetch_partition_infos(const common::ObIArray& keys, + common::ObIAllocator& allocator, common::ObArray& partitions, const int64_t cluster_id = common::OB_INVALID_ID) override; virtual int prefetch_by_table_id(const uint64_t tenant_id, const uint64_t start_table_id, @@ -57,42 +56,39 @@ class ObPersistentPartitionTable : public ObIPartitionTable { const int64_t start_partition_id, common::ObIArray& partition_infos, const bool need_fetch_faillist = false) override; - virtual int update(const ObPartitionReplica &replica) override; + virtual int update(const ObPartitionReplica& replica) override; virtual int batch_report_partition_role( - const common::ObIArray &pkey_array, - const common::ObRole new_role) override; + const common::ObIArray& pkey_array, const common::ObRole new_role) override; - virtual int batch_execute(const common::ObIArray &replicas) override; + virtual int batch_execute(const common::ObIArray& replicas) override; virtual int batch_report_with_optimization( - const common::ObIArray &replicas, - const bool with_role) override; - virtual int remove(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server) override; + const common::ObIArray& replicas, const bool with_role) override; + virtual int remove(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server) override; - virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const uint64_t unit_id) override; + virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const uint64_t unit_id) override; - virtual int set_original_leader(const uint64_t table_id, const int64_t partition_id, - const bool is_original_leader) override; + virtual int set_original_leader( + const uint64_t table_id, const int64_t partition_id, const bool is_original_leader) override; - virtual int update_rebuild_flag(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const bool rebuild) override; + virtual int update_rebuild_flag( + const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, const bool rebuild) override; - virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const ObPartitionReplica::FailList &fail_list) override; + virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const ObPartitionReplica::FailList& fail_list) override; - virtual int handover_partition(const common::ObPGKey &pg_key, - const common::ObAddr &src_addr, const common::ObAddr &dest_addr) override; + virtual int handover_partition( + const common::ObPGKey& pg_key, const common::ObAddr& src_addr, const common::ObAddr& dest_addr) override; - virtual int replace_partition(const ObPartitionReplica &replica, - const common::ObAddr &src_addr, const common::ObAddr &dest_addr) override; + virtual int replace_partition( + const ObPartitionReplica& replica, const common::ObAddr& src_addr, const common::ObAddr& dest_addr) override; common::ObISQLClient* get_sql_proxy() const { return sql_proxy_; } - private: +private: int get_partition_info(const uint64_t table_id, const int64_t partition_id, const bool filter_flag_replica, ObPartitionInfo& partition_info, const bool need_fetch_faillist = false, const int64_t cluster_id = common::OB_INVALID_ID); @@ -103,7 +99,7 @@ class ObPersistentPartitionTable : public ObIPartitionTable { int update_replica(ObPartitionTableProxy& pt_proxy, ObPartitionInfo& partition, const ObPartitionReplica& replica); int execute(ObPartitionTableProxy* proxy, const ObPartitionReplica& replica); - private: +private: bool inited_; common::ObISQLClient* sql_proxy_; common::ObServerConfig* config_; diff --git a/src/share/partition_table/ob_remote_partition_table_operator.h b/src/share/partition_table/ob_remote_partition_table_operator.h index 914c749b5..3b712e4e5 100644 --- a/src/share/partition_table/ob_remote_partition_table_operator.h +++ b/src/share/partition_table/ob_remote_partition_table_operator.h @@ -30,29 +30,22 @@ class ObPartitionLocation; namespace schema { class ObMultiVersionSchemaService; } -class ObRemotePartitionTableOperator : public ObPartitionTableOperator -{ +class ObRemotePartitionTableOperator : public ObPartitionTableOperator { public: - explicit ObRemotePartitionTableOperator(ObIPartPropertyGetter &prop_getter); - virtual ~ObRemotePartitionTableOperator() { } - int init(share::schema::ObMultiVersionSchemaService *schema_service, - ObRemoteSqlProxy *remote_sql_proxy); - virtual int get(const uint64_t table_id, - const int64_t partition_id, - ObPartitionInfo &partition_info, - const bool need_fetch_faillist = false, - const int64_t cluster_id = common::OB_INVALID_ID) override; - virtual int batch_fetch_partition_infos( - const common::ObIArray &keys, - common::ObIAllocator &allocator, - common::ObArray &partitions, + explicit ObRemotePartitionTableOperator(ObIPartPropertyGetter& prop_getter); + virtual ~ObRemotePartitionTableOperator() + {} + int init(share::schema::ObMultiVersionSchemaService* schema_service, ObRemoteSqlProxy* remote_sql_proxy); + virtual int get(const uint64_t table_id, const int64_t partition_id, ObPartitionInfo& partition_info, + const bool need_fetch_faillist = false, const int64_t cluster_id = common::OB_INVALID_ID) override; + virtual int batch_fetch_partition_infos(const common::ObIArray& keys, + common::ObIAllocator& allocator, common::ObArray& partitions, const int64_t cluster_id = common::OB_INVALID_ID) override; - //not supported interface - virtual int batch_execute(const common::ObIArray &replicas) override; - virtual int prefetch_by_table_id(const uint64_t tenant_id, const uint64_t table_id, - const int64_t partition_id, common::ObIArray &partition_infos, - const bool need_fetch_faillist = false) override; + // not supported interface + virtual int batch_execute(const common::ObIArray& replicas) override; + virtual int prefetch_by_table_id(const uint64_t tenant_id, const uint64_t table_id, const int64_t partition_id, + common::ObIArray& partition_infos, const bool need_fetch_faillist = false) override; virtual int prefetch(const uint64_t tenant_id, const uint64_t table_id, const int64_t partition_id, common::ObIArray& partition_infos, bool ignore_row_checksum, @@ -62,29 +55,27 @@ public: const int64_t partition_id, common::ObIArray& partition_infos, const bool need_fetch_faillist = false) override; - virtual int update(const ObPartitionReplica &replica) override; + virtual int update(const ObPartitionReplica& replica) override; - virtual int remove(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server) override; + virtual int remove(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server) override; - virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const uint64_t unit_id) override; + virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const uint64_t unit_id) override; - virtual int set_original_leader(const uint64_t table_id, const int64_t partition_id, - const bool is_original_leader) override; + virtual int set_original_leader( + const uint64_t table_id, const int64_t partition_id, const bool is_original_leader) override; - virtual int update_rebuild_flag(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const bool rebuild) override; + virtual int update_rebuild_flag( + const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, const bool rebuild) override; + + virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const ObPartitionReplica::FailList& fail_list) override; - virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const ObPartitionReplica::FailList &fail_list) override; private: - int get_partition_info( - const uint64_t table_id, const int64_t partition_id, - const bool filter_flag_replica, ObPartitionInfo &partition_info, - common::ObConsistencyLevel consistency); + int get_partition_info(const uint64_t table_id, const int64_t partition_id, const bool filter_flag_replica, + ObPartitionInfo& partition_info, common::ObConsistencyLevel consistency); - private: +private: bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; ObPartitionTableOperator pt_; diff --git a/src/share/partition_table/ob_replica_filter.h b/src/share/partition_table/ob_replica_filter.h index f14f546b7..50f5bfd54 100644 --- a/src/share/partition_table/ob_replica_filter.h +++ b/src/share/partition_table/ob_replica_filter.h @@ -30,7 +30,7 @@ class ObIServerTrace; class ObIZoneTrace; class ObIReplicaFilter { - public: +public: ObIReplicaFilter() {} virtual ~ObIReplicaFilter() @@ -43,7 +43,7 @@ class ObIReplicaFilter { }; class ObReplicaFilter : public ObIReplicaFilter, public common::ObDLinkBase { - public: +public: ObReplicaFilter() {} virtual ~ObReplicaFilter() @@ -51,19 +51,19 @@ class ObReplicaFilter : public ObIReplicaFilter, public common::ObDLinkBase& server_list); virtual int check(const ObPartitionReplica& replica, bool& pass) const; - private: +private: common::ObArray invalid_server_list_; }; class ObUnitFilter : public ObReplicaFilter { - public: +public: ObUnitFilter() : unit_ids_() {} virtual ~ObUnitFilter() @@ -313,12 +313,12 @@ class ObUnitFilter : public ObReplicaFilter { int set_unit_ids(const common::ObIArray& unit_ids); virtual int check(const ObPartitionReplica& replica, bool& pass) const; - private: +private: common::ObArray unit_ids_; }; class ObOnlyClusterPrivateTable : public ObReplicaFilter { - public: +public: explicit ObOnlyClusterPrivateTable() {} virtual ~ObOnlyClusterPrivateTable() @@ -331,7 +331,7 @@ class ObOnlyClusterPrivateTable : public ObReplicaFilter { }; class ObFilterSpecialTable : public ObReplicaFilter { - public: +public: explicit ObFilterSpecialTable() {} virtual ~ObFilterSpecialTable() @@ -344,7 +344,7 @@ class ObFilterSpecialTable : public ObReplicaFilter { }; class ObMemberListReplicaFilter : public ObReplicaFilter { - public: +public: ObMemberListReplicaFilter() {} virtual ~ObMemberListReplicaFilter() @@ -353,7 +353,7 @@ class ObMemberListReplicaFilter : public ObReplicaFilter { }; class ObInvalidPaxosReplicaFilter : public ObReplicaFilter { - public: +public: ObInvalidPaxosReplicaFilter() {} virtual ~ObInvalidPaxosReplicaFilter() @@ -362,7 +362,7 @@ class ObInvalidPaxosReplicaFilter : public ObReplicaFilter { }; class ObRebuildReplicaFilter : public ObReplicaFilter { - public: +public: ObRebuildReplicaFilter() {} virtual ~ObRebuildReplicaFilter() @@ -371,7 +371,7 @@ class ObRebuildReplicaFilter : public ObReplicaFilter { }; class ObRestoreReplicaFilter : public ObReplicaFilter { - public: +public: ObRestoreReplicaFilter() {} virtual ~ObRestoreReplicaFilter() @@ -380,7 +380,7 @@ class ObRestoreReplicaFilter : public ObReplicaFilter { }; class ObCutdataStatusFilter : public ObReplicaFilter { - public: +public: ObCutdataStatusFilter() {} virtual ~ObCutdataStatusFilter() @@ -389,7 +389,7 @@ class ObCutdataStatusFilter : public ObReplicaFilter { }; class ObValidReplicaTypeFilter : public ObReplicaFilter { - public: +public: ObValidReplicaTypeFilter() {} virtual ~ObValidReplicaTypeFilter() @@ -398,7 +398,7 @@ class ObValidReplicaTypeFilter : public ObReplicaFilter { }; class ObNotLogOnlyReplicaTypeFilter : public ObReplicaFilter { - public: +public: explicit ObNotLogOnlyReplicaTypeFilter() {} virtual ~ObNotLogOnlyReplicaTypeFilter() @@ -407,7 +407,7 @@ class ObNotLogOnlyReplicaTypeFilter : public ObReplicaFilter { }; class ObReplicaFilterHolder : public ObIReplicaFilter { - public: +public: ObReplicaFilterHolder(); virtual ~ObReplicaFilterHolder(); @@ -455,10 +455,10 @@ class ObReplicaFilterHolder : public ObIReplicaFilter { int set_only_cutdata_status(); int set_only_not_logonly_replica(); - private: +private: int build_skip_flag(); - private: +private: bool skip_empty_partition_; common::ObDList filter_list_; @@ -499,7 +499,7 @@ class ObReplicaFilterHolder : public ObIReplicaFilter { }; class ObIPartitionEntityFilter { - public: +public: ObIPartitionEntityFilter() {} virtual ~ObIPartitionEntityFilter() @@ -509,7 +509,7 @@ class ObIPartitionEntityFilter { }; class ObPartitionEntityFilter : public ObIPartitionEntityFilter, public common::ObDLinkBase { - public: +public: ObPartitionEntityFilter() {} virtual ~ObPartitionEntityFilter() @@ -517,7 +517,7 @@ class ObPartitionEntityFilter : public ObIPartitionEntityFilter, public common:: }; class ObFilterSinglePrimaryZone : public ObPartitionEntityFilter { - public: +public: ObFilterSinglePrimaryZone(const ObIZoneTrace* zone_trace) : zone_trace_(zone_trace) {} virtual ~ObFilterSinglePrimaryZone() @@ -525,33 +525,33 @@ class ObFilterSinglePrimaryZone : public ObPartitionEntityFilter { virtual int check(const share::schema::ObPrimaryZone& primary_zone_info, const common::ObIArray& zone_locality, bool& pass) const override; - private: +private: int get_full_replica_num( const common::ObIArray& zone_locality, int64_t& full_replica_num) const; - private: +private: const ObIZoneTrace* zone_trace_; }; class ObPartitionEntityFilterHolder : public ObIPartitionEntityFilter { - public: +public: ObPartitionEntityFilterHolder() : ObIPartitionEntityFilter(), filter_list_(), filter_single_primary_zone_(nullptr) {} virtual ~ObPartitionEntityFilterHolder() {} - public: +public: virtual int check(const share::schema::ObPrimaryZone& primary_zone_info, const common::ObIArray& zone_locality, bool& pass) const override; int add(ObPartitionEntityFilter& filter); void reuse(); int filter_single_primary_zone(const ObIZoneTrace& zone_trace); - private: +private: common::ObDList filter_list_; ObFilterSinglePrimaryZone filter_single_primary_zone_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionEntityFilterHolder); }; } // end namespace share diff --git a/src/share/partition_table/ob_rpc_partition_table.h b/src/share/partition_table/ob_rpc_partition_table.h index 1584ceba6..7e14eea8e 100644 --- a/src/share/partition_table/ob_rpc_partition_table.h +++ b/src/share/partition_table/ob_rpc_partition_table.h @@ -29,7 +29,7 @@ namespace share { class ObRsMgr; class ObRpcPartitionTable : public ObIPartitionTable { - public: +public: explicit ObRpcPartitionTable(ObIPartPropertyGetter& prop_getter); virtual ~ObRpcPartitionTable(); @@ -39,11 +39,9 @@ class ObRpcPartitionTable : public ObIPartitionTable { { return is_inited_; } - - virtual int get(const uint64_t table_id, - const int64_t partition_id, ObPartitionInfo &partition_info, - const bool need_fetch_faillist = false, - const int64_t cluster_id = common::OB_INVALID_ID) override; + + virtual int get(const uint64_t table_id, const int64_t partition_id, ObPartitionInfo& partition_info, + const bool need_fetch_faillist = false, const int64_t cluster_id = common::OB_INVALID_ID) override; virtual int prefetch_by_table_id(const uint64_t tenant_id, const uint64_t start_table_id, const int64_t start_partition_id, common::ObIArray& partition_infos, @@ -57,57 +55,49 @@ class ObRpcPartitionTable : public ObIPartitionTable { const int64_t start_partition_id, common::ObIArray& partition_infos, const bool need_fetch_faillist = false) override; - virtual int batch_fetch_partition_infos( - const common::ObIArray &keys, - common::ObIAllocator &allocator, - common::ObArray &partitions, + virtual int batch_fetch_partition_infos(const common::ObIArray& keys, + common::ObIAllocator& allocator, common::ObArray& partitions, const int64_t cluster_id = common::OB_INVALID_ID) override; - virtual int batch_execute(const common::ObIArray &replicas) override; + virtual int batch_execute(const common::ObIArray& replicas) override; virtual int batch_report_with_optimization( - const common::ObIArray &replicas, - const bool with_role) override; + const common::ObIArray& replicas, const bool with_role) override; virtual int batch_report_partition_role( - const common::ObIArray &pkey_array, - const common::ObRole new_role) override; - virtual int update(const ObPartitionReplica &replica) override; + const common::ObIArray& pkey_array, const common::ObRole new_role) override; + virtual int update(const ObPartitionReplica& replica) override; - virtual int remove(const uint64_t table_id, - const int64_t partition_id, const common::ObAddr &server) override; + virtual int remove(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server) override; - virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const uint64_t unit_id) override; + virtual int set_unit_id(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const uint64_t unit_id) override; - virtual int update_rebuild_flag(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const bool rebuild) override; - virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, - const common::ObAddr &server, const ObPartitionReplica::FailList &fail_list) override; + virtual int update_rebuild_flag( + const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, const bool rebuild) override; + virtual int update_fail_list(const uint64_t table_id, const int64_t partition_id, const common::ObAddr& server, + const ObPartitionReplica::FailList& fail_list) override; - virtual int handover_partition(const common::ObPGKey &pg_key, - const common::ObAddr &src_addr, const common::ObAddr &dest_addr) override; + virtual int handover_partition( + const common::ObPGKey& pg_key, const common::ObAddr& src_addr, const common::ObAddr& dest_addr) override; - virtual int replace_partition(const ObPartitionReplica &replica, - const common::ObAddr &src_addr, const common::ObAddr &dest_addr) override; + virtual int replace_partition( + const ObPartitionReplica& replica, const common::ObAddr& src_addr, const common::ObAddr& dest_addr) override; + + virtual int set_original_leader( + const uint64_t table_id, const int64_t partition_id, const bool is_original_leader) override; - virtual int set_original_leader(const uint64_t table_id, const int64_t partition_id, - const bool is_original_leader) override; private: - int get_timeout(int64_t &timeout); - int fetch_root_partition_v1(ObPartitionInfo &partition_info); - int fetch_root_partition_v2(ObPartitionInfo &partition_info); - int fetch_root_partition_from_rs_list_v1(ObPartitionInfo &partition_info); - int fetch_root_partition_from_all_server_v1(ObPartitionInfo &partition); + int get_timeout(int64_t& timeout); + int fetch_root_partition_v1(ObPartitionInfo& partition_info); + int fetch_root_partition_v2(ObPartitionInfo& partition_info); + int fetch_root_partition_from_rs_list_v1(ObPartitionInfo& partition_info); + int fetch_root_partition_from_all_server_v1(ObPartitionInfo& partition); - int fetch_root_partition_from_rs_list_v2(common::ObIArray &obs_list, - ObPartitionInfo &partition_info); - int fetch_root_partition_from_all_server_v2(const common::ObIArray &obs_list, - ObPartitionInfo &partition); - int fetch_root_partition_from_ps_v2(common::ObIArray &obs_list, - ObPartitionInfo &partition); - int fetch_root_partition_from_obs_v1(const common::ObIArray &obs_list, - ObPartitionInfo &partition_info); + int fetch_root_partition_from_rs_list_v2(common::ObIArray& obs_list, ObPartitionInfo& partition_info); + int fetch_root_partition_from_all_server_v2(const common::ObIArray& obs_list, ObPartitionInfo& partition); + int fetch_root_partition_from_ps_v2(common::ObIArray& obs_list, ObPartitionInfo& partition); + int fetch_root_partition_from_obs_v1(const common::ObIArray& obs_list, ObPartitionInfo& partition_info); - const int64_t CACHE_VALID_INTERVAL = 300 * 1000 * 1000; // 5min + const int64_t CACHE_VALID_INTERVAL = 300 * 1000 * 1000; // 5min private: bool is_inited_; @@ -115,7 +105,7 @@ private: share::ObRsMgr* rs_mgr_; common::ObServerConfig* config_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRpcPartitionTable); }; diff --git a/src/share/partition_table/ob_tenant_partition_container.h b/src/share/partition_table/ob_tenant_partition_container.h index 1e7399605..6e58d21c7 100644 --- a/src/share/partition_table/ob_tenant_partition_container.h +++ b/src/share/partition_table/ob_tenant_partition_container.h @@ -24,9 +24,9 @@ class ObMultiVersionSchemaService; } // namespace schema class ObTenantPartitionContainer { - public: +public: struct Partition { - public: + public: Partition() : partition_info_(), tablegroup_id_(common::OB_INVALID_ID) {} void reset() @@ -37,7 +37,7 @@ class ObTenantPartitionContainer { int assign(const Partition& other); TO_STRING_KV(K_(partition_info), K_(tablegroup_id)); - public: + public: ObPartitionInfo partition_info_; int64_t tablegroup_id_; }; @@ -47,14 +47,14 @@ class ObTenantPartitionContainer { {} bool operator()(const Partition* left, const Partition* right); - private: + private: template int compare(const T& left, const T& right) { return left < right ? -1 : (left == right ? 0 : 1); } - private: + private: int& ret_; }; @@ -64,7 +64,7 @@ class ObTenantPartitionContainer { int fetch_partition(ObTenantPartitionIterator& iter); int get_sorted_partition(common::ObIArray*& sorted_partition); - private: +private: bool inited_; share::schema::ObMultiVersionSchemaService* schema_service_; common::ObArray all_partition_; diff --git a/src/share/partition_table/ob_united_pt_operator.h b/src/share/partition_table/ob_united_pt_operator.h index 518aecc09..cd54b823a 100644 --- a/src/share/partition_table/ob_united_pt_operator.h +++ b/src/share/partition_table/ob_united_pt_operator.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace share { class ObPartitionInfo; class ObUnitedPtOperator { - public: +public: ObUnitedPtOperator(); virtual ~ObUnitedPtOperator() {} @@ -28,14 +28,14 @@ class ObUnitedPtOperator { // when on primary cluster, return only the partition infos of the primary cluster, remote_partition is reset virtual int united_get(const uint64_t table_id, const int64_t partition_id, ObPartitionInfo& partition_info); - private: +private: // specify a specific table_id/partition_id to get partition info // when on standby cluster, return the partition infos both on primary and standby clusters. // when on primary cluster, return only the partition infos of the primary cluster, remote_partition is reset int get(const uint64_t table_id, const int64_t partition_id, ObPartitionInfo& local_partition, ObPartitionInfo& remote_partition); - private: +private: bool inited_; ObPartitionTableOperator* pt_operator_; ObRemotePartitionTableOperator* remote_pt_operator_; diff --git a/src/share/rc/ob_context.h b/src/share/rc/ob_context.h index 96a5c14ad..2857e9c0b 100644 --- a/src/share/rc/ob_context.h +++ b/src/share/rc/ob_context.h @@ -52,19 +52,19 @@ class ObTenantSpaceFetcher; #define BIND_ENTITY(ENTITY_TYPE, CLS) \ template <> \ class Enum2Entity { \ - public: \ + public: \ using type = CLS; \ }; \ template <> \ class Entity2Enum { \ - public: \ + public: \ const static ObEntityType type = ENTITY_TYPE; \ }; #define BIND_FETCHER(ENTITY_TYPE, CLS) \ template <> \ class Type2Fetcher { \ - public: \ + public: \ using type = CLS; \ }; @@ -88,16 +88,16 @@ class EntityBase { template friend void destroy_entity(T_Entity* entity); - public: +public: EntityBase() : need_free_(true) {} - private: +private: bool need_free_; }; class ObTenantSpace : public EntityBase { - public: +public: ObTenantSpace(ObTenantBase* tenant) : tenant_(tenant) {} int init() @@ -115,12 +115,12 @@ class ObTenantSpace : public EntityBase { static void guard_deinit_cb(const ObTenantSpace& tenant_space, char* buf); static ObTenantSpace& root(); - private: +private: ObTenantBase* tenant_; }; class ObResourceOwner : public EntityBase { - public: +public: ObResourceOwner(const uint64_t owner_id) : owner_id_(owner_id) {} int init() @@ -141,12 +141,12 @@ class ObResourceOwner : public EntityBase { {} static ObResourceOwner& root(); - private: +private: uint64_t owner_id_; }; class ObTableSpace : public EntityBase { - public: +public: ObTableSpace(const uint64_t table_id) : table_id_(table_id) {} int init(); @@ -160,7 +160,7 @@ class ObTableSpace : public EntityBase { static void guard_deinit_cb(const ObTableSpace& table_space, char* buf); static ObTableSpace& root(); - private: +private: uint64_t table_id_; share::ObWorker::CompatMode compat_mode_; }; @@ -170,7 +170,7 @@ class ObTableSpace : public EntityBase { // TenantGuard, the TenantGuard will do the search, Will destroy the Guard's positioning, we keep the Guard simple // (Guard only does the switching function), so the logic of obtaining TenantSpace is placed on the outer layer class ObTenantSpaceFetcher { - public: +public: ObTenantSpaceFetcher(uint64_t tenant_id); ~ObTenantSpaceFetcher(); int get_ret() const @@ -183,7 +183,7 @@ class ObTenantSpaceFetcher { return *entity_; } - private: +private: int ret_; common::ObLDHandle handle_; ObTenantSpace* entity_; @@ -206,7 +206,7 @@ template class Guard final { using T_Entity = typename Enum2Entity::type; - public: +public: Guard(T_Entity& ref_entity) : ref_entity_(ref_entity), prev_(nullptr), next_(nullptr), is_inited_(false), is_inited_of_cb_(false) {} @@ -271,14 +271,14 @@ class Guard final { return *prev_; } - private: +private: static Guard*& g_guard() { static lib::CoVar g_guard; return g_guard; } - private: +private: T_Entity& ref_entity_; Guard* prev_; Guard* next_; @@ -337,7 +337,7 @@ inline void destroy_entity(T_Entity* entity) } class _SBase { - public: +public: int get_ret() const { return ret_; @@ -362,7 +362,7 @@ class _S : public _SBase { using T_Guard = Guard; using T_Entity = typename Enum2Entity::type; - public: +public: _S(const bool condition, T_Entity* entity) : _SBase(), guard_(nullptr) { int ret = common::OB_SUCCESS; @@ -394,7 +394,7 @@ class _S : public _SBase { using T_Entity = typename Enum2Entity::type; using T_EntityFetcher = typename Type2Fetcher::type; - public: +public: template _S(const bool condition, Args&&... args) : _SBase(), fetcher_(nullptr), guard_(nullptr) { @@ -423,7 +423,7 @@ class _S : public _SBase { } } - private: +private: char buf0_[sizeof(T_EntityFetcher)] __attribute__((aligned(16))); char buf1_[sizeof(T_Guard)] __attribute__((aligned(16))); T_EntityFetcher* fetcher_; @@ -435,7 +435,7 @@ class _S : public _SBase { using T_Guard = Guard; using T_Entity = typename Enum2Entity::type; - public: +public: template _S(const bool condition, Args&&... args) : _SBase(), entity_(nullptr), guard_(nullptr) { diff --git a/src/share/rc/ob_tenant_base.h b/src/share/rc/ob_tenant_base.h index c59d357e5..f0811df70 100644 --- a/src/share/rc/ob_tenant_base.h +++ b/src/share/rc/ob_tenant_base.h @@ -95,7 +95,7 @@ class ObTenantBase { template struct Identity {}; - public: +public: explicit ObTenantBase(const int64_t id); int init(); @@ -122,11 +122,11 @@ class ObTenantBase { return obj; } - private: +private: ObTenantBase(); #define MEMBER(TYPE, IDX) \ - public: \ +public: \ typedef int (*init_m##IDX##_func_name)(TYPE&); \ typedef void (*destory_m##IDX##_func_name)(TYPE&); \ static void mtl_bind_init_and_destory_func( \ @@ -136,7 +136,7 @@ class ObTenantBase { destory_m##IDX##_func = destory_func; \ } \ \ - private: \ +private: \ TYPE inner_get(Identity) \ { \ return m##IDX##_; \ @@ -147,10 +147,10 @@ class ObTenantBase { LST_DO2(MEMBER, (), MTL_MEMBERS); - protected: +protected: virtual int unlock(common::ObLDHandle& handle) = 0; - protected: +protected: // tenant id const uint64_t id_; bool inited_; diff --git a/src/share/redolog/ob_log_disk_manager.h b/src/share/redolog/ob_log_disk_manager.h index 950abfafd..039b22488 100644 --- a/src/share/redolog/ob_log_disk_manager.h +++ b/src/share/redolog/ob_log_disk_manager.h @@ -50,7 +50,7 @@ enum ObLogDiskState { }; struct ObLogFdInfo { - public: +public: int fd_; int64_t disk_id_; int64_t file_id_; @@ -72,7 +72,7 @@ struct ObLogFdInfo { }; class ObLogDiskInfo { - public: +public: ObLogDiskInfo() : disk_id_(-1), state_(OB_LDS_INVALID), @@ -149,7 +149,7 @@ class ObLogDiskInfo { TO_STRING_KV(K_(disk_id), K_(dir_path), K_(state), K_(state_modify_timestamp), K_(restore_start_file_id), K_(restore_start_offset), K_(log_dir), K_(file_pool), K_(is_inited)); - private: +private: OB_INLINE void set_disk_path(const char* path) { if (STRLEN(path) >= OB_MAX_FILE_NAME_LENGTH) { @@ -160,7 +160,7 @@ class ObLogDiskInfo { } } - private: +private: int64_t disk_id_; char dir_path_[OB_MAX_FILE_NAME_LENGTH]; int64_t state_; @@ -175,9 +175,9 @@ class ObLogDiskInfo { }; class ObLogDiskManager { - public: +public: class BaseDiskIterator { - public: + public: BaseDiskIterator(const ObLogDiskManager* disk_mgr, int64_t idx) { disk_mgr_ = disk_mgr; @@ -222,24 +222,24 @@ class ObLogDiskManager { return (other.disk_mgr_ != disk_mgr_) || (other.cur_idx_ != cur_idx_); } - protected: + protected: virtual bool is_qualified_state(const ObLogDiskState state) { UNUSED(state); return true; } - private: + private: const ObLogDiskManager* disk_mgr_; int64_t cur_idx_; }; class ReadWriteDiskIterator : public BaseDiskIterator { - public: + public: ReadWriteDiskIterator(const ObLogDiskManager* disk_mgr, int64_t idx) : BaseDiskIterator(disk_mgr, idx){}; virtual ~ReadWriteDiskIterator(){}; - protected: + protected: virtual bool is_qualified_state(const ObLogDiskState state) { return OB_LDS_GOOD == state || OB_LDS_RESTORE == state; @@ -261,7 +261,7 @@ class ObLogDiskManager { // 4) Get restore start file and offset from disk info // 5) Catch up finish class LogRestoreProgress { - public: + public: LogRestoreProgress() { reset(); @@ -286,7 +286,7 @@ class ObLogDiskManager { static const int16_t DATA_VERSION = 1; - public: + public: OB_INLINE bool is_catchup_start() const { return catchup_file_id_ > 0 && catchup_offset_ >= 0; @@ -309,11 +309,11 @@ class ObLogDiskManager { int deserialize(const char* buf, const int64_t data_len, int64_t& pos); int64_t get_serialize_size(void) const; - private: + private: int check(); }; - public: +public: ObLogDiskManager(); virtual ~ObLogDiskManager(); @@ -360,7 +360,7 @@ class ObLogDiskManager { static ObLogDiskManager* get_disk_manager(const ObRedoLogType log_type); static const int64_t MAX_DISK_COUNT = 5; - private: +private: struct DirScanResult { int64_t disk_id_; int64_t min_log_id_; @@ -377,7 +377,7 @@ class ObLogDiskManager { }; class MonitorTask : public common::ObTimerTask { - public: + public: MonitorTask() : disk_mgr_(NULL) {} virtual ~MonitorTask() @@ -391,7 +391,7 @@ class ObLogDiskManager { } virtual void runTimerTask(); - private: + private: ObLogDiskManager* disk_mgr_; DISALLOW_COPY_AND_ASSIGN(MonitorTask); }; @@ -512,7 +512,7 @@ class ObLogDiskManager { const char* LOG_RESTORE_FILENAME = "LOG_RESTORE"; const char* VALID_DISK_PREFIX = "disk"; - private: +private: bool is_inited_; char log_dir_[OB_MAX_FILE_NAME_LENGTH]; int64_t file_size_; @@ -532,7 +532,7 @@ class ObLogDiskManager { }; class ObSLogDiskManager : public ObLogDiskManager { - public: +public: virtual ~ObSLogDiskManager() {} @@ -547,13 +547,13 @@ class ObSLogDiskManager : public ObLogDiskManager { return ObLogDiskManager::init(log_dir, file_size, clog::ObLogWritePoolType::SLOG_WRITE_POOL); } - private: +private: ObSLogDiskManager() {} }; class ObCLogDiskManager : public ObLogDiskManager { - public: +public: virtual ~ObCLogDiskManager() {} @@ -568,13 +568,13 @@ class ObCLogDiskManager : public ObLogDiskManager { return ObLogDiskManager::init(log_dir, file_size, clog::ObLogWritePoolType::CLOG_WRITE_POOL); } - private: +private: ObCLogDiskManager() {} }; class ObILogDiskManager : public ObLogDiskManager { - public: +public: virtual ~ObILogDiskManager() {} @@ -589,7 +589,7 @@ class ObILogDiskManager : public ObLogDiskManager { return ObLogDiskManager::init(log_dir, file_size, clog::ObLogWritePoolType::ILOG_WRITE_POOL); } - private: +private: ObILogDiskManager() {} }; diff --git a/src/share/redolog/ob_log_file_reader.h b/src/share/redolog/ob_log_file_reader.h index 76562d339..efc501165 100644 --- a/src/share/redolog/ob_log_file_reader.h +++ b/src/share/redolog/ob_log_file_reader.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace share { struct ObLogReadFdKey final { - public: +public: ObLogReadFdKey(); ~ObLogReadFdKey() = default; void reset(); @@ -36,7 +36,7 @@ struct ObLogReadFdKey final { }; struct ObLogReadFdCacheItem final { - public: +public: ObLogReadFdCacheItem(); ~ObLogReadFdCacheItem() { @@ -48,7 +48,7 @@ struct ObLogReadFdCacheItem final { void reset(); TO_STRING_KV(K(key_), K(in_map_), K(fd_), K(ref_cnt_), K(timestamp_), KP(prev_), KP(next_)); - public: +public: ObLogReadFdKey key_; bool in_map_; int fd_; @@ -59,7 +59,7 @@ struct ObLogReadFdCacheItem final { }; class ObLogReadFdHandle final { - public: +public: ObLogReadFdHandle() : fd_item_(nullptr), is_local_(false){}; ~ObLogReadFdHandle() { @@ -74,14 +74,14 @@ class ObLogReadFdHandle final { }; TO_STRING_KV(KP(fd_item_), K(is_local_)); - private: +private: ObLogReadFdCacheItem* fd_item_; bool is_local_; // indicate if the fd_item_ is only used for this handle DISALLOW_COPY_AND_ASSIGN(ObLogReadFdHandle); }; class ObLogFileReader2 final { - public: +public: static ObLogFileReader2& get_instance(); int init(); @@ -93,7 +93,7 @@ class ObLogFileReader2 final { int evict_fd(const char* log_dir, const uint32_t file_id); static void close_fd(const int fd); - private: +private: ObLogFileReader2(); ~ObLogFileReader2(); @@ -106,20 +106,20 @@ class ObLogFileReader2 final { int do_clear_work(); - private: +private: class EvictTask : public common::ObTimerTask { - public: + public: explicit EvictTask(ObLogFileReader2* reader) : reader_(reader) {} virtual ~EvictTask() = default; virtual void runTimerTask(); - private: + private: ObLogFileReader2* reader_; DISALLOW_COPY_AND_ASSIGN(EvictTask); }; - private: +private: typedef common::hash::ObHashMap FD_MAP; static const int64_t MAP_BUCKET_INIT_CNT = 53; static const int64_t CACHE_EVICT_TIME_IN_US = 60 * 1000 * 1000; // 1 minute diff --git a/src/share/redolog/ob_log_file_store.h b/src/share/redolog/ob_log_file_store.h index e73a2758f..9bddaf6f4 100644 --- a/src/share/redolog/ob_log_file_store.h +++ b/src/share/redolog/ob_log_file_store.h @@ -53,7 +53,7 @@ struct ObLogFileIOInfo final { }; class ObLogFileDescriptor final { - public: +public: friend class ObLogFileStore; friend class ObLogFileReader; @@ -77,7 +77,7 @@ class ObLogFileDescriptor final { static const int8_t WRITE_FLAG = 2; static const int8_t TEMP_FLAG = 4; - private: +private: int get_log_fd(const int64_t disk_id); OB_INLINE bool is_tmp() const { @@ -94,7 +94,7 @@ class ObLogFileDescriptor final { bool is_valid_state(const ObLogDiskState state); static const int8_t FLAG_MASK = 0x0F; - private: +private: int8_t flag_; // local fd @@ -108,7 +108,7 @@ class ObLogFileDescriptor final { }; class ObLogFileReader final { - public: +public: static int get_fd( const char* log_dir, const int64_t file_id, const ObRedoLogType log_type, ObLogFileDescriptor& log_fd); static int64_t pread(ObLogFileDescriptor& log_fd, void* buf, const int64_t count, const int64_t offset); @@ -119,7 +119,7 @@ class ObLogFileReader final { // It exposes file_id to caller but hide the underlying multiple disks detail. // Caller read or write log file by file_id. class ObILogFileStore { - public: +public: ObILogFileStore() : log_type_(OB_REDO_TYPE_INVALID) {} virtual ~ObILogFileStore() @@ -169,14 +169,14 @@ class ObILogFileStore { static int format_file_path( char* buf, const int64_t size, const char* log_dir, const int64_t file_id, const bool is_tmp); - public: +public: static const int OPEN_FLAG_READ = O_RDONLY | O_DIRECT; static const int OPEN_FLAG_WRITE = O_WRONLY | O_DIRECT | O_SYNC | O_CREAT | O_APPEND; static const int OPEN_MODE = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; static const int64_t DEFAULT_DISK_USE_PERCENT = 80; // default value for clog static const int64_t SLOG_DISK_USE_PERCENT = 80; - protected: +protected: static const int MAX_IO_COUNT = 1024; static const int64_t AIO_TIMEOUT_SECOND = 30; static const int64_t CLOG_AIO_TIMEOUT_SECOND = 300; @@ -188,7 +188,7 @@ class ObILogFileStore { }; class ObLogFileStore : public ObILogFileStore { - public: +public: ObLogFileStore(); virtual ~ObLogFileStore(); @@ -259,7 +259,7 @@ class ObLogFileStore : public ObILogFileStore { return disk_mgr_->free_quota_warn(); } - private: +private: int inner_open(const int64_t file_id, const int8_t flag, ObLogFileDescriptor& log_fd); int inner_close(ObLogFileDescriptor& log_fd); int rename(const int64_t file_id); @@ -271,7 +271,7 @@ class ObLogFileStore : public ObILogFileStore { int process_failed_write(); int fstat(const int64_t file_id, struct stat* file_stat) const; - private: +private: bool is_inited_; ObLogDiskManager* disk_mgr_; diff --git a/src/share/redolog/ob_log_store_factory.h b/src/share/redolog/ob_log_store_factory.h index b5cb42b4b..34b8b51a4 100644 --- a/src/share/redolog/ob_log_store_factory.h +++ b/src/share/redolog/ob_log_store_factory.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class ObLogStoreFactory { - public: +public: static ObILogFileStore* create(const char* log_dir, const int64_t file_size, const clog::ObLogWritePoolType type); static void destroy(ObILogFileStore*& store); diff --git a/src/share/resource_manager/ob_resource_manager.h b/src/share/resource_manager/ob_resource_manager.h index d27b7978d..61f035a1c 100644 --- a/src/share/resource_manager/ob_resource_manager.h +++ b/src/share/resource_manager/ob_resource_manager.h @@ -24,7 +24,7 @@ class ObString; namespace share { class ObResourceManager { - public: +public: static ObResourceManager& get_instance(); int init(); ObResourcePlanManager& get_plan_mgr() @@ -36,11 +36,11 @@ class ObResourceManager { return res_mapping_rule_mgr_; } - private: +private: ObResourceManager() = default; virtual ~ObResourceManager() = default; - private: +private: /* variables */ ObResourcePlanManager res_plan_mgr_; ObResourceMappingRuleManager res_mapping_rule_mgr_; diff --git a/src/share/resource_manager/ob_resource_manager_proxy.h b/src/share/resource_manager/ob_resource_manager_proxy.h index 14ceef1e1..f92b67521 100644 --- a/src/share/resource_manager/ob_resource_manager_proxy.h +++ b/src/share/resource_manager/ob_resource_manager_proxy.h @@ -26,7 +26,7 @@ class ObObj; } // namespace common namespace share { class ObResourceManagerProxy { - public: +public: ObResourceManagerProxy(); virtual ~ObResourceManagerProxy(); int create_plan(uint64_t tenant_id, const common::ObString& plan, const common::ObObj& comment); @@ -55,7 +55,7 @@ class ObResourceManagerProxy { int get_all_resource_mapping_rules_by_user( uint64_t tenant_id, const common::ObString& plan, common::ObIArray& rules); - private: +private: int allocate_consumer_group_id(common::ObMySQLTransaction& trans, uint64_t tenant_id, int64_t& group_id); int check_if_plan_directive_exist(common::ObMySQLTransaction& trans, uint64_t tenant_id, const common::ObString& plan, const common::ObString& group, bool& exist); @@ -65,19 +65,19 @@ class ObResourceManagerProxy { common::ObMySQLTransaction& trans, uint64_t tenant_id, const common::ObString& group, bool& exist); int get_percentage(const char* name, const common::ObObj& obj, int64_t& v); - public: +public: class TransGuard { - public: + public: TransGuard(common::ObMySQLTransaction& trans, int& ret); ~TransGuard(); bool ready(); - private: + private: common::ObMySQLTransaction& trans_; int& ret_; }; - private: +private: /* functions */ int try_init_default_consumer_groups(common::ObMySQLTransaction& trans, uint64_t tenant_id); /* variables */ diff --git a/src/share/resource_manager/ob_resource_mapping_rule_manager.h b/src/share/resource_manager/ob_resource_mapping_rule_manager.h index e075d1b0d..09700340c 100644 --- a/src/share/resource_manager/ob_resource_mapping_rule_manager.h +++ b/src/share/resource_manager/ob_resource_mapping_rule_manager.h @@ -27,11 +27,11 @@ class ObString; namespace share { class ObResourceMappingRuleManager { - public: +public: typedef common::ObArray ObResourceMappingRuleSet; typedef common::ObArray ObResourceUserMappingRuleSet; - public: +public: ObResourceMappingRuleManager() = default; virtual ~ObResourceMappingRuleManager() = default; int init(); @@ -58,7 +58,7 @@ class ObResourceMappingRuleManager { return ret; } - private: +private: common::hash::ObHashMap rule_map_; common::hash::ObHashMap group_map_; DISALLOW_COPY_AND_ASSIGN(ObResourceMappingRuleManager); diff --git a/src/share/resource_manager/ob_resource_plan_info.h b/src/share/resource_manager/ob_resource_plan_info.h index 0d154fb66..b9ce63c80 100644 --- a/src/share/resource_manager/ob_resource_plan_info.h +++ b/src/share/resource_manager/ob_resource_plan_info.h @@ -25,7 +25,7 @@ class ObString; namespace share { class ObGroupName { - public: +public: ObGroupName(){}; int set_group_name(const common::ObString& name) { @@ -48,24 +48,24 @@ class ObGroupName { } TO_STRING_KV(K_(group_name)); - private: +private: common::ObString group_name_; char group_name_buf_[common::OB_MAX_RESOURCE_PLAN_NAME_LENGTH]; }; class ObPlanDirective { - public: +public: static const int INTERNAL_GROUP_NAME_COUNT = 2; static const common::ObString INTERNAL_GROUP_NAME[INTERNAL_GROUP_NAME_COUNT]; static bool is_internal_group_name(const common::ObString& name); - public: +public: ObPlanDirective() : tenant_id_(common::OB_INVALID_ID), mgmt_p1_(100), utilization_limit_(100), group_name_(), level_(1) {} ~ObPlanDirective() = default; - public: +public: int set_tenant_id(uint64_t tenant_id) { tenant_id_ = tenant_id; @@ -89,24 +89,24 @@ class ObPlanDirective { TO_STRING_KV( K_(tenant_id), "group_name", group_name_.get_group_name(), K_(mgmt_p1), K_(utilization_limit), K_(level)); - public: +public: uint64_t tenant_id_; int64_t mgmt_p1_; int64_t utilization_limit_; ObGroupName group_name_; int level_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlanDirective); }; class ObResourceMappingRule { - public: +public: ObResourceMappingRule() : tenant_id_(common::OB_INVALID_ID), attr_(), value_(), group_() {} ~ObResourceMappingRule() = default; - public: +public: int set_tenant_id(uint64_t tenant_id) { tenant_id_ = tenant_id; @@ -133,13 +133,13 @@ class ObResourceMappingRule { int assign(const ObResourceMappingRule& other); TO_STRING_KV(K_(tenant_id), K_(attr), K_(value), K_(group)); - public: +public: uint64_t tenant_id_; common::ObString attr_; common::ObString value_; common::ObString group_; - private: +private: char attr_buf_[common::OB_MAX_RESOURCE_PLAN_NAME_LENGTH]; char value_buf_[common::OB_MAX_RESOURCE_PLAN_NAME_LENGTH]; char group_buf_[common::OB_MAX_RESOURCE_PLAN_NAME_LENGTH]; @@ -147,12 +147,12 @@ class ObResourceMappingRule { }; class ObResourceUserMappingRule { - public: +public: ObResourceUserMappingRule() : tenant_id_(common::OB_INVALID_ID), user_id_(), group_id_(), group_name_() {} ~ObResourceUserMappingRule() = default; - public: +public: void set_tenant_id(uint64_t tenant_id) { tenant_id_ = tenant_id; @@ -172,13 +172,13 @@ class ObResourceUserMappingRule { int assign(const ObResourceUserMappingRule& other); TO_STRING_KV(K_(tenant_id), K_(user_id), K_(group_id), "group_name", group_name_.get_group_name()); - public: +public: uint64_t tenant_id_; uint64_t user_id_; uint64_t group_id_; ObGroupName group_name_; - private: +private: char group_name_buf_[common::OB_MAX_RESOURCE_PLAN_NAME_LENGTH]; DISALLOW_COPY_AND_ASSIGN(ObResourceUserMappingRule); }; diff --git a/src/share/resource_manager/ob_resource_plan_manager.h b/src/share/resource_manager/ob_resource_plan_manager.h index b7ac57d25..39a6b3ccc 100644 --- a/src/share/resource_manager/ob_resource_plan_manager.h +++ b/src/share/resource_manager/ob_resource_plan_manager.h @@ -26,16 +26,16 @@ class ObString; namespace share { class ObResourcePlanManager { - public: +public: typedef common::ObSEArray ObPlanDirectiveSet; - public: +public: ObResourcePlanManager() = default; virtual ~ObResourcePlanManager() = default; int init(); int refresh_resource_plan(uint64_t tenant_id, common::ObString& plan_name); - private: +private: /* functions */ int flush_directive_to_cgroup_fs(ObPlanDirectiveSet& directives); int create_cgroup_dir_if_not_exist(const ObPlanDirectiveSet& directives); diff --git a/src/share/restore/ob_restore_args.h b/src/share/restore/ob_restore_args.h index d2c7c61f7..8b5fd1b1e 100644 --- a/src/share/restore/ob_restore_args.h +++ b/src/share/restore/ob_restore_args.h @@ -39,10 +39,10 @@ struct ObSchemaIdPair { }; class ObRestoreArgs { - public: +public: OB_UNIS_VERSION(1); - public: +public: struct OrignalSQLInfo { OrignalSQLInfo() : backup_table_id_(common::OB_INVALID_ID), @@ -130,7 +130,7 @@ class ObRestoreArgs { K_(backup_index_name), K_(backup_database_name), K_(backup_tablegroup_name)); }; - public: +public: static constexpr int64_t OB_MAX_URI_LENGTH = 2048; static constexpr int64_t OB_MAX_URI_HOST_LENGTH = 128; static constexpr int64_t OB_MAX_URI_ACCESS_ID_LENGTH = 128; @@ -142,7 +142,7 @@ class ObRestoreArgs { static constexpr int64_t OB_MAX_URI_BUCKET_DIR_DEPTH = 10; static constexpr int64_t OB_MAX_TCP_INVITED_NODES_LENGTH = common::MAX_IP_ADDR_LENGTH * 100; // 3,200 - public: +public: ObRestoreArgs(); ~ObRestoreArgs() = default; void reset(); @@ -188,7 +188,7 @@ class ObRestoreArgs { K_(partition_id), K_(schema_id_list), K_(sql_info), K_(schema_version), K_(uri_header), K_(cluster_name), K_(storage_info), K_(schema_id_list)); - private: +private: /* functions */ int add_schema_id_pair(const uint64_t schema_id, const uint64_t backup_schema_id); /* variables */ diff --git a/src/share/restore/ob_restore_base_reader.h b/src/share/restore/ob_restore_base_reader.h index c17450712..3ee480c80 100644 --- a/src/share/restore/ob_restore_base_reader.h +++ b/src/share/restore/ob_restore_base_reader.h @@ -25,7 +25,7 @@ namespace share { namespace restore { class ObRestoreBaseReader { - public: +public: ObRestoreBaseReader(ObRestoreArgs& args); virtual ~ObRestoreBaseReader() = default; int init(const common::ObString& oss_uri); @@ -45,7 +45,7 @@ class ObRestoreBaseReader { int get_recycle_objects(common::ObIArray& objects); int get_create_all_timezone_stmts(common::ObIArray& stmts); - private: +private: int get_one_object_from_oss( const char* last_name, const bool allow_not_exist, common::ObIArray& stmts); int get_create_table_stmt( @@ -55,7 +55,7 @@ class ObRestoreBaseReader { int read_one_file(const common::ObStoragePath& path, common::ObIAllocator& allocator, char*& buf, int64_t& read_size); - private: +private: // oss path: "oss://runiu1/ob1.XX/3/1001" // file path: "file:///mnt/test_nfs_runiu/ob1.XX/3/1001" common::ObStoragePath common_path_; diff --git a/src/share/restore/ob_restore_uri_parser.h b/src/share/restore/ob_restore_uri_parser.h index 07acca6c5..b975288d4 100644 --- a/src/share/restore/ob_restore_uri_parser.h +++ b/src/share/restore/ob_restore_uri_parser.h @@ -47,36 +47,36 @@ struct ObAgentBackupInfo { }; class ObRestoreURIParserHelper { - public: +public: static int set_data_version(share::ObRestoreArgs& arg); }; class ObRestoreURIParser { - public: +public: static int parse(const common::ObString& uri, ObRestoreArgs& arg); - private: +private: static int parse(const char* uri, share::ObRestoreArgs& arg); static int split_uri(const char* full_uri, share::ObRestoreArgs& arg, char* dir_path, char* extra_args); - public: +public: class DirParser { - public: + public: DirParser(share::ObRestoreArgs& arg) : arg_(arg){}; int parse(const char* val); - private: + private: /* functions */ share::ObRestoreArgs& arg_; }; class ExtraArgsCb : public share::ObKVMatchCb { - public: + public: ExtraArgsCb(share::ObRestoreArgs& arg); // : arg_(arg) {}; int match(const char* key, const char* value); bool check() const; - private: + private: /* functions */ typedef int (*Setter)(share::ObRestoreArgs& arg, const char* val); static int set_data_timestamp(share::ObRestoreArgs& arg, const char* val); @@ -89,7 +89,7 @@ class ObRestoreURIParser { static int set_restore_pass(share::ObRestoreArgs& arg, const char* val); static int set_tcp_invited_nodes(share::ObRestoreArgs& arg, const char* val); - private: + private: share::ObRestoreArgs& arg_; struct Action { const char* key; @@ -102,37 +102,37 @@ class ObRestoreURIParser { }; class ZoneMapCb : public share::ObKVMatchCb { - public: + public: typedef common::hash::ObHashMap ZoneMap; - public: + public: ZoneMapCb(ZoneMap& zone_map) : zone_map_(zone_map){}; int match(const char* key, const char* val); - private: + private: ZoneMap& zone_map_; }; - private: +private: /* variables */ DISALLOW_COPY_AND_ASSIGN(ObRestoreURIParser); }; class ObPhysicalRestoreOptionParser { - public: +public: static int parse(const common::ObString& uri, ObPhysicalRestoreJob& job); - private: +private: static int parse(const char* uri, ObPhysicalRestoreJob& job); - public: +public: class ExtraArgsCb : public share::ObKVMatchCb { - public: + public: ExtraArgsCb(ObPhysicalRestoreJob& job); int match(const char* key, const char* value); bool check() const; - private: + private: /* functions */ typedef int (*Setter)(ObPhysicalRestoreJob& job, const char* val); static int set_restore_job_id(ObPhysicalRestoreJob& job, const char* val); @@ -142,7 +142,7 @@ class ObPhysicalRestoreOptionParser { static int set_locality(ObPhysicalRestoreJob& job, const char* val); static int set_primary_zone(ObPhysicalRestoreJob& job, const char* val); - private: + private: ObPhysicalRestoreJob& job_; struct Action { const char* key; @@ -154,7 +154,7 @@ class ObPhysicalRestoreOptionParser { bool is_set_[ACTION_CNT]; }; - private: +private: /* variables */ DISALLOW_COPY_AND_ASSIGN(ObPhysicalRestoreOptionParser); }; diff --git a/src/share/rpc/ob_batch_processor.h b/src/share/rpc/ob_batch_processor.h index 4acec244f..48681abb9 100644 --- a/src/share/rpc/ob_batch_processor.h +++ b/src/share/rpc/ob_batch_processor.h @@ -22,7 +22,7 @@ class ObPartitionService; } namespace obrpc { class ObBatchP : public ObRpcProcessor > { - public: +public: ObBatchP(storage::ObPartitionService* partition_service) : ps_(partition_service) {} ~ObBatchP() @@ -32,7 +32,7 @@ class ObBatchP : public ObRpcProcessor > return common::OB_SUCCESS; } - protected: +protected: int process(); int handle_clog_req(common::ObAddr& sender, const int64_t src_cluster_id, int type, common::ObPartitionKey& pkey, const char* buf, int32_t size); @@ -42,7 +42,7 @@ class ObBatchP : public ObRpcProcessor > int handle_trx_req(common::ObAddr& sender, int type, common::ObPartitionKey& pkey, const char* buf, int32_t size); int handle_sql_req(common::ObAddr& sender, int type, common::ObPartitionKey& pkey, const char* buf, int32_t size); - private: +private: storage::ObPartitionService* ps_; DISALLOW_COPY_AND_ASSIGN(ObBatchP); }; diff --git a/src/share/rpc/ob_batch_proxy.cpp b/src/share/rpc/ob_batch_proxy.cpp index 62c7fa462..3459c529e 100644 --- a/src/share/rpc/ob_batch_proxy.cpp +++ b/src/share/rpc/ob_batch_proxy.cpp @@ -65,7 +65,7 @@ DEFINE_GET_SERIALIZE_SIZE(ObBatchPacket) } class BatchCallBack : public ObBatchRpcProxy::AsyncCB { - public: +public: BatchCallBack() {} virtual ~BatchCallBack() @@ -84,7 +84,7 @@ class BatchCallBack : public ObBatchRpcProxy::AsyncCB { return newcb; } - public: +public: int process() { return common::OB_SUCCESS; @@ -96,7 +96,7 @@ class BatchCallBack : public ObBatchRpcProxy::AsyncCB { RPC_LOG(WARN, "batch rpc timeout", K(dst), K(error)); } - private: +private: DISALLOW_COPY_AND_ASSIGN(BatchCallBack); }; diff --git a/src/share/rpc/ob_batch_proxy.h b/src/share/rpc/ob_batch_proxy.h index f58b96c55..ff1eced43 100644 --- a/src/share/rpc/ob_batch_proxy.h +++ b/src/share/rpc/ob_batch_proxy.h @@ -67,7 +67,7 @@ inline int get_batch_thread_idx(const int batch_type) } class ObIFill { - public: +public: ObIFill() {} virtual ~ObIFill() @@ -93,7 +93,7 @@ struct ObSimpleReqHeader { struct ObBatchPacket { OB_UNIS_VERSION(1); - public: +public: typedef ObSimpleReqHeader Req; ObBatchPacket() : size_(0), id_(0), src_(0), buf_(nullptr), src_addr_() {} @@ -138,7 +138,7 @@ struct ObBatchPacket { }; class ObBatchRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObBatchRpcProxy); RPC_AP(PR1 post_packet, OB_BATCH, (ObBatchPacket)); int post_batch(uint64_t tenant_id, const common::ObAddr& addr, const int64_t cluster_id, ObBatchPacket& pkt); diff --git a/src/share/rpc/ob_batch_rpc.h b/src/share/rpc/ob_batch_rpc.h index fb9daad8d..a37e1ebe2 100644 --- a/src/share/rpc/ob_batch_rpc.h +++ b/src/share/rpc/ob_batch_rpc.h @@ -36,7 +36,7 @@ namespace obrpc { ob_abort(); \ } class ObSingleRpcBuffer { - public: +public: enum { HEADER_SIZE = sizeof(ObBatchPacket) }; ObSingleRpcBuffer(int64_t seq, int64_t limit) : seq_(seq), pos_(HEADER_SIZE), cnt_(0), capacity_(limit - sizeof(*this)) @@ -76,7 +76,7 @@ class ObSingleRpcBuffer { return ATOMIC_LOAD(&pos_); } - private: +private: static int64_t faa_bounded(int64_t* addr, int64_t x, int64_t limit) { int64_t nv = ATOMIC_LOAD(addr); @@ -87,7 +87,7 @@ class ObSingleRpcBuffer { return ov; } - private: +private: int64_t seq_ CACHE_ALIGNED; int64_t pos_ CACHE_ALIGNED; int64_t cnt_ CACHE_ALIGNED; @@ -96,13 +96,13 @@ class ObSingleRpcBuffer { }; class ObRingRpcBuffer { - public: +public: typedef ObSingleRpcBuffer Buffer; typedef ObIFill Req; typedef ObSimpleReqHeader ReqHeader; enum { RESERVED_SIZE = 1024 }; - public: +public: ObRingRpcBuffer(const int64_t buf_size, const int64_t buf_cnt) : read_seq_(0), fill_seq_(0), buf_size_(buf_size), buf_cnt_(buf_cnt) { @@ -230,7 +230,7 @@ class ObRingRpcBuffer { return bool_ret; } - protected: +protected: int64_t get_fill_seq() const { return ATOMIC_LOAD(&fill_seq_); @@ -253,13 +253,13 @@ class ObRingRpcBuffer { common::inc_update(&read_seq_, new_seq); } - private: +private: Buffer* get(int64_t seq) const { return (Buffer*)(buf_ + buf_size_ * (seq % buf_cnt_)); } - private: +private: int64_t read_seq_ CACHE_ALIGNED; int64_t fill_seq_ CACHE_ALIGNED; int64_t buf_size_ CACHE_ALIGNED; @@ -268,7 +268,7 @@ class ObRingRpcBuffer { }; class ObRpcBuffer : public common::SpHashNode { - public: +public: typedef ObBatchPacket Packet; typedef ObRingRpcBuffer RingBuffer; typedef RingBuffer::Req Req; @@ -376,7 +376,7 @@ class ObRpcBuffer : public common::SpHashNode { } } - private: +private: uint64_t tenant_id_; common::ObAddr server_; int64_t last_use_timestamp_; @@ -386,7 +386,7 @@ class ObRpcBuffer : public common::SpHashNode { }; class SingleWaitCond { - public: +public: SingleWaitCond() : n_waiters_(0), futex_() {} ~SingleWaitCond() @@ -413,13 +413,13 @@ class SingleWaitCond { return ready; } - private: +private: int32_t n_waiters_; lib::CoFutex futex_; }; class ObBatchRpcBase { - public: +public: enum { BUCKET_NUM = 64, BATCH_BUFFER_COUNT = 4 }; typedef ObRpcBuffer RpcBuffer; typedef RpcBuffer::Rpc Rpc; @@ -494,7 +494,7 @@ class ObBatchRpcBase { void do_work(); int get_dst_svr_list(common::ObIArray& dst_list); - protected: +protected: RpcBuffer* fetch(const uint64_t tenant_id, const common::ObAddr& server, const int64_t dst_cluster_id); common::ObQSync& get_qs() { @@ -502,11 +502,11 @@ class ObBatchRpcBase { return qsync; } - private: +private: RpcBuffer* create_buffer(const uint64_t tenant_id, const common::ObAddr& addr, const int64_t dst_cluster_id); void destroy_buffer(RpcBuffer* p); - private: +private: bool is_inited_; int batch_type_; common::ObAddr self_; @@ -517,7 +517,7 @@ class ObBatchRpcBase { }; class ObBatchRpc : public lib::TGRunnable { - public: +public: enum { MAX_THREAD_COUNT = BATCH_REQ_TYPE_COUNT, MINI_MODE_THREAD_COUNT = BATCH_REQ_TYPE_COUNT, @@ -603,7 +603,7 @@ class ObBatchRpc : public lib::TGRunnable { } int get_dst_svr_list(common::ObIArray& dst_list); - private: +private: Rpc rpc_; Rpc hp_rpc_; ObBatchRpcBase base_[MAX_THREAD_COUNT]; diff --git a/src/share/rpc/ob_blacklist_proxy.cpp b/src/share/rpc/ob_blacklist_proxy.cpp index 0a5ae6d04..98f013beb 100644 --- a/src/share/rpc/ob_blacklist_proxy.cpp +++ b/src/share/rpc/ob_blacklist_proxy.cpp @@ -36,7 +36,7 @@ void ObBlacklistResp::reset() } class BlacklistReqCallBack : public ObBlacklistRpcProxy::AsyncCB { - public: +public: BlacklistReqCallBack() {} virtual ~BlacklistReqCallBack() @@ -55,7 +55,7 @@ class BlacklistReqCallBack : public ObBlacklistRpcProxy::AsyncCB { - public: +public: BlacklistRespCallBack() {} virtual ~BlacklistRespCallBack() @@ -87,7 +87,7 @@ class BlacklistRespCallBack : public ObBlacklistRpcProxy::AsyncCB > { - public: +public: ObBlacklistReqP() {} ~ObBlacklistReqP() {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBlacklistReqP); }; }; // namespace obrpc diff --git a/src/share/rpc/ob_blacklist_resp_processor.h b/src/share/rpc/ob_blacklist_resp_processor.h index 789149e9f..746a1ab83 100644 --- a/src/share/rpc/ob_blacklist_resp_processor.h +++ b/src/share/rpc/ob_blacklist_resp_processor.h @@ -19,16 +19,16 @@ namespace oceanbase { namespace obrpc { class ObBlacklistRespP : public ObRpcProcessor > { - public: +public: ObBlacklistRespP() {} ~ObBlacklistRespP() {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBlacklistRespP); }; }; // namespace obrpc diff --git a/src/share/scheduler/ob_dag.h b/src/share/scheduler/ob_dag.h index 55613dd32..07319a88e 100644 --- a/src/share/scheduler/ob_dag.h +++ b/src/share/scheduler/ob_dag.h @@ -29,7 +29,7 @@ class ObTenantThreadPool; class ObDagWorkerNew; class ObITaskNew : public common::ObDLinkBase { - public: +public: enum ObITaskNewStatus { TASK_STATUS_INITING = 0, TASK_STATUS_WAITING = 1, @@ -50,7 +50,7 @@ class ObITaskNew : public common::ObDLinkBase { THIS_TASK_PAUSE = 1, }; - public: +public: explicit ObITaskNew(const int64_t type_id); virtual ~ObITaskNew(); int do_work(); @@ -94,7 +94,7 @@ class ObITaskNew : public common::ObDLinkBase { } VIRTUAL_TO_STRING_KV(KP(this), K_(type_id), K_(status), K_(dag), KP_(worker), K_(next_task)); - private: +private: friend class ObIDagNew; friend class ObTenantThreadPool; static const int64_t DEFAULT_CHILDREN_NUM = 8; @@ -106,7 +106,7 @@ class ObITaskNew : public common::ObDLinkBase { } virtual int process() = 0; - private: +private: int generate_next_task(); bool judge_delay_penalty(); const common::ObIArray& get_child_tasks() const @@ -170,10 +170,10 @@ class ObITaskNew : public common::ObDLinkBase { } int finish_task(); - protected: +protected: ObIDagNew* dag_; - private: +private: int64_t type_id_; lib::ObMutex lock_; ObITaskNewStatus status_; @@ -187,7 +187,7 @@ class ObITaskNew : public common::ObDLinkBase { common::ObSEArray children_; }; class ObIDagNew : public common::ObDLinkBase { - public: +public: // priority from high to low enum ObIDagNewPriority { DAG_PRIO_0 = 0, @@ -246,17 +246,17 @@ class ObIDagNew : public common::ObDLinkBase { } VIRTUAL_TO_STRING_KV(KP(this), K_(type_id), K_(id), K_(dag_ret), K_(dag_status), K_(start_time)); - public: +public: virtual int64_t hash() const = 0; virtual int64_t get_tenant_id() const = 0; virtual int fill_comment(char* buf, const int64_t buf_len) const = 0; virtual int64_t get_compat_mode() const = 0; virtual bool operator==(const ObIDagNew& other) const = 0; - protected: +protected: int dag_ret_; - private: +private: typedef common::ObDList TaskList; // cycled list static const int64_t DEFAULT_TASK_NUM = 32; static const int64_t TOTAL_LIMIT = 1024L * 1024L * 1024L; @@ -272,7 +272,7 @@ class ObIDagNew : public common::ObDLinkBase { RUNNABLE = 1, }; - private: +private: int finish_task(ObITaskNew& task); bool is_valid(); int init(const int64_t total = TOTAL_LIMIT, const int64_t hold = HOLD_LIMIT, const int64_t page_size = PAGE_SIZE); @@ -320,7 +320,7 @@ class ObIDagNew : public common::ObDLinkBase { } int set_dag_id(const ObDagId& dag_id); - private: +private: common::ObConcurrentFIFOAllocator allocator_; bool is_inited_; ObIDagNewPriority priority_; diff --git a/src/share/scheduler/ob_dag_scheduler.h b/src/share/scheduler/ob_dag_scheduler.h index cedc5d043..e35ff7a91 100644 --- a/src/share/scheduler/ob_dag_scheduler.h +++ b/src/share/scheduler/ob_dag_scheduler.h @@ -41,7 +41,7 @@ class ObITask : public common::ObDLinkBase { friend class ObIDag; friend class ObDagScheduler; - public: +public: enum ObITaskType { TASK_TYPE_UT = 0, TASK_TYPE_MACROMERGE = 1, @@ -124,7 +124,7 @@ class ObITask : public common::ObDLinkBase { } VIRTUAL_TO_STRING_KV(K_(type), K_(status), K(dag_)); - private: +private: virtual int generate_next_task(ObITask*& next_task) { UNUSED(next_task); @@ -132,7 +132,7 @@ class ObITask : public common::ObDLinkBase { } virtual int process() = 0; - private: +private: void reset(); int copy_dep_to(ObITask& other_task) const; void set_status(const ObITaskStatus status) @@ -174,10 +174,10 @@ class ObITask : public common::ObDLinkBase { } int generate_next_task(); - protected: +protected: ObIDag* dag_; - private: +private: ObITaskType type_; ObITaskStatus status_; int64_t indegree_; @@ -187,7 +187,7 @@ class ObITask : public common::ObDLinkBase { }; class ObFakeTask : public ObITask { - public: +public: ObFakeTask() : ObITask(TASK_TYPE_FAKE) {} virtual ~ObFakeTask() @@ -196,7 +196,7 @@ class ObFakeTask : public ObITask { }; class ObIDag : public common::ObDLinkBase { - public: +public: // priority from high to low, high priority tasks can preempt low priority tasks util their lower bound enum ObIDagPriority { DAG_PRIO_TRANS_TABLE_MERGE = 0, @@ -345,17 +345,17 @@ class ObIDag : public common::ObDLinkBase { DECLARE_VIRTUAL_TO_STRING; DISABLE_COPY_ASSIGN(ObIDag); - public: +public: virtual bool operator==(const ObIDag& other) const = 0; virtual int64_t hash() const = 0; virtual int64_t get_tenant_id() const = 0; virtual int fill_comment(char* buf, const int64_t buf_len) const = 0; virtual int64_t get_compat_mode() const = 0; - protected: +protected: int dag_ret_; - private: +private: typedef common::ObDList TaskList; typedef lib::ObLockGuard ObDagGuard; static const int64_t DEFAULT_TASK_NUM = 32; @@ -367,7 +367,7 @@ class ObIDag : public common::ObDLinkBase { friend class ObDagWorker; friend ObDagGuard; - private: +private: void free_task(ObITask& task); int finish_task(ObITask& task, int64_t& available_cnt); bool is_valid(); @@ -403,7 +403,7 @@ class ObIDag : public common::ObDLinkBase { --running_task_cnt_; } - private: +private: common::ObConcurrentFIFOAllocator allocator_; bool is_inited_; ObIDagPriority priority_; @@ -419,7 +419,7 @@ class ObIDag : public common::ObDLinkBase { template class ObPriorityList { - public: +public: enum { PRIO_CNT = PRIOS }; bool add_first(T* item, const int64_t prio) @@ -544,12 +544,12 @@ class ObPriorityList { return ret; } - private: +private: common::ObDList dlists_[PRIOS]; }; class ObDagWorker : public lib::ThreadPool, public common::ObDLinkBase { - public: +public: typedef common::ObDLinkNode Node; typedef common::ObDList WorkerNodeList; enum DagWorkerStatus { @@ -560,7 +560,7 @@ class ObDagWorker : public lib::ThreadPool, public common::ObDLinkBase { - public: +public: enum SwitchFlagType { SF_INIT = 0, SF_CONTINUE = 1, @@ -31,7 +31,7 @@ class ObDagWorkerNew : public lib::ThreadPool, public common::ObDLinkBase task_array_; common::ObAddr self_addr_; diff --git a/src/share/scheduler/ob_tenant_dag_scheduler.h b/src/share/scheduler/ob_tenant_dag_scheduler.h index f6d9067dc..bf520285e 100644 --- a/src/share/scheduler/ob_tenant_dag_scheduler.h +++ b/src/share/scheduler/ob_tenant_dag_scheduler.h @@ -40,7 +40,7 @@ class GetScheduleInfo; // for test #endif class ObDagSchedulerNew : public lib::ThreadPool { - public: +public: static ObDagSchedulerNew& get_instance(); int init(const int64_t schedule_period = SCHEDULER_PERIOD, const int64_t total_mem_limit = TOTAL_LIMIT, const int64_t hold_mem_limit = HOLD_LIMIT, const int64_t page_size = PAGE_SIZE); @@ -63,7 +63,7 @@ class ObDagSchedulerNew : public lib::ThreadPool { void set_sche_info(int64_t tenant_id, GetScheduleInfo* info); // for test #endif - private: +private: friend class ObTenantThreadPool; typedef common::hash::ObHashMap TenantThreadPoolMap; typedef common::hash::ObHashMap::iterator TenantThreadPoolIterator; @@ -73,7 +73,7 @@ class ObDagSchedulerNew : public lib::ThreadPool { static const int64_t SCHEDULER_PERIOD = 1000; // 1 ms static const int64_t DEFAULT_BUCKET_NUM; - private: +private: ObDagSchedulerNew(); virtual ~ObDagSchedulerNew(); int schedule_(); @@ -81,7 +81,7 @@ class ObDagSchedulerNew : public lib::ThreadPool { int add_types_(ObTenantThreadPool* thread_pool); int get_tenant_thread_pool_by_id_(int64_t tenant_id, ObTenantThreadPool*& tenant_thread_pool); - private: +private: bool is_inited_; bool is_running_; int64_t schedule_period_; @@ -118,11 +118,11 @@ void ObDagSchedulerNew::free_dag(int64_t tenant_id, T*& dag) #ifndef NDEBUG class GetScheduleInfo { - public: +public: common::ObVector choose_type_id_list_; common::ObVector running_tasks_cnt_; - public: +public: GetScheduleInfo(); ~GetScheduleInfo(); void destroy(); diff --git a/src/share/scheduler/ob_tenant_thread_pool.h b/src/share/scheduler/ob_tenant_thread_pool.h index a477c8d5f..9f8d78e6d 100644 --- a/src/share/scheduler/ob_tenant_thread_pool.h +++ b/src/share/scheduler/ob_tenant_thread_pool.h @@ -35,7 +35,7 @@ class GetScheduleInfo; // for test // descending sort list template class ObSortList { - public: +public: ObSortList() {} virtual ~ObSortList() @@ -125,12 +125,12 @@ class ObSortList { } VIRTUAL_TO_STRING_KV(K_(list)); - private: +private: common::ObDList list_; }; class ObTenantThreadPool { - public: +public: ObTenantThreadPool(int64_t tenant_id); virtual ~ObTenantThreadPool(); int init(const int64_t hash_bucket_num = DEFAULT_BUCKET_NUM, const int64_t total_mem_limit = TOTAL_LIMIT, @@ -172,14 +172,14 @@ class ObTenantThreadPool { #endif VIRTUAL_TO_STRING_KV(KP(this), K_(is_inited), K_(tenant_id), K_(max_thread_num)); - private: +private: friend class ObDagWorkerNew; friend class ObTaskNew; static const int32_t MAX_TYPE_CNT = 20; - private: +private: class DynamicScore : public common::ObDLinkBase { - public: + public: int64_t type_id_; double d_score_; DynamicScore() : type_id_(0), d_score_(0) @@ -231,7 +231,7 @@ class ObTenantThreadPool { static const int64_t PAGE_SIZE = common::OB_MALLOC_NORMAL_BLOCK_SIZE; static const int64_t DAG_SIZE_LIMIT = 10 << 10; - private: +private: int sys_task_start_(ObIDagNew* dag); void reset_dynamic_score_(); void calc_penalty_(); @@ -260,7 +260,7 @@ class ObTenantThreadPool { int pause_task(ObITaskNew* task, const ObITaskNew::SwitchTaskFlag flag); int switch_task(ObITaskNew* task, const ObITaskNew::SwitchTaskFlag flag); - private: +private: bool is_inited_; bool is_stoped_; int64_t tenant_id_; diff --git a/src/share/scheduler/ob_worker_obj_pool.h b/src/share/scheduler/ob_worker_obj_pool.h index 16c4bed89..2b2e607bd 100644 --- a/src/share/scheduler/ob_worker_obj_pool.h +++ b/src/share/scheduler/ob_worker_obj_pool.h @@ -20,7 +20,7 @@ namespace share { class ObDagWorkerNew; class ObWorkerObjPool { - public: +public: static ObWorkerObjPool& get_instance(); int init(const int64_t total_mem_limit = TOTAL_LIMIT, const int64_t hold_mem_limit = HOLD_LIMIT, const int64_t page_size = PAGE_SIZE); @@ -40,7 +40,7 @@ class ObWorkerObjPool { return worker_cnt_; } - private: +private: ObWorkerObjPool(); // prevent to new ~ObWorkerObjPool(); // prevent to delete ObWorkerObjPool(const ObWorkerObjPool&); @@ -53,7 +53,7 @@ class ObWorkerObjPool { static constexpr double OBJ_UP_LIMIT_PERCENT = 4; static constexpr double OBJ_CREATE_PERCENT = 2; - private: +private: bool is_inited_; lib::ObMutex lock_; int32_t init_worker_cnt_; diff --git a/src/share/schema/ob_column_schema.h b/src/share/schema/ob_column_schema.h index fd198b1de..0e0705452 100644 --- a/src/share/schema/ob_column_schema.h +++ b/src/share/schema/ob_column_schema.h @@ -43,7 +43,7 @@ class ObTableSchema; class ObColumnSchemaV2 : public ObSchema { OB_UNIS_VERSION_V(1); - public: +public: static const char* convert_column_type_to_str(common::ColumnType type); static common::ColumnType convert_str_to_column_type(const char* str); // constructor and destructor @@ -539,10 +539,10 @@ class ObColumnSchemaV2 : public ObSchema { DECLARE_VIRTUAL_TO_STRING; - private: +private: int alloc_column_ref_set(); - private: +private: uint64_t tenant_id_; uint64_t table_id_; uint64_t column_id_; diff --git a/src/share/schema/ob_constraint.h b/src/share/schema/ob_constraint.h index ce231fa42..0e69ec368 100644 --- a/src/share/schema/ob_constraint.h +++ b/src/share/schema/ob_constraint.h @@ -26,7 +26,7 @@ class ObTableSchema; class ObConstraint : public ObSchema { OB_UNIS_VERSION_V(1); - public: +public: ObConstraint(); explicit ObConstraint(common::ObIAllocator* allocator); ObConstraint(const ObConstraint& src_schema) = delete; @@ -186,7 +186,7 @@ class ObConstraint : public ObSchema { DECLARE_VIRTUAL_TO_STRING; - private: +private: uint64_t tenant_id_; uint64_t table_id_; uint64_t constraint_id_; diff --git a/src/share/schema/ob_database_sql_service.h b/src/share/schema/ob_database_sql_service.h index 65bfba8a9..a74e56741 100644 --- a/src/share/schema/ob_database_sql_service.h +++ b/src/share/schema/ob_database_sql_service.h @@ -25,7 +25,7 @@ namespace schema { class ObDatabaseSchema; class ObDatabaseSqlService : public ObDDLSqlService { - public: +public: ObDatabaseSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObDatabaseSqlService() @@ -41,7 +41,7 @@ class ObDatabaseSqlService : public ObDDLSqlService { virtual int drop_database_for_inspection( ObISQLClient& sql_client, const ObDatabaseSchema& db_schema, const int64_t new_schema_version); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDatabaseSqlService); }; diff --git a/src/share/schema/ob_dblink_mgr.h b/src/share/schema/ob_dblink_mgr.h index 3d3b6ff6d..f78fcc7ae 100644 --- a/src/share/schema/ob_dblink_mgr.h +++ b/src/share/schema/ob_dblink_mgr.h @@ -26,7 +26,7 @@ namespace share { namespace schema { class ObDbLinkNameHashWrapper { - public: +public: ObDbLinkNameHashWrapper() : tenant_id_(common::OB_INVALID_ID), dblink_name_() {} ObDbLinkNameHashWrapper(const uint64_t tenant_id, const common::ObString& dblink_name) @@ -53,7 +53,7 @@ class ObDbLinkNameHashWrapper { return dblink_name_; } - private: +private: uint64_t tenant_id_; common::ObString dblink_name_; }; @@ -110,7 +110,7 @@ class ObDbLinkMgr { typedef DbLinkSchemas::iterator DbLinkIter; typedef DbLinkSchemas::const_iterator ConstDbLinkIter; - public: +public: ObDbLinkMgr(); explicit ObDbLinkMgr(common::ObIAllocator& allocator); virtual ~ObDbLinkMgr(); @@ -134,7 +134,7 @@ class ObDbLinkMgr { int del_dblink_schemas_in_tenant(const uint64_t tenant_id); int get_dblink_schema_count(int64_t& schema_count) const; - private: +private: inline bool check_inner_stat() const; inline static bool compare_dblink(const ObDbLinkSchema* lhs, const ObDbLinkSchema* rhs); inline static bool equal_dblink(const ObDbLinkSchema* lhs, const ObDbLinkSchema* rhs); @@ -142,7 +142,7 @@ class ObDbLinkMgr { inline static bool equal_with_tenant_dblink_id(const ObDbLinkSchema* lhs, const ObTenantDbLinkId& tenant_dblink_id); int rebuild_dblink_hashmap(); - private: +private: common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; DbLinkSchemas dblink_schemas_; diff --git a/src/share/schema/ob_dblink_sql_service.h b/src/share/schema/ob_dblink_sql_service.h index ca3e9bf41..3f4218f8a 100644 --- a/src/share/schema/ob_dblink_sql_service.h +++ b/src/share/schema/ob_dblink_sql_service.h @@ -27,18 +27,18 @@ namespace schema { class ObDbLinkInfo; class ObDbLinkSqlService : public ObDDLSqlService { - public: +public: ObDbLinkSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObDbLinkSqlService() {} - public: +public: int insert_dblink(const ObDbLinkBaseInfo& dblink_info, const int64_t is_deleted, common::ObISQLClient& sql_client, const common::ObString* ddl_stmt_str); int delete_dblink(const uint64_t tenant_id, const uint64_t dblink_id, common::ObISQLClient& sql_client); - private: +private: int add_pk_columns(const uint64_t tenant_id, const uint64_t dblink_id, ObDMLSqlSplicer& dml); int add_normal_columns(const ObDbLinkBaseInfo& dblink_info, ObDMLSqlSplicer& dml); int add_history_columns(const ObDbLinkBaseInfo& dblink_info, int64_t is_deleted, ObDMLSqlSplicer& dml); diff --git a/src/share/schema/ob_ddl_sql_service.h b/src/share/schema/ob_ddl_sql_service.h index d88ad184d..76cdc8914 100644 --- a/src/share/schema/ob_ddl_sql_service.h +++ b/src/share/schema/ob_ddl_sql_service.h @@ -26,7 +26,7 @@ namespace schema { struct ObSchemaOperation; class ObDDLSqlService { - public: +public: ObDDLSqlService(ObSchemaService& schema_service) : schema_service_(schema_service) {} virtual ~ObDDLSqlService() @@ -46,17 +46,17 @@ class ObDDLSqlService { int finish_schema_split_v2( common::ObISQLClient& sql_client, const uint64_t tenant_id, const int64_t new_schema_version); - protected: +protected: virtual int log_operation(ObSchemaOperation& ddl_operation, common::ObISQLClient& sql_client, int64_t sql_exec_tenant_id = OB_INVALID_TENANT_ID, common::ObSqlString* public_sql_string = NULL); - private: +private: uint64_t fill_schema_id(const uint64_t exec_tenant_id, const uint64_t schema_id); - protected: +protected: ObSchemaService& schema_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDDLSqlService); }; diff --git a/src/share/schema/ob_dependency_info.h b/src/share/schema/ob_dependency_info.h index 40d558999..7174f487d 100644 --- a/src/share/schema/ob_dependency_info.h +++ b/src/share/schema/ob_dependency_info.h @@ -37,7 +37,7 @@ extern const char* ob_object_type_str(const ObObjectType object_type); class ObDependencyInfo : public ObSchema { OB_UNIS_VERSION(1); - public: +public: ObDependencyInfo(); ObDependencyInfo(const ObDependencyInfo& src_schema); explicit ObDependencyInfo(common::ObIAllocator* allocator); @@ -120,14 +120,14 @@ class ObDependencyInfo : public ObSchema { TO_STRING_KV(K_(tenant_id), K_(dep_obj_id), K_(dep_obj_type), K_(order), K_(dep_timestamp), K_(ref_obj_id), K_(ref_obj_type), K_(ref_timestamp), K_(dep_obj_owner_id), K_(property), K_(dep_attrs), K_(dep_reason), K_(ref_obj_name), K_(schema_version)) - private: +private: int gen_dependency_dml(const uint64_t exec_tenant_id, oceanbase::share::ObDMLSqlSplicer& dml); // uint64_t extract_tenant_id() const; uint64_t extract_ref_obj_id() const; // static uint64_t extract_tenant_id(uint64_t tenant_id); static uint64_t extract_obj_id(uint64_t exec_tenant_id, uint64_t id); - private: +private: uint64_t tenant_id_; uint64_t dep_obj_id_; ObObjectType dep_obj_type_; diff --git a/src/share/schema/ob_error_info.h b/src/share/schema/ob_error_info.h index 1e68660a3..599633979 100644 --- a/src/share/schema/ob_error_info.h +++ b/src/share/schema/ob_error_info.h @@ -46,7 +46,7 @@ class ObSchemaService; class ObErrorInfo : public ObSchema { OB_UNIS_VERSION(1); - public: +public: ObErrorInfo(); ObErrorInfo(const ObErrorInfo& src_schema); explicit ObErrorInfo(common::ObIAllocator* allocator); @@ -119,12 +119,12 @@ class ObErrorInfo : public ObSchema { TO_STRING_KV(K_(tenant_id), K_(obj_id), K_(obj_type), K_(obj_seq), K_(line), K_(position), K_(text_length), K_(text), K_(property), K_(error_number), K_(database_id), K_(schema_version), K_(error_status)) - private: +private: int gen_error_dml(const uint64_t exec_tenant_id, oceanbase::share::ObDMLSqlSplicer& dml); uint64_t extract_tenant_id() const; uint64_t extract_obj_id() const; - private: +private: uint64_t tenant_id_; uint64_t obj_id_; // errorinfo from which object. such as package etc. uint64_t obj_type_; diff --git a/src/share/schema/ob_multi_version_schema_service.h b/src/share/schema/ob_multi_version_schema_service.h index 8de2c0cf4..a64e6155e 100644 --- a/src/share/schema/ob_multi_version_schema_service.h +++ b/src/share/schema/ob_multi_version_schema_service.h @@ -36,14 +36,14 @@ static const int64_t MAX_CACHED_VERSION_NUM = 4; // singleton class // concurrency control for schema manager constructing tasks. class ObSchemaConstructTask { - public: +public: virtual ~ObSchemaConstructTask(); static ObSchemaConstructTask& get_instance(); // concurrency control for fetching the given schema version void cc_before(const int64_t version); void cc_after(const int64_t version); - private: +private: static const int MAX_PARALLEL_TASK = 1; ObSchemaConstructTask(); void lock(); @@ -62,14 +62,14 @@ class ObSchemaConstructTask { void wait(const int64_t version); void wakeup(const int64_t version); - private: +private: common::ObArray schema_tasks_; pthread_mutex_t schema_mutex_; pthread_cond_t schema_cond_; }; class ObSchemaVersionUpdater { - public: +public: ObSchemaVersionUpdater(int64_t new_schema_version, bool ignore_error = true) : new_schema_version_(new_schema_version), ignore_error_(ignore_error){}; virtual ~ObSchemaVersionUpdater(){}; @@ -95,7 +95,7 @@ class ObSchemaVersionUpdater { return ret; } - private: +private: int64_t new_schema_version_; bool ignore_error_; DISALLOW_COPY_AND_ASSIGN(ObSchemaVersionUpdater); @@ -106,13 +106,13 @@ class ObMultiVersionSchemaService; class ObSchemaGetterGuard; class ObMultiVersionSchemaService : public ObServerSchemaService { - public: +public: static bool g_skip_resolve_materialized_view_definition_; enum RefreshSchemaMode { NORMAL = 0, FORCE_FALLBACK, FORCE_LAZY }; const char* print_refresh_schema_mode(const RefreshSchemaMode mode); - public: +public: static ObMultiVersionSchemaService& get_instance(); // init the newest system or user table schema @@ -121,7 +121,7 @@ class ObMultiVersionSchemaService : public ObServerSchemaService { int init_sys_schema(const common::ObIArray& table_schemas); - public: +public: //--------ddl funcs for RS module ---------// // check table exist int check_table_exist(const uint64_t tenant_id, const uint64_t database_id, const common::ObString& table_name, @@ -201,7 +201,7 @@ class ObMultiVersionSchemaService : public ObServerSchemaService { int check_tenant_is_restore(ObSchemaGetterGuard* schema_guard, const uint64_t tenant_id, bool& is_restore); int check_restore_tenant_exist(const common::ObIArray& tenant_ids, bool& exist); - public: +public: static const int64_t MAX_INT64_VALUE = ((((uint64_t)1) << 63) - 1); // MAX INT64 VALUE // get the latest schema version @@ -228,7 +228,7 @@ class ObMultiVersionSchemaService : public ObServerSchemaService { friend class tools::ObAgentTaskGenerator; friend class tools::ObAgentTaskWorker; - protected: +protected: ObMultiVersionSchemaService(); virtual ~ObMultiVersionSchemaService(); virtual int destroy() override; @@ -236,7 +236,7 @@ class ObMultiVersionSchemaService : public ObServerSchemaService { virtual int publish_schema() override; virtual int publish_schema(const uint64_t tenant_id) override; - private: +private: // check inner stat bool check_inner_stat() const; int init_schema_manager(); @@ -275,7 +275,7 @@ class ObMultiVersionSchemaService : public ObServerSchemaService { int get_schema_status(const common::ObArray& schema_status_array, const uint64_t tenant_id, ObRefreshSchemaStatus& schema_status); - private: +private: static const int64_t MAX_VERSION_COUNT = 64; static const int64_t MAX_VERSION_COUNT_FOR_LIBOBLOG = 6; static const int32_t MAX_RETRY_TIMES = 10; @@ -294,14 +294,14 @@ class ObMultiVersionSchemaService : public ObServerSchemaService { bool with_timestamp_; - public: +public: // schema_cache related int init_sys_tenant_user_schema(); - int update_schema_cache(common::ObIArray &schema_array, const bool is_force = false) override; - int update_schema_cache(common::ObIArray &schema_array, const bool is_force = false) override; - int update_schema_cache(const common::ObIArray &schema_array) override; - int update_schema_cache(const share::schema::ObSysVariableSchema &schema) override; + int update_schema_cache(common::ObIArray& schema_array, const bool is_force = false) override; + int update_schema_cache(common::ObIArray& schema_array, const bool is_force = false) override; + int update_schema_cache(const common::ObIArray& schema_array) override; + int update_schema_cache(const share::schema::ObSysVariableSchema& schema) override; int build_full_materalized_view_schema( ObSchemaGetterGuard& schema_guard, common::ObIAllocator& allocator, ObTableSchema*& view_schema); virtual int get_schema(const ObSchemaMgr* mgr, const ObRefreshSchemaStatus& schema_status, @@ -351,13 +351,13 @@ class ObMultiVersionSchemaService : public ObServerSchemaService { int fetch_link_table_schema(const ObDbLinkSchema& dblink_schema, const common::ObString& database_name, const common::ObString& table_name, common::ObIAllocator& allocator, ObTableSchema*& table_schema); - private: +private: ObSchemaCache schema_cache_; ObSchemaMgrCache schema_mgr_cache_; ObSchemaMgrCache schema_mgr_cache_for_liboblog_; ObSchemaFetcher schema_fetcher_; - private: +private: common::SpinRWLock schema_info_rwlock_; ObRefreshSchemaInfo last_refreshed_schema_info_; int64_t init_version_cnt_; diff --git a/src/share/schema/ob_outline_mgr.h b/src/share/schema/ob_outline_mgr.h index affc6cfaa..9e73056e9 100644 --- a/src/share/schema/ob_outline_mgr.h +++ b/src/share/schema/ob_outline_mgr.h @@ -24,7 +24,7 @@ namespace share { namespace schema { class ObSimpleOutlineSchema : public ObSchema { - public: +public: ObSimpleOutlineSchema(); explicit ObSimpleOutlineSchema(common::ObIAllocator* allocator); ObSimpleOutlineSchema(const ObSimpleOutlineSchema& src_schema); @@ -108,7 +108,7 @@ class ObSimpleOutlineSchema : public ObSchema { return ObTenantOutlineId(tenant_id_, outline_id_); } - private: +private: uint64_t tenant_id_; uint64_t outline_id_; int64_t schema_version_; @@ -188,7 +188,7 @@ class ObOutlineMgr { typedef OutlineInfos::iterator OutlineIter; typedef OutlineInfos::const_iterator ConstOutlineIter; - public: +public: ObOutlineMgr(); explicit ObOutlineMgr(common::ObIAllocator& allocator); virtual ~ObOutlineMgr(); @@ -218,7 +218,7 @@ class ObOutlineMgr { int get_outline_schema_count(int64_t& outline_schema_count) const; int get_schema_statistics(ObSchemaStatisticsInfo& schema_info) const; - private: +private: inline bool check_inner_stat() const; inline static bool compare_outline(const ObSimpleOutlineSchema* lhs, const ObSimpleOutlineSchema* rhs); inline static bool equal_outline(const ObSimpleOutlineSchema* lhs, const ObSimpleOutlineSchema* rhs); @@ -228,7 +228,7 @@ class ObOutlineMgr { const ObSimpleOutlineSchema* lhs, const ObTenantOutlineId& tenant_outline_id); int rebuild_outline_hashmap(); - private: +private: common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; OutlineInfos outline_infos_; diff --git a/src/share/schema/ob_outline_sql_service.h b/src/share/schema/ob_outline_sql_service.h index fa52a5844..eab8a0499 100644 --- a/src/share/schema/ob_outline_sql_service.h +++ b/src/share/schema/ob_outline_sql_service.h @@ -26,7 +26,7 @@ namespace schema { class ObOutlineInfo; class ObOutlineSqlService : public ObDDLSqlService { - public: +public: ObOutlineSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObOutlineSqlService() @@ -44,10 +44,10 @@ class ObOutlineSqlService : public ObDDLSqlService { virtual int drop_outline(const ObOutlineInfo& outline_info, const int64_t new_schema_version, common::ObISQLClient& sql_client, const common::ObString* ddl_stmt_str = NULL); - private: +private: int add_outline(common::ObISQLClient& sql_client, const ObOutlineInfo& outline_info, const bool only_history = false); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOutlineSqlService); }; diff --git a/src/share/schema/ob_part_mgr_util.h b/src/share/schema/ob_part_mgr_util.h index caf9f7bdb..5df4b69ab 100644 --- a/src/share/schema/ob_part_mgr_util.h +++ b/src/share/schema/ob_part_mgr_util.h @@ -32,58 +32,58 @@ class ObTableSchema; class ObSimpleTableSchemaV2; class ObIPartIdsGenerator { - public: +public: virtual int gen(common::ObIArray& part_ids) = 0; }; class ObPartIdsGenerator : public ObIPartIdsGenerator { - public: +public: ObPartIdsGenerator(const ObPartitionSchema& partition_schema) : partition_schema_(partition_schema) {} virtual int gen(common::ObIArray& part_ids); - private: +private: ObPartIdsGenerator(); - private: +private: const ObPartitionSchema& partition_schema_; }; template class ObPartIdsGeneratorForAdd : public ObIPartIdsGenerator { - public: +public: ObPartIdsGeneratorForAdd(const T& table, const T& inc_table) : table_(table), inc_table_(inc_table) {} virtual int gen(common::ObIArray& part_ids); - private: +private: ObPartIdsGeneratorForAdd(); - private: +private: const T& table_; const T& inc_table_; }; class ObPartGetter { - public: +public: ObPartGetter(const ObTableSchema& table) : table_(table) {} int get_part_ids(const common::ObString& part_name, common::ObIArray& part_ids); int get_subpart_ids(const common::ObString& part_name, common::ObIArray& part_ids); - private: +private: ObPartGetter(); int get_subpart_ids_in_partition( const common::ObString& part_name, const ObPartition& partition, common::ObIArray& part_ids, bool& find); - private: +private: const ObTableSchema& table_; }; class ObPartIteratorV2 { const static int64_t BUF_LEN = common::OB_MAX_PARTITION_NAME_LENGTH; - public: +public: ObPartIteratorV2() : is_inited_(false), partition_schema_(NULL), idx_(-1), check_dropped_schema_(false) { MEMSET(buf_, 0, BUF_LEN); @@ -102,10 +102,10 @@ class ObPartIteratorV2 { } int next(const ObPartition*& part); - private: +private: inline int check_inner_stat(); - private: +private: bool is_inited_; const ObPartitionSchema* partition_schema_; int64_t idx_; @@ -119,7 +119,7 @@ class ObPartIteratorV2 { class ObSubPartIteratorV2 { const static int64_t BUF_LEN = common::OB_MAX_PARTITION_NAME_LENGTH; - public: +public: ObSubPartIteratorV2() : is_inited_(false), partition_schema_(NULL), @@ -157,12 +157,12 @@ class ObSubPartIteratorV2 { } int next(const ObSubPartition*& subpart); - private: +private: int next_for_template(const ObSubPartition*& subpart); int next_for_nontemplate(const ObSubPartition*& subpart); inline int check_inner_stat(); - private: +private: bool is_inited_; const ObPartitionSchema* partition_schema_; const ObPartition* part_; @@ -176,7 +176,7 @@ class ObSubPartIteratorV2 { // FIXME:() Consider integrating with ObPartIteratorV2 class ObDroppedPartIterator { - public: +public: ObDroppedPartIterator() : is_inited_(false), partition_schema_(NULL), idx_(0) {} ObDroppedPartIterator(const ObPartitionSchema& partition_schema) @@ -191,19 +191,19 @@ class ObDroppedPartIterator { } int next(const ObPartition*& part); - private: +private: inline int check_inner_stat(); - private: +private: bool is_inited_; const ObPartitionSchema* partition_schema_; int64_t idx_; }; class ObPartitionKeyIter { - public: +public: struct Info { - public: + public: Info() : partition_id_(common::OB_INVALID_ID), drop_schema_version_(common::OB_INVALID_VERSION), @@ -219,7 +219,7 @@ class ObPartitionKeyIter { const common::ObIArray* source_part_ids_; }; - public: +public: ObPartitionKeyIter() = delete; explicit ObPartitionKeyIter( const uint64_t schema_id, const ObPartitionSchema& partition_schema, bool check_dropped_schema); @@ -231,14 +231,14 @@ class ObPartitionKeyIter { int next_partition_key_v2(common::ObPartitionKey& pkey); int next_partition_info(ObPartitionKeyIter::Info& info); - public: +public: uint64_t get_schema_id() const { return schema_id_; } TO_STRING_KV(K_(schema_id), K_(part_level), KP_(partition_schema), K_(check_dropped_schema)); - private: +private: uint64_t schema_id_; ObPartitionLevel part_level_; const ObPartitionSchema* partition_schema_; @@ -251,26 +251,26 @@ class ObPartitionKeyIter { // FIXME:() Consider integrating with ObPartitionKeyIter class ObDroppedPartitionKeyIter { - public: +public: ObDroppedPartitionKeyIter() = delete; explicit ObDroppedPartitionKeyIter(const uint64_t schema_id, const ObPartitionSchema& partition_schema); int next_partition_id(int64_t& partition_id); int next_partition_info(ObPartitionKeyIter::Info& info); - public: +public: uint64_t get_schema_id() const { return iter_.get_schema_id(); } TO_STRING_KV(K_(iter)); - private: +private: ObPartitionKeyIter iter_; DISALLOW_COPY_AND_ASSIGN(ObDroppedPartitionKeyIter); }; class ObTablePartitionKeyIter { - public: +public: explicit ObTablePartitionKeyIter(const ObSimpleTableSchemaV2& table_schema, bool check_dropped_schema); // get partition count of table int64_t get_partition_cnt() const @@ -289,12 +289,12 @@ class ObTablePartitionKeyIter { int next_partition_key_v2(common::ObPartitionKey& pkey); int next_partition_id_v2(int64_t& partition_id); - private: +private: ObPartitionKeyIter partition_key_iter_; }; class ObTablegroupPartitionKeyIter { - public: +public: explicit ObTablegroupPartitionKeyIter(const ObTablegroupSchema& tablegroup_schema, bool check_dropped_schema); // get partition count of table int64_t get_partition_cnt() const @@ -313,12 +313,12 @@ class ObTablegroupPartitionKeyIter { int next_partition_key_v2(common::ObPGKey& pkey); int next_partition_id_v2(int64_t& partition_id); - private: +private: ObPartitionKeyIter partition_key_iter_; }; class ObTablePgKeyIter { - public: +public: ObTablePgKeyIter( const share::schema::ObSimpleTableSchemaV2& table_schema, const uint64_t tablegroup_id, bool check_dropped_schema) : table_schema_(table_schema), @@ -328,11 +328,11 @@ class ObTablePgKeyIter { virtual ~ObTablePgKeyIter() {} - public: +public: int init(); int next(common::ObPartitionKey& pkey, common::ObPGKey& pgkey); - private: +private: const share::schema::ObSimpleTableSchemaV2& table_schema_; const uint64_t tablegroup_id_; ObPartitionKeyIter iter_; @@ -387,13 +387,13 @@ struct ObPartitionItem { }; class ObTablePartItemIterator { - public: +public: ObTablePartItemIterator(); explicit ObTablePartItemIterator(const ObSimpleTableSchemaV2& table_schema); void init(const ObSimpleTableSchemaV2& table_schema); int next(ObPartitionItem& item); - private: +private: const ObSimpleTableSchemaV2* table_schema_; ObPartIteratorV2 part_iter_; ObSubPartIteratorV2 subpart_iter_; @@ -404,11 +404,11 @@ class ObTablePartItemIterator { }; class ObPartMgrUtils { - private: +private: ObPartMgrUtils(); ~ObPartMgrUtils(); - public: +public: static int check_part_exist(const ObPartitionSchema& partition_schema, const int64_t partition_id, const bool check_dropped_partition, bool& exist); static int get_part_diff(const ObPartitionSchema& old_table, const ObPartitionSchema& new_table, @@ -422,7 +422,7 @@ class ObPartMgrUtils { static int get_partition_entity_schemas_in_tenant(share::schema::ObSchemaGetterGuard& schema_guard, const uint64_t tenant_id, common::ObIArray& partition_schemas); - private: +private: static bool exist_partition_id(common::ObArray& partition_ids, const int64_t& partition_id); static bool compare_with_part_id(const ObPartition* lhs, const int64_t part_id) { diff --git a/src/share/schema/ob_partition_sql_helper.h b/src/share/schema/ob_partition_sql_helper.h index 6ad237bfb..4553ac3d3 100644 --- a/src/share/schema/ob_partition_sql_helper.h +++ b/src/share/schema/ob_partition_sql_helper.h @@ -33,7 +33,7 @@ class ObSplitInfo; namespace schema { class ObPartDMLGenerator { - public: +public: ObPartDMLGenerator() { MEMSET(high_bound_val_, 0, common::OB_MAX_B_HIGH_BOUND_VAL_LENGTH); @@ -44,7 +44,7 @@ class ObPartDMLGenerator { int gen_dml(ObDMLSqlSplicer& dml); static int add_part_name_column(const ObPartitionSchema* table, const ObPartition& part, share::ObDMLSqlSplicer& dml); - protected: +protected: struct PartInfo { uint64_t tenant_id_; uint64_t table_id_; @@ -81,7 +81,7 @@ class ObPartDMLGenerator { int gen_list_val_str(const common::ObIArray& list_value, common::ObString& list_val_str, common::ObString& b_list_val_str, uint64_t tenant_id); - private: +private: char high_bound_val_[common::OB_MAX_B_HIGH_BOUND_VAL_LENGTH]; char b_high_bound_val_[common::OB_MAX_B_HIGH_BOUND_VAL_LENGTH]; char list_val_[common::OB_MAX_PARTITION_EXPR_LENGTH]; @@ -89,7 +89,7 @@ class ObPartDMLGenerator { }; class ObAddIncPartDMLGenerator : public ObPartDMLGenerator { - public: +public: ObAddIncPartDMLGenerator(const ObPartitionSchema* ori_table, const ObPartition& part, const int64_t inc_part_num, const int64_t part_idx, const int64_t schema_version) : ObPartDMLGenerator(), @@ -103,12 +103,12 @@ class ObAddIncPartDMLGenerator : public ObPartDMLGenerator { {} int gen_dml_for_delay_delete(ObDMLSqlSplicer& dml); - protected: +protected: int extract_part_info(PartInfo& part_info); int extract_part_info_for_delay_delete(PartInfo& part_info); int convert_to_dml(const PartInfo& part_info, ObDMLSqlSplicer& dml); - private: +private: const ObPartitionSchema* ori_table_; const ObPartition& part_; int64_t inc_part_num_; @@ -117,7 +117,7 @@ class ObAddIncPartDMLGenerator : public ObPartDMLGenerator { }; class ObAddIncSubPartDMLGenerator : public ObPartDMLGenerator { - public: +public: ObAddIncSubPartDMLGenerator(const ObPartitionSchema* ori_table, const ObPartition& part, const ObSubPartition& sub_part, const int64_t inc_part_num, const int64_t part_idx, const int64_t subpart_idx, const int64_t schema_version) @@ -134,12 +134,12 @@ class ObAddIncSubPartDMLGenerator : public ObPartDMLGenerator { {} int gen_dml_for_delay_delete(ObDMLSqlSplicer& dml); - protected: +protected: int extract_part_info(PartInfo& part_info); int extract_part_info_for_delay_delete(PartInfo& part_info); int convert_to_dml(const PartInfo& part_info, ObDMLSqlSplicer& dml); - private: +private: const ObPartitionSchema* ori_table_; const ObPartition& part_; const ObSubPartition& sub_part_; @@ -150,25 +150,25 @@ class ObAddIncSubPartDMLGenerator : public ObPartDMLGenerator { }; class ObDropIncPartDMLGenerator : public ObPartDMLGenerator { - public: +public: ObDropIncPartDMLGenerator(const ObPartitionSchema* ori_table, const ObPartition& part, const int64_t schema_version) : ObPartDMLGenerator(), ori_table_(ori_table), part_(part), schema_version_(schema_version) {} virtual ~ObDropIncPartDMLGenerator() {} - protected: +protected: int extract_part_info(PartInfo& part_info); int convert_to_dml(const PartInfo& part_info, ObDMLSqlSplicer& dml); - private: +private: const ObPartitionSchema* ori_table_; const ObPartition& part_; int64_t schema_version_; }; class ObDropIncSubPartDMLGenerator : public ObPartDMLGenerator { - public: +public: ObDropIncSubPartDMLGenerator( const ObPartitionSchema* ori_table, const ObSubPartition& sub_part, const int64_t schema_version) : ObPartDMLGenerator(), ori_table_(ori_table), sub_part_(sub_part), schema_version_(schema_version) @@ -176,18 +176,18 @@ class ObDropIncSubPartDMLGenerator : public ObPartDMLGenerator { virtual ~ObDropIncSubPartDMLGenerator() {} - protected: +protected: int extract_part_info(PartInfo& part_info); int convert_to_dml(const PartInfo& part_info, ObDMLSqlSplicer& dml); - private: +private: const ObPartitionSchema* ori_table_; const ObSubPartition& sub_part_; int64_t schema_version_; }; class ObPartSqlHelper { - public: +public: ObPartSqlHelper(const ObPartitionSchema* table, common::ObISQLClient& sql_client, bool is_tablegroup_def) : table_(table), sql_client_(sql_client), is_tablegroup_def_(is_tablegroup_def) {} @@ -195,7 +195,7 @@ class ObPartSqlHelper { {} virtual bool is_tablegroup_def(); - protected: +protected: virtual bool is_deleted() const = 0; virtual int add_part_info_dml_column( const uint64_t exec_tenant_id, const ObPartitionSchema* table, ObDMLSqlSplicer& dml) = 0; @@ -213,12 +213,12 @@ class ObPartSqlHelper { const bool deal_with_delay_delete_subparts = false); int iterate_all_def_sub_part(const bool only_history); - private: +private: int iterate_all_sub_part_for_template(const bool only_history); int iterate_all_sub_part_for_nontemplate(const bool only_history, const bool deal_with_delay_delete_parts = false, const bool deal_with_delay_delete_subparts = false); - protected: +protected: static const int64_t MAX_DML_NUM = 128; const ObPartitionSchema* table_; common::ObISQLClient& sql_client_; @@ -226,7 +226,7 @@ class ObPartSqlHelper { }; class ObAddPartInfoHelper : public ObPartSqlHelper { - public: +public: ObAddPartInfoHelper(const ObPartitionSchema* table, common::ObISQLClient& sql_client, bool is_tablegroup_def) : ObPartSqlHelper(table, sql_client, is_tablegroup_def), high_bound_val_(NULL), list_val_(NULL), allocator_() {} @@ -235,7 +235,7 @@ class ObAddPartInfoHelper : public ObPartSqlHelper { int add_partition_info(); int add_partition_info_for_gc(); - protected: +protected: bool is_deleted() const { return false; @@ -249,7 +249,7 @@ class ObAddPartInfoHelper : public ObPartSqlHelper { const int64_t def_subpart_idx, const int64_t mapping_pg_sub_part_id, const ObSubPartition* subpart, ObDMLSqlSplicer& dml); - private: +private: int add_subpart_name_column(const ObPartitionSchema* table, const int64_t part_idx, const int64_t subpart_idx, const bool is_def_subpart, share::ObDMLSqlSplicer& dml); // add part high bound val column to dml @@ -271,7 +271,7 @@ class ObAddPartInfoHelper : public ObPartSqlHelper { template // ObPartition or ObSubPartition int add_list_val_column(const P& partition, ObDMLSqlSplicer& dml); - private: +private: char* high_bound_val_; char* list_val_; common::ObArenaAllocator allocator_; @@ -279,7 +279,7 @@ class ObAddPartInfoHelper : public ObPartSqlHelper { }; class ObDropPartInfoHelper : public ObPartSqlHelper { - public: +public: ObDropPartInfoHelper(const ObPartitionSchema* table, common::ObISQLClient& sql_client, bool is_tablegroup_def) : ObPartSqlHelper(table, sql_client, is_tablegroup_def) {} @@ -288,7 +288,7 @@ class ObDropPartInfoHelper : public ObPartSqlHelper { int delete_partition_info(); int delete_dropped_partition_info(); - protected: +protected: bool is_deleted() const { return true; @@ -302,12 +302,12 @@ class ObDropPartInfoHelper : public ObPartSqlHelper { const int64_t def_subpart_idx, const int64_t mapping_pg_sub_part_id, const ObSubPartition* subpart, ObDMLSqlSplicer& dml); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropPartInfoHelper); }; class ObAddIncPartHelper { - public: +public: ObAddIncPartHelper(const ObPartitionSchema* ori_table, const ObPartitionSchema* inc_table, const int64_t schema_version, common::ObISQLClient& sql_client, bool is_tablegroup_def) : ori_table_(ori_table), @@ -323,7 +323,7 @@ class ObAddIncPartHelper { int add_partition_info_for_nontemplate(const bool is_delay_delete = false); int add_partition_info_for_gc(); - private: +private: const ObPartitionSchema* ori_table_; const ObPartitionSchema* inc_table_; int64_t schema_version_; @@ -333,7 +333,7 @@ class ObAddIncPartHelper { }; class ObAddIncSubPartHelper { - public: +public: ObAddIncSubPartHelper(const ObPartitionSchema* ori_table, const ObPartitionSchema* inc_table, const int64_t schema_version, common::ObISQLClient& sql_client, bool is_tablegroup_def) : ori_table_(ori_table), @@ -349,7 +349,7 @@ class ObAddIncSubPartHelper { int add_subpartition_info_for_nontemplate(const bool is_delay_delete = false); int add_subpartition_info_for_gc(); - private: +private: const ObPartitionSchema* ori_table_; const ObPartitionSchema* inc_table_; int64_t schema_version_; @@ -359,7 +359,7 @@ class ObAddIncSubPartHelper { }; class ObDropIncPartHelper { - public: +public: ObDropIncPartHelper(const ObPartitionSchema* ori_table, const ObPartitionSchema* inc_table, const int64_t schema_version, common::ObISQLClient& sql_client, bool is_tablegroup_def) : ori_table_(ori_table), @@ -374,7 +374,7 @@ class ObDropIncPartHelper { int drop_partition_info_for_template(); int drop_partition_info_for_nontemplate(); - private: +private: const ObPartitionSchema* ori_table_; const ObPartitionSchema* inc_table_; int64_t schema_version_; @@ -384,7 +384,7 @@ class ObDropIncPartHelper { }; class ObDropIncSubPartHelper { - public: +public: ObDropIncSubPartHelper(const ObPartitionSchema* ori_table, const ObPartitionSchema* inc_table, const int64_t schema_version, common::ObISQLClient& sql_client, bool is_tablegroup_def) : ori_table_(ori_table), @@ -400,7 +400,7 @@ class ObDropIncSubPartHelper { int drop_subpartition_info_for_template(); int drop_subpartition_info_for_nontemplate(const bool deal_with_delay_delete_parts = false); - private: +private: const ObPartitionSchema* ori_table_; const ObPartitionSchema* inc_table_; int64_t schema_version_; @@ -410,7 +410,7 @@ class ObDropIncSubPartHelper { }; class ObSplitPartHelperV2 { - public: +public: ObSplitPartHelperV2(const ObPartitionSchema& new_schema, const int64_t schema_version, const share::ObSplitInfo& split_info, common::ObISQLClient& sql_client) : new_schema_(new_schema), schema_version_(schema_version), sql_client_(sql_client), split_info_(split_info) @@ -419,7 +419,7 @@ class ObSplitPartHelperV2 { {} int split_partition(); - private: +private: const ObPartitionSchema& new_schema_; int64_t schema_version_; common::ObISQLClient& sql_client_; @@ -428,41 +428,41 @@ class ObSplitPartHelperV2 { }; class ObSplitPartDMLGeneratorV2 : public ObPartDMLGenerator { - public: +public: ObSplitPartDMLGeneratorV2(const ObPartitionSchema& new_schema, const ObPartition& part, const int64_t schema_version) : ObPartDMLGenerator(), new_schema_(new_schema), part_(part), schema_version_(schema_version) {} virtual ~ObSplitPartDMLGeneratorV2() {} - protected: +protected: int extract_part_info(PartInfo& part_info); int convert_to_dml(const PartInfo& part_info, ObDMLSqlSplicer& dml); - private: +private: const ObPartitionSchema& new_schema_; const ObPartition& part_; int64_t schema_version_; }; class ObUpdatePartHisDMLGenerator : public ObPartDMLGenerator { - public: +public: ObUpdatePartHisDMLGenerator(const ObPartition& part, int64_t schema_version, const ObPartitionSchema& table_schema); virtual ~ObUpdatePartHisDMLGenerator() {} - protected: +protected: int extract_part_info(PartInfo& part_info); int convert_to_dml(const PartInfo& part_info, ObDMLSqlSplicer& dml); - private: +private: const ObPartition& part_; int64_t schema_version_; const ObPartitionSchema& table_schema_; }; class ObUpdatePartHisInfoHelper { - public: +public: ObUpdatePartHisInfoHelper(const obrpc::ObSplitPartitionArg& arg, const ObSimpleTableSchemaV2& table_schema, common::ObISQLClient& sql_client, const int64_t schema_version) : arg_(arg), table_schema_(table_schema), sql_client_(sql_client), schema_version_(schema_version) @@ -471,14 +471,14 @@ class ObUpdatePartHisInfoHelper { {} int update_partition_info(); - private: +private: const obrpc::ObSplitPartitionArg& arg_; const ObSimpleTableSchemaV2& table_schema_; common::ObISQLClient& sql_client_; int64_t schema_version_; }; class ObUpdatePartHisInfoHelperV2 { - public: +public: ObUpdatePartHisInfoHelperV2(const ObTablegroupSchema& tablegroup_schema, common::ObISQLClient& sql_client) : schema_(tablegroup_schema), sql_client_(sql_client) {} @@ -486,7 +486,7 @@ class ObUpdatePartHisInfoHelperV2 { {} int update_partition_info(); - private: +private: const ObTablegroupSchema& schema_; common::ObISQLClient& sql_client_; }; diff --git a/src/share/schema/ob_priv_mgr.h b/src/share/schema/ob_priv_mgr.h index f1f4755d6..2523a03f5 100644 --- a/src/share/schema/ob_priv_mgr.h +++ b/src/share/schema/ob_priv_mgr.h @@ -71,7 +71,7 @@ class ObPrivMgr { typedef ObjPrivInfos::iterator ObjPrivIter; typedef ObjPrivInfos::const_iterator ConstObjPrivIter; - public: +public: ObPrivMgr(); explicit ObPrivMgr(common::ObIAllocator& allocator); virtual ~ObPrivMgr(); @@ -141,11 +141,11 @@ class ObPrivMgr { int get_priv_schema_count(int64_t& priv_scheam_count) const; int get_schema_statistics(const ObSchemaType schema_type, ObSchemaStatisticsInfo& schema_info) const; - private: +private: int get_db_priv_iter(const ObOriginalDBKey& db_key, DBPrivIter& target_db_priv_iter) const; int get_sys_priv_iter(const ObSysPrivKey& sys_key, SysPrivIter& target_sys_priv_iter) const; - private: +private: common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; DBPrivInfos db_privs_; diff --git a/src/share/schema/ob_priv_sql_service.h b/src/share/schema/ob_priv_sql_service.h index 67ea7689d..b2a97963d 100644 --- a/src/share/schema/ob_priv_sql_service.h +++ b/src/share/schema/ob_priv_sql_service.h @@ -26,7 +26,7 @@ class ObOriginalDBKey; class ObTablePrivSortKey; class ObPrivSqlService : public ObDDLSqlService { - public: +public: ObPrivSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObPrivSqlService() @@ -77,7 +77,7 @@ class ObPrivSqlService : public ObDDLSqlService { virtual int delete_obj_priv(const ObObjPriv& obj_priv, const int64_t new_schema_version, ObISQLClient& sql_client); - private: +private: int log_obj_priv_operation(const ObObjPrivSortKey& obj_priv_key, const int64_t new_schema_version, const ObSchemaOperationType op_type, const ObString* ddl_stmt_str, ObISQLClient& sql_client); @@ -103,7 +103,7 @@ class ObPrivSqlService : public ObDDLSqlService { int gen_obj_priv_dml_ora(const uint64_t exec_tenant_id, const ObObjPrivSortKey& obj_priv_key, share::ObRawObjPriv& raw_obj_priv, const uint64_t option, ObDMLSqlSplicer& dml, bool is_deleted); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPrivSqlService); }; diff --git a/src/share/schema/ob_profile_mgr.h b/src/share/schema/ob_profile_mgr.h index 8ce5b3f76..574bf458d 100644 --- a/src/share/schema/ob_profile_mgr.h +++ b/src/share/schema/ob_profile_mgr.h @@ -22,7 +22,7 @@ namespace share { namespace schema { class ObProfileNameHashKey { - public: +public: ObProfileNameHashKey() : tenant_id_(common::OB_INVALID_TENANT_ID) {} ObProfileNameHashKey(uint64_t tenant_id, common::ObString name) : tenant_id_(tenant_id), name_(name) @@ -41,7 +41,7 @@ class ObProfileNameHashKey { return tenant_id_ == rv.tenant_id_ && name_ == rv.name_; } - private: +private: uint64_t tenant_id_; common::ObString name_; }; @@ -73,7 +73,7 @@ struct ObGetProfileKey { }; class ObProfileMgr { - public: +public: typedef common::ObSortedVector ProfileInfos; typedef common::hash::ObPointerHashMap ObProfileNameMap; typedef common::hash::ObPointerHashMap ObProfileIdMap; @@ -111,7 +111,7 @@ class ObProfileMgr { int get_schema_count(int64_t& schema_count) const; int get_schema_statistics(ObSchemaStatisticsInfo& schema_info) const; - private: +private: bool is_inited_; common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; diff --git a/src/share/schema/ob_profile_sql_service.h b/src/share/schema/ob_profile_sql_service.h index abffa955e..edc3c7313 100644 --- a/src/share/schema/ob_profile_sql_service.h +++ b/src/share/schema/ob_profile_sql_service.h @@ -26,7 +26,7 @@ namespace schema { class ObProfileSchema; class ObProfileSqlService : public ObDDLSqlService { - public: +public: ObProfileSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObProfileSqlService() @@ -39,10 +39,10 @@ class ObProfileSqlService : public ObDDLSqlService { int alter_schema(ObISQLClient& sql_client, const ObProfileSchema& schema); int drop_schema(ObISQLClient& sql_client, const ObProfileSchema& schema); - private: +private: int gen_sql(common::ObSqlString& sql, common::ObSqlString& values, const ObProfileSchema& schema); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObProfileSqlService); }; diff --git a/src/share/schema/ob_schema_cache.h b/src/share/schema/ob_schema_cache.h index 3987d754f..af43a493e 100644 --- a/src/share/schema/ob_schema_cache.h +++ b/src/share/schema/ob_schema_cache.h @@ -32,7 +32,7 @@ namespace share { namespace schema { class ObSchemaCacheKey : public common::ObIKVCacheKey { - public: +public: ObSchemaCacheKey(); ObSchemaCacheKey(const ObSchemaType schema_type, const uint64_t schema_id, const uint64_t schema_version); virtual ~ObSchemaCacheKey() @@ -50,7 +50,7 @@ class ObSchemaCacheKey : public common::ObIKVCacheKey { }; class ObSchemaCacheValue : public common::ObIKVCacheValue { - public: +public: ObSchemaCacheValue(); ObSchemaCacheValue(ObSchemaType schema_type, const ObSchema* schema); virtual ~ObSchemaCacheValue() @@ -66,7 +66,7 @@ class ObSchemaCacheValue : public common::ObIKVCacheValue { class ObSchemaCache { static const int64_t OB_SCHEMA_CACHE_SYS_CACHE_MAP_BUCKET_NUM = 512; - public: +public: ObSchemaCache(); virtual ~ObSchemaCache(); @@ -79,14 +79,14 @@ class ObSchemaCache { common::ObKVCacheHandle& handle, const ObSchema*& new_schema); const ObTableSchema* get_all_core_table() const; - private: +private: bool check_inner_stat() const; bool is_valid_key(ObSchemaType schema_type, uint64_t schema_id, int64_t schema_version) const; bool need_use_sys_cache(const ObSchemaCacheKey& cache_key) const; int init_all_core_table(); int put_sys_schema(const ObSchemaCacheKey& cache_key, const ObSchema& schema, const bool is_force); - private: +private: typedef common::hash::ObHashMap NoSwapCache; typedef common::ObKVCache KVCache; @@ -97,14 +97,14 @@ class ObSchemaCache { bool is_inited_; ObTableSchema all_core_table_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSchemaCache); }; class ObSchemaService; class ObTableSchema; class ObSchemaFetcher { - public: +public: ObSchemaFetcher(); virtual ~ObSchemaFetcher() {} @@ -113,7 +113,7 @@ class ObSchemaFetcher { int fetch_schema(ObSchemaType schema_type, const ObRefreshSchemaStatus& schema_status, uint64_t schema_id, int64_t schema_version, common::ObIAllocator& allocator, ObSchema*& schema); - private: +private: int fetch_tenant_schema( uint64_t tenant_id, int64_t schema_version, common::ObIAllocator& allocator, ObTenantSchema*& tenant_schema); int fetch_sys_variable_schema(const ObRefreshSchemaStatus& schema_status, uint64_t tenant_id, int64_t schema_version, @@ -145,7 +145,7 @@ class ObSchemaFetcher { #undef DEF_SCHEMA_INFO_FETCHER #endif - private: +private: ObSchemaService* schema_service_; common::ObISQLClient* sql_client_; bool is_inited_; diff --git a/src/share/schema/ob_schema_getter_guard.h b/src/share/schema/ob_schema_getter_guard.h index 3c770ddba..5b71eab17 100644 --- a/src/share/schema/ob_schema_getter_guard.h +++ b/src/share/schema/ob_schema_getter_guard.h @@ -54,7 +54,7 @@ class ObSimpleSynonymSchema; class ObUDF; class ObMockSchemaInfo; class ObSchemaGetterGuardHelper { - public: +public: ObSchemaGetterGuardHelper(common::ObIAllocator& alloc) : is_inited_(false), alloc_(alloc), full_schemas_(), simple_schemas_() {} @@ -71,19 +71,19 @@ class ObSchemaGetterGuardHelper { int get_tablegroup_schema(ObSchemaGetterGuard& guard, const ObSimpleTablegroupSchema* orig_tablegroup, const ObSimpleTablegroupSchema*& tablegroup_schema); - private: +private: const static int64_t DEFAULT_SCHEMA_NUM = 100; int64_t is_inited_; common::ObIAllocator& alloc_; common::hash::ObHashMap full_schemas_; common::hash::ObHashMap simple_schemas_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSchemaGetterGuardHelper); }; class ObSchemaMgrInfo { - public: +public: ObSchemaMgrInfo() : tenant_id_(common::OB_INVALID_TENANT_ID), snapshot_version_(common::OB_INVALID_VERSION), @@ -127,7 +127,7 @@ class ObSchemaMgrInfo { void reset(); TO_STRING_KV(K_(tenant_id), K_(snapshot_version), KP_(schema_mgr), K_(schema_status)); - private: +private: uint64_t tenant_id_; int64_t snapshot_version_; const ObSchemaMgr* schema_mgr_; @@ -153,7 +153,7 @@ class ObSchemaGetterGuard : public common::ObPartMgr { typedef common::ObSEArray SchemaObjs; typedef common::ObSEArray SchemaMgrInfos; - public: +public: enum CheckTableType { ALL_TYPES = 0, TEMP_TABLE_TYPE = 1, @@ -475,50 +475,56 @@ class ObSchemaGetterGuard : public common::ObPartMgr { int get_table_schema_version(const uint64_t table_id, int64_t& table_version); template - int check_flashback_object_exist(const SchemaType &object_schema, - const common::ObString &object_name, - bool &object_exist); + int check_flashback_object_exist( + const SchemaType& object_schema, const common::ObString& object_name, bool& object_exist); - virtual int get_part(const uint64_t table_id, - const share::schema::ObPartitionLevel part_level, - const int64_t part_id, - const common::ObNewRange &range, - const bool reverse, - common::ObIArray &part_ids) override; - virtual int get_part(const uint64_t table_id, - const share::schema::ObPartitionLevel part_level, - const int64_t part_id, - const common::ObNewRow &row, - common::ObIArray &part_ids) override; - int get_schema_count(int64_t &schema_count); - int get_schema_count(const uint64_t tenant_id, int64_t &schema_count); - int get_schema_size(const uint64_t tenant_id, int64_t &schema_count); - int get_schema_version_v2(const ObSchemaType schema_type, - const uint64_t schema_id, - int64_t &schema_version); - int get_idx_schema_by_origin_idx_name(uint64_t tenant_id, - uint64_t database_id, - const common::ObString &index_name, - const ObTableSchema *&table_schema); + virtual int get_part(const uint64_t table_id, const share::schema::ObPartitionLevel part_level, const int64_t part_id, + const common::ObNewRange& range, const bool reverse, common::ObIArray& part_ids) override; + virtual int get_part(const uint64_t table_id, const share::schema::ObPartitionLevel part_level, const int64_t part_id, + const common::ObNewRow& row, common::ObIArray& part_ids) override; + int get_schema_count(int64_t& schema_count); + int get_schema_count(const uint64_t tenant_id, int64_t& schema_count); + int get_schema_size(const uint64_t tenant_id, int64_t& schema_count); + int get_schema_version_v2(const ObSchemaType schema_type, const uint64_t schema_id, int64_t& schema_version); + int get_idx_schema_by_origin_idx_name( + uint64_t tenant_id, uint64_t database_id, const common::ObString& index_name, const ObTableSchema*& table_schema); - int get_tenant_unavailable_index(const uint64_t tenant_id, common::ObIArray &table_ids); - int check_unavailable_index_exist(const uint64_t tenant_id, bool &exist); - int check_restore_error_index_exist(const uint64_t tenant_id, bool &exist); + int get_tenant_unavailable_index(const uint64_t tenant_id, common::ObIArray& table_ids); + int check_unavailable_index_exist(const uint64_t tenant_id, bool& exist); + int check_restore_error_index_exist(const uint64_t tenant_id, bool& exist); - inline uint64_t get_session_id() const { return session_id_; } - inline void set_session_id(const uint64_t id) { session_id_ = id; } + inline uint64_t get_session_id() const + { + return session_id_; + } + inline void set_session_id(const uint64_t id) + { + session_id_ = id; + } - int get_partition_cnt(uint64_t table_id, int64_t &part_cnt); + int get_partition_cnt(uint64_t table_id, int64_t& part_cnt); - bool is_tenant_schema_guard() const { return common::OB_INVALID_TENANT_ID != tenant_id_; } + bool is_tenant_schema_guard() const + { + return common::OB_INVALID_TENANT_ID != tenant_id_; + } - int get_tenant_mv_ids(const uint64_t tenant_id, common::ObArray &mv_ids) const; - int get_all_mv_ids(common::ObArray &mv_ids) const; + int get_tenant_mv_ids(const uint64_t tenant_id, common::ObArray& mv_ids) const; + int get_all_mv_ids(common::ObArray& mv_ids) const; - SchemaGuardType get_schema_guard_type() const { return schema_guard_type_; } + SchemaGuardType get_schema_guard_type() const + { + return schema_guard_type_; + } - bool is_standby_cluster() { return is_standby_cluster_; } - bool is_schema_splited() const { return 0 != schema_mgr_infos_.count(); } + bool is_standby_cluster() + { + return is_standby_cluster_; + } + bool is_schema_splited() const + { + return 0 != schema_mgr_infos_.count(); + } int check_formal_guard() const; int is_lazy_mode(const uint64_t tenant_id, bool& is_lazy) const; @@ -528,7 +534,7 @@ class ObSchemaGetterGuard : public common::ObPartMgr { int get_sys_priv_with_tenant_id(const uint64_t tenant_id, common::ObIArray& sys_privs); int get_sys_priv_with_grantee_id(const uint64_t tenant_id, const uint64_t grantee_id, ObSysPriv*& sys_priv); - public: +public: // for optimize // ------- local cache : id2schema --------- struct IdSchemaWrapper { @@ -541,7 +547,7 @@ class ObSchemaGetterGuard : public common::ObPartMgr { template int get_from_local_cache(const ObSchemaType schema_type, const uint64_t schema_id, const T*& schema); - private: +private: int get_outline_schemas_in_tenant(const uint64_t tenant_id, common::ObIArray& outline_schemas); int get_synonym_schemas_in_tenant(const uint64_t tenant_id, common::ObIArray& synonym_schemas); @@ -592,7 +598,7 @@ class ObSchemaGetterGuard : public common::ObPartMgr { int get_index_status_inner(const ObTableSchema& data_table_schema, const bool with_global_index, common::ObIArray& index_status); - private: +private: int add_handle(const common::ObKVCacheHandle& handle); int init(const bool is_standby_cluster); int fast_reset() @@ -614,7 +620,7 @@ class ObSchemaGetterGuard : public common::ObPartMgr { const common::ObIArray& role_id_array); int try_mock_rowid(const ObTableSchema* orig_table, const ObTableSchema*& final_table); - private: +private: ObMultiVersionSchemaService* schema_service_; int64_t snapshot_version_; uint64_t session_id_; // 0: default value (session_id_ is useless) @@ -647,7 +653,7 @@ class ObSchemaGetterGuard : public common::ObPartMgr { bool is_standby_cluster_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSchemaGetterGuard); }; } // end of namespace schema diff --git a/src/share/schema/ob_schema_manager.h b/src/share/schema/ob_schema_manager.h index ca5b8596b..43d4697fb 100644 --- a/src/share/schema/ob_schema_manager.h +++ b/src/share/schema/ob_schema_manager.h @@ -136,7 +136,7 @@ struct GetTableKey { }; class ObSchemaManager { - public: +public: friend class oceanbase::storagetest::ObDataManager; static const int64_t SCHEMA_MEM_EXPIRE_TIME = 3600 * 1000 * 1000L; // one hour typedef common::ObSortedVector::iterator table_iterator; @@ -153,7 +153,7 @@ class ObSchemaManager { int init(const bool is_init_sys_tenant = true); void reset(); - public: +public: //---------memory related functions----- common::ObMemfragRecycleAllocator& get_allocator(); int copy_schema_infos(const ObSchemaManager& schema_manager); @@ -388,7 +388,7 @@ class ObSchemaManager { uint64_t tenant_id, common::ObMySQLProxy* sql_proxy, char* buf, const int64_t& buf_len, int64_t& pos) const; int deep_copy_obj(const common::ObObj& src, common::ObObj& dest) const; - private: +private: ObSchemaManager& operator=(const ObSchemaManager& schema); template @@ -443,7 +443,7 @@ class ObSchemaManager { int verify_db_read_only(const uint64_t tenant_id, const ObNeedPriv& need_priv) const; int verify_table_read_only(const uint64_t tenant_id, const ObNeedPriv& need_priv) const; - public: +public: // TODO(XX) I need it, please not delete. 20150413 int get_database_id(uint64_t tenant_id, const common::ObString& database_name, uint64_t& database_id) const; int get_database_name(const uint64_t tenant_id, const uint64_t database_id, common::ObString& database_name) const; @@ -458,7 +458,7 @@ class ObSchemaManager { return global_alloc_size_; } - private: +private: // how to be compatible static const int64_t OB_SCHEMA_MAGIC_NUMBER = 0x43532313; // SC diff --git a/src/share/schema/ob_schema_mem_mgr.h b/src/share/schema/ob_schema_mem_mgr.h index 5fb9530bd..aaac6d1a0 100644 --- a/src/share/schema/ob_schema_mem_mgr.h +++ b/src/share/schema/ob_schema_mem_mgr.h @@ -24,7 +24,7 @@ namespace share { namespace schema { class ObSchemaMemMgr { - public: +public: ObSchemaMemMgr(); virtual ~ObSchemaMemMgr(); // TODO: Subsequent need to do 500 tenant memory split, schema_mgr memory usage needs to be split to tenants @@ -47,14 +47,14 @@ class ObSchemaMemMgr { int try_reset_another_allocator(); int get_another_ptrs(common::ObArray& ptrs); - private: +private: bool check_inner_stat() const; int find_ptr(const void* ptr, const int ptrs_pos, int& idx); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSchemaMemMgr); - private: +private: common::ObArenaAllocator allocator_[2]; common::ObArray all_ptrs_[2]; common::ObArray ptrs_[2]; diff --git a/src/share/schema/ob_schema_mgr.h b/src/share/schema/ob_schema_mgr.h index 402a16edf..738457385 100644 --- a/src/share/schema/ob_schema_mgr.h +++ b/src/share/schema/ob_schema_mgr.h @@ -39,7 +39,7 @@ class ObServerSchemaService; class ObSchemaGetterGuard; class ObSimpleTenantSchema : public ObSchema { - public: +public: ObSimpleTenantSchema(); explicit ObSimpleTenantSchema(common::ObIAllocator* allocator); ObSimpleTenantSchema(const ObSimpleTenantSchema& src_schema); @@ -188,7 +188,7 @@ class ObSimpleTenantSchema : public ObSchema { in_recyclebin_ = in_recyclebin; } - private: +private: uint64_t tenant_id_; int64_t schema_version_; common::ObString tenant_name_; @@ -205,7 +205,7 @@ class ObSimpleTenantSchema : public ObSchema { }; class ObSimpleUserSchema : public ObSchema { - public: +public: ObSimpleUserSchema(); explicit ObSimpleUserSchema(common::ObIAllocator* allocator); ObSimpleUserSchema(const ObSimpleUserSchema& src_schema); @@ -281,7 +281,7 @@ class ObSimpleUserSchema : public ObSchema { return OB_ROLE == type_; } - private: +private: uint64_t tenant_id_; uint64_t user_id_; int64_t schema_version_; @@ -291,7 +291,7 @@ class ObSimpleUserSchema : public ObSchema { }; class ObSimpleDatabaseSchema : public ObSchema { - public: +public: ObSimpleDatabaseSchema(); explicit ObSimpleDatabaseSchema(common::ObIAllocator* allocator); ObSimpleDatabaseSchema(const ObSimpleDatabaseSchema& src_schema); @@ -372,7 +372,7 @@ class ObSimpleDatabaseSchema : public ObSchema { return drop_schema_version_ > 0; } - private: +private: uint64_t tenant_id_; uint64_t database_id_; int64_t schema_version_; @@ -383,7 +383,7 @@ class ObSimpleDatabaseSchema : public ObSchema { }; class ObSimpleTablegroupSchema : public ObSchema { - public: +public: ObSimpleTablegroupSchema(); explicit ObSimpleTablegroupSchema(common::ObIAllocator* allocator); ObSimpleTablegroupSchema(const ObSimpleTablegroupSchema& src_schema); @@ -517,7 +517,7 @@ class ObSimpleTablegroupSchema : public ObSchema { is_mock_global_index_invalid_ = is_invalid; } - private: +private: uint64_t tenant_id_; uint64_t tablegroup_id_; int64_t schema_version_; @@ -691,7 +691,7 @@ class ObSchemaMgr { typedef common::hash::ObPointerHashMap ConstraintNameMap; - public: +public: ObSchemaMgr(); explicit ObSchemaMgr(common::ObIAllocator& allocator); virtual ~ObSchemaMgr(); @@ -840,7 +840,7 @@ class ObSchemaMgr { int get_schema_count(int64_t& schema_count) const; int get_schema_statistics(common::ObIArray& schema_infos) const; - private: +private: inline bool check_inner_stat() const; inline static bool compare_tenant(const ObSimpleTenantSchema* lhs, const ObSimpleTenantSchema* rhs); inline static bool equal_tenant(const ObSimpleTenantSchema* lhs, const ObSimpleTenantSchema* rhs); @@ -915,7 +915,7 @@ class ObSchemaMgr { int get_tablegroup_statistics(ObSchemaStatisticsInfo& schema_info) const; int get_table_statistics(ObSchemaStatisticsInfo& schema_info) const; - private: +private: common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; int64_t schema_version_; diff --git a/src/share/schema/ob_schema_mgr_cache.h b/src/share/schema/ob_schema_mgr_cache.h index 539fdeb57..1d54b11e0 100644 --- a/src/share/schema/ob_schema_mgr_cache.h +++ b/src/share/schema/ob_schema_mgr_cache.h @@ -33,7 +33,7 @@ struct ObSchemaMgrItem { }; class ObSchemaMgrHandle { - public: +public: ObSchemaMgrHandle(); ObSchemaMgrHandle(const ObSchemaMgrHandle& other); virtual ~ObSchemaMgrHandle(); @@ -42,10 +42,10 @@ class ObSchemaMgrHandle { bool is_valid(); void dump() const; - private: +private: void revert(); - private: +private: friend class ObSchemaMgrCache; static const int64_t REF_TIME_THRESHOLD = 60 * 1000 * 1000L; ObSchemaMgrItem* schema_mgr_item_; @@ -53,10 +53,10 @@ class ObSchemaMgrHandle { }; class ObSchemaMgrCache { - public: +public: enum Mode { REFRESH = 0, FALLBACK = 1 }; - public: +public: ObSchemaMgrCache(); virtual ~ObSchemaMgrCache(); int init(int64_t init_cached_num, Mode mode); @@ -69,17 +69,17 @@ class ObSchemaMgrCache { int try_elimiante_schema_mgr(ObSchemaMgr*& eli_schema_mgr); void dump() const; - public: +public: const static int64_t MAX_SCHEMA_SLOT_NUM = 8 * 1024L; // 8192 - private: +private: bool check_inner_stat() const; // need process in wlock int try_update_latest_schema_idx(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSchemaMgrCache); - private: +private: common::TCRWLock lock_; ObSchemaMgrItem* schema_mgr_items_; int64_t max_cached_num_; diff --git a/src/share/schema/ob_schema_printer.h b/src/share/schema/ob_schema_printer.h index f3b560979..e7e4cf30c 100644 --- a/src/share/schema/ob_schema_printer.h +++ b/src/share/schema/ob_schema_printer.h @@ -39,16 +39,16 @@ class ObColumnSchemaV2; class ObSchemaGetterGuard; class ObSchemaPrinter { - public: +public: explicit ObSchemaPrinter(ObSchemaGetterGuard& schema_guard); virtual ~ObSchemaPrinter() {} - private: +private: ObSchemaPrinter(); DISALLOW_COPY_AND_ASSIGN(ObSchemaPrinter); - public: +public: int print_table_definition(uint64_t table_id, char* buf, const int64_t& buf_len, int64_t& pos, const common::ObTimeZoneInfo* tz_info, const common::ObLengthSemantics default_length_semantics, bool agent_mode) const; @@ -155,7 +155,7 @@ class ObSchemaPrinter { int print_hash_partition_elements(const ObPartitionSchema*& schema, char* buf, const int64_t& buf_len, int64_t& pos, bool agent_mode, const common::ObTimeZoneInfo* tz_info) const; - private: +private: ObSchemaGetterGuard& schema_guard_; }; diff --git a/src/share/schema/ob_schema_retrieve_utils.h b/src/share/schema/ob_schema_retrieve_utils.h index bc7af11c5..cda992c86 100644 --- a/src/share/schema/ob_schema_retrieve_utils.h +++ b/src/share/schema/ob_schema_retrieve_utils.h @@ -36,7 +36,7 @@ namespace schema { template class ObSchemaRetrieveHelperBase { - public: +public: static int64_t get_schema_id(const SCHEMA& schema) { UNUSED(schema); @@ -62,7 +62,7 @@ class ObSchemaRetrieveHelperBase { template class ObSchemaRetrieveHelperBase { - public: +public: static int64_t get_schema_id(const ObColumnSchemaV2& s); template static int fill_current( @@ -72,7 +72,7 @@ class ObSchemaRetrieveHelperBase { template class ObSchemaRetrieveHelperBase { - public: +public: static int64_t get_schema_id(const ObConstraint& s); template static int fill_current( @@ -82,7 +82,7 @@ class ObSchemaRetrieveHelperBase { template class ObSchemaRetrieveHelperBase { - public: +public: static int64_t get_schema_id(const ObPartition& s); template static int fill_current( @@ -92,7 +92,7 @@ class ObSchemaRetrieveHelperBase { template class ObSchemaRetrieveHelperBase { - public: +public: static int64_t get_schema_id(const ObSubPartition& s); template static int fill_current(const uint64_t tenant_id, const bool check_deleted, const bool is_subpart_template, T& result, @@ -102,10 +102,10 @@ class ObSchemaRetrieveHelperBase { template class ObSchemaRetrieveHelper { - private: +private: enum Mode { SINGLE_TABLE, MULTIPLE_TABLE }; - public: +public: ObSchemaRetrieveHelper(TABLE_SCHEMA& table) : mode_(SINGLE_TABLE), index_(0), is_subpart_def_(false), table_(&table), tmp_table_(NULL), table_array_(NULL) {} @@ -134,7 +134,7 @@ class ObSchemaRetrieveHelper { template static int fill_current(const uint64_t tenant_id, const bool check_deleted, T& result, SCHEMA& p, bool& is_deleted); - private: +private: const Mode mode_; int index_; bool is_subpart_def_; @@ -148,10 +148,10 @@ class ObSchemaRetrieveHelper { template class ObSubPartSchemaRetrieveHelper { - private: +private: enum Mode { SINGLE_TABLE, MULTIPLE_TABLE }; - public: +public: ObSubPartSchemaRetrieveHelper( TABLE_SCHEMA& table, const bool is_subpart_def = false, const bool is_subpart_template = true) : mode_(SINGLE_TABLE), @@ -192,7 +192,7 @@ class ObSubPartSchemaRetrieveHelper { static int fill_current(const uint64_t tenant_id, const bool check_deleted, const bool is_subpart_template, T& result, ObSubPartition& p, bool& is_deleted); - private: +private: const Mode mode_; int index_; bool is_subpart_def_; @@ -209,7 +209,7 @@ class ObSubPartSchemaRetrieveHelper { class VersionHisVal; class ObSchemaRetrieveUtils { - public: +public: /****************************************************************** * * for full schemas @@ -459,7 +459,7 @@ class ObSchemaRetrieveUtils { template static int retrieve_drop_tenant_infos(T& result, ObIArray& drop_tenant_infos); - private: +private: template static bool compare_table_id(const T* table_schema, const uint64_t table_id); static int retrieve_generated_column(const ObTableSchema& table_schema, ObColumnSchemaV2& column); diff --git a/src/share/schema/ob_schema_service.h b/src/share/schema/ob_schema_service.h index ab7f76d93..532fa00d2 100644 --- a/src/share/schema/ob_schema_service.h +++ b/src/share/schema/ob_schema_service.h @@ -262,7 +262,7 @@ DECLARE_ENUM(ObSchemaOperationType, op_type, OP_TYPE_DEF); struct ObSchemaOperation { OB_UNIS_VERSION_V(1); - public: +public: ObSchemaOperation(); int64_t schema_version_; uint64_t tenant_id_; @@ -343,7 +343,7 @@ struct ObSchemaOperation { struct ObPrimarySchemaInfo { OB_UNIS_VERSION_V(1); - public: +public: ObPrimarySchemaInfo(); ObPrimarySchemaInfo(const int64_t refreshed_schema_version, const int64_t next_schema_version) { @@ -366,7 +366,7 @@ struct ObPrimarySchemaInfo { }; class ObMockSchemaInfo { - public: +public: enum MockSchemaType { MOCK_INDEX_UNAVAILABLE = 0, MOCK_SCHEMA_SPLIT = 1, MOCK_MAX_TYPE }; ObMockSchemaInfo() @@ -400,7 +400,7 @@ class ObMockSchemaInfo { TO_STRING_KV(K_(schema_id), "mock_index_unavaliable", mock_schema_type_[MOCK_INDEX_UNAVAILABLE], "mock_schema_split", mock_schema_type_[MOCK_SCHEMA_SPLIT]); - private: +private: uint64_t schema_id_; bool mock_schema_type_[MOCK_MAX_TYPE]; }; @@ -408,7 +408,7 @@ class ObMockSchemaInfo { struct AlterColumnSchema : public ObColumnSchemaV2 { OB_UNIS_VERSION_V(1); - public: +public: AlterColumnSchema() : ObColumnSchemaV2(), alter_type_(OB_INVALID_DDL_OP), @@ -490,7 +490,7 @@ struct AlterColumnSchema : public ObColumnSchemaV2 { struct AlterTableSchema : public ObTableSchema { OB_UNIS_VERSION_V(1); - public: +public: AlterTableSchema() : ObTableSchema(), alter_type_(OB_INVALID_DDL_OP), @@ -637,13 +637,13 @@ class ObDbLinkSqlService; // table schema service interface layer class ObServerSchemaService; class ObSchemaService { - public: +public: // default false, only use for liboblog to control compatable static bool g_ignore_column_retrieve_error_; static bool g_liboblog_mode_; typedef common::ObArrayImpl ObSchemaOperationSet; class SchemaOperationSetWithAlloc : public ObSchemaOperationSet { - public: + public: SchemaOperationSetWithAlloc() : string_buf_(common::ObModIds::OB_SCHEMA_OPERATOR_SET_WITH_ALLOC) {} virtual ~SchemaOperationSetWithAlloc() @@ -667,7 +667,7 @@ class ObSchemaService { ptr = NULL; } - private: + private: common::ObStringBuf string_buf_; // alloc varchar }; virtual ~ObSchemaService() diff --git a/src/share/schema/ob_schema_service_rpc_proxy.h b/src/share/schema/ob_schema_service_rpc_proxy.h index 08248474b..a446b28ce 100644 --- a/src/share/schema/ob_schema_service_rpc_proxy.h +++ b/src/share/schema/ob_schema_service_rpc_proxy.h @@ -32,7 +32,7 @@ class ObMultiVersionSchemaService; } // namespace share namespace obrpc { class ObSchemaServiceRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObSchemaServiceRpcProxy); // RPC_S(PR5 get_latest_schema_version, OB_GET_LATEST_SCHEMA_VERSION, obrpc::Int64); RPC_SS(PR5 get_all_schema, OB_GET_ALL_SCHEMA, (ObGetAllSchemaArg), common::ObDataBuffer); @@ -61,7 +61,7 @@ private: struct ObAllSchema { OB_UNIS_VERSION(1); - public: +public: ObAllSchema() {} DECLARE_TO_STRING; @@ -77,21 +77,21 @@ struct ObAllSchema { }; class ObGetAllSchemaP : public ObRpcProcessor > { - public: +public: explicit ObGetAllSchemaP(share::schema::ObMultiVersionSchemaService* schema_service); virtual ~ObGetAllSchemaP(); - protected: +protected: virtual int before_process(); virtual int process(); virtual int after_process(); - private: +private: share::schema::ObMultiVersionSchemaService* schema_service_; char* buf_; int64_t buf_len_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGetAllSchemaP); }; diff --git a/src/share/schema/ob_schema_service_sql_impl.h b/src/share/schema/ob_schema_service_sql_impl.h index eaf146fe8..ce134f230 100644 --- a/src/share/schema/ob_schema_service_sql_impl.h +++ b/src/share/schema/ob_schema_service_sql_impl.h @@ -55,27 +55,30 @@ class VersionHisVal; class ObSimpleSysVariableSchema; class ObSchemaServiceSQLImpl : public ObSchemaService { - private: +private: static bool cmp_table_id(const ObTableSchema* a, const ObTableSchema* b) { return a->get_table_id() < b->get_table_id(); } - public: +public: const static int64_t MAX_IN_QUERY_PER_TIME = 100L; // FIXME@:change from 1000 to 100 for debugging const static int TENANT_MAP_BUCKET_NUM = 1024; const static int64_t MAX_BATCH_PART_NUM = 5000; ObSchemaServiceSQLImpl(); virtual ~ObSchemaServiceSQLImpl(); - virtual int init(common::ObMySQLProxy *sql_proxy, - common::ObDbLinkProxy *dblink_proxy, - const share::schema::ObServerSchemaService *schema_service) override; - virtual void set_common_config(const common::ObCommonConfig *config) override { config_ = config; } + virtual int init(common::ObMySQLProxy* sql_proxy, common::ObDbLinkProxy* dblink_proxy, + const share::schema::ObServerSchemaService* schema_service) override; + virtual void set_common_config(const common::ObCommonConfig* config) override + { + config_ = config; + } -#define GET_DDL_SQL_SERVICE_FUNC(SCHEMA_TYPE, SCHEMA) \ - Ob##SCHEMA_TYPE##SqlService &get_##SCHEMA##_sql_service() override { \ - return SCHEMA##_service_; \ +#define GET_DDL_SQL_SERVICE_FUNC(SCHEMA_TYPE, SCHEMA) \ + Ob##SCHEMA_TYPE##SqlService& get_##SCHEMA##_sql_service() override \ + { \ + return SCHEMA##_service_; \ }; GET_DDL_SQL_SERVICE_FUNC(Tenant, tenant); GET_DDL_SQL_SERVICE_FUNC(Database, database); @@ -94,67 +97,69 @@ class ObSchemaServiceSQLImpl : public ObSchemaService { /* sequence_id related */ virtual int init_sequence_id(const int64_t rootservice_epoch) override; virtual int inc_sequence_id() override; - virtual uint64_t get_sequence_id() override { return schema_info_.get_sequence_id(); }; + virtual uint64_t get_sequence_id() override + { + return schema_info_.get_sequence_id(); + }; - virtual int64_t get_last_operation_schema_version() const override { return last_operation_schema_version_; }; - virtual uint64_t get_last_operation_tenant_id() const override { return last_operation_tenant_id_; }; + virtual int64_t get_last_operation_schema_version() const override + { + return last_operation_schema_version_; + }; + virtual uint64_t get_last_operation_tenant_id() const override + { + return last_operation_tenant_id_; + }; virtual int set_last_operation_info(const uint64_t tenant_id, const int64_t schema_version) override; - virtual int get_refresh_schema_info(ObRefreshSchemaInfo &schema_info) override; - //enable refresh schema info - virtual int set_refresh_schema_info(const ObRefreshSchemaInfo &schema_info) override; + virtual int get_refresh_schema_info(ObRefreshSchemaInfo& schema_info) override; + // enable refresh schema info + virtual int set_refresh_schema_info(const ObRefreshSchemaInfo& schema_info) override; virtual bool is_sync_primary_ddl() const override { return 0 < primary_schema_versions_.count(); } // get schema of __all_core_table - virtual int get_all_core_table_schema(ObTableSchema &table_schema) override; - virtual void set_in_bootstrap(const bool is_in_bootstrap) override { is_in_bootstrap_ = is_in_bootstrap; } - virtual bool is_in_bootstrap() const override { return is_in_bootstrap_; } + virtual int get_all_core_table_schema(ObTableSchema& table_schema) override; + virtual void set_in_bootstrap(const bool is_in_bootstrap) override + { + is_in_bootstrap_ = is_in_bootstrap; + } + virtual bool is_in_bootstrap() const override + { + return is_in_bootstrap_; + } // get schemas of core tables, need get from kv table - int get_core_table_schemas(common::ObISQLClient &sql_client, - common::ObArray &core_schemas) override; + int get_core_table_schemas(common::ObISQLClient& sql_client, common::ObArray& core_schemas) override; - int get_sys_table_schemas(const common::ObIArray &table_ids, - common::ObISQLClient &sql_client, - common::ObIAllocator &allocator, - common::ObArray &sys_schemas) override; + int get_sys_table_schemas(const common::ObIArray& table_ids, common::ObISQLClient& sql_client, + common::ObIAllocator& allocator, common::ObArray& sys_schemas) override; /** * for schema fetcher */ - virtual int get_table_schema(const ObRefreshSchemaStatus &schema_status, - const uint64_t table_id, - const int64_t schema_version, - common::ObISQLClient &sql_client, - common::ObIAllocator &allocator, - ObTableSchema *&table_schema) override; + virtual int get_table_schema(const ObRefreshSchemaStatus& schema_status, const uint64_t table_id, + const int64_t schema_version, common::ObISQLClient& sql_client, common::ObIAllocator& allocator, + ObTableSchema*& table_schema) override; - virtual int get_batch_table_schema(const ObRefreshSchemaStatus &schema_status, - const int64_t schema_version, - common::ObArray &table_ids, - common::ObISQLClient &sql_client, - common::ObIAllocator &allocator, - common::ObArray &table_schema_array) override; + virtual int get_batch_table_schema(const ObRefreshSchemaStatus& schema_status, const int64_t schema_version, + common::ObArray& table_ids, common::ObISQLClient& sql_client, common::ObIAllocator& allocator, + common::ObArray& table_schema_array) override; /** * for refresh full schema */ - virtual int get_all_tenants(common::ObISQLClient &sql_client, - const int64_t schema_version, - common::ObIArray &schema_array) override; - virtual int get_sys_variable(common::ObISQLClient &client, - const ObRefreshSchemaStatus &schema_status, - const uint64_t tenant_id, - const int64_t schema_version, - ObSimpleSysVariableSchema &schema) override; - #define GET_ALL_SCHEMA_FUNC_DECLARE(SCHEMA, SCHEMA_TYPE) \ - virtual int get_all_##SCHEMA##s(common::ObISQLClient &sql_client, \ - const ObRefreshSchemaStatus &schema_status, \ - const int64_t schema_version, \ - const uint64_t tenant_id, \ - common::ObIArray &schema_array) override; + virtual int get_all_tenants(common::ObISQLClient& sql_client, const int64_t schema_version, + common::ObIArray& schema_array) override; + virtual int get_sys_variable(common::ObISQLClient& client, const ObRefreshSchemaStatus& schema_status, + const uint64_t tenant_id, const int64_t schema_version, ObSimpleSysVariableSchema& schema) override; +#define GET_ALL_SCHEMA_FUNC_DECLARE(SCHEMA, SCHEMA_TYPE) \ + virtual int get_all_##SCHEMA##s(common::ObISQLClient& sql_client, \ + const ObRefreshSchemaStatus& schema_status, \ + const int64_t schema_version, \ + const uint64_t tenant_id, \ + common::ObIArray& schema_array) override; GET_ALL_SCHEMA_FUNC_DECLARE(user, ObSimpleUserSchema); GET_ALL_SCHEMA_FUNC_DECLARE(database, ObSimpleDatabaseSchema); GET_ALL_SCHEMA_FUNC_DECLARE(tablegroup, ObSimpleTablegroupSchema); @@ -170,76 +175,58 @@ class ObSchemaServiceSQLImpl : public ObSchemaService { GET_ALL_SCHEMA_FUNC_DECLARE(obj_priv, ObObjPriv); GET_ALL_SCHEMA_FUNC_DECLARE(dblink, ObDbLinkSchema); - //get tenant increment schema operation between (base_version, new_schema_version] - virtual int get_increment_schema_operations(const ObRefreshSchemaStatus &schema_status, - const int64_t base_version, - const int64_t new_schema_version, - common::ObISQLClient &sql_client, - SchemaOperationSetWithAlloc &schema_operations) override; + // get tenant increment schema operation between (base_version, new_schema_version] + virtual int get_increment_schema_operations(const ObRefreshSchemaStatus& schema_status, const int64_t base_version, + const int64_t new_schema_version, common::ObISQLClient& sql_client, + SchemaOperationSetWithAlloc& schema_operations) override; - //get tenant increment schema operation (base_version, ] with limit, for rs used only - virtual int get_increment_schema_operations( - const ObRefreshSchemaStatus &schema_status, - const int64_t base_version, - common::ObISQLClient &sql_client, - SchemaOperationSetWithAlloc &schema_operations) override; + // get tenant increment schema operation (base_version, ] with limit, for rs used only + virtual int get_increment_schema_operations(const ObRefreshSchemaStatus& schema_status, const int64_t base_version, + common::ObISQLClient& sql_client, SchemaOperationSetWithAlloc& schema_operations) override; - virtual int check_sys_schema_change(common::ObISQLClient &sql_client, - const common::ObIArray &sys_table_ids, - const int64_t schema_version, - const int64_t new_schema_version, - bool &sys_schema_change) override; + virtual int check_sys_schema_change(common::ObISQLClient& sql_client, const common::ObIArray& sys_table_ids, + const int64_t schema_version, const int64_t new_schema_version, bool& sys_schema_change) override; - virtual int get_tenant_schema(const int64_t schema_version, - common::ObISQLClient &client, - const uint64_t tenant_id, - ObTenantSchema &tenant_schema) override; + virtual int get_tenant_schema(const int64_t schema_version, common::ObISQLClient& client, const uint64_t tenant_id, + ObTenantSchema& tenant_schema) override; - //get table schema of a single table - virtual int get_table_schema_from_inner_table(const ObRefreshSchemaStatus &schema_status, - const uint64_t table_id, - common::ObISQLClient &sql_client, - ObTableSchema &table_schema) override; + // get table schema of a single table + virtual int get_table_schema_from_inner_table(const ObRefreshSchemaStatus& schema_status, const uint64_t table_id, + common::ObISQLClient& sql_client, ObTableSchema& table_schema) override; + virtual int fetch_new_tenant_id(uint64_t& new_tenant_id) override; + virtual int fetch_new_table_id(const uint64_t tenant_id, uint64_t& new_table_id) override; + virtual int fetch_new_database_id(const uint64_t tenant_id, uint64_t& new_database_id) override; + virtual int fetch_new_tablegroup_id(const uint64_t tenant_id, uint64_t& new_tablegroup_id) override; + virtual int fetch_new_user_id(const uint64_t tenant_id, uint64_t& new_user_id) override; + virtual int fetch_new_outline_id(const uint64_t tenant_id, uint64_t& new_outline_id) override; + virtual int fetch_new_synonym_id(const uint64_t tenant_id, uint64_t& new_synonym_id) override; + virtual int fetch_new_udf_id(const uint64_t tenant_id, uint64_t& new_udf_id) override; + virtual int fetch_new_constraint_id(const uint64_t tenant_id, uint64_t& new_constraint_id) override; + virtual int fetch_new_sequence_id(const uint64_t tenant_id, uint64_t& new_sequence_id) override; + virtual int fetch_new_dblink_id(const uint64_t tenant_id, uint64_t& new_dblink_id) override; - virtual int fetch_new_tenant_id(uint64_t &new_tenant_id) override; - virtual int fetch_new_table_id(const uint64_t tenant_id, uint64_t &new_table_id) override; - virtual int fetch_new_database_id(const uint64_t tenant_id, uint64_t &new_database_id) override; - virtual int fetch_new_tablegroup_id(const uint64_t tenant_id, uint64_t &new_tablegroup_id) override; - virtual int fetch_new_user_id(const uint64_t tenant_id, uint64_t &new_user_id) override; - virtual int fetch_new_outline_id(const uint64_t tenant_id, uint64_t &new_outline_id) override; - virtual int fetch_new_synonym_id(const uint64_t tenant_id, uint64_t &new_synonym_id) override; - virtual int fetch_new_udf_id(const uint64_t tenant_id, uint64_t &new_udf_id) override; - virtual int fetch_new_constraint_id(const uint64_t tenant_id, uint64_t &new_constraint_id) override; - virtual int fetch_new_sequence_id(const uint64_t tenant_id, uint64_t &new_sequence_id) override; - virtual int fetch_new_dblink_id(const uint64_t tenant_id, uint64_t &new_dblink_id) override; + virtual int fetch_new_profile_id(const uint64_t tenant_id, uint64_t& new_profile_id) override; - virtual int fetch_new_profile_id(const uint64_t tenant_id, uint64_t &new_profile_id) override; - -// virtual int insert_sys_param(const ObSysParam &sys_param, -// common::ObISQLClient *sql_client); + // virtual int insert_sys_param(const ObSysParam &sys_param, + // common::ObISQLClient *sql_client); virtual int delete_partition_table(const uint64_t partition_table_id, const uint64_t tenant_id, - const int64_t partition_idx, common::ObISQLClient &sql_client) override; + const int64_t partition_idx, common::ObISQLClient& sql_client) override; - virtual int get_tablegroup_schema(const ObRefreshSchemaStatus &schema_status, - const uint64_t tablegroup_id, - const int64_t schema_version, - common::ObISQLClient &sql_client, - common::ObIAllocator &allocator, - ObTablegroupSchema *&tablegroup_schema) override; + virtual int get_tablegroup_schema(const ObRefreshSchemaStatus& schema_status, const uint64_t tablegroup_id, + const int64_t schema_version, common::ObISQLClient& sql_client, common::ObIAllocator& allocator, + ObTablegroupSchema*& tablegroup_schema) override; - virtual int get_batch_tenants(common::ObISQLClient &client, - const int64_t schema_version, - common::ObArray &schema_keys, - common::ObIArray &schema_array) override; + virtual int get_batch_tenants(common::ObISQLClient& client, const int64_t schema_version, + common::ObArray& schema_keys, common::ObIArray& schema_array) override; -#define GET_BATCH_SCHEMAS_FUNC_DECLARE(SCHEMA, SCHEMA_TYPE) \ - virtual int get_batch_##SCHEMA##s(const ObRefreshSchemaStatus &schema_status,\ - common::ObISQLClient &client, \ - const int64_t schema_version, \ - common::ObArray &schema_keys, \ - common::ObIArray &schema_array) override; +#define GET_BATCH_SCHEMAS_FUNC_DECLARE(SCHEMA, SCHEMA_TYPE) \ + virtual int get_batch_##SCHEMA##s(const ObRefreshSchemaStatus& schema_status, \ + common::ObISQLClient& client, \ + const int64_t schema_version, \ + common::ObArray& schema_keys, \ + common::ObIArray& schema_array) override; GET_BATCH_SCHEMAS_FUNC_DECLARE(user, ObSimpleUserSchema); GET_BATCH_SCHEMAS_FUNC_DECLARE(database, ObSimpleDatabaseSchema); GET_BATCH_SCHEMAS_FUNC_DECLARE(tablegroup, ObSimpleTablegroupSchema); @@ -274,25 +261,21 @@ class ObSchemaServiceSQLImpl : public ObSchemaService { GET_BATCH_FULL_SCHEMA_FUNC_DECLARE(sequence, ObSequenceSchema); GET_BATCH_FULL_SCHEMA_FUNC_DECLARE(profile, ObProfileSchema); - virtual int get_batch_users(const ObRefreshSchemaStatus &schema_status, - const int64_t schema_version, - common::ObArray &tenant_user_ids, - common::ObISQLClient &sql_client, - common::ObArray &user_info_array) override; + virtual int get_batch_users(const ObRefreshSchemaStatus& schema_status, const int64_t schema_version, + common::ObArray& tenant_user_ids, common::ObISQLClient& sql_client, + common::ObArray& user_info_array) override; - virtual int get_batch_tenants(common::ObISQLClient &client, - const int64_t schema_version, - common::ObArray &tenant_ids, - common::ObIArray &schema_array) override; + virtual int get_batch_tenants(common::ObISQLClient& client, const int64_t schema_version, + common::ObArray& tenant_ids, common::ObIArray& schema_array) override; #define FETCH_SCHEMAS_FUNC_DECLARE(SCHEMA, SCHEMA_TYPE) \ - int fetch_##SCHEMA##s(common::ObISQLClient &client, \ - const ObRefreshSchemaStatus &schema_status,\ - const int64_t schema_version, \ - const uint64_t tenant_id, \ - common::ObIArray &schema_array, \ - const SchemaKey *schema_keys = NULL, \ - const int64_t schema_key_size = 0); + int fetch_##SCHEMA##s(common::ObISQLClient& client, \ + const ObRefreshSchemaStatus& schema_status, \ + const int64_t schema_version, \ + const uint64_t tenant_id, \ + common::ObIArray& schema_array, \ + const SchemaKey* schema_keys = NULL, \ + const int64_t schema_key_size = 0); FETCH_SCHEMAS_FUNC_DECLARE(user, ObSimpleUserSchema); FETCH_SCHEMAS_FUNC_DECLARE(database, ObSimpleDatabaseSchema); FETCH_SCHEMAS_FUNC_DECLARE(tablegroup, ObSimpleTablegroupSchema); @@ -338,161 +321,98 @@ class ObSchemaServiceSQLImpl : public ObSchemaService { const uint64_t tenant_id, common::ObISQLClient& sql_client, common::ObArray& user_array, const uint64_t* user_keys = NULL, const int64_t users_size = 0); - int fetch_role_grantee_map_info( - const ObRefreshSchemaStatus &schema_status, - const int64_t schema_version, - const uint64_t tenant_id, - ObISQLClient &sql_client, - ObArray &user_array, - const bool is_fetch_role, - const uint64_t *user_keys /* = NULL */, - const int64_t users_size /* = 0 */); + int fetch_role_grantee_map_info(const ObRefreshSchemaStatus& schema_status, const int64_t schema_version, + const uint64_t tenant_id, ObISQLClient& sql_client, ObArray& user_array, const bool is_fetch_role, + const uint64_t* user_keys /* = NULL */, const int64_t users_size /* = 0 */); - virtual int get_core_version(common::ObISQLClient &sql_client, - const int64_t frozen_version, - int64_t &core_schema_version) override; - virtual int get_baseline_schema_version(common::ObISQLClient &sql_client, - const int64_t frozen_version, - int64_t &baseline_schema_version) override; + virtual int get_core_version( + common::ObISQLClient& sql_client, const int64_t frozen_version, int64_t& core_schema_version) override; + virtual int get_baseline_schema_version( + common::ObISQLClient& sql_client, const int64_t frozen_version, int64_t& baseline_schema_version) override; - virtual int fetch_schema_version(const ObRefreshSchemaStatus &schema_status, - common::ObISQLClient &sql_client, - int64_t &schema_version) override; + virtual int fetch_schema_version( + const ObRefreshSchemaStatus& schema_status, common::ObISQLClient& sql_client, int64_t& schema_version) override; virtual void set_refreshed_schema_version(const int64_t schema_version) override; - virtual int gen_new_schema_version(const uint64_t tenant_id, - const int64_t refreshed_schema_version, - int64_t &schema_version) override; + virtual int gen_new_schema_version( + const uint64_t tenant_id, const int64_t refreshed_schema_version, int64_t& schema_version) override; - virtual int get_new_schema_version(uint64_t tenant_id, int64_t &schema_version) override; + virtual int get_new_schema_version(uint64_t tenant_id, int64_t& schema_version) override; - virtual int get_ori_schema_version(const ObRefreshSchemaStatus &schema_status, const uint64_t tenant_id, const uint64_t table_id, int64_t &last_schema_version) override; + virtual int get_ori_schema_version(const ObRefreshSchemaStatus& schema_status, const uint64_t tenant_id, + const uint64_t table_id, int64_t& last_schema_version) override; /** * for recycle bin */ - virtual int insert_recyclebin_object( - const ObRecycleObject &recycle_obj, - common::ObISQLClient &sql_client) override; + virtual int insert_recyclebin_object(const ObRecycleObject& recycle_obj, common::ObISQLClient& sql_client) override; - virtual int fetch_recycle_object( - const uint64_t tenant_id, - const common::ObString &object_name, - const ObRecycleObject::RecycleObjType recycle_obj_type, - common::ObISQLClient &sql_client, - common::ObIArray &recycle_objs) override; + virtual int fetch_recycle_object(const uint64_t tenant_id, const common::ObString& object_name, + const ObRecycleObject::RecycleObjType recycle_obj_type, common::ObISQLClient& sql_client, + common::ObIArray& recycle_objs) override; virtual int delete_recycle_object( - const uint64_t tenant_id, - const ObRecycleObject &recycle_object, - common::ObISQLClient &sql_client) override; + const uint64_t tenant_id, const ObRecycleObject& recycle_object, common::ObISQLClient& sql_client) override; - virtual int fetch_expire_recycle_objects( - const uint64_t tenant_id, - const int64_t expire_time, - common::ObISQLClient &sql_client, - common::ObIArray &recycle_objs) override; + virtual int fetch_expire_recycle_objects(const uint64_t tenant_id, const int64_t expire_time, + common::ObISQLClient& sql_client, common::ObIArray& recycle_objs) override; - virtual int fetch_recycle_objects_of_db( - const uint64_t tenant_id, - const uint64_t database_id, - common::ObISQLClient &sql_client, - common::ObIArray &recycle_objs) override; + virtual int fetch_recycle_objects_of_db(const uint64_t tenant_id, const uint64_t database_id, + common::ObISQLClient& sql_client, common::ObIArray& recycle_objs) override; - virtual int query_table_status(const ObRefreshSchemaStatus &schema_status, - common::ObISQLClient &sql_client, - const int64_t schema_version, - const uint64_t tenant_id, - const uint64_t table_id, - const bool is_pg, - TableStatus &table_status) override; + virtual int query_table_status(const ObRefreshSchemaStatus& schema_status, common::ObISQLClient& sql_client, + const int64_t schema_version, const uint64_t tenant_id, const uint64_t table_id, const bool is_pg, + TableStatus& table_status) override; // for backup virtual int construct_recycle_table_object( - common::ObISQLClient &sql_client, - const ObSimpleTableSchemaV2 &table, - ObRecycleObject &recycle_object) override; + common::ObISQLClient& sql_client, const ObSimpleTableSchemaV2& table, ObRecycleObject& recycle_object) override; virtual int construct_recycle_database_object( - common::ObISQLClient &sql_client, - const ObDatabaseSchema &database, - ObRecycleObject &recycle_object) override; + common::ObISQLClient& sql_client, const ObDatabaseSchema& database, ObRecycleObject& recycle_object) override; // for liboblog - virtual int query_partition_status_from_sys_table( - const ObRefreshSchemaStatus &schema_status, - common::ObISQLClient &sql_client, - const int64_t schema_version, - const common::ObPartitionKey &pkey, - const bool is_sub_part_template, - PartitionStatus &table_status) override; - virtual int fetch_aux_tables(const ObRefreshSchemaStatus &schema_status, - const uint64_t tenant_id, - const uint64_t table_id, - const int64_t schema_version, - common::ObISQLClient &sql_client, - common::ObIArray &aux_tables) override; + virtual int query_partition_status_from_sys_table(const ObRefreshSchemaStatus& schema_status, + common::ObISQLClient& sql_client, const int64_t schema_version, const common::ObPartitionKey& pkey, + const bool is_sub_part_template, PartitionStatus& table_status) override; + virtual int fetch_aux_tables(const ObRefreshSchemaStatus& schema_status, const uint64_t tenant_id, + const uint64_t table_id, const int64_t schema_version, common::ObISQLClient& sql_client, + common::ObIArray& aux_tables) override; // link table. - virtual int get_link_table_schema(const ObDbLinkSchema &dblink_schema, - const common::ObString &database_name, - const common::ObString &table_name, - common::ObIAllocator &allocator, - ObTableSchema *&table_schema) override; + virtual int get_link_table_schema(const ObDbLinkSchema& dblink_schema, const common::ObString& database_name, + const common::ObString& table_name, common::ObIAllocator& allocator, ObTableSchema*& table_schema) override; static int check_ddl_id_exist( - common::ObISQLClient &sql_client, - const uint64_t tenant_id, - const common::ObString &ddl_id_str, - bool &is_exists); - virtual int construct_schema_version_history( - const ObRefreshSchemaStatus &schema_status, - common::ObISQLClient &sql_client, - const int64_t snapshot_version, - const VersionHisKey &version_his_key, - VersionHisVal &version_his_val) override; + common::ObISQLClient& sql_client, const uint64_t tenant_id, const common::ObString& ddl_id_str, bool& is_exists); + virtual int construct_schema_version_history(const ObRefreshSchemaStatus& schema_status, + common::ObISQLClient& sql_client, const int64_t snapshot_version, const VersionHisKey& version_his_key, + VersionHisVal& version_his_val) override; - static int fetch_tenant_compat_mode(common::ObISQLClient &sql_client, - const uint64_t tenant_id, - common::ObCompatibilityMode &mode); - static int sort_partition_array(ObPartitionSchema &partition_schema); - static int sort_subpartition_array(ObPartitionSchema &partition_schema); + static int fetch_tenant_compat_mode( + common::ObISQLClient& sql_client, const uint64_t tenant_id, common::ObCompatibilityMode& mode); + static int sort_partition_array(ObPartitionSchema& partition_schema); + static int sort_subpartition_array(ObPartitionSchema& partition_schema); static int gen_bootstrap_schema_version(const int64_t tenant_id, const int64_t refreshed_schema_version, - int64_t &gen_schema_version, int64_t &schema_version); - virtual int get_mock_schema_infos( - common::ObISQLClient &sql_client, - common::ObIArray &tenant_ids, - common::hash::ObHashMap &new_mock_schema_infos) override; + int64_t& gen_schema_version, int64_t& schema_version); + virtual int get_mock_schema_infos(common::ObISQLClient& sql_client, common::ObIArray& tenant_ids, + common::hash::ObHashMap& new_mock_schema_infos) override; - virtual int get_drop_tenant_infos( - common::ObISQLClient &sql_client, - int64_t schema_version, - common::ObIArray &drop_tenant_infos) override; + virtual int get_drop_tenant_infos(common::ObISQLClient& sql_client, int64_t schema_version, + common::ObIArray& drop_tenant_infos) override; virtual int query_tenant_status( - common::ObISQLClient &sql_client, - const uint64_t tenant_id, - TenantStatus &tenant_status) override; - virtual int get_schema_version_by_timestamp( - common::ObISQLClient &sql_client, - const ObRefreshSchemaStatus &schema_status, - const uint64_t tenant_id, - int64_t timestamp, - int64_t &schema_version) override; + common::ObISQLClient& sql_client, const uint64_t tenant_id, TenantStatus& tenant_status) override; + virtual int get_schema_version_by_timestamp(common::ObISQLClient& sql_client, + const ObRefreshSchemaStatus& schema_status, const uint64_t tenant_id, int64_t timestamp, + int64_t& schema_version) override; virtual int get_first_trans_end_schema_version( - common::ObISQLClient &sql_client, - const uint64_t tenant_id, - int64_t &schema_version) override; - virtual int load_split_schema_version( - common::ObISQLClient &sql_client, - int64_t &split_schema_version) override; - virtual int get_split_schema_version_v2( - common::ObISQLClient &sql_client, - const ObRefreshSchemaStatus &schema_status, - const uint64_t tenant_id, - int64_t &split_schema_version) override; + common::ObISQLClient& sql_client, const uint64_t tenant_id, int64_t& schema_version) override; + virtual int load_split_schema_version(common::ObISQLClient& sql_client, int64_t& split_schema_version) override; + virtual int get_split_schema_version_v2(common::ObISQLClient& sql_client, const ObRefreshSchemaStatus& schema_status, + const uint64_t tenant_id, int64_t& split_schema_version) override; -private: +private: bool check_inner_stat(); int fetch_new_schema_id(const uint64_t tenant_id, const share::ObMaxIdType max_id_type, uint64_t& new_schema_id); @@ -505,72 +425,42 @@ private: common::ObArray& not_core_schemas); template - int fetch_all_table_info(const ObRefreshSchemaStatus &schema_status, - const int64_t schema_version, - uint64_t tenant_id, - common::ObISQLClient &sql_client, - common::ObIAllocator &allocator, - common::ObIArray &table_schema_array, - const uint64_t *table_ids = NULL, - const int64_t table_ids_size = 0); - int fetch_all_column_info(const ObRefreshSchemaStatus &schema_status, - const int64_t schema_version, - const uint64_t tenant_id, - common::ObISQLClient &sql_client, - common::ObArray &table_schema_array, - const uint64_t *table_ids = NULL, - const int64_t table_ids_size = 0); - int fetch_all_constraint_info_ignore_inner_table(const ObRefreshSchemaStatus &schema_status, - const int64_t schema_version, - const uint64_t tenant_id, - common::ObISQLClient &sql_client, - common::ObArray &table_schema_array, - const uint64_t *table_ids = NULL, - const int64_t table_ids_size = 0); - int fetch_all_constraint_info(const ObRefreshSchemaStatus &schema_status, - const int64_t schema_version, - const uint64_t tenant_id, - common::ObISQLClient &sql_client, - common::ObArray &table_schema_array, - const uint64_t *table_ids = NULL, - const int64_t table_ids_size = 0); + int fetch_all_table_info(const ObRefreshSchemaStatus& schema_status, const int64_t schema_version, uint64_t tenant_id, + common::ObISQLClient& sql_client, common::ObIAllocator& allocator, common::ObIArray& table_schema_array, + const uint64_t* table_ids = NULL, const int64_t table_ids_size = 0); + int fetch_all_column_info(const ObRefreshSchemaStatus& schema_status, const int64_t schema_version, + const uint64_t tenant_id, common::ObISQLClient& sql_client, common::ObArray& table_schema_array, + const uint64_t* table_ids = NULL, const int64_t table_ids_size = 0); + int fetch_all_constraint_info_ignore_inner_table(const ObRefreshSchemaStatus& schema_status, + const int64_t schema_version, const uint64_t tenant_id, common::ObISQLClient& sql_client, + common::ObArray& table_schema_array, const uint64_t* table_ids = NULL, + const int64_t table_ids_size = 0); + int fetch_all_constraint_info(const ObRefreshSchemaStatus& schema_status, const int64_t schema_version, + const uint64_t tenant_id, common::ObISQLClient& sql_client, common::ObArray& table_schema_array, + const uint64_t* table_ids = NULL, const int64_t table_ids_size = 0); - template - int gen_batch_fetch_array( - common::ObArray &table_schema_array, - const uint64_t *table_ids /* = NULL */, - const int64_t table_ids_size /*= 0 */, - common::ObIArray &part_tables, - common::ObIArray &def_subpart_tables, - common::ObIArray &subpart_tables, - common::ObIArray &part_idxs, - common::ObIArray &def_subpart_idxs, - common::ObIArray &subpart_idxs); + template + int gen_batch_fetch_array(common::ObArray& table_schema_array, const uint64_t* table_ids /* = NULL */, + const int64_t table_ids_size /*= 0 */, common::ObIArray& part_tables, + common::ObIArray& def_subpart_tables, common::ObIArray& subpart_tables, + common::ObIArray& part_idxs, common::ObIArray& def_subpart_idxs, + common::ObIArray& subpart_idxs); - template - int fetch_all_partition_info(const ObRefreshSchemaStatus &schema_status, - const int64_t schema_version, - const uint64_t tenant_id, - common::ObISQLClient &sql_client, - common::ObArray &table_schema_array, - const uint64_t *table_ids /* = NULL */, - const int64_t table_ids_size /*= 0 */); + template + int fetch_all_partition_info(const ObRefreshSchemaStatus& schema_status, const int64_t schema_version, + const uint64_t tenant_id, common::ObISQLClient& sql_client, common::ObArray& table_schema_array, + const uint64_t* table_ids /* = NULL */, const int64_t table_ids_size /*= 0 */); - int fetch_all_tenant_info(const int64_t schema_version, - common::ObISQLClient &client, - common::ObIArray &tenant_schema_array, - const uint64_t *tenant_ids = NULL, - const int64_t tenant_ids_size = 0); + int fetch_all_tenant_info(const int64_t schema_version, common::ObISQLClient& client, + common::ObIArray& tenant_schema_array, const uint64_t* tenant_ids = NULL, + const int64_t tenant_ids_size = 0); - int get_sys_variable_schema( - common::ObISQLClient &sql_client, - const ObRefreshSchemaStatus &schema_status, - const uint64_t tenant_id, - const int64_t schema_version, - share::schema::ObSysVariableSchema &sys_variable_schema) override; + int get_sys_variable_schema(common::ObISQLClient& sql_client, const ObRefreshSchemaStatus& schema_status, + const uint64_t tenant_id, const int64_t schema_version, + share::schema::ObSysVariableSchema& sys_variable_schema) override; - template - int retrieve_schema_version(T &result, int64_t &schema_version); + template + int retrieve_schema_version(T& result, int64_t& schema_version); // retrieve core table and sys table don't read history table, set check_deleted to false // to filter is_deleted column @@ -690,7 +580,7 @@ private: int gen_leader_normal_schema_version( const uint64_t tenant_id, const int64_t refreshed_schema_version, int64_t& schema_version); - private: +private: common::ObMySQLProxy* mysql_proxy_; common::ObDbLinkProxy* dblink_proxy_; lib::ObMutex mutex_; @@ -742,7 +632,7 @@ private: common::hash::ObHashMap gen_schema_version_map_; const ObServerSchemaService* schema_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSchemaServiceSQLImpl); }; diff --git a/src/share/schema/ob_schema_store.h b/src/share/schema/ob_schema_store.h index f5894401a..787e1f452 100644 --- a/src/share/schema/ob_schema_store.h +++ b/src/share/schema/ob_schema_store.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace share { namespace schema { class ObSchemaStore { - public: +public: static const int64_t MAX_VERSION_COUNT = 64; static const int64_t MAX_VERSION_COUNT_FOR_LIBOBLOG = 6; ObSchemaStore() : tenant_id_(0), refreshed_version_(0), received_version_(0), checked_sys_version_(0) @@ -53,7 +53,7 @@ class ObSchemaStore { }; class ObSchemaStoreMap { - public: +public: const static int TENANT_MAP_BUCKET_NUM = 1024; ObSchemaStoreMap() {} @@ -67,7 +67,7 @@ class ObSchemaStoreMap { const ObSchemaStore* get(uint64_t tenant_id) const; ObSchemaStore* get(uint64_t tenant_id); - private: +private: common::ObLinkArray map_; }; diff --git a/src/share/schema/ob_schema_struct.h b/src/share/schema/ob_schema_struct.h index 82411a61d..f4b4bb92a 100644 --- a/src/share/schema/ob_schema_struct.h +++ b/src/share/schema/ob_schema_struct.h @@ -255,7 +255,7 @@ enum ObAlterColumnMode { }; struct ObRefreshSchemaStatus { - public: +public: ObRefreshSchemaStatus() : tenant_id_(common::OB_INVALID_TENANT_ID), snapshot_timestamp_(common::OB_INVALID_TIMESTAMP), @@ -294,7 +294,7 @@ struct ObRefreshSchemaStatus { TO_STRING_KV(K_(tenant_id), K_(snapshot_timestamp), K_(readable_schema_version), K_(created_schema_version)); - public: +public: // tenant_id_ is OB_INVALID_TENANT_ID which means non-split mode, effectively means split mode uint64_t tenant_id_; // snapshot_timestamp_ > 0 Indicates that a weakly consistent read is required, and is used in standalone cluster mode @@ -306,7 +306,7 @@ struct ObRefreshSchemaStatus { struct ObRefreshSchemaInfo { OB_UNIS_VERSION(1); - public: +public: ObRefreshSchemaInfo() : schema_version_(common::OB_INVALID_VERSION), tenant_id_(common::OB_INVALID_TENANT_ID), @@ -353,7 +353,7 @@ struct ObRefreshSchemaInfo { } TO_STRING_KV(K_(schema_version), K_(tenant_id), K_(sequence_id), K_(split_schema_version)); - private: +private: int64_t schema_version_; uint64_t tenant_id_; uint64_t sequence_id_; @@ -361,7 +361,7 @@ struct ObRefreshSchemaInfo { }; class ObDropTenantInfo { - public: +public: ObDropTenantInfo() : tenant_id_(common::OB_INVALID_TENANT_ID), schema_version_(common::OB_INVALID_VERSION) {} virtual ~ObDropTenantInfo(){}; @@ -385,7 +385,7 @@ class ObDropTenantInfo { } TO_STRING_KV(K_(tenant_id), K_(schema_version)); - private: +private: uint64_t tenant_id_; int64_t schema_version_; }; @@ -611,35 +611,35 @@ struct ObSchemaStatisticsInfo { class ObPartition; class PartIdPartitionArrayCmp { - public: +public: PartIdPartitionArrayCmp() : ret_(common::OB_SUCCESS) {} bool operator()(const share::schema::ObPartition* left, const share::schema::ObPartition* right); - public: +public: int get_ret() const { return ret_; } - private: +private: int ret_; }; class ObSubPartition; class SubPartIdPartitionArrayCmp { - public: +public: SubPartIdPartitionArrayCmp() : ret_(common::OB_SUCCESS) {} bool operator()(const share::schema::ObSubPartition* left, const share::schema::ObSubPartition* right); - public: +public: int get_ret() const { return ret_; } - private: +private: int ret_; }; @@ -1021,7 +1021,7 @@ typedef common::ObIArray ZoneLocalityIArray; typedef common::ObArrayHelper ZoneLocalityArray; class ObCompareNameWithTenantID { - public: +public: ObCompareNameWithTenantID() : tenant_id_(common::OB_INVALID_ID), name_case_mode_(common::OB_NAME_CASE_INVALID), @@ -1040,14 +1040,14 @@ class ObCompareNameWithTenantID { {} int compare(const common::ObString& str1, const common::ObString& str2); - private: +private: uint64_t tenant_id_; common::ObNameCaseMode name_case_mode_; uint64_t database_id_; }; class ObSchema { - public: +public: friend class ObLocality; friend class ObPrimaryZone; ObSchema(); @@ -1093,7 +1093,7 @@ class ObSchema { return error_ret_; } - protected: +protected: static const int64_t STRING_ARRAY_EXTEND_CNT = 7; void* alloc(const int64_t size); void free(void* ptr); @@ -1156,7 +1156,7 @@ int ObSchema::set_charset_and_collation_options( class ObLocality { OB_UNIS_VERSION(1); - public: +public: explicit ObLocality(ObSchema* schema) : schema_(schema) {} int assign(const ObLocality& other); @@ -1174,7 +1174,7 @@ class ObLocality { void reset(); TO_STRING_KV(K_(locality_str), K_(zone_replica_attr_array)); - public: +public: common::ObString locality_str_; ZoneLocalityArray zone_replica_attr_array_; ObSchema* schema_; @@ -1183,7 +1183,7 @@ class ObLocality { class ObPrimaryZone { OB_UNIS_VERSION(1); - public: +public: explicit ObPrimaryZone(ObSchema* schema) : schema_(schema) {} int assign(const ObPrimaryZone& other); @@ -1201,7 +1201,7 @@ class ObPrimaryZone { void reset(); TO_STRING_KV(K_(primary_zone_str), K_(primary_zone_array)); - public: +public: common::ObString primary_zone_str_; common::ObSEArray primary_zone_array_; ObSchema* schema_; @@ -1210,7 +1210,7 @@ class ObPrimaryZone { class ObSysVarSchema : public ObSchema { OB_UNIS_VERSION(1); - public: +public: ObSysVarSchema() : ObSchema() { reset(); @@ -1346,7 +1346,7 @@ class ObSysVarSchema : public ObSchema { TO_STRING_KV(K_(tenant_id), K_(name), K_(data_type), K_(value), K_(min_val), K_(max_val), K_(info), K_(zone), K_(schema_version), K_(flags)); - private: +private: uint64_t tenant_id_; common::ObString name_; common::ObObjType data_type_; @@ -1362,7 +1362,7 @@ class ObSysVarSchema : public ObSchema { class ObSysVariableSchema : public ObSchema { OB_UNIS_VERSION(1); - public: +public: // base methods ObSysVariableSchema(); explicit ObSysVariableSchema(common::ObIAllocator* allocator); @@ -1423,7 +1423,7 @@ class ObSysVariableSchema : public ObSchema { common::ObArrayWrap(sysvar_array_, ObSysVarFactory::ALL_SYS_VARS_COUNT), K_(read_only), K_(name_case_mode)); - private: +private: uint64_t tenant_id_; int64_t schema_version_; ObSysVarSchema* sysvar_array_[ObSysVarFactory::ALL_SYS_VARS_COUNT]; @@ -1446,7 +1446,7 @@ int get_tenant_status(const common::ObString& str, ObTenantStatus& status); class ObTenantSchema : public ObSchema { OB_UNIS_VERSION(1); - public: +public: // base methods ObTenantSchema(); explicit ObTenantSchema(common::ObIAllocator* allocator); @@ -1724,7 +1724,7 @@ class ObTenantSchema : public ObSchema { K_(default_tablegroup_id), K_(default_tablegroup_name), K_(compatibility_mode), K_(drop_tenant_time), K_(status), K_(in_recyclebin)); - private: +private: int add_sysvar_schema(const share::schema::ObSysVarSchema& sysvar_schema); int64_t get_sysvar_count() const { @@ -1732,7 +1732,7 @@ class ObTenantSchema : public ObSchema { } const ObSysVarSchema* get_sysvar_schema(int64_t idx) const; - private: +private: uint64_t tenant_id_; int64_t schema_version_; common::ObString tenant_name_; @@ -1792,7 +1792,7 @@ inline void ObTenantSchema::set_storage_format_work_version(const int64_t storag class ObDatabaseSchema : public ObSchema { OB_UNIS_VERSION(1); - public: +public: // base methods ObDatabaseSchema(); explicit ObDatabaseSchema(common::ObIAllocator* allocator); @@ -1977,7 +1977,7 @@ class ObDatabaseSchema : public ObSchema { K_(default_tablegroup_id), K_(default_tablegroup_name), K_(in_recyclebin), K_(primary_zone_array), K_(drop_schema_version)); - private: +private: uint64_t tenant_id_; uint64_t database_id_; int64_t schema_version_; @@ -2017,7 +2017,7 @@ inline int ObDatabaseSchema::add_zone(const common::ObString& zone) class ObPartitionOption : public ObSchema { OB_UNIS_VERSION(1); - public: +public: ObPartitionOption(); explicit ObPartitionOption(common::ObIAllocator* allocator); virtual ~ObPartitionOption(); @@ -2143,7 +2143,7 @@ class ObPartitionOption : public ObSchema { TO_STRING_KV(K_(part_func_type), K_(part_func_expr), K_(part_num), K_(partition_cnt_within_partition_table), K_(max_used_part_id), K_(auto_part), K_(auto_part_size)); - private: +private: ObPartitionFuncType part_func_type_; common::ObString part_func_expr_; int64_t part_num_; @@ -2160,7 +2160,7 @@ class ObPartitionOption : public ObSchema { // For any questions about the role of this structure, please contact @jiage class ObSchemaAllocator : public common::ObIAllocator { - public: +public: ObSchemaAllocator() : allocator_(NULL) {} ObSchemaAllocator(common::ObIAllocator& allocator) : allocator_(&allocator) @@ -2182,7 +2182,7 @@ class ObSchemaAllocator : public common::ObIAllocator { virtual ~ObSchemaAllocator(){}; - private: +private: common::ObIAllocator* allocator_; }; @@ -2191,11 +2191,11 @@ class ObSchemaAllocator : public common::ObIAllocator { // This level is added. Indicates that the partition level is considered. // Then it is to modify the subpartition of a single primary partition without affecting other things struct InnerPartListVectorCmp { - public: +public: InnerPartListVectorCmp() : ret_(common::OB_SUCCESS) {} - public: +public: bool operator()(const common::ObNewRow& left, const common::ObNewRow& right) { bool bool_ret = false; @@ -2214,7 +2214,7 @@ struct InnerPartListVectorCmp { return ret_; } - private: +private: int ret_; }; @@ -2222,7 +2222,7 @@ class ObPartitionUtils; struct ObBasePartition : public ObSchema { OB_UNIS_VERSION(1); - public: +public: friend class ObPartitionUtils; friend class sql::ObPartitionExecutorUtils; ObBasePartition(); @@ -2353,7 +2353,7 @@ struct ObBasePartition : public ObSchema { return is_empty_partition_name_; } - protected: +protected: uint64_t tenant_id_; uint64_t table_id_; int64_t part_id_; @@ -2386,7 +2386,7 @@ struct ObBasePartition : public ObSchema { struct ObPartition : public ObBasePartition { OB_UNIS_VERSION(1); - public: +public: ObPartition(); explicit ObPartition(common::ObIAllocator* allocator); int assign(const ObPartition& src_part); @@ -2483,14 +2483,14 @@ struct ObPartition : public ObBasePartition { common::ObArrayWrap(dropped_subpartition_array_, dropped_subpartition_num_), K_(dropped_subpartition_array_capacity)); - private: +private: int inner_add_partition( const ObSubPartition& part, ObSubPartition**& part_array, int64_t& part_array_capacity, int64_t& part_num); - protected: +protected: static const int64_t DEFAULT_ARRAY_CAPACITY = 128; - private: +private: // The 14x branch gz_commmon cluster once supported ob_admin to increase the function of subpartition // However, this function does not modify sub_part_num, so it is not assumed that the sub_part_num column value // of __all_part_history of the templated subpartition table is correct, which is corrected when the schema is @@ -2520,11 +2520,11 @@ struct ObPartition : public ObBasePartition { struct ObSubPartition : public ObBasePartition { OB_UNIS_VERSION(1); - public: +public: // For template, because it does not belong to any part, we set part_id to -1 static const int64_t TEMPLATE_PART_ID = -1; - public: +public: ObSubPartition(); explicit ObSubPartition(common::ObIAllocator* allocator); int assign(const ObSubPartition& src_part); @@ -2580,7 +2580,7 @@ struct ObSubPartition : public ObBasePartition { INHERIT_TO_STRING_KV("BasePartition", ObBasePartition, K_(subpart_id), K_(subpart_idx), K_(mapping_pg_sub_part_id), K_(drop_schema_version)); - private: +private: int64_t subpart_id_; int64_t subpart_idx_; // Valid for hash partition; int64_t mapping_pg_sub_part_id_; // nontemplate table, is partition_id of pg. @@ -2591,7 +2591,7 @@ struct ObSubPartition : public ObBasePartition { class ObPartitionSchema : public ObSchema { OB_UNIS_VERSION(1); - public: +public: // base methods ObPartitionSchema(); explicit ObPartitionSchema(common::ObIAllocator* allocator); @@ -2930,7 +2930,7 @@ class ObPartitionSchema : public ObSchema { int try_assign_part_array(const share::schema::ObPartitionSchema& that); int try_assign_def_subpart_array(const share::schema::ObPartitionSchema& that); - protected: +protected: int inner_add_partition(const ObPartition& part); int inner_add_partition(const ObSubPartition& part); template @@ -2939,10 +2939,10 @@ class ObPartitionSchema : public ObSchema { int64_t* pos /* = NULL*/) const; int get_def_subpart_name(const int64_t subpart_id, char* buf, const int64_t buf_size, int64_t* pos /* = NULL*/) const; - protected: +protected: static const int64_t DEFAULT_ARRAY_CAPACITY = 128; - protected: +protected: int64_t part_num_; // Redundant value, derived from sub_part_option_, valid when is_sub_part_template = true int64_t def_subpart_num_; @@ -2979,7 +2979,7 @@ class ObPartitionSchema : public ObSchema { class ObTablegroupSchema : public ObPartitionSchema { OB_UNIS_VERSION(1); - public: +public: // base methods ObTablegroupSchema(); explicit ObTablegroupSchema(common::ObIAllocator* allocator); @@ -3193,30 +3193,72 @@ class ObTablegroupSchema : public ObPartitionSchema { { return PARTITION_LEVEL_TWO == get_part_level(); } - inline virtual uint64_t get_table_id() const override { return tablegroup_id_; } // for partition schema used - inline virtual uint64_t get_database_id() const { return 0; } - inline virtual void set_database_id(const uint64_t database_id) { UNUSED(database_id); } - inline virtual void set_table_id(const uint64_t tablegroup_id) override { tablegroup_id_ = tablegroup_id; } - inline int64_t get_part_func_expr_num() const override { return part_func_expr_num_; } - inline void set_part_func_expr_num(const int64_t part_func_expr_num) override { part_func_expr_num_ = part_func_expr_num; } - inline int64_t get_sub_part_func_expr_num() const override { return sub_part_func_expr_num_; } - inline void set_sub_part_func_expr_num(const int64_t sub_part_func_expr_num) override { sub_part_func_expr_num_ = sub_part_func_expr_num; } - virtual int64_t get_partition_cnt() const override { return 0; } - virtual int calc_part_func_expr_num(int64_t &part_func_expr_num) const; - virtual int calc_subpart_func_expr_num(int64_t &subpart_func_expr_num) const; - //other methods + inline virtual uint64_t get_table_id() const override + { + return tablegroup_id_; + } // for partition schema used + inline virtual uint64_t get_database_id() const + { + return 0; + } + inline virtual void set_database_id(const uint64_t database_id) + { + UNUSED(database_id); + } + inline virtual void set_table_id(const uint64_t tablegroup_id) override + { + tablegroup_id_ = tablegroup_id; + } + inline int64_t get_part_func_expr_num() const override + { + return part_func_expr_num_; + } + inline void set_part_func_expr_num(const int64_t part_func_expr_num) override + { + part_func_expr_num_ = part_func_expr_num; + } + inline int64_t get_sub_part_func_expr_num() const override + { + return sub_part_func_expr_num_; + } + inline void set_sub_part_func_expr_num(const int64_t sub_part_func_expr_num) override + { + sub_part_func_expr_num_ = sub_part_func_expr_num; + } + virtual int64_t get_partition_cnt() const override + { + return 0; + } + virtual int calc_part_func_expr_num(int64_t& part_func_expr_num) const; + virtual int calc_subpart_func_expr_num(int64_t& subpart_func_expr_num) const; + // other methods virtual void reset() override; int64_t get_convert_size() const override; - virtual bool has_self_partition() const override { return get_binding(); } + virtual bool has_self_partition() const override + { + return get_binding(); + } virtual bool is_valid() const override; - bool is_mock_global_index_invalid() const { return is_mock_global_index_invalid_; } - bool is_global_index_table() const { return false; } - void set_mock_global_index_invalid(const bool is_invalid) {is_mock_global_index_invalid_ = is_invalid; } - bool can_read_index() const { return true; } + bool is_mock_global_index_invalid() const + { + return is_mock_global_index_invalid_; + } + bool is_global_index_table() const + { + return false; + } + void set_mock_global_index_invalid(const bool is_invalid) + { + is_mock_global_index_invalid_ = is_invalid; + } + bool can_read_index() const + { + return true; + } DECLARE_VIRTUAL_TO_STRING; - private: +private: uint64_t tenant_id_; uint64_t tablegroup_id_; int64_t schema_version_; @@ -3239,7 +3281,7 @@ class ObTablegroupSchema : public ObPartitionSchema { }; class ObPartitionUtils { - public: +public: /// Get part ids through range of partition_column // Get hash(FUNC_HASH/FUNC_KEY) part type ids @@ -3341,7 +3383,7 @@ class ObPartitionUtils { static bool is_types_equal_for_partition_check(const common::ObObjType& typ1, const common::ObObjType& type2); - private: +private: // Get level-one range part_ids // The meaning of get_part_index can refer to get_hash_part_ids() static int get_range_part_ids(ObPartition& start, ObPartition& end, const common::ObBorderFlag& border_flag, @@ -3509,7 +3551,7 @@ int ObPartitionUtils::get_end(const T* const* partition_array, const int64_t par class ObViewSchema : public ObSchema { OB_UNIS_VERSION(1); - public: +public: ObViewSchema(); explicit ObViewSchema(common::ObIAllocator* allocator); virtual ~ObViewSchema(); @@ -3586,7 +3628,7 @@ class ObViewSchema : public ObSchema { N_IS_UPDATABLE, STR_BOOL(view_is_updatable_), N_IS_MATERIALIZED, STR_BOOL(materialized_), K_(character_set_client), K_(collation_connection)); - private: +private: common::ObString view_definition_; ViewCheckOption view_check_option_; bool view_is_updatable_; @@ -3596,7 +3638,7 @@ class ObViewSchema : public ObSchema { }; class ObColumnSchemaHashWrapper { - public: +public: ObColumnSchemaHashWrapper() {} explicit ObColumnSchemaHashWrapper(const common::ObString& str) : column_name_(str) @@ -3616,7 +3658,7 @@ class ObColumnSchemaHashWrapper { common::ObString column_name_; }; class ObColumnSchemaWrapper { - public: +public: ObColumnSchemaWrapper() : column_name_(), prefix_len_(0) {} explicit ObColumnSchemaWrapper(const common::ObString& str, int32_t prefix_len) @@ -3657,7 +3699,7 @@ inline uint64_t ObColumnSchemaHashWrapper::hash() const return hash_ret; } class ObIndexSchemaHashWrapper { - public: +public: ObIndexSchemaHashWrapper() : tenant_id_(common::OB_INVALID_ID), database_id_(common::OB_INVALID_ID) {} ObIndexSchemaHashWrapper(uint64_t tenant_id, const uint64_t database_id, const common::ObString& index_name) @@ -3681,7 +3723,7 @@ class ObIndexSchemaHashWrapper { return index_name_; } - private: +private: uint64_t tenant_id_; uint64_t database_id_; common::ObString index_name_; @@ -3707,7 +3749,7 @@ inline bool ObIndexSchemaHashWrapper::operator==(const ObIndexSchemaHashWrapper& } class ObTableSchemaHashWrapper { - public: +public: ObTableSchemaHashWrapper() : tenant_id_(common::OB_INVALID_ID), database_id_(common::OB_INVALID_ID), @@ -3744,7 +3786,7 @@ class ObTableSchemaHashWrapper { return table_name_; } - private: +private: uint64_t tenant_id_; uint64_t database_id_; uint64_t session_id_; @@ -3773,7 +3815,7 @@ inline bool ObTableSchemaHashWrapper::operator==(const ObTableSchemaHashWrapper& } class ObDatabaseSchemaHashWrapper { - public: +public: ObDatabaseSchemaHashWrapper() : tenant_id_(common::OB_INVALID_ID), name_case_mode_(common::OB_NAME_CASE_INVALID) {} ObDatabaseSchemaHashWrapper( @@ -3798,7 +3840,7 @@ class ObDatabaseSchemaHashWrapper { return database_name_; } - private: +private: uint64_t tenant_id_; common::ObNameCaseMode name_case_mode_; common::ObString database_name_; @@ -3821,7 +3863,7 @@ inline bool ObDatabaseSchemaHashWrapper::operator==(const ObDatabaseSchemaHashWr } class ObTablegroupSchemaHashWrapper { - public: +public: ObTablegroupSchemaHashWrapper() : tenant_id_(common::OB_INVALID_ID) {} ObTablegroupSchemaHashWrapper(uint64_t tenant_id, const common::ObString& tablegroup_name) @@ -3841,13 +3883,13 @@ class ObTablegroupSchemaHashWrapper { return tablegroup_name_; } - private: +private: uint64_t tenant_id_; common::ObString tablegroup_name_; }; class ObForeignKeyInfoHashWrapper { - public: +public: ObForeignKeyInfoHashWrapper() { tenant_id_ = common::OB_INVALID_ID; @@ -3874,7 +3916,7 @@ class ObForeignKeyInfoHashWrapper { return foreign_key_name_; } - private: +private: uint64_t tenant_id_; uint64_t database_id_; common::ObString foreign_key_name_; @@ -3900,7 +3942,7 @@ inline bool ObForeignKeyInfoHashWrapper::operator==(const ObForeignKeyInfoHashWr } class ObConstraintInfoHashWrapper { - public: +public: ObConstraintInfoHashWrapper() { tenant_id_ = common::OB_INVALID_ID; @@ -3927,7 +3969,7 @@ class ObConstraintInfoHashWrapper { return constraint_name_; } - private: +private: uint64_t tenant_id_; uint64_t database_id_; common::ObString constraint_name_; @@ -3968,7 +4010,7 @@ inline bool ObTablegroupSchemaHashWrapper::operator==(const ObTablegroupSchemaHa struct ObTenantPlanBaselineId { OB_UNIS_VERSION(1); - public: +public: ObTenantPlanBaselineId() : tenant_id_(common::OB_INVALID_ID), plan_baseline_id_(common::OB_INVALID_ID) {} ObTenantPlanBaselineId(const uint64_t tenant_id, const uint64_t plan_baseline_id) @@ -4009,7 +4051,7 @@ struct ObTenantPlanBaselineId { struct ObTenantOutlineId { OB_UNIS_VERSION(1); - public: +public: ObTenantOutlineId() : tenant_id_(common::OB_INVALID_ID), outline_id_(common::OB_INVALID_ID) {} ObTenantOutlineId(const uint64_t tenant_id, const uint64_t outline_id) @@ -4051,7 +4093,7 @@ struct ObTenantOutlineId { struct ObTenantUserId { OB_UNIS_VERSION(1); - public: +public: ObTenantUserId() : tenant_id_(common::OB_INVALID_ID), user_id_(common::OB_INVALID_ID) {} ObTenantUserId(const uint64_t tenant_id, const uint64_t user_id) : tenant_id_(tenant_id), user_id_(user_id) @@ -4092,7 +4134,7 @@ struct ObTenantUserId { struct ObTenantUrObjId { OB_UNIS_VERSION(1); - public: +public: ObTenantUrObjId() : tenant_id_(common::OB_INVALID_ID), grantee_id_(common::OB_INVALID_ID), @@ -4155,31 +4197,31 @@ struct ObTenantUrObjId { }; class ObPrintPrivSet { - public: +public: explicit ObPrintPrivSet(ObPrivSet priv_set) : priv_set_(priv_set) {} DECLARE_TO_STRING; - private: +private: ObPrivSet priv_set_; }; class ObPrintPackedPrivArray { - public: +public: explicit ObPrintPackedPrivArray(const ObPackedPrivArray& packed_priv_array) : packed_priv_array_(packed_priv_array) {} DECLARE_TO_STRING; - private: +private: const ObPackedPrivArray& packed_priv_array_; }; class ObPriv { OB_UNIS_VERSION_V(1); - public: +public: ObPriv() : tenant_id_(common::OB_INVALID_ID), user_id_(common::OB_INVALID_ID), @@ -4288,7 +4330,7 @@ class ObPriv { TO_STRING_KV(K_(tenant_id), K_(user_id), K_(schema_version), "privileges", ObPrintPrivSet(priv_set_)); - protected: +protected: uint64_t tenant_id_; uint64_t user_id_; int64_t schema_version_; @@ -4299,7 +4341,7 @@ class ObPriv { // Not used now class ObUserInfoHashWrapper { - public: +public: ObUserInfoHashWrapper() : tenant_id_(common::OB_INVALID_ID) {} ObUserInfoHashWrapper(uint64_t tenant_id, const common::ObString& user_name) @@ -4319,7 +4361,7 @@ class ObUserInfoHashWrapper { return user_name_; } - private: +private: uint64_t tenant_id_; common::ObString user_name_; }; @@ -4370,7 +4412,7 @@ enum ObUserType { class ObUserInfo : public ObSchema, public ObPriv { OB_UNIS_VERSION(1); - public: +public: ObUserInfo() : ObSchema(), ObPriv(), @@ -4615,7 +4657,7 @@ class ObUserInfo : public ObSchema, public ObPriv { bool role_exists(const uint64_t role_id, const uint64_t option) const; int get_seq_by_role_id(uint64_t role_id, uint64_t& seq) const; - private: +private: common::ObString user_name_; common::ObString host_name_; common::ObString passwd_; @@ -4749,7 +4791,7 @@ struct ObSysPrivKey { class ObDBPriv : public ObSchema, public ObPriv { OB_UNIS_VERSION(1); - public: +public: ObDBPriv() : ObPriv(), db_(), sort_(0) {} explicit ObDBPriv(common::ObIAllocator* allocator) : ObSchema(allocator), ObPriv(allocator), db_(), sort_(0) @@ -4816,7 +4858,7 @@ class ObDBPriv : public ObSchema, public ObPriv { int64_t get_convert_size() const; TO_STRING_KV(K_(tenant_id), K_(user_id), K_(db), "privileges", ObPrintPrivSet(priv_set_)); - private: +private: common::ObString db_; uint64_t sort_; }; @@ -4980,7 +5022,7 @@ typedef common::ObSEArray ObObjPrivSortKeyAr class ObTablePriv : public ObSchema, public ObPriv { OB_UNIS_VERSION(1); - public: +public: // constructor and destructor ObTablePriv() : ObSchema(), ObPriv() {} @@ -5069,7 +5111,7 @@ class ObTablePriv : public ObSchema, public ObPriv { virtual void reset(); int64_t get_convert_size() const; - private: +private: common::ObString db_; common::ObString table_; }; @@ -5077,7 +5119,7 @@ class ObTablePriv : public ObSchema, public ObPriv { class ObObjPriv : public ObSchema, public ObPriv { OB_UNIS_VERSION(1); - public: +public: // constructor and destructor ObObjPriv() : ObSchema(), ObPriv() {} @@ -5180,7 +5222,7 @@ class ObObjPriv : public ObSchema, public ObPriv { virtual void reset(); int64_t get_convert_size() const; - private: +private: uint64_t obj_id_; uint64_t obj_type_; uint64_t col_id_; @@ -5412,7 +5454,7 @@ struct ObUserLoginInfo { class ObSysPriv : public ObSchema, public ObPriv { OB_UNIS_VERSION(1); - public: +public: ObSysPriv() : ObPriv(), grantee_id_(common::OB_INVALID_ID) {} explicit ObSysPriv(common::ObIAllocator* allocator) : ObSchema(allocator), ObPriv(allocator) @@ -5484,14 +5526,14 @@ class ObSysPriv : public ObSchema, public ObPriv { TO_STRING_KV(K_(tenant_id), K_(user_id), K_(grantee_id), "privileges", ObPrintPrivSet(priv_set_), "packedprivarray", ObPrintPackedPrivArray(priv_array_)); - private: +private: uint64_t grantee_id_; }; int get_int_value(const common::ObString& str, int64_t& value); class ObHostnameStuct { - public: +public: ObHostnameStuct() {} ~ObHostnameStuct() @@ -5512,7 +5554,7 @@ enum ObHintFormat { }; class ObFixedParam { - public: +public: ObFixedParam() : offset_(common::OB_INVALID_INDEX), value_() {} virtual ~ObFixedParam() @@ -5527,7 +5569,7 @@ class ObFixedParam { class ObMaxConcurrentParam { OB_UNIS_VERSION(1); - public: +public: static const int64_t UNLIMITED = -1; typedef common::ObArray FixParamStore; explicit ObMaxConcurrentParam(common::ObIAllocator* allocator, const common::ObMemAttr& attr = common::ObMemAttr()); @@ -5556,18 +5598,18 @@ class ObMaxConcurrentParam { } VIRTUAL_TO_STRING_KV(K_(concurrent_num), K_(outline_content), K_(fixed_param_store)); - private: +private: int deep_copy_outline_content(const common::ObString& src); int deep_copy_param_value(const common::ObObj& src, common::ObObj& dest); - public: +public: common::ObIAllocator* allocator_; int64_t concurrent_num_; common::ObString outline_content_; common::ObMemAttr mem_attr_; FixParamStore fixed_param_store_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMaxConcurrentParam); }; @@ -5576,7 +5618,7 @@ class ObOutlineParamsWrapper { typedef common::ObArray OutlineParamsArray; OB_UNIS_VERSION(1); - public: +public: ObOutlineParamsWrapper(); explicit ObOutlineParamsWrapper(common::ObIAllocator* allocator); ~ObOutlineParamsWrapper(); @@ -5615,19 +5657,19 @@ class ObOutlineParamsWrapper { }; TO_STRING_KV(K_(outline_params)); - private: +private: common::ObIAllocator* allocator_; OutlineParamsArray outline_params_; common::ObMemAttr mem_attr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOutlineParamsWrapper); }; struct BaselineKey { OB_UNIS_VERSION(1); - public: +public: BaselineKey() : tenant_id_(common::OB_INVALID_ID), db_id_(common::OB_INVALID_ID) {} @@ -5666,7 +5708,7 @@ struct BaselineKey { class ObPlanBaselineInfo : public ObSchema { OB_UNIS_VERSION(1); - public: +public: ObPlanBaselineInfo(); explicit ObPlanBaselineInfo(common::ObIAllocator* allocator); virtual ~ObPlanBaselineInfo(); @@ -5861,7 +5903,7 @@ class ObPlanBaselineInfo : public ObSchema { VIRTUAL_TO_STRING_KV(K_(key), K_(plan_baseline_id), K_(schema_version), K_(outline_data), K_(plan_hash_value), K_(fixed), K_(enabled), K_(executions), K_(cpu_time), K_(hints_info), K_(hints_all_worked)); - public: +public: BaselineKey key_; uint64_t plan_baseline_id_; int64_t schema_version_; // the last modify timestamp of this version @@ -5879,7 +5921,7 @@ class ObPlanBaselineInfo : public ObSchema { class ObOutlineInfo : public ObSchema { OB_UNIS_VERSION(1); - public: +public: ObOutlineInfo(); explicit ObOutlineInfo(common::ObIAllocator* allocator); virtual ~ObOutlineInfo(); @@ -6134,13 +6176,13 @@ class ObOutlineInfo : public ObSchema { K_(format), K_(outline_params_wrapper), K_(outline_target)); static bool is_sql_id_valid(const common::ObString& sql_id); - private: +private: static int replace_question_mark(const common::ObString& not_param_sql, const ObMaxConcurrentParam& concurrent_param, int64_t start_pos, int64_t cur_pos, int64_t& question_mark_offset, common::ObSqlString& string_helper); static int replace_not_param(const common::ObString& not_param_sql, const ParseNode& node, int64_t start_pos, int64_t cur_pos, common::ObSqlString& string_helper); - protected: +protected: uint64_t tenant_id_; uint64_t database_id_; uint64_t outline_id_; @@ -6162,7 +6204,7 @@ class ObOutlineInfo : public ObSchema { }; class ObDbLinkBaseInfo : public ObSchema { - public: +public: ObDbLinkBaseInfo() : ObSchema() { reset(); @@ -6278,7 +6320,7 @@ class ObDbLinkBaseInfo : public ObSchema { VIRTUAL_TO_STRING_KV(K_(tenant_id), K_(owner_id), K_(dblink_id), K_(dblink_name), K_(cluster_name), K_(tenant_name), K_(user_name), K_(host_addr)); - protected: +protected: uint64_t tenant_id_; uint64_t owner_id_; uint64_t dblink_id_; @@ -6292,7 +6334,7 @@ class ObDbLinkBaseInfo : public ObSchema { }; struct ObTenantDbLinkId { - public: +public: ObTenantDbLinkId() : tenant_id_(common::OB_INVALID_ID), dblink_id_(common::OB_INVALID_ID) {} ObTenantDbLinkId(uint64_t tenant_id, uint64_t dblink_id) : tenant_id_(tenant_id), dblink_id_(dblink_id) @@ -6338,7 +6380,7 @@ struct ObTenantDbLinkId { } TO_STRING_KV(K_(tenant_id), K_(dblink_id)); - private: +private: uint64_t tenant_id_; uint64_t dblink_id_; }; @@ -6346,7 +6388,7 @@ struct ObTenantDbLinkId { class ObDbLinkInfo : public ObDbLinkBaseInfo { OB_UNIS_VERSION(1); - public: +public: ObDbLinkInfo() : ObDbLinkBaseInfo() {} explicit ObDbLinkInfo(common::ObIAllocator* allocator) : ObDbLinkBaseInfo(allocator) @@ -6356,7 +6398,7 @@ class ObDbLinkInfo : public ObDbLinkBaseInfo { }; class ObDbLinkSchema : public ObDbLinkBaseInfo { - public: +public: ObDbLinkSchema() : ObDbLinkBaseInfo() {} explicit ObDbLinkSchema(common::ObIAllocator* allocator) : ObDbLinkBaseInfo(allocator) @@ -6381,7 +6423,7 @@ class ObDbLinkSchema : public ObDbLinkBaseInfo { class ObSynonymInfo : public ObSchema { OB_UNIS_VERSION(1); - public: +public: ObSynonymInfo(); explicit ObSynonymInfo(common::ObIAllocator* allocator); VIRTUAL_TO_STRING_KV(K_(tenant_id), K_(database_id), K_(synonym_id), K_(schema_version)); @@ -6479,9 +6521,9 @@ class ObSynonymInfo : public ObSchema { } void reset(); - private: +private: // void *alloc(int64_t size); - private: +private: uint64_t tenant_id_; uint64_t database_id_; uint64_t synonym_id_; @@ -6496,7 +6538,7 @@ class ObSynonymInfo : public ObSchema { struct ObTenantUDFId { OB_UNIS_VERSION(1); - public: +public: ObTenantUDFId() : tenant_id_(common::OB_INVALID_ID), udf_name_() {} ObTenantUDFId(const uint64_t tenant_id, const common::ObString& name) : tenant_id_(tenant_id), udf_name_(name) @@ -6536,7 +6578,7 @@ struct ObTenantUDFId { struct ObTenantSynonymId { OB_UNIS_VERSION(1); - public: +public: ObTenantSynonymId() : tenant_id_(common::OB_INVALID_ID), synonym_id_(common::OB_INVALID_ID) {} ObTenantSynonymId(const uint64_t tenant_id, const uint64_t synonym_id) @@ -6577,7 +6619,7 @@ struct ObTenantSynonymId { struct ObTenantSequenceId { OB_UNIS_VERSION(1); - public: +public: ObTenantSequenceId() : tenant_id_(common::OB_INVALID_ID), sequence_id_(common::OB_INVALID_ID) {} ObTenantSequenceId(const uint64_t tenant_id, const uint64_t sequence_id) @@ -6618,7 +6660,7 @@ struct ObTenantSequenceId { class ObAlterOutlineInfo : public ObOutlineInfo { OB_UNIS_VERSION(1); - public: +public: ObAlterOutlineInfo() : ObOutlineInfo(), alter_option_bitset_() {} virtual ~ObAlterOutlineInfo() @@ -6638,12 +6680,12 @@ class ObAlterOutlineInfo : public ObOutlineInfo { } INHERIT_TO_STRING_KV("ObOutlineInfo", ObOutlineInfo, K_(alter_option_bitset)); - private: +private: common::ObBitSet<> alter_option_bitset_; }; class ObOutlineNameHashWrapper { - public: +public: ObOutlineNameHashWrapper() : tenant_id_(common::OB_INVALID_ID), database_id_(common::OB_INVALID_ID), name_() {} ObOutlineNameHashWrapper(const uint64_t tenant_id, const uint64_t database_id, const common::ObString& name_) @@ -6679,7 +6721,7 @@ class ObOutlineNameHashWrapper { return name_; } - private: +private: uint64_t tenant_id_; uint64_t database_id_; common::ObString name_; @@ -6700,7 +6742,7 @@ inline bool ObOutlineNameHashWrapper::operator==(const ObOutlineNameHashWrapper& } class ObOutlineSignatureHashWrapper { - public: +public: ObOutlineSignatureHashWrapper() : tenant_id_(common::OB_INVALID_ID), database_id_(common::OB_INVALID_ID), signature_() {} ObOutlineSignatureHashWrapper(const uint64_t tenant_id, const uint64_t database_id, const common::ObString& signature) @@ -6736,14 +6778,14 @@ class ObOutlineSignatureHashWrapper { return signature_; } - private: +private: uint64_t tenant_id_; uint64_t database_id_; common::ObString signature_; }; class ObOutlineSqlIdHashWrapper { - public: +public: ObOutlineSqlIdHashWrapper() : tenant_id_(common::OB_INVALID_ID), database_id_(common::OB_INVALID_ID), sql_id_() {} ObOutlineSqlIdHashWrapper(const uint64_t tenant_id, const uint64_t database_id, const common::ObString& sql_id) @@ -6779,7 +6821,7 @@ class ObOutlineSqlIdHashWrapper { return sql_id_; } - private: +private: uint64_t tenant_id_; uint64_t database_id_; common::ObString sql_id_; @@ -6814,7 +6856,7 @@ inline bool ObOutlineSignatureHashWrapper::operator==(const ObOutlineSignatureHa } class ObSysTableChecker { - private: +private: ObSysTableChecker(); ~ObSysTableChecker(); @@ -6824,7 +6866,7 @@ class ObSysTableChecker { int check_sys_table_name(const uint64_t database_id, const common::ObString& table_name, bool& is_tenant_space_table); int ob_write_string(const common::ObString& src, common::ObString& dst); - public: +public: static ObSysTableChecker& instance(); int init(); int destroy(); @@ -6844,9 +6886,9 @@ class ObSysTableChecker { static bool is_rs_restart_related_table_id(const uint64_t table_id); static bool is_rs_restart_related_partition(const uint64_t table_id, const int64_t partition_id); - public: +public: class TableNameWrapper { - public: + public: TableNameWrapper() : database_id_(common::OB_INVALID_ID), name_case_mode_(common::OB_NAME_CASE_INVALID), table_name_() {} @@ -6859,17 +6901,17 @@ class ObSysTableChecker { bool operator==(const TableNameWrapper& rv) const; TO_STRING_KV(K_(database_id), K_(name_case_mode), K_(table_name)); - private: + private: uint64_t database_id_; // pure_database_id common::ObNameCaseMode name_case_mode_; common::ObString table_name_; }; typedef common::ObSEArray TableNameWrapperArray; - private: +private: static const int64_t TABLE_BUCKET_NUM = 300; - private: +private: common::hash::ObHashSet tenant_space_table_id_map_; common::hash::ObHashMap sys_table_name_map_; int64_t tenant_space_sys_table_num_; // Number of tenant-level system tables (including system table indexes) @@ -6882,7 +6924,7 @@ class ObTableSchema; class ObRecycleObject : public ObSchema { OB_UNIS_VERSION(1); - public: +public: enum RecycleObjType { INVALID = 0, TABLE, @@ -6991,7 +7033,7 @@ class ObRecycleObject : public ObSchema { TO_STRING_KV(K_(tenant_id), K_(database_id), K_(table_id), K_(tablegroup_id), K_(object_name), K_(original_name), K_(type), K_(tablegroup_name), K_(database_name)); - private: +private: uint64_t tenant_id_; uint64_t database_id_; uint64_t table_id_; @@ -7017,7 +7059,7 @@ typedef common::hash::ObPlacementHashSet { }; class ObSequenceMgr { - public: +public: typedef common::ObSortedVector SequenceInfos; typedef common::hash::ObPointerHashMap ObSequenceMap; typedef SequenceInfos::iterator SequenceIter; @@ -136,13 +136,13 @@ class ObSequenceMgr { static bool equal_sequence(const ObSequenceSchema* lhs, const ObSequenceSchema* rhs); static int rebuild_sequence_hashmap(const SequenceInfos& sequence_infos, ObSequenceMap& sequence_map); - private: +private: inline static bool compare_with_tenant_sequence_id( const ObSequenceSchema* lhs, const ObTenantSequenceId& tenant_outline_id); inline static bool equal_to_tenant_sequence_id( const ObSequenceSchema* lhs, const ObTenantSequenceId& tenant_outline_id); - private: +private: bool is_inited_; common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; diff --git a/src/share/schema/ob_sequence_sql_service.h b/src/share/schema/ob_sequence_sql_service.h index e43588f29..70d939798 100644 --- a/src/share/schema/ob_sequence_sql_service.h +++ b/src/share/schema/ob_sequence_sql_service.h @@ -26,7 +26,7 @@ namespace schema { class ObSequenceSchema; class ObSequenceSqlService : public ObDDLSqlService { - public: +public: ObSequenceSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObSequenceSqlService() @@ -41,11 +41,11 @@ class ObSequenceSqlService : public ObDDLSqlService { virtual int drop_sequence(const ObSequenceSchema& sequence_schema, const int64_t new_schema_version, common::ObISQLClient* sql_client, const common::ObString* ddl_stmt_str = NULL); - private: +private: int add_sequence( common::ObISQLClient& sql_client, const ObSequenceSchema& sequence_schema, const bool only_history = false); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSequenceSqlService); }; diff --git a/src/share/schema/ob_server_schema_service.cpp b/src/share/schema/ob_server_schema_service.cpp index 974188a8c..2e87bdd3d 100644 --- a/src/share/schema/ob_server_schema_service.cpp +++ b/src/share/schema/ob_server_schema_service.cpp @@ -43,7 +43,7 @@ using namespace oceanbase::common::sqlclient; template class TenantIdTrait { - public: +public: explicit TenantIdTrait(const T& value) : value_(value) {} uint64_t get_tenant_id() const @@ -51,12 +51,12 @@ class TenantIdTrait { return value_.tenant_id_; } - private: +private: const T& value_; }; template <> class TenantIdTrait { - public: +public: explicit TenantIdTrait(const uint64_t value) : value_(value) {} uint64_t get_tenant_id() const @@ -64,7 +64,7 @@ class TenantIdTrait { return common::extract_tenant_id(value_); } - private: +private: uint64_t value_; }; diff --git a/src/share/schema/ob_server_schema_service.h b/src/share/schema/ob_server_schema_service.h index 610d57b20..30a9216ea 100644 --- a/src/share/schema/ob_server_schema_service.h +++ b/src/share/schema/ob_server_schema_service.h @@ -203,7 +203,7 @@ struct VersionHisVal { }; class ObMaxSchemaVersionFetcher { - public: +public: ObMaxSchemaVersionFetcher() : max_schema_version_(common::OB_INVALID_VERSION) {} virtual ~ObMaxSchemaVersionFetcher() @@ -215,13 +215,13 @@ class ObMaxSchemaVersionFetcher { return max_schema_version_; } - private: +private: int64_t max_schema_version_; DISALLOW_COPY_AND_ASSIGN(ObMaxSchemaVersionFetcher); }; class ObSchemaVersionGetter { - public: +public: ObSchemaVersionGetter() : schema_version_(common::OB_INVALID_VERSION) {} virtual ~ObSchemaVersionGetter() @@ -233,7 +233,7 @@ class ObSchemaVersionGetter { return schema_version_; } - private: +private: int64_t schema_version_; DISALLOW_COPY_AND_ASSIGN(ObSchemaVersionGetter); }; @@ -241,7 +241,7 @@ class ObSchemaVersionGetter { class ObSchemaGetterGuard; class ObServerSchemaService { - public: +public: #define ALLOW_NEXT_LOG() ObTaskController::get().allow_next_syslog(); #define SCHEMA_KEY_FUNC(SCHEMA) \ struct SCHEMA##_key_hash_func { \ @@ -481,7 +481,7 @@ class ObServerSchemaService { common::ObArenaAllocator allocator_; }; - public: +public: int init(common::ObMySQLProxy* sql_proxy, common::ObDbLinkProxy* dblink_proxy, const common::ObCommonConfig* config); explicit ObServerSchemaService(bool enable_backup = false); virtual ~ObServerSchemaService(); @@ -544,7 +544,7 @@ class ObServerSchemaService { int check_tenant_can_use_new_table(const uint64_t tenant_id, bool& can) const; - protected: +protected: bool check_inner_stat() const; int check_stop() const; virtual int fallback_schema_mgr( @@ -566,12 +566,12 @@ class ObServerSchemaService { int destroy_schema_struct(uint64_t tenant_id); - private: +private: virtual int destroy(); // stats table instances in schem mgrs class ObTable { - public: + public: ObTable() : version_(0), combined_id_(0){}; virtual ~ObTable(){}; uint64_t hash() const @@ -697,7 +697,7 @@ class ObServerSchemaService { int try_update_split_schema_version_v2( const share::schema::ObRefreshSchemaStatus& schema_status, const uint64_t tenant_id); - protected: +protected: int update_table_columns(const uint64_t tenant_id, ObTableSchema& table_schema); virtual int update_schema_cache(common::ObIArray& schema_array, const bool is_force = false) = 0; virtual int update_schema_cache(common::ObIArray& schema_array, const bool is_forece = false) = 0; @@ -713,7 +713,7 @@ class ObServerSchemaService { const common::ObIArray& schemas, common::ObIArray& simple_schemas); int convert_to_simple_schema(const ObTableSchema& schema, ObSimpleTableSchemaV2& simple_schema); - protected: +protected: // core table count const static int64_t MIN_TABLE_COUNT = 1; static const int64_t REFRESH_SCHEMA_INTERVAL_US = 100 * 1000; // 100ms @@ -746,7 +746,7 @@ class ObServerSchemaService { const static int VERSION_HIS_MAP_BUCKET_NUM = 64 * 1024; common::hash::ObHashMap version_his_map_; - private: +private: static const int64_t BUCKET_SIZE = 128; int64_t core_schema_version_; int64_t schema_version_; @@ -754,7 +754,7 @@ class ObServerSchemaService { int64_t baseline_schema_version_; RefreshSchemaType refresh_schema_type_; - protected: +protected: // new schema management by tenant, need protected by lock const static int TENANT_MAP_BUCKET_NUM = 1024; const static int MOCK_SCHEMA_BUCKET_NUM = 100; diff --git a/src/share/schema/ob_synonym_mgr.h b/src/share/schema/ob_synonym_mgr.h index dc2f53c69..f3d94ad5c 100644 --- a/src/share/schema/ob_synonym_mgr.h +++ b/src/share/schema/ob_synonym_mgr.h @@ -25,7 +25,7 @@ namespace share { namespace schema { class ObSimpleSynonymSchema : public ObSchema { - public: +public: ObSimpleSynonymSchema(); explicit ObSimpleSynonymSchema(common::ObIAllocator* allocator); ObSimpleSynonymSchema(const ObSimpleSynonymSchema& src_schema); @@ -113,7 +113,7 @@ class ObSimpleSynonymSchema : public ObSchema { return ObTenantSynonymId(tenant_id_, synonym_id_); } - private: +private: uint64_t tenant_id_; uint64_t synonym_id_; int64_t schema_version_; @@ -124,7 +124,7 @@ class ObSimpleSynonymSchema : public ObSchema { }; class ObSynonymHashWrapper { - public: +public: ObSynonymHashWrapper() : tenant_id_(common::OB_INVALID_ID), database_id_(common::OB_INVALID_ID), synonym_name_() {} ObSynonymHashWrapper(uint64_t tenant_id, uint64_t database_id, const common::ObString& synonym_name) @@ -160,7 +160,7 @@ class ObSynonymHashWrapper { } TO_STRING_KV(K_(tenant_id), K_(database_id), K_(synonym_name)); - private: +private: uint64_t tenant_id_; uint64_t database_id_; common::ObString synonym_name_; @@ -205,7 +205,7 @@ struct ObGetSynonymKey { }; class ObSynonymMgr { - public: +public: typedef common::ObSortedVector SynonymInfos; typedef common::hash::ObPointerHashMap ObSynonymMap; typedef SynonymInfos::iterator SynonymIter; @@ -248,13 +248,13 @@ class ObSynonymMgr { } static int rebuild_synonym_hashmap(const SynonymInfos& synonym_infos, ObSynonymMap& synonym_map); - private: +private: inline static bool compare_with_tenant_synonym_id( const ObSimpleSynonymSchema* lhs, const ObTenantSynonymId& tenant_outline_id); inline static bool equal_to_tenant_synonym_id( const ObSimpleSynonymSchema* lhs, const ObTenantSynonymId& tenant_outline_id); - private: +private: bool is_inited_; common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; diff --git a/src/share/schema/ob_synonym_sql_service.h b/src/share/schema/ob_synonym_sql_service.h index 2f03eca05..04e2cda59 100644 --- a/src/share/schema/ob_synonym_sql_service.h +++ b/src/share/schema/ob_synonym_sql_service.h @@ -26,7 +26,7 @@ namespace schema { class ObSynonymInfo; class ObSynonymSqlService : public ObDDLSqlService { - public: +public: ObSynonymSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObSynonymSqlService() @@ -42,10 +42,10 @@ class ObSynonymSqlService : public ObDDLSqlService { virtual int drop_synonym(const ObSynonymInfo& synonym_info, const int64_t new_schema_version, common::ObISQLClient* sql_client, const common::ObString* ddl_stmt_str = NULL); - private: +private: int add_synonym(common::ObISQLClient& sql_client, const ObSynonymInfo& synonym_info, const bool only_history = false); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSynonymSqlService); }; diff --git a/src/share/schema/ob_sys_variable_mgr.h b/src/share/schema/ob_sys_variable_mgr.h index 693254ada..bc31c3432 100644 --- a/src/share/schema/ob_sys_variable_mgr.h +++ b/src/share/schema/ob_sys_variable_mgr.h @@ -24,7 +24,7 @@ namespace share { namespace schema { class ObSimpleSysVariableSchema : public ObSchema { - public: +public: ObSimpleSysVariableSchema(); explicit ObSimpleSysVariableSchema(common::ObIAllocator* allocator); ObSimpleSysVariableSchema(const ObSimpleSysVariableSchema& src_schema); @@ -67,7 +67,7 @@ class ObSimpleSysVariableSchema : public ObSchema { return read_only_; } - private: +private: uint64_t tenant_id_; int64_t schema_version_; common::ObNameCaseMode name_case_mode_; @@ -75,7 +75,7 @@ class ObSimpleSysVariableSchema : public ObSchema { }; class ObSysVariableHashWrapper { - public: +public: ObSysVariableHashWrapper() : tenant_id_(common::OB_INVALID_ID) {} ObSysVariableHashWrapper(uint64_t tenant_id) : tenant_id_(tenant_id) @@ -102,7 +102,7 @@ class ObSysVariableHashWrapper { } TO_STRING_KV(K_(tenant_id)); - private: +private: uint64_t tenant_id_; }; @@ -128,7 +128,7 @@ struct ObGetSysVariableKey }; class ObSysVariableMgr { - public: +public: typedef common::ObSortedVector SysVariableInfos; typedef common::hash::ObPointerHashMap ObSysVariableMap; @@ -161,11 +161,11 @@ class ObSysVariableMgr { } static int rebuild_sys_variable_hashmap(const SysVariableInfos& sys_var_infos, ObSysVariableMap& sys_var_map); - private: +private: inline static bool compare_with_tenant_id(const ObSimpleSysVariableSchema* lhs, const uint64_t& tenant_id); inline static bool equal_to_tenant_id(const ObSimpleSysVariableSchema* lhs, const uint64_t& tenant_id); - private: +private: bool is_inited_; common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; diff --git a/src/share/schema/ob_sys_variable_sql_service.h b/src/share/schema/ob_sys_variable_sql_service.h index f0c9875c6..3a93b9d17 100644 --- a/src/share/schema/ob_sys_variable_sql_service.h +++ b/src/share/schema/ob_sys_variable_sql_service.h @@ -28,7 +28,7 @@ class ObSysVariableSchema; class ObSysVarSchema; class ObSysVariableSqlService : public ObDDLSqlService { - public: +public: ObSysVariableSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObSysVariableSqlService() @@ -37,13 +37,13 @@ class ObSysVariableSqlService : public ObDDLSqlService { virtual int replace_sys_variable(ObSysVariableSchema& sys_variable_schema, common::ObISQLClient& sql_client, const ObSchemaOperationType& operation_type, const common::ObString* ddl_stmt_str = NULL); - private: +private: int replace_system_variable(const ObSysVarSchema& sysvar_schema, const ObSchemaOperationType& op, common::ObISQLClient& sql_client, const common::ObString* ddl_stmt_str); int replace_system_variable(const ObSysVarSchema& sysvar_schema, common::ObISQLClient& sql_client); int gen_sys_variable_dml(ObDMLSqlSplicer& dml, const ObSysVarSchema& sysvar_schema, bool is_history); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVariableSqlService); }; diff --git a/src/share/schema/ob_table_dml_param.h b/src/share/schema/ob_table_dml_param.h index 1d8b13684..3c129b76d 100644 --- a/src/share/schema/ob_table_dml_param.h +++ b/src/share/schema/ob_table_dml_param.h @@ -24,7 +24,7 @@ class ObColumnParam; class ObTableSchemaParam { OB_UNIS_VERSION_V(1); - public: +public: typedef common::ObFixedArray RowKeys; typedef common::ObFixedArray Columns; @@ -116,11 +116,11 @@ class ObTableSchemaParam { bool is_depend_column(uint64_t column_id) const; DECLARE_TO_STRING; - private: +private: ObTableSchemaParam(); DISALLOW_COPY_AND_ASSIGN(ObTableSchemaParam); - private: +private: common::ObIAllocator& allocator_; uint64_t table_id_; int64_t schema_version_; @@ -140,7 +140,7 @@ class ObTableSchemaParam { class ObTableDMLParam { OB_UNIS_VERSION_V(1); - public: +public: typedef common::ObFixedArray TableSchemas; typedef common::ObFixedArray ObColDescArray; @@ -178,7 +178,7 @@ class ObTableDMLParam { } DECLARE_TO_STRING; - private: +private: ObTableDMLParam(); DISALLOW_COPY_AND_ASSIGN(ObTableDMLParam); @@ -187,7 +187,7 @@ class ObTableDMLParam { int get_schemas_serialize_size(const TableSchemas& schemas, int64_t& size) const; ObTableSchemaParam* alloc_schema(); - private: +private: common::ObIAllocator& allocator_; int64_t tenant_schema_version_; ObTableSchemaParam data_table_; diff --git a/src/share/schema/ob_table_iter.h b/src/share/schema/ob_table_iter.h index 966e5cbf2..776bec207 100644 --- a/src/share/schema/ob_table_iter.h +++ b/src/share/schema/ob_table_iter.h @@ -24,7 +24,7 @@ class ObMultiVersionSchemaService; class ObSchemaGetterGuard; class ObTenantIterator { - public: +public: ObTenantIterator(); virtual ~ObTenantIterator() {} @@ -34,7 +34,7 @@ class ObTenantIterator { virtual int next(uint64_t& tenant_id); TO_STRING_KV(K_(is_inited), K_(cur_tenant_idx), K_(tenant_ids)) - private: +private: int get_tenant_ids(ObMultiVersionSchemaService& schema_service); bool is_inited_; int64_t cur_tenant_idx_; @@ -42,7 +42,7 @@ class ObTenantIterator { }; class ObITableIterator { - public: +public: ObITableIterator() {} virtual ~ObITableIterator() @@ -52,7 +52,7 @@ class ObITableIterator { }; class ObTableIterator : public ObITableIterator { - public: +public: ObTableIterator(); virtual ~ObTableIterator() {} @@ -64,10 +64,10 @@ class ObTableIterator : public ObITableIterator { DECLARE_TO_STRING; - private: +private: int next_batch_tables(); - private: +private: static const int64_t CACHE_TABLE_ARRAY_CAPACITY = 1024; ObTenantTableId cur_tenant_table_id_; common::ObSEArray cache_table_array_; @@ -77,7 +77,7 @@ class ObTableIterator : public ObITableIterator { }; class ObTenantTableIterator : public ObITableIterator { - public: +public: ObTenantTableIterator(); virtual ~ObTenantTableIterator() {} @@ -87,7 +87,7 @@ class ObTenantTableIterator : public ObITableIterator { TO_STRING_KV(K_(is_inited), K_(cur_table_idx), K_(table_ids)); - private: +private: int get_table_ids(ObMultiVersionSchemaService* schema_service, const uint64_t tenant_id); bool is_inited_; int64_t cur_table_idx_; @@ -101,7 +101,7 @@ class ObTenantTableIterator : public ObITableIterator { * 2 binding table group */ class ObTenantPartitionEntityIterator : public ObITableIterator { - public: +public: ObTenantPartitionEntityIterator() : is_inited_(false), cur_idx_(0), entity_id_array_() {} virtual ~ObTenantPartitionEntityIterator() @@ -112,10 +112,10 @@ class ObTenantPartitionEntityIterator : public ObITableIterator { TO_STRING_KV(K_(is_inited), K_(cur_idx), K_(entity_id_array)); - private: +private: int get_partition_entity_id_array(ObSchemaGetterGuard& schema_guard, const uint64_t tenant_id); - private: +private: bool is_inited_; int64_t cur_idx_; common::ObArray entity_id_array_; diff --git a/src/share/schema/ob_table_param.h b/src/share/schema/ob_table_param.h index d794dc410..777b61c80 100644 --- a/src/share/schema/ob_table_param.h +++ b/src/share/schema/ob_table_param.h @@ -34,7 +34,7 @@ class ColumnHashMap { struct HashNode* next_; }; - public: +public: ColumnHashMap(common::ObIAllocator& allocator) : allocator_(allocator), bucket_num_(0), buckets_(NULL), is_inited_(false) {} @@ -45,19 +45,19 @@ class ColumnHashMap { int set(const uint64_t key, const int32_t value); int get(const uint64_t key, int32_t& value) const; - private: +private: ColumnHashMap(); ColumnHashMap(const ColumnHashMap& other); ColumnHashMap& operator=(const ColumnHashMap& other); - private: +private: bool is_inited() const { return is_inited_; } int find_node(const uint64_t key, HashNode* head, HashNode*& node) const; - public: +public: common::ObIAllocator& allocator_; int64_t bucket_num_; HashNode** buckets_; @@ -117,7 +117,7 @@ class ColumnMap { typedef common::ObFixedArray ColumnArray; #define IS_SHADOW_COLUMN(column_id) (column_id >= OB_MIN_SHADOW_COLUMN_ID) - public: +public: ColumnMap(common::ObIAllocator& allocator) : array_(allocator), shadow_array_(allocator), @@ -142,17 +142,17 @@ class ColumnMap { int get(const uint64_t column_id, int32_t& proj) const; TO_STRING_KV(K(is_inited_), K(use_array_), K(shadow_use_array_), K(has_), K(has_shadow_)); - private: +private: ColumnMap(); ColumnMap(const ColumnMap& other); ColumnMap& operator=(const ColumnMap& other); - private: +private: int create(const bool use_array, const int64_t array_size, const int64_t offset, const common::ObIArray& column_ids, const common::ObIArray& column_indexes, ColumnArray& array, ColumnHashMap& map); - private: +private: ColumnArray array_; ColumnArray shadow_array_; ColumnHashMap map_; @@ -167,16 +167,16 @@ class ColumnMap { class ObColumnParam { OB_UNIS_VERSION_V(1); - public: +public: explicit ObColumnParam(common::ObIAllocator& allocator); virtual ~ObColumnParam(); virtual void reset(); - private: +private: ObColumnParam(); DISALLOW_COPY_AND_ASSIGN(ObColumnParam); - public: +public: inline void set_column_id(const uint64_t column_id) { column_id_ = column_id; @@ -239,10 +239,10 @@ class ObColumnParam { TO_STRING_KV(K_(column_id), K_(meta_type), K_(order), K_(accuracy), K_(orig_default_value), K_(cur_default_value), K_(is_nullable)); - private: +private: int deep_copy_obj(const common::ObObj& src, common::ObObj& dest); - private: +private: common::ObIAllocator& allocator_; uint64_t column_id_; common::ObObjMeta meta_type_; @@ -259,21 +259,21 @@ class ObTableSchemaParam; class ObTableParam { OB_UNIS_VERSION_V(1); - public: +public: typedef common::ObFixedArray Columns; typedef common::ObFixedArray Projector; typedef common::ObFixedArray ColDescArray; - public: +public: explicit ObTableParam(common::ObIAllocator& allocator); virtual ~ObTableParam(); virtual void reset(); - private: +private: ObTableParam(); DISALLOW_COPY_AND_ASSIGN(ObTableParam); - public: +public: int convert(const ObTableSchema& table_schema, const ObTableSchema& index_schema, const common::ObIArray& output_column_ids, const bool index_back); @@ -415,7 +415,7 @@ class ObTableParam { static int alloc_column(common::ObIAllocator& allocator, ObColumnParam*& col_ptr); static int create_column_map(const common::ObIArray& cols, ColumnMap& col_map); - private: +private: int construct_columns_and_projector(const ObTableSchema& table_schema, const common::ObIArray& output_column_ids, common::ObIArray& cols, ColumnMap& col_map, common::ObIArray& projector, common::ObIArray& output_projector); @@ -441,7 +441,7 @@ class ObTableParam { int construct_lob_locator_param(const ObTableSchema& table_schema, const Columns& storage_project_columns, const Projector& access_projector, bool& use_lob_locator, int64_t& rowid_version, Projector& rowid_projector); - private: +private: const static int64_t DEFAULT_COLUMN_MAP_BUCKET_NUM = 4; common::ObIAllocator& allocator_; uint64_t table_id_; diff --git a/src/share/schema/ob_table_schema.h b/src/share/schema/ob_table_schema.h index 8449a785a..b10aad122 100644 --- a/src/share/schema/ob_table_schema.h +++ b/src/share/schema/ob_table_schema.h @@ -112,7 +112,7 @@ enum ObTablePKMode { struct ObTableMode { OB_UNIS_VERSION_V(1); - private: +private: static const int32_t TM_MODE_FLAG_BITS = 8; static const int32_t TM_PK_MODE_OFFSET = 8; static const int32_t TM_PK_MODE_BITS = 4; @@ -121,7 +121,7 @@ struct ObTableMode { static const uint32_t MODE_FLAG_MASK = (1U << TM_MODE_FLAG_BITS) - 1; static const uint32_t PK_MODE_MASK = (1U << TM_PK_MODE_BITS) - 1; - public: +public: ObTableMode() { reset(); @@ -202,54 +202,155 @@ struct ObBackUpTableModeOp { }; class ObSimpleTableSchemaV2 : public ObPartitionSchema { - public: +public: ObSimpleTableSchemaV2(); explicit ObSimpleTableSchemaV2(common::ObIAllocator* allocator); ObSimpleTableSchemaV2(const ObSimpleTableSchemaV2& src_schema) = delete; virtual ~ObSimpleTableSchemaV2(); - ObSimpleTableSchemaV2 &operator=(const ObSimpleTableSchemaV2 &other) = delete; - int assign(const ObSimpleTableSchemaV2 &src_schema); - bool operator ==(const ObSimpleTableSchemaV2 &other) const; + ObSimpleTableSchemaV2& operator=(const ObSimpleTableSchemaV2& other) = delete; + int assign(const ObSimpleTableSchemaV2& src_schema); + bool operator==(const ObSimpleTableSchemaV2& other) const; void reset() override; void reset_partition_schema(); bool is_valid() const override; bool is_link_valid() const; int64_t get_convert_size() const override; - inline void set_tenant_id(const uint64_t tenant_id) override { tenant_id_ = tenant_id; } - inline uint64_t get_tenant_id() const override { return tenant_id_; } - inline virtual void set_table_id(const uint64_t table_id) override { table_id_ = table_id; } - inline virtual uint64_t get_table_id() const override { return table_id_; } - inline void set_schema_version(const int64_t schema_version) override { schema_version_ = schema_version; } - inline int64_t get_schema_version() const override { return schema_version_; } - inline const char *get_locality() const { return extract_str(locality_str_); } - virtual const common::ObString &get_locality_str() const override { return locality_str_; } - virtual common::ObString &get_locality_str() override { return locality_str_; } - inline const char *get_previous_locality() const { return extract_str(previous_locality_str_); } - virtual const common::ObString &get_previous_locality_str() const override { return previous_locality_str_; } - inline int set_locality(const char *locality) { return deep_copy_str(locality, locality_str_); } - inline int set_locality(const common::ObString &locality) { return deep_copy_str(locality, locality_str_); } - inline int set_previous_locality(const char *previous_locality) { return deep_copy_str(previous_locality, previous_locality_str_); } - inline int set_previous_locality(const common::ObString &previous_locality) { return deep_copy_str(previous_locality, previous_locality_str_); } - inline void set_database_id(const uint64_t database_id) { database_id_ = database_id; } - inline uint64_t get_database_id() const { return database_id_; } - virtual void set_tablegroup_id(const uint64_t tablegroup_id) override { tablegroup_id_ = tablegroup_id; } - virtual uint64_t get_tablegroup_id() const override { return tablegroup_id_; } - inline void set_data_table_id(const uint64_t data_table_id) { data_table_id_ = data_table_id; } - inline uint64_t get_data_table_id() const { return data_table_id_; } - inline int set_table_name(const common::ObString &table_name) - { return deep_copy_str(table_name, table_name_); } - inline const char *get_table_name() const { return extract_str(table_name_); } - virtual const char *get_entity_name() const override { return extract_str(table_name_); } - inline const common::ObString &get_table_name_str() const { return table_name_; } - inline const common::ObString &get_origin_index_name_str() const { return origin_index_name_; } - inline void set_name_case_mode(const common::ObNameCaseMode cmp_mode) { name_case_mode_ = cmp_mode; } - inline common::ObNameCaseMode get_name_case_mode() const { return name_case_mode_; } - inline void set_table_type(const ObTableType table_type) { table_type_ = table_type; } - inline ObTableType get_table_type() const { return table_type_; } - inline void set_table_mode(const int32_t table_mode) { table_mode_.mode_ = table_mode; } - inline int32_t get_table_mode() const { return table_mode_.mode_; } - inline void set_table_mode_struct(const ObTableMode table_mode) { table_mode_ = table_mode; } - inline ObTableMode get_table_mode_struct() const { return table_mode_; } + inline void set_tenant_id(const uint64_t tenant_id) override + { + tenant_id_ = tenant_id; + } + inline uint64_t get_tenant_id() const override + { + return tenant_id_; + } + inline virtual void set_table_id(const uint64_t table_id) override + { + table_id_ = table_id; + } + inline virtual uint64_t get_table_id() const override + { + return table_id_; + } + inline void set_schema_version(const int64_t schema_version) override + { + schema_version_ = schema_version; + } + inline int64_t get_schema_version() const override + { + return schema_version_; + } + inline const char* get_locality() const + { + return extract_str(locality_str_); + } + virtual const common::ObString& get_locality_str() const override + { + return locality_str_; + } + virtual common::ObString& get_locality_str() override + { + return locality_str_; + } + inline const char* get_previous_locality() const + { + return extract_str(previous_locality_str_); + } + virtual const common::ObString& get_previous_locality_str() const override + { + return previous_locality_str_; + } + inline int set_locality(const char* locality) + { + return deep_copy_str(locality, locality_str_); + } + inline int set_locality(const common::ObString& locality) + { + return deep_copy_str(locality, locality_str_); + } + inline int set_previous_locality(const char* previous_locality) + { + return deep_copy_str(previous_locality, previous_locality_str_); + } + inline int set_previous_locality(const common::ObString& previous_locality) + { + return deep_copy_str(previous_locality, previous_locality_str_); + } + inline void set_database_id(const uint64_t database_id) + { + database_id_ = database_id; + } + inline uint64_t get_database_id() const + { + return database_id_; + } + virtual void set_tablegroup_id(const uint64_t tablegroup_id) override + { + tablegroup_id_ = tablegroup_id; + } + virtual uint64_t get_tablegroup_id() const override + { + return tablegroup_id_; + } + inline void set_data_table_id(const uint64_t data_table_id) + { + data_table_id_ = data_table_id; + } + inline uint64_t get_data_table_id() const + { + return data_table_id_; + } + inline int set_table_name(const common::ObString& table_name) + { + return deep_copy_str(table_name, table_name_); + } + inline const char* get_table_name() const + { + return extract_str(table_name_); + } + virtual const char* get_entity_name() const override + { + return extract_str(table_name_); + } + inline const common::ObString& get_table_name_str() const + { + return table_name_; + } + inline const common::ObString& get_origin_index_name_str() const + { + return origin_index_name_; + } + inline void set_name_case_mode(const common::ObNameCaseMode cmp_mode) + { + name_case_mode_ = cmp_mode; + } + inline common::ObNameCaseMode get_name_case_mode() const + { + return name_case_mode_; + } + inline void set_table_type(const ObTableType table_type) + { + table_type_ = table_type; + } + inline ObTableType get_table_type() const + { + return table_type_; + } + inline void set_table_mode(const int32_t table_mode) + { + table_mode_.mode_ = table_mode; + } + inline int32_t get_table_mode() const + { + return table_mode_.mode_; + } + inline void set_table_mode_struct(const ObTableMode table_mode) + { + table_mode_ = table_mode; + } + inline ObTableMode get_table_mode_struct() const + { + return table_mode_; + } inline ObTableModeFlag get_table_mode_flag() const { return (ObTableModeFlag)table_mode_.mode_flag_; @@ -260,18 +361,37 @@ class ObSimpleTableSchemaV2 : public ObPartitionSchema { } // Is it a new table without a primary key inline bool is_new_no_pk_table() const - { return TPKM_NEW_NO_PK == (enum ObTablePKMode)table_mode_.pk_mode_; } - inline int set_primary_zone(const common::ObString &primary_zone) - { return deep_copy_str(primary_zone, primary_zone_); } - int set_primary_zone_array(const common::ObIArray &primary_zone_array); - inline virtual void set_min_partition_id(uint64_t partition_id) override { min_partition_id_ = partition_id; } - inline void set_session_id(const uint64_t id) { session_id_ = id; } - inline virtual uint64_t get_min_partition_id() const override { return min_partition_id_; } - inline const common::ObString &get_primary_zone() const { return primary_zone_; } - inline uint64_t get_session_id() const { return session_id_; } - int set_zone_list(const common::ObIArray &zone_list); - int set_zone_list(const common::ObIArray &zone_list); - int get_zone_list(common::ObIArray &zone_list) const; + { + return TPKM_NEW_NO_PK == (enum ObTablePKMode)table_mode_.pk_mode_; + } + inline int set_primary_zone(const common::ObString& primary_zone) + { + return deep_copy_str(primary_zone, primary_zone_); + } + int set_primary_zone_array(const common::ObIArray& primary_zone_array); + inline virtual void set_min_partition_id(uint64_t partition_id) override + { + min_partition_id_ = partition_id; + } + inline void set_session_id(const uint64_t id) + { + session_id_ = id; + } + inline virtual uint64_t get_min_partition_id() const override + { + return min_partition_id_; + } + inline const common::ObString& get_primary_zone() const + { + return primary_zone_; + } + inline uint64_t get_session_id() const + { + return session_id_; + } + int set_zone_list(const common::ObIArray& zone_list); + int set_zone_list(const common::ObIArray& zone_list); + int get_zone_list(common::ObIArray& zone_list) const; virtual int get_zone_list( share::schema::ObSchemaGetterGuard& schema_guard, common::ObIArray& zone_list) const override; virtual int get_primary_zone_inherit( @@ -601,7 +721,7 @@ class ObSimpleTableSchemaV2 : public ObPartitionSchema { } DECLARE_VIRTUAL_TO_STRING; - public: +public: // pkey->pgkey // Note that the following two methods rely on sorted_part_id_partition_array_ and // sorted_part_id_def_subpartition_array_ arrays, These two arrays are generated when the schema is refreshed, so the @@ -611,7 +731,7 @@ class ObSimpleTableSchemaV2 : public ObPartitionSchema { int get_pg_key(const common::ObPartitionKey& pkey, common::ObPGKey& pg_key) const; int get_pg_key(const uint64_t table_id, const int64_t partition_id, common::ObPGKey& pg_key) const; - public: +public: bool is_mock_global_index_invalid() const { return is_mock_global_index_invalid_; @@ -621,11 +741,11 @@ class ObSimpleTableSchemaV2 : public ObPartitionSchema { is_mock_global_index_invalid_ = is_invalid; } - private: +private: static bool compare_part_id(const ObPartition* part, const int64_t part_id); static bool compare_sub_part_id(const ObSubPartition* part, const int64_t sub_part_id); - protected: +protected: uint64_t tenant_id_; uint64_t table_id_; int64_t schema_version_; @@ -684,7 +804,7 @@ class ObSimpleTableSchemaV2 : public ObPartitionSchema { class ObTableSchema : public ObSimpleTableSchemaV2 { OB_UNIS_VERSION(1); - public: +public: friend class AlterTableSchema; friend class ObPrintableTableSchema; enum ObIndexAttributesFlag { @@ -708,7 +828,7 @@ class ObTableSchema : public ObSimpleTableSchemaV2 { static int create_new_idx_name_after_flashback(ObTableSchema& new_table_schema, common::ObString& new_idx_name, common::ObIAllocator& allocator, ObSchemaGetterGuard& guard); - public: +public: typedef ObColumnSchemaV2* const* const_column_iterator; typedef ObConstraint* const* const_constraint_iterator; typedef ObConstraint** constraint_iterator; @@ -1455,7 +1575,7 @@ class ObTableSchema : public ObSimpleTableSchemaV2 { DECLARE_VIRTUAL_TO_STRING; - protected: +protected: int add_col_to_id_hash_array(ObColumnSchemaV2* column); int remove_col_from_id_hash_array(const ObColumnSchemaV2* column); int add_col_to_name_hash_array(ObColumnSchemaV2* column); @@ -1466,12 +1586,12 @@ class ObTableSchema : public ObSimpleTableSchemaV2 { int delete_column_update_prev_id(ObColumnSchemaV2* column); int64_t column_cnt_; - protected: +protected: // constraint related int add_cst_to_cst_array(ObConstraint* cst); int remove_cst_from_cst_array(const ObConstraint* cst); - private: +private: int get_default_row( get_default_value func, const common::ObIArray& column_ids, common::ObNewRow& default_row) const; inline int64_t get_id_hash_array_mem_size(const int64_t column_cnt) const; @@ -1485,10 +1605,10 @@ class ObTableSchema : public ObSimpleTableSchemaV2 { ObConstraint* get_constraint_internal(std::function func); const ObConstraint* get_constraint_internal(std::function func) const; - protected: +protected: int add_mv_tid(const uint64_t mv_tid); - protected: +protected: uint64_t max_used_column_id_; uint64_t max_used_constraint_id_; // Only temporary table settings, according to the last active time of the session @@ -1587,10 +1707,10 @@ class ObTableSchema : public ObSimpleTableSchemaV2 { }; class ObPrintableTableSchema final : public ObTableSchema { - public: +public: DECLARE_VIRTUAL_TO_STRING; - private: +private: ObPrintableTableSchema() = delete; }; @@ -1889,7 +2009,7 @@ int ObTableSchema::add_column(const ColumnType& column) } class ObColumnIterByPrevNextID { - public: +public: explicit ObColumnIterByPrevNextID(const ObTableSchema& table_schema) : is_end_(false), table_schema_(table_schema), last_column_schema_(NULL), last_iter_(NULL) {} @@ -1898,7 +2018,7 @@ class ObColumnIterByPrevNextID { int next(const ObColumnSchemaV2*& column_schema); const ObColumnSchemaV2* get_first_column() const; - private: +private: bool is_end_; const ObTableSchema& table_schema_; const ObColumnSchemaV2* last_column_schema_; diff --git a/src/share/schema/ob_table_sql_service.h b/src/share/schema/ob_table_sql_service.h index 85549d793..4ef3c0b52 100644 --- a/src/share/schema/ob_table_sql_service.h +++ b/src/share/schema/ob_table_sql_service.h @@ -31,7 +31,7 @@ class ObTableSchema; class ObColumnSchemaV2; class ObTableSqlService : public ObDDLSqlService { - public: +public: explicit ObTableSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service), sql_proxy_(NULL) {} virtual ~ObTableSqlService() @@ -159,7 +159,7 @@ class ObTableSqlService : public ObDDLSqlService { int update_check_constraint_state( common::ObISQLClient& sql_client, const ObTableSchema& table, const ObConstraint& cst); - private: +private: int add_table(common::ObISQLClient& sql_client, const ObTableSchema& table, const bool only_history = false); int delete_from_all_table(common::ObISQLClient& sql_client, const uint64_t table_id); int delete_from_all_table_stat(common::ObISQLClient& sql_client, const uint64_t table_id); @@ -223,11 +223,11 @@ class ObTableSqlService : public ObDDLSqlService { uint64_t child_column_id, uint64_t parent_column_id, int64_t position, share::ObDMLSqlSplicer& dml); int check_table_options(const share::schema::ObTableSchema& table_schema); - public: +public: int log_operation_wrapper(ObSchemaOperation& opt, common::ObISQLClient& sql_client); int insert_temp_table_info(common::ObISQLClient& trans, const ObTableSchema& table_schema); - private: +private: int exec_update(common::ObISQLClient& sql_client, const uint64_t table_id, const char* table_name, share::ObDMLSqlSplicer& dml, int64_t& affected_rows); int exec_insert(common::ObISQLClient& sql_client, const uint64_t table_id, const char* table_name, @@ -239,16 +239,16 @@ class ObTableSqlService : public ObDDLSqlService { bool is_user_partition_table(const ObTableSchema& table_schema); bool is_user_subpartition_table(const ObTableSchema& table); - public: +public: void init(common::ObMySQLProxy* sql_proxy) { sql_proxy_ = sql_proxy; } - private: +private: common::ObMySQLProxy* sql_proxy_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableSqlService); }; diff --git a/src/share/schema/ob_tablegroup_sql_service.h b/src/share/schema/ob_tablegroup_sql_service.h index b52837663..8bb4e91db 100644 --- a/src/share/schema/ob_tablegroup_sql_service.h +++ b/src/share/schema/ob_tablegroup_sql_service.h @@ -22,7 +22,7 @@ namespace schema { class ObTablegroupSchema; class ObTablegroupSqlService : public ObDDLSqlService { - public: +public: ObTablegroupSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObTablegroupSqlService() @@ -55,7 +55,7 @@ class ObTablegroupSqlService : public ObDDLSqlService { common::ObISQLClient& client, const ObSchemaOperationType op_type, const ObTablegroupSchema& tablegroup_schema); int check_tablegroup_options(const share::schema::ObTablegroupSchema& tablegroup); - private: +private: int add_tablegroup( common::ObISQLClient& sql_client, const share::schema::ObTablegroupSchema& tablegroup, const bool only_history); diff --git a/src/share/schema/ob_tenant_sql_service.h b/src/share/schema/ob_tenant_sql_service.h index f0d5bd806..c185c95bf 100644 --- a/src/share/schema/ob_tenant_sql_service.h +++ b/src/share/schema/ob_tenant_sql_service.h @@ -25,7 +25,7 @@ struct ObSchemaOperation; class ObTenantSchema; class ObTenantSqlService : public ObDDLSqlService { - public: +public: ObTenantSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObTenantSqlService() @@ -45,11 +45,11 @@ class ObTenantSqlService : public ObDDLSqlService { common::ObISQLClient& sql_client, const common::ObString* ddl_stmt_str = NULL); virtual int delete_tenant_content(common::ObISQLClient& client, const uint64_t tenant_id, const char* table_name); - private: +private: int replace_tenant(const ObTenantSchema& tenant_schema, const ObSchemaOperationType op, common::ObISQLClient& sql_client, const common::ObString* ddl_stmt_str); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantSqlService); }; diff --git a/src/share/schema/ob_udf.h b/src/share/schema/ob_udf.h index 2dc4d8305..b6134343a 100644 --- a/src/share/schema/ob_udf.h +++ b/src/share/schema/ob_udf.h @@ -27,7 +27,7 @@ class ObTableSchema; class ObUDF : public ObSchema { OB_UNIS_VERSION_V(1); - public: +public: enum UDFType { UDF_TYPE_UNINITIAL, FUNCTION, AGGREGATE }; enum UDFRetType { @@ -39,7 +39,7 @@ class ObUDF : public ObSchema { ROW, }; - public: +public: ObUDF() : ObSchema(), tenant_id_(common::OB_INVALID_ID), @@ -161,7 +161,7 @@ class ObUDF : public ObSchema { TO_STRING_KV(K_(tenant_id), K_(udf_id), K_(name), K_(ret), K_(dl), K_(type), K_(schema_version)); - private: +private: uint64_t tenant_id_; uint64_t udf_id_; common::ObString name_; @@ -176,7 +176,7 @@ class ObUDF : public ObSchema { class ObUDFMeta { OB_UNIS_VERSION_V(1); - public: +public: ObUDFMeta() : tenant_id_(common::OB_INVALID_ID), name_(), diff --git a/src/share/schema/ob_udf_mgr.h b/src/share/schema/ob_udf_mgr.h index 1963bd84f..09bb9551b 100644 --- a/src/share/schema/ob_udf_mgr.h +++ b/src/share/schema/ob_udf_mgr.h @@ -24,7 +24,7 @@ namespace share { namespace schema { class ObSimpleUDFSchema : public ObSchema { - public: +public: ObSimpleUDFSchema(); explicit ObSimpleUDFSchema(common::ObIAllocator* allocator); ObSimpleUDFSchema(const ObSimpleUDFSchema& src_schema); @@ -132,7 +132,7 @@ class ObSimpleUDFSchema : public ObSchema { return udf_name_; } - private: +private: uint64_t tenant_id_; uint64_t udf_id_; common::ObString udf_name_; @@ -152,7 +152,7 @@ struct ObGetUDFKey { }; class ObUDFHashWrapper { - public: +public: ObUDFHashWrapper() : tenant_id_(common::OB_INVALID_ID), udf_name_() {} ObUDFHashWrapper(uint64_t tenant_id, const common::ObString& udf_name) : tenant_id_(tenant_id), udf_name_(udf_name) @@ -188,7 +188,7 @@ class ObUDFHashWrapper { } TO_STRING_KV(K_(tenant_id), K_(udf_name)); - private: +private: uint64_t tenant_id_; common::ObString udf_name_; }; @@ -207,7 +207,7 @@ struct ObGetUDFKey { }; class ObUDFMgr { - public: +public: typedef common::ObSortedVector UDFInfos; typedef common::hash::ObPointerHashMap ObUDFMap; typedef UDFInfos::iterator UDFIter; @@ -244,11 +244,11 @@ class ObUDFMgr { } static int rebuild_udf_hashmap(const UDFInfos& udf_infos, ObUDFMap& udf_map); - private: +private: inline static bool compare_with_tenant_udf_id(const ObSimpleUDFSchema* lhs, const ObTenantUDFId& tenant_outline_id); inline static bool equal_to_tenant_udf_id(const ObSimpleUDFSchema* lhs, const ObTenantUDFId& tenant_outline_id); - private: +private: bool is_inited_; common::ObArenaAllocator local_allocator_; common::ObIAllocator& allocator_; diff --git a/src/share/schema/ob_udf_sql_service.h b/src/share/schema/ob_udf_sql_service.h index 7d77c799e..3efb51261 100644 --- a/src/share/schema/ob_udf_sql_service.h +++ b/src/share/schema/ob_udf_sql_service.h @@ -26,7 +26,7 @@ namespace schema { class ObUDF; class ObUDFSqlService : public ObDDLSqlService { - public: +public: ObUDFSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObUDFSqlService() @@ -46,10 +46,10 @@ class ObUDFSqlService : public ObDDLSqlService { virtual int drop_udf(const ObUDF& udf_info, const int64_t new_schema_version, common::ObISQLClient* sql_client, const common::ObString* ddl_stmt_str = NULL); - private: +private: int add_udf(common::ObISQLClient& sql_client, const ObUDF& udf_info, const bool only_history = false); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUDFSqlService); }; diff --git a/src/share/schema/ob_user_sql_service.h b/src/share/schema/ob_user_sql_service.h index d35b72925..cdcdb7c14 100644 --- a/src/share/schema/ob_user_sql_service.h +++ b/src/share/schema/ob_user_sql_service.h @@ -26,7 +26,7 @@ namespace schema { class ObUserInfo; class ObUserSqlService : public ObDDLSqlService { - public: +public: ObUserSqlService(ObSchemaService& schema_service) : ObDDLSqlService(schema_service) {} virtual ~ObUserSqlService() @@ -59,12 +59,12 @@ class ObUserSqlService : public ObDDLSqlService { virtual int replace_user(const ObUserInfo& user, const int64_t new_schema_version, const common::ObString* ddl_stmt_str, common::ObISQLClient& sql_client, const ObSchemaOperationType type); - private: +private: int drop_user_delete_role_grantee_map(const uint64_t tenant_id, bool is_role, const uint64_t new_schema_version, const ObUserInfo* user, const ObString* ddl_stmt_str, ObISQLClient& sql_client, share::schema::ObSchemaGetterGuard& schema_guard); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUserSqlService); }; diff --git a/src/share/sequence/ob_sequence_cache.h b/src/share/sequence/ob_sequence_cache.h index 69e0d1d00..979da0590 100644 --- a/src/share/sequence/ob_sequence_cache.h +++ b/src/share/sequence/ob_sequence_cache.h @@ -57,14 +57,14 @@ struct SequenceCacheNode { return end_.val(); } - private: +private: ObSequenceValue start_; ObSequenceValue end_; }; // a wrapper class, adaptor for ObLinkHashMap struct CacheItemKey { - public: +public: CacheItemKey() : key_(0) {} CacheItemKey(const uint64_t key) : key_(key) @@ -91,7 +91,7 @@ struct CacheItemKey { }; struct ObSequenceCacheItem : public common::LinkHashValue { - public: +public: ObSequenceCacheItem() : prefetching_(false), with_prefetch_node_(false), @@ -126,7 +126,7 @@ struct ObSequenceCacheItem : public common::LinkHashValue { return last_number_.val(); } - public: +public: SequenceCacheNode curr_node_; SequenceCacheNode prefetch_node_; // avoid concurrent prefetch @@ -137,20 +137,20 @@ struct ObSequenceCacheItem : public common::LinkHashValue { int64_t last_refresh_ts_; lib::ObMutex alloc_mutex_; - private: +private: ObSequenceValue last_number_; - public: +public: TO_STRING_KV(K_(curr_node), K_(prefetch_node), K_(prefetching), K_(with_prefetch_node), K_(last_refresh_ts), K_(last_number), K_(base_on_last_number)); }; class ObSequenceCache { - public: +public: // map sequence_id => sequence cache typedef common::ObLinkHashMap NodeMap; - public: +public: ObSequenceCache(); virtual ~ObSequenceCache() = default; static ObSequenceCache& get_instance(); @@ -159,7 +159,7 @@ class ObSequenceCache { int nextval(const share::schema::ObSequenceSchema& schema, common::ObIAllocator& allocator, ObSequenceValue& nextval); int remove(uint64_t sequence_id); - private: +private: /* functions */ int get_item(CacheItemKey& key, ObSequenceCacheItem*& item); diff --git a/src/share/sequence/ob_sequence_ddl_proxy.h b/src/share/sequence/ob_sequence_ddl_proxy.h index cf35806d1..ddc0b8942 100644 --- a/src/share/sequence/ob_sequence_ddl_proxy.h +++ b/src/share/sequence/ob_sequence_ddl_proxy.h @@ -29,7 +29,7 @@ class ObMultiVersionSchemaService; } // namespace schema class ObSequenceDDLProxy { - public: +public: ObSequenceDDLProxy(share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& sql_proxy); virtual ~ObSequenceDDLProxy(); int create_sequence(share::schema::ObSequenceSchema& seq_schema, const common::ObBitSet<>& opt_bitset, @@ -43,7 +43,7 @@ class ObSequenceDDLProxy { int rename_sequence(share::schema::ObSequenceSchema& seq_schema, common::ObMySQLTransaction& trans, const common::ObString* ddl_stmt_str); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObSequenceDDLProxy); diff --git a/src/share/sequence/ob_sequence_dml_proxy.h b/src/share/sequence/ob_sequence_dml_proxy.h index 4550ad297..5cb4ad505 100644 --- a/src/share/sequence/ob_sequence_dml_proxy.h +++ b/src/share/sequence/ob_sequence_dml_proxy.h @@ -36,7 +36,7 @@ class ObSequenceSchema; class ObMultiVersionSchemaService; } // namespace schema class ObSequenceDMLProxy { - public: +public: ObSequenceDMLProxy(); virtual ~ObSequenceDMLProxy(); void init(share::schema::ObMultiVersionSchemaService& schema_service, common::ObMySQLProxy& sql_proxy); @@ -51,7 +51,7 @@ class ObSequenceDMLProxy { int prefetch_next_batch(const uint64_t tenant_id, const uint64_t sequence_id, const share::ObSequenceOption& option, SequenceCacheNode& cache_range); - private: +private: /* functions */ int set_pre_op_timeout(common::ObTimeoutCtx& ctx); int init_sequence_value_table(common::ObMySQLTransaction& trans, common::ObSQLClientRetryWeak& sql_client_retry_weak, diff --git a/src/share/sequence/ob_sequence_option.h b/src/share/sequence/ob_sequence_option.h index dc19519c8..4b038033d 100644 --- a/src/share/sequence/ob_sequence_option.h +++ b/src/share/sequence/ob_sequence_option.h @@ -35,19 +35,19 @@ enum ObSequenceArg { }; struct ObSequenceValueAllocator : public common::ObDataBuffer { - public: +public: ObSequenceValueAllocator() : ObDataBuffer(static_cast(buf_), common::number::ObNumber::MAX_BYTE_LEN) {} ~ObSequenceValueAllocator() = default; - private: +private: char buf_[common::number::ObNumber::MAX_BYTE_LEN]; }; struct ObSequenceValue { OB_UNIS_VERSION(1); - public: +public: ObSequenceValue(); ObSequenceValue(int64_t init_val); int assign(const ObSequenceValue& other); @@ -64,13 +64,13 @@ struct ObSequenceValue { } TO_STRING_KV("val", val_.format()); - private: +private: char buf_[common::number::ObNumber::MAX_BYTE_LEN]; common::number::ObNumber val_; }; struct ObSequenceMaxMinInitializer { - public: +public: ObSequenceMaxMinInitializer(); // Oracle defaults to 28 integers of 9s and 27 negatives of 9s @@ -97,10 +97,10 @@ struct ObSequenceMaxMinInitializer { class ObSequenceOption { OB_UNIS_VERSION(2); - public: +public: static const int64_t NO_CACHE = 1; - public: +public: ObSequenceOption() : increment_by_(static_cast(1)), start_with_(static_cast(0)), @@ -305,7 +305,7 @@ class ObSequenceOption { TO_STRING_KV(K_(increment_by), K_(start_with), K_(maxvalue), K_(minvalue), K_(cache), K_(cycle), K_(order)); - private: +private: ObSequenceValue increment_by_; ObSequenceValue start_with_; ObSequenceValue maxvalue_; diff --git a/src/share/sequence/ob_sequence_option_builder.h b/src/share/sequence/ob_sequence_option_builder.h index 7667831b1..1acb9a1f5 100644 --- a/src/share/sequence/ob_sequence_option_builder.h +++ b/src/share/sequence/ob_sequence_option_builder.h @@ -20,14 +20,14 @@ namespace oceanbase { namespace share { class ObSequenceOption; class ObSequenceOptionBuilder { - public: +public: ObSequenceOptionBuilder() = default; ~ObSequenceOptionBuilder() = default; static int build_create_sequence_option(const common::ObBitSet<>& opt_bitset, share::ObSequenceOption& opt_new); static int build_alter_sequence_option( const common::ObBitSet<>& opt_bitset, const share::ObSequenceOption& opt_old, share::ObSequenceOption& opt_new); - private: +private: static int pre_check_sequence_option(const share::ObSequenceOption& opt); static int check_sequence_option(const common::ObBitSet<>& opt_bitset, const share::ObSequenceOption& opt); static int check_sequence_option_integer(const common::ObBitSet<>& opt_bitset, const share::ObSequenceOption& option); diff --git a/src/share/stat/ob_col_stat_sql_service.h b/src/share/stat/ob_col_stat_sql_service.h index d3457f8e5..7a291cfe4 100644 --- a/src/share/stat/ob_col_stat_sql_service.h +++ b/src/share/stat/ob_col_stat_sql_service.h @@ -53,7 +53,7 @@ struct ObStatConverterInfo { class ObTableColStatSqlService { const static int64_t STATISTIC_WEAK_READ_TIMEOUT = 500000; - public: +public: ObTableColStatSqlService(); ~ObTableColStatSqlService(); @@ -74,7 +74,7 @@ class ObTableColStatSqlService { int64_t idx, ObStatConverterInfo& stat_converter_info); int fill_table_stat(common::sqlclient::ObMySQLResult& result, int64_t& partition_id, ObTableStat& stat); - private: +private: // serialize data to hex-str. append \0 if return OB_SUCCESS //@pos, buf pos used. //@cstr_pos begin of hex-str. @@ -96,10 +96,10 @@ class ObTableColStatSqlService { const share::schema::ObTableSchema* real_table_schema, const ObIArray& column_ids, ObStatConverterInfo& stat_converter_info); - private: +private: static const char* bitmap_compress_lib_name; - private: +private: bool inited_; common::ObMySQLProxy* mysql_proxy_; lib::ObMutex mutex_; diff --git a/src/share/stat/ob_column_stat.h b/src/share/stat/ob_column_stat.h index c0518369e..9fe6837d9 100644 --- a/src/share/stat/ob_column_stat.h +++ b/src/share/stat/ob_column_stat.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace common { class ObColumnStat : public common::ObIKVCacheValue { - public: +public: static const int64_t BUCKET_BITS = 10; // ln2(1024) = 10; static const int64_t TOTAL_BUCKET_BITS = 40; // 6 groups static const int64_t NUM_LLC_BUCKET = (1 << BUCKET_BITS); @@ -30,7 +30,7 @@ class ObColumnStat : public common::ObIKVCacheValue { static const int64_t LARGE_NDV_NUMBER = 2LL << 61; // 2 << 64 is too large for int64_t, and 2 << 61 is enough for ndv static const int64_t MAX_OBJECT_SERIALIZE_SIZE = 512; - public: +public: struct Key : public common::ObIKVCacheKey { uint64_t table_id_; uint64_t partition_id_; @@ -79,7 +79,7 @@ class ObColumnStat : public common::ObIKVCacheValue { TO_STRING_KV(K(table_id_), K(partition_id_), K(column_id_)); }; - public: +public: ObColumnStat(); // construct object to write, maybe failed when dont't have enough memory for llc_bitmap_ or object_buf_ explicit ObColumnStat(common::ObIAllocator& allocator); @@ -230,12 +230,12 @@ class ObColumnStat : public common::ObIKVCacheValue { return is_modified_; } - private: +private: inline void calc_llc_value(const common::ObObj& value); inline uint64_t trailing_zeroes(const uint64_t num); inline double select_alpha_value(const int64_t num_bucket); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObColumnStat); uint64_t table_id_; uint64_t partition_id_; diff --git a/src/share/stat/ob_column_stat_cache.h b/src/share/stat/ob_column_stat_cache.h index 1692f0538..103a754d2 100644 --- a/src/share/stat/ob_column_stat_cache.h +++ b/src/share/stat/ob_column_stat_cache.h @@ -23,7 +23,7 @@ class ObColumnStat; class ObColumnStatValueHandle; class ObColumnStatCache : public common::ObKVCache { - public: +public: ObColumnStatCache(); ~ObColumnStatCache(); @@ -33,7 +33,7 @@ class ObColumnStatCache : public common::ObKVCache { - public: +public: ObOptColumnStatCache() {} ~ObOptColumnStatCache() @@ -46,7 +46,7 @@ class ObOptColumnStatCache : public common::ObKVCache& column_stats); int delete_column_stat(const ObIArray& column_stats); - private: +private: int get_table_stat_sql(const ObOptColumnStat& stat, const int64_t current_time, ObSqlString& sql_string); int get_column_stat_sql(const ObOptColumnStat& stat, const int64_t current_time, ObSqlString& sql_string); int get_histogram_stat_sql(const ObOptColumnStat& stat, common::ObIAllocator& allocator, @@ -57,7 +57,7 @@ class ObOptStatSqlService { int get_obj_binary_hex_str(const common::ObObj& obj, common::ObIAllocator& allocator, common::ObString& out_str); int hex_str_to_obj(const char* buf, int64_t buf_len, common::ObIAllocator& allocator, common::ObObj& obj); - private: +private: int fetch_histogram_stat( const ObOptColumnStat::Key& key, const ObHistogram& basic_histogram_info, ObOptColumnStat& stat); int fill_bucket_stat(sqlclient::ObMySQLResult& result, ObOptColumnStat& stat, int64_t& last_endpoint_num); diff --git a/src/share/stat/ob_opt_table_stat.h b/src/share/stat/ob_opt_table_stat.h index 119a30751..33770f26f 100644 --- a/src/share/stat/ob_opt_table_stat.h +++ b/src/share/stat/ob_opt_table_stat.h @@ -27,7 +27,7 @@ namespace common { * Optimizer Table Level Statistics */ class ObOptTableStat : public common::ObIKVCacheValue { - public: +public: struct Key : public common::ObIKVCacheKey { Key() : table_id_(OB_INVALID_ID), partition_id_(OB_INVALID_INDEX) {} @@ -230,7 +230,7 @@ class ObOptTableStat : public common::ObIKVCacheValue { TO_STRING_KV(K_(last_analyzed)); - private: +private: int64_t sstable_row_count_; int64_t memtable_row_count_; int64_t data_size_; diff --git a/src/share/stat/ob_opt_table_stat_cache.h b/src/share/stat/ob_opt_table_stat_cache.h index 04f109f0c..5df8f4884 100644 --- a/src/share/stat/ob_opt_table_stat_cache.h +++ b/src/share/stat/ob_opt_table_stat_cache.h @@ -22,7 +22,7 @@ namespace common { struct ObOptTableStatHandle; class ObOptTableStatCache : public common::ObKVCache { - public: +public: int get_value(const ObOptTableStat::Key& key, ObOptTableStatHandle& handle); int put_value(const ObOptTableStat::Key& key, const ObOptTableStat& value); int put_and_fetch_value(const ObOptTableStat::Key& key, const ObOptTableStat& value, ObOptTableStatHandle& handle); diff --git a/src/share/stat/ob_stat_manager.h b/src/share/stat/ob_stat_manager.h index 5d89d2328..aab48f0b6 100644 --- a/src/share/stat/ob_stat_manager.h +++ b/src/share/stat/ob_stat_manager.h @@ -26,7 +26,7 @@ struct ObPartitionKey; class ObColumnStatValueHandle; class ObTableStat; class ObColumnStatDataService { - public: +public: virtual ~ObColumnStatDataService() {} virtual int get_column_stat(const ObColumnStat::Key& key, const bool force_new, ObColumnStatValueHandle& handle) = 0; @@ -42,14 +42,14 @@ class ObColumnStatDataService { }; class ObTableStatDataService { - public: +public: virtual ~ObTableStatDataService() {} virtual int get_table_stat(const ObPartitionKey& key, ObTableStat& tstat) = 0; }; class ObStatManager { - public: +public: ObStatManager(); virtual ~ObStatManager(); @@ -58,7 +58,7 @@ class ObStatManager { static ObStatManager& get_instance(); static const ObTableStat& get_default_table_stat(); - public: +public: int update_column_stat(const ObColumnStat& cstat); /** * item in column_stats must not NULL, or will return OB_ERR_UNEXPECTED @@ -76,10 +76,10 @@ class ObStatManager { int erase_table_stat(const common::ObPartitionKey& pkey); int erase_column_stat(const common::ObPartitionKey& pkey, const int64_t column_id); - private: +private: int get_column_stat(const ObColumnStat::Key& key, ObColumnStatValueHandle& handle); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStatManager); ObColumnStatDataService* column_stat_service_; ObTableStatDataService* table_stat_service_; diff --git a/src/share/stat/ob_table_stat.h b/src/share/stat/ob_table_stat.h index 8a7e6dd72..8cbae36ae 100644 --- a/src/share/stat/ob_table_stat.h +++ b/src/share/stat/ob_table_stat.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace common { class ObTableStat : public common::ObIKVCacheValue { - public: +public: struct Key : public common::ObIKVCacheKey { ObPartitionKey pkey_; Key() : pkey_() @@ -117,7 +117,7 @@ class ObTableStat : public common::ObIKVCacheValue { return ret; } - public: +public: int64_t get_data_version() const { return data_version_; @@ -181,7 +181,7 @@ class ObTableStat : public common::ObIKVCacheValue { TO_STRING_KV( K_(row_count), K_(data_size), K_(macro_blocks_num), K_(micro_blocks_num), K_(average_row_size), K_(data_version)); - private: +private: int64_t row_count_; int64_t data_size_; int64_t macro_blocks_num_; diff --git a/src/share/stat/ob_table_stat_cache.h b/src/share/stat/ob_table_stat_cache.h index ab13e2418..e9d36f4ba 100644 --- a/src/share/stat/ob_table_stat_cache.h +++ b/src/share/stat/ob_table_stat_cache.h @@ -24,7 +24,7 @@ class ObTableStat; class ObTableStatValueHandle; class ObTableStatCache : public common::ObKVCache { - public: +public: ObTableStatCache(); ~ObTableStatCache(); diff --git a/src/share/stat/ob_user_tab_col_statistics.h b/src/share/stat/ob_user_tab_col_statistics.h index ec71fd3a4..8e954cbd0 100644 --- a/src/share/stat/ob_user_tab_col_statistics.h +++ b/src/share/stat/ob_user_tab_col_statistics.h @@ -25,7 +25,7 @@ struct ObPartitionKey; class ObServerConfig; class ObColStatService : public ObColumnStatDataService { - public: +public: ObColStatService(); ~ObColStatService(); @@ -37,50 +37,37 @@ class ObColStatService : public ObColumnStatDataService { * Caller should not hold ObColumnStat object for a long time that ObColumnStatCache * can not release it. */ - int get_column_stat(const ObColumnStat::Key &key, - const bool force_new, - ObColumnStatValueHandle &handle) override; + int get_column_stat(const ObColumnStat::Key& key, const bool force_new, ObColumnStatValueHandle& handle) override; /** * same as above interface, except do not hold object in cache instead of deep copy * so %stat can be written in incremental calculation. */ - int get_column_stat(const ObColumnStat::Key &key, - const bool force_new, - ObColumnStat &stat, - ObIAllocator &alloc) override; + int get_column_stat( + const ObColumnStat::Key& key, const bool force_new, ObColumnStat& stat, ObIAllocator& alloc) override; - int get_batch_stat(const uint64_t table_id, - const ObIArray &partition_id, - const ObIArray &column_id, - ObIArray &handles) override; + int get_batch_stat(const uint64_t table_id, const ObIArray& partition_id, + const ObIArray& column_id, ObIArray& handles) override; - int get_batch_stat(const share::schema::ObTableSchema &table_schema, - const uint64_t partition_id, - ObIArray &stats, - ObIAllocator &allocator) override; + int get_batch_stat(const share::schema::ObTableSchema& table_schema, const uint64_t partition_id, + ObIArray& stats, ObIAllocator& allocator) override; /** * item in stats must not NULL, or will return OB_ERR_UNEXPECTED */ - int update_column_stats(const ObIArray &stats) override; - int update_column_stat(const ObColumnStat &stat) override; - int erase_column_stat(const ObPartitionKey &pkey, const int64_t column_id) override; + int update_column_stats(const ObIArray& stats) override; + int update_column_stat(const ObColumnStat& stat) override; + int erase_column_stat(const ObPartitionKey& pkey, const int64_t column_id) override; + private: - int load_and_put_cache(const ObColumnStat::Key &key, - ObColumnStatValueHandle &handle); - int load_and_put_cache(const ObColumnStat::Key &key, - ObColumnStat &new_entry, - ObColumnStatValueHandle &handle); - int batch_load_and_put_cache(const share::schema::ObTableSchema &table_schema, - const uint64_t partition_id, - ObIArray &handles); - int batch_load_and_put_cache(const uint64_t table_id, - const ObIArray &partition_ids, - const ObIArray &column_ids, - ObIArray &handles); - int batch_put_and_fetch_row(ObIArray &col_stats, - ObIArray &handles); - static int deep_copy(ObIAllocator &alloc, const ObColumnStat &src, ObColumnStat &dst); + int load_and_put_cache(const ObColumnStat::Key& key, ObColumnStatValueHandle& handle); + int load_and_put_cache(const ObColumnStat::Key& key, ObColumnStat& new_entry, ObColumnStatValueHandle& handle); + int batch_load_and_put_cache(const share::schema::ObTableSchema& table_schema, const uint64_t partition_id, + ObIArray& handles); + int batch_load_and_put_cache(const uint64_t table_id, const ObIArray& partition_ids, + const ObIArray& column_ids, ObIArray& handles); + int batch_put_and_fetch_row(ObIArray& col_stats, ObIArray& handles); + static int deep_copy(ObIAllocator& alloc, const ObColumnStat& src, ObColumnStat& dst); + private: ObTableColStatSqlService sql_service_; ObColumnStatCache column_stat_cache_; @@ -88,7 +75,7 @@ private: }; // end of class ObColStatService class ObTableStatService : public ObTableStatDataService { - public: +public: ObTableStatService(); ~ObTableStatService(); @@ -96,13 +83,13 @@ class ObTableStatService : public ObTableStatDataService { virtual int get_table_stat(const common::ObPartitionKey& key, ObTableStat& tstat); int erase_table_stat(const common::ObPartitionKey& pkey); - private: +private: int load_and_put_cache(ObTableStat::Key& key, ObTableStatValueHandle& handle); - private: +private: static const int64_t DEFAULT_USER_TAB_STAT_CACHE_PRIORITY = 1; - private: +private: ObTableColStatSqlService sql_service_; ObTableStatDataService* service_cache_; ObTableStatCache table_stat_cache_; diff --git a/src/share/system_variable/ob_system_variable.h b/src/share/system_variable/ob_system_variable.h index eecd436c5..1dd68f3de 100644 --- a/src/share/system_variable/ob_system_variable.h +++ b/src/share/system_variable/ob_system_variable.h @@ -26,7 +26,7 @@ class ObBasicSessionInfo; namespace share { class ObSpecialSysVarValues { - public: +public: // OB_SV_VERSION_COMMENT const static int64_t VERSION_COMMENT_MAX_LEN = 256; static char version_comment_[VERSION_COMMENT_MAX_LEN]; @@ -46,12 +46,12 @@ class ObSpecialSysVarValues { static const int64_t COLL_INT_STR_MAX_LEN = 64; static char default_coll_int_str_[COLL_INT_STR_MAX_LEN]; - public: +public: ObSpecialSysVarValues(); }; class ObSetVar { - public: +public: enum SetScopeType { /* * most system variables can be set with: @@ -95,12 +95,12 @@ class ObSetVar { TO_STRING_KV(K_(var_name), K_(set_scope), K_(is_set_default), K_(actual_tenant_id)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetVar); }; class ObSysVarTypeLib { - public: +public: // ObSysVarTypeLib() : count_(0), type_names_(NULL) {} ObSysVarTypeLib(const char** type_names) // last elem must be 0 : count_(0), type_names_(NULL) @@ -124,14 +124,14 @@ class ObSysVarTypeLib { int64_t count_; const char** type_names_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVarTypeLib); }; class ObBasicSysVar { OB_UNIS_VERSION_V(1); - public: +public: static const char* EMPTY_STRING; typedef int (*OnCheckAndConvertFunc)(sql::ObExecContext& ctx, const ObSetVar& set_var, const ObBasicSysVar& sys_var, const common::ObObj& in_val, common::ObObj& out_val); @@ -147,7 +147,7 @@ class ObBasicSysVar { return (flag & ObSysVarFlag::NULLABLE) && (value == common::ObString::make_string(ObBasicSysVar::EMPTY_STRING)); } - public: +public: ObBasicSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL, bool is_enum_type = false) @@ -261,7 +261,7 @@ class ObBasicSysVar { common::ObString& coll_var_name, common::ObString& coll_val, common::ObCollationType& coll_type); DECLARE_TO_STRING; - protected: +protected: // Currently there is a simple principle for the setting operation of base_value and inc_value: // 1. Only base_value and min_value/max_value will be set together, and there is no need to judge whether base_value // is valid. Currently there is only the init interface. @@ -275,12 +275,12 @@ class ObBasicSysVar { common::ObObjType type_; int64_t flags_; - protected: +protected: int log_err_wrong_value_for_var(int error_no, const common::ObObj& val) const; int check_and_convert_int_tc_value(const common::ObObj& value, int64_t invalid_value, int64_t& result_value) const; int check_and_convert_uint_tc_value(const common::ObObj& value, uint64_t invalid_value, uint64_t& result_value) const; - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); OnCheckAndConvertFunc on_check_and_convert_; @@ -290,12 +290,12 @@ class ObBasicSysVar { GetMetaTypeFunc get_meta_type_; bool is_enum_type_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBasicSysVar); }; class ObTypeLibSysVar : public ObBasicSysVar { - public: +public: ObTypeLibSysVar(const char** type_names, OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL, bool is_enum_type = false) @@ -311,19 +311,19 @@ class ObTypeLibSysVar : public ObBasicSysVar { common::ObIAllocator& allocator, const sql::ObBasicSessionInfo& session, common::ObString& show_str) const; int find_type(const common::ObString& type, int64_t& type_index) const; - protected: +protected: ObSysVarTypeLib type_lib_; - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTypeLibSysVar); }; class ObEnumSysVar : public ObTypeLibSysVar { - public: +public: ObEnumSysVar(const char** type_names, OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) @@ -336,15 +336,15 @@ class ObEnumSysVar : public ObTypeLibSysVar { virtual int inner_to_select_obj( common::ObIAllocator& allocator, const sql::ObBasicSessionInfo& session, common::ObObj& select_obj) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObEnumSysVar); }; class ObBoolSysVar : public ObTypeLibSysVar { - public: +public: const static char* BOOL_TYPE_NAMES[]; - public: +public: ObBoolSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObTypeLibSysVar( @@ -353,7 +353,7 @@ class ObBoolSysVar : public ObTypeLibSysVar { virtual ~ObBoolSysVar() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBoolSysVar); }; @@ -361,7 +361,7 @@ class ObBoolSysVar : public ObTypeLibSysVar { class ObSetSysVar : public ObTypeLibSysVar { static const int64_t MAX_STR_BUF_LEN = 512; - public: +public: ObSetSysVar(const char** type_names, OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObTypeLibSysVar(type_names, on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -370,16 +370,16 @@ class ObSetSysVar : public ObTypeLibSysVar { {} int find_set(const common::ObString& value); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetSysVar); }; ////////////////////////////// class ObSqlModeVar : public ObSetSysVar { - public: +public: const static char* SQL_MODE_NAMES[]; - public: +public: ObSqlModeVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObSetSysVar( @@ -388,18 +388,18 @@ class ObSqlModeVar : public ObSetSysVar { virtual ~ObSqlModeVar() {} - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlModeVar); }; ////////////////////////////// class ObSysVarAccessMode : public ObBoolSysVar { - public: +public: ObSysVarAccessMode(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObBoolSysVar(on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -407,13 +407,13 @@ class ObSysVarAccessMode : public ObBoolSysVar { virtual ~ObSysVarAccessMode() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVarAccessMode); }; ///////////////////////////// class ObCharsetSysVar : public ObBasicSysVar { - public: +public: ObCharsetSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObBasicSysVar(on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -422,17 +422,17 @@ class ObCharsetSysVar : public ObBasicSysVar { {} virtual int check_update_type(const ObSetVar& set_var, const common::ObObj& val); - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCharsetSysVar); }; ///////////////////////////// class ObTinyintSysVar : public ObBasicSysVar { - public: +public: ObTinyintSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObBasicSysVar(on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -441,16 +441,16 @@ class ObTinyintSysVar : public ObBasicSysVar { {} virtual int check_update_type(const ObSetVar& set_var, const common::ObObj& val); - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTinyintSysVar); }; class ObIntSysVar : public ObBasicSysVar { - public: +public: ObIntSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObBasicSysVar(on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -459,18 +459,18 @@ class ObIntSysVar : public ObBasicSysVar { {} virtual int check_update_type(const ObSetVar& set_var, const common::ObObj& val); - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); virtual int do_convert( sql::ObExecContext& ctx, const common::ObObj& in_val, common::ObObj& out_val, bool& is_converted); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIntSysVar); }; class ObStrictRangeIntSysVar : public ObIntSysVar { - public: +public: ObStrictRangeIntSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObIntSysVar(on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -478,16 +478,16 @@ class ObStrictRangeIntSysVar : public ObIntSysVar { virtual ~ObStrictRangeIntSysVar() {} - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStrictRangeIntSysVar); }; class ObNumericSysVar : public ObBasicSysVar { - public: +public: ObNumericSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObBasicSysVar(on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -496,18 +496,18 @@ class ObNumericSysVar : public ObBasicSysVar { {} virtual int check_update_type(const ObSetVar& set_var, const common::ObObj& val); - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); virtual int do_convert( sql::ObExecContext& ctx, const common::ObObj& in_val, common::ObObj& out_val, bool& is_converted); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNumericSysVar); }; class ObVarcharSysVar : public ObBasicSysVar { - public: +public: ObVarcharSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObBasicSysVar(on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -516,16 +516,16 @@ class ObVarcharSysVar : public ObBasicSysVar { {} virtual int check_update_type(const ObSetVar& set_var, const common::ObObj& val); - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVarcharSysVar); }; class ObTimeZoneSysVar : public ObBasicSysVar { - public: +public: ObTimeZoneSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) : ObBasicSysVar(on_check_and_convert, on_update, to_select_obj, to_show_str, get_meta_type) @@ -534,20 +534,20 @@ class ObTimeZoneSysVar : public ObBasicSysVar { {} virtual int check_update_type(const ObSetVar& set_var, const common::ObObj& val); - private: +private: virtual int do_check_and_convert( sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val, common::ObObj& out_val); int find_pos_time_zone(sql::ObExecContext& ctx, const common::ObString& str_val, const bool is_oracle_compatible); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTimeZoneSysVar); }; class ObSessionSpecialIntSysVar : public ObIntSysVar { - public: +public: typedef int (*SessionSpecialUpdateFunc)(sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& val); - public: +public: ObSessionSpecialIntSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, SessionSpecialUpdateFunc session_special_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) @@ -569,18 +569,18 @@ class ObSessionSpecialIntSysVar : public ObIntSysVar { return ret; } - private: +private: SessionSpecialUpdateFunc session_special_update_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSessionSpecialIntSysVar); }; class ObSessionSpecialVarcharSysVar : public ObVarcharSysVar { - public: +public: typedef int (*SessionSpecialUpdateFunc)(sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& val); - public: +public: ObSessionSpecialVarcharSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, SessionSpecialUpdateFunc session_special_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) @@ -602,18 +602,18 @@ class ObSessionSpecialVarcharSysVar : public ObVarcharSysVar { return ret; } - private: +private: SessionSpecialUpdateFunc session_special_update_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSessionSpecialVarcharSysVar); }; class ObSessionSpecialBoolSysVar : public ObBoolSysVar { - public: +public: typedef int (*SessionSpecialUpdateFunc)(sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& val); - public: +public: ObSessionSpecialBoolSysVar(OnCheckAndConvertFunc on_check_and_convert = NULL, OnUpdateFunc on_update = NULL, SessionSpecialUpdateFunc session_special_update = NULL, ToObjFunc to_select_obj = NULL, ToStrFunc to_show_str = NULL, GetMetaTypeFunc get_meta_type = NULL) @@ -635,21 +635,21 @@ class ObSessionSpecialBoolSysVar : public ObBoolSysVar { return ret; } - private: +private: SessionSpecialUpdateFunc session_special_update_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSessionSpecialBoolSysVar); }; class ObSysVarOnCheckFuncs { - public: +public: ObSysVarOnCheckFuncs() {} virtual ~ObSysVarOnCheckFuncs() {} - public: +public: static int check_and_convert_timestamp_service(sql::ObExecContext& ctx, const ObSetVar& set_var, const ObBasicSysVar& sys_var, const common::ObObj& in_val, common::ObObj& out_val); static int check_and_convert_max_allowed_packet(sql::ObExecContext& ctx, const ObSetVar& set_var, @@ -681,24 +681,24 @@ class ObSysVarOnCheckFuncs { static int check_and_convert_sql_throttle_queue_time(sql::ObExecContext& ctx, const ObSetVar& set_var, const ObBasicSysVar& sys_var, const common::ObObj& in_val, common::ObObj& out_val); - private: +private: static int check_session_readonly(sql::ObExecContext& ctx, const ObSetVar& set_var, const ObBasicSysVar& sys_var, const common::ObObj& in_val, common::ObObj& out_val); static bool can_set_trans_var(ObSetVar::SetScopeType scope, sql::ObBasicSessionInfo& session); static int get_string(const common::ObObj& val, common::ObString& str); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVarOnCheckFuncs); }; class ObSysVarOnUpdateFuncs { - public: +public: ObSysVarOnUpdateFuncs() {} virtual ~ObSysVarOnUpdateFuncs() {} - public: +public: static int update_tx_isolation( sql::ObExecContext& ctx, const ObSetVar& set_var, const ObBasicSysVar& sys_var, const common::ObObj& val); static int update_tx_read_only_no_scope( @@ -708,7 +708,7 @@ class ObSysVarOnUpdateFuncs { static int update_safe_weak_read_snapshot( sql::ObExecContext& ctx, const ObSetVar& set_var, const ObBasicSysVar& sys_var, const common::ObObj& val); - private: +private: static int restart_trans( sql::ObExecContext& ctx, sql::ObBasicSessionInfo& session, bool read_only, int32_t isolation); static int start_trans(sql::ObExecContext& ctx); @@ -717,13 +717,13 @@ class ObSysVarOnUpdateFuncs { }; class ObSysVarToObjFuncs { - public: +public: ObSysVarToObjFuncs() {} virtual ~ObSysVarToObjFuncs() {} - public: +public: static int to_obj_charset(common::ObIAllocator& allocator, const sql::ObBasicSessionInfo& session, const ObBasicSysVar& sys_var, common::ObObj& result_obj); static int to_obj_collation(common::ObIAllocator& allocator, const sql::ObBasicSessionInfo& session, @@ -731,18 +731,18 @@ class ObSysVarToObjFuncs { static int to_obj_sql_mode(common::ObIAllocator& allocator, const sql::ObBasicSessionInfo& session, const ObBasicSysVar& sys_var, common::ObObj& result_obj); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVarToObjFuncs); }; class ObSysVarToStrFuncs { - public: +public: ObSysVarToStrFuncs() {} virtual ~ObSysVarToStrFuncs() {} - public: +public: static int to_str_charset(common::ObIAllocator& allocator, const sql::ObBasicSessionInfo& session, const ObBasicSysVar& sys_var, common::ObString& result_str); static int to_str_collation(common::ObIAllocator& allocator, const sql::ObBasicSessionInfo& session, @@ -750,35 +750,35 @@ class ObSysVarToStrFuncs { static int to_str_sql_mode(common::ObIAllocator& allocator, const sql::ObBasicSessionInfo& session, const ObBasicSysVar& sys_var, common::ObString& result_str); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVarToStrFuncs); }; class ObSysVarGetMetaTypeFuncs { - public: +public: ObSysVarGetMetaTypeFuncs() {} virtual ~ObSysVarGetMetaTypeFuncs() {} - public: +public: static common::ObObjType get_meta_type_varchar() { return common::ObVarcharType; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVarGetMetaTypeFuncs); }; class ObSysVarSessionSpecialUpdateFuncs { - public: +public: ObSysVarSessionSpecialUpdateFuncs() {} virtual ~ObSysVarSessionSpecialUpdateFuncs() {} - public: +public: // @@identiy alias to @@last_insert_id static int update_identity(sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& val); static int update_last_insert_id(sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& val); @@ -787,12 +787,12 @@ class ObSysVarSessionSpecialUpdateFuncs { // @@tx_read_only alias to @@transaction_read_only static int update_tx_read_only(sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& val); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVarSessionSpecialUpdateFuncs); }; class ObCharsetSysVarPair { - public: +public: static const int64_t SYS_CHARSET_SYS_VAR_PAIR_COUNT = 3; static ObCharsetSysVarPair CHARSET_SYS_VAR_PAIRS[SYS_CHARSET_SYS_VAR_PAIR_COUNT]; @@ -808,16 +808,16 @@ class ObCharsetSysVarPair { static int get_charset_var_by_collation_var(const common::ObString& coll_var_name, common::ObString& cs_var_name); static int get_collation_var_by_charset_var(const common::ObString& cs_var_name, common::ObString& coll_var_name); - private: +private: common::ObString cs_var_name_; common::ObString coll_var_name_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCharsetSysVarPair); }; class ObBinlogRowImage { - public: +public: enum ImageType { MINIMAL = 0, NOBLOB = 1, @@ -828,32 +828,32 @@ class ObBinlogRowImage { virtual ~ObBinlogRowImage() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBinlogRowImage); }; class ObPreProcessSysVars { - public: +public: ObPreProcessSysVars() {} virtual ~ObPreProcessSysVars() {} - public: +public: static int init_sys_var(); - private: +private: static int change_initial_value(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPreProcessSysVars); }; class ObSysVarUtils { - public: +public: static int log_bounds_error_or_warning(sql::ObExecContext& ctx, const ObSetVar& set_var, const common::ObObj& in_val); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysVarUtils); }; diff --git a/src/share/system_variable/ob_system_variable_factory.h b/src/share/system_variable/ob_system_variable_factory.h index 38c1a5897..bfd582721 100644 --- a/src/share/system_variable/ob_system_variable_factory.h +++ b/src/share/system_variable/ob_system_variable_factory.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace share { class ObSysVarAutoIncrementIncrement : public ObIntSysVar { - public: +public: ObSysVarAutoIncrementIncrement() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -34,7 +34,7 @@ class ObSysVarAutoIncrementIncrement : public ObIntSysVar { } }; class ObSysVarAutoIncrementOffset : public ObIntSysVar { - public: +public: ObSysVarAutoIncrementOffset() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -47,7 +47,7 @@ class ObSysVarAutoIncrementOffset : public ObIntSysVar { } }; class ObSysVarAutocommit : public ObBoolSysVar { - public: +public: ObSysVarAutocommit() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -60,7 +60,7 @@ class ObSysVarAutocommit : public ObBoolSysVar { } }; class ObSysVarCharacterSetClient : public ObCharsetSysVar { - public: +public: ObSysVarCharacterSetClient() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_charset_not_null, NULL, ObSysVarToObjFuncs::to_obj_charset, ObSysVarToStrFuncs::to_str_charset, @@ -76,7 +76,7 @@ class ObSysVarCharacterSetClient : public ObCharsetSysVar { } }; class ObSysVarCharacterSetConnection : public ObCharsetSysVar { - public: +public: ObSysVarCharacterSetConnection() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_charset_not_null, NULL, ObSysVarToObjFuncs::to_obj_charset, ObSysVarToStrFuncs::to_str_charset, @@ -92,7 +92,7 @@ class ObSysVarCharacterSetConnection : public ObCharsetSysVar { } }; class ObSysVarCharacterSetDatabase : public ObCharsetSysVar { - public: +public: ObSysVarCharacterSetDatabase() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_charset_not_null, NULL, ObSysVarToObjFuncs::to_obj_charset, ObSysVarToStrFuncs::to_str_charset, @@ -108,7 +108,7 @@ class ObSysVarCharacterSetDatabase : public ObCharsetSysVar { } }; class ObSysVarCharacterSetResults : public ObCharsetSysVar { - public: +public: ObSysVarCharacterSetResults() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_charset, NULL, ObSysVarToObjFuncs::to_obj_charset, ObSysVarToStrFuncs::to_str_charset, ObSysVarGetMetaTypeFuncs::get_meta_type_varchar) @@ -123,7 +123,7 @@ class ObSysVarCharacterSetResults : public ObCharsetSysVar { } }; class ObSysVarCharacterSetServer : public ObCharsetSysVar { - public: +public: ObSysVarCharacterSetServer() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_charset_not_null, NULL, ObSysVarToObjFuncs::to_obj_charset, ObSysVarToStrFuncs::to_str_charset, @@ -139,7 +139,7 @@ class ObSysVarCharacterSetServer : public ObCharsetSysVar { } }; class ObSysVarCharacterSetSystem : public ObCharsetSysVar { - public: +public: ObSysVarCharacterSetSystem() : ObCharsetSysVar(NULL, NULL, ObSysVarToObjFuncs::to_obj_charset, ObSysVarToStrFuncs::to_str_charset, ObSysVarGetMetaTypeFuncs::get_meta_type_varchar) @@ -154,7 +154,7 @@ class ObSysVarCharacterSetSystem : public ObCharsetSysVar { } }; class ObSysVarCollationConnection : public ObCharsetSysVar { - public: +public: ObSysVarCollationConnection() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_collation_not_null, NULL, ObSysVarToObjFuncs::to_obj_collation, ObSysVarToStrFuncs::to_str_collation, @@ -170,7 +170,7 @@ class ObSysVarCollationConnection : public ObCharsetSysVar { } }; class ObSysVarCollationDatabase : public ObCharsetSysVar { - public: +public: ObSysVarCollationDatabase() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_collation_not_null, NULL, ObSysVarToObjFuncs::to_obj_collation, ObSysVarToStrFuncs::to_str_collation, @@ -186,7 +186,7 @@ class ObSysVarCollationDatabase : public ObCharsetSysVar { } }; class ObSysVarCollationServer : public ObCharsetSysVar { - public: +public: ObSysVarCollationServer() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_collation_not_null, NULL, ObSysVarToObjFuncs::to_obj_collation, ObSysVarToStrFuncs::to_str_collation, @@ -202,7 +202,7 @@ class ObSysVarCollationServer : public ObCharsetSysVar { } }; class ObSysVarInteractiveTimeout : public ObIntSysVar { - public: +public: ObSysVarInteractiveTimeout() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -215,7 +215,7 @@ class ObSysVarInteractiveTimeout : public ObIntSysVar { } }; class ObSysVarLastInsertId : public ObSessionSpecialIntSysVar { - public: +public: ObSysVarLastInsertId() : ObSessionSpecialIntSysVar(NULL, ObSysVarSessionSpecialUpdateFuncs::update_last_insert_id, NULL, NULL, NULL) {} @@ -229,7 +229,7 @@ class ObSysVarLastInsertId : public ObSessionSpecialIntSysVar { } }; class ObSysVarMaxAllowedPacket : public ObIntSysVar { - public: +public: ObSysVarMaxAllowedPacket() : ObIntSysVar(ObSysVarOnCheckFuncs::check_and_convert_max_allowed_packet, NULL, NULL, NULL, NULL) {} @@ -243,7 +243,7 @@ class ObSysVarMaxAllowedPacket : public ObIntSysVar { } }; class ObSysVarSqlMode : public ObSqlModeVar { - public: +public: ObSysVarSqlMode() : ObSqlModeVar(ObSysVarOnCheckFuncs::check_and_convert_sql_mode, ObSysVarOnUpdateFuncs::update_sql_mode, ObSysVarToObjFuncs::to_obj_sql_mode, ObSysVarToStrFuncs::to_str_sql_mode, @@ -259,7 +259,7 @@ class ObSysVarSqlMode : public ObSqlModeVar { } }; class ObSysVarTimeZone : public ObTimeZoneSysVar { - public: +public: ObSysVarTimeZone() : ObTimeZoneSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -272,7 +272,7 @@ class ObSysVarTimeZone : public ObTimeZoneSysVar { } }; class ObSysVarTxIsolation : public ObSessionSpecialVarcharSysVar { - public: +public: ObSysVarTxIsolation() : ObSessionSpecialVarcharSysVar(ObSysVarOnCheckFuncs::check_and_convert_tx_isolation, ObSysVarOnUpdateFuncs::update_tx_isolation, ObSysVarSessionSpecialUpdateFuncs::update_tx_isolation, NULL, @@ -288,7 +288,7 @@ class ObSysVarTxIsolation : public ObSessionSpecialVarcharSysVar { } }; class ObSysVarVersionComment : public ObVarcharSysVar { - public: +public: ObSysVarVersionComment() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -301,7 +301,7 @@ class ObSysVarVersionComment : public ObVarcharSysVar { } }; class ObSysVarWaitTimeout : public ObIntSysVar { - public: +public: ObSysVarWaitTimeout() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -314,10 +314,10 @@ class ObSysVarWaitTimeout : public ObIntSysVar { } }; class ObSysVarBinlogRowImage : public ObEnumSysVar { - public: +public: const static char* BINLOG_ROW_IMAGE_NAMES[]; - public: +public: ObSysVarBinlogRowImage() : ObEnumSysVar(BINLOG_ROW_IMAGE_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -330,7 +330,7 @@ class ObSysVarBinlogRowImage : public ObEnumSysVar { } }; class ObSysVarCharacterSetFilesystem : public ObCharsetSysVar { - public: +public: ObSysVarCharacterSetFilesystem() : ObCharsetSysVar(ObSysVarOnCheckFuncs::check_and_convert_charset_not_null, NULL, ObSysVarToObjFuncs::to_obj_charset, ObSysVarToStrFuncs::to_str_charset, @@ -346,7 +346,7 @@ class ObSysVarCharacterSetFilesystem : public ObCharsetSysVar { } }; class ObSysVarConnectTimeout : public ObIntSysVar { - public: +public: ObSysVarConnectTimeout() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -359,7 +359,7 @@ class ObSysVarConnectTimeout : public ObIntSysVar { } }; class ObSysVarDatadir : public ObVarcharSysVar { - public: +public: ObSysVarDatadir() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -372,7 +372,7 @@ class ObSysVarDatadir : public ObVarcharSysVar { } }; class ObSysVarDebugSync : public ObVarcharSysVar { - public: +public: ObSysVarDebugSync() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -385,7 +385,7 @@ class ObSysVarDebugSync : public ObVarcharSysVar { } }; class ObSysVarDivPrecisionIncrement : public ObIntSysVar { - public: +public: ObSysVarDivPrecisionIncrement() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -398,7 +398,7 @@ class ObSysVarDivPrecisionIncrement : public ObIntSysVar { } }; class ObSysVarExplicitDefaultsForTimestamp : public ObBoolSysVar { - public: +public: ObSysVarExplicitDefaultsForTimestamp() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -411,7 +411,7 @@ class ObSysVarExplicitDefaultsForTimestamp : public ObBoolSysVar { } }; class ObSysVarGroupConcatMaxLen : public ObIntSysVar { - public: +public: ObSysVarGroupConcatMaxLen() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -424,7 +424,7 @@ class ObSysVarGroupConcatMaxLen : public ObIntSysVar { } }; class ObSysVarIdentity : public ObSessionSpecialIntSysVar { - public: +public: ObSysVarIdentity() : ObSessionSpecialIntSysVar(NULL, ObSysVarSessionSpecialUpdateFuncs::update_identity, NULL, NULL, NULL) {} @@ -438,7 +438,7 @@ class ObSysVarIdentity : public ObSessionSpecialIntSysVar { } }; class ObSysVarLowerCaseTableNames : public ObIntSysVar { - public: +public: ObSysVarLowerCaseTableNames() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -451,7 +451,7 @@ class ObSysVarLowerCaseTableNames : public ObIntSysVar { } }; class ObSysVarNetReadTimeout : public ObIntSysVar { - public: +public: ObSysVarNetReadTimeout() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -464,7 +464,7 @@ class ObSysVarNetReadTimeout : public ObIntSysVar { } }; class ObSysVarNetWriteTimeout : public ObIntSysVar { - public: +public: ObSysVarNetWriteTimeout() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -477,7 +477,7 @@ class ObSysVarNetWriteTimeout : public ObIntSysVar { } }; class ObSysVarReadOnly : public ObBoolSysVar { - public: +public: ObSysVarReadOnly() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -490,7 +490,7 @@ class ObSysVarReadOnly : public ObBoolSysVar { } }; class ObSysVarSqlAutoIsNull : public ObBoolSysVar { - public: +public: ObSysVarSqlAutoIsNull() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -503,7 +503,7 @@ class ObSysVarSqlAutoIsNull : public ObBoolSysVar { } }; class ObSysVarSqlSelectLimit : public ObIntSysVar { - public: +public: ObSysVarSqlSelectLimit() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -516,7 +516,7 @@ class ObSysVarSqlSelectLimit : public ObIntSysVar { } }; class ObSysVarTimestamp : public ObNumericSysVar { - public: +public: ObSysVarTimestamp() : ObNumericSysVar(ObSysVarOnCheckFuncs::check_and_convert_max_min_timestamp, NULL, NULL, NULL, NULL) {} @@ -530,7 +530,7 @@ class ObSysVarTimestamp : public ObNumericSysVar { } }; class ObSysVarTxReadOnly : public ObSessionSpecialBoolSysVar { - public: +public: ObSysVarTxReadOnly() : ObSessionSpecialBoolSysVar(ObSysVarOnCheckFuncs::check_and_convert_tx_read_only, ObSysVarOnUpdateFuncs::update_tx_read_only_no_scope, ObSysVarSessionSpecialUpdateFuncs::update_tx_read_only, @@ -546,7 +546,7 @@ class ObSysVarTxReadOnly : public ObSessionSpecialBoolSysVar { } }; class ObSysVarVersion : public ObVarcharSysVar { - public: +public: ObSysVarVersion() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -559,7 +559,7 @@ class ObSysVarVersion : public ObVarcharSysVar { } }; class ObSysVarSqlWarnings : public ObBoolSysVar { - public: +public: ObSysVarSqlWarnings() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -572,7 +572,7 @@ class ObSysVarSqlWarnings : public ObBoolSysVar { } }; class ObSysVarMaxUserConnections : public ObIntSysVar { - public: +public: ObSysVarMaxUserConnections() : ObIntSysVar(ObSysVarOnCheckFuncs::check_and_convert_max_user_connections, NULL, NULL, NULL, NULL) {} @@ -586,7 +586,7 @@ class ObSysVarMaxUserConnections : public ObIntSysVar { } }; class ObSysVarInitConnect : public ObVarcharSysVar { - public: +public: ObSysVarInitConnect() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -599,7 +599,7 @@ class ObSysVarInitConnect : public ObVarcharSysVar { } }; class ObSysVarLicense : public ObVarcharSysVar { - public: +public: ObSysVarLicense() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -612,7 +612,7 @@ class ObSysVarLicense : public ObVarcharSysVar { } }; class ObSysVarNetBufferLength : public ObIntSysVar { - public: +public: ObSysVarNetBufferLength() : ObIntSysVar(ObSysVarOnCheckFuncs::check_and_convert_net_buffer_length, NULL, NULL, NULL, NULL) {} @@ -626,7 +626,7 @@ class ObSysVarNetBufferLength : public ObIntSysVar { } }; class ObSysVarSystemTimeZone : public ObVarcharSysVar { - public: +public: ObSysVarSystemTimeZone() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -639,7 +639,7 @@ class ObSysVarSystemTimeZone : public ObVarcharSysVar { } }; class ObSysVarQueryCacheSize : public ObIntSysVar { - public: +public: ObSysVarQueryCacheSize() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -652,10 +652,10 @@ class ObSysVarQueryCacheSize : public ObIntSysVar { } }; class ObSysVarQueryCacheType : public ObEnumSysVar { - public: +public: const static char* QUERY_CACHE_TYPE_NAMES[]; - public: +public: ObSysVarQueryCacheType() : ObEnumSysVar(QUERY_CACHE_TYPE_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -668,7 +668,7 @@ class ObSysVarQueryCacheType : public ObEnumSysVar { } }; class ObSysVarSqlQuoteShowCreate : public ObBoolSysVar { - public: +public: ObSysVarSqlQuoteShowCreate() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -681,7 +681,7 @@ class ObSysVarSqlQuoteShowCreate : public ObBoolSysVar { } }; class ObSysVarMaxSpRecursionDepth : public ObIntSysVar { - public: +public: ObSysVarMaxSpRecursionDepth() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -694,7 +694,7 @@ class ObSysVarMaxSpRecursionDepth : public ObIntSysVar { } }; class ObSysVarSqlSafeUpdates : public ObBoolSysVar { - public: +public: ObSysVarSqlSafeUpdates() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -707,7 +707,7 @@ class ObSysVarSqlSafeUpdates : public ObBoolSysVar { } }; class ObSysVarConcurrentInsert : public ObVarcharSysVar { - public: +public: ObSysVarConcurrentInsert() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -720,7 +720,7 @@ class ObSysVarConcurrentInsert : public ObVarcharSysVar { } }; class ObSysVarDefaultAuthenticationPlugin : public ObVarcharSysVar { - public: +public: ObSysVarDefaultAuthenticationPlugin() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -733,7 +733,7 @@ class ObSysVarDefaultAuthenticationPlugin : public ObVarcharSysVar { } }; class ObSysVarDisabledStorageEngines : public ObVarcharSysVar { - public: +public: ObSysVarDisabledStorageEngines() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -746,7 +746,7 @@ class ObSysVarDisabledStorageEngines : public ObVarcharSysVar { } }; class ObSysVarErrorCount : public ObIntSysVar { - public: +public: ObSysVarErrorCount() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -759,7 +759,7 @@ class ObSysVarErrorCount : public ObIntSysVar { } }; class ObSysVarGeneralLog : public ObBoolSysVar { - public: +public: ObSysVarGeneralLog() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -772,7 +772,7 @@ class ObSysVarGeneralLog : public ObBoolSysVar { } }; class ObSysVarHaveOpenssl : public ObVarcharSysVar { - public: +public: ObSysVarHaveOpenssl() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -785,7 +785,7 @@ class ObSysVarHaveOpenssl : public ObVarcharSysVar { } }; class ObSysVarHaveProfiling : public ObVarcharSysVar { - public: +public: ObSysVarHaveProfiling() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -798,7 +798,7 @@ class ObSysVarHaveProfiling : public ObVarcharSysVar { } }; class ObSysVarHaveSsl : public ObVarcharSysVar { - public: +public: ObSysVarHaveSsl() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -811,7 +811,7 @@ class ObSysVarHaveSsl : public ObVarcharSysVar { } }; class ObSysVarHostname : public ObVarcharSysVar { - public: +public: ObSysVarHostname() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -824,7 +824,7 @@ class ObSysVarHostname : public ObVarcharSysVar { } }; class ObSysVarLcMessages : public ObVarcharSysVar { - public: +public: ObSysVarLcMessages() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -837,7 +837,7 @@ class ObSysVarLcMessages : public ObVarcharSysVar { } }; class ObSysVarLocalInfile : public ObBoolSysVar { - public: +public: ObSysVarLocalInfile() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -850,7 +850,7 @@ class ObSysVarLocalInfile : public ObBoolSysVar { } }; class ObSysVarLockWaitTimeout : public ObIntSysVar { - public: +public: ObSysVarLockWaitTimeout() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -863,7 +863,7 @@ class ObSysVarLockWaitTimeout : public ObIntSysVar { } }; class ObSysVarLongQueryTime : public ObNumericSysVar { - public: +public: ObSysVarLongQueryTime() : ObNumericSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -876,7 +876,7 @@ class ObSysVarLongQueryTime : public ObNumericSysVar { } }; class ObSysVarMaxConnections : public ObIntSysVar { - public: +public: ObSysVarMaxConnections() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -889,7 +889,7 @@ class ObSysVarMaxConnections : public ObIntSysVar { } }; class ObSysVarMaxExecutionTime : public ObIntSysVar { - public: +public: ObSysVarMaxExecutionTime() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -902,7 +902,7 @@ class ObSysVarMaxExecutionTime : public ObIntSysVar { } }; class ObSysVarProtocolVersion : public ObIntSysVar { - public: +public: ObSysVarProtocolVersion() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -915,7 +915,7 @@ class ObSysVarProtocolVersion : public ObIntSysVar { } }; class ObSysVarServerId : public ObIntSysVar { - public: +public: ObSysVarServerId() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -928,7 +928,7 @@ class ObSysVarServerId : public ObIntSysVar { } }; class ObSysVarSslCa : public ObVarcharSysVar { - public: +public: ObSysVarSslCa() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -941,7 +941,7 @@ class ObSysVarSslCa : public ObVarcharSysVar { } }; class ObSysVarSslCapath : public ObVarcharSysVar { - public: +public: ObSysVarSslCapath() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -954,7 +954,7 @@ class ObSysVarSslCapath : public ObVarcharSysVar { } }; class ObSysVarSslCert : public ObVarcharSysVar { - public: +public: ObSysVarSslCert() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -967,7 +967,7 @@ class ObSysVarSslCert : public ObVarcharSysVar { } }; class ObSysVarSslCipher : public ObVarcharSysVar { - public: +public: ObSysVarSslCipher() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -980,7 +980,7 @@ class ObSysVarSslCipher : public ObVarcharSysVar { } }; class ObSysVarSslCrl : public ObVarcharSysVar { - public: +public: ObSysVarSslCrl() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -993,7 +993,7 @@ class ObSysVarSslCrl : public ObVarcharSysVar { } }; class ObSysVarSslCrlpath : public ObVarcharSysVar { - public: +public: ObSysVarSslCrlpath() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1006,7 +1006,7 @@ class ObSysVarSslCrlpath : public ObVarcharSysVar { } }; class ObSysVarSslKey : public ObVarcharSysVar { - public: +public: ObSysVarSslKey() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1019,7 +1019,7 @@ class ObSysVarSslKey : public ObVarcharSysVar { } }; class ObSysVarTimeFormat : public ObVarcharSysVar { - public: +public: ObSysVarTimeFormat() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1032,7 +1032,7 @@ class ObSysVarTimeFormat : public ObVarcharSysVar { } }; class ObSysVarTlsVersion : public ObVarcharSysVar { - public: +public: ObSysVarTlsVersion() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1045,7 +1045,7 @@ class ObSysVarTlsVersion : public ObVarcharSysVar { } }; class ObSysVarTmpTableSize : public ObIntSysVar { - public: +public: ObSysVarTmpTableSize() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1058,7 +1058,7 @@ class ObSysVarTmpTableSize : public ObIntSysVar { } }; class ObSysVarTmpdir : public ObVarcharSysVar { - public: +public: ObSysVarTmpdir() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1071,7 +1071,7 @@ class ObSysVarTmpdir : public ObVarcharSysVar { } }; class ObSysVarUniqueChecks : public ObBoolSysVar { - public: +public: ObSysVarUniqueChecks() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1084,7 +1084,7 @@ class ObSysVarUniqueChecks : public ObBoolSysVar { } }; class ObSysVarVersionCompileMachine : public ObVarcharSysVar { - public: +public: ObSysVarVersionCompileMachine() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1097,7 +1097,7 @@ class ObSysVarVersionCompileMachine : public ObVarcharSysVar { } }; class ObSysVarVersionCompileOs : public ObVarcharSysVar { - public: +public: ObSysVarVersionCompileOs() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1110,7 +1110,7 @@ class ObSysVarVersionCompileOs : public ObVarcharSysVar { } }; class ObSysVarWarningCount : public ObIntSysVar { - public: +public: ObSysVarWarningCount() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1123,7 +1123,7 @@ class ObSysVarWarningCount : public ObIntSysVar { } }; class ObSysVarObDefaultReplicaNum : public ObIntSysVar { - public: +public: ObSysVarObDefaultReplicaNum() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1136,7 +1136,7 @@ class ObSysVarObDefaultReplicaNum : public ObIntSysVar { } }; class ObSysVarObIntermResultMemLimit : public ObIntSysVar { - public: +public: ObSysVarObIntermResultMemLimit() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1149,7 +1149,7 @@ class ObSysVarObIntermResultMemLimit : public ObIntSysVar { } }; class ObSysVarObProxyPartitionHit : public ObBoolSysVar { - public: +public: ObSysVarObProxyPartitionHit() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1162,7 +1162,7 @@ class ObSysVarObProxyPartitionHit : public ObBoolSysVar { } }; class ObSysVarObLogLevel : public ObVarcharSysVar { - public: +public: ObSysVarObLogLevel() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1175,7 +1175,7 @@ class ObSysVarObLogLevel : public ObVarcharSysVar { } }; class ObSysVarObMaxParallelDegree : public ObIntSysVar { - public: +public: ObSysVarObMaxParallelDegree() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1188,7 +1188,7 @@ class ObSysVarObMaxParallelDegree : public ObIntSysVar { } }; class ObSysVarObQueryTimeout : public ObIntSysVar { - public: +public: ObSysVarObQueryTimeout() : ObIntSysVar(ObSysVarOnCheckFuncs::check_and_convert_timeout_too_large, NULL, NULL, NULL, NULL) {} @@ -1202,10 +1202,10 @@ class ObSysVarObQueryTimeout : public ObIntSysVar { } }; class ObSysVarObReadConsistency : public ObEnumSysVar { - public: +public: const static char* OB_READ_CONSISTENCY_NAMES[]; - public: +public: ObSysVarObReadConsistency() : ObEnumSysVar(OB_READ_CONSISTENCY_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1218,7 +1218,7 @@ class ObSysVarObReadConsistency : public ObEnumSysVar { } }; class ObSysVarObEnableTransformation : public ObBoolSysVar { - public: +public: ObSysVarObEnableTransformation() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1231,7 +1231,7 @@ class ObSysVarObEnableTransformation : public ObBoolSysVar { } }; class ObSysVarObTrxTimeout : public ObIntSysVar { - public: +public: ObSysVarObTrxTimeout() : ObIntSysVar(ObSysVarOnCheckFuncs::check_and_convert_timeout_too_large, NULL, NULL, NULL, NULL) {} @@ -1245,7 +1245,7 @@ class ObSysVarObTrxTimeout : public ObIntSysVar { } }; class ObSysVarObEnablePlanCache : public ObBoolSysVar { - public: +public: ObSysVarObEnablePlanCache() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1258,7 +1258,7 @@ class ObSysVarObEnablePlanCache : public ObBoolSysVar { } }; class ObSysVarObEnableIndexDirectSelect : public ObBoolSysVar { - public: +public: ObSysVarObEnableIndexDirectSelect() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1271,7 +1271,7 @@ class ObSysVarObEnableIndexDirectSelect : public ObBoolSysVar { } }; class ObSysVarObProxySetTrxExecuted : public ObBoolSysVar { - public: +public: ObSysVarObProxySetTrxExecuted() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1284,7 +1284,7 @@ class ObSysVarObProxySetTrxExecuted : public ObBoolSysVar { } }; class ObSysVarObEnableAggregationPushdown : public ObBoolSysVar { - public: +public: ObSysVarObEnableAggregationPushdown() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1297,7 +1297,7 @@ class ObSysVarObEnableAggregationPushdown : public ObBoolSysVar { } }; class ObSysVarObLastSchemaVersion : public ObIntSysVar { - public: +public: ObSysVarObLastSchemaVersion() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1310,7 +1310,7 @@ class ObSysVarObLastSchemaVersion : public ObIntSysVar { } }; class ObSysVarObGlobalDebugSync : public ObVarcharSysVar { - public: +public: ObSysVarObGlobalDebugSync() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1323,7 +1323,7 @@ class ObSysVarObGlobalDebugSync : public ObVarcharSysVar { } }; class ObSysVarObProxyGlobalVariablesVersion : public ObIntSysVar { - public: +public: ObSysVarObProxyGlobalVariablesVersion() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1336,7 +1336,7 @@ class ObSysVarObProxyGlobalVariablesVersion : public ObIntSysVar { } }; class ObSysVarObEnableTraceLog : public ObBoolSysVar { - public: +public: ObSysVarObEnableTraceLog() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1349,7 +1349,7 @@ class ObSysVarObEnableTraceLog : public ObBoolSysVar { } }; class ObSysVarObEnableHashGroupBy : public ObBoolSysVar { - public: +public: ObSysVarObEnableHashGroupBy() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1362,7 +1362,7 @@ class ObSysVarObEnableHashGroupBy : public ObBoolSysVar { } }; class ObSysVarObEnableBlkNestedloopJoin : public ObBoolSysVar { - public: +public: ObSysVarObEnableBlkNestedloopJoin() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1375,7 +1375,7 @@ class ObSysVarObEnableBlkNestedloopJoin : public ObBoolSysVar { } }; class ObSysVarObBnlJoinCacheSize : public ObIntSysVar { - public: +public: ObSysVarObBnlJoinCacheSize() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1388,7 +1388,7 @@ class ObSysVarObBnlJoinCacheSize : public ObIntSysVar { } }; class ObSysVarObProxyUserPrivilege : public ObIntSysVar { - public: +public: ObSysVarObProxyUserPrivilege() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1401,7 +1401,7 @@ class ObSysVarObProxyUserPrivilege : public ObIntSysVar { } }; class ObSysVarObOrgClusterId : public ObStrictRangeIntSysVar { - public: +public: ObSysVarObOrgClusterId() : ObStrictRangeIntSysVar(ObSysVarOnCheckFuncs::check_and_convert_ob_org_cluster_id, NULL, NULL, NULL, NULL) {} @@ -1415,7 +1415,7 @@ class ObSysVarObOrgClusterId : public ObStrictRangeIntSysVar { } }; class ObSysVarObPlanCachePercentage : public ObIntSysVar { - public: +public: ObSysVarObPlanCachePercentage() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1428,7 +1428,7 @@ class ObSysVarObPlanCachePercentage : public ObIntSysVar { } }; class ObSysVarObPlanCacheEvictHighPercentage : public ObIntSysVar { - public: +public: ObSysVarObPlanCacheEvictHighPercentage() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1441,7 +1441,7 @@ class ObSysVarObPlanCacheEvictHighPercentage : public ObIntSysVar { } }; class ObSysVarObPlanCacheEvictLowPercentage : public ObIntSysVar { - public: +public: ObSysVarObPlanCacheEvictLowPercentage() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1454,7 +1454,7 @@ class ObSysVarObPlanCacheEvictLowPercentage : public ObIntSysVar { } }; class ObSysVarRecyclebin : public ObBoolSysVar { - public: +public: ObSysVarRecyclebin() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1467,7 +1467,7 @@ class ObSysVarRecyclebin : public ObBoolSysVar { } }; class ObSysVarObCapabilityFlag : public ObIntSysVar { - public: +public: ObSysVarObCapabilityFlag() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1480,7 +1480,7 @@ class ObSysVarObCapabilityFlag : public ObIntSysVar { } }; class ObSysVarObStmtParallelDegree : public ObIntSysVar { - public: +public: ObSysVarObStmtParallelDegree() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1493,7 +1493,7 @@ class ObSysVarObStmtParallelDegree : public ObIntSysVar { } }; class ObSysVarIsResultAccurate : public ObBoolSysVar { - public: +public: ObSysVarIsResultAccurate() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1506,7 +1506,7 @@ class ObSysVarIsResultAccurate : public ObBoolSysVar { } }; class ObSysVarErrorOnOverlapTime : public ObBoolSysVar { - public: +public: ObSysVarErrorOnOverlapTime() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1519,10 +1519,10 @@ class ObSysVarErrorOnOverlapTime : public ObBoolSysVar { } }; class ObSysVarObCompatibilityMode : public ObEnumSysVar { - public: +public: const static char* OB_COMPATIBILITY_MODE_NAMES[]; - public: +public: ObSysVarObCompatibilityMode() : ObEnumSysVar(OB_COMPATIBILITY_MODE_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1535,7 +1535,7 @@ class ObSysVarObCompatibilityMode : public ObEnumSysVar { } }; class ObSysVarObCreateTableStrictMode : public ObBoolSysVar { - public: +public: ObSysVarObCreateTableStrictMode() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1548,7 +1548,7 @@ class ObSysVarObCreateTableStrictMode : public ObBoolSysVar { } }; class ObSysVarObSqlWorkAreaPercentage : public ObIntSysVar { - public: +public: ObSysVarObSqlWorkAreaPercentage() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1561,7 +1561,7 @@ class ObSysVarObSqlWorkAreaPercentage : public ObIntSysVar { } }; class ObSysVarObSafeWeakReadSnapshot : public ObIntSysVar { - public: +public: ObSysVarObSafeWeakReadSnapshot() : ObIntSysVar(NULL, ObSysVarOnUpdateFuncs::update_safe_weak_read_snapshot, NULL, NULL, NULL) {} @@ -1575,10 +1575,10 @@ class ObSysVarObSafeWeakReadSnapshot : public ObIntSysVar { } }; class ObSysVarObRoutePolicy : public ObEnumSysVar { - public: +public: const static char* OB_ROUTE_POLICY_NAMES[]; - public: +public: ObSysVarObRoutePolicy() : ObEnumSysVar(OB_ROUTE_POLICY_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1591,7 +1591,7 @@ class ObSysVarObRoutePolicy : public ObEnumSysVar { } }; class ObSysVarObEnableTransmissionChecksum : public ObBoolSysVar { - public: +public: ObSysVarObEnableTransmissionChecksum() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1604,7 +1604,7 @@ class ObSysVarObEnableTransmissionChecksum : public ObBoolSysVar { } }; class ObSysVarForeignKeyChecks : public ObBoolSysVar { - public: +public: ObSysVarForeignKeyChecks() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1617,7 +1617,7 @@ class ObSysVarForeignKeyChecks : public ObBoolSysVar { } }; class ObSysVarObStatementTraceId : public ObVarcharSysVar { - public: +public: ObSysVarObStatementTraceId() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1630,7 +1630,7 @@ class ObSysVarObStatementTraceId : public ObVarcharSysVar { } }; class ObSysVarObEnableTruncateFlashback : public ObBoolSysVar { - public: +public: ObSysVarObEnableTruncateFlashback() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1643,7 +1643,7 @@ class ObSysVarObEnableTruncateFlashback : public ObBoolSysVar { } }; class ObSysVarObTcpInvitedNodes : public ObVarcharSysVar { - public: +public: ObSysVarObTcpInvitedNodes() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1656,7 +1656,7 @@ class ObSysVarObTcpInvitedNodes : public ObVarcharSysVar { } }; class ObSysVarSqlThrottleCurrentPriority : public ObIntSysVar { - public: +public: ObSysVarSqlThrottleCurrentPriority() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1669,7 +1669,7 @@ class ObSysVarSqlThrottleCurrentPriority : public ObIntSysVar { } }; class ObSysVarSqlThrottlePriority : public ObIntSysVar { - public: +public: ObSysVarSqlThrottlePriority() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1682,7 +1682,7 @@ class ObSysVarSqlThrottlePriority : public ObIntSysVar { } }; class ObSysVarSqlThrottleRt : public ObNumericSysVar { - public: +public: ObSysVarSqlThrottleRt() : ObNumericSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1695,7 +1695,7 @@ class ObSysVarSqlThrottleRt : public ObNumericSysVar { } }; class ObSysVarSqlThrottleCpu : public ObNumericSysVar { - public: +public: ObSysVarSqlThrottleCpu() : ObNumericSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1708,7 +1708,7 @@ class ObSysVarSqlThrottleCpu : public ObNumericSysVar { } }; class ObSysVarSqlThrottleIo : public ObIntSysVar { - public: +public: ObSysVarSqlThrottleIo() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1721,7 +1721,7 @@ class ObSysVarSqlThrottleIo : public ObIntSysVar { } }; class ObSysVarSqlThrottleNetwork : public ObNumericSysVar { - public: +public: ObSysVarSqlThrottleNetwork() : ObNumericSysVar(ObSysVarOnCheckFuncs::check_and_convert_sql_throttle_queue_time, NULL, NULL, NULL, NULL) {} @@ -1735,7 +1735,7 @@ class ObSysVarSqlThrottleNetwork : public ObNumericSysVar { } }; class ObSysVarSqlThrottleLogicalReads : public ObIntSysVar { - public: +public: ObSysVarSqlThrottleLogicalReads() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1748,7 +1748,7 @@ class ObSysVarSqlThrottleLogicalReads : public ObIntSysVar { } }; class ObSysVarAutoIncrementCacheSize : public ObIntSysVar { - public: +public: ObSysVarAutoIncrementCacheSize() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1761,10 +1761,10 @@ class ObSysVarAutoIncrementCacheSize : public ObIntSysVar { } }; class ObSysVarObEnableJit : public ObEnumSysVar { - public: +public: const static char* OB_ENABLE_JIT_NAMES[]; - public: +public: ObSysVarObEnableJit() : ObEnumSysVar(OB_ENABLE_JIT_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1777,7 +1777,7 @@ class ObSysVarObEnableJit : public ObEnumSysVar { } }; class ObSysVarObTempTablespaceSizePercentage : public ObIntSysVar { - public: +public: ObSysVarObTempTablespaceSizePercentage() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1790,7 +1790,7 @@ class ObSysVarObTempTablespaceSizePercentage : public ObIntSysVar { } }; class ObSysVarOptimizerAdaptiveCursorSharing : public ObBoolSysVar { - public: +public: ObSysVarOptimizerAdaptiveCursorSharing() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1803,10 +1803,10 @@ class ObSysVarOptimizerAdaptiveCursorSharing : public ObBoolSysVar { } }; class ObSysVarObTimestampService : public ObEnumSysVar { - public: +public: const static char* OB_TIMESTAMP_SERVICE_NAMES[]; - public: +public: ObSysVarObTimestampService() : ObEnumSysVar(OB_TIMESTAMP_SERVICE_NAMES, ObSysVarOnCheckFuncs::check_and_convert_timestamp_service, NULL, NULL, NULL, NULL) @@ -1821,7 +1821,7 @@ class ObSysVarObTimestampService : public ObEnumSysVar { } }; class ObSysVarPluginDir : public ObVarcharSysVar { - public: +public: ObSysVarPluginDir() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1834,7 +1834,7 @@ class ObSysVarPluginDir : public ObVarcharSysVar { } }; class ObSysVarUndoRetention : public ObIntSysVar { - public: +public: ObSysVarUndoRetention() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1847,7 +1847,7 @@ class ObSysVarUndoRetention : public ObIntSysVar { } }; class ObSysVarObUseParallelExecution : public ObBoolSysVar { - public: +public: ObSysVarObUseParallelExecution() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1860,7 +1860,7 @@ class ObSysVarObUseParallelExecution : public ObBoolSysVar { } }; class ObSysVarObSqlAuditPercentage : public ObIntSysVar { - public: +public: ObSysVarObSqlAuditPercentage() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1873,7 +1873,7 @@ class ObSysVarObSqlAuditPercentage : public ObIntSysVar { } }; class ObSysVarObEnableSqlAudit : public ObBoolSysVar { - public: +public: ObSysVarObEnableSqlAudit() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1886,7 +1886,7 @@ class ObSysVarObEnableSqlAudit : public ObBoolSysVar { } }; class ObSysVarOptimizerUseSqlPlanBaselines : public ObBoolSysVar { - public: +public: ObSysVarOptimizerUseSqlPlanBaselines() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1899,7 +1899,7 @@ class ObSysVarOptimizerUseSqlPlanBaselines : public ObBoolSysVar { } }; class ObSysVarOptimizerCaptureSqlPlanBaselines : public ObBoolSysVar { - public: +public: ObSysVarOptimizerCaptureSqlPlanBaselines() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1912,7 +1912,7 @@ class ObSysVarOptimizerCaptureSqlPlanBaselines : public ObBoolSysVar { } }; class ObSysVarParallelMaxServers : public ObIntSysVar { - public: +public: ObSysVarParallelMaxServers() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1925,7 +1925,7 @@ class ObSysVarParallelMaxServers : public ObIntSysVar { } }; class ObSysVarParallelServersTarget : public ObIntSysVar { - public: +public: ObSysVarParallelServersTarget() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1938,7 +1938,7 @@ class ObSysVarParallelServersTarget : public ObIntSysVar { } }; class ObSysVarObEarlyLockRelease : public ObBoolSysVar { - public: +public: ObSysVarObEarlyLockRelease() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1951,7 +1951,7 @@ class ObSysVarObEarlyLockRelease : public ObBoolSysVar { } }; class ObSysVarObTrxIdleTimeout : public ObIntSysVar { - public: +public: ObSysVarObTrxIdleTimeout() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1964,10 +1964,10 @@ class ObSysVarObTrxIdleTimeout : public ObIntSysVar { } }; class ObSysVarBlockEncryptionMode : public ObEnumSysVar { - public: +public: const static char* BLOCK_ENCRYPTION_MODE_NAMES[]; - public: +public: ObSysVarBlockEncryptionMode() : ObEnumSysVar(BLOCK_ENCRYPTION_MODE_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1980,7 +1980,7 @@ class ObSysVarBlockEncryptionMode : public ObEnumSysVar { } }; class ObSysVarNlsDateFormat : public ObVarcharSysVar { - public: +public: ObSysVarNlsDateFormat() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -1993,7 +1993,7 @@ class ObSysVarNlsDateFormat : public ObVarcharSysVar { } }; class ObSysVarNlsTimestampFormat : public ObVarcharSysVar { - public: +public: ObSysVarNlsTimestampFormat() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2006,7 +2006,7 @@ class ObSysVarNlsTimestampFormat : public ObVarcharSysVar { } }; class ObSysVarNlsTimestampTzFormat : public ObVarcharSysVar { - public: +public: ObSysVarNlsTimestampTzFormat() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2019,7 +2019,7 @@ class ObSysVarNlsTimestampTzFormat : public ObVarcharSysVar { } }; class ObSysVarObReservedMetaMemoryPercentage : public ObIntSysVar { - public: +public: ObSysVarObReservedMetaMemoryPercentage() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2032,7 +2032,7 @@ class ObSysVarObReservedMetaMemoryPercentage : public ObIntSysVar { } }; class ObSysVarObCheckSysVariable : public ObBoolSysVar { - public: +public: ObSysVarObCheckSysVariable() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2045,7 +2045,7 @@ class ObSysVarObCheckSysVariable : public ObBoolSysVar { } }; class ObSysVarNlsLanguage : public ObVarcharSysVar { - public: +public: ObSysVarNlsLanguage() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2058,7 +2058,7 @@ class ObSysVarNlsLanguage : public ObVarcharSysVar { } }; class ObSysVarNlsTerritory : public ObVarcharSysVar { - public: +public: ObSysVarNlsTerritory() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2071,7 +2071,7 @@ class ObSysVarNlsTerritory : public ObVarcharSysVar { } }; class ObSysVarNlsSort : public ObVarcharSysVar { - public: +public: ObSysVarNlsSort() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2084,7 +2084,7 @@ class ObSysVarNlsSort : public ObVarcharSysVar { } }; class ObSysVarNlsComp : public ObVarcharSysVar { - public: +public: ObSysVarNlsComp() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2097,7 +2097,7 @@ class ObSysVarNlsComp : public ObVarcharSysVar { } }; class ObSysVarNlsCharacterset : public ObVarcharSysVar { - public: +public: ObSysVarNlsCharacterset() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2110,7 +2110,7 @@ class ObSysVarNlsCharacterset : public ObVarcharSysVar { } }; class ObSysVarNlsNcharCharacterset : public ObVarcharSysVar { - public: +public: ObSysVarNlsNcharCharacterset() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2123,7 +2123,7 @@ class ObSysVarNlsNcharCharacterset : public ObVarcharSysVar { } }; class ObSysVarNlsDateLanguage : public ObVarcharSysVar { - public: +public: ObSysVarNlsDateLanguage() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2136,7 +2136,7 @@ class ObSysVarNlsDateLanguage : public ObVarcharSysVar { } }; class ObSysVarNlsLengthSemantics : public ObVarcharSysVar { - public: +public: ObSysVarNlsLengthSemantics() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2149,7 +2149,7 @@ class ObSysVarNlsLengthSemantics : public ObVarcharSysVar { } }; class ObSysVarNlsNcharConvExcp : public ObVarcharSysVar { - public: +public: ObSysVarNlsNcharConvExcp() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2162,7 +2162,7 @@ class ObSysVarNlsNcharConvExcp : public ObVarcharSysVar { } }; class ObSysVarNlsCalendar : public ObVarcharSysVar { - public: +public: ObSysVarNlsCalendar() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2175,7 +2175,7 @@ class ObSysVarNlsCalendar : public ObVarcharSysVar { } }; class ObSysVarNlsNumericCharacters : public ObVarcharSysVar { - public: +public: ObSysVarNlsNumericCharacters() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2188,7 +2188,7 @@ class ObSysVarNlsNumericCharacters : public ObVarcharSysVar { } }; class ObSysVarNljBatchingEnabled : public ObBoolSysVar { - public: +public: ObSysVarNljBatchingEnabled() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2201,7 +2201,7 @@ class ObSysVarNljBatchingEnabled : public ObBoolSysVar { } }; class ObSysVarTracefileIdentifier : public ObVarcharSysVar { - public: +public: ObSysVarTracefileIdentifier() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2214,7 +2214,7 @@ class ObSysVarTracefileIdentifier : public ObVarcharSysVar { } }; class ObSysVarGroupbyNopushdownCutRatio : public ObIntSysVar { - public: +public: ObSysVarGroupbyNopushdownCutRatio() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2227,7 +2227,7 @@ class ObSysVarGroupbyNopushdownCutRatio : public ObIntSysVar { } }; class ObSysVarPxBroadcastFudgeFactor : public ObIntSysVar { - public: +public: ObSysVarPxBroadcastFudgeFactor() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2240,7 +2240,7 @@ class ObSysVarPxBroadcastFudgeFactor : public ObIntSysVar { } }; class ObSysVarPrimaryZoneEntityCount : public ObIntSysVar { - public: +public: ObSysVarPrimaryZoneEntityCount() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2253,7 +2253,7 @@ class ObSysVarPrimaryZoneEntityCount : public ObIntSysVar { } }; class ObSysVarTransactionIsolation : public ObSessionSpecialVarcharSysVar { - public: +public: ObSysVarTransactionIsolation() : ObSessionSpecialVarcharSysVar(ObSysVarOnCheckFuncs::check_and_convert_tx_isolation, ObSysVarOnUpdateFuncs::update_tx_isolation, ObSysVarSessionSpecialUpdateFuncs::update_tx_isolation, NULL, @@ -2269,7 +2269,7 @@ class ObSysVarTransactionIsolation : public ObSessionSpecialVarcharSysVar { } }; class ObSysVarObTrxLockTimeout : public ObIntSysVar { - public: +public: ObSysVarObTrxLockTimeout() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2282,10 +2282,10 @@ class ObSysVarObTrxLockTimeout : public ObIntSysVar { } }; class ObSysVarValidatePasswordCheckUserName : public ObEnumSysVar { - public: +public: const static char* VALIDATE_PASSWORD_CHECK_USER_NAME_NAMES[]; - public: +public: ObSysVarValidatePasswordCheckUserName() : ObEnumSysVar(VALIDATE_PASSWORD_CHECK_USER_NAME_NAMES, NULL, NULL, NULL, NULL, NULL) {} @@ -2299,7 +2299,7 @@ class ObSysVarValidatePasswordCheckUserName : public ObEnumSysVar { } }; class ObSysVarValidatePasswordLength : public ObIntSysVar { - public: +public: ObSysVarValidatePasswordLength() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2312,7 +2312,7 @@ class ObSysVarValidatePasswordLength : public ObIntSysVar { } }; class ObSysVarValidatePasswordMixedCaseCount : public ObIntSysVar { - public: +public: ObSysVarValidatePasswordMixedCaseCount() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2325,7 +2325,7 @@ class ObSysVarValidatePasswordMixedCaseCount : public ObIntSysVar { } }; class ObSysVarValidatePasswordNumberCount : public ObIntSysVar { - public: +public: ObSysVarValidatePasswordNumberCount() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2338,10 +2338,10 @@ class ObSysVarValidatePasswordNumberCount : public ObIntSysVar { } }; class ObSysVarValidatePasswordPolicy : public ObEnumSysVar { - public: +public: const static char* VALIDATE_PASSWORD_POLICY_NAMES[]; - public: +public: ObSysVarValidatePasswordPolicy() : ObEnumSysVar(VALIDATE_PASSWORD_POLICY_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2354,7 +2354,7 @@ class ObSysVarValidatePasswordPolicy : public ObEnumSysVar { } }; class ObSysVarValidatePasswordSpecialCharCount : public ObIntSysVar { - public: +public: ObSysVarValidatePasswordSpecialCharCount() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2367,7 +2367,7 @@ class ObSysVarValidatePasswordSpecialCharCount : public ObIntSysVar { } }; class ObSysVarDefaultPasswordLifetime : public ObIntSysVar { - public: +public: ObSysVarDefaultPasswordLifetime() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2380,7 +2380,7 @@ class ObSysVarDefaultPasswordLifetime : public ObIntSysVar { } }; class ObSysVarObTraceInfo : public ObVarcharSysVar { - public: +public: ObSysVarObTraceInfo() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2393,7 +2393,7 @@ class ObSysVarObTraceInfo : public ObVarcharSysVar { } }; class ObSysVarObEnableBatchedMultiStatement : public ObBoolSysVar { - public: +public: ObSysVarObEnableBatchedMultiStatement() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2406,7 +2406,7 @@ class ObSysVarObEnableBatchedMultiStatement : public ObBoolSysVar { } }; class ObSysVarPxPartitionScanThreshold : public ObIntSysVar { - public: +public: ObSysVarPxPartitionScanThreshold() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2419,10 +2419,10 @@ class ObSysVarPxPartitionScanThreshold : public ObIntSysVar { } }; class ObSysVarObPxBcastOptimization : public ObEnumSysVar { - public: +public: const static char* _OB_PX_BCAST_OPTIMIZATION_NAMES[]; - public: +public: ObSysVarObPxBcastOptimization() : ObEnumSysVar(_OB_PX_BCAST_OPTIMIZATION_NAMES, NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2435,7 +2435,7 @@ class ObSysVarObPxBcastOptimization : public ObEnumSysVar { } }; class ObSysVarObPxSlaveMappingThreshold : public ObIntSysVar { - public: +public: ObSysVarObPxSlaveMappingThreshold() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2448,7 +2448,7 @@ class ObSysVarObPxSlaveMappingThreshold : public ObIntSysVar { } }; class ObSysVarEnableParallelDml : public ObBoolSysVar { - public: +public: ObSysVarEnableParallelDml() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2461,7 +2461,7 @@ class ObSysVarEnableParallelDml : public ObBoolSysVar { } }; class ObSysVarPxMinGranulesPerSlave : public ObIntSysVar { - public: +public: ObSysVarPxMinGranulesPerSlave() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2474,7 +2474,7 @@ class ObSysVarPxMinGranulesPerSlave : public ObIntSysVar { } }; class ObSysVarSecureFilePriv : public ObVarcharSysVar { - public: +public: ObSysVarSecureFilePriv() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2487,7 +2487,7 @@ class ObSysVarSecureFilePriv : public ObVarcharSysVar { } }; class ObSysVarPlsqlWarnings : public ObVarcharSysVar { - public: +public: ObSysVarPlsqlWarnings() : ObVarcharSysVar(ObSysVarOnCheckFuncs::check_and_convert_plsql_warnings, NULL, NULL, NULL, NULL) {} @@ -2501,7 +2501,7 @@ class ObSysVarPlsqlWarnings : public ObVarcharSysVar { } }; class ObSysVarEnableParallelQuery : public ObBoolSysVar { - public: +public: ObSysVarEnableParallelQuery() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2514,7 +2514,7 @@ class ObSysVarEnableParallelQuery : public ObBoolSysVar { } }; class ObSysVarForceParallelQueryDop : public ObIntSysVar { - public: +public: ObSysVarForceParallelQueryDop() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2527,7 +2527,7 @@ class ObSysVarForceParallelQueryDop : public ObIntSysVar { } }; class ObSysVarForceParallelDmlDop : public ObIntSysVar { - public: +public: ObSysVarForceParallelDmlDop() : ObIntSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2540,7 +2540,7 @@ class ObSysVarForceParallelDmlDop : public ObIntSysVar { } }; class ObSysVarObPlBlockTimeout : public ObIntSysVar { - public: +public: ObSysVarObPlBlockTimeout() : ObIntSysVar(ObSysVarOnCheckFuncs::check_and_convert_timeout_too_large, NULL, NULL, NULL, NULL) {} @@ -2554,7 +2554,7 @@ class ObSysVarObPlBlockTimeout : public ObIntSysVar { } }; class ObSysVarTransactionReadOnly : public ObSessionSpecialBoolSysVar { - public: +public: ObSysVarTransactionReadOnly() : ObSessionSpecialBoolSysVar(ObSysVarOnCheckFuncs::check_and_convert_tx_read_only, ObSysVarOnUpdateFuncs::update_tx_read_only_no_scope, ObSysVarSessionSpecialUpdateFuncs::update_tx_read_only, @@ -2570,7 +2570,7 @@ class ObSysVarTransactionReadOnly : public ObSessionSpecialBoolSysVar { } }; class ObSysVarResourceManagerPlan : public ObVarcharSysVar { - public: +public: ObSysVarResourceManagerPlan() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2583,7 +2583,7 @@ class ObSysVarResourceManagerPlan : public ObVarcharSysVar { } }; class ObSysVarPerformanceSchema : public ObBoolSysVar { - public: +public: ObSysVarPerformanceSchema() : ObBoolSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2596,7 +2596,7 @@ class ObSysVarPerformanceSchema : public ObBoolSysVar { } }; class ObSysVarNlsCurrency : public ObVarcharSysVar { - public: +public: ObSysVarNlsCurrency() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2609,7 +2609,7 @@ class ObSysVarNlsCurrency : public ObVarcharSysVar { } }; class ObSysVarNlsIsoCurrency : public ObVarcharSysVar { - public: +public: ObSysVarNlsIsoCurrency() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2622,7 +2622,7 @@ class ObSysVarNlsIsoCurrency : public ObVarcharSysVar { } }; class ObSysVarNlsDualCurrency : public ObVarcharSysVar { - public: +public: ObSysVarNlsDualCurrency() : ObVarcharSysVar(NULL, NULL, NULL, NULL, NULL) {} inline virtual ObSysVarClassType get_type() const @@ -2636,7 +2636,7 @@ class ObSysVarNlsDualCurrency : public ObVarcharSysVar { }; class ObSysVarFactory { - public: +public: ObSysVarFactory(); virtual ~ObSysVarFactory(); void destroy(); @@ -2658,7 +2658,7 @@ class ObSysVarFactory { // increase OB_MAX_SYS_VAR_ID if you need a sys_var_id greater than it. const static int32_t OB_MAX_SYS_VAR_ID = 20000; - private: +private: static bool sys_var_name_case_cmp(const char* name1, const common::ObString& name2); const static char* SYS_VAR_NAMES_SORTED_BY_NAME[ALL_SYS_VARS_COUNT]; const static ObSysVarClassType SYS_VAR_IDS_SORTED_BY_NAME[ALL_SYS_VARS_COUNT]; diff --git a/src/share/system_variable/ob_system_variable_init.h b/src/share/system_variable/ob_system_variable_init.h index 2721abfc1..55334b99e 100644 --- a/src/share/system_variable/ob_system_variable_init.h +++ b/src/share/system_variable/ob_system_variable_init.h @@ -74,7 +74,7 @@ struct ObSysVarFromJson { }; class ObSysVariables { - public: +public: static int64_t get_all_sys_var_count(); static ObSysVarClassType get_sys_var_id(int64_t i); static common::ObString get_name(int64_t i); @@ -96,7 +96,7 @@ class ObSysVariables { }; class ObSysVarsToIdxMap { - public: +public: static int64_t get_store_idx(int64_t var_id); static bool has_invalid_sys_var_id(); }; diff --git a/src/sql/code_generator/ob_code_generator.h b/src/sql/code_generator/ob_code_generator.h index 188f8b90f..c75adc904 100644 --- a/src/sql/code_generator/ob_code_generator.h +++ b/src/sql/code_generator/ob_code_generator.h @@ -30,7 +30,7 @@ class ObLogicalOperator; class ObRawExprUniqueSet; class ObCodeGenerator { - public: +public: ObCodeGenerator( bool use_jit, bool use_static_typing_engine, uint64_t min_cluster_version, DatumParamStore* param_store) : use_jit_(use_jit), @@ -43,7 +43,7 @@ class ObCodeGenerator { int generate(const ObLogPlan& log_plan, ObPhysicalPlan& phy_plan); - private: +private: int generate_old_plan(const ObLogPlan& log_plan, ObPhysicalPlan& phy_plan); int generate_exprs(const ObLogPlan& log_plan, ObPhysicalPlan& phy_plan); @@ -74,7 +74,7 @@ class ObCodeGenerator { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCodeGenerator); - private: +private: bool use_jit_; bool use_static_typing_engine_; uint64_t min_cluster_version_; diff --git a/src/sql/code_generator/ob_code_generator_impl.cpp b/src/sql/code_generator/ob_code_generator_impl.cpp index 77a32d285..831e4d3c1 100644 --- a/src/sql/code_generator/ob_code_generator_impl.cpp +++ b/src/sql/code_generator/ob_code_generator_impl.cpp @@ -120,7 +120,7 @@ using namespace oceanbase::share::schema; using namespace oceanbase::transaction; class ObCodeGeneratorImpl::ColumnIndexProviderImpl : public jit::expr::ObColumnIndexProvider { - public: +public: ColumnIndexProviderImpl(const RowDesc& input_row_desc, const int32_t* projector = NULL, int64_t projector_size = 0) : left_row_desc_(&input_row_desc), right_row_desc_(NULL), projector_(projector), projector_size_(projector_size) {} @@ -163,10 +163,10 @@ class ObCodeGeneratorImpl::ColumnIndexProviderImpl : public jit::expr::ObColumnI return ret; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ColumnIndexProviderImpl); - private: +private: const RowDesc* left_row_desc_; const RowDesc* right_row_desc_; const int32_t* projector_; @@ -3047,7 +3047,7 @@ int ObCodeGeneratorImpl::generate_root_row_desc(ObJoin* join, const std::pair& calculable_exprs, const ObDMLStmt& stmt, ObPhysicalPlan& phy_plan, common::ObDList& pre_calc_exprs); - protected: +protected: // types and constants class ColumnIndexProviderImpl; typedef common::ObSEArray, 2> PhyOpsDesc; - protected: +protected: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCodeGeneratorImpl); // function members @@ -351,7 +351,7 @@ class ObCodeGeneratorImpl { int convert_multi_table_insert(ObLogInsertAll& op, const PhyOpsDesc& child_ops, PhyOpsDesc& out_ops); int convert_multi_insert_conditions(ObMultiTableInsert& phy_op, ObLogInsertAll& op, RowDesc* out_row_desc); - protected: +protected: ObPhysicalPlan* phy_plan_; common::ObSEArray phy_cte_tables_; uint64_t cur_tbl_op_id_; diff --git a/src/sql/code_generator/ob_column_index_provider.h b/src/sql/code_generator/ob_column_index_provider.h index acdd4aa29..f939f2711 100644 --- a/src/sql/code_generator/ob_column_index_provider.h +++ b/src/sql/code_generator/ob_column_index_provider.h @@ -23,7 +23,7 @@ namespace sql { class ObRawExpr; class RowDesc : public jit::expr::ObColumnIndexProvider { - public: +public: RowDesc() {} virtual ~RowDesc() @@ -45,7 +45,7 @@ class RowDesc : public jit::expr::ObColumnIndexProvider { int get_idx(const jit::expr::ObExpr* raw_expr, int64_t& idx) const override; TO_STRING_KV(N_EXPR, exprs_); - private: +private: typedef common::hash::ObHashMap ExprIdxMap; ExprIdxMap expr_idx_map_; common::ObSEArray exprs_; diff --git a/src/sql/code_generator/ob_expr_generator.h b/src/sql/code_generator/ob_expr_generator.h index bbd37a55c..30241e42c 100644 --- a/src/sql/code_generator/ob_expr_generator.h +++ b/src/sql/code_generator/ob_expr_generator.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprGenerator { - public: +public: ObExprGenerator() {} virtual ~ObExprGenerator() @@ -28,7 +28,7 @@ class ObExprGenerator { virtual int generate(ObRawExpr& raw_expr, ObSqlExpression& out_expr) = 0; virtual int generate(ObRawExpr& raw_expr, ObIterExprOperator*& out_expr) = 0; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprGenerator); }; diff --git a/src/sql/code_generator/ob_expr_generator_impl.h b/src/sql/code_generator/ob_expr_generator_impl.h index 02cfd0500..cca132f47 100644 --- a/src/sql/code_generator/ob_expr_generator_impl.h +++ b/src/sql/code_generator/ob_expr_generator_impl.h @@ -39,7 +39,7 @@ class ObExprDllUdf; typedef common::ObSEArray PhyIterExprDesc; class ObExprGeneratorImpl : public ObExprGenerator, public ObRawExprVisitor { - public: +public: ObExprGeneratorImpl(int16_t cur_regexp_op_count, int16_t cur_like_op_count, uint32_t* next_expr_id, ObColumnIndexProvider& column_idx_provider); @@ -66,7 +66,7 @@ class ObExprGeneratorImpl : public ObExprGenerator, public ObRawExprVisitor { int gen_fast_column_conv_expr(ObRawExpr& raw_expr); int gen_fast_expr(ObRawExpr& raw_expr); - private: +private: /// interface of ObRawExprVisitor virtual int visit(ObConstRawExpr& expr); virtual int visit(ObVarRawExpr& expr); @@ -83,9 +83,9 @@ class ObExprGeneratorImpl : public ObExprGenerator, public ObRawExprVisitor { virtual int visit(ObPseudoColumnRawExpr& expr); virtual bool skip_child(ObRawExpr& expr); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprGeneratorImpl); int visit_simple_op(ObNonTerminalRawExpr& expr); @@ -113,10 +113,10 @@ class ObExprGeneratorImpl : public ObExprGenerator, public ObRawExprVisitor { // visit child of %raw_expr and add visited child to %visited_exprs int infix_visit_child(ObRawExpr& raw_expr, common::ObIArray& visited_exprs); - private: +private: int set_need_cast(ObNonTerminalRawExpr& expr, bool& need_cast); - private: +private: // data members ObSqlExpression* sql_expr_; // generated postfix expression int16_t cur_regexp_op_count_; diff --git a/src/sql/code_generator/ob_static_engine_cg.h b/src/sql/code_generator/ob_static_engine_cg.h index 93c98f37f..4b1f28e4c 100644 --- a/src/sql/code_generator/ob_static_engine_cg.h +++ b/src/sql/code_generator/ob_static_engine_cg.h @@ -116,7 +116,7 @@ class ObTempTableTransformationOpSpec; // code generator for static typing engine. // class ObStaticEngineCG : public ObCodeGeneratorImpl { - public: +public: using ObCodeGeneratorImpl::ObCodeGeneratorImpl; template friend class GenSpecHelper; @@ -130,7 +130,7 @@ class ObStaticEngineCG : public ObCodeGeneratorImpl { int generate_rt_expr(const ObRawExpr& raw_expr, ObExpr*& rt_expr); int generate_rt_exprs(const common::ObIArray& src, common::ObIArray& dst); - private: +private: bool enable_pushdown_filter_to_storage(const ObLogTableScan& op); // Post order visit logic plan and generate operator specification. // %in_root_job indicate that the operator is executed in main execution thread, @@ -313,7 +313,7 @@ class ObStaticEngineCG : public ObCodeGeneratorImpl { int generate_spec(ObLogInsert& op, ObPxMultiPartInsertSpec& spec, const bool in_root_job); int generate_spec(ObLogUpdate& op, ObPxMultiPartUpdateSpec& spec, const bool in_root_job); - private: +private: int convert_global_index_merge_info(ObLogMerge& op, const TableColumns& table_columns, common::ObIArray& subplan_roots, ObTableDMLInfo& table_dml_info); int generate_merge_subplan_access_exprs(const bool has_update_clause, const ObAssignments& assigns, @@ -403,7 +403,7 @@ class ObStaticEngineCG : public ObCodeGeneratorImpl { int generate_hash_func_exprs(const common::ObIArray& hash_dist_exprs, ExprFixedArray& dist_exprs, common::ObHashFuncs& dist_hash_funcs); - private: +private: // all exprs of current operator ObSEArray cur_op_exprs_; // all self_produced exprs of current operator diff --git a/src/sql/code_generator/ob_static_engine_expr_cg.cpp b/src/sql/code_generator/ob_static_engine_expr_cg.cpp index 4204999b6..8c051e4bb 100644 --- a/src/sql/code_generator/ob_static_engine_expr_cg.cpp +++ b/src/sql/code_generator/ob_static_engine_expr_cg.cpp @@ -400,7 +400,7 @@ struct TmpFrameInfo { {} TO_STRING_KV(K_(expr_start_pos), K_(frame_info)); - public: +public: uint64_t expr_start_pos_; ObFrameInfo frame_info_; }; diff --git a/src/sql/code_generator/ob_static_engine_expr_cg.h b/src/sql/code_generator/ob_static_engine_expr_cg.h index a33ed6bd4..2067a81e5 100644 --- a/src/sql/code_generator/ob_static_engine_expr_cg.h +++ b/src/sql/code_generator/ob_static_engine_expr_cg.h @@ -28,23 +28,23 @@ class ObDMLStmt; class ObRawExprUniqueSet; class ObExprCGCtx { - public: +public: ObExprCGCtx() : allocator_(NULL), exec_ctx_(NULL) {} ObExprCGCtx(common::ObIAllocator* allocator, ObExecContext* exec_ctx) : allocator_(allocator), exec_ctx_(exec_ctx) {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCGCtx); - public: +public: common::ObIAllocator* allocator_; ObExecContext* exec_ctx_; }; class ObRawExpr; class ObHiddenColumnItem; class ObStaticEngineExprCG { - public: +public: static const int64_t STACK_OVERFLOW_CHECK_DEPTH = 16; static const int64_t DATUM_EVAL_INFO_SIZE = sizeof(ObDatum) + sizeof(ObEvalInfo); friend class ObRawExpr; @@ -81,7 +81,7 @@ class ObStaticEngineExprCG { return op_cg_ctx_; } - private: +private: static ObExpr* get_rt_expr(const ObRawExpr& raw_expr); int construct_exprs(const common::ObIArray& raw_exprs, common::ObIArray& rt_exprs); @@ -146,11 +146,11 @@ class ObStaticEngineExprCG { int inner_generate_calculable_exprs( const common::ObIArray& calculable_exprs, ObPreCalcExprFrameInfo& expr_info); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObStaticEngineExprCG); - private: +private: common::ObIAllocator& allocator_; DatumParamStore* param_store_; ObExprCGCtx op_cg_ctx_; diff --git a/src/sql/dtl/ob_dtl.h b/src/sql/dtl/ob_dtl.h index 32ec758a2..e10002efa 100644 --- a/src/sql/dtl/ob_dtl.h +++ b/src/sql/dtl/ob_dtl.h @@ -27,7 +27,7 @@ class ObDtlChannel; using obrpc::ObDtlRpcProxy; class ObDtlHashTableCell { - public: +public: ObDtlHashTableCell() {} ~ObDtlHashTableCell() @@ -41,12 +41,12 @@ class ObDtlHashTableCell { int foreach_refactored(std::function op); - private: +private: ObDList chan_list_; }; class ObDtlHashTable { - public: +public: ObDtlHashTable() : bucket_num_(0), bucket_cells_(nullptr), allocator_() {} ~ObDtlHashTable(); @@ -63,14 +63,14 @@ class ObDtlHashTable { return bucket_num_; } - private: +private: int64_t bucket_num_; ObDtlHashTableCell* bucket_cells_; common::ObFIFOAllocator allocator_; }; class ObDtlChannelManager { - public: +public: ObDtlChannelManager(int64_t idx, ObDtlHashTable& hash_table) : idx_(idx), spin_lock_(), hash_table_(hash_table) {} ~ObDtlChannelManager(); @@ -82,14 +82,14 @@ class ObDtlChannelManager { int foreach_refactored(int64_t interval, std::function op); TO_STRING_KV(K_(idx)); - private: +private: int64_t idx_; ObSpinLock spin_lock_; ObDtlHashTable& hash_table_; }; class ObDtl { - public: +public: ObDtl(); virtual ~ObDtl(); @@ -129,7 +129,7 @@ class ObDtl { OB_INLINE ObDfcServer& get_dfc_server(); OB_INLINE const ObDfcServer& get_dfc_server() const; - public: +public: // NOTE: This function doesn't have mutex protection. Make sure the // first call is in a single thread and after that use it as you // like. @@ -141,12 +141,12 @@ class ObDtl { return val & (BUCKET_NUM - 1); } - private: +private: int new_channel(uint64_t tenant_id, uint64_t chid, const common::ObAddr& peer, ObDtlChannel*& chan, bool is_local); int init_channel(uint64_t tenant_id, uint64_t chid, const ObAddr& peer, ObDtlChannel*& chan, ObDtlFlowControl* dfc); int get_dtl_channel_manager(uint64_t hash_val, ObDtlChannelManager*& ch_mgr); - private: +private: // bucket number has to be a multiply of hash_cnt static const int64_t HASH_CNT = 256; static const int64_t BUCKET_NUM = 131072; diff --git a/src/sql/dtl/ob_dtl_basic_channel.h b/src/sql/dtl/ob_dtl_basic_channel.h index 32f6ef27b..286d29bfc 100644 --- a/src/sql/dtl/ob_dtl_basic_channel.h +++ b/src/sql/dtl/ob_dtl_basic_channel.h @@ -83,7 +83,7 @@ static_assert(ARRAYSIZEOF(msg_writer_map) == ObDtlMsgType::MAX, "invalid ms_writ // 2) ObRow msg // 3) Array new engine msg class ObDtlChannelEncoder { - public: +public: virtual int write(const ObDtlMsg& msg, ObEvalCtx* eval_ctx, const bool is_eof) = 0; virtual int need_new_buffer(const ObDtlMsg& msg, ObEvalCtx* ctx, int64_t& need_size, bool& need_new) = 0; virtual void write_msg_type(ObDtlLinkedBuffer*) = 0; @@ -98,7 +98,7 @@ class ObDtlChannelEncoder { }; class ObDtlControlMsgWriter : public ObDtlChannelEncoder { - public: +public: ObDtlControlMsgWriter() : type_(CONTROL_WRITER), write_buffer_(nullptr) {} virtual DtlWriterType type() @@ -149,7 +149,7 @@ class ObDtlControlMsgWriter : public ObDtlChannelEncoder { }; class ObDtlRowMsgWriter : public ObDtlChannelEncoder { - public: +public: ObDtlRowMsgWriter(); virtual ~ObDtlRowMsgWriter(); @@ -183,7 +183,7 @@ class ObDtlRowMsgWriter : public ObDtlChannelEncoder { buffer->msg_type() = ObDtlMsgType::PX_CHUNK_ROW; } - private: +private: DtlWriterType type_; ObChunkRowStore row_store_; ObChunkRowStore::Block* block_; @@ -215,7 +215,7 @@ OB_INLINE int ObDtlRowMsgWriter::write(const ObDtlMsg& msg, ObEvalCtx* eval_ctx, } class ObDtlDatumMsgWriter : public ObDtlChannelEncoder { - public: +public: ObDtlDatumMsgWriter(); virtual ~ObDtlDatumMsgWriter(); @@ -249,7 +249,7 @@ class ObDtlDatumMsgWriter : public ObDtlChannelEncoder { buffer->msg_type() = ObDtlMsgType::PX_DATUM_ROW; } - private: +private: DtlWriterType type_; ObDtlLinkedBuffer* write_buffer_; ObChunkDatumStore::Block* block_; @@ -283,7 +283,7 @@ OB_INLINE int ObDtlDatumMsgWriter::write(const ObDtlMsg& msg, ObEvalCtx* eval_ct } class SendMsgResponse { - public: +public: SendMsgResponse(); virtual ~SendMsgResponse(); @@ -321,7 +321,7 @@ class SendMsgResponse { TO_STRING_KV(KP_(inited), K_(ret)); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(SendMsgResponse); bool inited_; @@ -339,7 +339,7 @@ class SendMsgResponse { class ObDtlBasicChannel : public ObDtlChannel { friend class ObDtlChanAgent; - public: +public: explicit ObDtlBasicChannel(const uint64_t tenant_id, const uint64_t id, const common::ObAddr& peer); virtual ~ObDtlBasicChannel(); @@ -349,7 +349,7 @@ class ObDtlBasicChannel : public ObDtlChannel { } class ObDtlChannelBlockProc : public ObIDltChannelLoopPred { - public: + public: void set_ch_idx_var(int64_t* chan_idx) { chan_idx_ = chan_idx; @@ -444,7 +444,7 @@ class ObDtlBasicChannel : public ObDtlChannel { TO_STRING_KV(KP_(id), K_(peer)); - protected: +protected: int push_back_send_list(); int wait_unblocking(); int switch_buffer(const int64_t min_size, const bool is_eof, const int64_t timeout_ts); @@ -466,7 +466,7 @@ class ObDtlBasicChannel : public ObDtlChannel { return recv_buffer_cnt_ > processed_buffer_cnt_; } - protected: +protected: bool is_inited_; const uint64_t local_id_; const int64_t peer_id_; @@ -507,7 +507,7 @@ class ObDtlBasicChannel : public ObDtlChannel { ObDtlChannelBlockProc block_proc_; static const int64_t MAX_BUFFER_CNT = 2; - public: +public: // TODO delete int64_t times_; int64_t write_buf_use_time_; diff --git a/src/sql/dtl/ob_dtl_buf_allocator.h b/src/sql/dtl/ob_dtl_buf_allocator.h index ad2d0ca7c..c0b1b16a4 100644 --- a/src/sql/dtl/ob_dtl_buf_allocator.h +++ b/src/sql/dtl/ob_dtl_buf_allocator.h @@ -25,13 +25,13 @@ class ObDtlLinkedBuffer; class ObDtlBasicChannel; class ObDtlBufIAllocator { - public: +public: virtual ObDtlLinkedBuffer* alloc_buf(ObDtlBasicChannel& ch, const int64_t payload_size) = 0; virtual void free_buf(ObDtlBasicChannel& ch, ObDtlLinkedBuffer*& buf) = 0; }; class ObDtlBufAllocator : public ObDtlBufIAllocator { - public: +public: ObDtlBufAllocator(int64_t tenant_id = common::OB_SERVER_TENANT_ID) : alloc_buffer_cnt_(0), free_buffer_cnt_(0), tenant_id_(tenant_id), sys_buffer_size_(0), timeout_ts_(0){}; virtual ~ObDtlBufAllocator() = default; @@ -50,7 +50,7 @@ class ObDtlBufAllocator : public ObDtlBufIAllocator { timeout_ts_ = timeout_ts; } - private: +private: int64_t alloc_buffer_cnt_; int64_t free_buffer_cnt_; int64_t tenant_id_; diff --git a/src/sql/dtl/ob_dtl_channel.h b/src/sql/dtl/ob_dtl_channel.h index a6ba6bc54..8a1dd2fe3 100644 --- a/src/sql/dtl/ob_dtl_channel.h +++ b/src/sql/dtl/ob_dtl_channel.h @@ -53,13 +53,13 @@ namespace dtl { // define dtl process api class ObIDtlChannelProc { - public: +public: virtual int process(const ObDtlLinkedBuffer&, dtl::ObDtlMsgIterator*) = 0; }; // define interface for process_one/process_one_if class ObIDltChannelLoopPred { - public: +public: virtual bool pred_process(int64_t, ObDtlChannel*) = 0; }; @@ -76,10 +76,10 @@ class ObDtlFlowControl; #define IS_RECEIVE_CHANNEL(chid) (!!(chid & 0x1)) class ObDtlChannel : public common::ObDLinkBase { - public: +public: enum class DtlChannelType { LOCAL_CHANNEL = 0, RPC_CHANNEL = 1, BASIC_CHANNEL = 2 }; - public: +public: explicit ObDtlChannel(uint64_t id, const common::ObAddr& peer); virtual ~ObDtlChannel() {} @@ -257,7 +257,7 @@ class ObDtlChannel : public common::ObDLinkBase { compressor_type_ = type; } - protected: +protected: common::ObThreadCond cond_; int64_t pins_; uint64_t id_; @@ -281,7 +281,7 @@ class ObDtlChannel : public common::ObDLinkBase { common::ObCompressorType compressor_type_; - public: +public: // ObDtlChannel is link base, so it add extra link // link data list void remove_self(); diff --git a/src/sql/dtl/ob_dtl_channel_agent.h b/src/sql/dtl/ob_dtl_channel_agent.h index db9eb27a4..3b63a1626 100644 --- a/src/sql/dtl/ob_dtl_channel_agent.h +++ b/src/sql/dtl/ob_dtl_channel_agent.h @@ -32,7 +32,7 @@ class ObDtlRpcChannel; class ObDtlLocalChannel; class ObDtlBufEncoder { - public: +public: ObDtlBufEncoder() : use_row_store_(false), tenant_id_(500), buffer_(nullptr), msg_writer_(nullptr) {} ~ObDtlBufEncoder() @@ -71,7 +71,7 @@ class ObDtlBufEncoder { return buffer_; } - private: +private: int64_t use_row_store_; int64_t tenant_id_; ObDtlLinkedBuffer* buffer_; @@ -82,7 +82,7 @@ class ObDtlBufEncoder { }; class ObDtlBcastService { - public: +public: ObDtlBcastService() : server_addr_(), bcast_buf_(nullptr), @@ -130,7 +130,7 @@ class ObDtlChanAgent { TO_STRING_KV(K(server_addr_), K(ch_count_)); }; - public: +public: ObDtlChanAgent() : init_(false), local_channels_(), @@ -149,12 +149,12 @@ class ObDtlChanAgent { int64_t tenant_id, int64_t timeout_ts); void destroy(); - private: +private: int switch_buffer(int64_t need_size); int send_last_buffer(ObDtlLinkedBuffer*& last_buffer); int inner_broadcast_row(const ObDtlMsg& msg, ObEvalCtx* eval_ctx, bool is_eof); - private: +private: bool init_; // use to allocate broadcast service. common::ObArenaAllocator allocator_; diff --git a/src/sql/dtl/ob_dtl_channel_group.h b/src/sql/dtl/ob_dtl_channel_group.h index f453d78a3..5979b5c90 100644 --- a/src/sql/dtl/ob_dtl_channel_group.h +++ b/src/sql/dtl/ob_dtl_channel_group.h @@ -51,7 +51,7 @@ class ObDtlFlowControl; // } // class ObDtlChannelGroup { - public: +public: static int make_channel(const uint64_t tenant_id, const common::ObAddr& addr1, const common::ObAddr& addr2, ObDtlChannelInfo& ci1, ObDtlChannelInfo& ci2); static int make_channel(ObDtlChSet& producer, ObDtlChSet& consumer); diff --git a/src/sql/dtl/ob_dtl_channel_loop.h b/src/sql/dtl/ob_dtl_channel_loop.h index fd57cc94d..bde03ecc3 100644 --- a/src/sql/dtl/ob_dtl_channel_loop.h +++ b/src/sql/dtl/ob_dtl_channel_loop.h @@ -29,14 +29,14 @@ namespace sql { namespace dtl { class ObDtlChannelLoop : public ObDtlChannelWatcher { - private: +private: static constexpr auto MAX_PROCS = (int64_t)(ObDtlMsgType::MAX); using Proc = ObDtlPacketProcBase; using InterruptProc = ObDtlInterruptProc; using PredFunc = std::function; class ObDtlChannelLoopProc : public ObIDtlChannelProc { - public: + public: ObDtlChannelLoopProc(uint16_t& last_msg_type, Proc** proc_map) : last_msg_type_(last_msg_type), proc_map_(proc_map) {} virtual int process(const ObDtlLinkedBuffer&, dtl::ObDtlMsgIterator*); @@ -47,7 +47,7 @@ class ObDtlChannelLoop : public ObDtlChannelWatcher { typedef ObDtlLocalChannel ObDtlMockChannel; - public: +public: ObDtlChannelLoop(); virtual ~ObDtlChannelLoop() = default; @@ -102,12 +102,12 @@ class ObDtlChannelLoop : public ObDtlChannelWatcher { proxy_first_buffer_cache_ = proxy_first_buffer_cache; } - private: +private: int process_channels(ObIDltChannelLoopPred* pred, int64_t& nth_channel); int process_channel(int64_t& nth_channel); int process_base(ObIDltChannelLoopPred* pred, int64_t& hinted_channel, int64_t timeout); - public: +public: int unblock_channels(int64_t data_channel_idx); void add_last_data_list(ObDtlChannel* ch); virtual void remove_data_list(ObDtlChannel* ch, bool force) override; @@ -122,7 +122,7 @@ class ObDtlChannelLoop : public ObDtlChannelWatcher { use_interm_result_ = flag; } - private: +private: static const int64_t INTERRUPT_CHECK_TIMES = 16; Proc* proc_map_[MAX_PROCS]; InterruptProc* interrupt_proc_; @@ -147,7 +147,7 @@ class ObDtlChannelLoop : public ObDtlChannelWatcher { int64_t loop_times_; bool use_interm_result_; - public: +public: int64_t time_recorder_; }; diff --git a/src/sql/dtl/ob_dtl_channel_mem_manager.h b/src/sql/dtl/ob_dtl_channel_mem_manager.h index 3d41e4892..73307d566 100644 --- a/src/sql/dtl/ob_dtl_channel_mem_manager.h +++ b/src/sql/dtl/ob_dtl_channel_mem_manager.h @@ -29,7 +29,7 @@ namespace dtl { // class ObDtlLinkedBuffer; class ObDtlChannelMemManager { - public: +public: ObDtlChannelMemManager(uint64_t tenant_id); virtual ~ObDtlChannelMemManager() { @@ -39,7 +39,7 @@ class ObDtlChannelMemManager { int init(); void destroy(); - public: +public: ObDtlLinkedBuffer* alloc(int64_t chid, int64_t size); int free(ObDtlLinkedBuffer* buf, bool auto_free = true); @@ -111,14 +111,14 @@ class ObDtlChannelMemManager { return free_queue_.size(); } - private: +private: bool out_of_memory(); int64_t get_used_memory_size(); int64_t get_max_dtl_memory_size(); int64_t get_max_tenant_memory_limit_size(); void real_free(ObDtlLinkedBuffer* buf); - private: +private: uint64_t tenant_id_; int64_t size_per_buffer_; int64_t seqno_; diff --git a/src/sql/dtl/ob_dtl_channel_watcher.h b/src/sql/dtl/ob_dtl_channel_watcher.h index ff942c5e5..8bc44dbae 100644 --- a/src/sql/dtl/ob_dtl_channel_watcher.h +++ b/src/sql/dtl/ob_dtl_channel_watcher.h @@ -23,7 +23,7 @@ class ObDtlChannel; // Watcher class ObDtlChannelWatcher { - public: +public: virtual void notify(ObDtlChannel& chan) = 0; virtual void remove_data_list(ObDtlChannel* chan, bool force = false) = 0; virtual void add_last_data_list(ObDtlChannel* ch) = 0; diff --git a/src/sql/dtl/ob_dtl_fc_server.h b/src/sql/dtl/ob_dtl_fc_server.h index ba3ebc3cb..69077454a 100644 --- a/src/sql/dtl/ob_dtl_fc_server.h +++ b/src/sql/dtl/ob_dtl_fc_server.h @@ -30,11 +30,11 @@ namespace sql { namespace dtl { class ObTenantDfc { - public: +public: ObTenantDfc(uint64_t tenant_id); virtual ~ObTenantDfc(); - public: +public: static int mtl_init(uint64_t tenant_id, ObTenantDfc*& tenant_dfc); static void mtl_destroy(ObTenantDfc*& tenant_dfc); @@ -54,7 +54,7 @@ class ObTenantDfc { int deregister_dfc(ObDtlFlowControl& dfc); - public: +public: // for cache first msg and release first msg int64_t get_hash_value(int64_t chid); int cache_buffer(int64_t chid, ObDtlLinkedBuffer*& data_buffer, bool attach = false); @@ -128,14 +128,14 @@ class ObTenantDfc { return &tenant_mem_mgr_; } - private: +private: static int init_channel_mem_manager(); static int init_first_buffer_manager(); int clean_on_timeout(); virtual void calc_max_buffer(int64_t max_parallel_cnt); - private: +private: // global data flow control ObDtlFlowControl tenant_dfc_; uint64_t tenant_id_; @@ -156,12 +156,12 @@ class ObTenantDfc { ObDtlTenantMemManager tenant_mem_mgr_; ObDtlLocalFirstBufferCacheManager first_buffer_mgr_; - public: +public: TO_STRING_KV(K_(tenant_id), K_(blocked_dfc_cnt), K_(channel_total_cnt)); }; class ObDfcServer : public ObTimerTask { - public: +public: ObDfcServer() {} ~ObDfcServer() @@ -194,7 +194,7 @@ class ObDfcServer : public ObTimerTask { ObDtlTenantMemManager* get_tenant_mem_manager(int64_t tenant_id); - private: +private: int get_tenant_dfc_by_id(uint64_t tenant_id, ObTenantDfc*& tenant_dfc); common::hash::ObHashMap tenant_dfc_map_; typedef common::hash::ObHashMap::iterator diff --git a/src/sql/dtl/ob_dtl_flow_control.h b/src/sql/dtl/ob_dtl_flow_control.h index 36bff6443..d8e9229fe 100644 --- a/src/sql/dtl/ob_dtl_flow_control.h +++ b/src/sql/dtl/ob_dtl_flow_control.h @@ -41,7 +41,7 @@ class ObDtlLocalFirstBufferCache; class ObDtlUnblockingMsg : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: ObDtlUnblockingMsg() {} @@ -50,7 +50,7 @@ class ObDtlUnblockingMsg : public dtl::ObDtlMsgTemp { - public: +public: explicit ObDtlUnblockingMsgP(ObDtlFlowControl& dfc) : dfc_(dfc) {} virtual ~ObDtlUnblockingMsgP() = default; @@ -62,7 +62,7 @@ class ObDtlUnblockingMsgP : public dtl::ObDtlPacketProc { class ObDtlDrainMsg : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: ObDtlDrainMsg() {} @@ -71,7 +71,7 @@ class ObDtlDrainMsg : public dtl::ObDtlMsgTemp { - public: +public: explicit ObDtlDrainMsgP(ObDtlFlowControl& dfc) : dfc_(dfc) {} virtual ~ObDtlDrainMsgP() = default; @@ -80,7 +80,7 @@ class ObDtlDrainMsgP : public dtl::ObDtlPacketProc { }; class ObDtlFlowControl { - public: +public: ObDtlFlowControl() : tenant_id_(OB_INVALID_ID), timeout_ts_(0), @@ -319,7 +319,7 @@ class ObDtlFlowControl { return compressor_type_; } - private: +private: static const int64_t THRESHOLD_SIZE = 2097152; static const int64_t MAX_BUFFER_CNT = 3; static const int64_t MAX_BUFFER_FACTOR = 2; @@ -352,7 +352,7 @@ class ObDtlFlowControl { ObDtlChTotalInfo* ch_info_; - private: +private: // Todo: In DFC, it can monitor data size and so on }; diff --git a/src/sql/dtl/ob_dtl_interm_result_manager.h b/src/sql/dtl/ob_dtl_interm_result_manager.h index 4a8f49764..a260a482b 100644 --- a/src/sql/dtl/ob_dtl_interm_result_manager.h +++ b/src/sql/dtl/ob_dtl_interm_result_manager.h @@ -62,7 +62,7 @@ struct ObDTLIntermResultInfo { class ObDTLIntermResultGC : public common::ObTimerTask { friend class ObDTLIntermResultManager; - public: +public: ObDTLIntermResultGC() : cur_time_(0), expire_keys_(), gc_type_(NOT_INIT), dump_count_(0), interm_cnt_(0), clean_cnt_(0) {} @@ -71,17 +71,17 @@ class ObDTLIntermResultGC : public common::ObTimerTask { void operator()(common::hash::HashMapPair& entry); void runTimerTask(); - public: +public: const static int64_t REFRESH_INTERVAL = 10 * 1000L * 1000L; // 10s interval const static int64_t DUMP_TIME_THRESHOLD = 10 * 1000L * 1000L; // dump time threshold is 10s const static int64_t CLEAR_TIME_THRESHOLD = 10 * 1000L * 1000L; // clean time threashold is 10s - public: +public: enum ObGCType { NOT_INIT = 0, CLEAR = 1, DUMP = 2 }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDTLIntermResultGC); - private: +private: int64_t cur_time_; common::ObSEArray expire_keys_; ObGCType gc_type_; @@ -91,24 +91,24 @@ class ObDTLIntermResultGC : public common::ObTimerTask { }; class ObAtomicGetIntermResultInfoCall { - public: +public: ObAtomicGetIntermResultInfoCall() : result_info_() {} ~ObAtomicGetIntermResultInfoCall() = default; void operator()(common::hash::HashMapPair& entry); - public: +public: ObDTLIntermResultInfo result_info_; }; class ObAtomicAppendBlockCall { - public: +public: ObAtomicAppendBlockCall(char* buf, int64_t size) : block_buf_(buf), size_(size), ret_(common::OB_SUCCESS) {} ~ObAtomicAppendBlockCall() = default; void operator()(common::hash::HashMapPair& entry); - public: +public: char* block_buf_; int64_t size_; int ret_; @@ -117,7 +117,7 @@ class ObAtomicAppendBlockCall { class ObDTLIntermResultManager { friend class ObDTLIntermResultGC; - public: +public: static ObDTLIntermResultManager& getInstance(); typedef common::hash::ObHashMap MAP; int get_interm_result_info(ObDTLIntermResultKey& key, ObDTLIntermResultInfo& result_info); @@ -136,15 +136,15 @@ class ObDTLIntermResultManager { int init(); void destroy(); - private: +private: static const int64_t BUCKET_NUM = 500000; // 50w - private: +private: MAP map_; bool is_inited_; int64_t dir_id_; ObDTLIntermResultGC gc_; - private: +private: ObDTLIntermResultManager(); ~ObDTLIntermResultManager(); DISALLOW_COPY_AND_ASSIGN(ObDTLIntermResultManager); diff --git a/src/sql/dtl/ob_dtl_linked_buffer.h b/src/sql/dtl/ob_dtl_linked_buffer.h index 82ed7c3bb..1e265ff1b 100644 --- a/src/sql/dtl/ob_dtl_linked_buffer.h +++ b/src/sql/dtl/ob_dtl_linked_buffer.h @@ -28,7 +28,7 @@ class ObDtlChannel; class ObDtlDfoKey { OB_UNIS_VERSION(1); - public: +public: ObDtlDfoKey() : server_id_(-1), px_sequence_id_(common::OB_INVALID_ID), qc_id_(-1), dfo_id_(common::OB_INVALID_ID) {} uint64_t hash() const @@ -68,7 +68,7 @@ class ObDtlDfoKey { TO_STRING_KV(K_(server_id), K_(px_sequence_id), K_(qc_id), K_(dfo_id)); - public: +public: static const uint64_t PX_SEQ_MASK = 0x8000000000000000; int32_t server_id_; uint64_t px_sequence_id_; @@ -79,7 +79,7 @@ class ObDtlDfoKey { class ObDtlLinkedBuffer : public common::ObLink { OB_UNIS_VERSION(1); - public: +public: ObDtlLinkedBuffer() : buf_(), size_(), @@ -325,7 +325,7 @@ class ObDtlLinkedBuffer : public common::ObLink { return use_interm_result_; } - private: +private: char* buf_; int64_t size_; mutable int64_t pos_; diff --git a/src/sql/dtl/ob_dtl_local_channel.h b/src/sql/dtl/ob_dtl_local_channel.h index 8352d01dc..4a136a87d 100644 --- a/src/sql/dtl/ob_dtl_local_channel.h +++ b/src/sql/dtl/ob_dtl_local_channel.h @@ -33,7 +33,7 @@ namespace sql { namespace dtl { class ObDtlLocalChannel : public ObDtlBasicChannel { - public: +public: explicit ObDtlLocalChannel(const uint64_t tenant_id, const uint64_t id, const common::ObAddr& peer); virtual ~ObDtlLocalChannel(); @@ -48,7 +48,7 @@ class ObDtlLocalChannel : public ObDtlBasicChannel { virtual int feedup(ObDtlLinkedBuffer*& buffer) override; virtual int send_message(ObDtlLinkedBuffer*& buf); - private: +private: int send_shared_message(ObDtlLinkedBuffer*& buf); int process_interm_result(ObDtlLinkedBuffer* buffer); }; diff --git a/src/sql/dtl/ob_dtl_local_first_buffer_manager.cpp b/src/sql/dtl/ob_dtl_local_first_buffer_manager.cpp index 57258e64d..26cb2f055 100644 --- a/src/sql/dtl/ob_dtl_local_first_buffer_manager.cpp +++ b/src/sql/dtl/ob_dtl_local_first_buffer_manager.cpp @@ -26,7 +26,7 @@ using namespace oceanbase::lib; using namespace oceanbase::share; class PinFunction { - public: +public: void operator()(ObDtlLocalFirstBufferCache* val) { val->pin(); diff --git a/src/sql/dtl/ob_dtl_local_first_buffer_manager.h b/src/sql/dtl/ob_dtl_local_first_buffer_manager.h index 2e12cd255..27b8505a3 100644 --- a/src/sql/dtl/ob_dtl_local_first_buffer_manager.h +++ b/src/sql/dtl/ob_dtl_local_first_buffer_manager.h @@ -29,7 +29,7 @@ namespace sql { namespace dtl { class ObDtlCacheBufferInfo : public common::ObDLinkBase { - public: +public: ObDtlCacheBufferInfo() : buffer_(nullptr), chid_(common::OB_INVALID_ID), ts_(0) {} @@ -54,20 +54,20 @@ class ObDtlCacheBufferInfo : public common::ObDLinkBase { return chid_; } - private: +private: ObDtlLinkedBuffer* buffer_; int64_t chid_; int64_t ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDtlCacheBufferInfo); }; // dtl buffer info management class ObDtlBufferInfoManager { - public: +public: class ObDtlBufferInfoAllocator { - public: + public: ObDtlBufferInfoAllocator() : spin_lock_(), allocator_(), free_list_() {} ~ObDtlBufferInfoAllocator(); @@ -78,14 +78,14 @@ class ObDtlBufferInfoManager { int alloc_buffer_info(int64_t chid, ObDtlCacheBufferInfo*& buffer_info); int free_buffer_info(ObDtlCacheBufferInfo* buffer_info); - private: + private: static const int64_t MAX_FREE_LIST_SIZE = 8; ObSpinLock spin_lock_; common::ObFIFOAllocator allocator_; ObDList free_list_; }; - public: +public: ObDtlBufferInfoManager(common::ObFIFOAllocator& allocator) : conrrent_allocators_(nullptr), allocator_(allocator) {} ~ObDtlBufferInfoManager() @@ -99,14 +99,14 @@ class ObDtlBufferInfoManager { int alloc_buffer_info(int64_t chid, ObDtlCacheBufferInfo*& buffer_info); int free_buffer_info(ObDtlCacheBufferInfo* buffer_info); - private: +private: static int64_t get_hash_value(int64_t chid) { uint64_t val = common::murmurhash(&chid, sizeof(chid), 0); return val % ALLOCATOR_CNT; } - private: +private: static const int64_t ALLOCATOR_CNT = 128; ObDtlBufferInfoAllocator* conrrent_allocators_; common::ObFIFOAllocator& allocator_; @@ -122,7 +122,7 @@ struct ob_dtl_key_value_fun { template class ObDtlFirstBufferHashTableCell { - public: +public: ObDtlFirstBufferHashTableCell() : first_buffer_list_() {} ~ObDtlFirstBufferHashTableCell() @@ -138,7 +138,7 @@ class ObDtlFirstBufferHashTableCell { int foreach_refactored(std::function op); - private: +private: common::ObDList first_buffer_list_; ob_dtl_key_value_fun key_fun_; }; @@ -242,7 +242,7 @@ int ObDtlFirstBufferHashTableCell::foreach_refactored(std: } class ObDtlFirstBufferConcurrentCell { - public: +public: ObDtlFirstBufferConcurrentCell(common::ObIAllocator& allocator) : n_lock_(0), lock_(nullptr), allocator_(allocator) {} ~ObDtlFirstBufferConcurrentCell() @@ -255,7 +255,7 @@ class ObDtlFirstBufferConcurrentCell { ObLatch& get_lock(int32_t idx); - private: +private: int32_t n_lock_; ObLatch* lock_; common::ObIAllocator& allocator_; @@ -263,7 +263,7 @@ class ObDtlFirstBufferConcurrentCell { template > class ObDtlFirstBufferHashTable { - public: +public: ObDtlFirstBufferHashTable(common::ObIAllocator& allocator) : bucket_num_(0), n_lock_(0), allocator_(allocator), concurrent_cell_(allocator), bucket_cells_(nullptr) {} @@ -298,7 +298,7 @@ class ObDtlFirstBufferHashTable { return bucket_num_; } - private: +private: int64_t bucket_num_; int64_t n_lock_; common::ObIAllocator& allocator_; @@ -417,9 +417,9 @@ int ObDtlFirstBufferHashTable::foreach_refa } class ObDtlLocalFirstBufferCache : public common::ObDLinkBase { - public: +public: class ObDtlBufferClean { - public: + public: ObDtlBufferClean(ObDtlTenantMemManager* tenant_mem_mgr, ObDtlBufferInfoManager* buffer_info_mgr) : tenant_mem_mgr_(tenant_mem_mgr), buffer_info_mgr_(buffer_info_mgr) {} @@ -427,12 +427,12 @@ class ObDtlLocalFirstBufferCache : public common::ObDLinkBase class ObDtlMsgTemp : public ObDtlMsg { - public: +public: ObDtlMsgType get_type() const override { return type(); diff --git a/src/sql/dtl/ob_dtl_processor.h b/src/sql/dtl/ob_dtl_processor.h index 9c8a82b99..8c38d8969 100644 --- a/src/sql/dtl/ob_dtl_processor.h +++ b/src/sql/dtl/ob_dtl_processor.h @@ -26,12 +26,12 @@ namespace sql { namespace dtl { class ObDtlInterruptProc { - public: +public: virtual int process(const common::ObInterruptCode& ic) = 0; }; class ObDtlMsgIterator { - public: +public: virtual bool has_next() = 0; virtual void set_iterator_end() = 0; virtual int get_next_row(common::ObNewRow& row) = 0; @@ -39,7 +39,7 @@ class ObDtlMsgIterator { }; class ObDtlPacketProcBase { - public: +public: virtual ~ObDtlPacketProcBase() = default; virtual ObDtlMsgType get_proc_type() const = 0; virtual OB_INLINE void set_iter(ObDtlMsgIterator* iter) @@ -55,7 +55,7 @@ class ObDtlPacketProcBase { template class ObDtlPacketProc : public ObDtlPacketProcBase { - public: +public: ObDtlMsgType get_proc_type() const override { return Packet::type(); @@ -68,10 +68,10 @@ class ObDtlPacketProc : public ObDtlPacketProcBase { return common::OB_SUCCESS; } - private: +private: virtual int process(const Packet& pkt) = 0; - private: +private: Packet pkt_; }; diff --git a/src/sql/dtl/ob_dtl_rpc_channel.h b/src/sql/dtl/ob_dtl_rpc_channel.h index e86af38ff..d9483d4c1 100644 --- a/src/sql/dtl/ob_dtl_rpc_channel.h +++ b/src/sql/dtl/ob_dtl_rpc_channel.h @@ -45,7 +45,7 @@ namespace dtl { class ObDtlRpcChannel : public ObDtlBasicChannel { friend class ObDtlBcastService; class SendMsgCB : public obrpc::ObDtlRpcProxy::AsyncCB { - public: + public: explicit SendMsgCB(SendMsgResponse& response, const common::ObCurTraceId::TraceId trace_id) : response_(response) { trace_id_.set(trace_id); @@ -59,13 +59,13 @@ class ObDtlRpcChannel : public ObDtlBasicChannel { UNUSED(arg); } - private: + private: SendMsgResponse& response_; common::ObCurTraceId::TraceId trace_id_; }; class SendBCMsgCB : public obrpc::ObDtlRpcProxy::AsyncCB { - public: + public: explicit SendBCMsgCB(const common::ObCurTraceId::TraceId trace_id) : responses_() { trace_id_.set(trace_id); @@ -83,12 +83,12 @@ class ObDtlRpcChannel : public ObDtlBasicChannel { return responses_.assign(resps); } - private: + private: common::ObSEArray responses_; common::ObCurTraceId::TraceId trace_id_; }; - public: +public: explicit ObDtlRpcChannel(const uint64_t tenant_id, const uint64_t id, const common::ObAddr& peer); virtual ~ObDtlRpcChannel(); diff --git a/src/sql/dtl/ob_dtl_rpc_processor.h b/src/sql/dtl/ob_dtl_rpc_processor.h index a94a81446..ad7e89010 100644 --- a/src/sql/dtl/ob_dtl_rpc_processor.h +++ b/src/sql/dtl/ob_dtl_rpc_processor.h @@ -25,17 +25,17 @@ class ObDtlLinkedBuffer; class ObDtlChannel; class ObDtlSendMessageP : public obrpc::ObRpcProcessor > { - public: +public: virtual int process() final; static int process_msg(ObDtlRpcDataResponse& response, ObDtlSendArgs& args); static int process_interm_result(ObDtlSendArgs& arg); - private: +private: static int process_px_bloom_filter_data(ObDtlLinkedBuffer*& buffer); }; class ObDtlBCSendMessageP : public obrpc::ObRpcProcessor > { - public: +public: virtual int process() final; }; diff --git a/src/sql/dtl/ob_dtl_rpc_proxy.h b/src/sql/dtl/ob_dtl_rpc_proxy.h index 3b183a8ed..1b79927ab 100644 --- a/src/sql/dtl/ob_dtl_rpc_proxy.h +++ b/src/sql/dtl/ob_dtl_rpc_proxy.h @@ -27,12 +27,12 @@ namespace dtl { class ObDtlRpcDataResponse { OB_UNIS_VERSION(1); - public: +public: ObDtlRpcDataResponse() : is_block_(false), recode_(OB_SUCCESS) {} TO_STRING_KV(K_(is_block)); - public: +public: bool is_block_; int recode_; }; @@ -40,12 +40,12 @@ class ObDtlRpcDataResponse { class ObDtlBCRpcDataResponse { OB_UNIS_VERSION(1); - public: +public: ObDtlBCRpcDataResponse() : resps_() {} TO_STRING_KV(K_(resps)); - public: +public: ObSEArray resps_; }; @@ -58,7 +58,7 @@ struct ObDtlRpcChanArgs { }; class ObDtlSendArgs { - public: +public: ObDtlSendArgs() = default; ObDtlSendArgs(int64_t chid, const ObDtlLinkedBuffer& buffer) : chid_(chid), buffer_(buffer) {} @@ -66,19 +66,19 @@ class ObDtlSendArgs { ObDtlLinkedBuffer buffer_; TO_STRING_KV(K_(chid), KP(&buffer_)); - private: +private: OB_UNIS_VERSION(1); }; class ObDtlBCSendArgs { - public: +public: ObDtlBCSendArgs() : args_(), bc_buffer_() {} ObSEArray args_; ObDtlLinkedBuffer bc_buffer_; TO_STRING_KV(K(args_.count())); - private: +private: OB_UNIS_VERSION(1); }; @@ -87,7 +87,7 @@ class ObDtlBCSendArgs { namespace obrpc { class ObDtlRpcProxy : public ObRpcProxy { - public: +public: DEFINE_TO(ObDtlRpcProxy); // RPC_S(PR5 create_channel, OB_DTL_CREATE_CHANNEL, (ObDtlRpcChanArgs)); diff --git a/src/sql/dtl/ob_dtl_task.h b/src/sql/dtl/ob_dtl_task.h index 295b403c2..f686ddaa4 100644 --- a/src/sql/dtl/ob_dtl_task.h +++ b/src/sql/dtl/ob_dtl_task.h @@ -38,7 +38,7 @@ enum DTL_CHAN_STATE { DTL_CS_RUN, DTL_CS_DRAINED, DTL_CS_UNREGISTER }; struct ObDtlChannelInfo { OB_UNIS_VERSION(1); - public: +public: uint64_t chid_; // Local or RPC channel is used. DTL_CHAN_TYPE type_; @@ -59,9 +59,9 @@ struct ObDtlChannelInfo { class ObDtlChSet { OB_UNIS_VERSION(1); - public: +public: static constexpr int64_t MAX_CHANS = 65536; // nearly unlimited - public: +public: ObDtlChSet() : exec_addr_() {} ~ObDtlChSet() = default; @@ -86,7 +86,7 @@ class ObDtlChSet { } TO_STRING_KV(K_(exec_addr), K_(ch_info_set)); - protected: +protected: common::ObAddr exec_addr_; common::ObSEArray ch_info_set_; }; @@ -94,7 +94,7 @@ class ObDtlChSet { class ObDtlExecServer { OB_UNIS_VERSION(1); - public: +public: ObDtlExecServer() : total_task_cnt_(0), exec_addrs_(), prefix_task_counts_() {} @@ -117,7 +117,7 @@ class ObDtlExecServer { } TO_STRING_KV(K_(total_task_cnt), K_(exec_addrs), K_(prefix_task_counts)); - public: +public: int64_t total_task_cnt_; common::ObSEArray exec_addrs_; common::ObSEArray prefix_task_counts_; @@ -126,7 +126,7 @@ class ObDtlExecServer { class ObDtlChTotalInfo { OB_UNIS_VERSION(1); - public: +public: ObDtlChTotalInfo() : start_channel_id_(0), transmit_exec_server_(), @@ -147,7 +147,7 @@ class ObDtlChTotalInfo { TO_STRING_KV( K_(start_channel_id), K_(transmit_exec_server), K_(receive_exec_server), K_(channel_count), K_(tenant_id)); - public: +public: int64_t start_channel_id_; ObDtlExecServer transmit_exec_server_; ObDtlExecServer receive_exec_server_; @@ -159,7 +159,7 @@ class ObDtlTask { OB_UNIS_VERSION(1); static constexpr int64_t MAX_CHANS = 128; - public: +public: ObDtlTask(); virtual ~ObDtlTask(); @@ -177,13 +177,13 @@ class ObDtlTask { TO_STRING_KV(K_(jobid)); - protected: +protected: // Link channels with channel ID. // int link_chans(); // Unlink channels linked before. // void unlink_chans(); - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObDtlTask); uint64_t jobid_; diff --git a/src/sql/dtl/ob_dtl_tenant_mem_manager.h b/src/sql/dtl/ob_dtl_tenant_mem_manager.h index 2e85094ca..cddd3b9aa 100644 --- a/src/sql/dtl/ob_dtl_tenant_mem_manager.h +++ b/src/sql/dtl/ob_dtl_tenant_mem_manager.h @@ -24,7 +24,7 @@ namespace dtl { // class ObDtlLinkedBuffer; class ObDtlTenantMemManager { - public: +public: ObDtlTenantMemManager(uint64_t tenant_id); virtual ~ObDtlTenantMemManager() { @@ -35,7 +35,7 @@ class ObDtlTenantMemManager { void destroy(); int auto_free_on_time(bool with_tenant_resource); - public: +public: ObDtlLinkedBuffer* alloc(int64_t chid, int64_t size); int free(ObDtlLinkedBuffer* buf); int64_t hash(int64_t chid); @@ -47,7 +47,7 @@ class ObDtlTenantMemManager { return mem_mgrs_.count(); } - private: +private: void buffer_status(); int64_t get_min_buffer_size(); @@ -55,12 +55,12 @@ class ObDtlTenantMemManager { int64_t variance_alloc_times(); int64_t avg_alloc_times(); - private: +private: static const int64_t HASH_CNT = 128; uint64_t tenant_id_; common::ObSEArray mem_mgrs_; - private: +private: common::ObSEArray times_; int64_t hash_cnt_; }; diff --git a/src/sql/dtl/ob_dtl_utils.h b/src/sql/dtl/ob_dtl_utils.h index 0f56acce5..cf44cc34c 100644 --- a/src/sql/dtl/ob_dtl_utils.h +++ b/src/sql/dtl/ob_dtl_utils.h @@ -22,7 +22,7 @@ namespace sql { namespace dtl { class ObPxControlChannelProc : public ObIDltChannelLoopPred { - public: +public: ObPxControlChannelProc() {} virtual bool pred_process(int64_t idx, ObDtlChannel* chan) override @@ -33,7 +33,7 @@ class ObPxControlChannelProc : public ObIDltChannelLoopPred { }; class ObDtlAsynSender { - public: +public: ObDtlAsynSender(ObIArray& channels, ObDtlChTotalInfo* ch_info, bool is_transmit) : channels_(channels), ch_info_(ch_info), is_transmit_(is_transmit) {} @@ -42,17 +42,17 @@ class ObDtlAsynSender { int syn_send(); virtual int action(ObDtlChannel* ch) = 0; - private: +private: int calc_batch_buffer_cnt(int64_t& max_batch_size, int64_t& max_loop_cnt); - private: +private: ObIArray& channels_; ObDtlChTotalInfo* ch_info_; bool is_transmit_; }; class ObTransmitEofAsynSender : public ObDtlAsynSender { - public: +public: ObTransmitEofAsynSender(ObIArray& channels, ObDtlChTotalInfo* ch_info, bool is_transmit, int64_t timeout_ts, sql::ObEvalCtx* eval_ctx) : ObDtlAsynSender(channels, ch_info, is_transmit), timeout_ts_(timeout_ts), eval_ctx_(eval_ctx) @@ -60,13 +60,13 @@ class ObTransmitEofAsynSender : public ObDtlAsynSender { virtual int action(ObDtlChannel* ch); - private: +private: int64_t timeout_ts_; sql::ObEvalCtx* eval_ctx_; }; class ObDfcDrainAsynSender : public ObDtlAsynSender { - public: +public: ObDfcDrainAsynSender( ObIArray& channels, ObDtlChTotalInfo* ch_info, bool is_transmit, int64_t timeout_ts) : ObDtlAsynSender(channels, ch_info, is_transmit), timeout_ts_(timeout_ts) @@ -74,12 +74,12 @@ class ObDfcDrainAsynSender : public ObDtlAsynSender { virtual int action(ObDtlChannel* ch); - private: +private: int64_t timeout_ts_; }; class ObDfcUnblockAsynSender : public ObDtlAsynSender { - public: +public: ObDfcUnblockAsynSender(ObIArray& channels, ObDtlChTotalInfo* ch_info, bool is_transmit, int64_t timeout_ts, ObDtlFlowControl& dfc) : ObDtlAsynSender(channels, ch_info, is_transmit), timeout_ts_(timeout_ts), dfc_(dfc), unblock_cnt_(0) @@ -92,7 +92,7 @@ class ObDfcUnblockAsynSender : public ObDtlAsynSender { return unblock_cnt_; } - private: +private: int64_t timeout_ts_; ObDtlFlowControl& dfc_; int64_t unblock_cnt_; diff --git a/src/sql/dtl/ob_op_metric.h b/src/sql/dtl/ob_op_metric.h index cceab1991..475162814 100644 --- a/src/sql/dtl/ob_op_metric.h +++ b/src/sql/dtl/ob_op_metric.h @@ -25,7 +25,7 @@ namespace sql { class ObOpMetric { OB_UNIS_VERSION(1); - public: +public: ObOpMetric() : enable_audit_(false), id_(-1), @@ -148,7 +148,7 @@ class ObOpMetric { TO_STRING_KV( K_(id), K_(type), K_(first_in_ts), K_(first_out_ts), K_(last_in_ts), K_(last_out_ts), K_(counter), K_(exec_time)); - private: +private: static const int64_t FIRST_IN = 0x01; static const int64_t FIRST_OUT = 0x02; static const int64_t LAST_IN = 0x4; diff --git a/src/sql/engine/aggregate/ob_aggregate_function.h b/src/sql/engine/aggregate/ob_aggregate_function.h index 82b634e98..6cd20faf8 100644 --- a/src/sql/engine/aggregate/ob_aggregate_function.h +++ b/src/sql/engine/aggregate/ob_aggregate_function.h @@ -28,7 +28,7 @@ namespace sql { typedef common::ObDList ObAggrExprList; class ObAggregateDistinctItem { - public: +public: ObAggregateDistinctItem() : group_id_(0), col_idx_(0), cs_type_(common::CS_TYPE_INVALID), cells_(NULL), cs_type_list_(NULL) {} @@ -64,14 +64,14 @@ class ObAggregateDistinctItem { // We only implement distinct logic here, no common interface abstracted here, // use the derived class directly. class ObAggCellCtx { - public: +public: // %alloc is used to initialize the structures, can not be used to hold the data explicit ObAggCellCtx(common::ObIAllocator& alloc); virtual ~ObAggCellCtx(); virtual void reuse(); - public: +public: // for distinct calculate may be replace by hash based distinct in the future. ObUniqueSort* distinct_set_; common::ObArrayHelper sort_columns_; @@ -79,12 +79,12 @@ class ObAggCellCtx { int init_distinct_set(const uint64_t tenant_id, const common::ObIArray& cs_types, const int64_t sort_col_cnt, const bool need_rewind); - protected: +protected: common::ObIAllocator& alloc_; }; class ObGroupConcatRowStore { - public: +public: ObGroupConcatRowStore(); ~ObGroupConcatRowStore(); @@ -136,7 +136,7 @@ class ObGroupConcatRowStore { return need_sort_; } - private: +private: bool need_sort_; int64_t rows_; int64_t iter_idx_; @@ -147,7 +147,7 @@ class ObGroupConcatRowStore { }; class ObGroupConcatCtx : public ObAggCellCtx { - public: +public: ObGroupConcatCtx(common::ObIAllocator& alloc) : ObAggCellCtx(alloc), gc_rs_(NULL) {} @@ -155,7 +155,7 @@ class ObGroupConcatCtx : public ObAggCellCtx { virtual void reuse() override; - public: +public: ObGroupConcatRowStore* gc_rs_; }; @@ -166,7 +166,7 @@ enum { }; class ObAggregateFunction { - public: +public: struct GroupRow { GroupRow() : row_(NULL), ctx_(NULL) {} @@ -185,7 +185,7 @@ class ObAggregateFunction { TO_STRING_KV(K(expr_), K(ctx_idx_)); }; - public: +public: ObAggregateFunction(); ~ObAggregateFunction(); void set_int_div_as_double(bool did); @@ -250,7 +250,7 @@ class ObAggregateFunction { int deep_copy_cur_row(ObNewRow*& prev_row, const ObNewRow cur_row); int compare_calc(ObObj& obj1, ObObj& obj2, const ObOpSchemaObj& extra_info, int32_t& compare_result, bool& is_asc); - private: +private: inline ObAggCellCtx* get_agg_cell_ctx(const int64_t group_id, const int64_t cell_idx) { return cell_idx >= 0 ? row_array_.at(group_id).ctx_[cell_idx] : NULL; @@ -306,7 +306,7 @@ class ObAggregateFunction { const static int64_t CONCAT_STR_BUF_LEN = common::OB_MAX_VARCHAR_LENGTH; const static int64_t STORED_ROW_MAGIC_NUM = 0xaaaabbbbccccdddd; - private: +private: // data members bool has_distinct_; bool has_sort_; diff --git a/src/sql/engine/aggregate/ob_aggregate_processor.h b/src/sql/engine/aggregate/ob_aggregate_processor.h index bad440588..6bcedd304 100644 --- a/src/sql/engine/aggregate/ob_aggregate_processor.h +++ b/src/sql/engine/aggregate/ob_aggregate_processor.h @@ -29,10 +29,10 @@ namespace oceanbase { namespace sql { struct ObAggrInfo { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObAggrInfo() : expr_(NULL), real_aggr_type_(T_INVALID), @@ -122,7 +122,7 @@ inline bool ObAggrInfo::is_number() const typedef common::ObFixedArray DatumFixedArray; class ObAggregateProcessor { - public: +public: // Context structure for one aggregation function of one group, only some functions need this: // with distinct: need this for distinct calculate // group concat: need context to hold the input cells. @@ -139,7 +139,7 @@ class ObAggregateProcessor { // We only implement distinct logic here, no common interface abstracted here, // use the derived class directly. class ExtraResult { - public: + public: // %alloc is used to initialize the structures, can not be used to hold the data explicit ExtraResult(common::ObIAllocator& alloc) : alloc_(alloc), unique_sort_op_(NULL) {} @@ -149,16 +149,16 @@ class ObAggregateProcessor { const uint64_t tenant_id, const ObAggrInfo& aggr_info, ObEvalCtx& eval_ctx, const bool need_rewind); DECLARE_VIRTUAL_TO_STRING; - protected: + protected: common::ObIAllocator& alloc_; - public: + public: // for distinct calculate may be replace by hash based distinct in the future. ObUniqueSortImpl* unique_sort_op_; }; class GroupConcatExtraResult : public ExtraResult { - public: + public: explicit GroupConcatExtraResult(common::ObIAllocator& alloc) : ExtraResult(alloc), row_count_(0), iter_idx_(0), sort_op_(NULL) {} @@ -210,7 +210,7 @@ class ObAggregateProcessor { } DECLARE_VIRTUAL_TO_STRING; - private: + private: int64_t row_count_; int64_t iter_idx_; @@ -221,7 +221,7 @@ class ObAggregateProcessor { }; class AggrCell { - public: + public: AggrCell() : curr_row_results_(), row_count_(0), @@ -319,10 +319,10 @@ class ObAggregateProcessor { ; } - public: + public: ObChunkDatumStore::ShadowStoredRow<> curr_row_results_; - private: + private: // for avg/count int64_t row_count_; @@ -370,7 +370,7 @@ class ObAggregateProcessor { ObChunkDatumStore::StoredRow* groupby_store_row_; }; - public: +public: ObAggregateProcessor(ObEvalCtx& eval_ctx, ObIArray& aggr_infos); ~ObAggregateProcessor() { @@ -428,7 +428,7 @@ class ObAggregateProcessor { int clone_cell(ObDatum& target_cell, const ObDatum& src_cell, const bool is_number = false); static int get_llc_size(); - private: +private: int extend_concat_str_buf(const ObString& pad_str, const int64_t pos, const int64_t group_concat_cur_row_num, int64_t& append_len, bool& buf_is_full); OB_INLINE bool need_extra_info(const ObExprOperatorType expr_type); @@ -483,7 +483,7 @@ class ObAggregateProcessor { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAggregateProcessor); - private: +private: static const int64_t GROUP_ROW_SIZE = sizeof(GroupRow); static const int64_t GROUP_CELL_SIZE = sizeof(AggrCell); // data members @@ -508,7 +508,7 @@ class ObAggregateProcessor { // Used for calc hash for columns class ObGroupRowItem { - public: +public: ObGroupRowItem() : group_id_(0), group_row_ptr_(NULL), groupby_datums_hash_(0), next_(NULL) {} @@ -525,7 +525,7 @@ class ObGroupRowItem { TO_STRING_KV(K_(group_id), KPC_(group_row), K_(groupby_datums_hash), KP_(group_exprs), KP_(next)); - public: +public: int64_t group_id_; union { void* group_row_ptr_; @@ -537,7 +537,7 @@ class ObGroupRowItem { }; class ObGroupRowHashTable : public ObExtendHashTable { - public: +public: ObGroupRowHashTable() : ObExtendHashTable(), eval_ctx_(nullptr), cmp_funcs_(nullptr) {} @@ -545,10 +545,10 @@ class ObGroupRowHashTable : public ObExtendHashTable { int init(ObIAllocator* allocator, lib::ObMemAttr& mem_attr, ObEvalCtx* eval_ctx, const common::ObIArray* cmp_funcs, int64_t initial_size = INITIAL_SIZE); - private: +private: bool compare(const ObGroupRowItem& left, const ObGroupRowItem& right) const; - private: +private: ObEvalCtx* eval_ctx_; const common::ObIArray* cmp_funcs_; }; diff --git a/src/sql/engine/aggregate/ob_distinct.h b/src/sql/engine/aggregate/ob_distinct.h index 3b5b65ab6..b8c8953ec 100644 --- a/src/sql/engine/aggregate/ob_distinct.h +++ b/src/sql/engine/aggregate/ob_distinct.h @@ -24,7 +24,7 @@ typedef common::ObColumnInfo ObDistinctColumn; class ObDistinct : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - public: +public: explicit ObDistinct(common::ObIAllocator& alloc); // ObDistinct(); virtual ~ObDistinct(); @@ -43,10 +43,10 @@ class ObDistinct : public ObSingleChildPhyOperator { return ObPhyOperator::init_array_size<>(distinct_columns_, distinct_count); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistinct); - protected: +protected: virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; // data members common::ObFixedArray distinct_columns_; diff --git a/src/sql/engine/aggregate/ob_distinct_op.h b/src/sql/engine/aggregate/ob_distinct_op.h index 59d9f2b57..b1be45581 100644 --- a/src/sql/engine/aggregate/ob_distinct_op.h +++ b/src/sql/engine/aggregate/ob_distinct_op.h @@ -22,7 +22,7 @@ namespace sql { class ObDistinctSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObDistinctSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); INHERIT_TO_STRING_KV("op_spec", ObOpSpec, K_(distinct_exprs), K_(is_block_mode), K_(cmp_funcs)); diff --git a/src/sql/engine/aggregate/ob_exec_hash_struct.h b/src/sql/engine/aggregate/ob_exec_hash_struct.h index ea1718b8c..c3f5e914d 100644 --- a/src/sql/engine/aggregate/ob_exec_hash_struct.h +++ b/src/sql/engine/aggregate/ob_exec_hash_struct.h @@ -32,7 +32,7 @@ namespace sql { // Auto extended hash table, extend to double buckets size if hash table is quarter filled. template class ObExtendHashTable { - public: +public: const static int64_t INITIAL_SIZE = 128; const static int64_t SIZE_BUCKET_SCALE = 4; ObExtendHashTable() : initial_bucket_num_(0), size_(0), buckets_(NULL), allocator_(NULL) @@ -113,11 +113,11 @@ class ObExtendHashTable { return ret; } - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObExtendHashTable); int extend(); - protected: +protected: lib::ObMemAttr mem_attr_; int64_t initial_bucket_num_; int64_t size_; @@ -269,7 +269,7 @@ int ObExtendHashTable::extend() // Used for calc hash for columns class ObHashCols { - public: +public: ObHashCols() : row_(NULL), stored_row_(NULL), hash_col_idx_(NULL), next_(NULL), hash_val_(0) {} ObHashCols(const common::ObNewRow* row, const common::ObIArray* hash_col_idx) @@ -310,7 +310,7 @@ class ObHashCols { TO_STRING_KV(K_(row), K_(stored_row), K_(hash_col_idx), K_(next), K_(hash_val)); - public: +public: const common::ObNewRow* row_; const common::ObRowStore::StoredRow* stored_row_; const common::ObIArray* hash_col_idx_; @@ -319,14 +319,14 @@ class ObHashCols { }; class ObGbyHashCols : public ObHashCols { - public: +public: using ObHashCols::ObHashCols; ObGbyHashCols*& next() { return *reinterpret_cast(&next_); }; - public: +public: int64_t group_id_ = 0; }; @@ -334,7 +334,7 @@ class ObGbyHashCols : public ObHashCols { // Used for build hash group row. template class ObHashCtx { - public: +public: explicit ObHashCtx() : group_rows_(), started_(false), bkt_created_(false) {} virtual ~ObHashCtx() @@ -350,10 +350,10 @@ class ObHashCtx { return group_rows_.mem_used(); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHashCtx); - protected: +protected: ObExtendHashTable group_rows_; bool started_; bool bkt_created_; @@ -371,7 +371,7 @@ class ObHashCtx { // are the same in one partition. // class ObGbyBloomFilter { - public: +public: explicit ObGbyBloomFilter(const ModulePageAllocator& alloc) : bits_(alloc), cnt_(0), h2_shift_(0) {} @@ -404,7 +404,7 @@ class ObGbyBloomFilter { h2_shift_ = 0; } - private: +private: inline uint64_t h1(const uint64_t hash_val) { return hash_val; @@ -422,7 +422,7 @@ class ObGbyBloomFilter { return v >> h2_shift_; } - public: +public: int set(const uint64_t hash_val) { int ret = common::OB_SUCCESS; @@ -441,7 +441,7 @@ class ObGbyBloomFilter { return bits_.has_member(h1(hash_val) & (cnt_ - 1)) && bits_.has_member(h2(hash_val) & (cnt_ - 1)); } - private: +private: ObSegmentBitSet<> bits_; int64_t cnt_; // power of 2 int64_t h2_shift_; diff --git a/src/sql/engine/aggregate/ob_groupby.h b/src/sql/engine/aggregate/ob_groupby.h index 1ea0f5ee3..e221a4297 100644 --- a/src/sql/engine/aggregate/ob_groupby.h +++ b/src/sql/engine/aggregate/ob_groupby.h @@ -32,14 +32,14 @@ typedef common::ObColumnInfo ObGroupColumn; //}; class ObGroupBy : public ObSingleChildPhyOperator { - public: +public: static const int64_t MIN_BUCKET_COUNT = 100; static const int64_t MAX_BUCKET_COUNT = 100000; static const int64_t LOCAL_COLUMN_COUNT = 16; - protected: +protected: class ObGroupByCtx : public ObPhyOperatorCtx { - public: + public: explicit ObGroupByCtx(ObExecContext& exec_ctx) : ObPhyOperatorCtx(exec_ctx), aggr_func_(), child_column_count_(0) {} virtual ~ObGroupByCtx() @@ -62,13 +62,13 @@ class ObGroupBy : public ObSingleChildPhyOperator { child_column_count_ = child_column_count; } - protected: + protected: ObAggregateFunction aggr_func_; int64_t child_column_count_; }; OB_UNIS_VERSION_V(1); - public: +public: explicit ObGroupBy(common::ObIAllocator& alloc); virtual ~ObGroupBy(); virtual void reset(); @@ -127,7 +127,7 @@ class ObGroupBy : public ObSingleChildPhyOperator { est_group_cnt_ = cnt; } - protected: +protected: int is_same_group(const common::ObRowStore::StoredRow& row1, const common::ObNewRow& row2, bool& result, int64_t& first_diff_pos) const; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const = 0; @@ -155,11 +155,11 @@ class ObGroupBy : public ObSingleChildPhyOperator { */ virtual int inner_create_operator_ctx(ObExecContext& ctx, ObPhyOperatorCtx*& op_ctx) const = 0; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObGroupBy); - protected: +protected: ObAggrExprList aggr_columns_; int64_t mem_size_limit_; // discarded, never assigned int32_t prepare_row_num_; diff --git a/src/sql/engine/aggregate/ob_groupby_op.h b/src/sql/engine/aggregate/ob_groupby_op.h index f54d140c0..a648a4c2f 100644 --- a/src/sql/engine/aggregate/ob_groupby_op.h +++ b/src/sql/engine/aggregate/ob_groupby_op.h @@ -21,28 +21,28 @@ namespace sql { // constant class ObGroupBySpec : public ObOpSpec { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObGroupBySpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), aggr_infos_(alloc) {} DECLARE_VIRTUAL_TO_STRING; // int add_udf_meta(ObAggUDFDatumMeta &meta) { return agg_udf_meta_.push_back(meta); } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObGroupBySpec); - public: +public: AggrInfoFixedArray aggr_infos_; // aggr column + non-aggr column // common::ObSEArray agg_udf_meta_; }; // modifiable class ObGroupByOp : public ObOperator { - public: +public: ObGroupByOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), aggr_processor_(eval_ctx_, (static_cast(const_cast(spec))).aggr_infos_) @@ -59,12 +59,12 @@ class ObGroupByOp : public ObOperator { virtual int inner_close() override; virtual void destroy() override; - private: +private: void reset_default(); // disallow copy DISALLOW_COPY_AND_ASSIGN(ObGroupByOp); - protected: +protected: ObAggregateProcessor aggr_processor_; }; diff --git a/src/sql/engine/aggregate/ob_hash_distinct.h b/src/sql/engine/aggregate/ob_hash_distinct.h index 1086c5637..a950ad1dc 100644 --- a/src/sql/engine/aggregate/ob_hash_distinct.h +++ b/src/sql/engine/aggregate/ob_hash_distinct.h @@ -28,15 +28,15 @@ namespace sql { class ObHashDistinct : public ObDistinct { OB_UNIS_VERSION_V(1); - public: +public: class ObHashDistinctCtx : public ObPhyOperatorCtx { - public: + public: static const int64_t MIN_PART_COUNT = 8; static const int64_t MAX_PART_COUNT = 256; enum HDState { SCAN_CHILD = 1, OUTPUT_HA = 2, PROCESS_IN_MEM = 3, GET_PARTITION = 4, SCAN_PARTITION = 5 }; friend class ObHashDistinct; class PartitionLinkNode : public common::ObDLinkBase { - public: + public: PartitionLinkNode(ObHashDistinctCtx* data, ObHashDistinctCtx* parent) : ObDLinkBase(), data_(data), parent_(parent) {} @@ -150,7 +150,7 @@ class ObHashDistinct : public ObDistinct { int assign_sub_ctx(ObHashDistinctCtx* parent, ObChunkRowStore* parent_row_stores, ObHashDistinctCtx* top_ctx); DISALLOW_COPY_AND_ASSIGN(ObHashDistinctCtx); - private: + private: int64_t mem_limit_; // n_bucket must be pow2, so the last N bits of hash_value can used as bucket_idx directly // N = bucket_bits_ = log2(n_buckets_) @@ -198,7 +198,7 @@ class ObHashDistinct : public ObDistinct { friend class ObHashDistinct; }; - public: +public: static const int64_t MIN_BUCKET_COUNT = 1L << 14; // 16384; static const int64_t MAX_BUCKET_COUNT = 1L << 19; // 524288; static const int64_t HASH_DISTINCT_BUCKET_RATIO = 2; @@ -213,7 +213,7 @@ class ObHashDistinct : public ObDistinct { virtual void reuse(); virtual int rescan(ObExecContext& ctx) const; - private: +private: int estimate_memory_usage( ObHashDistinctCtx* hash_ctx, int64_t memory_limit, int64_t& ha_mem, int64_t& mem_need) const; int get_hash_value(const common::ObNewRow* row, uint64_t& hash_value) const; diff --git a/src/sql/engine/aggregate/ob_hash_distinct_op.h b/src/sql/engine/aggregate/ob_hash_distinct_op.h index 50459b495..f11a6e297 100644 --- a/src/sql/engine/aggregate/ob_hash_distinct_op.h +++ b/src/sql/engine/aggregate/ob_hash_distinct_op.h @@ -25,7 +25,7 @@ namespace sql { class ObHashDistinctSpec : public ObDistinctSpec { OB_UNIS_VERSION_V(1); - public: +public: ObHashDistinctSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ObSortCollations sort_collations_; @@ -33,7 +33,7 @@ class ObHashDistinctSpec : public ObDistinctSpec { }; class ObHashDistinctOp : public ObOperator { - public: +public: ObHashDistinctOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); ~ObHashDistinctOp() {} @@ -44,14 +44,14 @@ class ObHashDistinctOp : public ObOperator { virtual int inner_get_next_row() override; virtual void destroy() override; - private: +private: void reset(); int do_unblock_distinct(); int do_block_distinct(); int init_hash_partition_infras(); int build_distinct_data(bool is_block); - private: +private: typedef int (ObHashDistinctOp::*GetNextRowFunc)(); static const int64_t MIN_BUCKET_COUNT = 1L << 14; // 16384; static const int64_t MAX_BUCKET_COUNT = 1L << 19; // 524288; diff --git a/src/sql/engine/aggregate/ob_hash_groupby.cpp b/src/sql/engine/aggregate/ob_hash_groupby.cpp index c53c0dedd..c44ba6163 100644 --- a/src/sql/engine/aggregate/ob_hash_groupby.cpp +++ b/src/sql/engine/aggregate/ob_hash_groupby.cpp @@ -33,7 +33,7 @@ using namespace common::hash; namespace sql { struct ObGbyPartition : public common::ObDLinkBase { - public: +public: ObGbyPartition(common::ObIAllocator* alloc = nullptr) : row_store_(alloc), level_(0) {} ObChunkRowStore row_store_; @@ -41,7 +41,7 @@ struct ObGbyPartition : public common::ObDLinkBase { }; class ObHashGroupBy::ObHashGroupByCtx : public ObGroupByCtx, public ObHashCtx { - public: +public: explicit ObHashGroupByCtx(ObExecContext& exec_ctx) : ObGroupByCtx(exec_ctx), ObHashCtx(), @@ -138,11 +138,11 @@ class ObHashGroupBy::ObHashGroupByCtx : public ObGroupByCtx, public ObHashCtx { - public: + public: DatumStoreLinkPartition(common::ObIAllocator* alloc = nullptr) : datum_store_(alloc), part_id_(0) {} ObChunkDatumStore datum_store_; int64_t part_id_; }; - public: +public: static const int64_t MIN_PARTITION_CNT = 8; static const int64_t MAX_PARTITION_CNT = 256; @@ -74,7 +74,7 @@ class ObHashGroupByOp : public ObGroupByOp { static constexpr const double EXTRA_MEM_RATIO = 0.25; static const int64_t FIX_SIZE_PER_PART = sizeof(DatumStoreLinkPartition) + ObChunkRowStore::BLOCK_SIZE; - public: +public: ObHashGroupByOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObGroupByOp(exec_ctx, spec, input), curr_group_id_(common::OB_INVALID_INDEX), @@ -170,11 +170,11 @@ class ObHashGroupByOp : public ObGroupByOp { int restore_groupby_datum(); int init_mem_context(void); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObHashGroupByOp); - private: +private: ObGroupRowHashTable local_group_rows_; int64_t curr_group_id_; diff --git a/src/sql/engine/aggregate/ob_merge_distinct.cpp b/src/sql/engine/aggregate/ob_merge_distinct.cpp index 2442e5864..52f3e1644 100644 --- a/src/sql/engine/aggregate/ob_merge_distinct.cpp +++ b/src/sql/engine/aggregate/ob_merge_distinct.cpp @@ -22,7 +22,7 @@ using namespace common; namespace sql { class ObMergeDistinct::ObMergeDistinctCtx : public ObPhyOperatorCtx { - public: +public: explicit ObMergeDistinctCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), got_first_row_(false), @@ -93,10 +93,10 @@ class ObMergeDistinct::ObMergeDistinctCtx : public ObPhyOperatorCtx { ObPhyOperatorCtx::destroy_base(); } - private: +private: static const int64_t OB_ROW_BUF_SIZE = OB_MAX_ROW_LENGTH; - private: +private: bool got_first_row_; ObNewRow last_row_; void* last_row_buf_; diff --git a/src/sql/engine/aggregate/ob_merge_distinct.h b/src/sql/engine/aggregate/ob_merge_distinct.h index cedd9aab8..b414631d3 100644 --- a/src/sql/engine/aggregate/ob_merge_distinct.h +++ b/src/sql/engine/aggregate/ob_merge_distinct.h @@ -23,10 +23,10 @@ namespace sql { class ObMergeDistinct : public ObDistinct { OB_UNIS_VERSION_V(1); - private: +private: class ObMergeDistinctCtx; - public: +public: explicit ObMergeDistinct(common::ObIAllocator& alloc); // ObMergeDistinct(); virtual ~ObMergeDistinct(); @@ -34,7 +34,7 @@ class ObMergeDistinct : public ObDistinct { virtual void reuse(); virtual int rescan(ObExecContext& ctx) const; - private: +private: // member function int compare_equal(const common::ObNewRow& this_row, const common::ObNewRow& last_row, bool& result) const; /** diff --git a/src/sql/engine/aggregate/ob_merge_distinct_op.h b/src/sql/engine/aggregate/ob_merge_distinct_op.h index 3be1e98e0..c9901aa1f 100644 --- a/src/sql/engine/aggregate/ob_merge_distinct_op.h +++ b/src/sql/engine/aggregate/ob_merge_distinct_op.h @@ -23,12 +23,12 @@ namespace sql { class ObMergeDistinctSpec : public ObDistinctSpec { OB_UNIS_VERSION_V(1); - public: +public: ObMergeDistinctSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); }; class ObMergeDistinctOp : public ObOperator { - public: +public: ObMergeDistinctOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; @@ -38,7 +38,7 @@ class ObMergeDistinctOp : public ObOperator { virtual void destroy() override; class Compare { - public: + public: Compare() : eval_ctx_(nullptr), cmp_funcs_(nullptr), ret_code_(common::OB_SUCCESS) {} @@ -49,7 +49,7 @@ class ObMergeDistinctOp : public ObOperator { int ret_code_; }; - private: +private: typedef ObChunkDatumStore::LastStoredRow LastStoreRow; bool first_got_row_; common::ObArenaAllocator alloc_; diff --git a/src/sql/engine/aggregate/ob_merge_groupby.cpp b/src/sql/engine/aggregate/ob_merge_groupby.cpp index 0ee28eee0..c4b78e81c 100644 --- a/src/sql/engine/aggregate/ob_merge_groupby.cpp +++ b/src/sql/engine/aggregate/ob_merge_groupby.cpp @@ -22,7 +22,7 @@ namespace sql { // REGISTER_PHY_OPERATOR(ObMergeGroupBy, PHY_MERGE_GROUP_BY); class ObMergeGroupBy::ObMergeGroupByCtx : public ObGroupByCtx { - public: +public: explicit ObMergeGroupByCtx(ObExecContext& exec_ctx) : ObGroupByCtx(exec_ctx), last_input_row_(NULL), is_end_(false), cur_output_group_id(-1), first_output_group_id(0) {} @@ -31,10 +31,10 @@ class ObMergeGroupBy::ObMergeGroupByCtx : public ObGroupByCtx { ObGroupByCtx::destroy(); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMergeGroupByCtx); - private: +private: const ObNewRow* last_input_row_; bool is_end_; // added to support groupby with rollup diff --git a/src/sql/engine/aggregate/ob_merge_groupby.h b/src/sql/engine/aggregate/ob_merge_groupby.h index 2afd513dd..fe3ad9ec9 100644 --- a/src/sql/engine/aggregate/ob_merge_groupby.h +++ b/src/sql/engine/aggregate/ob_merge_groupby.h @@ -16,15 +16,15 @@ namespace oceanbase { namespace sql { class ObMergeGroupBy : public ObGroupBy { - protected: +protected: class ObMergeGroupByCtx; - public: +public: explicit ObMergeGroupBy(common::ObIAllocator& alloc); virtual ~ObMergeGroupBy(); virtual int rescan(ObExecContext& ctx) const; - private: +private: virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; /** * @brief open operator, not including children operators. diff --git a/src/sql/engine/aggregate/ob_merge_groupby_op.h b/src/sql/engine/aggregate/ob_merge_groupby_op.h index 3211e545d..abe4e5e6a 100644 --- a/src/sql/engine/aggregate/ob_merge_groupby_op.h +++ b/src/sql/engine/aggregate/ob_merge_groupby_op.h @@ -22,7 +22,7 @@ namespace sql { class ObMergeGroupBySpec : public ObGroupBySpec { OB_UNIS_VERSION_V(1); - public: +public: ObMergeGroupBySpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObGroupBySpec(alloc, type), group_exprs_(alloc), @@ -51,11 +51,11 @@ class ObMergeGroupBySpec : public ObGroupBySpec { int add_group_expr(ObExpr* expr); int add_rollup_expr(ObExpr* expr); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObMergeGroupBySpec); - public: +public: ExprFixedArray group_exprs_; // group by column ExprFixedArray rollup_exprs_; // rollup column common::ObFixedArray is_distinct_rollup_expr_; @@ -64,7 +64,7 @@ class ObMergeGroupBySpec : public ObGroupBySpec { // The input data has been sorted according to the groupby column class ObMergeGroupByOp : public ObGroupByOp { - public: +public: ObMergeGroupByOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObGroupByOp(exec_ctx, spec, input), is_end_(false), @@ -87,11 +87,11 @@ class ObMergeGroupByOp : public ObGroupByOp { int rollup_and_calc_results(const int64_t group_id, const ObExpr* diff_expr = NULL); int rewrite_rollup_column(ObExpr*& diff_expr); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObMergeGroupByOp); - private: +private: bool is_end_; // added to support groupby with rollup int64_t cur_output_group_id_; diff --git a/src/sql/engine/aggregate/ob_scalar_aggregate.cpp b/src/sql/engine/aggregate/ob_scalar_aggregate.cpp index 647bfbdb4..9b8c1e856 100644 --- a/src/sql/engine/aggregate/ob_scalar_aggregate.cpp +++ b/src/sql/engine/aggregate/ob_scalar_aggregate.cpp @@ -22,7 +22,7 @@ namespace oceanbase { using namespace common; namespace sql { class ObScalarAggregate::ObScalarAggregateCtx : public ObGroupByCtx { - public: +public: explicit ObScalarAggregateCtx(ObExecContext& exec_ctx) : ObGroupByCtx(exec_ctx), started_(false) {} virtual void destroy() @@ -30,7 +30,7 @@ class ObScalarAggregate::ObScalarAggregateCtx : public ObGroupByCtx { ObGroupByCtx::destroy(); } - private: +private: bool started_; friend class ObScalarAggregate; diff --git a/src/sql/engine/aggregate/ob_scalar_aggregate.h b/src/sql/engine/aggregate/ob_scalar_aggregate.h index 5d32cbfa7..5e77d3f54 100644 --- a/src/sql/engine/aggregate/ob_scalar_aggregate.h +++ b/src/sql/engine/aggregate/ob_scalar_aggregate.h @@ -23,10 +23,10 @@ class ObNewRow; namespace sql { class ObScalarAggregate : public ObGroupBy { - protected: +protected: class ObScalarAggregateCtx; - public: +public: explicit ObScalarAggregate(common::ObIAllocator& alloc); virtual ~ObScalarAggregate(); virtual void reset(); @@ -34,7 +34,7 @@ class ObScalarAggregate : public ObGroupBy { virtual int rescan(ObExecContext& ctx) const; virtual int switch_iterator(ObExecContext& ctx) const override; - protected: +protected: virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; /** * @brief open operator, not including children operators. @@ -64,7 +64,7 @@ class ObScalarAggregate : public ObGroupBy { virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; virtual int add_group_column_idx(int64_t column_idx, common::ObCollationType cs_type); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObScalarAggregate); }; diff --git a/src/sql/engine/aggregate/ob_scalar_aggregate_op.h b/src/sql/engine/aggregate/ob_scalar_aggregate_op.h index 0a1e3e843..9160c84d6 100644 --- a/src/sql/engine/aggregate/ob_scalar_aggregate_op.h +++ b/src/sql/engine/aggregate/ob_scalar_aggregate_op.h @@ -21,17 +21,17 @@ namespace sql { class ObScalarAggregateSpec : public ObGroupBySpec { OB_UNIS_VERSION_V(1); - public: +public: ObScalarAggregateSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObGroupBySpec(alloc, type) {} - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObScalarAggregateSpec); }; class ObScalarAggregateOp : public ObGroupByOp { - public: +public: friend ObAggregateProcessor; ObScalarAggregateOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObGroupByOp(exec_ctx, spec, input), started_(false) @@ -44,11 +44,11 @@ class ObScalarAggregateOp : public ObGroupByOp { virtual int inner_get_next_row() override; virtual void destroy() override; // reset default value of %cur_rownum_ && %rownum_limit_ - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObScalarAggregateOp); - private: +private: bool started_; }; diff --git a/src/sql/engine/basic/ob_chunk_datum_store.h b/src/sql/engine/basic/ob_chunk_datum_store.h index cd140ddd0..e74058df3 100644 --- a/src/sql/engine/basic/ob_chunk_datum_store.h +++ b/src/sql/engine/basic/ob_chunk_datum_store.h @@ -33,7 +33,7 @@ namespace sql { class ObChunkDatumStore { OB_UNIS_VERSION_V(1); - public: +public: static inline int row_copy_size(const common::ObIArray& exprs, ObEvalCtx& ctx, int64_t& size) { int ret = OB_SUCCESS; @@ -119,7 +119,7 @@ class ObChunkDatumStore { */ template class LastStoredRow { - public: + public: LastStoredRow(ObIAllocator& alloc) : store_row_(nullptr), alloc_(alloc), max_size_(0), reuse_(false) {} ~LastStoredRow() @@ -225,7 +225,7 @@ class ObChunkDatumStore { template class ShadowStoredRow { - public: + public: ShadowStoredRow() : alloc_(nullptr), store_row_(nullptr), saved_(false) {} ~ShadowStoredRow() @@ -303,7 +303,7 @@ class ObChunkDatumStore { } TO_STRING_KV(KPC_(store_row)); - private: + private: common::ObIAllocator* alloc_; T* store_row_; bool saved_; @@ -417,7 +417,7 @@ class ObChunkDatumStore { } __attribute__((packed)); struct BlockList { - public: + public: BlockList() : head_(NULL), last_(NULL), size_(0) {} inline int64_t get_size() const @@ -468,7 +468,7 @@ class ObChunkDatumStore { } TO_STRING_KV(K_(size), K_(head), K_(last), K_(*head), K_(last)); - private: + private: Block* head_; Block* last_; int64_t size_; @@ -488,7 +488,7 @@ class ObChunkDatumStore { * |----------------| * */ class BlockBuffer { - public: + public: static const int64_t HEAD_SIZE = sizeof(Block); /* n_rows, check_sum */ BlockBuffer() : data_(NULL), cur_pos_(0), cap_(0) {} @@ -550,7 +550,7 @@ class ObChunkDatumStore { friend ObChunkDatumStore; friend Block; - private: + private: union { char* data_; Block* block; @@ -561,7 +561,7 @@ class ObChunkDatumStore { class ChunkIterator; class RowIterator { - public: + public: friend class ObChunkDatumStore; RowIterator(); virtual ~RowIterator() @@ -595,7 +595,7 @@ class ObChunkDatumStore { TO_STRING_KV(KP_(store), K_(*store), K_(cur_iter_blk), K_(cur_row_in_blk), K_(cur_pos_in_blk), K_(n_blocks), K_(cur_nth_block)); - private: + private: explicit RowIterator(ObChunkDatumStore* row_store); void reset_cursor() { @@ -606,7 +606,7 @@ class ObChunkDatumStore { cur_nth_block_ = 0; } - protected: + protected: ObChunkDatumStore* store_; Block* cur_iter_blk_; int64_t cur_row_in_blk_; // cur nth row in cur block for in-mem debug @@ -616,10 +616,10 @@ class ObChunkDatumStore { }; class ChunkIterator { - public: + public: enum IterEndState { PROCESSING = 0x00, MEM_ITER_END = 0x01, DISK_ITER_END = 0x02 }; - public: + public: friend class ObChunkDatumStore; ChunkIterator(); virtual ~ChunkIterator(); @@ -674,10 +674,10 @@ class ObChunkDatumStore { TO_STRING_KV(KP_(store), KP_(cur_iter_blk), KP_(cur_iter_blk_buf), K_(cur_chunk_n_blocks), K_(cur_iter_pos), K_(file_size), K_(chunk_read_size), KP_(chunk_mem)); - private: + private: void reset_cursor(const int64_t file_size); - protected: + protected: ObChunkDatumStore* store_; Block* cur_iter_blk_; BlockBuffer* cur_iter_blk_buf_; /*for reuse of cur_iter_blk_; @@ -701,7 +701,7 @@ class ObChunkDatumStore { }; class Iterator { - public: + public: friend class ObChunkDatumStore; Iterator() : start_iter_(false) {} @@ -742,16 +742,16 @@ class ObChunkDatumStore { return chunk_it_.get_chunk_read_size(); } - private: + private: explicit Iterator(ObChunkDatumStore* row_store); - protected: + protected: bool start_iter_; ChunkIterator chunk_it_; RowIterator row_it_; }; - public: +public: const static int64_t BLOCK_SIZE = (64L << 10); static const int32_t DATUM_SIZE = sizeof(common::ObDatum); @@ -894,7 +894,7 @@ class ObChunkDatumStore { int update_iterator(Iterator& org_it); int clean_block(Block* clean_block); - private: +private: OB_INLINE int add_row( const common::ObIArray& exprs, ObEvalCtx* ctx, const int64_t row_size, StoredRow** stored_row); static int get_timeout(int64_t& timeout_ms); @@ -944,7 +944,7 @@ class ObChunkDatumStore { callback_->free(size); } - private: +private: bool inited_; uint64_t tenant_id_; const char* label_; diff --git a/src/sql/engine/basic/ob_chunk_row_store.h b/src/sql/engine/basic/ob_chunk_row_store.h index 9acb84b2f..6274d28ab 100644 --- a/src/sql/engine/basic/ob_chunk_row_store.h +++ b/src/sql/engine/basic/ob_chunk_row_store.h @@ -31,7 +31,7 @@ namespace sql { class ObChunkRowStore { OB_UNIS_VERSION_V(1); - public: +public: enum STORE_MODE { /* e.g. [0, 1, 2] with projector (0, 2) */ WITHOUT_PROJECTOR = 0, /* store [0, 2] get [0, 2] */ FULL /* store [0, 1, 2] get [0, 1, 2] with(0, 2) */ @@ -146,7 +146,7 @@ class ObChunkRowStore { } __attribute__((packed)); struct BlockList { - public: + public: BlockList() : head_(NULL), last_(NULL), size_(0) {} inline int64_t get_size() const @@ -197,7 +197,7 @@ class ObChunkRowStore { } TO_STRING_KV(K_(size), K_(head), K_(last), K_(*head), K_(last)); - private: + private: Block* head_; Block* last_; int64_t size_; @@ -217,7 +217,7 @@ class ObChunkRowStore { * |----------------| * */ class BlockBuffer { - public: + public: static const int64_t HEAD_SIZE = sizeof(Block); /* n_rows, check_sum */ BlockBuffer() : data_(NULL), cur_pos_(0), cap_(0) {} @@ -279,7 +279,7 @@ class ObChunkRowStore { friend ObChunkRowStore; friend Block; - private: + private: union { char* data_; Block* block; @@ -290,7 +290,7 @@ class ObChunkRowStore { class ChunkIterator; class RowIterator { - public: + public: friend class ObChunkRowStore; RowIterator(); virtual ~RowIterator() @@ -325,7 +325,7 @@ class ObChunkRowStore { TO_STRING_KV(KP_(store), K_(*store), K_(cur_iter_blk), K_(cur_row_in_blk), K_(cur_pos_in_blk), K_(n_blocks), K_(cur_nth_block)); - private: + private: explicit RowIterator(ObChunkRowStore* row_store); void reset_cursor() { @@ -336,7 +336,7 @@ class ObChunkRowStore { cur_nth_block_ = 0; } - protected: + protected: ObChunkRowStore* store_; Block* cur_iter_blk_; common::ObNewRow row_; @@ -347,10 +347,10 @@ class ObChunkRowStore { }; class ChunkIterator { - public: + public: enum IterEndState { PROCESSING = 0x00, MEM_ITER_END = 0x01, DISK_ITER_END = 0x02 }; - public: + public: friend class ObChunkRowStore; ChunkIterator(); virtual ~ChunkIterator(); @@ -405,10 +405,10 @@ class ObChunkRowStore { TO_STRING_KV(KP_(store), KP_(cur_iter_blk), KP_(cur_iter_blk_buf), K_(cur_chunk_n_blocks), K_(cur_iter_pos), K_(file_size), K_(chunk_read_size), KP_(chunk_mem)); - private: + private: void reset_cursor(const int64_t file_size); - protected: + protected: ObChunkRowStore* store_; Block* cur_iter_blk_; BlockBuffer* cur_iter_blk_buf_; /*for reuse of cur_iter_blk_; @@ -432,7 +432,7 @@ class ObChunkRowStore { } class Iterator : public common::ObOuterRowIterator { - public: + public: friend class ObChunkRowStore; Iterator() : start_iter_(false), convert_row_with_obj_fun_(NULL), convert_row_fun_(NULL) {} @@ -474,14 +474,14 @@ class ObChunkRowStore { return (this->*convert_row_fun_)(row_it_, row, sr); } - private: + private: explicit Iterator(ObChunkRowStore* row_store); CONVERT_FUN(convert_to_row, , common::ObNewRow*&) CONVERT_FUN(convert_to_row, _with_obj, common::ObNewRow&) CONVERT_FUN(convert_to_row_full, , common::ObNewRow*&) CONVERT_FUN(convert_to_row_full, _with_obj, common::ObNewRow&) - protected: + protected: bool start_iter_; ChunkIterator chunk_it_; RowIterator row_it_; @@ -489,7 +489,7 @@ class ObChunkRowStore { int (Iterator::*convert_row_fun_)(RowIterator& it, ObNewRow*& row, const StoredRow* sr); }; - public: +public: const static int64_t BLOCK_SIZE = (64L << 10); //+ BlockBuffer::HEAD_SIZE; explicit ObChunkRowStore(common::ObIAllocator* alloc = NULL); @@ -613,7 +613,7 @@ class ObChunkRowStore { int alloc_dir_id(); TO_STRING_KV(K_(tenant_id), K_(label), K_(ctx_id), K_(mem_limit), K_(row_cnt), K_(file_size)); - private: +private: static int get_timeout(int64_t& timeout_ms); void* alloc_blk_mem(const int64_t size, const bool for_iterator); void free_blk_mem(void* mem, const int64_t size = 0); @@ -663,7 +663,7 @@ class ObChunkRowStore { } } - private: +private: bool inited_; uint64_t tenant_id_; const char* label_; @@ -723,7 +723,7 @@ inline int ObChunkRowStore::BlockBuffer::advance(int64_t size) } class ObChunkStoreUtil { - public: +public: static int alloc_dir_id(int64_t& dir_id); }; diff --git a/src/sql/engine/basic/ob_count.h b/src/sql/engine/basic/ob_count.h index 2fb946bc0..87f14d66f 100644 --- a/src/sql/engine/basic/ob_count.h +++ b/src/sql/engine/basic/ob_count.h @@ -21,11 +21,11 @@ class ObSqlExpression; class ObCount : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - public: +public: class ObCountCtx : ObPhyOperatorCtx { friend class ObCount; - public: + public: explicit ObCountCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), cur_rownum_(1), has_rownum_limit_(false), rownum_limit_value_(-1) {} @@ -34,13 +34,13 @@ class ObCount : public ObSingleChildPhyOperator { ObPhyOperatorCtx::destroy_base(); } - public: + public: int64_t cur_rownum_; bool has_rownum_limit_; int64_t rownum_limit_value_; }; - public: +public: explicit ObCount(common::ObIAllocator& alloc); virtual ~ObCount(); virtual int get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; @@ -54,7 +54,7 @@ class ObCount : public ObSingleChildPhyOperator { int add_anti_monotone_filter_exprs(ObSqlExpression* expr); virtual int switch_iterator(ObExecContext& ctx) const; - private: +private: bool is_valid() const; int get_rownum_limit_value(ObExecContext& ctx, int64_t& rownum_limit_value) const; int get_int_value(ObExecContext& ctx, const ObSqlExpression* in_val, int64_t& out_val) const; @@ -89,7 +89,7 @@ class ObCount : public ObSingleChildPhyOperator { */ virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; - private: +private: ObSqlExpression* rownum_limit_expr_; common::ObDList anti_monotone_filter_exprs_; }; diff --git a/src/sql/engine/basic/ob_count_op.h b/src/sql/engine/basic/ob_count_op.h index c4787da9e..9b166920b 100644 --- a/src/sql/engine/basic/ob_count_op.h +++ b/src/sql/engine/basic/ob_count_op.h @@ -21,7 +21,7 @@ namespace sql { class ObCountSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObCountSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); INHERIT_TO_STRING_KV("op_spec", ObOpSpec, K_(rownum_limit), K_(anti_monotone_filters)); @@ -30,7 +30,7 @@ class ObCountSpec : public ObOpSpec { }; class ObCountOp : public ObOperator { - public: +public: ObCountOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; @@ -52,12 +52,12 @@ class ObCountOp : public ObOperator { return cur_rownum_; } - private: +private: // reset default value of %cur_rownum_ && %rownum_limit_ void reset_default(); int get_rownum_limit(); - private: +private: int64_t cur_rownum_; int64_t rownum_limit_; }; diff --git a/src/sql/engine/basic/ob_expr_values.cpp b/src/sql/engine/basic/ob_expr_values.cpp index 5d61b6bde..84903313d 100644 --- a/src/sql/engine/basic/ob_expr_values.cpp +++ b/src/sql/engine/basic/ob_expr_values.cpp @@ -27,7 +27,7 @@ namespace sql { OB_SERIALIZE_MEMBER(ObExprValuesInput, partition_id_values_); class ObExprValues::ObExprValuesCtx : public ObPhyOperatorCtx { - public: +public: explicit ObExprValuesCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), node_idx_(0), @@ -44,7 +44,7 @@ class ObExprValues::ObExprValuesCtx : public ObPhyOperatorCtx { ObPhyOperatorCtx::destroy_base(); } - private: +private: int64_t node_idx_; ObIterExprCtx iter_expr_ctx_; int64_t value_count_; diff --git a/src/sql/engine/basic/ob_expr_values.h b/src/sql/engine/basic/ob_expr_values.h index 303d7df82..d1f46d5bd 100644 --- a/src/sql/engine/basic/ob_expr_values.h +++ b/src/sql/engine/basic/ob_expr_values.h @@ -22,7 +22,7 @@ class ObIterExprRangeParam; class ObExprValuesInput : public ObIPhyOperatorInput { OB_UNIS_VERSION_V(1); - public: +public: ObExprValuesInput() : partition_id_values_(0) {} virtual ~ObExprValuesInput() @@ -38,14 +38,14 @@ class ObExprValuesInput : public ObIPhyOperatorInput { return PHY_EXPR_VALUES; } - public: +public: int64_t partition_id_values_; }; class ObExprValues : public ObNoChildrenPhyOperator { class ObExprValuesCtx; - public: +public: explicit ObExprValues(common::ObIAllocator& alloc); virtual ~ObExprValues(); @@ -70,10 +70,10 @@ class ObExprValues : public ObNoChildrenPhyOperator { return deserialize_(buf, data_len, pos); } - private: +private: const static int64_t UNIS_VERSION = 1; - private: +private: // function members /** * @brief init operator context, will create a physical operator context (and a current row space) @@ -102,10 +102,10 @@ class ObExprValues : public ObNoChildrenPhyOperator { int calc_next_row(ObExecContext& ctx) const; int calc_next_row_by_range_param(ObExprValuesCtx& value_ctx, const common::ObNewRow*& row) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprValues); - private: +private: // data members common::ObFixedArray values_; common::ObFixedArray range_params_; diff --git a/src/sql/engine/basic/ob_expr_values_op.h b/src/sql/engine/basic/ob_expr_values_op.h index 22e9e5c09..3405eea2c 100644 --- a/src/sql/engine/basic/ob_expr_values_op.h +++ b/src/sql/engine/basic/ob_expr_values_op.h @@ -23,7 +23,7 @@ class ObPhyOpSeriCtx; class ObExprValuesOpInput : public ObOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObExprValuesOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObOpInput(ctx, spec), partition_id_values_(0) {} virtual ~ObExprValuesOpInput() @@ -36,14 +36,14 @@ class ObExprValuesOpInput : public ObOpInput { return common::OB_SUCCESS; } - public: +public: int64_t partition_id_values_; }; class ObExprValuesSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObExprValuesSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), values_(alloc), str_values_array_(alloc) {} @@ -57,16 +57,16 @@ class ObExprValuesSpec : public ObOpSpec { virtual int64_t get_serialize_size(const ObPhyOpSeriCtx& seri_ctx) const override; int64_t get_serialize_size_(const ObPhyOpSeriCtx& seri_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprValuesSpec); - public: +public: common::ObFixedArray values_; common::ObFixedArray str_values_array_; }; class ObExprValuesOp : public ObOperator { - public: +public: ObExprValuesOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; virtual int rescan() override; @@ -82,14 +82,14 @@ class ObExprValuesOp : public ObOperator { ObOperator::destroy(); } - private: +private: int calc_next_row(); int get_value_count(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprValuesOp); - private: +private: int64_t node_idx_; int64_t vector_index_; ObDatumCaster datum_caster_; diff --git a/src/sql/engine/basic/ob_expr_values_with_child.cpp b/src/sql/engine/basic/ob_expr_values_with_child.cpp index 75cb54fa4..732784c7e 100644 --- a/src/sql/engine/basic/ob_expr_values_with_child.cpp +++ b/src/sql/engine/basic/ob_expr_values_with_child.cpp @@ -24,7 +24,7 @@ using namespace common; using namespace share; namespace sql { class ObExprValuesWithChild::ObExprValuesWithChildCtx : public ObPhyOperatorCtx { - public: +public: explicit ObExprValuesWithChildCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), node_idx_(0) {} ~ObExprValuesWithChildCtx() @@ -34,7 +34,7 @@ class ObExprValuesWithChild::ObExprValuesWithChildCtx : public ObPhyOperatorCtx ObPhyOperatorCtx::destroy_base(); } - private: +private: int64_t node_idx_; friend class ObExprValuesWithChild; }; diff --git a/src/sql/engine/basic/ob_expr_values_with_child.h b/src/sql/engine/basic/ob_expr_values_with_child.h index 6bbb4f048..27c04a934 100644 --- a/src/sql/engine/basic/ob_expr_values_with_child.h +++ b/src/sql/engine/basic/ob_expr_values_with_child.h @@ -21,7 +21,7 @@ class ObIterExprRangeParam; class ObExprValuesWithChild : public ObSingleChildPhyOperator { class ObExprValuesWithChildCtx; - public: +public: explicit ObExprValuesWithChild(common::ObIAllocator& alloc); virtual ~ObExprValuesWithChild(); @@ -51,10 +51,10 @@ class ObExprValuesWithChild : public ObSingleChildPhyOperator { return deserialize_(buf, data_len, pos); } - private: +private: const static int64_t UNIS_VERSION = 1; - private: +private: // function members /** * @brief init operator context, will create a physical operator context (and a current row space) @@ -90,10 +90,10 @@ class ObExprValuesWithChild : public ObSingleChildPhyOperator { int calc_next_row(ObExecContext& ctx) const; int64_t get_serialize_size_(const ObPhyOpSeriCtx& seri_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprValuesWithChild); - private: +private: // data members common::ObFixedArray values_; }; diff --git a/src/sql/engine/basic/ob_hash_partitioning_infrastructure.h b/src/sql/engine/basic/ob_hash_partitioning_infrastructure.h index 0c299e4a0..e1148e955 100644 --- a/src/sql/engine/basic/ob_hash_partitioning_infrastructure.h +++ b/src/sql/engine/basic/ob_hash_partitioning_infrastructure.h @@ -105,7 +105,7 @@ struct TempHashPartCols : public HashPartCols { template class ObPartitionExtendHashTable { - public: +public: const static int64_t INITIAL_SIZE = 128; const static int64_t SIZE_BUCKET_PERCENT = 80; const static int64_t MAX_MEM_PERCENT = 40; @@ -203,14 +203,14 @@ class ObPartitionExtendHashTable { sql_mem_processor_ = sql_mem_processor; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionExtendHashTable); using BucketArray = common::ObSegmentArray; int extend(const int64_t new_bucket_num); static int64_t estimate_bucket_num(const int64_t bucket_num, const int64_t max_hash_mem); int create_bucket_array(const int64_t bucket_num, BucketArray*& new_buckets); - private: +private: int64_t size_; int64_t bucket_num_; BucketArray* buckets_; @@ -222,7 +222,7 @@ class ObPartitionExtendHashTable { template class ObBasicHashPartInfrastructure { - public: +public: ObBasicHashPartInfrastructure() : tenant_id_(UINT64_MAX), mem_context_(nullptr), @@ -263,14 +263,14 @@ class ObBasicHashPartInfrastructure { {} ~ObBasicHashPartInfrastructure(); - public: +public: enum InputWays { ONE = 1, TWO = 2 }; enum ProcessMode { Cache = 0, PreProcess = 1, }; - public: +public: struct ObIntraPartKey { ObIntraPartKey() : nth_way_(0), level_(0), nth_part_(0) {} @@ -309,7 +309,7 @@ class ObBasicHashPartInfrastructure { }; }; class ObIntraPartition : public common::ObDLinkBase { - public: + public: ObIntraPartition() : part_key_(), store_() {} ~ObIntraPartition() @@ -317,17 +317,17 @@ class ObBasicHashPartInfrastructure { store_.reset(); } - public: + public: int init(); TO_STRING_KV(K_(part_key)); - public: + public: ObIntraPartKey part_key_; ObChunkRowStore store_; }; - private: +private: bool is_left() const { return InputSide::LEFT == cur_side_; @@ -387,7 +387,7 @@ class ObBasicHashPartInfrastructure { int update_mem_status_periodically(); - public: +public: int init(uint64_t tenant_id, bool enable_sql_dumped, bool unique, bool need_pre_part, int64_t ways, ObSqlMemMgrProcessor* sql_mem_processor); @@ -483,7 +483,7 @@ class ObBasicHashPartInfrastructure { int calc_hash_value(const common::ObNewRow* row, uint64_t& hash_value); - private: +private: static const int64_t BLOCK_SIZE = 64 * 1024; static const int64_t MIN_BUCKET_NUM = 128; static const int64_t MAX_BUCKET_NUM = 131072; // 1M = 131072 * 8 diff --git a/src/sql/engine/basic/ob_hash_partitioning_infrastructure_op.h b/src/sql/engine/basic/ob_hash_partitioning_infrastructure_op.h index 8ccfb7ca3..4c3ec1cf0 100644 --- a/src/sql/engine/basic/ob_hash_partitioning_infrastructure_op.h +++ b/src/sql/engine/basic/ob_hash_partitioning_infrastructure_op.h @@ -70,7 +70,7 @@ struct ObTempHashPartCols : public ObHashPartCols { template class ObHashPartitionExtendHashTable { - public: +public: const static int64_t INITIAL_SIZE = 128; const static int64_t SIZE_BUCKET_PERCENT = 80; const static int64_t MAX_MEM_PERCENT = 40; @@ -176,7 +176,7 @@ class ObHashPartitionExtendHashTable { sql_mem_processor_ = sql_mem_processor; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHashPartitionExtendHashTable); using BucketArray = common::ObSegmentArray; int extend(const int64_t new_bucket_num); @@ -184,7 +184,7 @@ class ObHashPartitionExtendHashTable { const int64_t bucket_num, const int64_t max_hash_mem, const int64_t min_bucket, const int64_t max_bucket); int create_bucket_array(const int64_t bucket_num, BucketArray*& new_buckets); - private: +private: int64_t size_; int64_t bucket_num_; int64_t min_bucket_num_; @@ -200,7 +200,7 @@ class ObHashPartitionExtendHashTable { template class ObHashPartInfrastructure { - public: +public: ObHashPartInfrastructure() : tenant_id_(UINT64_MAX), mem_context_(nullptr), @@ -245,14 +245,14 @@ class ObHashPartInfrastructure { {} ~ObHashPartInfrastructure(); - public: +public: enum InputWays { ONE = 1, TWO = 2 }; enum ProcessMode { Cache = 0, PreProcess = 1, }; - public: +public: struct ObIntraPartKey { ObIntraPartKey() : nth_way_(0), level_(0), nth_part_(0) {} @@ -291,7 +291,7 @@ class ObHashPartInfrastructure { }; }; class ObIntraPartition : public common::ObDLinkBase { - public: + public: ObIntraPartition() : part_key_(), store_() {} ~ObIntraPartition() @@ -299,17 +299,17 @@ class ObHashPartInfrastructure { store_.reset(); } - public: + public: int init(); TO_STRING_KV(K_(part_key)); - public: + public: ObIntraPartKey part_key_; ObChunkDatumStore store_; }; - private: +private: bool is_left() const { return InputSide::LEFT == cur_side_; @@ -368,7 +368,7 @@ class ObHashPartInfrastructure { int update_mem_status_periodically(); - public: +public: int init(uint64_t tenant_id, bool enable_sql_dumped, bool unique, bool need_pre_part, int64_t ways, ObSqlMemMgrProcessor* sql_mem_processor); @@ -486,7 +486,7 @@ class ObHashPartInfrastructure { return ret; } - private: +private: static const int64_t BLOCK_SIZE = 64 * 1024; static const int64_t MIN_BUCKET_NUM = 128; static const int64_t MAX_BUCKET_NUM = 131072; // 1M = 131072 * 8 diff --git a/src/sql/engine/basic/ob_limit.cpp b/src/sql/engine/basic/ob_limit.cpp index 9db6d6ea8..3daa56aee 100644 --- a/src/sql/engine/basic/ob_limit.cpp +++ b/src/sql/engine/basic/ob_limit.cpp @@ -24,7 +24,7 @@ namespace sql { // REGISTER_PHY_OPERATOR(ObLimit, PHY_LIMIT); class ObLimit::ObLimitCtx : public ObPhyOperatorCtx { - public: +public: explicit ObLimitCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), limit_(-1), @@ -40,7 +40,7 @@ class ObLimit::ObLimitCtx : public ObPhyOperatorCtx { ObPhyOperatorCtx::destroy_base(); } - private: +private: int64_t limit_; int64_t offset_; int64_t input_count_; diff --git a/src/sql/engine/basic/ob_limit.h b/src/sql/engine/basic/ob_limit.h index 3672f9858..9e0bcb7af 100644 --- a/src/sql/engine/basic/ob_limit.h +++ b/src/sql/engine/basic/ob_limit.h @@ -23,10 +23,10 @@ class ObSqlExpression; class ObLimit : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - private: +private: class ObLimitCtx; - public: +public: explicit ObLimit(common::ObIAllocator& alloc); virtual ~ObLimit(); @@ -56,7 +56,7 @@ class ObLimit : public ObSingleChildPhyOperator { } int convert_limit_percent(ObExecContext& ctx, ObLimitCtx* limit_ctx) const; - private: +private: bool is_valid() const; int get_int_value(ObExecContext& ctx, const ObSqlExpression* in_val, int64_t& out_val, bool& is_null_value) const; int get_double_value(ObExecContext& ctx, const ObSqlExpression* double_val, double& out_val) const; @@ -96,7 +96,7 @@ class ObLimit : public ObSingleChildPhyOperator { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObLimit); - private: +private: // data members ObSqlExpression* org_limit_; ObSqlExpression* org_offset_; diff --git a/src/sql/engine/basic/ob_limit_op.h b/src/sql/engine/basic/ob_limit_op.h index b9fbb01b3..519e83811 100644 --- a/src/sql/engine/basic/ob_limit_op.h +++ b/src/sql/engine/basic/ob_limit_op.h @@ -22,7 +22,7 @@ namespace sql { class ObLimitSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObLimitSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); INHERIT_TO_STRING_KV("op_spec", ObOpSpec, K_(limit_expr), K_(offset_expr), K_(percent_expr), K_(calc_found_rows), @@ -40,7 +40,7 @@ class ObLimitSpec : public ObOpSpec { }; class ObLimitOp : public ObOperator { - public: +public: ObLimitOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; @@ -56,11 +56,11 @@ class ObLimitOp : public ObOperator { static int get_int_val(ObExpr* expr, ObEvalCtx& eval_ctx, int64_t& val, bool& is_null_value); static int get_double_val(ObExpr* expr, ObEvalCtx& eval_ctx, double& val); - private: +private: int convert_limit_percent(); int is_row_order_by_item_value_equal(bool& is_equal); - private: +private: int64_t limit_; int64_t offset_; int64_t input_cnt_; diff --git a/src/sql/engine/basic/ob_material.h b/src/sql/engine/basic/ob_material.h index f2cff034b..086774049 100644 --- a/src/sql/engine/basic/ob_material.h +++ b/src/sql/engine/basic/ob_material.h @@ -30,7 +30,7 @@ namespace sql { class ObMaterialInput : public ObIPhyOperatorInput { OB_UNIS_VERSION_V(1); - public: +public: ObMaterialInput() : bypass_(false) {} virtual ~ObMaterialInput() = default; @@ -49,7 +49,7 @@ class ObMaterialInput : public ObIPhyOperatorInput { return bypass_; } - protected: +protected: bool bypass_; }; @@ -57,7 +57,7 @@ class ObExecContext; class ObMaterial : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - public: +public: explicit ObMaterial(common::ObIAllocator& alloc) : ObSingleChildPhyOperator(alloc) {} virtual ~ObMaterial() @@ -68,11 +68,11 @@ class ObMaterial : public ObSingleChildPhyOperator { int get_material_row_count(ObExecContext& exec_ctx, int64_t& row_count) const; - private: +private: class ObMaterialCtx : public ObPhyOperatorCtx { friend class ObMaterial; - public: + public: explicit ObMaterialCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), mem_context_(nullptr), @@ -103,7 +103,7 @@ class ObMaterial : public ObSingleChildPhyOperator { return sql_mem_processor_.get_data_size() > sql_mem_processor_.get_mem_bound(); } - private: + private: lib::MemoryContext* mem_context_; ObChunkRowStore row_store_; ObChunkRowStore::Iterator row_store_it_; @@ -114,7 +114,7 @@ class ObMaterial : public ObSingleChildPhyOperator { bool is_first_; }; - private: +private: virtual int inner_get_next_row(ObExecContext& exec_ctx, const common::ObNewRow*& row) const; /** * @brief open operator, not including children operators. @@ -132,9 +132,9 @@ class ObMaterial : public ObSingleChildPhyOperator { int get_all_row_from_child(ObMaterialCtx& mat_ctx, ObSQLSessionInfo& session) const; int process_dump(ObMaterialCtx& mat_ctx) const; - private: +private: // no data member - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMaterial); }; diff --git a/src/sql/engine/basic/ob_material_op.h b/src/sql/engine/basic/ob_material_op.h index ee8636b02..1176e4fa1 100644 --- a/src/sql/engine/basic/ob_material_op.h +++ b/src/sql/engine/basic/ob_material_op.h @@ -23,13 +23,13 @@ namespace sql { class ObMaterialSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObMaterialSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type) {} }; class ObMaterialOp : public ObOperator { - public: +public: ObMaterialOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), mem_context_(nullptr), @@ -52,7 +52,7 @@ class ObMaterialOp : public ObOperator { return common::OB_SUCCESS; } - private: +private: int process_dump(); int get_all_row_from_child(ObSQLSessionInfo& session); @@ -68,7 +68,7 @@ class ObMaterialOp : public ObOperator { } } - private: +private: lib::MemoryContext* mem_context_; ObChunkDatumStore datum_store_; ObChunkDatumStore::Iterator datum_store_it_; diff --git a/src/sql/engine/basic/ob_monitoring_dump.cpp b/src/sql/engine/basic/ob_monitoring_dump.cpp index eabd15fb9..d4b240ae6 100644 --- a/src/sql/engine/basic/ob_monitoring_dump.cpp +++ b/src/sql/engine/basic/ob_monitoring_dump.cpp @@ -22,7 +22,7 @@ namespace sql { OB_SERIALIZE_MEMBER((ObMonitoringDump, ObSingleChildPhyOperator), flags_, dst_op_id_); class ObMonitoringDump::ObMonitoringDumpCtx : public ObPhyOperatorCtx { - public: +public: explicit ObMonitoringDumpCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), op_name_(), @@ -47,7 +47,7 @@ class ObMonitoringDump::ObMonitoringDumpCtx : public ObPhyOperatorCtx { uint64_t last_row_time_; bool first_row_fetched_; - private: +private: friend class ObMonitoringDump; }; diff --git a/src/sql/engine/basic/ob_monitoring_dump.h b/src/sql/engine/basic/ob_monitoring_dump.h index e985e97cd..41d14ba72 100644 --- a/src/sql/engine/basic/ob_monitoring_dump.h +++ b/src/sql/engine/basic/ob_monitoring_dump.h @@ -25,7 +25,7 @@ class ObMonitoringDump : public ObSingleChildPhyOperator { OB_UNIS_VERSION(1); class ObMonitoringDumpCtx; - public: +public: explicit ObMonitoringDump(common::ObIAllocator& alloc) : ObSingleChildPhyOperator(alloc), flags_(0), dst_op_id_(-1) {} virtual ~ObMonitoringDump() = default; @@ -39,7 +39,7 @@ class ObMonitoringDump : public ObSingleChildPhyOperator { dst_op_id_ = dst_op_id; } - private: +private: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -66,7 +66,7 @@ class ObMonitoringDump : public ObSingleChildPhyOperator { virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; - private: +private: uint64_t flags_; uint64_t dst_op_id_; DISALLOW_COPY_AND_ASSIGN(ObMonitoringDump); diff --git a/src/sql/engine/basic/ob_monitoring_dump_op.h b/src/sql/engine/basic/ob_monitoring_dump_op.h index fcd84ae8f..74f59797b 100644 --- a/src/sql/engine/basic/ob_monitoring_dump_op.h +++ b/src/sql/engine/basic/ob_monitoring_dump_op.h @@ -22,7 +22,7 @@ namespace sql { class ObMonitoringDumpSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObMonitoringDumpSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); INHERIT_TO_STRING_KV("op_spec", ObOpSpec, K_(flags), K_(dst_op_id)); @@ -32,7 +32,7 @@ class ObMonitoringDumpSpec : public ObOpSpec { }; class ObMonitoringDumpOp : public ObOperator { - public: +public: ObMonitoringDumpOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; @@ -44,7 +44,7 @@ class ObMonitoringDumpOp : public ObOperator { ObOperator::destroy(); } - private: +private: common::ObDatum op_name_; common::ObDatum tracefile_identifier_; uint64_t open_time_; diff --git a/src/sql/engine/basic/ob_pushdown_filter.h b/src/sql/engine/basic/ob_pushdown_filter.h index 704f2875a..d0d62bda9 100644 --- a/src/sql/engine/basic/ob_pushdown_filter.h +++ b/src/sql/engine/basic/ob_pushdown_filter.h @@ -45,7 +45,7 @@ enum FilterExecutorType { }; class ObPushdownFilterUtils { - public: +public: static bool is_pushdown_storage(int32_t pd_storage_flag) { return pd_storage_flag & 0x01; @@ -59,7 +59,7 @@ class ObPushdownFilterUtils { class ObPushdownFilterNode { OB_UNIS_VERSION_V(1); - public: +public: ObPushdownFilterNode(common::ObIAllocator& alloc) : alloc_(alloc), type_(PushdownFilterType::MAX_FILTER_TYPE), n_child_(0), childs_(nullptr), col_ids_(alloc) {} @@ -88,7 +88,7 @@ class ObPushdownFilterNode { } TO_STRING_KV(K_(type), K_(n_child), K_(col_ids)); - public: +public: common::ObIAllocator& alloc_; PushdownFilterType type_; uint32_t n_child_; @@ -99,7 +99,7 @@ class ObPushdownFilterNode { class ObPushdownAndFilterNode : public ObPushdownFilterNode { OB_UNIS_VERSION_V(1); - public: +public: ObPushdownAndFilterNode(common::ObIAllocator& alloc) : ObPushdownFilterNode(alloc) {} }; @@ -107,7 +107,7 @@ class ObPushdownAndFilterNode : public ObPushdownFilterNode { class ObPushdownOrFilterNode : public ObPushdownFilterNode { OB_UNIS_VERSION_V(1); - public: +public: ObPushdownOrFilterNode(common::ObIAllocator& alloc) : ObPushdownFilterNode(alloc) {} }; @@ -115,7 +115,7 @@ class ObPushdownOrFilterNode : public ObPushdownFilterNode { class ObPushdownBlackFilterNode : public ObPushdownFilterNode { OB_UNIS_VERSION_V(1); - public: +public: ObPushdownBlackFilterNode(common::ObIAllocator& alloc) : ObPushdownFilterNode(alloc), column_exprs_(alloc), filter_exprs_(alloc), tmp_expr_(nullptr) {} @@ -126,7 +126,7 @@ class ObPushdownBlackFilterNode : public ObPushdownFilterNode { virtual int postprocess() override; OB_INLINE void clear_evaluated_datums(); - public: +public: ExprFixedArray column_exprs_; ExprFixedArray filter_exprs_; ObExpr* tmp_expr_; @@ -135,7 +135,7 @@ class ObPushdownBlackFilterNode : public ObPushdownFilterNode { class ObPushdownWhiteFilterNode : public ObPushdownFilterNode { OB_UNIS_VERSION_V(1); - public: +public: ObPushdownWhiteFilterNode(common::ObIAllocator& alloc) : ObPushdownFilterNode(alloc) {} ~ObPushdownWhiteFilterNode() @@ -145,14 +145,14 @@ class ObPushdownWhiteFilterNode : public ObPushdownFilterNode { class ObPushdownFilterExecutor; class ObPushdownFilterNode; class ObPushdownFilterFactory { - public: +public: ObPushdownFilterFactory(common::ObIAllocator* alloc) : alloc_(alloc) {} int alloc(PushdownFilterType type, uint32_t n_child, ObPushdownFilterNode*& pd_filter); int alloc(FilterExecutorType type, uint32_t n_child, ObPushdownFilterNode& filter_node, ObPushdownFilterExecutor*& filter_executor); - private: +private: // pushdown filter typedef int (*PDFilterAllocFunc)(common::ObIAllocator& alloc, uint32_t n_child, ObPushdownFilterNode*& filter_node); template @@ -167,19 +167,19 @@ class ObPushdownFilterFactory { ObPushdownFilterExecutor*& filter_executor); static FilterExecutorAllocFunc FILTER_EXECUTOR_ALLOC[FilterExecutorType::MAX_EXECUTOR_TYPE]; - private: +private: common::ObIAllocator* alloc_; }; class ObPushdownFilterConstructor { - public: +public: ObPushdownFilterConstructor(common::ObIAllocator* alloc, ObStaticEngineCG& static_cg) : alloc_(alloc), factory_(alloc), static_cg_(static_cg) {} int apply(ObRawExpr* raw_expr, ObPushdownFilterNode*& filter_tree); int apply(common::ObIArray& exprs, ObPushdownFilterNode*& filter_tree); - private: +private: int merge_filter_node(ObPushdownFilterNode* dst, ObPushdownFilterNode* other, common::ObIArray& merged_node, bool& merged); int deduplicate_filter_node(common::ObIArray& filter_nodes, uint32_t& n_node); @@ -195,7 +195,7 @@ class ObPushdownFilterConstructor { return false; } - private: +private: common::ObIAllocator* alloc_; ObPushdownFilterFactory factory_; ObStaticEngineCG& static_cg_; @@ -205,7 +205,7 @@ class ObPushdownFilterConstructor { class ObPushdownFilter { OB_UNIS_VERSION_V(1); - public: +public: ObPushdownFilter(common::ObIAllocator& alloc) : alloc_(alloc), filter_tree_(nullptr) {} @@ -227,14 +227,14 @@ class ObPushdownFilter { int64_t& pos, ObPushdownFilterNode*& pd_storage_filter); static int64_t get_serialize_pushdown_filter_size(ObPushdownFilterNode* pd_filter_node); // NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: common::ObIAllocator& alloc_; ObPushdownFilterNode* filter_tree_; }; // executor interface class ObPushdownFilterExecutor { - public: +public: ObPushdownFilterExecutor(common::ObIAllocator& alloc, ObPushdownFilterNode& filter) : type_(FilterExecutorType::MAX_EXECUTOR_TYPE), filter_(filter), @@ -379,13 +379,13 @@ class ObPushdownFilterExecutor { VIRTUAL_TO_STRING_KV(K_(type), K_(n_cols), "col_offsets", common::ObArrayWrap(col_offsets_, n_cols_), K_(n_child), KP_(childs), KP_(filter_bitmap), KP_(col_params)); - protected: +protected: int find_evaluated_datums( ObExpr* expr, const common::ObIArray& calc_exprs, common::ObIArray& eval_exprs); int find_evaluated_datums(common::ObIArray& src_exprs, const common::ObIArray& calc_exprs, common::ObIArray& eval_exprs); - protected: +protected: FilterExecutorType type_; ObPushdownFilterNode& filter_; int64_t n_cols_; @@ -398,7 +398,7 @@ class ObPushdownFilterExecutor { }; class ObBlackFilterExecutor : public ObPushdownFilterExecutor { - public: +public: ObBlackFilterExecutor(common::ObIAllocator& alloc, ObPushdownBlackFilterNode& filter) : ObPushdownFilterExecutor(alloc, filter), n_eval_infos_(0), eval_infos_(nullptr), eval_ctx_(nullptr) {} @@ -413,7 +413,7 @@ class ObBlackFilterExecutor : public ObPushdownFilterExecutor { INHERIT_TO_STRING_KV("ObPushdownBlackFilterExecutor", ObPushdownFilterExecutor, K_(filter), K_(n_eval_infos), K_(n_cols), "col_offsets", common::ObArrayWrap(col_offsets_, n_cols_), KP_(eval_infos), KP_(eval_ctx)); - private: +private: int32_t n_eval_infos_; ObEvalInfo** eval_infos_; ObEvalCtx* eval_ctx_; @@ -427,7 +427,7 @@ OB_INLINE void ObBlackFilterExecutor::clear_evaluated_datums() } class ObWhiteFilterExecutor : public ObPushdownFilterExecutor { - public: +public: ObWhiteFilterExecutor(common::ObIAllocator& alloc, ObPushdownWhiteFilterNode& filter) : ObPushdownFilterExecutor(alloc, filter) {} @@ -439,11 +439,11 @@ class ObWhiteFilterExecutor : public ObPushdownFilterExecutor { common::ObIAllocator& alloc, const common::ObIArray& calc_exprs, ObEvalCtx* eval_ctx) override; INHERIT_TO_STRING_KV("ObPushdownFilterExecutor", ObPushdownFilterExecutor, K_(filter)); - private: +private: }; class ObAndFilterExecutor : public ObPushdownFilterExecutor { - public: +public: ObAndFilterExecutor(common::ObIAllocator& alloc, ObPushdownAndFilterNode& filter) : ObPushdownFilterExecutor(alloc, filter) {} @@ -452,11 +452,11 @@ class ObAndFilterExecutor : public ObPushdownFilterExecutor { common::ObIAllocator& alloc, const common::ObIArray& calc_exprs, ObEvalCtx* eval_ctx) override; INHERIT_TO_STRING_KV("ObPushdownFilterExecutor", ObPushdownFilterExecutor, K_(filter)); - private: +private: }; class ObOrFilterExecutor : public ObPushdownFilterExecutor { - public: +public: ObOrFilterExecutor(common::ObIAllocator& alloc, ObPushdownOrFilterNode& filter) : ObPushdownFilterExecutor(alloc, filter) {} @@ -466,20 +466,20 @@ class ObOrFilterExecutor : public ObPushdownFilterExecutor { common::ObIAllocator& alloc, const common::ObIArray& calc_exprs, ObEvalCtx* eval_ctx) override; INHERIT_TO_STRING_KV("ObPushdownFilterExecutor", ObPushdownFilterExecutor, K_(filter)); - private: +private: }; class ObFilterExecutorConstructor { - public: +public: ObFilterExecutorConstructor(common::ObIAllocator* alloc) : alloc_(alloc), factory_(alloc) {} int apply(ObPushdownFilterNode* filter_tree, ObPushdownFilterExecutor*& filter_executor); - private: +private: template int create_filter_executor(ObPushdownFilterNode* filter_tree, ObPushdownFilterExecutor*& filter_executor); - private: +private: common::ObIAllocator* alloc_; ObPushdownFilterFactory factory_; }; diff --git a/src/sql/engine/basic/ob_ra_datum_store.h b/src/sql/engine/basic/ob_ra_datum_store.h index f8d0db15f..b3915c4bb 100644 --- a/src/sql/engine/basic/ob_ra_datum_store.h +++ b/src/sql/engine/basic/ob_ra_datum_store.h @@ -28,9 +28,9 @@ namespace sql { // Random access row store, support disk store. // All row must have same cell count and projector. class ObRADatumStore { - public: +public: class ShrinkBuffer { - public: + public: ShrinkBuffer() : data_(NULL), head_(0), tail_(0), cap_(0) {} @@ -83,7 +83,7 @@ class ObRADatumStore { TO_STRING_KV(KP_(data), K_(head), K_(tail), K_(cap)); - private: + private: char* data_; int64_t head_; int64_t tail_; @@ -285,7 +285,7 @@ class ObRADatumStore { class Reader { friend class ObRADatumStore; - public: + public: explicit Reader(ObRADatumStore& store) : store_(store), file_size_(0), idx_blk_(NULL), ib_pos_(0), blk_(NULL) {} virtual ~Reader() @@ -303,10 +303,10 @@ class ObRADatumStore { void reset(); void reuse(); - private: + private: void reset_cursor(const int64_t file_size); - private: + private: ObRADatumStore& store_; // idx_blk_, blk_ may point to the writing block, // we need to invalid the pointers if file_size_ change. @@ -321,7 +321,7 @@ class ObRADatumStore { DISALLOW_COPY_AND_ASSIGN(Reader); }; - public: +public: const static int64_t BLOCK_SIZE = (64L << 10) - sizeof(LinkNode); const static int64_t BIG_BLOCK_SIZE = (256L << 10) - sizeof(LinkNode); // alloc first index block after store 1MB data. @@ -389,7 +389,7 @@ class ObRADatumStore { TO_STRING_KV( K_(tenant_id), K_(label), K_(ctx_id), K_(mem_limit), K_(save_row_cnt), K_(row_cnt), K_(fd), K_(file_size)); - private: +private: static int get_timeout(int64_t& timeout_ms); void* alloc_blk_mem(const int64_t size); void free_blk_mem(void* mem, const int64_t size = 0); @@ -415,7 +415,7 @@ class ObRADatumStore { bool need_dump(); - private: +private: bool inited_; uint64_t tenant_id_; const char* label_; diff --git a/src/sql/engine/basic/ob_ra_row_store.h b/src/sql/engine/basic/ob_ra_row_store.h index 7d957b8ce..4fe08ebd7 100644 --- a/src/sql/engine/basic/ob_ra_row_store.h +++ b/src/sql/engine/basic/ob_ra_row_store.h @@ -26,9 +26,9 @@ namespace sql { // Random access row store, support disk store. // All row must have same cell count and projector. class ObRARowStore { - public: +public: class ShrinkBuffer { - public: + public: ShrinkBuffer() : data_(NULL), head_(0), tail_(0), cap_(0) {} @@ -81,7 +81,7 @@ class ObRARowStore { TO_STRING_KV(KP_(data), K_(head), K_(tail), K_(cap)); - private: + private: char* data_; int64_t head_; int64_t tail_; @@ -224,7 +224,7 @@ class ObRARowStore { class Reader { friend class ObRARowStore; - public: + public: explicit Reader(ObRARowStore& store) : store_(store), file_size_(0), idx_blk_(NULL), ib_pos_(0), blk_(NULL) {} virtual ~Reader() @@ -244,10 +244,10 @@ class ObRARowStore { void reset(); void reuse(); - private: + private: void reset_cursor(const int64_t file_size); - private: + private: ObRARowStore& store_; // idx_blk_, blk_ may point to the writing block, // we need to invalid the pointers if file_size_ change. @@ -263,7 +263,7 @@ class ObRARowStore { DISALLOW_COPY_AND_ASSIGN(Reader); }; - public: +public: const static int64_t BLOCK_SIZE = (64L << 10) - sizeof(LinkNode); const static int64_t BIG_BLOCK_SIZE = (256L << 10) - sizeof(LinkNode); // alloc first index block after store 1MB data. @@ -333,7 +333,7 @@ class ObRARowStore { TO_STRING_KV( K_(tenant_id), K_(label), K_(ctx_id), K_(mem_limit), K_(save_row_cnt), K_(row_cnt), K_(fd), K_(file_size)); - private: +private: static int get_timeout(int64_t& timeout_ms); void* alloc_blk_mem(const int64_t size); void free_blk_mem(void* mem, const int64_t size = 0); @@ -359,7 +359,7 @@ class ObRARowStore { bool need_dump(); - private: +private: bool inited_; uint64_t tenant_id_; const char* label_; diff --git a/src/sql/engine/basic/ob_select_into.cpp b/src/sql/engine/basic/ob_select_into.cpp index ddf9a6410..3392c815b 100644 --- a/src/sql/engine/basic/ob_select_into.cpp +++ b/src/sql/engine/basic/ob_select_into.cpp @@ -26,7 +26,7 @@ namespace sql { class ObSelectInto::ObSelectIntoCtx : public ObPhyOperatorCtx { friend class ObSelectInto; - public: +public: explicit ObSelectIntoCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), top_limit_cnt_(INT64_MAX), file_appender_(), is_first_(true) {} @@ -45,7 +45,7 @@ class ObSelectInto::ObSelectIntoCtx : public ObPhyOperatorCtx { file_appender_.close(); } - private: +private: int64_t top_limit_cnt_; ObFileAppender file_appender_; bool is_first_; diff --git a/src/sql/engine/basic/ob_select_into.h b/src/sql/engine/basic/ob_select_into.h index 69ad1d0ae..c1873ddac 100644 --- a/src/sql/engine/basic/ob_select_into.h +++ b/src/sql/engine/basic/ob_select_into.h @@ -24,10 +24,10 @@ namespace sql { class ObSelectInto : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - private: +private: class ObSelectIntoCtx; - public: +public: explicit ObSelectInto(common::ObIAllocator& alloc); virtual ~ObSelectInto(); virtual void reset(); @@ -56,7 +56,7 @@ class ObSelectInto : public ObSingleChildPhyOperator { closed_cht_ = closed_cht; } - private: +private: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -91,7 +91,7 @@ class ObSelectInto : public ObSingleChildPhyOperator { ObSelectIntoCtx& into_ctx) const; DISALLOW_COPY_AND_ASSIGN(ObSelectInto); - private: +private: ObItemType into_type_; common::ObSEArray user_vars_; common::ObObj outfile_name_; diff --git a/src/sql/engine/basic/ob_sql_mem_callback.h b/src/sql/engine/basic/ob_sql_mem_callback.h index d22b6e357..5c3b0f9ef 100644 --- a/src/sql/engine/basic/ob_sql_mem_callback.h +++ b/src/sql/engine/basic/ob_sql_mem_callback.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObSqlMemoryCallback { - public: +public: virtual void alloc(int64_t size) = 0; virtual void free(int64_t size) = 0; virtual void dumped(int64_t size) = 0; diff --git a/src/sql/engine/basic/ob_temp_table_access.h b/src/sql/engine/basic/ob_temp_table_access.h index dca28bef9..6f09628ef 100644 --- a/src/sql/engine/basic/ob_temp_table_access.h +++ b/src/sql/engine/basic/ob_temp_table_access.h @@ -32,7 +32,7 @@ class ObTempTableAccessInput : public ObIPhyOperatorInput { friend class ObTempTableAccess; OB_UNIS_VERSION_V(1); - public: +public: ObTempTableAccessInput(); virtual ~ObTempTableAccessInput(); virtual void reset() override; @@ -43,11 +43,11 @@ class ObTempTableAccessInput : public ObIPhyOperatorInput { int check_closed_finish(bool& is_end); int assign_ids(common::ObIArray& interm_res_ids); - protected: +protected: common::ObIAllocator* deserialize_allocator_; DISALLOW_COPY_AND_ASSIGN(ObTempTableAccessInput); - public: +public: uint64_t closed_count_; uint64_t unfinished_count_ptr_; common::ObSEArray interm_result_ids_; @@ -56,11 +56,11 @@ class ObTempTableAccessInput : public ObIPhyOperatorInput { class ObTempTableAccess : public ObNoChildrenPhyOperator { OB_UNIS_VERSION_V(1); - protected: +protected: class ObTempTableAccessCtx : public ObPhyOperatorCtx { friend class ObTempTableAccess; - public: + public: explicit ObTempTableAccessCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), row_store_(NULL), tta_input_(NULL), is_started_(false) {} @@ -72,14 +72,14 @@ class ObTempTableAccess : public ObNoChildrenPhyOperator { } int locate_interm_result(dtl::ObDTLIntermResultKey& dtl_int_key); - private: + private: ObChunkRowStore* row_store_; ObChunkRowStore::Iterator row_store_it_; ObTempTableAccessInput* tta_input_; bool is_started_; }; - public: +public: ObTempTableAccess(common::ObIAllocator& alloc) : ObNoChildrenPhyOperator(alloc), output_indexs_(alloc), @@ -138,7 +138,7 @@ class ObTempTableAccess : public ObNoChildrenPhyOperator { DISALLOW_COPY_AND_ASSIGN(ObTempTableAccess); - private: +private: common::ObFixedArray output_indexs_; uint64_t temp_table_id_; bool is_distributed_; diff --git a/src/sql/engine/basic/ob_temp_table_access_op.h b/src/sql/engine/basic/ob_temp_table_access_op.h index fb487195a..a9bdf52f5 100644 --- a/src/sql/engine/basic/ob_temp_table_access_op.h +++ b/src/sql/engine/basic/ob_temp_table_access_op.h @@ -33,7 +33,7 @@ class ObTempTableAccessOpInput : public ObOpInput { OB_UNIS_VERSION_V(1); friend class ObTempTableAccessOp; - public: +public: ObTempTableAccessOpInput(ObExecContext& ctx, const ObOpSpec& spec); virtual ~ObTempTableAccessOpInput(); virtual void reset() override; @@ -44,21 +44,21 @@ class ObTempTableAccessOpInput : public ObOpInput { int check_finish(bool& is_end, int64_t& interm_res_ids); int check_closed_finish(bool& is_end); - protected: +protected: common::ObIAllocator* deserialize_allocator_; DISALLOW_COPY_AND_ASSIGN(ObTempTableAccessOpInput); - public: +public: uint64_t closed_count_; uint64_t unfinished_count_ptr_; common::ObSEArray interm_result_ids_; }; class ObTempTableAccessOpSpec : public ObOpSpec { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObTempTableAccessOpSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), output_indexs_(alloc), @@ -112,7 +112,7 @@ class ObTempTableAccessOpSpec : public ObOpSpec { DECLARE_VIRTUAL_TO_STRING; - public: +public: common::ObFixedArray output_indexs_; uint64_t temp_table_id_; bool is_distributed_; @@ -122,7 +122,7 @@ class ObTempTableAccessOpSpec : public ObOpSpec { }; class ObTempTableAccessOp : public ObOperator { - public: +public: ObTempTableAccessOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), datum_store_(NULL), datum_store_it_(), is_started_(false) {} @@ -139,7 +139,7 @@ class ObTempTableAccessOp : public ObOperator { int locate_interm_result(dtl::ObDTLIntermResultKey& dtl_int_key); int destory_interm_results(); - private: +private: ObChunkDatumStore* datum_store_; ObChunkDatumStore::Iterator datum_store_it_; bool is_started_; diff --git a/src/sql/engine/basic/ob_temp_table_insert.h b/src/sql/engine/basic/ob_temp_table_insert.h index 6fd3179e5..9429abc8f 100644 --- a/src/sql/engine/basic/ob_temp_table_insert.h +++ b/src/sql/engine/basic/ob_temp_table_insert.h @@ -30,7 +30,7 @@ class ObTempTableInsertInput : public ObIPhyOperatorInput { friend class ObTempTableInsert; OB_UNIS_VERSION_V(1); - public: +public: ObTempTableInsertInput(); virtual ~ObTempTableInsertInput(); virtual void reset() override; @@ -39,11 +39,11 @@ class ObTempTableInsertInput : public ObIPhyOperatorInput { virtual int init(ObExecContext& ctx, ObTaskInfo& task_info, const ObPhyOperator& op); int assign_ids(common::ObIArray& interm_res_ids); - protected: +protected: common::ObIAllocator* deserialize_allocator_; DISALLOW_COPY_AND_ASSIGN(ObTempTableInsertInput); - public: +public: uint64_t unfinished_count_ptr_; common::ObSEArray interm_result_ids_; }; @@ -51,11 +51,11 @@ class ObTempTableInsertInput : public ObIPhyOperatorInput { class ObTempTableInsert : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - protected: +protected: class ObTempTableInsertCtx : public ObPhyOperatorCtx { friend class ObTempTableInsert; - public: + public: explicit ObTempTableInsertCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), interm_result_id_(0) {} virtual ~ObTempTableInsertCtx() @@ -69,11 +69,11 @@ class ObTempTableInsert : public ObSingleChildPhyOperator { interm_result_id_ = id; } - public: + public: uint64_t interm_result_id_; }; - public: +public: ObTempTableInsert(common::ObIAllocator& alloc) : ObSingleChildPhyOperator(alloc), temp_table_id_(0), is_distributed_(false) {} @@ -110,7 +110,7 @@ class ObTempTableInsert : public ObSingleChildPhyOperator { DISALLOW_COPY_AND_ASSIGN(ObTempTableInsert); - private: +private: uint64_t temp_table_id_; bool is_distributed_; }; diff --git a/src/sql/engine/basic/ob_temp_table_insert_op.h b/src/sql/engine/basic/ob_temp_table_insert_op.h index ad27aba27..358bf0311 100644 --- a/src/sql/engine/basic/ob_temp_table_insert_op.h +++ b/src/sql/engine/basic/ob_temp_table_insert_op.h @@ -33,7 +33,7 @@ class ObTempTableInsertOpInput : public ObOpInput { OB_UNIS_VERSION_V(1); friend class ObTempTableInsertOp; - public: +public: ObTempTableInsertOpInput(ObExecContext& ctx, const ObOpSpec& spec); virtual ~ObTempTableInsertOpInput(); virtual void reset() override; @@ -42,20 +42,20 @@ class ObTempTableInsertOpInput : public ObOpInput { virtual int init(ObTaskInfo& task_info); virtual int init(ObExecContext& ctx, ObTaskInfo& task_info, const ObPhyOperator& op); - protected: +protected: common::ObIAllocator* deserialize_allocator_; DISALLOW_COPY_AND_ASSIGN(ObTempTableInsertOpInput); - public: +public: uint64_t unfinished_count_ptr_; common::ObSEArray interm_result_ids_; }; class ObTempTableInsertOpSpec : public ObOpSpec { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObTempTableInsertOpSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), temp_table_id_(0), is_distributed_(false) {} @@ -80,13 +80,13 @@ class ObTempTableInsertOpSpec : public ObOpSpec { DECLARE_VIRTUAL_TO_STRING; - public: +public: uint64_t temp_table_id_; bool is_distributed_; }; class ObTempTableInsertOp : public ObOperator { - public: +public: ObTempTableInsertOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), interm_result_id_(0) {} @@ -100,7 +100,7 @@ class ObTempTableInsertOp : public ObOperator { virtual void destroy() override; int prepare_scan_param(); - private: +private: uint64_t interm_result_id_; }; diff --git a/src/sql/engine/basic/ob_temp_table_transformation.h b/src/sql/engine/basic/ob_temp_table_transformation.h index b8dcf6881..6da6e8b1b 100644 --- a/src/sql/engine/basic/ob_temp_table_transformation.h +++ b/src/sql/engine/basic/ob_temp_table_transformation.h @@ -24,11 +24,11 @@ namespace sql { class ObTempTableTransformation : public ObMultiChildrenPhyOperator { OB_UNIS_VERSION_V(1); - protected: +protected: class ObTempTableTransformationCtx : public ObPhyOperatorCtx { friend class ObTempTableTransformation; - public: + public: explicit ObTempTableTransformationCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual ~ObTempTableTransformationCtx() @@ -39,7 +39,7 @@ class ObTempTableTransformation : public ObMultiChildrenPhyOperator { } }; - public: +public: explicit ObTempTableTransformation(common::ObIAllocator& alloc) : ObMultiChildrenPhyOperator(alloc) {} ~ObTempTableTransformation() diff --git a/src/sql/engine/basic/ob_temp_table_transformation_op.h b/src/sql/engine/basic/ob_temp_table_transformation_op.h index ddcd2ee5d..605bc9a96 100644 --- a/src/sql/engine/basic/ob_temp_table_transformation_op.h +++ b/src/sql/engine/basic/ob_temp_table_transformation_op.h @@ -29,10 +29,10 @@ namespace oceanbase { namespace sql { class ObExecContext; class ObTempTableTransformationOpSpec : public ObOpSpec { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObTempTableTransformationOpSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type) {} virtual ~ObTempTableTransformationOpSpec() @@ -41,7 +41,7 @@ class ObTempTableTransformationOpSpec : public ObOpSpec { }; class ObTempTableTransformationOp : public ObOperator { - public: +public: ObTempTableTransformationOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input) {} diff --git a/src/sql/engine/basic/ob_topk.cpp b/src/sql/engine/basic/ob_topk.cpp index a90a8ecbe..43e22df4c 100644 --- a/src/sql/engine/basic/ob_topk.cpp +++ b/src/sql/engine/basic/ob_topk.cpp @@ -26,7 +26,7 @@ using namespace common; namespace sql { class ObTopK::ObTopKCtx : public ObPhyOperatorCtx { - public: +public: explicit ObTopKCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), topk_final_count_(-1), output_count_(0) {} virtual void destroy() @@ -34,7 +34,7 @@ class ObTopK::ObTopKCtx : public ObPhyOperatorCtx { ObPhyOperatorCtx::destroy_base(); } - private: +private: int64_t topk_final_count_; // count of rows that need to be output upforward int64_t output_count_; friend class ObTopK; diff --git a/src/sql/engine/basic/ob_topk.h b/src/sql/engine/basic/ob_topk.h index 0957e0000..73bb178ab 100644 --- a/src/sql/engine/basic/ob_topk.h +++ b/src/sql/engine/basic/ob_topk.h @@ -21,10 +21,10 @@ class ObSqlExpression; class ObTopK : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - private: +private: class ObTopKCtx; - public: +public: explicit ObTopK(common::ObIAllocator& alloc); virtual ~ObTopK(); @@ -34,7 +34,7 @@ class ObTopK : public ObSingleChildPhyOperator { ObSqlExpression* limit, ObSqlExpression* offset, int64_t minimum_row_count, int64_t topk_precision); virtual int rescan(ObExecContext& ctx) const; - private: +private: bool is_valid() const; int get_int_value(ObExecContext& ctx, const ObSqlExpression* in_val, int64_t& out_val, bool& is_null_value) const; /** @@ -72,7 +72,7 @@ class ObTopK : public ObSingleChildPhyOperator { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObTopK); - private: +private: // data members int64_t minimum_row_count_; int64_t topk_precision_; diff --git a/src/sql/engine/basic/ob_topk_op.h b/src/sql/engine/basic/ob_topk_op.h index 559cf8bf4..8dfe0c826 100644 --- a/src/sql/engine/basic/ob_topk_op.h +++ b/src/sql/engine/basic/ob_topk_op.h @@ -21,7 +21,7 @@ namespace sql { class ObTopKSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObTopKSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); bool is_valid() const; @@ -34,12 +34,12 @@ class ObTopKSpec : public ObOpSpec { ObExpr* org_limit_; ObExpr* org_offset_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTopKSpec); }; class ObTopKOp : public ObOperator { - public: +public: ObTopKOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; @@ -52,7 +52,7 @@ class ObTopKOp : public ObOperator { ObOperator::destroy(); } - private: +private: int get_topk_final_count(); DISALLOW_COPY_AND_ASSIGN(ObTopKOp); diff --git a/src/sql/engine/basic/ob_values.cpp b/src/sql/engine/basic/ob_values.cpp index 6f9fb8af4..ab3dfb4d2 100644 --- a/src/sql/engine/basic/ob_values.cpp +++ b/src/sql/engine/basic/ob_values.cpp @@ -19,7 +19,7 @@ namespace sql { OB_SERIALIZE_MEMBER((ObValues, ObNoChildrenPhyOperator), row_store_); class ObValues::ObValuesCtx : public ObPhyOperatorCtx { - public: +public: explicit ObValuesCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), row_store_it_() {} virtual void destroy() @@ -27,7 +27,7 @@ class ObValues::ObValuesCtx : public ObPhyOperatorCtx { ObPhyOperatorCtx::destroy_base(); } - private: +private: ObRowStore::Iterator row_store_it_; friend class ObValues; }; diff --git a/src/sql/engine/basic/ob_values.h b/src/sql/engine/basic/ob_values.h index aa8b9959e..564a8193b 100644 --- a/src/sql/engine/basic/ob_values.h +++ b/src/sql/engine/basic/ob_values.h @@ -22,7 +22,7 @@ class ObValues : public ObNoChildrenPhyOperator { OB_UNIS_VERSION(1); class ObValuesCtx; - public: +public: explicit ObValues(common::ObIAllocator& alloc) : ObNoChildrenPhyOperator(alloc), row_store_(alloc) {} ~ObValues() @@ -35,7 +35,7 @@ class ObValues : public ObNoChildrenPhyOperator { int rescan(ObExecContext& ctx) const; int set_row_store(const common::ObRowStore& row_store); - private: +private: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -62,7 +62,7 @@ class ObValues : public ObNoChildrenPhyOperator { virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; DISALLOW_COPY_AND_ASSIGN(ObValues); - private: +private: common::ObRowStore row_store_; }; } // namespace sql diff --git a/src/sql/engine/basic/ob_values_op.h b/src/sql/engine/basic/ob_values_op.h index f1bb49c29..e517987a5 100644 --- a/src/sql/engine/basic/ob_values_op.h +++ b/src/sql/engine/basic/ob_values_op.h @@ -25,14 +25,14 @@ namespace sql { class ObValuesSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObValuesSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); common::ObRowStore row_store_; }; class ObValuesOp : public ObOperator { - public: +public: ObValuesOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; @@ -45,7 +45,7 @@ class ObValuesOp : public ObOperator { ObOperator::destroy(); } - private: +private: common::ObNewRow cur_row_; common::ObRowStore::Iterator row_store_it_; }; diff --git a/src/sql/engine/cmd/ob_alter_system_executor.h b/src/sql/engine/cmd/ob_alter_system_executor.h index db5afc09a..411846789 100644 --- a/src/sql/engine/cmd/ob_alter_system_executor.h +++ b/src/sql/engine/cmd/ob_alter_system_executor.h @@ -26,14 +26,14 @@ class ObBootstrapStmt; #define DEF_SIMPLE_EXECUTOR(name) \ class name##Executor { \ - public: \ + public: \ name##Executor() \ {} \ virtual ~name##Executor() \ {} \ int execute(ObExecContext& ctx, name##Stmt& stmt); \ \ - private: \ + private: \ DISALLOW_COPY_AND_ASSIGN(name##Executor); \ } @@ -123,31 +123,31 @@ DEF_SIMPLE_EXECUTOR(ObBackupSetEncryption); DEF_SIMPLE_EXECUTOR(ObBackupSetDecryption); class ObCancelTaskExecutor { - public: +public: ObCancelTaskExecutor() {} virtual ~ObCancelTaskExecutor() {} int execute(ObExecContext& ctx, ObCancelTaskStmt& stmt); - private: +private: int parse_task_id(const common::ObString& task_id_str, share::ObTaskId& task_id); int fetch_sys_task_info(ObExecContext& ctx, const common::ObString& task_id, common::ObAddr& task_server); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCancelTaskExecutor); }; class ObChangeTenantExecutor { - public: +public: ObChangeTenantExecutor() {} virtual ~ObChangeTenantExecutor() {} int execute(ObExecContext& ctx, ObChangeTenantStmt& stmt); - private: - private: +private: +private: DISALLOW_COPY_AND_ASSIGN(ObChangeTenantExecutor); }; diff --git a/src/sql/engine/cmd/ob_baseline_executor.h b/src/sql/engine/cmd/ob_baseline_executor.h index b5d69edf2..cb8ae2281 100644 --- a/src/sql/engine/cmd/ob_baseline_executor.h +++ b/src/sql/engine/cmd/ob_baseline_executor.h @@ -31,14 +31,14 @@ class ObDMLStmt; class ObOptimizerContext; class ObAlterBaselineExecutor { - public: +public: ObAlterBaselineExecutor() {} virtual ~ObAlterBaselineExecutor() {} int execute(ObExecContext& ctx, ObAlterBaselineStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterBaselineExecutor); }; diff --git a/src/sql/engine/cmd/ob_database_executor.h b/src/sql/engine/cmd/ob_database_executor.h index 606f9a7e8..a1ebdb286 100644 --- a/src/sql/engine/cmd/ob_database_executor.h +++ b/src/sql/engine/cmd/ob_database_executor.h @@ -25,45 +25,45 @@ class ObAlterDatabaseStmt; class ObFlashBackDatabaseStmt; class ObPurgeDatabaseStmt; class ObCreateDatabaseExecutor { - public: +public: ObCreateDatabaseExecutor(); virtual ~ObCreateDatabaseExecutor(); int execute(ObExecContext& ctx, ObCreateDatabaseStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateDatabaseExecutor); }; /////////////////////// class ObUseDatabaseExecutor { - public: +public: ObUseDatabaseExecutor(); virtual ~ObUseDatabaseExecutor(); int execute(ObExecContext& ctx, ObUseDatabaseStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUseDatabaseExecutor); }; /////////////////////// class ObAlterDatabaseExecutor { - public: +public: ObAlterDatabaseExecutor(); virtual ~ObAlterDatabaseExecutor(); int execute(ObExecContext& ctx, ObAlterDatabaseStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterDatabaseExecutor); }; ///////////////////// class ObDropDatabaseExecutor { - public: +public: ObDropDatabaseExecutor(); virtual ~ObDropDatabaseExecutor(); int execute(ObExecContext& ctx, ObDropDatabaseStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropDatabaseExecutor); }; @@ -71,26 +71,26 @@ class ObDropDatabaseExecutor { * * */ class ObFlashBackDatabaseExecutor { - public: +public: ObFlashBackDatabaseExecutor() {} virtual ~ObFlashBackDatabaseExecutor() {} int execute(ObExecContext& ctx, ObFlashBackDatabaseStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFlashBackDatabaseExecutor); }; class ObPurgeDatabaseExecutor { - public: +public: ObPurgeDatabaseExecutor() {} virtual ~ObPurgeDatabaseExecutor() {} int execute(ObExecContext& ctx, ObPurgeDatabaseStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPurgeDatabaseExecutor); }; diff --git a/src/sql/engine/cmd/ob_dblink_executor.h b/src/sql/engine/cmd/ob_dblink_executor.h index c9dac07ad..216fe280d 100644 --- a/src/sql/engine/cmd/ob_dblink_executor.h +++ b/src/sql/engine/cmd/ob_dblink_executor.h @@ -21,26 +21,26 @@ class ObCreateDbLinkStmt; class ObDropDbLinkStmt; class ObCreateDbLinkExecutor { - public: +public: ObCreateDbLinkExecutor() {} virtual ~ObCreateDbLinkExecutor() {} int execute(ObExecContext& ctx, ObCreateDbLinkStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateDbLinkExecutor); }; class ObDropDbLinkExecutor { - public: +public: ObDropDbLinkExecutor() {} virtual ~ObDropDbLinkExecutor() {} int execute(ObExecContext& ctx, ObDropDbLinkStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropDbLinkExecutor); }; diff --git a/src/sql/engine/cmd/ob_dcl_executor.h b/src/sql/engine/cmd/ob_dcl_executor.h index 0b3464af4..02bac16a0 100644 --- a/src/sql/engine/cmd/ob_dcl_executor.h +++ b/src/sql/engine/cmd/ob_dcl_executor.h @@ -27,33 +27,33 @@ namespace sql { class ObExecContext; class ObGrantStmt; class ObGrantExecutor { - public: +public: ObGrantExecutor() {} virtual ~ObGrantExecutor() {} int execute(ObExecContext& ctx, ObGrantStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGrantExecutor); }; class ObRevokeStmt; class ObRevokeExecutor { - public: +public: ObRevokeExecutor() {} virtual ~ObRevokeExecutor() {} int execute(ObExecContext& ctx, ObRevokeStmt& stmt); - private: +private: int revoke_user(obrpc::ObCommonRpcProxy* rpc_proxy, ObRevokeStmt& stmt); int revoke_db(obrpc::ObCommonRpcProxy* rpc_proxy, ObRevokeStmt& stmt); int revoke_table(obrpc::ObCommonRpcProxy* rpc_proxy, ObRevokeStmt& stmt); int revoke_sys_priv(obrpc::ObCommonRpcProxy* rpc_proxy, ObRevokeStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRevokeExecutor); }; } // namespace sql diff --git a/src/sql/engine/cmd/ob_empty_query_executor.h b/src/sql/engine/cmd/ob_empty_query_executor.h index f29d760f0..3444dba8c 100644 --- a/src/sql/engine/cmd/ob_empty_query_executor.h +++ b/src/sql/engine/cmd/ob_empty_query_executor.h @@ -20,14 +20,14 @@ class ObExecContext; class ObEmptyQueryStmt; class ObEmptyQueryExecutor { - public: +public: ObEmptyQueryExecutor() {} virtual ~ObEmptyQueryExecutor() {} int execute(ObExecContext& ctx, ObEmptyQueryStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObEmptyQueryExecutor); }; } // namespace sql diff --git a/src/sql/engine/cmd/ob_index_executor.h b/src/sql/engine/cmd/ob_index_executor.h index a4b169fbf..7bdfe653e 100644 --- a/src/sql/engine/cmd/ob_index_executor.h +++ b/src/sql/engine/cmd/ob_index_executor.h @@ -27,13 +27,13 @@ class ObCreateIndexStmt; class ObSQLSessionInfo; class ObCreateIndexExecutor { - public: +public: friend class ObAlterTableExecutor; ObCreateIndexExecutor(); virtual ~ObCreateIndexExecutor(); int execute(ObExecContext& ctx, ObCreateIndexStmt& stmt); - private: +private: int set_drop_index_stmt_str(obrpc::ObDropIndexArg& drop_index_arg, common::ObIAllocator& allocator); int sync_check_index_status(sql::ObSQLSessionInfo& my_session, obrpc::ObCommonRpcProxy& common_rpc_proxy, const obrpc::ObCreateIndexArg& create_index_arg, common::ObIAllocator& allocator, @@ -44,7 +44,7 @@ class ObCreateIndexExecutor { class ObDropIndexStmt; class ObDropIndexExecutor { - public: +public: ObDropIndexExecutor(); virtual ~ObDropIndexExecutor(); @@ -53,26 +53,26 @@ class ObDropIndexExecutor { class ObFlashBackIndexStmt; class ObFlashBackIndexExecutor { - public: +public: ObFlashBackIndexExecutor() {} virtual ~ObFlashBackIndexExecutor() {} int execute(ObExecContext& ctx, ObFlashBackIndexStmt& stmt); - private: +private: }; class ObPurgeIndexStmt; class ObPurgeIndexExecutor { - public: +public: ObPurgeIndexExecutor() {} virtual ~ObPurgeIndexExecutor() {} int execute(ObExecContext& ctx, ObPurgeIndexStmt& stmt); - private: +private: }; } // namespace sql diff --git a/src/sql/engine/cmd/ob_kill_executor.h b/src/sql/engine/cmd/ob_kill_executor.h index d5e676657..0ff8d2f03 100644 --- a/src/sql/engine/cmd/ob_kill_executor.h +++ b/src/sql/engine/cmd/ob_kill_executor.h @@ -29,29 +29,29 @@ class ObSQLSessionMgr; class ObKillSessionArg; class ObKillSession { - public: +public: ObKillSession() {} virtual ~ObKillSession() {} - protected: +protected: int kill_session(const ObKillSessionArg& arg, ObSQLSessionMgr& sess_mgr); - private: +private: int get_session(ObSQLSessionMgr& ses_mgr, uint32_t sessid, ObSQLSessionInfo*& sess_info); DISALLOW_COPY_AND_ASSIGN(ObKillSession); }; class ObKillExecutor : public ObKillSession { - public: +public: ObKillExecutor() {} virtual ~ObKillExecutor() {} int execute(ObExecContext& ctx, ObKillStmt& stmt); - private: +private: int get_remote_session_location(const ObKillSessionArg& arg, ObExecContext& ctx, common::ObAddr& addr); int generate_read_sql(uint32_t sess_id, common::ObSqlString& sql); int kill_remote_session(ObExecContext& ctx, const common::ObAddr& addr, const ObKillSessionArg& arg); @@ -61,16 +61,16 @@ class ObKillExecutor : public ObKillSession { class ObRpcKillSessionP : public obrpc::ObRpcProcessor >, public ObKillSession { - public: +public: explicit ObRpcKillSessionP(const observer::ObGlobalContext& gctx) : gctx_(gctx) {} ~ObRpcKillSessionP() {} - protected: +protected: int process(); - private: +private: const observer::ObGlobalContext& gctx_; }; } // namespace sql diff --git a/src/sql/engine/cmd/ob_kill_session_arg.h b/src/sql/engine/cmd/ob_kill_session_arg.h index a8aa08b64..d30b46c84 100644 --- a/src/sql/engine/cmd/ob_kill_session_arg.h +++ b/src/sql/engine/cmd/ob_kill_session_arg.h @@ -25,7 +25,7 @@ class ObKillStmt; class ObKillSessionArg { OB_UNIS_VERSION(1); - public: +public: ObKillSessionArg() : sess_id_(0), tenant_id_(common::OB_INVALID_TENANT_ID), @@ -39,7 +39,7 @@ class ObKillSessionArg { int calculate_sessid(ObExecContext& ctx, const ObKillStmt& stmt); TO_STRING_KV(K(sess_id_), K(tenant_id_), K(user_id_), K(is_query_), K(has_user_super_privilege_)); - public: +public: uint32_t sess_id_; uint64_t tenant_id_; uint64_t user_id_; diff --git a/src/sql/engine/cmd/ob_load_data_executor.h b/src/sql/engine/cmd/ob_load_data_executor.h index 867968dd6..74febfc1e 100644 --- a/src/sql/engine/cmd/ob_load_data_executor.h +++ b/src/sql/engine/cmd/ob_load_data_executor.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLoadDataStmt; class ObLoadDataExecutor { - public: +public: ObLoadDataExecutor() {} virtual ~ObLoadDataExecutor() @@ -25,11 +25,11 @@ class ObLoadDataExecutor { int execute(ObExecContext& ctx, ObLoadDataStmt& stmt); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObLoadDataExecutor); // function members - private: +private: // data members }; diff --git a/src/sql/engine/cmd/ob_load_data_impl.h b/src/sql/engine/cmd/ob_load_data_impl.h index fbe23cf39..5a8834662 100644 --- a/src/sql/engine/cmd/ob_load_data_impl.h +++ b/src/sql/engine/cmd/ob_load_data_impl.h @@ -81,7 +81,7 @@ struct ObLoadTableColumnDesc { }; class ObInsertValueGenerator { - public: +public: int gen_values(const common::ObIArray& file_col_values, common::ObIArray& table_column_values, ObExecContext& exec_ctx, ObLoadFileBuffer& data_buf) const; @@ -102,13 +102,13 @@ class ObInsertValueGenerator { bool find_table_column_value_desc_by_column_id(const uint64_t column_id, int64_t& idx); int gen_insert_columns_names_buff(ObExecContext& ctx, const ObLoadArgument& load_args, common::ObString& data_buff); - private: +private: common::ObSEArray table_column_value_desc_; common::ObSEArray exprs_ref_file_col_; }; class ObPartIdCalculator { - public: +public: int init(ObExecContext& ctx, const common::ObString& q_name, const uint64_t& table_id, ObInsertValueGenerator& generator, ObLoadFileBuffer& data_buf, common::ObIArray& insert_values, common::ObIArray& file_col_values); @@ -119,7 +119,7 @@ class ObPartIdCalculator { return table_location_.get_table_id(); } - private: +private: common::ObSEArray param_to_file_col_idx_; ObTableLocation table_location_; }; @@ -159,7 +159,7 @@ struct ObDataFrag : common::ObLink { }; class ObPartDataFragMgr { - public: +public: ObPartDataFragMgr(ObDataFragMgr& data_frag_mgr, int64_t part_id) : data_frag_mgr_(data_frag_mgr), part_id_(part_id), total_row_consumed_(0), total_row_proceduced_(0) {} @@ -209,7 +209,7 @@ class ObPartDataFragMgr { volatile int64_t total_row_proceduced_; common::ObSpLinkQueue queue_; - public: +public: // for batch task struct InsertTaskSplitPoint { InsertTaskSplitPoint() @@ -232,7 +232,7 @@ class ObPartDataFragMgr { int free_frags(); TO_STRING_KV(K(frag_free_list_), K(queue_top_begin_point_)); - private: +private: /** * @brief return the pos of row_num in frag */ @@ -262,7 +262,7 @@ struct ObPartDataFragHash { }; class ObDataFragMgr { - public: +public: int init(ObExecContext& ctx, uint64_t table_id); int get_part_datafrag(int64_t part_id, ObPartDataFragMgr*& part_datafrag_mgr); int64_t get_total_part_cnt() @@ -291,7 +291,7 @@ class ObDataFragMgr { } TO_STRING_KV(K_(total_part_cnt), "total_alloc_cnt", get_total_allocated_frag_count(), K_(total_free_cnt)); - private: +private: common::ObMemAttr attr_; int64_t total_part_cnt_; volatile int64_t total_alloc_cnt_; @@ -305,7 +305,7 @@ class ObDataFragMgr { // one buffer info for one partition class ObPartitionBufferCtrl { - public: +public: explicit ObPartitionBufferCtrl(int64_t partition_id) : part_id_(partition_id), buffer_(NULL) {} ~ObPartitionBufferCtrl() @@ -326,9 +326,9 @@ class ObPartitionBufferCtrl { TO_STRING_KV(K_(part_id), KP_(buffer)); - public: +public: int64_t part_id_; // hash key - private: +private: void* buffer_; } CACHE_ALIGNED; @@ -352,7 +352,7 @@ struct ObPartBufMgrHashInfo { //======================== class ObAllocatorSwitch : public common::ObIAllocator { - public: +public: ObAllocatorSwitch() : cur_alloc_(&permanent_alloc_) {} void switch_permanent() @@ -415,17 +415,17 @@ class ObAllocatorSwitch : public common::ObIAllocator { TO_STRING_KV("cur_alloc_", (cur_alloc_ == &permanent_alloc_) ? "permanent" : "temporary"); - private: +private: common::ObIAllocator* cur_alloc_; ObArenaAllocator permanent_alloc_; ObArenaAllocator temporary_alloc_; }; class ObLoadFileBuffer { - public: +public: static const int64_t MAX_BUFFER_SIZE = OB_MALLOC_BIG_BLOCK_SIZE; - public: +public: ObLoadFileBuffer() = delete; ObLoadFileBuffer(int64_t buffer_size) : pos_(0), buffer_size_(buffer_size) {} @@ -462,7 +462,7 @@ class ObLoadFileBuffer { pos_ = 0; } - private: +private: int64_t pos_; int64_t buffer_size_; char buffer_[]; @@ -492,7 +492,7 @@ struct ObCSVFormats { }; class ObLoadFileDataTrimer { - public: +public: ObLoadFileDataTrimer() : incomplate_data_(NULL), incomplate_data_len_(0), lines_cnt_(0) {} int init(common::ObIAllocator& allocator, const ObCSVFormats& formats); @@ -517,7 +517,7 @@ class ObLoadFileDataTrimer { lines_cnt_ += line_cnt; } - private: +private: ObCSVFormats formats_; // TODO [load data] change to ObInverseParser(formats) char* incomplate_data_; int64_t incomplate_data_len_; @@ -525,10 +525,10 @@ class ObLoadFileDataTrimer { }; class ObCSVParser { - public: +public: static const char* ZERO_STRING; - public: +public: ObCSVParser() : is_fast_parse_(false), total_field_nums_(0) { reuse(); @@ -574,7 +574,7 @@ class ObCSVParser { is_fast_parse_ = true; } - private: +private: bool is_terminate_char(char cur_char, char*& cur_pos, bool& is_line_term); bool is_enclosed_field_start(char* cur_pos, char& cur_char); void handle_one_field(char* field_end_pos); @@ -583,7 +583,7 @@ class ObCSVParser { int deal_with_irregular_line(); void remove_enclosed_char(char*& cur_field_end_pos); - private: +private: // parsing style bool is_fast_parse_; ObCSVFormats formats_; @@ -710,7 +710,7 @@ private: }; */ class ObLoadDataBase { - public: +public: ObLoadDataBase() {} virtual ~ObLoadDataBase() @@ -792,7 +792,7 @@ struct ObLoadServerInfo { * @brief load data shuffle parallel implementation */ class ObLoadDataSPImpl : public ObLoadDataBase { - public: +public: enum class TaskType { InvalidTask = -1, ShuffleTask = 0, @@ -872,7 +872,7 @@ class ObLoadDataSPImpl : public ObLoadDataBase { common::ObSEArray ctx_allocators; }; - public: +public: ObLoadDataSPImpl() {} ~ObLoadDataSPImpl() @@ -896,7 +896,7 @@ class ObLoadDataSPImpl : public ObLoadDataBase { static int exec_shuffle(int64_t task_id, ObShuffleTaskHandle* handle); static int exec_insert(ObInsertTask& task, ObInsertResult& result); - private: +private: static int build_insert_values_generator( ObExecContext& ctx, ObLoadDataStmt& load_stmt, ObInsertValueGenerator& generator); static int recursively_replace_variables( @@ -907,7 +907,7 @@ class ObLoadDataSPImpl : public ObLoadDataBase { }; class ObLoadDataImpl : public ObLoadDataBase { - public: +public: enum ParseStep { FIND_LINE_START = 0, FIND_LINE_TERM }; static const int64_t FILE_READ_BUFFER_SIZE = 2 * 1024 * 1024; @@ -1030,11 +1030,11 @@ class ObLoadDataImpl : public ObLoadDataBase { int execute(ObExecContext& ctx, ObLoadDataStmt& load_stmt); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObLoadDataImpl); // function members - private: +private: // arguments ObLoadArgument load_args_; ObDataInFileStruct data_struct_in_file_; diff --git a/src/sql/engine/cmd/ob_load_data_rpc.h b/src/sql/engine/cmd/ob_load_data_rpc.h index f9370e21f..739704681 100644 --- a/src/sql/engine/cmd/ob_load_data_rpc.h +++ b/src/sql/engine/cmd/ob_load_data_rpc.h @@ -47,7 +47,7 @@ class ObPartDataFragMgr; namespace obrpc { class ObLoadDataRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObLoadDataRpcProxy); RPC_AP(@PR5 ap_load_data_execute, obrpc::OB_LOAD_DATA_EXECUTE, (sql::ObLoadbuffer), sql::ObLoadResult); RPC_AP(@PR5 ap_load_data_shuffle, obrpc::OB_LOAD_DATA_SHUFFLE, (sql::ObShuffleTask), sql::ObShuffleResult); @@ -88,7 +88,7 @@ enum class ObTaskResFlag { typedef ObBitSet<32> ErrRowBitset; class ObParallelTaskController { - public: +public: ObParallelTaskController() : max_parallelism_(0), task_cnt_(0), processing_cnt_(0) {} ~ObParallelTaskController() @@ -114,7 +114,7 @@ class ObParallelTaskController { return max_parallelism_; } - private: +private: static const int64_t MAX_TIME_WAIT_MS = 2 * RPC_BATCH_INSERT_TIMEOUT_US / 1000; int64_t max_parallelism_; int64_t task_cnt_; @@ -210,7 +210,7 @@ struct ObInsertTask { template class ObRpcPointerArg { - public: +public: ObRpcPointerArg() : ptr_value_(0) {} int set_arg(T* ptr) @@ -232,7 +232,7 @@ class ObRpcPointerArg { return ret; } - private: +private: union { uint64_t ptr_value_; T* ptr_; @@ -273,7 +273,7 @@ struct ObShuffleResult { template class ObConcurrentFixedCircularArray { - public: +public: ObConcurrentFixedCircularArray() : array_size_(0), data_(NULL), head_pos_(0), tail_pos_(0) {} ~ObConcurrentFixedCircularArray() @@ -325,7 +325,7 @@ class ObConcurrentFixedCircularArray { return ATOMIC_LOAD(&head_pos_) - ATOMIC_LOAD(&tail_pos_); } - private: +private: // data members int64_t array_size_; T* volatile data_; @@ -337,7 +337,7 @@ typedef ObConcurrentFixedCircularArray CompleteTaskArray; // load data task buffer class ObLoadbuffer { - public: +public: const static int64_t LOAD_BUFFER_MAX_ROW_COUNT = DEFAULT_BUFFERRED_ROW_COUNT; ObLoadbuffer() : tenant_id_(common::OB_INVALID_ID), @@ -504,7 +504,7 @@ class ObLoadbuffer { K_(part_id), K_(task_status), K_(insert_mode), K_(returned_timestamp)); OB_UNIS_VERSION(1); - private: +private: // send params uint64_t tenant_id_; uint64_t table_id_; @@ -534,7 +534,7 @@ class ObLoadbuffer { // load data task result class ObLoadResult { - public: +public: ObLoadResult() : task_id_(-1), part_id_(common::OB_INVALID_PARTITION_ID), affected_rows_(0), failed_rows_(0), task_flags_(false) {} @@ -551,23 +551,23 @@ class ObLoadResult { class ObRpcLoadDataTaskExecuteP : public oceanbase::obrpc::ObRpcProcessor > { - public: +public: explicit ObRpcLoadDataTaskExecuteP(const observer::ObGlobalContext& gctx) : gctx_(gctx), escape_data_buffer_() {} virtual ~ObRpcLoadDataTaskExecuteP() {} - protected: +protected: int process(); - private: +private: const observer::ObGlobalContext& gctx_; common::ObDataBuffer escape_data_buffer_; char str_buf_[common::OB_MAX_DEFAULT_VALUE_LENGTH]; // TODO: change this }; class ObRpcLoadDataTaskCallBack : public obrpc::ObLoadDataRpcProxy::AsyncCB { - public: +public: ObRpcLoadDataTaskCallBack( ObParallelTaskController& task_controller, CompleteTaskArray& complete_task_list, Request* request) : task_controller_(task_controller), complete_task_list_(complete_task_list), request_buffer_ptr_(request) @@ -585,7 +585,7 @@ class ObRpcLoadDataTaskCallBack : public obrpc::ObLoadDataRpcProxy::AsyncCB > { - public: +public: explicit ObRpcLoadDataShuffleTaskExecuteP(const observer::ObGlobalContext& gctx) : gctx_(gctx) {} virtual ~ObRpcLoadDataShuffleTaskExecuteP() {} - protected: +protected: int process(); - private: +private: const observer::ObGlobalContext& gctx_; }; class ObRpcLoadDataShuffleTaskCallBack : public obrpc::ObLoadDataRpcProxy::AsyncCB { - public: +public: ObRpcLoadDataShuffleTaskCallBack(ObParallelTaskController& task_controller, ObConcurrentFixedCircularArray& complete_task_list, ObShuffleTaskHandle* handle) : task_controller_(task_controller), complete_task_list_(complete_task_list), handle_(handle) @@ -628,7 +628,7 @@ class ObRpcLoadDataShuffleTaskCallBack : public obrpc::ObLoadDataRpcProxy::Async int process(); int release_resouce(); - private: +private: ObParallelTaskController& task_controller_; ObConcurrentFixedCircularArray& complete_task_list_; ObShuffleTaskHandle* handle_; @@ -636,21 +636,21 @@ class ObRpcLoadDataShuffleTaskCallBack : public obrpc::ObLoadDataRpcProxy::Async class ObRpcLoadDataInsertTaskExecuteP : public oceanbase::obrpc::ObRpcProcessor > { - public: +public: explicit ObRpcLoadDataInsertTaskExecuteP(const observer::ObGlobalContext& gctx) : gctx_(gctx) {} virtual ~ObRpcLoadDataInsertTaskExecuteP() {} - protected: +protected: int process(); - private: +private: const observer::ObGlobalContext& gctx_; }; class ObRpcLoadDataInsertTaskCallBack : public obrpc::ObLoadDataRpcProxy::AsyncCB { - public: +public: ObRpcLoadDataInsertTaskCallBack(ObParallelTaskController& task_controller, ObConcurrentFixedCircularArray& complete_task_list, ObInsertTask* insert_task) : task_controller_(task_controller), complete_task_list_(complete_task_list), insert_task_(insert_task) @@ -669,7 +669,7 @@ class ObRpcLoadDataInsertTaskCallBack : public obrpc::ObLoadDataRpcProxy::AsyncC int process(); int release_resouce(); - private: +private: ObParallelTaskController& task_controller_; ObConcurrentFixedCircularArray& complete_task_list_; ObInsertTask* insert_task_; diff --git a/src/sql/engine/cmd/ob_load_data_utils.h b/src/sql/engine/cmd/ob_load_data_utils.h index c709531a9..c1b5d90b3 100644 --- a/src/sql/engine/cmd/ob_load_data_utils.h +++ b/src/sql/engine/cmd/ob_load_data_utils.h @@ -30,7 +30,7 @@ typedef common::ObBitSet ObExprV /* A state machine to handle backslash from a char stream */ class ObLoadEscapeSM { - public: +public: static const int64_t ESCAPE_CHAR_MYSQL = static_cast('\\'); static const int64_t ESCAPE_CHAR_ORACLE = static_cast('\''); ObLoadEscapeSM() : is_escaped_flag_(false), escape_char_(INT64_MAX), escaped_char_count(0) @@ -72,14 +72,14 @@ class ObLoadEscapeSM { return escaped_char_count; } - private: +private: bool is_escaped_flag_; int64_t escape_char_; int64_t escaped_char_count; }; class ObLoadDataUtils { - public: +public: static const char* NULL_STRING; static const char NULL_VALUE_FLAG; @@ -177,7 +177,7 @@ class ObLoadDataUtils { }; class ObLoadTaskStatus { - public: +public: ObLoadTaskStatus() : task_status_(0) {} enum class ResFlag { @@ -202,12 +202,12 @@ class ObLoadTaskStatus { TO_STRING_KV(K_(task_status)); OB_UNIS_VERSION(1); - private: +private: int64_t task_status_; }; class ObLoadDataTimer { - public: +public: ObLoadDataTimer() : total_time_us_(0), temp_start_time_us_(-1) {} OB_INLINE void start_stat() @@ -231,7 +231,7 @@ class ObLoadDataTimer { } TO_STRING_KV("secs", get_wait_secs()); - private: +private: int64_t total_time_us_; int64_t temp_start_time_us_; }; @@ -242,7 +242,7 @@ class ObLoadDataTimer { * to detect a given str from a char stream */ class ObKMPStateMachine { - public: +public: ObKMPStateMachine() : is_inited_(false), str_(NULL), str_len_(0), matched_pos_(0), next_(NULL) {} int init(common::ObIAllocator& allocator, const common::ObString& str); @@ -279,7 +279,7 @@ class ObKMPStateMachine { matched_pos_ = 0; } - private: +private: static const int KEY_WORD_MAX_LENGTH = 2 * 1024; bool is_inited_; char* str_; // string pattern for matching @@ -337,7 +337,7 @@ struct ObLoadDataStat { }; class ObGlobalLoadDataStatMap { - public: +public: static ObGlobalLoadDataStatMap* getInstance(); ObGlobalLoadDataStatMap() : is_inited_(false) {} @@ -346,7 +346,7 @@ class ObGlobalLoadDataStatMap { int unregister_job(const ObLoadDataGID& id, ObLoadDataStat*& job_status); int get_job_status(const ObLoadDataGID& id, ObLoadDataStat*& job_status); - private: +private: typedef common::hash::ObHashMap HASH_MAP; static const int64_t bucket_num = 1000; static ObGlobalLoadDataStatMap* instance_; diff --git a/src/sql/engine/cmd/ob_outline_executor.h b/src/sql/engine/cmd/ob_outline_executor.h index b1c2e1729..3bc541aa6 100644 --- a/src/sql/engine/cmd/ob_outline_executor.h +++ b/src/sql/engine/cmd/ob_outline_executor.h @@ -35,13 +35,13 @@ class ObDMLStmt; class ObOptimizerContext; class ObOutlineExecutor { - public: +public: ObOutlineExecutor() {} virtual ~ObOutlineExecutor() {} - protected: +protected: int get_outline(ObExecContext& ctx, ObDMLStmt* outline_stmt, common::ObString& outline); int generate_outline_info( ObExecContext& ctx, ObCreateOutlineStmt* outline_stmt, share::schema::ObOutlineInfo& outline_info); @@ -53,43 +53,43 @@ class ObOutlineExecutor { bool is_valid_outline_stmt_type(stmt::StmtType type); int print_outline(ObExecContext& ctx, ObLogPlan* log_plan, common::ObString& outline); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOutlineExecutor); }; class ObCreateOutlineExecutor : public ObOutlineExecutor { - public: +public: ObCreateOutlineExecutor() {} virtual ~ObCreateOutlineExecutor() {} int execute(ObExecContext& ctx, ObCreateOutlineStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateOutlineExecutor); }; class ObAlterOutlineExecutor : public ObOutlineExecutor { - public: +public: ObAlterOutlineExecutor() {} virtual ~ObAlterOutlineExecutor() {} int execute(ObExecContext& ctx, ObAlterOutlineStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterOutlineExecutor); }; class ObDropOutlineExecutor { - public: +public: ObDropOutlineExecutor() {} virtual ~ObDropOutlineExecutor() {} int execute(ObExecContext& ctx, ObDropOutlineStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropOutlineExecutor); }; diff --git a/src/sql/engine/cmd/ob_partition_executor_utils.h b/src/sql/engine/cmd/ob_partition_executor_utils.h index 9191f450f..376628ed4 100644 --- a/src/sql/engine/cmd/ob_partition_executor_utils.h +++ b/src/sql/engine/cmd/ob_partition_executor_utils.h @@ -35,7 +35,7 @@ class ObTableStmt; class ObTablegroupStmt; class ObPartitionExecutorUtils { - public: +public: const static int OB_DEFAULT_ARRAY_SIZE = 16; static int calc_values_exprs(ObExecContext& ctx, ObCreateTableStmt& stmt); static int calc_values_exprs(ObExecContext& ctx, ObCreateIndexStmt& stmt); @@ -101,7 +101,7 @@ class ObPartitionExecutorUtils { static int row_expr_to_array(ObRawExpr* row_expr, ObIArray& list_values_expr_array); - private: +private: static int calc_values_exprs(ObExecContext& ctx, const stmt::StmtType stmt_type, share::schema::ObTableSchema& table_schema, ObPartitionedStmt& stmt, bool is_subpart); diff --git a/src/sql/engine/cmd/ob_profile_cmd_executor.h b/src/sql/engine/cmd/ob_profile_cmd_executor.h index 886c6775c..2f8cf6fc7 100644 --- a/src/sql/engine/cmd/ob_profile_cmd_executor.h +++ b/src/sql/engine/cmd/ob_profile_cmd_executor.h @@ -26,15 +26,15 @@ namespace sql { class ObExecContext; class ObUserProfileStmt; class ObProfileDDLExecutor { - public: +public: ObProfileDDLExecutor() {} virtual ~ObProfileDDLExecutor() {} int execute(ObExecContext& ctx, ObUserProfileStmt& stmt); - private: - private: +private: +private: DISALLOW_COPY_AND_ASSIGN(ObProfileDDLExecutor); }; diff --git a/src/sql/engine/cmd/ob_resource_executor.h b/src/sql/engine/cmd/ob_resource_executor.h index d6c5cecb0..c51f0cf29 100644 --- a/src/sql/engine/cmd/ob_resource_executor.h +++ b/src/sql/engine/cmd/ob_resource_executor.h @@ -25,75 +25,75 @@ class ObAlterResourceUnitStmt; class ObDropResourceUnitStmt; class ObCreateResourcePoolExecutor { - public: +public: ObCreateResourcePoolExecutor(); virtual ~ObCreateResourcePoolExecutor(); int execute(ObExecContext& ctx, ObCreateResourcePoolStmt& stmt); - private: +private: }; class ObDropResourcePoolExecutor { - public: +public: ObDropResourcePoolExecutor(); virtual ~ObDropResourcePoolExecutor(); int execute(ObExecContext& ctx, ObDropResourcePoolStmt& stmt); - private: +private: }; class ObSplitResourcePoolExecutor { - public: +public: ObSplitResourcePoolExecutor(); virtual ~ObSplitResourcePoolExecutor(); int execute(ObExecContext& ctx, ObSplitResourcePoolStmt& stmt); - private: +private: }; class ObMergeResourcePoolExecutor { - public: +public: ObMergeResourcePoolExecutor(); virtual ~ObMergeResourcePoolExecutor(); int execute(ObExecContext& ctx, ObMergeResourcePoolStmt& stmt); - private: +private: }; class ObAlterResourcePoolExecutor { - public: +public: ObAlterResourcePoolExecutor(); virtual ~ObAlterResourcePoolExecutor(); int execute(ObExecContext& ctx, ObAlterResourcePoolStmt& stmt); - private: +private: }; class ObCreateResourceUnitExecutor { - public: +public: ObCreateResourceUnitExecutor(); virtual ~ObCreateResourceUnitExecutor(); int execute(ObExecContext& ctx, ObCreateResourceUnitStmt& stmt); - private: +private: }; class ObAlterResourceUnitExecutor { - public: +public: ObAlterResourceUnitExecutor(); virtual ~ObAlterResourceUnitExecutor(); int execute(ObExecContext& ctx, ObAlterResourceUnitStmt& stmt); - private: +private: }; class ObDropResourceUnitExecutor { - public: +public: ObDropResourceUnitExecutor(); virtual ~ObDropResourceUnitExecutor(); int execute(ObExecContext& ctx, ObDropResourceUnitStmt& stmt); - private: +private: }; } // namespace sql diff --git a/src/sql/engine/cmd/ob_restore_executor.h b/src/sql/engine/cmd/ob_restore_executor.h index b8608fa53..514600e2d 100644 --- a/src/sql/engine/cmd/ob_restore_executor.h +++ b/src/sql/engine/cmd/ob_restore_executor.h @@ -20,14 +20,14 @@ class ObRestoreTenantStmt; class ObPhysicalRestoreTenantStmt; class ObRestoreTenantExecutor { - public: +public: ObRestoreTenantExecutor(); virtual ~ObRestoreTenantExecutor(); int execute(ObExecContext& ctx, ObRestoreTenantStmt& stmt); }; class ObPhysicalRestoreTenantExecutor { - public: +public: ObPhysicalRestoreTenantExecutor(); virtual ~ObPhysicalRestoreTenantExecutor(); int execute(ObExecContext& ctx, ObPhysicalRestoreTenantStmt& stmt); diff --git a/src/sql/engine/cmd/ob_role_cmd_executor.h b/src/sql/engine/cmd/ob_role_cmd_executor.h index 0cd58c56c..ed607ed11 100644 --- a/src/sql/engine/cmd/ob_role_cmd_executor.h +++ b/src/sql/engine/cmd/ob_role_cmd_executor.h @@ -27,7 +27,7 @@ class ObExecContext; class ObCreateRoleStmt; class ObDropRoleStmt; class ObCreateRoleExecutor { - public: +public: ObCreateRoleExecutor() {} virtual ~ObCreateRoleExecutor() @@ -36,16 +36,16 @@ class ObCreateRoleExecutor { static int encrypt_passwd( const common::ObString& passwd, common::ObString& encrypted_passwd, char* enc_buf, int64_t buf_len); - private: +private: int create_role(obrpc::ObCommonRpcProxy* rpc_proxy, const obrpc::ObCreateRoleArg& arg) const; int drop_role(obrpc::ObCommonRpcProxy* rpc_proxy, const obrpc::ObDropUserArg& arg) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateRoleExecutor); }; class ObDropRoleExecutor { - public: +public: ObDropRoleExecutor() {} virtual ~ObDropRoleExecutor() @@ -54,10 +54,10 @@ class ObDropRoleExecutor { static int encrypt_passwd( const common::ObString& passwd, common::ObString& encrypted_passwd, char* enc_buf, int64_t buf_len); - private: +private: int drop_role(obrpc::ObCommonRpcProxy* rpc_proxy, const obrpc::ObDropUserArg& arg) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropRoleExecutor); }; diff --git a/src/sql/engine/cmd/ob_sequence_executor.h b/src/sql/engine/cmd/ob_sequence_executor.h index 6e1cdd426..44f309b4c 100644 --- a/src/sql/engine/cmd/ob_sequence_executor.h +++ b/src/sql/engine/cmd/ob_sequence_executor.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { #define DEF_SIMPLE_EXECUTOR(name) \ class name##Executor { \ - public: \ + public: \ name##Executor() \ {} \ virtual ~name##Executor() \ {} \ int execute(ObExecContext& ctx, name##Stmt& stmt); \ \ - private: \ + private: \ DISALLOW_COPY_AND_ASSIGN(name##Executor); \ } diff --git a/src/sql/engine/cmd/ob_set_names_executor.h b/src/sql/engine/cmd/ob_set_names_executor.h index 5e6a45db5..849102f83 100644 --- a/src/sql/engine/cmd/ob_set_names_executor.h +++ b/src/sql/engine/cmd/ob_set_names_executor.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExecContext; class ObSetNamesExecutor { - public: +public: ObSetNamesExecutor() {} virtual ~ObSetNamesExecutor() @@ -25,14 +25,14 @@ class ObSetNamesExecutor { int execute(ObExecContext& ctx, ObSetNamesStmt& stmt); - private: +private: int get_global_sys_var_character_set_client(ObExecContext& ctx, common::ObString& character_set_client) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSetNamesExecutor); // function members - private: +private: // data members }; diff --git a/src/sql/engine/cmd/ob_set_password_executor.h b/src/sql/engine/cmd/ob_set_password_executor.h index ec55cd88e..e6b6d2c1f 100644 --- a/src/sql/engine/cmd/ob_set_password_executor.h +++ b/src/sql/engine/cmd/ob_set_password_executor.h @@ -27,7 +27,7 @@ class ObExecContext; class ObSetPasswordStmt; class ObSetPasswordExecutor { - public: +public: ObSetPasswordExecutor(); virtual ~ObSetPasswordExecutor(); int execute(ObExecContext& ctx, ObSetPasswordStmt& stmt); diff --git a/src/sql/engine/cmd/ob_synonym_executor.h b/src/sql/engine/cmd/ob_synonym_executor.h index 69268f274..24f283e31 100644 --- a/src/sql/engine/cmd/ob_synonym_executor.h +++ b/src/sql/engine/cmd/ob_synonym_executor.h @@ -27,7 +27,7 @@ class ObExecContext; class ObRawExpr; class ObCreateSynonymStmt; class ObCreateSynonymExecutor { - public: +public: const static int OB_DEFAULT_ARRAY_SIZE = 16; ObCreateSynonymExecutor() {} @@ -35,20 +35,20 @@ class ObCreateSynonymExecutor { {} int execute(ObExecContext& ctx, ObCreateSynonymStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateSynonymExecutor); }; class ObDropSynonymStmt; class ObDropSynonymExecutor { - public: +public: ObDropSynonymExecutor() {} virtual ~ObDropSynonymExecutor() {} int execute(ObExecContext& ctx, ObDropSynonymStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropSynonymExecutor); }; diff --git a/src/sql/engine/cmd/ob_table_executor.h b/src/sql/engine/cmd/ob_table_executor.h index 744dbf57d..c39a86f53 100644 --- a/src/sql/engine/cmd/ob_table_executor.h +++ b/src/sql/engine/cmd/ob_table_executor.h @@ -44,20 +44,20 @@ class ObCreateTableStmt; class ObTableStmt; class ObTableExecutorUtils { - public: +public: static int get_first_stmt( const common::ObString& stmt, common::ObString& first_stmt, ObSQLMode sql_mode = DEFAULT_OCEANBASE_MODE); }; class ObCreateTableExecutor { - public: +public: ObCreateTableExecutor(); virtual ~ObCreateTableExecutor(); int execute(ObExecContext& ctx, ObCreateTableStmt& stmt); int set_index_arg_list(ObExecContext& ctx, ObCreateTableStmt& stmt); int execute_ctas(ObExecContext& ctx, ObCreateTableStmt& stmt, obrpc::ObCommonRpcProxy* common_rpc_proxy); - private: +private: int prepare_ins_arg(ObCreateTableStmt& stmt, const ObSQLSessionInfo* my_session, ObSqlString& ins_sql); int prepare_alter_arg( ObCreateTableStmt& stmt, const ObSQLSessionInfo* my_session, obrpc::ObAlterTableArg& alter_table_arg); @@ -67,12 +67,12 @@ class ObCreateTableExecutor { class ObAlterTableStmt; class ObAlterTableExecutor { - public: +public: ObAlterTableExecutor(); virtual ~ObAlterTableExecutor(); int execute(ObExecContext& ctx, ObAlterTableStmt& stmt); - private: +private: struct PartitionServer { PartitionServer() : pkey_(), server_() {} @@ -199,89 +199,89 @@ class ObAlterTableExecutor { int refresh_schema_for_table(const uint64_t tenant_id); - private: +private: // DISALLOW_COPY_AND_ASSIGN(ObAlterTableExecutor); }; class ObDropTableStmt; class ObDropTableExecutor { - public: +public: ObDropTableExecutor(); virtual ~ObDropTableExecutor(); int execute(ObExecContext& ctx, ObDropTableStmt& stmt); - private: +private: }; class ObRenameTableStmt; class ObRenameTableExecutor { - public: +public: ObRenameTableExecutor(); virtual ~ObRenameTableExecutor(); int execute(ObExecContext& ctx, ObRenameTableStmt& stmt); - private: +private: }; class ObTruncateTableStmt; class ObTruncateTableExecutor { - public: +public: ObTruncateTableExecutor(); virtual ~ObTruncateTableExecutor(); int execute(ObExecContext& ctx, ObTruncateTableStmt& stmt); - private: +private: }; class ObCreateTableLikeStmt; class ObCreateTableLikeExecutor { - public: +public: ObCreateTableLikeExecutor(); virtual ~ObCreateTableLikeExecutor(); int execute(ObExecContext& ctx, ObCreateTableLikeStmt& stmt); - private: +private: }; class ObFlashBackTableFromRecyclebinStmt; class ObFlashBackTableFromRecyclebinExecutor { - public: +public: ObFlashBackTableFromRecyclebinExecutor() {} virtual ~ObFlashBackTableFromRecyclebinExecutor() {} int execute(ObExecContext& ctx, ObFlashBackTableFromRecyclebinStmt& stmt); - private: +private: }; class ObFlashBackTableToScnStmt; class ObFlashBackTableToScnExecutor { - public: +public: ObFlashBackTableToScnExecutor() {} virtual ~ObFlashBackTableToScnExecutor() {} int execute(ObExecContext& ctx, ObFlashBackTableToScnStmt& stmt); - private: +private: }; class ObPurgeTableStmt; class ObPurgeTableExecutor { - public: +public: ObPurgeTableExecutor() {} virtual ~ObPurgeTableExecutor() {} int execute(ObExecContext& ctx, ObPurgeTableStmt& stmt); - private: +private: }; class ObOptimizeTableStmt; class ObOptimizeTableExecutor { - public: +public: ObOptimizeTableExecutor() = default; virtual ~ObOptimizeTableExecutor() = default; int execute(ObExecContext& ctx, ObOptimizeTableStmt& stmt); @@ -289,7 +289,7 @@ class ObOptimizeTableExecutor { class ObOptimizeTenantStmt; class ObOptimizeTenantExecutor { - public: +public: ObOptimizeTenantExecutor() = default; virtual ~ObOptimizeTenantExecutor() = default; int execute(ObExecContext& ctx, ObOptimizeTenantStmt& stmt); @@ -299,7 +299,7 @@ class ObOptimizeTenantExecutor { class ObOptimizeAllStmt; class ObOptimizeAllExecutor { - public: +public: ObOptimizeAllExecutor() = default; virtual ~ObOptimizeAllExecutor() = default; int execute(ObExecContext& ctx, ObOptimizeAllStmt& stmt); diff --git a/src/sql/engine/cmd/ob_tablegroup_executor.h b/src/sql/engine/cmd/ob_tablegroup_executor.h index 80f59c16c..d3314da3a 100644 --- a/src/sql/engine/cmd/ob_tablegroup_executor.h +++ b/src/sql/engine/cmd/ob_tablegroup_executor.h @@ -28,14 +28,14 @@ class ObRawExpr; #define DEF_SIMPLE_EXECUTOR(name) \ class name##Executor { \ - public: \ + public: \ name##Executor() \ {} \ virtual ~name##Executor() \ {} \ int execute(ObExecContext& ctx, name##Stmt& stmt); \ \ - private: \ + private: \ DISALLOW_COPY_AND_ASSIGN(name##Executor); \ } @@ -48,14 +48,14 @@ DEF_SIMPLE_EXECUTOR(ObDropTablegroup); class ObAlterTablegroupStmt; class ObAlterTablegroupExecutor { - public: +public: ObAlterTablegroupExecutor() {} virtual ~ObAlterTablegroupExecutor() {} int execute(ObExecContext& ctx, ObAlterTablegroupStmt& stmt); - private: +private: int check_alter_partition(ObExecContext& ctx, ObAlterTablegroupStmt& stmt, const obrpc::ObAlterTablegroupArg& arg); DISALLOW_COPY_AND_ASSIGN(ObAlterTablegroupExecutor); }; diff --git a/src/sql/engine/cmd/ob_tcl_executor.h b/src/sql/engine/cmd/ob_tcl_executor.h index 7f883c6ba..346413c9f 100644 --- a/src/sql/engine/cmd/ob_tcl_executor.h +++ b/src/sql/engine/cmd/ob_tcl_executor.h @@ -20,68 +20,68 @@ namespace sql { class ObExecContext; class ObEndTransStmt; class ObEndTransExecutor { - public: +public: ObEndTransExecutor() {} virtual ~ObEndTransExecutor() {} int execute(ObExecContext& ctx, ObEndTransStmt& stmt); - private: +private: int end_trans(ObExecContext& ctx, ObEndTransStmt& stmt); DISALLOW_COPY_AND_ASSIGN(ObEndTransExecutor); }; class ObStartTransStmt; class ObStartTransExecutor { - public: +public: ObStartTransExecutor() {} virtual ~ObStartTransExecutor() {} int execute(ObExecContext& ctx, ObStartTransStmt& stmt); - private: +private: int start_trans(ObExecContext& ctx, ObStartTransStmt& stmt); DISALLOW_COPY_AND_ASSIGN(ObStartTransExecutor); }; class ObCreateSavePointStmt; class ObCreateSavePointExecutor { - public: +public: ObCreateSavePointExecutor() {} virtual ~ObCreateSavePointExecutor() {} int execute(ObExecContext& ctx, ObCreateSavePointStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateSavePointExecutor); }; class ObRollbackSavePointStmt; class ObRollbackSavePointExecutor { - public: +public: ObRollbackSavePointExecutor() {} virtual ~ObRollbackSavePointExecutor() {} int execute(ObExecContext& ctx, ObRollbackSavePointStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRollbackSavePointExecutor); }; class ObReleaseSavePointStmt; class ObReleaseSavePointExecutor { - public: +public: ObReleaseSavePointExecutor() {} virtual ~ObReleaseSavePointExecutor() {} int execute(ObExecContext& ctx, ObReleaseSavePointStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObReleaseSavePointExecutor); }; diff --git a/src/sql/engine/cmd/ob_tenant_executor.h b/src/sql/engine/cmd/ob_tenant_executor.h index de76e934e..afa13aba4 100644 --- a/src/sql/engine/cmd/ob_tenant_executor.h +++ b/src/sql/engine/cmd/ob_tenant_executor.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { #define DEF_SIMPLE_EXECUTOR(name) \ class name##Executor { \ - public: \ + public: \ name##Executor() \ {} \ virtual ~name##Executor() \ {} \ int execute(ObExecContext& ctx, name##Stmt& stmt); \ \ - private: \ + private: \ DISALLOW_COPY_AND_ASSIGN(name##Executor); \ } diff --git a/src/sql/engine/cmd/ob_udf_executor.h b/src/sql/engine/cmd/ob_udf_executor.h index 1264c8fff..d4880581a 100644 --- a/src/sql/engine/cmd/ob_udf_executor.h +++ b/src/sql/engine/cmd/ob_udf_executor.h @@ -28,7 +28,7 @@ class ObExecContext; class ObRawExpr; class ObCreateFuncStmt; class ObCreateFuncExecutor { - public: +public: const static int OB_DEFAULT_ARRAY_SIZE = 16; ObCreateFuncExecutor() {} @@ -36,20 +36,20 @@ class ObCreateFuncExecutor { {} int execute(ObExecContext& ctx, ObCreateFuncStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateFuncExecutor); }; class ObDropFuncStmt; class ObDropFuncExecutor { - public: +public: ObDropFuncExecutor() {} virtual ~ObDropFuncExecutor() {} int execute(ObExecContext& ctx, ObDropFuncStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropFuncExecutor); }; } // namespace sql diff --git a/src/sql/engine/cmd/ob_user_cmd_executor.h b/src/sql/engine/cmd/ob_user_cmd_executor.h index 0c0b1d7d0..a57b4e749 100644 --- a/src/sql/engine/cmd/ob_user_cmd_executor.h +++ b/src/sql/engine/cmd/ob_user_cmd_executor.h @@ -30,7 +30,7 @@ class ObExecContext; class ObCreateUserStmt; class ObDropUserExecutor; class ObCreateUserExecutor { - public: +public: ObCreateUserExecutor() {} virtual ~ObCreateUserExecutor() @@ -42,16 +42,16 @@ class ObCreateUserExecutor { const common::ObIArray& index, common::ObIArray& users, common::ObIArray& hosts); - private: +private: int create_user(obrpc::ObCommonRpcProxy* rpc_proxy, const obrpc::ObCreateUserArg& arg) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateUserExecutor); }; class ObDropUserStmt; class ObDropUserExecutor { - public: +public: ObDropUserExecutor() {} virtual ~ObDropUserExecutor() @@ -63,31 +63,31 @@ class ObDropUserExecutor { common::ObIArray& dst_users, common::ObIArray& dst_hosts); int execute(ObExecContext& ctx, ObDropUserStmt& stmt); - private: +private: int drop_user(obrpc::ObCommonRpcProxy* rpc_proxy, const obrpc::ObDropUserArg& arg); DISALLOW_COPY_AND_ASSIGN(ObDropUserExecutor); }; class ObLockUserStmt; class ObLockUserExecutor { - public: +public: ObLockUserExecutor() {} virtual ~ObLockUserExecutor() {} int execute(ObExecContext& ctx, ObLockUserStmt& stmt); - private: +private: int lock_user(obrpc::ObCommonRpcProxy* rpc_proxy, const obrpc::ObLockUserArg& arg); DISALLOW_COPY_AND_ASSIGN(ObLockUserExecutor); }; class ObAlterUserProfileStmt; class ObAlterUserProfileExecutor { - private: +private: int set_role_exec(ObExecContext& ctx, ObAlterUserProfileStmt& stmt); - public: +public: ObAlterUserProfileExecutor() {} virtual ~ObAlterUserProfileExecutor() @@ -99,28 +99,28 @@ class ObAlterUserProfileExecutor { class ObRenameUserStmt; class ObRenameUserExecutor { - public: +public: ObRenameUserExecutor() {} virtual ~ObRenameUserExecutor() {} int execute(ObExecContext& ctx, ObRenameUserStmt& stmt); - private: +private: int rename_user(obrpc::ObCommonRpcProxy* rpc_proxy, const obrpc::ObRenameUserArg& arg); DISALLOW_COPY_AND_ASSIGN(ObRenameUserExecutor); }; class ObAlterUserPrimaryZoneStmt; class ObAlterUserPrimaryZoneExecutor { - public: +public: ObAlterUserPrimaryZoneExecutor() {} virtual ~ObAlterUserPrimaryZoneExecutor() {} int execute(ObExecContext& ctx, ObAlterUserPrimaryZoneStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterUserPrimaryZoneExecutor); }; diff --git a/src/sql/engine/cmd/ob_variable_set_executor.h b/src/sql/engine/cmd/ob_variable_set_executor.h index 7ca07f578..53bd2d6c0 100644 --- a/src/sql/engine/cmd/ob_variable_set_executor.h +++ b/src/sql/engine/cmd/ob_variable_set_executor.h @@ -29,7 +29,7 @@ class ObExecContext; class ObSQLSessionInfo; class ObPhysicalPlanCtx; class ObVariableSetExecutor { - public: +public: ObVariableSetExecutor(); virtual ~ObVariableSetExecutor(); int execute(ObExecContext& ctx, ObVariableSetStmt& stmt); @@ -43,7 +43,7 @@ class ObVariableSetExecutor { static int switch_to_session_variable( const common::ObExprCtx& expr_ctx, const common::ObObj& value, ObSessionVariable& sess_var); - private: +private: int process_session_autocommit_hook(ObExecContext& exec_ctx, const common::ObObj& val); int process_auto_increment_hook(const ObSQLMode sql_mode, const common::ObString var_name, common::ObObj& val); int process_last_insert_id_hook( @@ -52,7 +52,7 @@ class ObVariableSetExecutor { int update_global_variables( ObExecContext& ctx, ObDDLStmt& stmt, const share::ObSetVar& set_var, const common::ObObj& value_obj); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVariableSetExecutor); }; } // namespace sql diff --git a/src/sql/engine/cmd/ob_xa_executor.h b/src/sql/engine/cmd/ob_xa_executor.h index c2dd79478..c7afa3bd2 100644 --- a/src/sql/engine/cmd/ob_xa_executor.h +++ b/src/sql/engine/cmd/ob_xa_executor.h @@ -22,83 +22,83 @@ namespace sql { class ObExecContext; class ObXaStartStmt; class ObXaStartExecutor { - public: +public: ObXaStartExecutor() {} ~ObXaStartExecutor() {} int execute(ObExecContext& ctx, ObXaStartStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaStartExecutor); }; class ObPlXaStartExecutor { - public: +public: ObPlXaStartExecutor() {} ~ObPlXaStartExecutor() {} int execute(ObExecContext& ctx, ObXaStartStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlXaStartExecutor); }; class ObXaEndStmt; class ObXaEndExecutor { - public: +public: ObXaEndExecutor() {} ~ObXaEndExecutor() {} int execute(ObExecContext& ctx, ObXaEndStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaEndExecutor); }; class ObPlXaEndExecutor { - public: +public: ObPlXaEndExecutor() {} ~ObPlXaEndExecutor() {} int execute(ObExecContext& ctx, ObXaEndStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlXaEndExecutor); }; class ObXaPrepareStmt; class ObXaPrepareExecutor { - public: +public: ObXaPrepareExecutor() {} ~ObXaPrepareExecutor() {} int execute(ObExecContext& ctx, ObXaPrepareStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaPrepareExecutor); }; class ObPlXaPrepareExecutor { - public: +public: ObPlXaPrepareExecutor() {} ~ObPlXaPrepareExecutor() {} int execute(ObExecContext& ctx, ObXaPrepareStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlXaPrepareExecutor); }; class ObXaCommitStmt; class ObXaRollBackStmt; class ObXaEndTransExecutor { - public: +public: ObXaEndTransExecutor() {} ~ObXaEndTransExecutor() @@ -112,13 +112,13 @@ class ObXaEndTransExecutor { return execute_(stmt.get_xa_string(), true, ctx); } - private: +private: int execute_(const common::ObString& xid, const bool is_rollback, ObExecContext& ctx); DISALLOW_COPY_AND_ASSIGN(ObXaEndTransExecutor); }; class ObPlXaEndTransExecutor { - public: +public: ObPlXaEndTransExecutor() {} ~ObPlXaEndTransExecutor() @@ -134,7 +134,7 @@ class ObPlXaEndTransExecutor { stmt.get_gtrid_string(), stmt.get_bqual_string(), stmt.get_format_id(), true, stmt.get_flags(), ctx); } - private: +private: int execute_(const common::ObString& gtrid_str, const common::ObString& bqual_str, const int64_t format_id, const bool is_rollback, const int64_t flags, ObExecContext& ctx); DISALLOW_COPY_AND_ASSIGN(ObPlXaEndTransExecutor); diff --git a/src/sql/engine/connect_by/ob_cnnt_by_pump.h b/src/sql/engine/connect_by/ob_cnnt_by_pump.h index ac353dce8..1e03551e2 100644 --- a/src/sql/engine/connect_by/ob_cnnt_by_pump.h +++ b/src/sql/engine/connect_by/ob_cnnt_by_pump.h @@ -20,9 +20,9 @@ namespace oceanbase { namespace sql { class ObConnectByOpPumpBase { - private: +private: class MallocWrapper : public common::ObMalloc { - public: + public: explicit MallocWrapper(const char* label) : allocator_(label), alloc_cnt_(0) {} virtual ~MallocWrapper() @@ -49,12 +49,12 @@ class ObConnectByOpPumpBase { allocator_.free(ptr); } - private: + private: common::ObArenaAllocator allocator_; int64_t alloc_cnt_; }; - public: +public: ObConnectByOpPumpBase() : // shallow_row_(), // pump_row_desc_(NULL), @@ -78,10 +78,10 @@ class ObConnectByOpPumpBase { } // virtual int set_connect_by_root_row(const common::ObNewRow *root_row) = 0; - protected: +protected: int deep_copy_row(const common::ObIArray& exprs, const ObChunkDatumStore::StoredRow*& dst_row); - protected: +protected: static const int64_t SYS_PATH_BUFFER_INIT_SIZE = 128; // for init hash set for loop check static const int64_t CONNECT_BY_TREE_HEIGHT = 16; @@ -102,9 +102,9 @@ class ObNLConnectByOp; class ObConnectByOpPump : public ObConnectByOpPumpBase { friend ObNLConnectByOp; - private: +private: class ObHashColumn { - public: + public: ObHashColumn() : row_(NULL), exprs_(NULL), hash_val_(0) {} ObHashColumn(const ObChunkDatumStore::StoredRow* row, const common::ObIArray* exprs) @@ -126,14 +126,14 @@ class ObConnectByOpPump : public ObConnectByOpPumpBase { bool operator==(const ObHashColumn& other) const; - public: + public: const ObChunkDatumStore::StoredRow* row_; const common::ObIArray* exprs_; mutable uint64_t hash_val_; }; class PumpNode { - public: + public: PumpNode() : pump_row_(NULL), output_row_(NULL), @@ -165,7 +165,7 @@ class ObConnectByOpPump : public ObConnectByOpPumpBase { }; typedef common::hash::ObHashSet RowMap; - public: +public: ObConnectByOpPump() : ObConnectByOpPumpBase(), // prior_exprs_result_row_(), @@ -197,7 +197,7 @@ class ObConnectByOpPump : public ObConnectByOpPumpBase { int get_sys_path(uint64_t sys_connect_by_path_id, ObString& parent_path); int concat_sys_path(uint64_t sys_connect_by_path_id, const ObString& cur_path); - private: +private: // int alloc_prior_row_cells(uint64_t row_count); int push_back_node_to_stack(PumpNode& node); int calc_prior_and_check_cycle(PumpNode& node, bool set_refactored, PumpNode* left_node); @@ -215,7 +215,7 @@ class ObConnectByOpPump : public ObConnectByOpPumpBase { return datum_store_constructed_; } - private: +private: static const int64_t SYS_PATH_BUFFER_INIT_SIZE = 128; static const int64_t CONNECT_BY_MAX_NODE_NUM = (2L << 30) / sizeof(PumpNode); ObArray pump_stack_; diff --git a/src/sql/engine/connect_by/ob_cnnt_by_pump_bfs.h b/src/sql/engine/connect_by/ob_cnnt_by_pump_bfs.h index f27bd1255..82ee3e0a4 100644 --- a/src/sql/engine/connect_by/ob_cnnt_by_pump_bfs.h +++ b/src/sql/engine/connect_by/ob_cnnt_by_pump_bfs.h @@ -25,9 +25,9 @@ class ObNLConnectByWithIndexOp; class ObConnectByOpBFSPump : public ObConnectByOpPumpBase { friend ObNLConnectByWithIndexOp; - private: +private: class PathNode { - public: + public: PathNode() : prior_exprs_result_(NULL), paths_(), level_(0) {} ~PathNode() @@ -51,7 +51,7 @@ class ObConnectByOpBFSPump : public ObConnectByOpPumpBase { }; class PumpNode { - public: + public: PumpNode() : pump_row_(NULL), output_row_(NULL), path_node_() {} ~PumpNode() @@ -69,7 +69,7 @@ class ObConnectByOpBFSPump : public ObConnectByOpPumpBase { }; class RowComparer { - public: + public: explicit RowComparer(const common::ObIArray* sort_collations, const common::ObIArray* sort_cmp_funs, int& ret) : sort_collations_(sort_collations), sort_cmp_funs_(sort_cmp_funs), ret_(ret) @@ -78,13 +78,13 @@ class ObConnectByOpBFSPump : public ObConnectByOpPumpBase { {} bool operator()(const PumpNode& pump_node1, const PumpNode& pump_node2); - private: + private: const common::ObIArray* sort_collations_; const common::ObIArray* sort_cmp_funs_; int& ret_; }; - public: +public: ObConnectByOpBFSPump() : ObConnectByOpPumpBase(), pump_stack_(), @@ -118,7 +118,7 @@ class ObConnectByOpBFSPump : public ObConnectByOpPumpBase { void free_memory(); void free_memory_for_rescan(); - private: +private: int push_back_row_to_stack( const common::ObIArray& root_exprs, const common::ObIArray& cur_output_exprs); int free_record_rows(); @@ -129,7 +129,7 @@ class ObConnectByOpBFSPump : public ObConnectByOpPumpBase { int free_path_stack(); int free_pump_node_stack(ObIArray& stack); - private: +private: common::ObArray pump_stack_; common::ObArray path_stack_; common::ObArray sort_stack_; diff --git a/src/sql/engine/connect_by/ob_connect_by_utility.h b/src/sql/engine/connect_by/ob_connect_by_utility.h index 911e77217..1322e7a1a 100644 --- a/src/sql/engine/connect_by/ob_connect_by_utility.h +++ b/src/sql/engine/connect_by/ob_connect_by_utility.h @@ -34,9 +34,9 @@ enum ObConnectByPseudoColumn { typedef common::ObFixedArray ConnectByRowDesc; class ObConnectByPumpBase { - private: +private: class MallocWrapper : public common::ObMalloc { - public: + public: explicit MallocWrapper(const char* label) : allocator_(label), alloc_cnt_(0) {} virtual ~MallocWrapper() @@ -63,12 +63,12 @@ class ObConnectByPumpBase { allocator_.free(ptr); } - private: + private: common::ObArenaAllocator allocator_; int64_t alloc_cnt_; }; - public: +public: ObConnectByPumpBase() : shallow_row_(), pump_row_desc_(NULL), @@ -93,7 +93,7 @@ class ObConnectByPumpBase { } virtual int set_connect_by_root_row(const common::ObNewRow* root_row) = 0; - protected: +protected: int deep_copy_row(const common::ObNewRow& src_row, const common::ObNewRow*& dst_row); int alloc_shallow_row_cells(const ObPhyOperator& left_op); int alloc_shallow_row_projector(const ObPhyOperator& left_op); @@ -101,7 +101,7 @@ class ObConnectByPumpBase { int check_output_pseudo_columns(); int check_pump_row_desc(); - protected: +protected: static const int64_t SYS_PATH_BUFFER_INIT_SIZE = 128; // for init hash set for loop check static const int64_t CONNECT_BY_TREE_HEIGHT = 16; @@ -127,9 +127,9 @@ class ObConnectBy; class ObConnectByPump : public ObConnectByPumpBase { friend ObConnectBy; - private: +private: class ObHashColumn { - public: + public: ObHashColumn() : row_(NULL), expr_ctx_(NULL), hash_val_(0) {} ObHashColumn(const common::ObNewRow* row, common::ObExprCtx* expr_ctx) @@ -161,7 +161,7 @@ class ObConnectByPump : public ObConnectByPumpBase { TO_STRING_KV(K_(row), K_(hash_val)); - public: + public: const common::ObNewRow* row_; common::ObExprCtx* expr_ctx_; mutable uint64_t hash_val_; @@ -292,7 +292,7 @@ class ObConnectByPump : public ObConnectByPumpBase { }; class PumpNode { - public: + public: PumpNode() : pump_row_(NULL), output_row_(NULL), @@ -327,7 +327,7 @@ class ObConnectByPump : public ObConnectByPumpBase { typedef common::hash::ObHashSet RowMap; - public: +public: ObConnectByPump() : ObConnectByPumpBase(), prior_exprs_result_row_(), @@ -370,7 +370,7 @@ class ObConnectByPump : public ObConnectByPumpBase { int calc_hash_value(const ObArray& hash_exprs, const ObNewRow& row, ObExprCtx& expr_ctx, uint64_t& hash_value) const; - private: +private: int alloc_prior_row_cells(uint64_t row_count); int alloc_iter(PumpNode& node); int push_back_node_to_stack(PumpNode& node); @@ -388,7 +388,7 @@ class ObConnectByPump : public ObConnectByPumpBase { return row_store_constructed_; } - private: +private: static const int64_t SYS_PATH_BUFFER_INIT_SIZE = 128; static const int64_t CONNECT_BY_MAX_NODE_NUM = (2L << 30) / sizeof(PumpNode); // record results of connect by prior expressions diff --git a/src/sql/engine/connect_by/ob_connect_by_utility_bfs.h b/src/sql/engine/connect_by/ob_connect_by_utility_bfs.h index 0464b501d..7fe38f0f0 100644 --- a/src/sql/engine/connect_by/ob_connect_by_utility_bfs.h +++ b/src/sql/engine/connect_by/ob_connect_by_utility_bfs.h @@ -23,9 +23,9 @@ class ObConnectByWithIndex; class ObConnectByPumpBFS : public ObConnectByPumpBase { friend ObConnectByWithIndex; - private: +private: class PathNode { - public: + public: PathNode() : prior_exprs_result_(NULL), paths_(), level_(0) {} ~PathNode() @@ -49,7 +49,7 @@ class ObConnectByPumpBFS : public ObConnectByPumpBase { }; class PumpNode { - public: + public: PumpNode() : pump_row_(NULL), output_row_(NULL), path_node_() {} ~PumpNode() @@ -67,19 +67,19 @@ class ObConnectByPumpBFS : public ObConnectByPumpBase { }; class RowComparer { - public: + public: explicit RowComparer(const ObIArray& sort_columns, int& ret) : sort_columns_(sort_columns), ret_(ret) {} ~RowComparer() {} bool operator()(const PumpNode& pump_node1, const PumpNode& pump_node2); - private: + private: const ObIArray& sort_columns_; int& ret_; }; - public: +public: ObConnectByPumpBFS() : ObConnectByPumpBase(), pump_stack_(), @@ -105,7 +105,7 @@ class ObConnectByPumpBFS : public ObConnectByPumpBase { void free_memory(); void free_memory_for_rescan(); - private: +private: int push_back_row_to_stack(const ObNewRow& left_row, const ObNewRow& output_row); int free_record_rows(); int add_path_stack(PathNode& path_node); @@ -115,7 +115,7 @@ class ObConnectByPumpBFS : public ObConnectByPumpBase { int free_path_stack(); int free_pump_node_stack(ObIArray& stack); - private: +private: static const int64_t CONNECT_BY_MAX_NODE_NUM = (2L << 30) / sizeof(PumpNode); ObArray pump_stack_; ObArray path_stack_; diff --git a/src/sql/engine/connect_by/ob_nested_loop_connect_by.h b/src/sql/engine/connect_by/ob_nested_loop_connect_by.h index df8ffa651..55f3f96c7 100644 --- a/src/sql/engine/connect_by/ob_nested_loop_connect_by.h +++ b/src/sql/engine/connect_by/ob_nested_loop_connect_by.h @@ -26,15 +26,15 @@ class ObConnectByBase : public ObBasicNestedLoopJoin { friend ObConnectByPumpBase; OB_UNIS_VERSION_V(1); - protected: +protected: enum ObJoinState { JS_JOIN_END = 0, JS_READ_LEFT, JS_READ_RIGHT, JS_READ_OUTPUT, JS_READ_PUMP, JS_STATE_COUNT }; enum ObFuncType { FT_ITER_GOING = 0, FT_ITER_END, FT_TYPE_COUNT }; - public: +public: class ObConnectByBaseCtx : public ObBasicNestedLoopJoinCtx { friend ObConnectByBase; // friend ObConnectByPumpBase; - public: + public: ObConnectByBaseCtx(ObExecContext& ctx) : ObBasicNestedLoopJoinCtx(ctx), state_(JS_READ_LEFT), @@ -55,12 +55,12 @@ class ObConnectByBase : public ObBasicNestedLoopJoin { virtual int set_sys_current_path( int64_t sys_connect_by_path_id, const ObString& cur_str, const ObString& res_path) = 0; - protected: + protected: int create_null_cell_row(const ObConnectByBase& connect_by); int create_mock_right_row(const ObConnectByBase& connect_by); int init(const ObConnectByBase& connect_by, common::ObExprCtx* join_ctx); - protected: + protected: ObJoinState state_; const common::ObNewRow* root_row_; common::ObNewRow null_cell_row_; // used for root row output @@ -68,7 +68,7 @@ class ObConnectByBase : public ObBasicNestedLoopJoin { bool is_inited_; }; - public: +public: explicit ObConnectByBase(common::ObIAllocator& alloc); virtual ~ObConnectByBase(); virtual void reset(); @@ -96,14 +96,14 @@ class ObConnectByBase : public ObBasicNestedLoopJoin { N_ROOT_ROW_DESC, root_row_desc_, N_PSEUDO_COLUMN_ROW_DESC, pseudo_column_row_desc_, N_CONNECT_BY_PRIOR_EXPRS, connect_by_prior_exprs_); - protected: +protected: int construct_mock_right_row(const ObNewRow& root_row, ObNewRow& mock_right_row) const; int construct_root_output_row(ObConnectByBaseCtx& join_ctx, const ObNewRow*& output_row) const; int calc_connect_by_root_exprs(ObConnectByBaseCtx& join_ctx, ObNewRow* root_row, const ObNewRow* output_row) const; int calc_sys_connect_by_path(ObConnectByBaseCtx& join_ctx, ObNewRow* output_row) const; - protected: +protected: // idx, used to get param from phy plan. common::ObFixedArray level_params_; // Use to store sys connect by path sql expression. @@ -115,14 +115,14 @@ class ObConnectBy : public ObConnectByBase { friend ObConnectByPump; OB_UNIS_VERSION_V(1); - public: +public: class ObConnectByCtx : public ObConnectByBaseCtx { friend ObConnectBy; friend ObExprSysConnectByPath; friend ObExprPrior; friend ObConnectByPump; - public: + public: ObConnectByCtx(ObExecContext& ctx) : ObConnectByBaseCtx(ctx), connect_by_pump_(), @@ -156,10 +156,10 @@ class ObConnectBy : public ObConnectByBase { return sql_mem_processor_.get_data_size() > sql_mem_processor_.get_mem_bound(); } - private: + private: int init(const ObConnectBy& connect_by, common::ObExprCtx* join_ctx); - private: + private: ObConnectByPump connect_by_pump_; lib::MemoryContext* mem_context_; ObSqlWorkAreaProfile profile_; @@ -185,7 +185,7 @@ class ObConnectBy : public ObConnectByBase { common::ObCollationType ctype_; // collation type }; - public: +public: explicit ObConnectBy(common::ObIAllocator& alloc); virtual ~ObConnectBy(); virtual int rescan(ObExecContext& exec_ctx) const override; @@ -207,7 +207,7 @@ class ObConnectBy : public ObConnectByBase { return equal_cond_infos_.push_back(EqualConditionInfo(cmp_type, ctype)); } - private: +private: int inner_open(ObExecContext& exec_ctx) const override; int inner_get_next_row(ObExecContext& exec_ctx, const ObNewRow*& row) const override; int inner_create_operator_ctx(ObExecContext& exec_ctx, ObPhyOperatorCtx*& op_ctx) const override; @@ -244,7 +244,7 @@ class ObConnectBy : public ObConnectByBase { int add_pseudo_column(ObConnectByCtx& join_ctx, ObConnectByPump::PumpNode& node) const; - private: +private: // state operations and transfer functions array. state_operation_func_type state_operation_func_[JS_STATE_COUNT]; state_function_func_type state_function_func_[JS_STATE_COUNT][FT_TYPE_COUNT]; diff --git a/src/sql/engine/connect_by/ob_nested_loop_connect_by_with_index.h b/src/sql/engine/connect_by/ob_nested_loop_connect_by_with_index.h index 07c36cc23..8c8e7d7ca 100644 --- a/src/sql/engine/connect_by/ob_nested_loop_connect_by_with_index.h +++ b/src/sql/engine/connect_by/ob_nested_loop_connect_by_with_index.h @@ -24,11 +24,11 @@ class ObExprPrior; class ObConnectByWithIndex : public ObConnectByBase { OB_UNIS_VERSION_V(1); - public: +public: class ObConnectByWithIndexCtx : public ObConnectByBaseCtx { friend ObConnectByWithIndex; - public: + public: ObConnectByWithIndexCtx(ObExecContext& ctx) : ObConnectByBaseCtx(ctx), output_row_(NULL), connect_by_pump_(), is_match_(false), is_cycle_(false) {} @@ -53,17 +53,17 @@ class ObConnectByWithIndex : public ObConnectByBase { return connect_by_pump_.set_cur_node_path(sys_connect_by_path_id, res_path); } - private: + private: int init(const ObConnectByWithIndex& connect_by, common::ObExprCtx* join_ctx); - private: + private: const ObNewRow* output_row_; ObConnectByPumpBFS connect_by_pump_; bool is_match_; // whether there is a child, for calc connect_by_isleaf bool is_cycle_; // whether part of a cycle, for calc connect_by_iscycle }; - public: +public: explicit ObConnectByWithIndex(common::ObIAllocator& alloc); virtual ~ObConnectByWithIndex(); int rescan(ObExecContext& exec_ctx) const override; @@ -72,7 +72,7 @@ class ObConnectByWithIndex : public ObConnectByBase { return need_sort_siblings_; } - private: +private: int inner_open(ObExecContext& exec_ctx) const override; int inner_get_next_row(ObExecContext& exec_ctx, const ObNewRow*& row) const override; int inner_create_operator_ctx(ObExecContext& exec_ctx, ObPhyOperatorCtx*& op_ctx) const override; @@ -109,7 +109,7 @@ class ObConnectByWithIndex : public ObConnectByBase { ObConnectByWithIndexCtx& join_ctx, ObNewRow* output_row, ObConnectByPseudoColumn column_type) const; int calc_sort_siblings_expr(ObConnectByWithIndexCtx& join_ctx, ObNewRow* output_row) const; - private: +private: // state operations and transfer functions array. state_operation_func_type state_operation_func_[JS_STATE_COUNT]; state_function_func_type state_function_func_[JS_STATE_COUNT][FT_TYPE_COUNT]; diff --git a/src/sql/engine/connect_by/ob_nl_cnnt_by_op.h b/src/sql/engine/connect_by/ob_nl_cnnt_by_op.h index e95f02381..196c0547c 100644 --- a/src/sql/engine/connect_by/ob_nl_cnnt_by_op.h +++ b/src/sql/engine/connect_by/ob_nl_cnnt_by_op.h @@ -24,7 +24,7 @@ namespace sql { class ObNLConnectBySpecBase : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObNLConnectBySpecBase(common::ObIAllocator& alloc, const ObPhyOperatorType type); virtual ~ObNLConnectBySpecBase() {} @@ -33,7 +33,7 @@ class ObNLConnectBySpecBase : public ObOpSpec { return sys_connect_exprs_.count(); } - protected: +protected: enum ObCnntByOpState { CNTB_STATE_JOIN_END = 0, CNTB_STATE_READ_OUTPUT, @@ -44,7 +44,7 @@ class ObNLConnectBySpecBase : public ObOpSpec { }; enum ObFuncType { FT_ITER_GOING = 0, FT_ITER_END, FT_TYPE_COUNT }; - public: +public: common::ObCmpFuncs cmp_funcs_; ExprFixedArray sort_siblings_exprs_; ExprFixedArray connect_by_root_exprs_; @@ -70,7 +70,7 @@ class ObNLConnectBySpecBase : public ObOpSpec { }; class ObNLConnectByOpBase : public ObOperator { - protected: +protected: enum ObConnectByPseudoColumn { LEVEL = 0, CONNECT_BY_ISCYCLE = 1, @@ -88,7 +88,7 @@ class ObNLConnectByOpBase : public ObOperator { }; enum ObFuncType { FT_ITER_GOING = 0, FT_ITER_END, FT_TYPE_COUNT }; - public: +public: ObNLConnectByOpBase(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), sys_connect_by_path_id_(INT64_MAX) {} @@ -109,13 +109,13 @@ class ObNLConnectByOpBase : public ObOperator { class ObNLConnectBySpec : public ObNLConnectBySpecBase { OB_UNIS_VERSION_V(1); - public: +public: ObNLConnectBySpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObNLConnectBySpecBase(alloc, type) {} }; class ObNLConnectByOp : public ObNLConnectByOpBase { - public: +public: ObNLConnectByOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); ~ObNLConnectByOp(); @@ -147,7 +147,7 @@ class ObNLConnectByOp : public ObNLConnectByOpBase { } int calc_pseudo_flags(ObConnectByOpPump::PumpNode& node); - private: +private: typedef int (ObNLConnectByOp::*state_operation_func_type)(); typedef int (ObNLConnectByOp::*state_function_func_type)(); @@ -182,10 +182,10 @@ class ObNLConnectByOp : public ObNLConnectByOpBase { int init(); - public: +public: ObConnectByOpPump connect_by_pump_; - private: +private: // state operations and transfer functions array. state_operation_func_type state_operation_func_[CNTB_STATE_STATE_COUNT]; state_function_func_type state_function_func_[CNTB_STATE_STATE_COUNT][FT_TYPE_COUNT]; diff --git a/src/sql/engine/connect_by/ob_nl_cnnt_by_with_index_op.h b/src/sql/engine/connect_by/ob_nl_cnnt_by_with_index_op.h index 1d0367edf..9d46b2041 100644 --- a/src/sql/engine/connect_by/ob_nl_cnnt_by_with_index_op.h +++ b/src/sql/engine/connect_by/ob_nl_cnnt_by_with_index_op.h @@ -25,14 +25,14 @@ namespace sql { class ObNLConnectByWithIndexSpec : public ObNLConnectBySpecBase { OB_UNIS_VERSION_V(1); - public: +public: ObNLConnectByWithIndexSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObNLConnectBySpecBase(alloc, type) {} }; class ObNLConnectByWithIndexOp : public ObNLConnectByOpBase { - public: +public: ObNLConnectByWithIndexOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); ~ObNLConnectByWithIndexOp(); @@ -63,7 +63,7 @@ class ObNLConnectByWithIndexOp : public ObNLConnectByOpBase { return connect_by_pump_.set_cur_node_path(sys_connect_by_path_id_, res_path); } - private: +private: typedef int (ObNLConnectByWithIndexOp::*state_operation_func_type)(); typedef int (ObNLConnectByWithIndexOp::*state_function_func_type)(); @@ -99,10 +99,10 @@ class ObNLConnectByWithIndexOp : public ObNLConnectByOpBase { int init(); int open_right_child(); - public: +public: ObConnectByOpBFSPump connect_by_pump_; - private: +private: // state operations and transfer functions array. state_operation_func_type state_operation_func_[CNTB_STATE_STATE_COUNT]; state_function_func_type state_function_func_[CNTB_STATE_STATE_COUNT][FT_TYPE_COUNT]; diff --git a/src/sql/engine/dml/ob_duplicated_key_checker.h b/src/sql/engine/dml/ob_duplicated_key_checker.h index b2d1e73dd..43a9c09b7 100644 --- a/src/sql/engine/dml/ob_duplicated_key_checker.h +++ b/src/sql/engine/dml/ob_duplicated_key_checker.h @@ -22,7 +22,7 @@ typedef ObChunkDatumStore DupKeyCheckerDatumRowStore; typedef common::ObRowStore::Iterator DupKeyCheckerRowIter; typedef ObChunkDatumStore::Iterator DupKeyCheckerDatumRowIter; class ObIRowkeyIterator { - public: +public: virtual ~ObIRowkeyIterator() {} virtual int get_next_conflict_row(common::ObNewRow& row) = 0; @@ -129,7 +129,7 @@ struct ObConstraintValue { typedef common::hash::ObHashMap ObUniqueConstraintCtx; class ObDupKeyCheckerCtx { - public: +public: friend class ObDuplicatedKeyChecker; static const int64_t ROW_BATCH_SIZE = 512; struct PartRowStore { @@ -141,7 +141,7 @@ class ObDupKeyCheckerCtx { ObChunkDatumStore* datum_store_; }; - public: +public: ObDupKeyCheckerCtx(common::ObIAllocator& allocator, common::ObExprCtx* expr_ctx, ObDMLMiniTaskExecutor& index_executor, DupKeyCheckerRowStore* checker_row_store, ObEvalCtx* eval_ctx = NULL, DupKeyCheckerDatumRowStore* checker_datum_row_store = NULL); @@ -207,10 +207,10 @@ class ObDupKeyCheckerCtx { template int shuffle_final_data(ObExecContext& ctx, const ObExprPtrIArray& output_exprs, ShuffleOp& shuffle_op); - private: +private: int create_mini_task_info(ObTaskInfo*& task_info); - private: +private: common::ObIAllocator& allocator_; common::ObExprCtx* expr_ctx_; ObEvalCtx* eval_ctx_; @@ -281,9 +281,9 @@ class ObDupKeyCheckerCtx { * Task to get other column data corresponding to this part of rowkey */ class ObDuplicatedKeyChecker { - private: +private: class ObUniqueIndexRowkeyIter : public ObIRowkeyIterator { - public: + public: ObUniqueIndexRowkeyIter(common::ObIAllocator& allocator, common::ObExprCtx* expr_ctx, DupKeyCheckerRowIter checker_row_iter, const ObUniqueIndexScanInfo& index_info) : allocator_(allocator), @@ -315,7 +315,7 @@ class ObDuplicatedKeyChecker { return iter_output_; }; - private: + private: common::ObIAllocator& allocator_; common::ObExprCtx* expr_ctx_; const ObUniqueIndexScanInfo& index_info_; @@ -327,7 +327,7 @@ class ObDuplicatedKeyChecker { }; class ObPrimaryRowkeyIter : public ObIRowkeyIterator { - public: + public: ObPrimaryRowkeyIter(common::ObRowStore::Iterator rowkey_iter, ObDupKeyCheckerCtx& checker_ctx) : rowkey_iter_(rowkey_iter), checker_ctx_(checker_ctx), iter_output_(NULL), eval_ctx_(NULL) {} @@ -344,7 +344,7 @@ class ObDuplicatedKeyChecker { }; int init(ObChunkDatumStore* datum_store); - private: + private: common::ObRowStore::Iterator rowkey_iter_; ObDupKeyCheckerCtx& checker_ctx_; // for static engine @@ -353,7 +353,7 @@ class ObDuplicatedKeyChecker { ObEvalCtx* eval_ctx_; }; - public: +public: ObDuplicatedKeyChecker() : unique_index_cnt_(0), phy_plan_(NULL), @@ -427,7 +427,7 @@ class ObDuplicatedKeyChecker { template int shuffle_final_data(ObExecContext& ctx, ObDupKeyCheckerCtx& checker_ctx, const ShuffleOp& shuffle_op) const; - private: +private: int build_conflict_row_task_info(const ObUniqueIndexScanInfo& index_info, ObExecContext& ctx, ObIRowkeyIterator& rowkey_iter, ObDupKeyCheckerCtx& checker_ctx) const; int build_conflict_row_task_info_list(ObExecContext& ctx, ObDupKeyCheckerCtx& checker_ctx) const; @@ -441,7 +441,7 @@ class ObDuplicatedKeyChecker { int extract_rowkey_info(const ObPhyUniqueConstraintInfo& constraint_info, ObEvalCtx& eval_ctx, char* buf, int64_t buf_len, const ObTimeZoneInfo* tz_info) const; - private: +private: int64_t unique_index_cnt_; const ObPhysicalPlan* phy_plan_; // primary and local unique index scan plan root diff --git a/src/sql/engine/dml/ob_multi_dml_plan_mgr.cpp b/src/sql/engine/dml/ob_multi_dml_plan_mgr.cpp index fb9079d45..3c2b1db6d 100644 --- a/src/sql/engine/dml/ob_multi_dml_plan_mgr.cpp +++ b/src/sql/engine/dml/ob_multi_dml_plan_mgr.cpp @@ -22,7 +22,7 @@ using namespace common; using namespace share; namespace sql { class ObMultiDMLPlanMgr::ServerOpInfo { - public: +public: ServerOpInfo() {} inline void reset() diff --git a/src/sql/engine/dml/ob_multi_dml_plan_mgr.h b/src/sql/engine/dml/ob_multi_dml_plan_mgr.h index cd8798581..d9c33d1d0 100644 --- a/src/sql/engine/dml/ob_multi_dml_plan_mgr.h +++ b/src/sql/engine/dml/ob_multi_dml_plan_mgr.h @@ -21,7 +21,7 @@ struct ObTableDMLCtx; class ObMultiDMLPlanMgr { struct PartValuesInfo { - public: + public: PartValuesInfo() : datum_store_(NULL), row_store_(NULL), @@ -42,7 +42,7 @@ class ObMultiDMLPlanMgr { typedef common::ObSEArray IndexSubPlanInfo; typedef common::ObArrayWrap TableSubPlanInfo; - public: +public: ObMultiDMLPlanMgr(common::ObIAllocator& allocator) : allocator_(allocator), exec_ctx_(NULL), @@ -77,7 +77,7 @@ class ObMultiDMLPlanMgr { return table_need_first_; } - private: +private: int get_or_create_part_subplan_info(int64_t table_idx, int64_t index_idx, int64_t part_idx, int64_t op, PartValuesInfo*& part_subplan_info, bool is_static_engine = false); int get_server_op_info( @@ -87,7 +87,7 @@ class ObMultiDMLPlanMgr { const ServerOpInfo table_op, const ObJobID& ob_job_id, uint64_t task_id, ObTaskInfo& task_info); int allocate_mini_task_info(ObTaskInfo*& task_info); - private: +private: common::ObIAllocator& allocator_; ObExecContext* exec_ctx_; common::ObIArrayWrap* table_dml_ctxs_; diff --git a/src/sql/engine/dml/ob_multi_part_delete.cpp b/src/sql/engine/dml/ob_multi_part_delete.cpp index 3940d0297..9a96e48f2 100644 --- a/src/sql/engine/dml/ob_multi_part_delete.cpp +++ b/src/sql/engine/dml/ob_multi_part_delete.cpp @@ -23,7 +23,7 @@ namespace sql { class ObMultiPartDelete::ObMultiPartDeleteCtx : public ObTableModifyCtx, public ObMultiDMLCtx { friend class ObMultiPartDelete; - public: +public: explicit ObMultiPartDeleteCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), ObMultiDMLCtx(ctx.get_allocator()) {} diff --git a/src/sql/engine/dml/ob_multi_part_delete.h b/src/sql/engine/dml/ob_multi_part_delete.h index 34049308d..0710c3420 100644 --- a/src/sql/engine/dml/ob_multi_part_delete.h +++ b/src/sql/engine/dml/ob_multi_part_delete.h @@ -18,11 +18,11 @@ namespace sql { class ObMultiPartDelete : public ObTableModify, public ObMultiDMLInfo { class ObMultiPartDeleteCtx; - public: +public: static const int64_t DELETE_OP = 0; static const int64_t DML_OP_CNT = 1; - public: +public: explicit ObMultiPartDelete(common::ObIAllocator& allocator); virtual ~ObMultiPartDelete(); @@ -40,7 +40,7 @@ class ObMultiPartDelete : public ObTableModify, public ObMultiDMLInfo { return true; } - private: +private: /** * @brief open operator, not including children operators. * called by open. diff --git a/src/sql/engine/dml/ob_multi_part_delete_op.h b/src/sql/engine/dml/ob_multi_part_delete_op.h index 59112dc70..15269add1 100644 --- a/src/sql/engine/dml/ob_multi_part_delete_op.h +++ b/src/sql/engine/dml/ob_multi_part_delete_op.h @@ -19,7 +19,7 @@ namespace sql { class ObMultiPartDeleteSpec : public ObTableDeleteSpec, public ObMultiDMLInfo { OB_UNIS_VERSION_V(1); - public: +public: ObMultiPartDeleteSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableDeleteSpec(alloc, type), ObMultiDMLInfo(alloc) {} @@ -37,19 +37,19 @@ class ObMultiPartDeleteSpec : public ObTableDeleteSpec, public ObMultiDMLInfo { }; class ObMultiPartDeleteOp : public ObTableDeleteOp, public ObMultiDMLCtx { - public: +public: static const int64_t DELETE_OP = 0; // There is only one dml operation in multi table delete static const int64_t DML_OP_CNT = 1; - public: +public: ObMultiPartDeleteOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableDeleteOp(ctx, spec, input), ObMultiDMLCtx(ctx.get_allocator()) {} ~ObMultiPartDeleteOp() {} - public: +public: virtual int inner_open() override; virtual int get_next_row() override; virtual int inner_close(); diff --git a/src/sql/engine/dml/ob_multi_part_insert.cpp b/src/sql/engine/dml/ob_multi_part_insert.cpp index d3fd3036e..3e611e012 100644 --- a/src/sql/engine/dml/ob_multi_part_insert.cpp +++ b/src/sql/engine/dml/ob_multi_part_insert.cpp @@ -22,7 +22,7 @@ namespace sql { class ObMultiPartInsert::ObMultiPartInsertCtx : public ObTableInsert::ObTableInsertCtx, public ObMultiDMLCtx { friend class ObMultiPartInsert; - public: +public: explicit ObMultiPartInsertCtx(ObExecContext& ctx) : ObTableInsertCtx(ctx), ObMultiDMLCtx(ctx.get_allocator()) {} ~ObMultiPartInsertCtx() diff --git a/src/sql/engine/dml/ob_multi_part_insert.h b/src/sql/engine/dml/ob_multi_part_insert.h index d20ef3a3b..225b5aec1 100644 --- a/src/sql/engine/dml/ob_multi_part_insert.h +++ b/src/sql/engine/dml/ob_multi_part_insert.h @@ -20,11 +20,11 @@ class ObTableLocation; class ObMultiPartInsert : public ObTableInsert, public ObMultiDMLInfo { class ObMultiPartInsertCtx; - public: +public: static const int64_t INSERT_OP = 0; static const int64_t DML_OP_CNT = 1; - public: +public: explicit ObMultiPartInsert(common::ObIAllocator& alloc); virtual ~ObMultiPartInsert(); @@ -45,7 +45,7 @@ class ObMultiPartInsert : public ObTableInsert, public ObMultiDMLInfo { return true; } - protected: +protected: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -62,7 +62,7 @@ class ObMultiPartInsert : public ObTableInsert, public ObMultiDMLInfo { virtual int inner_close(ObExecContext& ctx) const; int shuffle_insert_row(ObExecContext& ctx, bool& got_row) const; - protected: +protected: // exprs for calculating the inserted row common::ObDList insert_row_exprs_; // projector for building the inserted row diff --git a/src/sql/engine/dml/ob_multi_part_insert_op.h b/src/sql/engine/dml/ob_multi_part_insert_op.h index a15d20e43..5722af9d0 100644 --- a/src/sql/engine/dml/ob_multi_part_insert_op.h +++ b/src/sql/engine/dml/ob_multi_part_insert_op.h @@ -19,7 +19,7 @@ namespace sql { class ObMultiPartInsertSpec : public ObTableInsertSpec, public ObMultiDMLInfo { OB_UNIS_VERSION_V(1); - public: +public: ObMultiPartInsertSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableInsertSpec(alloc, type), ObMultiDMLInfo(alloc) {} @@ -37,11 +37,11 @@ class ObMultiPartInsertSpec : public ObTableInsertSpec, public ObMultiDMLInfo { }; class ObMultiPartInsertOp : public ObTableInsertOp, public ObMultiDMLCtx { - public: +public: static const int64_t INSERT_OP = 0; static const int64_t DML_OP_CNT = 1; - public: +public: ObMultiPartInsertOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableInsertOp(ctx, spec, input), ObMultiDMLCtx(ctx.get_allocator()) {} diff --git a/src/sql/engine/dml/ob_multi_part_lock.cpp b/src/sql/engine/dml/ob_multi_part_lock.cpp index 81b6b1434..7e0445de4 100644 --- a/src/sql/engine/dml/ob_multi_part_lock.cpp +++ b/src/sql/engine/dml/ob_multi_part_lock.cpp @@ -25,7 +25,7 @@ namespace sql { class ObMultiPartLock::ObMultiPartLockCtx : public ObTableModifyCtx, public ObMultiDMLCtx { friend class ObMultiPartLock; - public: +public: explicit ObMultiPartLockCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), ObMultiDMLCtx(ctx.get_allocator()), got_row_(false) {} @@ -46,7 +46,7 @@ class ObMultiPartLock::ObMultiPartLockCtx : public ObTableModifyCtx, public ObMu ObMultiDMLCtx::destroy_ctx(); } - private: +private: bool got_row_; }; diff --git a/src/sql/engine/dml/ob_multi_part_lock.h b/src/sql/engine/dml/ob_multi_part_lock.h index 28742e357..c48b90ca7 100644 --- a/src/sql/engine/dml/ob_multi_part_lock.h +++ b/src/sql/engine/dml/ob_multi_part_lock.h @@ -18,11 +18,11 @@ namespace sql { class ObMultiPartLock : public ObTableModify, public ObMultiDMLInfo { class ObMultiPartLockCtx; - public: +public: static const int64_t LOCK_OP = 0; static const int64_t DML_OP_CNT = 1; - public: +public: explicit ObMultiPartLock(common::ObIAllocator& allocator); virtual ~ObMultiPartLock(); virtual bool is_multi_dml() const @@ -35,7 +35,7 @@ class ObMultiPartLock : public ObTableModify, public ObMultiDMLInfo { return common::OB_SUCCESS; } - private: +private: virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; virtual int inner_close(ObExecContext& ctx) const; virtual int init_op_ctx(ObExecContext& ctx) const; diff --git a/src/sql/engine/dml/ob_multi_part_lock_op.h b/src/sql/engine/dml/ob_multi_part_lock_op.h index 2f6e66041..822750141 100644 --- a/src/sql/engine/dml/ob_multi_part_lock_op.h +++ b/src/sql/engine/dml/ob_multi_part_lock_op.h @@ -18,7 +18,7 @@ namespace sql { class ObMultiPartLockSpec : public ObTableModifySpec, public ObMultiDMLInfo { OB_UNIS_VERSION_V(1); - public: +public: ObMultiPartLockSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableModifySpec(alloc, type), ObMultiDMLInfo(alloc) {} @@ -32,18 +32,18 @@ class ObMultiPartLockSpec : public ObTableModifySpec, public ObMultiDMLInfo { }; class ObMultiPartLockOp : public ObTableModifyOp, public ObMultiDMLCtx { - public: +public: static const int64_t LOCK_OP = 0; static const int64_t DML_OP_CNT = 1; - public: +public: ObMultiPartLockOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableModifyOp(ctx, spec, input), ObMultiDMLCtx(ctx.get_allocator()) {} ~ObMultiPartLockOp() {} - private: +private: virtual int inner_open() override; virtual int inner_close() override; virtual int inner_get_next_row(); @@ -55,7 +55,7 @@ class ObMultiPartLockOp : public ObTableModifyOp, public ObMultiDMLCtx { ObMultiDMLCtx::destroy_ctx(); } - private: +private: bool got_row_ = false; }; } // namespace sql diff --git a/src/sql/engine/dml/ob_multi_part_update.cpp b/src/sql/engine/dml/ob_multi_part_update.cpp index 2ffbcc703..938318666 100644 --- a/src/sql/engine/dml/ob_multi_part_update.cpp +++ b/src/sql/engine/dml/ob_multi_part_update.cpp @@ -24,7 +24,7 @@ namespace sql { class ObMultiPartUpdate::ObMultiPartUpdateCtx : public ObTableModifyCtx, public ObMultiDMLCtx { friend class ObMultiPartUpdate; - public: +public: explicit ObMultiPartUpdateCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), ObMultiDMLCtx(ctx.get_allocator()), found_rows_(0), changed_rows_(0), affected_rows_(0) {} @@ -48,7 +48,7 @@ class ObMultiPartUpdate::ObMultiPartUpdateCtx : public ObTableModifyCtx, public ++affected_rows_; } - private: +private: int64_t found_rows_; int64_t changed_rows_; int64_t affected_rows_; diff --git a/src/sql/engine/dml/ob_multi_part_update.h b/src/sql/engine/dml/ob_multi_part_update.h index 45cfeebaa..2478e2691 100644 --- a/src/sql/engine/dml/ob_multi_part_update.h +++ b/src/sql/engine/dml/ob_multi_part_update.h @@ -18,12 +18,12 @@ namespace sql { class ObMultiPartUpdate : public ObTableModify, public ObMultiDMLInfo { class ObMultiPartUpdateCtx; - public: +public: static const int64_t DELETE_OP = 0; static const int64_t INSERT_OP = 1; static const int64_t UPDATE_OP = 2; static const int64_t DML_OP_CNT = 3; // 3 dml type for multi table update - public: +public: explicit ObMultiPartUpdate(common::ObIAllocator& allocator); virtual ~ObMultiPartUpdate(); @@ -41,7 +41,7 @@ class ObMultiPartUpdate : public ObTableModify, public ObMultiDMLInfo { return true; } - private: +private: /** * @brief open operator, not including children operators. * called by open. diff --git a/src/sql/engine/dml/ob_multi_part_update_op.h b/src/sql/engine/dml/ob_multi_part_update_op.h index d90a86229..080212c04 100644 --- a/src/sql/engine/dml/ob_multi_part_update_op.h +++ b/src/sql/engine/dml/ob_multi_part_update_op.h @@ -19,7 +19,7 @@ namespace sql { class ObMultiPartUpdateSpec : public ObTableUpdateSpec, public ObMultiDMLInfo { OB_UNIS_VERSION_V(1); - public: +public: ObMultiPartUpdateSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableUpdateSpec(alloc, type), ObMultiDMLInfo(alloc) {} @@ -37,12 +37,12 @@ class ObMultiPartUpdateSpec : public ObTableUpdateSpec, public ObMultiDMLInfo { }; class ObMultiPartUpdateOp : public ObTableUpdateOp, public ObMultiDMLCtx { - public: +public: static const int64_t DELETE_OP = 0; static const int64_t INSERT_OP = 1; static const int64_t UPDATE_OP = 2; static const int64_t DML_OP_CNT = 3; // multi table update mybe contain 3 kinds dml op - public: +public: ObMultiPartUpdateOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableUpdateOp(ctx, spec, input), ObMultiDMLCtx(ctx.get_allocator()), @@ -53,7 +53,7 @@ class ObMultiPartUpdateOp : public ObTableUpdateOp, public ObMultiDMLCtx { ~ObMultiPartUpdateOp() {} - public: +public: virtual int inner_open() override; virtual int inner_close() override; virtual int inner_get_next_row(); @@ -79,7 +79,7 @@ class ObMultiPartUpdateOp : public ObTableUpdateOp, public ObMultiDMLCtx { ++affected_rows_; } - private: +private: int64_t found_rows_; int64_t changed_rows_; int64_t affected_rows_; diff --git a/src/sql/engine/dml/ob_multi_table_insert_up.cpp b/src/sql/engine/dml/ob_multi_table_insert_up.cpp index 609d6daaf..a701c9225 100644 --- a/src/sql/engine/dml/ob_multi_table_insert_up.cpp +++ b/src/sql/engine/dml/ob_multi_table_insert_up.cpp @@ -24,7 +24,7 @@ namespace sql { class ObMultiTableInsertUp::ObMultiTableInsertUpCtx : public ObTableInsertUp::ObTableInsertUpCtx, public ObMultiDMLCtx { friend class ObMultiTableInsertUp; - public: +public: explicit ObMultiTableInsertUpCtx(ObExecContext& ctx) : ObTableInsertUpCtx(ctx), ObMultiDMLCtx(ctx.get_allocator()), @@ -52,7 +52,7 @@ class ObMultiTableInsertUp::ObMultiTableInsertUpCtx : public ObTableInsertUp::Ob ++affected_rows_; } - private: +private: common::ObRowStore replace_row_store_; ObDupKeyCheckerCtx dupkey_checker_ctx_; int64_t changed_rows_; diff --git a/src/sql/engine/dml/ob_multi_table_insert_up.h b/src/sql/engine/dml/ob_multi_table_insert_up.h index 820b185bb..5fdc261a0 100644 --- a/src/sql/engine/dml/ob_multi_table_insert_up.h +++ b/src/sql/engine/dml/ob_multi_table_insert_up.h @@ -22,7 +22,7 @@ class ObTableLocation; class ObMultiTableInsertUp : public ObTableInsertUp, public ObMultiDMLInfo { class ObMultiTableInsertUpCtx; - public: +public: // insert a row if there is no duplicate row with all unique index, otherwise // delete and insert a row. static const int64_t DELETE_OP = 0; @@ -30,7 +30,7 @@ class ObMultiTableInsertUp : public ObTableInsertUp, public ObMultiDMLInfo { static const int64_t UPDATE_OP = 2; static const int64_t DML_OP_CNT = 3; - public: +public: explicit ObMultiTableInsertUp(common::ObIAllocator& alloc); virtual ~ObMultiTableInsertUp(); @@ -54,7 +54,7 @@ class ObMultiTableInsertUp : public ObTableInsertUp, public ObMultiDMLInfo { return true; } - protected: +protected: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -75,7 +75,7 @@ class ObMultiTableInsertUp : public ObTableInsertUp, public ObMultiDMLInfo { int shuffle_update_row(ObExecContext& ctx, common::ObPartMgr& part_mgr, ObMultiTableInsertUpCtx& insert_up_ctx, const common::ObNewRow& insert_row, const common::ObNewRow& duplicate_row) const; - private: +private: ObDuplicatedKeyChecker duplicate_key_checker_; }; } // namespace sql diff --git a/src/sql/engine/dml/ob_multi_table_insert_up_op.h b/src/sql/engine/dml/ob_multi_table_insert_up_op.h index 9f10caa99..697a1caff 100644 --- a/src/sql/engine/dml/ob_multi_table_insert_up_op.h +++ b/src/sql/engine/dml/ob_multi_table_insert_up_op.h @@ -21,7 +21,7 @@ namespace sql { class ObMultiTableInsertUpSpec : public ObTableInsertUpSpec, public ObMultiDMLInfo { OB_UNIS_VERSION_V(1); - public: +public: ObMultiTableInsertUpSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableInsertUpSpec(alloc, type), ObMultiDMLInfo(alloc), table_column_exprs_(alloc) {} @@ -37,19 +37,19 @@ class ObMultiTableInsertUpSpec : public ObTableInsertUpSpec, public ObMultiDMLIn return true; } - public: +public: ObDuplicatedKeyChecker duplicate_key_checker_; ExprFixedArray table_column_exprs_; }; class ObMultiTableInsertUpOp : public ObTableInsertUpOp, public ObMultiDMLCtx { - public: +public: static const int64_t DELETE_OP = 0; static const int64_t INSERT_OP = 1; static const int64_t UPDATE_OP = 2; static const int64_t DML_OP_CNT = 3; - public: +public: ObMultiTableInsertUpOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableInsertUpOp(ctx, spec, input), ObMultiDMLCtx(ctx.get_allocator()), @@ -91,7 +91,7 @@ class ObMultiTableInsertUpOp : public ObTableInsertUpOp, public ObMultiDMLCtx { int convert_exprs_to_stored_row(common::ObIAllocator& allocator, ObEvalCtx& eval_ctx, const ObExprPtrIArray& exprs, ObChunkDatumStore::StoredRow*& new_row); - private: +private: ObChunkDatumStore replace_row_store_; ObDupKeyCheckerCtx dupkey_checker_ctx_; int64_t changed_rows_; diff --git a/src/sql/engine/dml/ob_multi_table_merge.cpp b/src/sql/engine/dml/ob_multi_table_merge.cpp index 8ee28aeae..7b9dd5591 100644 --- a/src/sql/engine/dml/ob_multi_table_merge.cpp +++ b/src/sql/engine/dml/ob_multi_table_merge.cpp @@ -28,7 +28,7 @@ namespace sql { class ObMultiTableMerge::ObMultiTableMergeCtx : public ObTableMergeCtx, public ObMultiDMLCtx { friend class ObMultiTableMerge; - public: +public: explicit ObMultiTableMergeCtx(ObExecContext& ctx) : ObTableMergeCtx(ctx), ObMultiDMLCtx(ctx.get_allocator()) {} ~ObMultiTableMergeCtx() diff --git a/src/sql/engine/dml/ob_multi_table_merge.h b/src/sql/engine/dml/ob_multi_table_merge.h index 0be6f22ca..9b7acf3f6 100644 --- a/src/sql/engine/dml/ob_multi_table_merge.h +++ b/src/sql/engine/dml/ob_multi_table_merge.h @@ -21,7 +21,7 @@ namespace sql { class ObMultiTableMergeInput : public ObTableModifyInput { friend class ObMultiTableMerge; - public: +public: ObMultiTableMergeInput() : ObTableModifyInput() {} virtual ~ObMultiTableMergeInput() @@ -31,19 +31,19 @@ class ObMultiTableMergeInput : public ObTableModifyInput { return PHY_MULTI_TABLE_MERGE; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultiTableMergeInput); }; class ObMultiTableMerge : public ObTableMerge, public ObMultiDMLInfo { class ObMultiTableMergeCtx; - public: +public: static const int64_t DELETE_OP = 0; static const int64_t INSERT_OP = 1; static const int64_t DML_OP_CNT = 2; - public: +public: explicit ObMultiTableMerge(common::ObIAllocator& alloc); virtual ~ObMultiTableMerge(); virtual bool is_multi_dml() const @@ -51,7 +51,7 @@ class ObMultiTableMerge : public ObTableMerge, public ObMultiDMLInfo { return true; } - protected: +protected: virtual int inner_open(ObExecContext& ctx) const; virtual int inner_close(ObExecContext& ctx) const; diff --git a/src/sql/engine/dml/ob_multi_table_merge_op.h b/src/sql/engine/dml/ob_multi_table_merge_op.h index efd31e662..f2e6bf55a 100644 --- a/src/sql/engine/dml/ob_multi_table_merge_op.h +++ b/src/sql/engine/dml/ob_multi_table_merge_op.h @@ -20,7 +20,7 @@ namespace sql { class ObMultiTableMergeSpec : public ObTableMergeSpec, public ObMultiDMLInfo { OB_UNIS_VERSION_V(1); - public: +public: ObMultiTableMergeSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableMergeSpec(alloc, type), ObMultiDMLInfo(alloc) {} @@ -33,19 +33,19 @@ class ObMultiTableMergeSpec : public ObTableMergeSpec, public ObMultiDMLInfo { }; class ObMultiTableMergeOp : public ObTableMergeOp, public ObMultiDMLCtx { - public: +public: static const int64_t DELETE_OP = 0; static const int64_t UPDATE_INSERT_OP = 1; static const int64_t INSERT_OP = 2; static const int64_t DML_OP_CNT = 3; - public: +public: ObMultiTableMergeOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableMergeOp(ctx, spec, input), ObMultiDMLCtx(ctx.get_allocator()) {} virtual ~ObMultiTableMergeOp(){}; - protected: +protected: virtual int inner_open() override; virtual int inner_close() override; diff --git a/src/sql/engine/dml/ob_multi_table_replace.cpp b/src/sql/engine/dml/ob_multi_table_replace.cpp index 5a6ef7001..7f2a3d36d 100644 --- a/src/sql/engine/dml/ob_multi_table_replace.cpp +++ b/src/sql/engine/dml/ob_multi_table_replace.cpp @@ -24,7 +24,7 @@ namespace sql { class ObMultiTableReplace::ObMultiTableReplaceCtx : public ObTableReplace::ObTableReplaceCtx, public ObMultiDMLCtx { friend class ObMultiTableReplace; - public: +public: explicit ObMultiTableReplaceCtx(ObExecContext& ctx) : ObTableReplaceCtx(ctx), ObMultiDMLCtx(ctx.get_allocator()), @@ -41,7 +41,7 @@ class ObMultiTableReplace::ObMultiTableReplaceCtx : public ObTableReplace::ObTab replace_row_store_.reset(); } - private: +private: common::ObRowStore replace_row_store_; ObDupKeyCheckerCtx dupkey_checker_ctx_; }; diff --git a/src/sql/engine/dml/ob_multi_table_replace.h b/src/sql/engine/dml/ob_multi_table_replace.h index d648e20c7..851753893 100644 --- a/src/sql/engine/dml/ob_multi_table_replace.h +++ b/src/sql/engine/dml/ob_multi_table_replace.h @@ -23,14 +23,14 @@ class ObTableLocation; class ObMultiTableReplace : public ObTableReplace, public ObMultiDMLInfo { class ObMultiTableReplaceCtx; - public: +public: // insert a row if there is no duplicate row with all unique index, otherwise // delete and insert a row. static const int64_t DELETE_OP = 0; static const int64_t INSERT_OP = 1; static const int64_t DML_OP_CNT = 2; - public: +public: explicit ObMultiTableReplace(common::ObIAllocator& alloc); virtual ~ObMultiTableReplace(); @@ -54,7 +54,7 @@ class ObMultiTableReplace : public ObTableReplace, public ObMultiDMLInfo { return true; } - protected: +protected: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -71,7 +71,7 @@ class ObMultiTableReplace : public ObTableReplace, public ObMultiDMLInfo { int load_replace_row(ObExecContext& ctx, common::ObRowStore& row_store) const; int shuffle_replace_row(ObExecContext& ctx, bool& got_row) const; - private: +private: ObDuplicatedKeyChecker duplicate_key_checker_; }; } // namespace sql diff --git a/src/sql/engine/dml/ob_multi_table_replace_op.h b/src/sql/engine/dml/ob_multi_table_replace_op.h index 5603d712f..ea69d2ffd 100644 --- a/src/sql/engine/dml/ob_multi_table_replace_op.h +++ b/src/sql/engine/dml/ob_multi_table_replace_op.h @@ -22,7 +22,7 @@ namespace sql { class ObMultiTableReplaceSpec : public ObTableReplaceSpec, public ObMultiDMLInfo { OB_UNIS_VERSION_V(1); - public: +public: ObMultiTableReplaceSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableReplaceSpec(alloc, type), ObMultiDMLInfo(alloc) {} @@ -38,17 +38,17 @@ class ObMultiTableReplaceSpec : public ObTableReplaceSpec, public ObMultiDMLInfo return true; } - public: +public: ObDuplicatedKeyChecker duplicate_key_checker_; }; class ObMultiTableReplaceOp : public ObTableReplaceOp, public ObMultiDMLCtx { - public: +public: static const int64_t DELETE_OP = 0; static const int64_t INSERT_OP = 1; static const int64_t DML_OP_CNT = 2; - public: +public: ObMultiTableReplaceOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableReplaceOp(ctx, spec, input), ObMultiDMLCtx(ctx.get_allocator()), @@ -73,7 +73,7 @@ class ObMultiTableReplaceOp : public ObTableReplaceOp, public ObMultiDMLCtx { replace_row_store_.reset(); } - private: +private: ObChunkDatumStore replace_row_store_; ObDupKeyCheckerCtx dupkey_checker_ctx_; }; diff --git a/src/sql/engine/dml/ob_table_append.h b/src/sql/engine/dml/ob_table_append.h index 170a85ce4..3e67bc5ad 100644 --- a/src/sql/engine/dml/ob_table_append.h +++ b/src/sql/engine/dml/ob_table_append.h @@ -23,7 +23,7 @@ class ObPhyTableLocation; class ObTableAppendInput : public ObIPhyOperatorInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableAppendInput() : ObIPhyOperatorInput(), location_idx_(common::OB_INVALID_INDEX) {} virtual ~ObTableAppendInput() = default; @@ -37,7 +37,7 @@ class ObTableAppendInput : public ObIPhyOperatorInput { return location_idx_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableAppendInput); int64_t location_idx_; }; @@ -45,9 +45,9 @@ class ObTableAppendInput : public ObIPhyOperatorInput { class ObTableAppend : public ObSingleChildPhyOperator { OB_UNIS_VERSION(1); - public: +public: class Operator2RowIter : public common::ObNewRowIterator { - public: + public: Operator2RowIter(ObExecContext& ctx, const ObPhyOperator& op) : ctx_(ctx), op_(op) {} @@ -57,7 +57,7 @@ class ObTableAppend : public ObSingleChildPhyOperator { virtual void reset() {} - private: + private: ObExecContext& ctx_; const ObPhyOperator& op_; }; @@ -77,13 +77,13 @@ class ObTableAppend : public ObSingleChildPhyOperator { return table_id_; } - protected: +protected: virtual int inner_open(ObExecContext& ctx) const override; virtual int inner_close(ObExecContext& ctx) const override; int get_part_location(ObExecContext& ctx, const ObPhyTableLocation& table_location, const share::ObPartitionReplicaLocation*& out) const; - protected: +protected: uint64_t table_id_; }; } // end namespace sql diff --git a/src/sql/engine/dml/ob_table_append_local_sort_data.h b/src/sql/engine/dml/ob_table_append_local_sort_data.h index f36596e07..f1b5acb67 100644 --- a/src/sql/engine/dml/ob_table_append_local_sort_data.h +++ b/src/sql/engine/dml/ob_table_append_local_sort_data.h @@ -22,7 +22,7 @@ namespace sql { class ObTableAppendLocalSortDataInput : public ObTableAppendInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableAppendLocalSortDataInput() : ObTableAppendInput(), task_id_() {} virtual ~ObTableAppendLocalSortDataInput() @@ -42,18 +42,18 @@ class ObTableAppendLocalSortDataInput : public ObTableAppendInput { return task_id_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableAppendLocalSortDataInput); ObTaskID task_id_; }; class ObTableAppendLocalSortData : public ObTableAppend { - public: +public: class ObTableAppendLocalSortDataCtx : public ObPhyOperatorCtx { friend class ObTableAppendLocalSortData; - public: - public: + public: + public: explicit ObTableAppendLocalSortDataCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual ~ObTableAppendLocalSortDataCtx() = default; @@ -74,7 +74,7 @@ class ObTableAppendLocalSortData : public ObTableAppend { return &reclaim_macro_block; } - protected: +protected: virtual int inner_open(ObExecContext& ctx) const override; virtual int inner_close(ObExecContext& ctx) const override; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const override; @@ -82,7 +82,7 @@ class ObTableAppendLocalSortData : public ObTableAppend { // called when interm result freed static void reclaim_macro_block(const common::ObNewRow& row); - private: +private: mutable common::ObNewRow row_; mutable bool iter_end_; }; diff --git a/src/sql/engine/dml/ob_table_append_sstable.h b/src/sql/engine/dml/ob_table_append_sstable.h index 107ef6720..6e01db17a 100644 --- a/src/sql/engine/dml/ob_table_append_sstable.h +++ b/src/sql/engine/dml/ob_table_append_sstable.h @@ -22,7 +22,7 @@ namespace sql { class ObTableAppendSSTableInput : public ObTableAppendInput { OB_UNIS_VERSION(1); - public: +public: ObTableAppendSSTableInput() : ObTableAppendInput(), task_id_() {} virtual ~ObTableAppendSSTableInput() @@ -42,17 +42,17 @@ class ObTableAppendSSTableInput : public ObTableAppendInput { task_id_.reset(); } - private: +private: ObTaskID task_id_; DISALLOW_COPY_AND_ASSIGN(ObTableAppendSSTableInput); }; class ObTableAppendSSTable : public ObTableAppend { - public: +public: class ObTableAppendSSTableCtx : public ObPhyOperatorCtx { friend class ObTableAppendSSTable; - public: + public: explicit ObTableAppendSSTableCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual ~ObTableAppendSSTableCtx() = default; @@ -67,7 +67,7 @@ class ObTableAppendSSTable : public ObTableAppend { virtual int init_op_ctx(ObExecContext& ctx) const override; virtual int create_operator_input(ObExecContext& ctx) const override; - protected: +protected: virtual int inner_open(ObExecContext& ctx) const override; virtual int inner_close(ObExecContext& ctx) const override; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const override; diff --git a/src/sql/engine/dml/ob_table_conflict_row_fetcher.h b/src/sql/engine/dml/ob_table_conflict_row_fetcher.h index f53cf2deb..6dbc8ce75 100644 --- a/src/sql/engine/dml/ob_table_conflict_row_fetcher.h +++ b/src/sql/engine/dml/ob_table_conflict_row_fetcher.h @@ -28,7 +28,7 @@ class ObPhyTableLocation; struct ObPartConflictRowStore { OB_UNIS_VERSION(1); - public: +public: ObPartConflictRowStore() : part_key_(), conflict_row_store_(NULL) {} TO_STRING_KV(K_(part_key), KPC_(conflict_row_store)); @@ -41,7 +41,7 @@ class ObTCRFetcherInput : public ObIPhyOperatorInput { friend class ObTableConflictRowFetcher; OB_UNIS_VERSION(1); - public: +public: ObTCRFetcherInput() : ObIPhyOperatorInput(), part_conflict_rows_(), allocator_(NULL) {} virtual ~ObTCRFetcherInput() @@ -57,22 +57,22 @@ class ObTCRFetcherInput : public ObIPhyOperatorInput { virtual int init(ObExecContext& ctx, ObTaskInfo& task_info, const ObPhyOperator& op); void set_deserialize_allocator(common::ObIAllocator* allocator); - private: +private: common::ObSEArray part_conflict_rows_; common::ObIAllocator* allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTCRFetcherInput); }; class ObTableConflictRowFetcher : public ObNoChildrenPhyOperator { OB_UNIS_VERSION(1); - public: +public: class ObTCRFetcherCtx : public ObPhyOperatorCtx { friend class ObTableConflictRowFetcher; - public: + public: explicit ObTCRFetcherCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), duplicated_iter_array_(), curr_row_index_(0), curr_rowkey_id_(0) {} @@ -84,14 +84,14 @@ class ObTableConflictRowFetcher : public ObNoChildrenPhyOperator { duplicated_iter_array_.reset(); } - public: + public: common::ObSEArray duplicated_iter_array_; int64_t curr_row_index_; int64_t curr_rowkey_id_; }; class ObConflictRowIterator : public common::ObNewRowIterator { - public: + public: ObConflictRowIterator(common::ObRowStore::Iterator iter) : row_iter_(iter) {} virtual int get_next_row(common::ObNewRow*& row) override @@ -103,11 +103,11 @@ class ObTableConflictRowFetcher : public ObNoChildrenPhyOperator { row_iter_.reset(); } - private: + private: common::ObRowStore::Iterator row_iter_; }; - public: +public: explicit ObTableConflictRowFetcher(common::ObIAllocator& alloc); ~ObTableConflictRowFetcher(); void set_table_id(uint64_t table_id) @@ -140,7 +140,7 @@ class ObTableConflictRowFetcher : public ObNoChildrenPhyOperator { } int create_operator_input(ObExecContext& ctx) const; - protected: +protected: /** * @brief called by get_next_row(), get a row from the child operator or row_store * @param ctx[in], execute context @@ -168,14 +168,14 @@ class ObTableConflictRowFetcher : public ObNoChildrenPhyOperator { virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; int fetch_conflict_rows(ObExecContext& ctx, storage::ObDMLBaseParam& dml_param) const; - private: +private: uint64_t table_id_; uint64_t index_tid_; common::ObFixedArray conflict_column_ids_; common::ObFixedArray access_column_ids_; bool only_data_table_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableConflictRowFetcher); }; } // namespace sql diff --git a/src/sql/engine/dml/ob_table_conflict_row_fetcher_op.h b/src/sql/engine/dml/ob_table_conflict_row_fetcher_op.h index 8c836330a..4e0f6b3e1 100644 --- a/src/sql/engine/dml/ob_table_conflict_row_fetcher_op.h +++ b/src/sql/engine/dml/ob_table_conflict_row_fetcher_op.h @@ -25,7 +25,7 @@ namespace sql { struct ObPartConflictDatumStore { OB_UNIS_VERSION(1); - public: +public: ObPartConflictDatumStore() : part_key_(), conflict_datum_store_(NULL) {} TO_STRING_KV(K_(part_key), KPC_(conflict_datum_store)); @@ -38,7 +38,7 @@ class ObTCRFetcherOpInput : public ObOpInput { friend class ObTableConflictRowFetcherOp; OB_UNIS_VERSION(1); - public: +public: ObTCRFetcherOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObOpInput(ctx, spec), part_conflict_rows_(), alloc_(NULL) {} @@ -54,16 +54,16 @@ class ObTCRFetcherOpInput : public ObOpInput { alloc_ = alloc; } - private: +private: common::ObSEArray part_conflict_rows_; common::ObIAllocator* alloc_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTCRFetcherOpInput); }; class ObConflictDatumIterator : public common::ObNewRowIterator { - public: +public: ObConflictDatumIterator(const ObExpr* const* exprs, int64_t col_cnt, ObIAllocator* alloc) : exprs_(exprs), col_cnt_(col_cnt), alloc_(alloc) {} @@ -78,7 +78,7 @@ class ObConflictDatumIterator : public common::ObNewRowIterator { } int init(sql::ObChunkDatumStore* conflict_datum_store); - private: +private: const ObExpr* const* exprs_; int64_t col_cnt_; ObIAllocator* alloc_; @@ -89,7 +89,7 @@ class ObConflictDatumIterator : public common::ObNewRowIterator { class ObTableConflictRowFetcherSpec : public ObOpSpec { OB_UNIS_VERSION(1); - public: +public: ObTableConflictRowFetcherSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), table_id_(common::OB_INVALID_ID), @@ -101,7 +101,7 @@ class ObTableConflictRowFetcherSpec : public ObOpSpec { only_data_table_(false) {} - public: +public: uint64_t table_id_; uint64_t index_tid_; common::ObFixedArray conf_col_ids_; @@ -110,12 +110,12 @@ class ObTableConflictRowFetcherSpec : public ObOpSpec { ExprFixedArray access_exprs_; bool only_data_table_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableConflictRowFetcherSpec); }; class ObTableConflictRowFetcherOp : public ObOperator { - public: +public: ObTableConflictRowFetcherOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(ctx, spec, input), dup_row_iter_arr_(), @@ -133,7 +133,7 @@ class ObTableConflictRowFetcherOp : public ObOperator { dup_row_iter_arr_.reset(); } - private: +private: int fetch_conflict_rows(storage::ObDMLBaseParam& dml_para); DISALLOW_COPY_AND_ASSIGN(ObTableConflictRowFetcherOp); diff --git a/src/sql/engine/dml/ob_table_delete.h b/src/sql/engine/dml/ob_table_delete.h index 61f855565..3c3fbe937 100644 --- a/src/sql/engine/dml/ob_table_delete.h +++ b/src/sql/engine/dml/ob_table_delete.h @@ -19,7 +19,7 @@ namespace sql { class ObTableDeleteInput : public ObTableModifyInput { friend class ObTableDelete; - public: +public: ObTableDeleteInput() : ObTableModifyInput() {} virtual ~ObTableDeleteInput() @@ -29,16 +29,16 @@ class ObTableDeleteInput : public ObTableModifyInput { return PHY_DELETE; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableDeleteInput); }; class ObTableDelete : public ObTableModify { - protected: +protected: class ObTableDeleteCtx : public ObTableModifyCtx { friend class ObTableDelete; - public: + public: explicit ObTableDeleteCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), part_row_cnt_(0), dml_param_() {} ~ObTableDeleteCtx() @@ -50,19 +50,19 @@ class ObTableDelete : public ObTableModify { part_infos_.reset(); } - protected: + protected: int64_t part_row_cnt_; storage::ObDMLBaseParam dml_param_; common::ObSEArray part_infos_; }; - public: +public: explicit ObTableDelete(common::ObIAllocator& alloc); ~ObTableDelete(); int add_compute(ObColumnExpression* expr); - protected: +protected: /** * @brief called by get_next_row(), get a row from the child operator or row_store * @param ctx[in], execute context @@ -76,7 +76,7 @@ class ObTableDelete : public ObTableModify { */ virtual int inner_open(ObExecContext& ctx) const; - private: +private: /** * @brief close operator, not including children operators. * Every op should implement this method. @@ -94,7 +94,7 @@ class ObTableDelete : public ObTableModify { const common::ObIArray& part_infos, int64_t& affected_rows) const; inline int do_table_delete(ObExecContext& ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableDelete); }; } // namespace sql diff --git a/src/sql/engine/dml/ob_table_delete_op.h b/src/sql/engine/dml/ob_table_delete_op.h index 4b1af4d7d..4e83059c2 100644 --- a/src/sql/engine/dml/ob_table_delete_op.h +++ b/src/sql/engine/dml/ob_table_delete_op.h @@ -21,16 +21,16 @@ namespace sql { class ObTableDeleteSpec : public ObTableModifySpec { OB_UNIS_VERSION(1); - public: +public: ObTableDeleteSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableModifySpec(alloc, type) {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableDeleteSpec); }; class ObTableDeleteOp : public ObTableModifyOp { - public: +public: ObTableDeleteOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableModifyOp(exec_ctx, spec, input), part_row_cnt_(0) {} @@ -44,7 +44,7 @@ class ObTableDeleteOp : public ObTableModifyOp { ObTableModifyOp::destroy(); } - protected: +protected: virtual int inner_open() override; virtual int inner_get_next_row() override; virtual int prepare_next_storage_row(const ObExprPtrIArray*& output) override; @@ -53,7 +53,7 @@ class ObTableDeleteOp : public ObTableModifyOp { int do_table_delete(); int delete_rows(int64_t& affected_rows); - protected: +protected: common::ObSEArray part_infos_; storage::ObDMLBaseParam dml_param_; int64_t part_row_cnt_; @@ -63,7 +63,7 @@ class ObTableDeleteOp : public ObTableModifyOp { class ObTableDeleteOpInput : public ObTableModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableDeleteOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableModifyOpInput(ctx, spec) {} int init(ObTaskInfo& task_info) override @@ -71,7 +71,7 @@ class ObTableDeleteOpInput : public ObTableModifyOpInput { return ObTableModifyOpInput::init(task_info); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableDeleteOpInput); }; diff --git a/src/sql/engine/dml/ob_table_delete_returning.cpp b/src/sql/engine/dml/ob_table_delete_returning.cpp index 35c5288a3..739ffa6c7 100644 --- a/src/sql/engine/dml/ob_table_delete_returning.cpp +++ b/src/sql/engine/dml/ob_table_delete_returning.cpp @@ -23,7 +23,7 @@ using namespace storage; using namespace share; namespace sql { class ObTableDeleteReturning::ObTableDeleteReturningCtx : public ObTableDeleteCtx { - public: +public: explicit ObTableDeleteReturningCtx(ObExecContext& ctx) : ObTableDeleteCtx(ctx) {} ~ObTableDeleteReturningCtx() diff --git a/src/sql/engine/dml/ob_table_delete_returning.h b/src/sql/engine/dml/ob_table_delete_returning.h index 11366e811..cf50d505c 100644 --- a/src/sql/engine/dml/ob_table_delete_returning.h +++ b/src/sql/engine/dml/ob_table_delete_returning.h @@ -22,7 +22,7 @@ namespace sql { class ObTableDeleteReturningInput : public ObTableModifyInput { friend class ObTableDeleteReturning; - public: +public: ObTableDeleteReturningInput() : ObTableModifyInput() {} virtual ~ObTableDeleteReturningInput() @@ -32,23 +32,23 @@ class ObTableDeleteReturningInput : public ObTableModifyInput { return PHY_DELETE_RETURNING; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableDeleteReturningInput); }; class ObTableDeleteReturning : public ObTableDelete { class ObTableDeleteReturningCtx; - public: +public: explicit ObTableDeleteReturning(common::ObIAllocator& alloc); ~ObTableDeleteReturning(); - private: +private: virtual int inner_open(ObExecContext& ctx) const override; virtual int get_next_row(ObExecContext& ctx, const ObNewRow*& row) const override; virtual int init_op_ctx(ObExecContext& ctx) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableDeleteReturning); }; diff --git a/src/sql/engine/dml/ob_table_delete_returning_op.h b/src/sql/engine/dml/ob_table_delete_returning_op.h index f99a0ae19..03dc20f79 100644 --- a/src/sql/engine/dml/ob_table_delete_returning_op.h +++ b/src/sql/engine/dml/ob_table_delete_returning_op.h @@ -22,19 +22,19 @@ namespace sql { class ObTableDeleteReturningSpec : public ObTableDeleteSpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableDeleteReturningSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableDeleteSpec(alloc, type) {} virtual ~ObTableDeleteReturningSpec() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableDeleteReturningSpec); }; class ObTableDeleteReturningOp : public ObTableDeleteOp { - public: +public: ObTableDeleteReturningOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableDeleteOp(ctx, spec, input), partition_service_(NULL), @@ -45,11 +45,11 @@ class ObTableDeleteReturningOp : public ObTableDeleteOp { virtual ~ObTableDeleteReturningOp() {} - protected: +protected: virtual int get_next_row() override; virtual int inner_open() override; - private: +private: storage::ObPartitionService* partition_service_; // the following three members is for interface of old engine int64_t child_row_count_; @@ -59,7 +59,7 @@ class ObTableDeleteReturningOp : public ObTableDeleteOp { class ObTableDeleteReturningOpInput : public ObTableModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableDeleteReturningOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableModifyOpInput(ctx, spec) {} @@ -68,7 +68,7 @@ class ObTableDeleteReturningOpInput : public ObTableModifyOpInput { return ObTableModifyOpInput::init(task_info); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableDeleteReturningOpInput); }; diff --git a/src/sql/engine/dml/ob_table_insert.h b/src/sql/engine/dml/ob_table_insert.h index dc77fcff7..dcd6af80e 100644 --- a/src/sql/engine/dml/ob_table_insert.h +++ b/src/sql/engine/dml/ob_table_insert.h @@ -23,7 +23,7 @@ class ObPhyTableLocation; class ObTableInsertInput : public ObTableModifyInput { friend class ObTableUpdate; - public: +public: ObTableInsertInput() : ObTableModifyInput() {} virtual ~ObTableInsertInput() @@ -33,16 +33,16 @@ class ObTableInsertInput : public ObTableModifyInput { return PHY_INSERT; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableInsertInput); }; class ObTableInsert : public ObTableModify { - public: +public: class ObTableInsertCtx : public ObTableModifyCtx { friend class ObTableInsert; - public: + public: explicit ObTableInsertCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), curr_row_num_(0), @@ -64,7 +64,7 @@ class ObTableInsert : public ObTableModify { part_infos_.reset(); } - public: + public: int64_t curr_row_num_; int64_t estimate_rows_; bool first_bulk_; @@ -76,7 +76,7 @@ class ObTableInsert : public ObTableModify { int64_t new_row_projector_size_; }; - public: +public: explicit ObTableInsert(common::ObIAllocator& alloc); ~ObTableInsert(); @@ -87,7 +87,7 @@ class ObTableInsert : public ObTableModify { return common::OB_ITER_END; } - protected: +protected: /** * @brief called by get_next_row(), get a row from the child operator or row_store * @param ctx[in], execute context @@ -128,11 +128,11 @@ class ObTableInsert : public ObTableModify { int copy_insert_row( ObTableInsertCtx& insert_ctx, const ObNewRow*& input_row, ObNewRow& insert_row, bool need_copy) const; - private: +private: int do_table_insert(ObExecContext& ctx) const; int copy_insert_rows(ObTableInsertCtx& insert_ctx, const ObNewRow*& input_row) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableInsert); }; } // namespace sql diff --git a/src/sql/engine/dml/ob_table_insert_all.cpp b/src/sql/engine/dml/ob_table_insert_all.cpp index 1cb8b406d..dc5263c90 100644 --- a/src/sql/engine/dml/ob_table_insert_all.cpp +++ b/src/sql/engine/dml/ob_table_insert_all.cpp @@ -22,7 +22,7 @@ namespace sql { class ObMultiTableInsert::ObMultiTableInsertCtx : public ObTableInsert::ObTableInsertCtx, public ObMultiDMLCtx { friend class ObMultiTableInsert; - public: +public: explicit ObMultiTableInsertCtx(ObExecContext& ctx) : ObTableInsertCtx(ctx), ObMultiDMLCtx(ctx.get_allocator()) {} ~ObMultiTableInsertCtx() diff --git a/src/sql/engine/dml/ob_table_insert_all.h b/src/sql/engine/dml/ob_table_insert_all.h index 2f424fd54..aa4741143 100644 --- a/src/sql/engine/dml/ob_table_insert_all.h +++ b/src/sql/engine/dml/ob_table_insert_all.h @@ -19,7 +19,7 @@ namespace sql { class InsertTableInfo { friend class ObMultiTableInsert; - public: +public: InsertTableInfo() : check_constraint_exprs_(), virtual_column_exprs_(), match_conds_exprs_(), when_conds_idx_(-1) {} virtual ~InsertTableInfo() @@ -61,11 +61,11 @@ class ObTableLocation; class ObMultiTableInsert : public ObTableInsert, public ObMultiDMLInfo { class ObMultiTableInsertCtx; - public: +public: static const int64_t INSERT_OP = 0; static const int64_t DML_OP_CNT = 1; - public: +public: explicit ObMultiTableInsert(common::ObIAllocator& alloc); virtual ~ObMultiTableInsert(); @@ -108,7 +108,7 @@ class ObMultiTableInsert : public ObTableInsert, public ObMultiDMLInfo { return true; } - protected: +protected: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -128,7 +128,7 @@ class ObMultiTableInsert : public ObTableInsert, public ObMultiDMLInfo { int prepare_insert_row(const ObNewRow* input_row, const DMLSubPlan& insert_dml_sub, ObNewRow& new_row) const; int deep_copy_rows(ObMultiTableInsertCtx*& insert_ctx, const ObNewRow& row, ObNewRow& new_row) const; - private: +private: bool is_multi_insert_first_; common::ObFixedArray multi_table_insert_infos_; }; diff --git a/src/sql/engine/dml/ob_table_insert_op.h b/src/sql/engine/dml/ob_table_insert_op.h index 19920dfb4..0c70fa2d7 100644 --- a/src/sql/engine/dml/ob_table_insert_op.h +++ b/src/sql/engine/dml/ob_table_insert_op.h @@ -20,16 +20,16 @@ namespace sql { class ObTableInsertSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableInsertSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableModifySpec(alloc, type) {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableInsertSpec); }; class ObTableInsertOp : public ObTableModifyOp { - public: +public: ObTableInsertOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableModifyOp(ctx, spec, input), curr_row_num_(0), part_row_cnt_(0), is_end_(false) {} @@ -43,7 +43,7 @@ class ObTableInsertOp : public ObTableModifyOp { ObTableModifyOp::destroy(); } - protected: +protected: virtual int inner_open() override; virtual int inner_get_next_row() override; virtual int rescan() override; @@ -54,7 +54,7 @@ class ObTableInsertOp : public ObTableModifyOp { storage::ObDMLBaseParam& dml_param, const common::ObIArray& part_infos, int64_t& affected_rows); int do_table_insert(); - public: +public: int64_t curr_row_num_; int64_t part_row_cnt_; storage::ObDMLBaseParam dml_param_; @@ -63,14 +63,14 @@ class ObTableInsertOp : public ObTableModifyOp { // we set this flag = true to avoid call child_->get_next_row() after OB_ITER_END bool is_end_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableInsertOp); }; class ObTableInsertOpInput : public ObTableModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableInsertOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableModifyOpInput(ctx, spec) {} int init(ObTaskInfo& task_info) override @@ -78,12 +78,12 @@ class ObTableInsertOpInput : public ObTableModifyOpInput { return ObTableModifyOpInput::init(task_info); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableInsertOpInput); }; class ObSeInsertRowIterator : public ObTableModifyOp::DMLRowIterator { - public: +public: ObSeInsertRowIterator(ObExecContext& ctx, ObTableInsertOp& op) : DMLRowIterator(ctx, op), batch_rows_(NULL), @@ -112,13 +112,13 @@ class ObSeInsertRowIterator : public ObTableModifyOp::DMLRowIterator { } // for batch insert - private: +private: static const int64_t BULK_COUNT = 500; // get 500 rows when get_next_rows is called int create_cur_rows(int64_t total_cnt, int64_t col_cnt, common::ObNewRow*& row, int64_t& row_cnt); int alloc_rows_cells(const int64_t col_cnt, const int64_t row_cnt, common::ObNewRow* rows); int copy_cur_rows(const ObNewRow& src_row); - private: +private: ObNewRow* batch_rows_; bool first_bulk_; int64_t estimate_rows_; diff --git a/src/sql/engine/dml/ob_table_insert_returning.cpp b/src/sql/engine/dml/ob_table_insert_returning.cpp index ad98d5edf..3ab718661 100644 --- a/src/sql/engine/dml/ob_table_insert_returning.cpp +++ b/src/sql/engine/dml/ob_table_insert_returning.cpp @@ -26,7 +26,7 @@ using namespace storage; using namespace share; namespace sql { class ObTableInsertReturning::ObTableInsertReturningCtx : public ObTableInsertCtx { - public: +public: explicit ObTableInsertReturningCtx(ObExecContext& ctx) : ObTableInsertCtx(ctx), new_row_() {} @@ -38,7 +38,7 @@ class ObTableInsertReturning::ObTableInsertReturningCtx : public ObTableInsertCt ObTableInsertCtx::destroy(); } - public: +public: common::ObNewRow insert_row_; common::ObNewRow new_row_; }; diff --git a/src/sql/engine/dml/ob_table_insert_returning.h b/src/sql/engine/dml/ob_table_insert_returning.h index a37500f41..bf09d635c 100644 --- a/src/sql/engine/dml/ob_table_insert_returning.h +++ b/src/sql/engine/dml/ob_table_insert_returning.h @@ -24,7 +24,7 @@ namespace sql { class ObPhyTableLocation; class ObTableInsertReturningInput : public ObTableInsertInput { - public: +public: ObTableInsertReturningInput() : ObTableInsertInput() {} virtual ~ObTableInsertReturningInput() @@ -34,7 +34,7 @@ class ObTableInsertReturningInput : public ObTableInsertInput { return PHY_INSERT_RETURNING; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableInsertReturningInput); }; @@ -42,27 +42,27 @@ class ObTableInsertReturning : public ObTableInsert { class ObTableInsertReturningCtx; OB_UNIS_VERSION(1); - public: +public: explicit ObTableInsertReturning(common::ObIAllocator& alloc); ~ObTableInsertReturning(); void reset(); void reuse(); int set_insert_row_exprs(); - protected: +protected: int init_op_ctx(ObExecContext& ctx) const override; int inner_open(ObExecContext& ctx) const override; int get_next_row(ObExecContext& ctx, const ObNewRow*& row) const override; int inner_close(ObExecContext& ctx) const override; - protected: +protected: // exprs for calculating the inserted row common::ObDList insert_row_exprs_; // projector for building the inserted row int32_t* insert_projector_; int64_t insert_projector_size_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableInsertReturning); }; } // namespace sql diff --git a/src/sql/engine/dml/ob_table_insert_returning_op.h b/src/sql/engine/dml/ob_table_insert_returning_op.h index e0f103352..cb353cfce 100644 --- a/src/sql/engine/dml/ob_table_insert_returning_op.h +++ b/src/sql/engine/dml/ob_table_insert_returning_op.h @@ -21,26 +21,26 @@ namespace sql { class ObTableInsertReturningOpInput : public ObTableInsertOpInput { OB_UNIS_VERSION_V(1); - public: +public: using ObTableInsertOpInput::ObTableInsertOpInput; }; class ObTableInsertReturningSpec : public ObTableInsertSpec { OB_UNIS_VERSION_V(1); - public: +public: using ObTableInsertSpec::ObTableInsertSpec; }; class ObTableInsertReturningOp : public ObTableInsertOp { - public: +public: using ObTableInsertOp::ObTableInsertOp; virtual int inner_open() override; virtual int get_next_row() override; virtual int inner_close() override; - private: +private: common::ObNewRow new_row_; }; diff --git a/src/sql/engine/dml/ob_table_insert_up.h b/src/sql/engine/dml/ob_table_insert_up.h index 89cb3525f..06494a537 100644 --- a/src/sql/engine/dml/ob_table_insert_up.h +++ b/src/sql/engine/dml/ob_table_insert_up.h @@ -20,7 +20,7 @@ namespace sql { class ObTableInsertUpInput : public ObTableModifyInput { friend class ObTableInsertUp; - public: +public: ObTableInsertUpInput() : ObTableModifyInput() {} virtual ~ObTableInsertUpInput() @@ -30,16 +30,16 @@ class ObTableInsertUpInput : public ObTableModifyInput { return PHY_INSERT_ON_DUP; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableInsertUpInput); }; class ObTableInsertUp : public ObTableModify { OB_UNIS_VERSION(1); - public: +public: class ObTableInsertUpCtx : public ObTableModifyCtx { - public: + public: explicit ObTableInsertUpCtx(ObExecContext& ctx); ~ObTableInsertUpCtx(); common::ObNewRow& get_update_row(); @@ -64,7 +64,7 @@ class ObTableInsertUp : public ObTableModify { ++found_rows_; } - public: + public: common::ObNewRow rowkey_row_; int64_t found_rows_; int64_t get_count_; @@ -80,7 +80,7 @@ class ObTableInsertUp : public ObTableModify { bool cur_gi_task_iter_end_; }; - public: +public: explicit ObTableInsertUp(common::ObIAllocator& alloc); virtual ~ObTableInsertUp(); @@ -136,7 +136,7 @@ class ObTableInsertUp : public ObTableModify { return init_array_size<>(assignment_infos_, count); } - protected: +protected: /** * @brief open operator, not including children operators. * called by open. @@ -173,7 +173,7 @@ class ObTableInsertUp : public ObTableModify { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObTableInsertUp); // function members - protected: +protected: int32_t* old_projector_; int64_t old_projector_size_; int32_t* new_projector_; diff --git a/src/sql/engine/dml/ob_table_insert_up_op.h b/src/sql/engine/dml/ob_table_insert_up_op.h index dc3044b1d..7ea41c67f 100644 --- a/src/sql/engine/dml/ob_table_insert_up_op.h +++ b/src/sql/engine/dml/ob_table_insert_up_op.h @@ -21,7 +21,7 @@ namespace sql { class ObTableInsertUpOpInput : public ObTableModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableInsertUpOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableModifyOpInput(ctx, spec) {} virtual int init(ObTaskInfo& task_info) override @@ -33,7 +33,7 @@ class ObTableInsertUpOpInput : public ObTableModifyOpInput { class ObTableInsertUpSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableInsertUpSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObTableInsertUpSpec() {} @@ -45,7 +45,7 @@ class ObTableInsertUpSpec : public ObTableModifySpec { INHERIT_TO_STRING_KV("table_modify_spec", ObTableModifySpec, K_(scan_column_ids), K_(update_related_column_ids), K_(updated_column_ids), K_(updated_column_infos), K_(insert_row), K_(old_row), K_(new_row)); - public: +public: common::ObFixedArray scan_column_ids_; common::ObFixedArray update_related_column_ids_; @@ -61,7 +61,7 @@ class ObTableInsertUpSpec : public ObTableModifySpec { }; class ObTableInsertUpOp : public ObTableModifyOp { - public: +public: ObTableInsertUpOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); int inner_open() override; @@ -75,7 +75,7 @@ class ObTableInsertUpOp : public ObTableModifyOp { ObTableModifyOp::destroy(); } - protected: +protected: int init_autoinc_param(const common::ObPartitionKey& pkey); int calc_insert_row(); @@ -92,11 +92,11 @@ class ObTableInsertUpOp : public ObTableModifyOp { int update_auto_increment(const ObExpr& expr, const uint64_t cid, bool& is_auto_col_changed); - private: +private: int do_table_insert_up(); void reset(); - protected: +protected: storage::ObRow2ExprsProjector row2exprs_projector_; int64_t found_rows_; int64_t get_count_; diff --git a/src/sql/engine/dml/ob_table_lock.h b/src/sql/engine/dml/ob_table_lock.h index 791579a14..e7488f7fc 100644 --- a/src/sql/engine/dml/ob_table_lock.h +++ b/src/sql/engine/dml/ob_table_lock.h @@ -19,7 +19,7 @@ namespace sql { class ObTableLockInput : public ObTableModifyInput { friend class ObTableLock; - public: +public: ObTableLockInput() : ObTableModifyInput() {} virtual ~ObTableLockInput() @@ -29,16 +29,16 @@ class ObTableLockInput : public ObTableModifyInput { return PHY_LOCK; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableLockInput); }; class ObTableLock : public ObTableModify { - public: +public: class ObTableLockCtx : public ObTableModifyCtx { friend class ObTableLock; - public: + public: explicit ObTableLockCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), lock_row_(), dml_param_(), part_key_(), part_infos_(), for_update_wait_timeout_(-1) {} @@ -52,7 +52,7 @@ class ObTableLock : public ObTableModify { } friend class ObTableLock; - protected: + protected: common::ObNewRow lock_row_; storage::ObDMLBaseParam dml_param_; common::ObPartitionKey part_key_; @@ -62,7 +62,7 @@ class ObTableLock : public ObTableModify { OB_UNIS_VERSION(1); - public: +public: explicit ObTableLock(common::ObIAllocator& alloc); virtual ~ObTableLock(); virtual void reset(); @@ -86,7 +86,7 @@ class ObTableLock : public ObTableModify { return false; } - protected: +protected: virtual int inner_open(ObExecContext& ctx) const; virtual int inner_close(ObExecContext& ctx) const; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; @@ -109,10 +109,10 @@ class ObTableLock : public ObTableModify { return for_update_wait_us_ == 0; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableLock); - protected: +protected: // projector for build the lock row int32_t* rowkey_projector_; int64_t rowkey_projector_size_; diff --git a/src/sql/engine/dml/ob_table_lock_op.h b/src/sql/engine/dml/ob_table_lock_op.h index 05cd39d6b..f78c605aa 100644 --- a/src/sql/engine/dml/ob_table_lock_op.h +++ b/src/sql/engine/dml/ob_table_lock_op.h @@ -20,7 +20,7 @@ namespace sql { class ObTableLockOpInput : public ObTableModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableLockOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableModifyOpInput(ctx, spec) {} virtual int init(ObTaskInfo& task_info) override @@ -32,7 +32,7 @@ class ObTableLockOpInput : public ObTableModifyOpInput { class ObTableLockSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableLockSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObTableLockSpec(); @@ -56,14 +56,14 @@ class ObTableLockSpec : public ObTableModifySpec { INHERIT_TO_STRING_KV("table_modify_spec", ObTableModifySpec, K_(for_update_wait_us), K_(skip_locked)); - public: +public: // projector for build the lock row int64_t for_update_wait_us_; bool skip_locked_; // UNUSED for the current }; class ObTableLockOp : public ObTableModifyOp { - public: +public: friend class ObTableModifyOp; ObTableLockOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); @@ -77,13 +77,13 @@ class ObTableLockOp : public ObTableModifyOp { return ObTableModifyOp::destroy(); } - protected: +protected: int do_table_lock(); int lock_single_part(); int lock_multi_part(); int prepare_lock_row(); - protected: +protected: common::ObNewRow lock_row_; storage::ObDMLBaseParam dml_param_; common::ObPartitionKey part_key_; diff --git a/src/sql/engine/dml/ob_table_merge.h b/src/sql/engine/dml/ob_table_merge.h index 3cec35476..a67651675 100644 --- a/src/sql/engine/dml/ob_table_merge.h +++ b/src/sql/engine/dml/ob_table_merge.h @@ -26,7 +26,7 @@ namespace sql { class ObTableMergeInput : public ObTableModifyInput { friend class ObTableMerge; - public: +public: ObTableMergeInput() : ObTableModifyInput() {} virtual ~ObTableMergeInput() @@ -36,7 +36,7 @@ class ObTableMergeInput : public ObTableModifyInput { return PHY_MERGE; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableMergeInput); }; @@ -44,9 +44,9 @@ class ObTableMergeInput : public ObTableModifyInput { class ObTableMerge : public ObTableModify { OB_UNIS_VERSION(1); - public: +public: class ObTableMergeCtx : public ObTableModifyCtx { - public: + public: explicit ObTableMergeCtx(ObExecContext& ctx); ~ObTableMergeCtx(); int init(ObExecContext& ctx, bool has_insert_clause, bool has_update_clause, int64_t insert_row_column_count, @@ -71,7 +71,7 @@ class ObTableMerge : public ObTableModify { return update_row_; } - public: + public: // fileds for update clause common::ObNewRow update_row_; // row buffer for update clause, hold both old row and new row common::ObNewRow target_rowkey_; // rowkey for the updated row @@ -94,7 +94,7 @@ class ObTableMerge : public ObTableModify { common::ObSEArray part_infos_; }; - public: +public: explicit ObTableMerge(common::ObIAllocator& alloc); virtual ~ObTableMerge() {} @@ -212,11 +212,11 @@ class ObTableMerge : public ObTableModify { int copy_row(const ObNewRow& old_row, ObNewRow& new_row, int32_t* projector = NULL, int64_t projector_size = 0) const; virtual int rescan(ObExecContext& ctx) const; - protected: +protected: int generate_origin_row(ObExecContext& ctx, const common::ObNewRow* input_row, bool& conflict) const; int calc_update_row(ObExecContext& ctx, const common::ObNewRow* input_row) const; - private: +private: virtual int inner_open(ObExecContext& ctx) const; virtual int inner_close(ObExecContext& ctx) const; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; @@ -232,12 +232,12 @@ class ObTableMerge : public ObTableModify { int deserialize_projector( const char* buf, const int64_t data_len, int64_t& pos, int32_t*& projector, int64_t& projector_size); - private: +private: template inline int add_id_to_array(T& array, uint64_t id); DISALLOW_COPY_AND_ASSIGN(ObTableMerge); - protected: +protected: bool has_insert_clause_; bool has_update_clause_; @@ -279,7 +279,7 @@ int ObTableMerge::add_id_to_array(T& array, uint64_t id) } /////////////////////////////////// functor ////////////////////////////////////// class ExprFunction { - public: +public: ExprFunction(ObTableMerge& table_merge) : table_merge_(table_merge) {} ~ExprFunction() @@ -290,12 +290,12 @@ class ExprFunction { return table_merge_; } - protected: +protected: ObTableMerge& table_merge_; }; class MatchCondition : public ExprFunction { - public: +public: MatchCondition(ObTableMerge& table_merge) : ExprFunction(table_merge) {} ~MatchCondition() @@ -307,7 +307,7 @@ class MatchCondition : public ExprFunction { }; class DeleteCondition : public ExprFunction { - public: +public: DeleteCondition(ObTableMerge& table_merge) : ExprFunction(table_merge) {} ~DeleteCondition() @@ -319,7 +319,7 @@ class DeleteCondition : public ExprFunction { }; class UpdateCondition : public ExprFunction { - public: +public: UpdateCondition(ObTableMerge& table_merge) : ExprFunction(table_merge) {} ~UpdateCondition() @@ -331,7 +331,7 @@ class UpdateCondition : public ExprFunction { }; class InsertCondition : public ExprFunction { - public: +public: InsertCondition(ObTableMerge& table_merge) : ExprFunction(table_merge) {} ~InsertCondition() diff --git a/src/sql/engine/dml/ob_table_merge_op.h b/src/sql/engine/dml/ob_table_merge_op.h index 4c50d249c..b8edd7459 100644 --- a/src/sql/engine/dml/ob_table_merge_op.h +++ b/src/sql/engine/dml/ob_table_merge_op.h @@ -28,7 +28,7 @@ namespace sql { class ObTableMergeOpInput : public ObTableModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableMergeOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableModifyOpInput(ctx, spec) {} virtual ~ObTableMergeOpInput() @@ -38,17 +38,17 @@ class ObTableMergeOpInput : public ObTableModifyOpInput { class ObTableMergeSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableMergeSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); INHERIT_TO_STRING_KV("op_spec", ObOpSpec, K_(has_insert_clause), K_(has_update_clause), K_(delete_conds), K_(update_conds), K_(insert_conds), K_(update_conds), K_(rowkey_exprs)); - private: +private: template inline int add_id_to_array(T& array, uint64_t id); - public: +public: inline int add_delete_column_id(uint64_t column_id) { return add_id_to_array(delete_column_ids_, column_id); @@ -57,7 +57,7 @@ class ObTableMergeSpec : public ObTableModifySpec { int64_t array_index, uint64_t column_id, uint64_t project_index, bool auto_filled_timestamp); int init_updated_column_count(common::ObIAllocator& allocator, int64_t count); - public: +public: bool has_insert_clause_; bool has_update_clause_; @@ -76,7 +76,7 @@ class ObTableMergeSpec : public ObTableModifySpec { ////////////////////////////////////// ObTableMergeOp ////////////////////////////////////// class ObTableMergeOp : public ObTableModifyOp { - public: +public: ObTableMergeOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObTableMergeOp() {} @@ -106,10 +106,10 @@ class ObTableMergeOp : public ObTableModifyOp { void inc_changed_rows() {} - protected: +protected: int generate_origin_row(bool& conflict); - private: +private: int process_update(storage::ObPartitionService* partition_service, const common::ObPartitionKey& pkey, storage::ObDMLBaseParam& dml_param); int update_row(storage::ObPartitionService* partition_service, const common::ObPartitionKey& pkey, @@ -123,7 +123,7 @@ class ObTableMergeOp : public ObTableModifyOp { } int do_table_merge(); - protected: +protected: common::ObNewRow insert_row_; common::ObRowStore insert_row_store_; common::ObNewRow old_row_; diff --git a/src/sql/engine/dml/ob_table_modify.h b/src/sql/engine/dml/ob_table_modify.h index f1f9d3c2e..043ad805f 100644 --- a/src/sql/engine/dml/ob_table_modify.h +++ b/src/sql/engine/dml/ob_table_modify.h @@ -41,7 +41,7 @@ typedef Ob2DArray part_infos_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableModifyInput); }; typedef common::ObFixedArray ObForeignKeyArgArray; class ObTableModify : public ObSingleChildPhyOperator { - protected: +protected: class ObTableModifyCtx : public ObPhyOperatorCtx { - public: + public: explicit ObTableModifyCtx(ObExecContext& exec_ctx) : ObPhyOperatorCtx(exec_ctx), exec_ctx_(exec_ctx), @@ -443,7 +443,7 @@ class ObTableModify : public ObSingleChildPhyOperator { } int check_stack(); - public: + public: ObExecContext& exec_ctx_; common::ObMySQLProxy* sql_proxy_; observer::ObInnerSQLConnection* inner_conn_; @@ -462,12 +462,12 @@ class ObTableModify : public ObSingleChildPhyOperator { RowkeyDistCtx* rowkey_dist_ctx_; bool iter_end_; - private: + private: ObSQLSessionInfo::StmtSavedValue* saved_session_; char* saved_session_buf_[sizeof(ObSQLSessionInfo::StmtSavedValue)]; }; class ObDMLRowIterator : public common::ObNewRowIterator { - public: + public: explicit ObDMLRowIterator(ObExecContext& ctx, const ObTableModify& op) : ctx_(ctx), op_(op), project_row_() {} ~ObDMLRowIterator() @@ -479,13 +479,13 @@ class ObTableModify : public ObSingleChildPhyOperator { int get_next_rows(common::ObNewRow*& row, int64_t& row_count); void reset(); - private: + private: ObExecContext& ctx_; const ObTableModify& op_; common::ObNewRow project_row_; }; class ForeignKeyHandle { - public: + public: static int do_handle_old_row( ObTableModify* modify_op, ObTableModifyCtx& modify_ctx, const common::ObNewRow& old_row); static int do_handle_old_row( @@ -499,7 +499,7 @@ class ObTableModify : public ObSingleChildPhyOperator { static int do_handle(ObTableModifyCtx& modify_ctx, const ObForeignKeyArgArray& fk_args, const common::ObNewRow& old_row, const common::ObNewRow& new_row); - private: + private: static int value_changed(const common::ObIArray& columns, const common::ObNewRow& old_row, const common::ObNewRow& new_row, bool& has_changed); static int check_exist( @@ -516,7 +516,7 @@ class ObTableModify : public ObSingleChildPhyOperator { static bool is_self_ref_row(const ObNewRow& row, const ObForeignKeyArg& fk_arg); }; - private: +private: // The multi-table semantics of update and delete, such as udpate t1, t2, the data source // is the Cartesian product of t1 and t2, if there are duplicate rows, only the first row // is processed each time, and it needs to be filtered out later. Here, a constant is @@ -529,7 +529,7 @@ class ObTableModify : public ObSingleChildPhyOperator { OB_UNIS_VERSION(1); - public: +public: explicit ObTableModify(common::ObIAllocator& alloc); ~ObTableModify(); @@ -674,7 +674,7 @@ class ObTableModify : public ObSingleChildPhyOperator { stmt_id_idx_ = stmt_id_idx; } - public: +public: int init_foreign_key_args(int64_t fk_count); int add_foreign_key_arg(const ObForeignKeyArg& fk_arg); int init_foreign_key_operation(ObExecContext& ctx) const; @@ -737,7 +737,7 @@ class ObTableModify : public ObSingleChildPhyOperator { return false; } - protected: +protected: /** * @brief open operator, not including children operators. * called by open. @@ -771,10 +771,10 @@ class ObTableModify : public ObSingleChildPhyOperator { void log_user_error_inner(int ret, int64_t col_idx, int64_t row_num, ObExecContext& ctx) const; int calc_row_for_pdml(ObExecContext& ctx, ObNewRow& cur_row) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableModify); - protected: +protected: uint64_t table_id_; uint64_t index_tid_; bool is_ignore_; @@ -826,9 +826,9 @@ int ObTableModify::check_updated_value(UpdateCtx& update_ctx, const UpdateOp& up class ObMultiDMLCtx; class ObMultiDMLInfo { - public: +public: class ObIsMultiDMLGuard { - public: + public: explicit ObIsMultiDMLGuard(ObPhysicalPlanCtx& plan_ctx) : is_multi_dml_(plan_ctx.get_is_multi_dml()) { is_multi_dml_ = true; @@ -838,11 +838,11 @@ class ObMultiDMLInfo { is_multi_dml_ = false; } - private: + private: bool& is_multi_dml_; }; - public: +public: ObMultiDMLInfo(common::ObIAllocator& alloc) : allocator_(alloc), table_dml_infos_(), subplan_root_(NULL), se_subplan_root_(NULL) {} @@ -871,7 +871,7 @@ class ObMultiDMLInfo { bool sesubplan_has_foreign_key() const; int wait_all_task(ObMultiDMLCtx* dml_ctx, ObPhysicalPlanCtx* plan_ctx) const; - public: +public: common::ObIAllocator& allocator_; common::ObArrayWrap table_dml_infos_; const ObPhyOperator* subplan_root_; @@ -881,7 +881,7 @@ class ObMultiDMLInfo { class ObMultiDMLCtx { friend class ObMultiDMLInfo; - public: +public: explicit ObMultiDMLCtx(common::ObIAllocator& allocator) : table_dml_ctxs_(), multi_dml_plan_mgr_(allocator), @@ -905,7 +905,7 @@ class ObMultiDMLCtx { const ObPhysicalPlan* phy_plan, const ObPhyOperator* subplan_root, const ObOpSpec* se_subplan_root = NULL); void release_multi_part_shuffle_info(); - public: +public: common::ObArrayWrap table_dml_ctxs_; ObMultiDMLPlanMgr multi_dml_plan_mgr_; ObDMLMiniTaskExecutor mini_task_executor_; diff --git a/src/sql/engine/dml/ob_table_modify_op.h b/src/sql/engine/dml/ob_table_modify_op.h index 7da5007d7..3819c6530 100644 --- a/src/sql/engine/dml/ob_table_modify_op.h +++ b/src/sql/engine/dml/ob_table_modify_op.h @@ -23,7 +23,7 @@ class ObTableModifyOp; class ObTableModifySpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableModifySpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); virtual ~ObTableModifySpec() {} @@ -126,10 +126,10 @@ class ObTableModifySpec : public ObOpSpec { return false; } - public: +public: virtual bool has_foreign_key() const; - public: +public: uint64_t table_id_; uint64_t index_tid_; bool is_ignore_; @@ -154,16 +154,16 @@ class ObTableModifySpec : public ObOpSpec { bool need_skip_log_user_error_; bool table_location_uncertain_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableModifySpec); }; class ObTableModifyOpInput : public ObOpInput { - public: +public: friend class ObTableModifyOp; OB_UNIS_VERSION_V(1); - public: +public: ObTableModifyOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObOpInput(ctx, spec), location_idx_(common::OB_INVALID_INDEX), part_infos_() {} @@ -197,18 +197,18 @@ class ObTableModifyOpInput : public ObOpInput { } TO_STRING_KV(K_(location_idx), K_(part_infos)); - private: +private: int64_t location_idx_; common::ObFixedArray part_infos_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableModifyOpInput); }; class ObTableModifyOp : public ObOperator { - public: +public: class DMLRowIterator : public common::ObNewRowIterator { - public: + public: DMLRowIterator(ObExecContext& ctx, ObTableModifyOp& op) : ctx_(ctx), op_(op) {} virtual ~DMLRowIterator() @@ -223,14 +223,14 @@ class ObTableModifyOp : public ObOperator { // create project_row_ cells. int setup_project_row(const int64_t cnt); - protected: + protected: ObExecContext& ctx_; ObTableModifyOp& op_; common::ObNewRow project_row_; }; class ForeignKeyHandle { - public: + public: struct ObFkRowResInfo { ObExpr* rt_expr_; ObDatum ori_datum_; @@ -243,7 +243,7 @@ class ObTableModifyOp : public ObOperator { static int do_handle(ObTableModifyOp& modify_op, const ObForeignKeyArgArray& fk_args, const ObExprPtrIArray& old_row, const ObExprPtrIArray& new_row); - private: + private: static int value_changed(ObTableModifyOp& op, const common::ObIArray& columns, const ObExprPtrIArray& old_row, const ObExprPtrIArray& new_row, bool& has_changed); static int check_exist( @@ -263,7 +263,7 @@ class ObTableModifyOp : public ObOperator { ObEvalCtx& ctx, const ObExprPtrIArray& row, const ObForeignKeyArg& fk_arg, bool& is_self_ref); }; - public: +public: ObTableModifyOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObTableModifyOp() {} @@ -300,7 +300,7 @@ class ObTableModifyOp : public ObOperator { ObOperator::destroy(); } - public: +public: int open_inner_conn(); int close_inner_conn(); int begin_nested_session(bool skip_cur_stmt_tables); @@ -350,7 +350,7 @@ class ObTableModifyOp : public ObOperator { return ObOperator::get_next_row(); } - protected: +protected: OperatorOpenOrder get_operator_open_order() const; virtual int inner_open(); virtual int inner_close(); @@ -396,7 +396,7 @@ class ObTableModifyOp : public ObOperator { bool init_returning_store(); - public: +public: common::ObMySQLProxy* sql_proxy_; observer::ObInnerSQLConnection* inner_conn_; uint64_t tenant_id_; @@ -421,7 +421,7 @@ class ObTableModifyOp : public ObOperator { ObChunkDatumStore returning_datum_store_; ObChunkDatumStore::Iterator returning_datum_iter_; - private: +private: ObSQLSessionInfo::StmtSavedValue* saved_session_; char* saved_session_buf_[sizeof(ObSQLSessionInfo::StmtSavedValue)]; // when got forgien key self reference, need to change row. diff --git a/src/sql/engine/dml/ob_table_replace.h b/src/sql/engine/dml/ob_table_replace.h index e739ca0f7..f0b84f36f 100644 --- a/src/sql/engine/dml/ob_table_replace.h +++ b/src/sql/engine/dml/ob_table_replace.h @@ -28,7 +28,7 @@ namespace sql { class ObTableReplaceInput : public ObTableModifyInput { friend class ObTableUpdate; - public: +public: ObTableReplaceInput() : ObTableModifyInput() {} virtual ~ObTableReplaceInput() @@ -38,14 +38,14 @@ class ObTableReplaceInput : public ObTableModifyInput { return PHY_REPLACE; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableReplaceInput); }; class ObTableReplace : public ObTableModify { - protected: +protected: class ObTableReplaceCtx : public ObTableModifyCtx { - public: + public: explicit ObTableReplaceCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), insert_row_(), @@ -68,7 +68,7 @@ class ObTableReplace : public ObTableModify { part_infos_.reset(); } - public: + public: common::ObNewRow insert_row_; int64_t record_; int64_t affected_rows_; @@ -78,7 +78,7 @@ class ObTableReplace : public ObTableModify { common::ObNewRow cast_row_; }; - public: +public: explicit ObTableReplace(common::ObIAllocator& alloc) : ObTableModify(alloc), only_one_unique_key_(false), res_obj_types_(alloc) {} @@ -113,7 +113,7 @@ class ObTableReplace : public ObTableModify { int add_column_res_type(const ObObjType type); OB_UNIS_VERSION_V(1); - protected: +protected: int do_table_replace(ObExecContext& ctx) const; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; int try_insert(ObExecContext& ctx, common::ObExprCtx& expr_ctx, const common::ObNewRow* insert_row, @@ -136,11 +136,11 @@ class ObTableReplace : public ObTableModify { int do_type_cast(ObExecContext& ctx, const common::ObNewRow*& row) const; int shallow_copy_row(ObExecContext& ctx, const common::ObNewRow*& src_row, common::ObNewRow& dst_row) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObTableReplace); // function members - protected: +protected: bool only_one_unique_key_; common::ObFixedArray res_obj_types_; }; diff --git a/src/sql/engine/dml/ob_table_replace_op.h b/src/sql/engine/dml/ob_table_replace_op.h index 1985f7404..f1821a01d 100644 --- a/src/sql/engine/dml/ob_table_replace_op.h +++ b/src/sql/engine/dml/ob_table_replace_op.h @@ -25,19 +25,19 @@ namespace sql { class ObTableReplaceSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableReplaceSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableModifySpec(alloc, type), only_one_unique_key_(false), table_column_exprs_(alloc) {} bool only_one_unique_key_; ExprFixedArray table_column_exprs_; // table column exprs - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableReplaceSpec); }; class ObTableReplaceOp : public ObTableModifyOp { - public: +public: ObTableReplaceOp(ObExecContext& ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableModifyOp(ctx, spec, input), row2exprs_projector_(ctx.get_allocator()), @@ -56,10 +56,10 @@ class ObTableReplaceOp : public ObTableModifyOp { virtual void destroy() override; int do_table_replace(); - protected: +protected: int check_values(bool& is_equal) const; - private: +private: int try_insert(ObSQLSessionInfo& my_session, const ObPartitionKey& part_key, storage::ObPartitionService& partition_service, const storage::ObDMLBaseParam& dml_param, ObNewRowIterator*& dup_rows_iter); @@ -70,7 +70,7 @@ class ObTableReplaceOp : public ObTableModifyOp { storage::ObPartitionService& partition_service, storage::ObTableScanParam& scan_param, const common::ObNewRowIterator& dup_rows_iter, common::ObNewRowIterator** result); - protected: +protected: storage::ObRow2ExprsProjector row2exprs_projector_; int64_t record_; int64_t affected_rows_; @@ -82,7 +82,7 @@ class ObTableReplaceOp : public ObTableModifyOp { class ObTableReplaceOpInput : public ObTableModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableReplaceOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableModifyOpInput(ctx, spec) {} int init(ObTaskInfo& task_info) override @@ -90,7 +90,7 @@ class ObTableReplaceOpInput : public ObTableModifyOpInput { return ObTableModifyOpInput::init(task_info); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableReplaceOpInput); }; diff --git a/src/sql/engine/dml/ob_table_update.h b/src/sql/engine/dml/ob_table_update.h index b243748db..2d4a1f602 100644 --- a/src/sql/engine/dml/ob_table_update.h +++ b/src/sql/engine/dml/ob_table_update.h @@ -19,7 +19,7 @@ namespace sql { class ObTableUpdateInput : public ObTableModifyInput { friend class ObTableUpdate; - public: +public: ObTableUpdateInput() : ObTableModifyInput() {} virtual ~ObTableUpdateInput() @@ -29,16 +29,16 @@ class ObTableUpdateInput : public ObTableModifyInput { return PHY_UPDATE; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableUpdateInput); }; class ObTableUpdate : public ObTableModify { - public: +public: class ObTableUpdateCtx : public ObTableModifyCtx { friend class ObTableUpdate; - public: + public: explicit ObTableUpdateCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), full_row_(), @@ -89,7 +89,7 @@ class ObTableUpdate : public ObTableModify { } friend class ObTableUpdate; - protected: + protected: common::ObNewRow full_row_; common::ObNewRow new_row_; common::ObNewRow old_row_; @@ -109,7 +109,7 @@ class ObTableUpdate : public ObTableModify { OB_UNIS_VERSION(1); - public: +public: explicit ObTableUpdate(common::ObIAllocator& alloc); virtual ~ObTableUpdate(); @@ -155,7 +155,7 @@ class ObTableUpdate : public ObTableModify { return ObSqlExpressionUtil::add_expr_to_list(new_spk_exprs_, expr); } - protected: +protected: /** * @brief called by my_get_next_row(), get a row from the child operator or row_store * @param ctx[in], execute context @@ -184,10 +184,10 @@ class ObTableUpdate : public ObTableModify { int build_lock_row(ObTableUpdateCtx& update_ctx, const common::ObNewRow& old_row) const; int do_table_update(ObExecContext& ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableUpdate); - protected: +protected: common::ObFixedArray updated_column_ids_; common::ObFixedArray updated_column_infos_; bool is_global_index_; diff --git a/src/sql/engine/dml/ob_table_update_op.h b/src/sql/engine/dml/ob_table_update_op.h index 75f67c55b..249bc2721 100644 --- a/src/sql/engine/dml/ob_table_update_op.h +++ b/src/sql/engine/dml/ob_table_update_op.h @@ -21,7 +21,7 @@ namespace sql { class ObTableUpdateOpInput : public ObTableModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableUpdateOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableModifyOpInput(ctx, spec) {} virtual int init(ObTaskInfo& task_info) override @@ -33,7 +33,7 @@ class ObTableUpdateOpInput : public ObTableModifyOpInput { class ObTableUpdateSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableUpdateSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObTableUpdateSpec(); @@ -50,7 +50,7 @@ class ObTableUpdateSpec : public ObTableModifySpec { INHERIT_TO_STRING_KV("table_modify_spec", ObTableModifySpec, K_(updated_column_ids), K_(updated_column_infos), K_(old_row), K_(new_row)); - public: +public: common::ObFixedArray updated_column_ids_; common::ObFixedArray updated_column_infos_; ExprFixedArray old_row_; @@ -58,7 +58,7 @@ class ObTableUpdateSpec : public ObTableModifySpec { }; class ObTableUpdateOp : public ObTableModifyOp { - public: +public: friend ObTableModifyOp; ObTableUpdateOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); @@ -92,7 +92,7 @@ class ObTableUpdateOp : public ObTableModifyOp { return found_rows_; } - protected: +protected: bool check_row_whether_changed() const; int update_rows(int64_t& affected_rows); // update all rows in open phase, @@ -102,7 +102,7 @@ class ObTableUpdateOp : public ObTableModifyOp { // update single row int do_row_update(); - protected: +protected: bool has_got_old_row_; int64_t found_rows_; int64_t changed_rows_; diff --git a/src/sql/engine/dml/ob_table_update_returning.cpp b/src/sql/engine/dml/ob_table_update_returning.cpp index da693b955..dc36e563e 100644 --- a/src/sql/engine/dml/ob_table_update_returning.cpp +++ b/src/sql/engine/dml/ob_table_update_returning.cpp @@ -26,7 +26,7 @@ using namespace storage; using namespace share; namespace sql { class ObTableUpdateReturning::ObTableUpdateReturningCtx : public ObTableUpdateCtx { - public: +public: explicit ObTableUpdateReturningCtx(ObExecContext& ctx) : ObTableUpdateCtx(ctx) {} ~ObTableUpdateReturningCtx() diff --git a/src/sql/engine/dml/ob_table_update_returning.h b/src/sql/engine/dml/ob_table_update_returning.h index 9265cd6f3..893f89c8c 100644 --- a/src/sql/engine/dml/ob_table_update_returning.h +++ b/src/sql/engine/dml/ob_table_update_returning.h @@ -20,7 +20,7 @@ namespace sql { class ObTableUpdateReturningInput : public ObTableModifyInput { friend class ObTableUpdateReturning; - public: +public: ObTableUpdateReturningInput() : ObTableModifyInput() {} virtual ~ObTableUpdateReturningInput() @@ -30,7 +30,7 @@ class ObTableUpdateReturningInput : public ObTableModifyInput { return PHY_UPDATE_RETURNING; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableUpdateReturningInput); }; @@ -38,7 +38,7 @@ class ObTableUpdateReturning : public ObTableUpdate { class ObTableUpdateReturningCtx; OB_UNIS_VERSION(1); - public: +public: explicit ObTableUpdateReturning(common::ObIAllocator& alloc) : ObTableUpdate(alloc), updated_projector_(NULL), updated_projector_size_(0) {} @@ -54,11 +54,11 @@ class ObTableUpdateReturning : public ObTableUpdate { void reset(); void reuse(); - private: +private: int init_op_ctx(ObExecContext& ctx) const; DISALLOW_COPY_AND_ASSIGN(ObTableUpdateReturning); - private: +private: int32_t* updated_projector_; int64_t updated_projector_size_; }; diff --git a/src/sql/engine/dml/ob_table_update_returning_op.h b/src/sql/engine/dml/ob_table_update_returning_op.h index bb841f46e..442900098 100644 --- a/src/sql/engine/dml/ob_table_update_returning_op.h +++ b/src/sql/engine/dml/ob_table_update_returning_op.h @@ -21,7 +21,7 @@ namespace sql { class ObTableUpdateReturningOpInput : public ObTableUpdateOpInput { OB_UNIS_VERSION_V(1); - public: +public: using ObTableUpdateOpInput::ObTableUpdateOpInput; virtual int init(ObTaskInfo& task_info) override @@ -33,12 +33,12 @@ class ObTableUpdateReturningOpInput : public ObTableUpdateOpInput { class ObTableUpdateReturningSpec : public ObTableUpdateSpec { OB_UNIS_VERSION_V(1); - public: +public: using ObTableUpdateSpec::ObTableUpdateSpec; }; class ObTableUpdateReturningOp : public ObTableUpdateOp { - public: +public: using ObTableUpdateOp::ObTableUpdateOp; int get_next_row() override; diff --git a/src/sql/engine/expr/ob_const_map_initializer.h b/src/sql/engine/expr/ob_const_map_initializer.h index 18723d24f..ebb2bd601 100644 --- a/src/sql/engine/expr/ob_const_map_initializer.h +++ b/src/sql/engine/expr/ob_const_map_initializer.h @@ -29,7 +29,7 @@ namespace sql { template class ObConstMap { - public: +public: typedef int (*InitFunction)(MyClass& member); explicit ObConstMap(InitFunction init_f) : is_inited_(false), init_f_(init_f) @@ -52,7 +52,7 @@ class ObConstMap { return member_; } - protected: +protected: bool is_inited_; InitFunction init_f_; MyClass member_; diff --git a/src/sql/engine/expr/ob_datum_cast.h b/src/sql/engine/expr/ob_datum_cast.h index d89c758d0..672467d20 100644 --- a/src/sql/engine/expr/ob_datum_cast.h +++ b/src/sql/engine/expr/ob_datum_cast.h @@ -53,7 +53,7 @@ int padding_char_for_cast(int64_t padding_cnt, const common::ObCollationType& pa common::ObIAllocator& alloc, common::ObString& padding_res); class ObDatumHexUtils { - public: +public: static int hextoraw_string(const ObExpr& expr, const common::ObString& in_str, ObEvalCtx& ctx, ObDatum& res_datum); static int hextoraw(const ObExpr& expr, const common::ObDatum& in, const common::ObObjType& in_type, const common::ObCollationType& in_cs_type, ObEvalCtx& ctx, ObDatum& res); @@ -68,7 +68,7 @@ class ObDatumHexUtils { }; class ObDatumCast { - public: +public: static int get_implicit_cast_function(const common::ObObjType in_type, const common::ObCollationType in_cs_type, const common::ObObjType out_type, const common::ObCollationType out_cs_type, const int64_t cast_mode, ObExpr::EvalFunc& eval_func); @@ -109,7 +109,7 @@ class ObDatumCast { }; class ObDatumCaster { - public: +public: ObDatumCaster() : inited_(false), eval_ctx_(NULL), cast_expr_(NULL), extra_cast_expr_(NULL) {} ~ObDatumCaster() @@ -131,7 +131,7 @@ class ObDatumCaster { int destroy(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDatumCaster); // setup following data member of ObExpr: diff --git a/src/sql/engine/expr/ob_expr.h b/src/sql/engine/expr/ob_expr.h index 0ff91c27d..a04f4119b 100644 --- a/src/sql/engine/expr/ob_expr.h +++ b/src/sql/engine/expr/ob_expr.h @@ -37,7 +37,7 @@ typedef ObItemType ObExprOperatorType; struct ObDatumMeta { OB_UNIS_VERSION(1); - public: +public: ObDatumMeta() : type_(common::ObNullType), cs_type_(common::CS_TYPE_INVALID), scale_(-1), precision_(-1) {} ObDatumMeta(const common::ObObjType type, const common::ObCollationType cs_type, const int8_t scale) @@ -122,18 +122,18 @@ struct ObEvalCtx { return tmp_alloc_; } - private: +private: // Allocate expression result memory. void* alloc_expr_res(const int64_t size) { return expr_res_alloc_.alloc(size); } - public: +public: char** frames_; ObExecContext& exec_ctx_; - private: +private: // Expression result allocator, never reset. common::ObArenaAllocator& expr_res_alloc_; @@ -181,7 +181,7 @@ typedef common::ObFixedArray ObStrValues struct ObExpr { OB_UNIS_VERSION(1); - public: +public: const static uint32_t INVALID_EXP_CTX_ID = UINT32_MAX; ObExpr(); @@ -249,10 +249,10 @@ struct ObExpr { KP_(inner_functions), K_(inner_func_cnt), K_(arg_cnt), K_(parent_cnt), K_(frame_idx), K_(datum_off), K_(res_buf_off), K_(res_buf_len), K_(expr_ctx_id), K_(extra), KP(this)); - private: +private: char* alloc_str_res_mem(ObEvalCtx& ctx, const int64_t size) const; - public: +public: typedef int (*EvalFunc)(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); typedef int (*EvalEnumSetFunc)(const ObExpr& expr, const common::ObIArray& str_values, const uint64_t cast_mode, ObEvalCtx& ctx, ObDatum& expr_datum); @@ -338,27 +338,27 @@ struct ObExprExtraInfoAccess { // Please try not to use this, if you mast use it, make sure it only allocate one time and is // for expression result. class ObExprStrResAlloc : public common::ObIAllocator { - public: +public: ObExprStrResAlloc(const ObExpr& expr, ObEvalCtx& ctx) : off_(0), expr_(expr), ctx_(ctx) {} void* alloc(const int64_t size) override; - private: +private: int64_t off_; const ObExpr& expr_; ObEvalCtx& ctx_; }; struct ObDatumObj { - public: +public: void set_scale(common::ObScale scale) { meta_.scale_ = scale; } TO_STRING_KV(K_(meta)); - public: +public: ObDatumMeta meta_; common::ObDatum datum_; }; @@ -374,7 +374,7 @@ struct ObDatumObjParam : public ObDatumObj { TO_STRING_KV(K_(accuracy), K_(res_flags), K_(datum), K_(meta)); - public: +public: int from_objparam(const common::ObObjParam& objparam); int to_objparam(common::ObObjParam& obj_param); @@ -498,7 +498,7 @@ struct ObDatumObjParam : public ObDatumObj { return offsetof(ObDatumObjParam, flag_) * 8; } - private: +private: common::ObAccuracy accuracy_; uint32_t res_flags_; // BINARY, NUM, NOT_NULL, TIMESTAMP, etc // reference: src/lib/regex/include/mysql_com.h diff --git a/src/sql/engine/expr/ob_expr_abs.h b/src/sql/engine/expr/ob_expr_abs.h index f71193637..55f838314 100644 --- a/src/sql/engine/expr/ob_expr_abs.h +++ b/src/sql/engine/expr/ob_expr_abs.h @@ -20,10 +20,10 @@ namespace sql { class ObExprAbs : public ObExprOperator { typedef int (*abs_func)(common::ObObj& res, const common::ObObj& param, common::ObExprCtx& expr_ctx); - public: +public: virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos); - public: +public: explicit ObExprAbs(common::ObIAllocator& alloc); ~ObExprAbs(){}; @@ -37,7 +37,7 @@ class ObExprAbs : public ObExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: int set_func_mysql(common::ObObjType param_type); int set_func_oracle(common::ObObjType param_type); // tinyint, mediumint, smallint, int32 @@ -77,10 +77,10 @@ class ObExprAbs : public ObExprOperator { static common::ObObjType calc_param_type(const common::ObObjType orig_param_type, const bool is_oracle_mode); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprAbs); - private: +private: abs_func func_; }; diff --git a/src/sql/engine/expr/ob_expr_acos.h b/src/sql/engine/expr/ob_expr_acos.h index cb5a49a2b..c796d2967 100644 --- a/src/sql/engine/expr/ob_expr_acos.h +++ b/src/sql/engine/expr/ob_expr_acos.h @@ -17,17 +17,14 @@ namespace oceanbase { namespace sql { class ObExprAcos : public ObFuncExprOperator { - public: +public: explicit ObExprAcos(common::ObIAllocator& alloc); virtual ~ObExprAcos(); - virtual int calc_result_type1(ObExprResType &type, - ObExprResType &type1, - common::ObExprTypeCtx &type_ctx) const override; - virtual int calc_result1(common::ObObj &result, - const common::ObObj &obj, - common::ObExprCtx &expr_ctx) const override; - virtual int cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, - ObExpr &rt_expr) const override; + virtual int calc_result_type1( + ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override; + virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const override; + virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; + private: DISALLOW_COPY_AND_ASSIGN(ObExprAcos); }; diff --git a/src/sql/engine/expr/ob_expr_add.h b/src/sql/engine/expr/ob_expr_add.h index f14f44a9e..367ac711b 100644 --- a/src/sql/engine/expr/ob_expr_add.h +++ b/src/sql/engine/expr/ob_expr_add.h @@ -23,7 +23,7 @@ class ObRawExpr; class ObExprCGCtx; class ObExprAdd : public ObArithExprOperator { - public: +public: ObExprAdd(); explicit ObExprAdd(common::ObIAllocator& alloc, ObExprOperatorType type = T_OP_ADD); virtual ~ObExprAdd(){}; @@ -41,7 +41,7 @@ class ObExprAdd : public ObArithExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - public: +public: // very very effective implementation // if false is returned, the addition of multiplication will be stored in res template @@ -86,7 +86,7 @@ class ObExprAdd : public ObArithExprOperator { static int add_datetime(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObIAllocator* allocator, common::ObScale scale); - private: +private: static int add_int(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObIAllocator* allocator, common::ObScale scale); static int add_uint(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, @@ -102,7 +102,7 @@ class ObExprAdd : public ObArithExprOperator { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprAdd); - public: +public: static int add_null(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int add_int_int(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int add_int_uint(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); @@ -202,7 +202,7 @@ class ObExprAdd : public ObArithExprOperator { } static int add_datetime_datetime(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static ObArithFunc add_funcs_[common::ObMaxTC]; static ObArithFunc agg_add_funcs_[common::ObMaxTC]; static const int64_t SHIFT_OFFSET = 63; @@ -211,7 +211,7 @@ class ObExprAdd : public ObArithExprOperator { // Add expr for aggregation, different with ObExprAdd: // No overflow check for float/double type. class ObExprAggAdd : public ObExprAdd { - public: +public: explicit ObExprAggAdd(common::ObIAllocator& alloc) : ObExprAdd(alloc, T_OP_AGG_ADD) {} }; diff --git a/src/sql/engine/expr/ob_expr_agg_param_list.h b/src/sql/engine/expr/ob_expr_agg_param_list.h index 5811b4c6d..cc0cb526c 100644 --- a/src/sql/engine/expr/ob_expr_agg_param_list.h +++ b/src/sql/engine/expr/ob_expr_agg_param_list.h @@ -16,11 +16,11 @@ namespace oceanbase { namespace sql { class ObExprAggParamList : public ObFuncExprOperator { - public: +public: explicit ObExprAggParamList(common::ObIAllocator& alloc); virtual ~ObExprAggParamList(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprAggParamList); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_and.h b/src/sql/engine/expr/ob_expr_and.h index 66fb17a8b..e5a17e9f0 100644 --- a/src/sql/engine/expr/ob_expr_and.h +++ b/src/sql/engine/expr/ob_expr_and.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprAnd : public ObLogicalExprOperator { - public: +public: explicit ObExprAnd(common::ObIAllocator& alloc); virtual ~ObExprAnd(){}; @@ -30,7 +30,7 @@ class ObExprAnd : public ObLogicalExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: static int cacl_res_with_one_param_null( common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObExprCtx& expr_ctx); // disallow copy diff --git a/src/sql/engine/expr/ob_expr_arg_case.h b/src/sql/engine/expr/ob_expr_arg_case.h index bf9307b95..d0ffaad00 100644 --- a/src/sql/engine/expr/ob_expr_arg_case.h +++ b/src/sql/engine/expr/ob_expr_arg_case.h @@ -23,7 +23,7 @@ typedef int (*ob_get_cmp_type_func)(common::ObObjType& type, const common::ObObj const common::ObObjType& type2, const common::ObObjType& type3); class ObExprArgCase : public ObExprOperator { - public: +public: explicit ObExprArgCase(common::ObIAllocator& alloc); virtual ~ObExprArgCase(); @@ -54,11 +54,11 @@ class ObExprArgCase : public ObExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprArgCase); - private: +private: bool need_cast_; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_ascii.h b/src/sql/engine/expr/ob_expr_ascii.h index 75b52c7a8..78e5022bb 100644 --- a/src/sql/engine/expr/ob_expr_ascii.h +++ b/src/sql/engine/expr/ob_expr_ascii.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprAscii : public ObFuncExprOperator { - public: +public: explicit ObExprAscii(common::ObIAllocator& alloc); virtual ~ObExprAscii(){}; static int calc(common::ObObj& obj, const common::ObObj& obj1, common::ObExprCtx& expr_ctx); @@ -29,12 +29,12 @@ class ObExprAscii : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_ascii_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprAscii); }; class ObExprOrd : public ObFuncExprOperator { - public: +public: explicit ObExprOrd(common::ObIAllocator& alloc); virtual ~ObExprOrd(){}; static int calc(common::ObObj& obj, const common::ObObj& obj1, common::ObExprCtx& expr_ctx); @@ -46,7 +46,7 @@ class ObExprOrd : public ObFuncExprOperator { static int calc_ord_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOrd); }; diff --git a/src/sql/engine/expr/ob_expr_asin.h b/src/sql/engine/expr/ob_expr_asin.h index 3ccb069fc..78e67c7c4 100644 --- a/src/sql/engine/expr/ob_expr_asin.h +++ b/src/sql/engine/expr/ob_expr_asin.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObExprAsin : public ObFuncExprOperator { - public: +public: explicit ObExprAsin(common::ObIAllocator& alloc); virtual ~ObExprAsin(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprAsin); }; diff --git a/src/sql/engine/expr/ob_expr_assign.h b/src/sql/engine/expr/ob_expr_assign.h index 256e3045f..cf0e302dc 100644 --- a/src/sql/engine/expr/ob_expr_assign.h +++ b/src/sql/engine/expr/ob_expr_assign.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprAssign : public ObFuncExprOperator { - public: +public: explicit ObExprAssign(common::ObIAllocator& alloc); virtual ~ObExprAssign(); virtual int calc_result_type2( @@ -29,7 +29,7 @@ class ObExprAssign : public ObFuncExprOperator { static int calc(common::ObObj& result, const common::ObObj& key, const common::ObObj& value, sql::ObSQLSessionInfo* my_session_, common::ObCastCtx& cast_ctx); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprAssign); }; diff --git a/src/sql/engine/expr/ob_expr_atan.h b/src/sql/engine/expr/ob_expr_atan.h index ee72624b5..d9f80f46b 100644 --- a/src/sql/engine/expr/ob_expr_atan.h +++ b/src/sql/engine/expr/ob_expr_atan.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObExprAtan : public ObFuncExprOperator { - public: +public: explicit ObExprAtan(common::ObIAllocator& alloc); virtual ~ObExprAtan(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprAtan); }; diff --git a/src/sql/engine/expr/ob_expr_atan2.h b/src/sql/engine/expr/ob_expr_atan2.h index 380ddba60..37046a3ad 100644 --- a/src/sql/engine/expr/ob_expr_atan2.h +++ b/src/sql/engine/expr/ob_expr_atan2.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprAtan2 : public ObFuncExprOperator { - public: +public: explicit ObExprAtan2(common::ObIAllocator& alloc); virtual ~ObExprAtan2(); virtual int calc_result_typeN( @@ -26,7 +26,7 @@ class ObExprAtan2 : public ObFuncExprOperator { common::ObObj& result, const common::ObObj* objs, int64_t param_num, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprAtan2); }; diff --git a/src/sql/engine/expr/ob_expr_autoinc_nextval.h b/src/sql/engine/expr/ob_expr_autoinc_nextval.h index 703906976..4a185f8a9 100644 --- a/src/sql/engine/expr/ob_expr_autoinc_nextval.h +++ b/src/sql/engine/expr/ob_expr_autoinc_nextval.h @@ -22,7 +22,7 @@ class AutoincParam; namespace sql { class ObPhysicalPlanCtx; class ObExprAutoincNextval : public ObFuncExprOperator { - public: +public: explicit ObExprAutoincNextval(common::ObIAllocator& alloc); virtual ~ObExprAutoincNextval(); @@ -35,7 +35,7 @@ class ObExprAutoincNextval : public ObFuncExprOperator { static int get_uint_value(const ObExpr& input_expr, ObDatum* input_value, bool& is_zero, uint64_t& casted_value); - private: +private: // check to generate auto-inc value or not and cast. static int check_and_cast(common::ObObj& result, const common::ObObj* objs_array, int64_t param_num, common::ObExprCtx& expr_ctx, share::AutoincParam* autoinc_param, bool& is_to_generate, uint64_t& casted_value); diff --git a/src/sql/engine/expr/ob_expr_between.h b/src/sql/engine/expr/ob_expr_between.h index adab46adc..1984a785f 100644 --- a/src/sql/engine/expr/ob_expr_between.h +++ b/src/sql/engine/expr/ob_expr_between.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprBetween : public ObRelationalExprOperator { - public: +public: ObExprBetween(); explicit ObExprBetween(common::ObIAllocator& alloc); virtual ~ObExprBetween() @@ -30,13 +30,13 @@ class ObExprBetween : public ObRelationalExprOperator { const common::ObObj& obj3, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprBetween); // function members - private: +private: // data members }; diff --git a/src/sql/engine/expr/ob_expr_bit_and.h b/src/sql/engine/expr/ob_expr_bit_and.h index 42ba181fd..ade83b1ff 100644 --- a/src/sql/engine/expr/ob_expr_bit_and.h +++ b/src/sql/engine/expr/ob_expr_bit_and.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprBitAnd : public ObBitwiseExprOperator { - public: +public: explicit ObExprBitAnd(common::ObIAllocator& alloc); ObExprBitAnd( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension); @@ -27,15 +27,15 @@ class ObExprBitAnd : public ObBitwiseExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBitAnd); }; class ObExprBitAndOra : public ObExprBitAnd { - public: +public: explicit ObExprBitAndOra(common::ObIAllocator& alloc); // use cg_expr in ObExprBitAnd - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBitAndOra); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_bit_count.h b/src/sql/engine/expr/ob_expr_bit_count.h index 1b59c9e70..1d2ea651b 100644 --- a/src/sql/engine/expr/ob_expr_bit_count.h +++ b/src/sql/engine/expr/ob_expr_bit_count.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprBitCount : public ObBitwiseExprOperator { - public: +public: explicit ObExprBitCount(common::ObIAllocator& alloc); virtual ~ObExprBitCount(); virtual int calc_result1(common::ObObj& result, const common::ObObj& obj1, common::ObExprCtx& expr_ctx) const; @@ -26,7 +26,7 @@ class ObExprBitCount : public ObBitwiseExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_bitcount_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: static const uint8_t char_to_num_bits[256]; DISALLOW_COPY_AND_ASSIGN(ObExprBitCount); }; diff --git a/src/sql/engine/expr/ob_expr_bit_left_shift.h b/src/sql/engine/expr/ob_expr_bit_left_shift.h index fee9432aa..04373f2f3 100644 --- a/src/sql/engine/expr/ob_expr_bit_left_shift.h +++ b/src/sql/engine/expr/ob_expr_bit_left_shift.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprBitLeftShift : public ObBitwiseExprOperator { - public: +public: explicit ObExprBitLeftShift(common::ObIAllocator& alloc); virtual ~ObExprBitLeftShift(){}; @@ -26,7 +26,7 @@ class ObExprBitLeftShift : public ObBitwiseExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBitLeftShift); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_bit_length.h b/src/sql/engine/expr/ob_expr_bit_length.h index 2d6ea1f14..bbb7e73fa 100644 --- a/src/sql/engine/expr/ob_expr_bit_length.h +++ b/src/sql/engine/expr/ob_expr_bit_length.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprBitLength : public ObFuncExprOperator { - public: +public: ObExprBitLength(); explicit ObExprBitLength(common::ObIAllocator& alloc); virtual ~ObExprBitLength(); @@ -28,7 +28,7 @@ class ObExprBitLength : public ObFuncExprOperator { static int calc_null(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int calc_bit_length(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBitLength); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_bit_neg.h b/src/sql/engine/expr/ob_expr_bit_neg.h index 4571e49c1..dcffb83ca 100644 --- a/src/sql/engine/expr/ob_expr_bit_neg.h +++ b/src/sql/engine/expr/ob_expr_bit_neg.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprBitNeg : public ObBitwiseExprOperator { - public: +public: explicit ObExprBitNeg(common::ObIAllocator& alloc); virtual ~ObExprBitNeg(){}; @@ -26,7 +26,7 @@ class ObExprBitNeg : public ObBitwiseExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_bitneg_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBitNeg); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_bit_or.h b/src/sql/engine/expr/ob_expr_bit_or.h index 32d1746ae..0277d72d4 100644 --- a/src/sql/engine/expr/ob_expr_bit_or.h +++ b/src/sql/engine/expr/ob_expr_bit_or.h @@ -18,14 +18,14 @@ namespace oceanbase { namespace sql { class ObExprBitOr : public ObBitwiseExprOperator { - public: +public: explicit ObExprBitOr(common::ObIAllocator& alloc); virtual ~ObExprBitOr(){}; virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBitOr); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_bit_right_shift.h b/src/sql/engine/expr/ob_expr_bit_right_shift.h index 1d1e3f488..dc4e9c5d6 100644 --- a/src/sql/engine/expr/ob_expr_bit_right_shift.h +++ b/src/sql/engine/expr/ob_expr_bit_right_shift.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprBitRightShift : public ObBitwiseExprOperator { - public: +public: explicit ObExprBitRightShift(common::ObIAllocator& alloc); virtual ~ObExprBitRightShift(){}; @@ -26,7 +26,7 @@ class ObExprBitRightShift : public ObBitwiseExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBitRightShift); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_bit_xor.h b/src/sql/engine/expr/ob_expr_bit_xor.h index af16f1298..47b90401a 100644 --- a/src/sql/engine/expr/ob_expr_bit_xor.h +++ b/src/sql/engine/expr/ob_expr_bit_xor.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { // bitwise xor class ObExprBitXor : public ObBitwiseExprOperator { - public: +public: explicit ObExprBitXor(common::ObIAllocator& alloc); virtual ~ObExprBitXor(){}; @@ -28,7 +28,7 @@ class ObExprBitXor : public ObBitwiseExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBitXor); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_bool.h b/src/sql/engine/expr/ob_expr_bool.h index 24ed3ee63..4163c1539 100644 --- a/src/sql/engine/expr/ob_expr_bool.h +++ b/src/sql/engine/expr/ob_expr_bool.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprBool : public ObLogicalExprOperator { - public: +public: explicit ObExprBool(common::ObIAllocator& alloc); virtual ~ObExprBool(); @@ -28,7 +28,7 @@ class ObExprBool : public ObLogicalExprOperator { ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBool); }; diff --git a/src/sql/engine/expr/ob_expr_calc_partition_id.h b/src/sql/engine/expr/ob_expr_calc_partition_id.h index 16d4d6743..ba1cc9541 100644 --- a/src/sql/engine/expr/ob_expr_calc_partition_id.h +++ b/src/sql/engine/expr/ob_expr_calc_partition_id.h @@ -28,7 +28,7 @@ namespace sql { struct CalcPartitionIdInfo : public ObIExprExtraInfo { OB_UNIS_VERSION(1); - public: +public: CalcPartitionIdInfo(common::ObIAllocator& alloc, ObExprOperatorType type) : ObIExprExtraInfo(alloc, type), ref_table_id_(common::OB_INVALID_ID), @@ -54,7 +54,7 @@ struct CalcPartitionIdInfo : public ObIExprExtraInfo { // return NONE_PARTITION_ID(-1) if part id not found class ObExprCalcPartitionId : public ObFuncExprOperator { - public: +public: static const int64_t NONE_PARTITION_ID = -1; enum OptRouteType { OPT_ROUTE_NONE, OPT_ROUTE_HASH_ONE }; explicit ObExprCalcPartitionId(common::ObIAllocator& alloc); @@ -67,7 +67,7 @@ class ObExprCalcPartitionId : public ObFuncExprOperator { static int calc_partition_level_two(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); static int calc_opt_route_hash_one(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: static int init_calc_part_info( ObExprCGCtx& expr_cg_ctx, const share::schema::ObTableSchema& table_schema, CalcPartitionIdInfo*& calc_part_info); static int build_row(ObEvalCtx& ctx, common::ObIAllocator& allocator, const ObExpr& expr, common::ObNewRow& row); @@ -78,7 +78,7 @@ class ObExprCalcPartitionId : public ObFuncExprOperator { static int enable_opt_route_hash_one( const share::schema::ObTableSchema& table_schema, const ObRawExpr& raw_expr, bool& enable_opt_route_hash_one); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCalcPartitionId); }; diff --git a/src/sql/engine/expr/ob_expr_calc_urowid.h b/src/sql/engine/expr/ob_expr_calc_urowid.h index 5b7051d39..cf168f358 100644 --- a/src/sql/engine/expr/ob_expr_calc_urowid.h +++ b/src/sql/engine/expr/ob_expr_calc_urowid.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprCalcURowID : public ObExprOperator { - public: +public: explicit ObExprCalcURowID(common::ObIAllocator& alloc); virtual ~ObExprCalcURowID(); @@ -32,7 +32,7 @@ class ObExprCalcURowID : public ObExprOperator { static int calc_urowid(const ObExpr& rt_expr, ObEvalCtx& eva_ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCalcURowID); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_cardinality.h b/src/sql/engine/expr/ob_expr_cardinality.h index 17a2781f8..597135a1c 100644 --- a/src/sql/engine/expr/ob_expr_cardinality.h +++ b/src/sql/engine/expr/ob_expr_cardinality.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprCardinality : public ObFuncExprOperator { - public: +public: explicit ObExprCardinality(common::ObIAllocator& alloc); virtual ~ObExprCardinality(); int assign(const ObExprOperator& other); @@ -26,7 +26,7 @@ class ObExprCardinality : public ObFuncExprOperator { virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCardinality); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_case.h b/src/sql/engine/expr/ob_expr_case.h index aef310267..8e1bd7773 100644 --- a/src/sql/engine/expr/ob_expr_case.h +++ b/src/sql/engine/expr/ob_expr_case.h @@ -22,7 +22,7 @@ namespace sql { #define NEED_CHECK_WHEN_EXPR_TYPE(flag) (((flag)&CHECK_WHEN_EXPR_TYPE) != 0) class ObExprCase : public ObExprOperator { - public: +public: explicit ObExprCase(common::ObIAllocator& alloc); virtual ~ObExprCase(); @@ -37,7 +37,7 @@ class ObExprCase : public ObExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int is_same_kind_type_for_case(const common::ObIArray& type_arr); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCase); }; diff --git a/src/sql/engine/expr/ob_expr_cast.h b/src/sql/engine/expr/ob_expr_cast.h index f4bb7e207..a402aec27 100644 --- a/src/sql/engine/expr/ob_expr_cast.h +++ b/src/sql/engine/expr/ob_expr_cast.h @@ -52,7 +52,7 @@ class ObExprCast : public ObFuncExprOperator { OB_UNIS_VERSION_V(1); const static int32_t OB_LITERAL_MAX_INT_LEN = 21; - public: +public: ObExprCast(); explicit ObExprCast(common::ObIAllocator& alloc); virtual ~ObExprCast(){}; @@ -71,13 +71,13 @@ class ObExprCast : public ObFuncExprOperator { extra_serialize_ = v ? 1 : 0; } - private: +private: int check_target_type_precision_valid(const ObExprResType& type, const common::ObCastMode cast_mode) const; int get_cast_type(const ObExprResType param_type2, ObExprResType& dst_type) const; int get_explicit_cast_cm(const ObExprResType& src_type, const ObExprResType& dst_type, const ObSQLSessionInfo& session, const ObRawExpr& cast_raw_expr, common::ObCastMode& cast_mode) const; - private: +private: int get_cast_string_len(ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx, int32_t& res_len, int16_t& length_semantics, common::ObCollationType conn) const; int get_cast_inttc_len(ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx, int32_t& res_len, diff --git a/src/sql/engine/expr/ob_expr_char.h b/src/sql/engine/expr/ob_expr_char.h index c5061a708..d079b53a9 100644 --- a/src/sql/engine/expr/ob_expr_char.h +++ b/src/sql/engine/expr/ob_expr_char.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprChar : public ObFuncExprOperator { - public: +public: explicit ObExprChar(common::ObIAllocator& alloc); virtual ~ObExprChar(); virtual int calc_result_typeN( @@ -26,7 +26,7 @@ class ObExprChar : public ObFuncExprOperator { common::ObObj& result, const common::ObObj* objs_array, int64_t param_num, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: int calc_result_type(ObExprResType& type, ObExprResType& type1) const; DISALLOW_COPY_AND_ASSIGN(ObExprChar); }; diff --git a/src/sql/engine/expr/ob_expr_char_length.h b/src/sql/engine/expr/ob_expr_char_length.h index d0a68f1a5..c488133d9 100644 --- a/src/sql/engine/expr/ob_expr_char_length.h +++ b/src/sql/engine/expr/ob_expr_char_length.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprCharLength : public ObFuncExprOperator { - public: +public: explicit ObExprCharLength(common::ObIAllocator& alloc); virtual ~ObExprCharLength(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprCharLength : public ObFuncExprOperator { static int eval_char_length(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCharLength); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_chr.h b/src/sql/engine/expr/ob_expr_chr.h index c25667a85..a05690ea0 100644 --- a/src/sql/engine/expr/ob_expr_chr.h +++ b/src/sql/engine/expr/ob_expr_chr.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprChr : public ObStringExprOperator { - public: +public: explicit ObExprChr(common::ObIAllocator& alloc); virtual ~ObExprChr(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -28,7 +28,7 @@ class ObExprChr : public ObStringExprOperator { static int number2varchar(common::ObString& str_result, const double text, common::ObIAllocator& alloc); static int calc_chr_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprChr); }; diff --git a/src/sql/engine/expr/ob_expr_cmp_func.h b/src/sql/engine/expr/ob_expr_cmp_func.h index e63028f83..e2bd3bf87 100644 --- a/src/sql/engine/expr/ob_expr_cmp_func.h +++ b/src/sql/engine/expr/ob_expr_cmp_func.h @@ -25,7 +25,7 @@ class ObDatum; namespace sql { typedef int (*DatumCmpFunc)(const common::ObDatum& datum1, const common::ObDatum& datum2); class ObExprCmpFuncsHelper { - public: +public: static sql::ObExpr::EvalFunc get_eval_expr_cmp_func(const common::ObObjType type1, const common::ObObjType type2, const common::ObCmpOp cmp_op, const bool is_oracle_mode, const common::ObCollationType cs_type); diff --git a/src/sql/engine/expr/ob_expr_coalesce.h b/src/sql/engine/expr/ob_expr_coalesce.h index dec9433d0..4120edbcf 100644 --- a/src/sql/engine/expr/ob_expr_coalesce.h +++ b/src/sql/engine/expr/ob_expr_coalesce.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprCoalesce : public ObExprOperator { - public: +public: explicit ObExprCoalesce(common::ObIAllocator& alloc); virtual ~ObExprCoalesce(); virtual int calc_result_typeN( @@ -29,7 +29,7 @@ class ObExprCoalesce : public ObExprOperator { static int calc(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, const ObExprResType& expected_type, common::ObCastCtx& cast_ctx); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCoalesce); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_coll_pred.h b/src/sql/engine/expr/ob_expr_coll_pred.h index 432626eb7..343828f15 100644 --- a/src/sql/engine/expr/ob_expr_coll_pred.h +++ b/src/sql/engine/expr/ob_expr_coll_pred.h @@ -20,7 +20,7 @@ namespace sql { class ObExprCollPred : public ObExprOperator { OB_UNIS_VERSION(1); - public: +public: explicit ObExprCollPred(common::ObIAllocator& alloc); virtual ~ObExprCollPred(); @@ -55,10 +55,10 @@ class ObExprCollPred : public ObExprOperator { const ObExprCalcType calc_type, CollectionPredRes& result); static int compare_obj(const ObObj& obj1, const ObObj& obj2, ObCompareCtx& cmp_ctx); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCollPred); - private: +private: ObMultiSetType ms_type_; ObMultiSetModifier ms_modifier_; }; diff --git a/src/sql/engine/expr/ob_expr_collation.h b/src/sql/engine/expr/ob_expr_collation.h index b515d38ba..5cb8c46f6 100644 --- a/src/sql/engine/expr/ob_expr_collation.h +++ b/src/sql/engine/expr/ob_expr_collation.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { /// Returns the character set of the string argument. class ObExprCharset : public ObStringExprOperator { - public: +public: // ObExprCharset(); explicit ObExprCharset(common::ObIAllocator& alloc); virtual ~ObExprCharset(); @@ -27,19 +27,19 @@ class ObExprCharset : public ObStringExprOperator { virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCharset); // function members - private: +private: // data members }; /// Returns the collation of the string argument. class ObExprCollation : public ObStringExprOperator { - public: +public: // ObExprCollation(); explicit ObExprCollation(common::ObIAllocator& alloc); virtual ~ObExprCollation(); @@ -48,20 +48,20 @@ class ObExprCollation : public ObStringExprOperator { virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCollation); // function members - private: +private: // data members }; /// Returns the collation coercibility value of the string argument. /// @see ObCollationLevel class ObExprCoercibility : public ObExprOperator { - public: +public: // ObExprCoercibility(); explicit ObExprCoercibility(common::ObIAllocator& alloc); virtual ~ObExprCoercibility(); @@ -70,13 +70,13 @@ class ObExprCoercibility : public ObExprOperator { virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCoercibility); // function members - private: +private: // data members }; @@ -84,7 +84,7 @@ class ObExprCoercibility : public ObExprOperator { /// used to implement COLLATE clause, e.g. C1 collate utf8_general_ci, 'abc' collate utf8_bin /// format: SET_COLLATION(expr, utf8_general_ci) class ObExprSetCollation : public ObExprOperator { - public: +public: // ObExprSetCollation(); explicit ObExprSetCollation(common::ObIAllocator& alloc); virtual ~ObExprSetCollation(); @@ -95,20 +95,20 @@ class ObExprSetCollation : public ObExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprSetCollation); // function members - private: +private: // data members }; /// Returns the meta used for comparison /// @note for debug purpose class ObExprCmpMeta : public ObStringExprOperator { - public: +public: // ObExprCmpMeta(); explicit ObExprCmpMeta(common::ObIAllocator& alloc); virtual ~ObExprCmpMeta(); @@ -117,13 +117,13 @@ class ObExprCmpMeta : public ObStringExprOperator { virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCmpMeta); // function members - private: +private: // data members }; diff --git a/src/sql/engine/expr/ob_expr_column_conv.h b/src/sql/engine/expr/ob_expr_column_conv.h index 3ff67617a..2f10b804c 100644 --- a/src/sql/engine/expr/ob_expr_column_conv.h +++ b/src/sql/engine/expr/ob_expr_column_conv.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObBaseExprColumnConv { - public: +public: ObBaseExprColumnConv(common::ObIAllocator& alloc) : alloc_(alloc), str_values_(alloc_) {} virtual ~ObBaseExprColumnConv() @@ -39,14 +39,14 @@ class ObBaseExprColumnConv { ObBaseExprColumnConv(const ObBaseExprColumnConv& other) = delete; ObBaseExprColumnConv& operator=(const ObBaseExprColumnConv& other) = delete; - protected: +protected: common::ObIAllocator& alloc_; common::ObFixedArray str_values_; }; // fast column convert is a optimized form of OExprColumnConvert class ObFastColumnConvExpr : public ObBaseExprColumnConv, public ObFastExprOperator { - public: +public: explicit ObFastColumnConvExpr(common::ObIAllocator& alloc); virtual ~ObFastColumnConvExpr() {} @@ -83,7 +83,7 @@ class ObFastColumnConvExpr : public ObBaseExprColumnConv, public ObFastExprOpera } VIRTUAL_TO_STRING_KV(K_(column_type), K_(value_item), K_(column_info)); - private: +private: ObExprResType column_type_; ObPostExprItem value_item_; ObString column_info_; @@ -92,7 +92,7 @@ class ObFastColumnConvExpr : public ObBaseExprColumnConv, public ObFastExprOpera class ObExprColumnConv : public ObBaseExprColumnConv, public ObFuncExprOperator { OB_UNIS_VERSION_V(1); - public: +public: // objs[0] type // objs[1] collation_type // objs[2] accuray_expr @@ -104,7 +104,7 @@ class ObExprColumnConv : public ObBaseExprColumnConv, public ObFuncExprOperator static const int64_t PARAMS_COUNT_WITHOUT_COLUMN_INFO = 5; static const int64_t PARAMS_COUNT_WITH_COLUMN_INFO = 6; - public: +public: explicit ObExprColumnConv(common::ObIAllocator& alloc); virtual ~ObExprColumnConv(); virtual int calc_result_typeN( @@ -119,7 +119,7 @@ class ObExprColumnConv : public ObBaseExprColumnConv, public ObFuncExprOperator const ObString* column_info = NULL); static int column_convert(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprColumnConv) const; }; diff --git a/src/sql/engine/expr/ob_expr_concat.h b/src/sql/engine/expr/ob_expr_concat.h index 68fccfe8c..f81720e90 100644 --- a/src/sql/engine/expr/ob_expr_concat.h +++ b/src/sql/engine/expr/ob_expr_concat.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprConcat : public ObStringExprOperator { - public: +public: explicit ObExprConcat(common::ObIAllocator& alloc); virtual ~ObExprConcat(); @@ -42,7 +42,7 @@ class ObExprConcat : public ObStringExprOperator { static int eval_concat(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprConcat); }; diff --git a/src/sql/engine/expr/ob_expr_concat_ws.h b/src/sql/engine/expr/ob_expr_concat_ws.h index 60b31d549..9c623d91f 100644 --- a/src/sql/engine/expr/ob_expr_concat_ws.h +++ b/src/sql/engine/expr/ob_expr_concat_ws.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { // stands for Concatenate With Separator and is a special form of CONCAT() class ObExprConcatWs : public ObStringExprOperator { - public: +public: ObExprConcatWs(); explicit ObExprConcatWs(common::ObIAllocator& alloc); virtual ~ObExprConcatWs(); @@ -36,7 +36,7 @@ class ObExprConcatWs : public ObStringExprOperator { static int calc(const common::ObString& sep_str, const common::ObIArray& words, common::ObIAllocator& alloc, common::ObString& res_str); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprConcatWs); }; diff --git a/src/sql/engine/expr/ob_expr_connect_by_root.h b/src/sql/engine/expr/ob_expr_connect_by_root.h index e1dadb1db..212118412 100644 --- a/src/sql/engine/expr/ob_expr_connect_by_root.h +++ b/src/sql/engine/expr/ob_expr_connect_by_root.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprConnectByRoot : public ObExprOperator { - public: +public: explicit ObExprConnectByRoot(common::ObIAllocator& alloc); virtual ~ObExprConnectByRoot() {} @@ -30,7 +30,7 @@ class ObExprConnectByRoot : public ObExprOperator { static int eval_connect_by_root(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprConnectByRoot) const; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_connection_id.h b/src/sql/engine/expr/ob_expr_connection_id.h index d617c8ebb..dc7e74136 100644 --- a/src/sql/engine/expr/ob_expr_connection_id.h +++ b/src/sql/engine/expr/ob_expr_connection_id.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprConnectionId : public ObFuncExprOperator { - public: +public: explicit ObExprConnectionId(common::ObIAllocator& alloc); virtual ~ObExprConnectionId(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprConnectionId : public ObFuncExprOperator { static int eval_connection_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprConnectionId); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_conv.h b/src/sql/engine/expr/ob_expr_conv.h index 67cf40d7a..e853a40d2 100644 --- a/src/sql/engine/expr/ob_expr_conv.h +++ b/src/sql/engine/expr/ob_expr_conv.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprConv : public ObStringExprOperator { - public: +public: explicit ObExprConv(common::ObIAllocator& alloc); virtual ~ObExprConv(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3, @@ -27,7 +27,7 @@ class ObExprConv : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_conv(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: static const int16_t MIN_BASE = 2; static const int16_t MAX_BASE = 36; static const int16_t MAX_LENGTH = 65; diff --git a/src/sql/engine/expr/ob_expr_convert.h b/src/sql/engine/expr/ob_expr_convert.h index 3a646813f..f99a5a695 100644 --- a/src/sql/engine/expr/ob_expr_convert.h +++ b/src/sql/engine/expr/ob_expr_convert.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprConvert : public ObFuncExprOperator { - public: +public: explicit ObExprConvert(common::ObIAllocator& alloc); virtual ~ObExprConvert(); virtual int calc_result_type2( @@ -27,7 +27,7 @@ class ObExprConvert : public ObFuncExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprConvert); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_cos.h b/src/sql/engine/expr/ob_expr_cos.h index c92013334..ee3432100 100644 --- a/src/sql/engine/expr/ob_expr_cos.h +++ b/src/sql/engine/expr/ob_expr_cos.h @@ -19,14 +19,14 @@ namespace oceanbase { namespace sql { class ObExprCos : public ObFuncExprOperator { - public: +public: explicit ObExprCos(common::ObIAllocator& alloc); virtual ~ObExprCos(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& radian, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& radian_obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCos); }; diff --git a/src/sql/engine/expr/ob_expr_cosh.h b/src/sql/engine/expr/ob_expr_cosh.h index d37556ce0..6cb306d21 100644 --- a/src/sql/engine/expr/ob_expr_cosh.h +++ b/src/sql/engine/expr/ob_expr_cosh.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObExprCosh : public ObFuncExprOperator { - public: +public: explicit ObExprCosh(common::ObIAllocator& alloc); virtual ~ObExprCosh(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCosh); }; diff --git a/src/sql/engine/expr/ob_expr_ctxcat_analyzer.h b/src/sql/engine/expr/ob_expr_ctxcat_analyzer.h index a2b870cbb..276b99d6c 100644 --- a/src/sql/engine/expr/ob_expr_ctxcat_analyzer.h +++ b/src/sql/engine/expr/ob_expr_ctxcat_analyzer.h @@ -20,13 +20,13 @@ namespace oceanbase { namespace sql { class ObExprOperatorFactory; class ObExprCtxCatAnalyzer { - public: +public: ObExprCtxCatAnalyzer(ObExprOperatorFactory& expr_factory) : expr_factory_(expr_factory) {} int parse_search_keywords(common::ObObj& keyword_text, ObMatchAgainstMode mode_flag, ObIterExprOperator*& search_tree, common::ObIArray& keywords); - private: +private: int create_set_op_tree( common::ObIArray& set_keys, ObItemType set_op_type, ObIterExprOperator*& search_tree); int ft_get_simple_words( @@ -34,7 +34,7 @@ class ObExprCtxCatAnalyzer { int ft_get_boolean_words( common::ObObj& keyword_text, ObIterExprOperator*& search_tree, common::ObIArray& keywords); - private: +private: ObExprOperatorFactory& expr_factory_; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_cur_time.h b/src/sql/engine/expr/ob_expr_cur_time.h index abf70c471..f449e61b1 100644 --- a/src/sql/engine/expr/ob_expr_cur_time.h +++ b/src/sql/engine/expr/ob_expr_cur_time.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprUtcTimestamp : public ObFuncExprOperator { - public: +public: explicit ObExprUtcTimestamp(common::ObIAllocator& alloc); virtual ~ObExprUtcTimestamp(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,13 +26,13 @@ class ObExprUtcTimestamp : public ObFuncExprOperator { static int eval_utc_timestamp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprUtcTimestamp); }; class ObExprCurTimestamp : public ObFuncExprOperator { - public: +public: explicit ObExprCurTimestamp(common::ObIAllocator& alloc); virtual ~ObExprCurTimestamp(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -40,13 +40,13 @@ class ObExprCurTimestamp : public ObFuncExprOperator { static int eval_cur_timestamp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCurTimestamp); }; class ObExprSysdate : public ObFuncExprOperator { - public: +public: explicit ObExprSysdate(common::ObIAllocator& alloc); virtual ~ObExprSysdate(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const override; @@ -54,13 +54,13 @@ class ObExprSysdate : public ObFuncExprOperator { static int eval_sysdate(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprSysdate); }; class ObExprCurDate : public ObFuncExprOperator { - public: +public: explicit ObExprCurDate(common::ObIAllocator& alloc); virtual ~ObExprCurDate(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -68,13 +68,13 @@ class ObExprCurDate : public ObFuncExprOperator { static int eval_cur_date(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCurDate); }; class ObExprCurTime : public ObFuncExprOperator { - public: +public: explicit ObExprCurTime(common::ObIAllocator& alloc); virtual ~ObExprCurTime(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -82,7 +82,7 @@ class ObExprCurTime : public ObFuncExprOperator { static int eval_cur_time(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCurTime); }; diff --git a/src/sql/engine/expr/ob_expr_current_user.h b/src/sql/engine/expr/ob_expr_current_user.h index 108faa8b1..a030e5872 100644 --- a/src/sql/engine/expr/ob_expr_current_user.h +++ b/src/sql/engine/expr/ob_expr_current_user.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprCurrentUser : public ObStringExprOperator { - public: +public: explicit ObExprCurrentUser(common::ObIAllocator& alloc); virtual ~ObExprCurrentUser(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprCurrentUser : public ObStringExprOperator { static int eval_current_user(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprCurrentUser); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_database.h b/src/sql/engine/expr/ob_expr_database.h index 1fb3eaca0..475017f4f 100644 --- a/src/sql/engine/expr/ob_expr_database.h +++ b/src/sql/engine/expr/ob_expr_database.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprDatabase : public ObStringExprOperator { - public: +public: explicit ObExprDatabase(common::ObIAllocator& alloc); virtual ~ObExprDatabase(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprDatabase : public ObStringExprOperator { static int eval_database(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDatabase); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_date.h b/src/sql/engine/expr/ob_expr_date.h index 1a6f9625e..5033f0012 100644 --- a/src/sql/engine/expr/ob_expr_date.h +++ b/src/sql/engine/expr/ob_expr_date.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprDate : public ObFuncExprOperator { - public: +public: explicit ObExprDate(common::ObIAllocator& alloc); virtual ~ObExprDate(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -30,7 +30,7 @@ class ObExprDate : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_date(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprDate); }; diff --git a/src/sql/engine/expr/ob_expr_date_add.h b/src/sql/engine/expr/ob_expr_date_add.h index 9214ea6ed..9d6e92834 100644 --- a/src/sql/engine/expr/ob_expr_date_add.h +++ b/src/sql/engine/expr/ob_expr_date_add.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprDateAdjust : public ObFuncExprOperator { - public: +public: ObExprDateAdjust(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension = NOT_ROW_DIMENSION); @@ -28,12 +28,12 @@ class ObExprDateAdjust : public ObFuncExprOperator { const common::ObObj& unit, common::ObExprCtx& expr_ctx, bool is_add, const ObExprResType& res_type) const; static int calc_date_adjust(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, bool is_add); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDateAdjust); }; class ObExprDateAdd : public ObExprDateAdjust { - public: +public: explicit ObExprDateAdd(common::ObIAllocator& alloc); virtual ~ObExprDateAdd(){}; virtual int calc_result3(common::ObObj& result, const common::ObObj& date, const common::ObObj& interval, @@ -41,12 +41,12 @@ class ObExprDateAdd : public ObExprDateAdjust { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_date_add(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDateAdd); }; class ObExprDateSub : public ObExprDateAdjust { - public: +public: explicit ObExprDateSub(common::ObIAllocator& alloc); virtual ~ObExprDateSub(){}; virtual int calc_result3(common::ObObj& result, const common::ObObj& date, const common::ObObj& interval, @@ -54,12 +54,12 @@ class ObExprDateSub : public ObExprDateAdjust { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_date_sub(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDateSub); }; class ObExprAddMonths : public ObFuncExprOperator { - public: +public: explicit ObExprAddMonths(common::ObIAllocator& alloc); virtual ~ObExprAddMonths() {} @@ -70,12 +70,12 @@ class ObExprAddMonths : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_add_months(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprAddMonths); }; class ObExprLastDay : public ObFuncExprOperator { - public: +public: explicit ObExprLastDay(common::ObIAllocator& alloc); virtual ~ObExprLastDay() {} @@ -84,12 +84,12 @@ class ObExprLastDay : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_last_day(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLastDay); }; class ObExprNextDay : public ObFuncExprOperator { - public: +public: explicit ObExprNextDay(common::ObIAllocator& alloc); virtual ~ObExprNextDay() {} @@ -100,7 +100,7 @@ class ObExprNextDay : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_next_day(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNextDay); }; diff --git a/src/sql/engine/expr/ob_expr_date_diff.h b/src/sql/engine/expr/ob_expr_date_diff.h index c9da59f5b..19ddf0062 100644 --- a/src/sql/engine/expr/ob_expr_date_diff.h +++ b/src/sql/engine/expr/ob_expr_date_diff.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprDateDiff : public ObFuncExprOperator { - public: +public: explicit ObExprDateDiff(common::ObIAllocator& alloc); virtual ~ObExprDateDiff(); virtual int calc_result_type2( @@ -33,7 +33,7 @@ class ObExprDateDiff : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_date_diff(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprDateDiff); }; @@ -54,7 +54,7 @@ inline int ObExprDateDiff::calc_result_type2( } class ObExprMonthsBetween : public ObFuncExprOperator { - public: +public: explicit ObExprMonthsBetween(common::ObIAllocator& alloc); virtual ~ObExprMonthsBetween(); virtual int calc_result_type2( @@ -64,7 +64,7 @@ class ObExprMonthsBetween : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_months_between(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprMonthsBetween); }; diff --git a/src/sql/engine/expr/ob_expr_date_format.h b/src/sql/engine/expr/ob_expr_date_format.h index f9b350433..653d925c2 100644 --- a/src/sql/engine/expr/ob_expr_date_format.h +++ b/src/sql/engine/expr/ob_expr_date_format.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprDateFormat : public ObStringExprOperator { - public: +public: explicit ObExprDateFormat(common::ObIAllocator& alloc); virtual ~ObExprDateFormat(); virtual int calc_result_type2( @@ -31,7 +31,7 @@ class ObExprDateFormat : public ObStringExprOperator { static int calc_date_format(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int calc_date_format_invalid(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprDateFormat); diff --git a/src/sql/engine/expr/ob_expr_day_of_func.h b/src/sql/engine/expr/ob_expr_day_of_func.h index 9540e8ab4..a813f697a 100644 --- a/src/sql/engine/expr/ob_expr_day_of_func.h +++ b/src/sql/engine/expr/ob_expr_day_of_func.h @@ -19,40 +19,40 @@ namespace oceanbase { namespace sql { class ObExprDayOfMonth : public ObExprTimeBase { - public: +public: ObExprDayOfMonth(); explicit ObExprDayOfMonth(common::ObIAllocator& alloc); virtual ~ObExprDayOfMonth(); static int calc_dayofmonth(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDayOfMonth); }; class ObExprDayOfWeek : public ObExprTimeBase { - public: +public: ObExprDayOfWeek(); explicit ObExprDayOfWeek(common::ObIAllocator& alloc); virtual ~ObExprDayOfWeek(); static int calc_dayofweek(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDayOfWeek); }; class ObExprDayOfYear : public ObExprTimeBase { - public: +public: ObExprDayOfYear(); explicit ObExprDayOfYear(common::ObIAllocator& alloc); virtual ~ObExprDayOfYear(); static int calc_dayofyear(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDayOfYear); }; class ObExprToSeconds : public ObFuncExprOperator { - public: +public: ObExprToSeconds(); explicit ObExprToSeconds(common::ObIAllocator& alloc); virtual ~ObExprToSeconds(); @@ -63,7 +63,7 @@ class ObExprToSeconds : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_toseconds(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToSeconds); }; @@ -82,7 +82,7 @@ inline int ObExprToSeconds::calc_result_type1( } class ObExprSecToTime : public ObFuncExprOperator { - public: +public: ObExprSecToTime(); explicit ObExprSecToTime(common::ObIAllocator& alloc); virtual ~ObExprSecToTime(); @@ -93,7 +93,7 @@ class ObExprSecToTime : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_sectotime(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSecToTime); }; @@ -109,7 +109,7 @@ inline int ObExprSecToTime::calc_result_type1( } class ObExprTimeToSec : public ObFuncExprOperator { - public: +public: ObExprTimeToSec(); explicit ObExprTimeToSec(common::ObIAllocator& alloc); virtual ~ObExprTimeToSec(); @@ -120,7 +120,7 @@ class ObExprTimeToSec : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_timetosec(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprTimeToSec); }; @@ -137,7 +137,7 @@ inline int ObExprTimeToSec::calc_result_type1( } class ObExprSubtime : public ObFuncExprOperator { - public: +public: explicit ObExprSubtime(common::ObIAllocator& alloc); virtual ~ObExprSubtime(){}; virtual int calc_result_type2(ObExprResType& type, ObExprResType& date_arg, ObExprResType& time_arg, @@ -150,7 +150,7 @@ class ObExprSubtime : public ObFuncExprOperator { static int subtime_datetime(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int subtime_varchar(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubtime); }; diff --git a/src/sql/engine/expr/ob_expr_dbms_lob.h b/src/sql/engine/expr/ob_expr_dbms_lob.h index 9b2d6c8c4..9435f375d 100644 --- a/src/sql/engine/expr/ob_expr_dbms_lob.h +++ b/src/sql/engine/expr/ob_expr_dbms_lob.h @@ -22,18 +22,18 @@ namespace sql { // https://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_lob.htm#i998484 class ObExprDbmsLobGetLength : public ObFuncExprOperator { - public: +public: explicit ObExprDbmsLobGetLength(common::ObIAllocator& alloc); virtual ~ObExprDbmsLobGetLength(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& lob, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& lob, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobGetLength); }; class ObExprDbmsLobAppend : public ObStringExprOperator { - public: +public: explicit ObExprDbmsLobAppend(common::ObIAllocator& alloc); virtual ~ObExprDbmsLobAppend(); virtual int calc_result_type2( @@ -43,12 +43,12 @@ class ObExprDbmsLobAppend : public ObStringExprOperator { virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobAppend); }; class ObExprDbmsLobRead : public ObStringExprOperator { - public: +public: explicit ObExprDbmsLobRead(common::ObIAllocator& alloc); virtual ~ObExprDbmsLobRead(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3, @@ -58,12 +58,12 @@ class ObExprDbmsLobRead : public ObStringExprOperator { virtual int calc_result3(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, const common::ObObj& obj3, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobRead); }; class ObExprDbmsLobConvertToBlob : public ObStringExprOperator { - public: +public: explicit ObExprDbmsLobConvertToBlob(common::ObIAllocator& alloc); virtual ~ObExprDbmsLobConvertToBlob(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3, @@ -73,24 +73,24 @@ class ObExprDbmsLobConvertToBlob : public ObStringExprOperator { virtual int calc_result3(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, const common::ObObj& obj3, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobConvertToBlob); }; class ObExprDbmsLobCastClobToBlob : public ObStringExprOperator { - public: +public: explicit ObExprDbmsLobCastClobToBlob(common::ObIAllocator& alloc); virtual ~ObExprDbmsLobCastClobToBlob(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& clob, common::ObExprTypeCtx& type_ctx) const; static int calc(common::ObObj& result, const common::ObObj& obj, common::ObCastCtx& cast_ctx); virtual int calc_result1(common::ObObj& result, const common::ObObj& clob, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobCastClobToBlob); }; class ObExprDbmsLobConvertClobCharset : public ObStringExprOperator { - public: +public: explicit ObExprDbmsLobConvertClobCharset(common::ObIAllocator& alloc); virtual ~ObExprDbmsLobConvertClobCharset(); virtual int calc_result_type2( @@ -100,7 +100,7 @@ class ObExprDbmsLobConvertClobCharset : public ObStringExprOperator { virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobConvertClobCharset); }; diff --git a/src/sql/engine/expr/ob_expr_des_hex_str.h b/src/sql/engine/expr/ob_expr_des_hex_str.h index 7fc1459b1..82afbd7a5 100644 --- a/src/sql/engine/expr/ob_expr_des_hex_str.h +++ b/src/sql/engine/expr/ob_expr_des_hex_str.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprDesHexStr : public ObFuncExprOperator { - public: +public: explicit ObExprDesHexStr(common::ObIAllocator& alloc); virtual ~ObExprDesHexStr() {} @@ -30,11 +30,11 @@ class ObExprDesHexStr : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_des_hex_str(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int deserialize_hex_cstr( const char* buf, int64_t buf_len, common::ObExprStringBuf& string_buf, common::ObObj& obj); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDesHexStr); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_div.h b/src/sql/engine/expr/ob_expr_div.h index 0e293b06d..066632388 100644 --- a/src/sql/engine/expr/ob_expr_div.h +++ b/src/sql/engine/expr/ob_expr_div.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprDiv : public ObArithExprOperator { - public: +public: ObExprDiv(); explicit ObExprDiv(common::ObIAllocator& alloc, ObExprOperatorType type = T_OP_DIV); virtual ~ObExprDiv() @@ -58,7 +58,7 @@ class ObExprDiv : public ObArithExprOperator { ObEvalCtx& ctx, const ObExpr& expr); DISALLOW_COPY_AND_ASSIGN(ObExprDiv); - private: +private: static ObArithFunc div_funcs_[common::ObMaxTC]; static ObArithFunc avg_div_funcs_[common::ObMaxTC]; static const common::ObScale DIV_CALC_SCALE; @@ -68,7 +68,7 @@ class ObExprDiv : public ObArithExprOperator { // Div expr for aggregation, different with ObExprDiv: // No overflow check for double type. class ObExprAggDiv : public ObExprDiv { - public: +public: explicit ObExprAggDiv(common::ObIAllocator& alloc) : ObExprDiv(alloc, T_OP_AGG_DIV) {} }; diff --git a/src/sql/engine/expr/ob_expr_dll_udf.h b/src/sql/engine/expr/ob_expr_dll_udf.h index 062b4ed64..efba64dc0 100644 --- a/src/sql/engine/expr/ob_expr_dll_udf.h +++ b/src/sql/engine/expr/ob_expr_dll_udf.h @@ -28,7 +28,7 @@ class ObSqlExpression; class ObExprDllUdf : public ObFuncExprOperator { OB_UNIS_VERSION_V(1); - public: +public: explicit ObExprDllUdf(ObIAllocator& alloc); ObExprDllUdf(ObIAllocator& alloc, ObExprOperatorType type, const char* name); virtual ~ObExprDllUdf(); @@ -38,7 +38,7 @@ class ObExprDllUdf : public ObFuncExprOperator { virtual int calc_resultN( common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, common::ObExprCtx& expr_ctx) const; - public: +public: int set_udf_meta(const share::schema::ObUDFMeta& udf); int init_udf(const common::ObIArray& para_exprs); common::ObIArray& get_udf_attribute() @@ -55,7 +55,7 @@ class ObExprDllUdf : public ObFuncExprOperator { }; int add_const_expression(ObSqlExpression* sql_calc, int64_t idx_in_udf_arg); - protected: +protected: common::ObIAllocator& allocator_; ObNormalUdfFunction udf_func_; ObUdfFunction::ObUdfCtx udf_ctx_; diff --git a/src/sql/engine/expr/ob_expr_effective_tenant.h b/src/sql/engine/expr/ob_expr_effective_tenant.h index 439ed1594..009080784 100644 --- a/src/sql/engine/expr/ob_expr_effective_tenant.h +++ b/src/sql/engine/expr/ob_expr_effective_tenant.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprEffectiveTenant : public ObFuncExprOperator { - public: +public: explicit ObExprEffectiveTenant(common::ObIAllocator& alloc); virtual ~ObExprEffectiveTenant(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprEffectiveTenant : public ObFuncExprOperator { static int eval_effective_tenant(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprEffectiveTenant); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_effective_tenant_id.h b/src/sql/engine/expr/ob_expr_effective_tenant_id.h index 0891a80ef..41c4a8951 100644 --- a/src/sql/engine/expr/ob_expr_effective_tenant_id.h +++ b/src/sql/engine/expr/ob_expr_effective_tenant_id.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprEffectiveTenantId : public ObFuncExprOperator { - public: +public: explicit ObExprEffectiveTenantId(common::ObIAllocator& alloc); virtual ~ObExprEffectiveTenantId(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprEffectiveTenantId : public ObFuncExprOperator { static int eval_effective_tenant_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprEffectiveTenantId); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_elt.h b/src/sql/engine/expr/ob_expr_elt.h index 28fe5cccb..79dacfeb1 100644 --- a/src/sql/engine/expr/ob_expr_elt.h +++ b/src/sql/engine/expr/ob_expr_elt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprElt : public ObExprOperator { - public: +public: explicit ObExprElt(common::ObIAllocator& alloc); virtual ~ObExprElt(){}; @@ -35,7 +35,7 @@ class ObExprElt : public ObExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_elt(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprElt); }; diff --git a/src/sql/engine/expr/ob_expr_empty_lob.h b/src/sql/engine/expr/ob_expr_empty_lob.h index 565cb4f3d..6162a9e52 100644 --- a/src/sql/engine/expr/ob_expr_empty_lob.h +++ b/src/sql/engine/expr/ob_expr_empty_lob.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprEmptyClob : public ObFuncExprOperator { - public: +public: explicit ObExprEmptyClob(common::ObIAllocator& alloc); virtual ~ObExprEmptyClob(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -27,13 +27,13 @@ class ObExprEmptyClob : public ObFuncExprOperator { static int eval_empty_clob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprEmptyClob); }; class ObExprEmptyBlob : public ObFuncExprOperator { - public: +public: explicit ObExprEmptyBlob(common::ObIAllocator& alloc); virtual ~ObExprEmptyBlob(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -41,7 +41,7 @@ class ObExprEmptyBlob : public ObFuncExprOperator { static int eval_empty_blob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprEmptyBlob); }; diff --git a/src/sql/engine/expr/ob_expr_equal.h b/src/sql/engine/expr/ob_expr_equal.h index 4d8b21841..850fb1f7b 100644 --- a/src/sql/engine/expr/ob_expr_equal.h +++ b/src/sql/engine/expr/ob_expr_equal.h @@ -20,14 +20,14 @@ namespace oceanbase { namespace sql { class ObExprEqual : public ObRelationalExprOperator { - public: +public: ObExprEqual(); - explicit ObExprEqual(common::ObIAllocator &alloc); - virtual ~ObExprEqual() {}; - virtual int calc_result2(common::ObObj &result, const common::ObObj &obj1, - const common::ObObj &obj2, common::ObExprCtx &expr_ctx) const override; - virtual int calc_resultN(common::ObObj &result, const common::ObObj *objs_stack, - int64_t param_num, common::ObExprCtx &expr_ctx) const override; + explicit ObExprEqual(common::ObIAllocator& alloc); + virtual ~ObExprEqual(){}; + virtual int calc_result2(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, + common::ObExprCtx& expr_ctx) const override; + virtual int calc_resultN(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, + common::ObExprCtx& expr_ctx) const override; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override { @@ -35,25 +35,15 @@ class ObExprEqual : public ObRelationalExprOperator { return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr); } - static int calc(common::ObObj &result, - const common::ObObj &obj1, - const common::ObObj &obj2, - const common::ObCompareCtx &cmp_ctx, - common::ObCastCtx &cast_ctx); - static int calc_cast(common::ObObj &result, - const common::ObObj &obj1, - const common::ObObj &obj2, - const common::ObCompareCtx &cmp_ctx, - common::ObCastCtx &cast_ctx); - static int calc_without_cast(common::ObObj &result, - const common::ObObj &obj1, - const common::ObObj &obj2, - const common::ObCompareCtx &cmp_ctx, - bool &need_cast); - virtual int calc_result_type2(ObExprResType &type, - ObExprResType &type1, - ObExprResType &type2, - common::ObExprTypeCtx &type_ctx) const override; + static int calc(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, + const common::ObCompareCtx& cmp_ctx, common::ObCastCtx& cast_ctx); + static int calc_cast(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, + const common::ObCompareCtx& cmp_ctx, common::ObCastCtx& cast_ctx); + static int calc_without_cast(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, + const common::ObCompareCtx& cmp_ctx, bool& need_cast); + virtual int calc_result_type2( + ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const override; + private: DISALLOW_COPY_AND_ASSIGN(ObExprEqual); }; diff --git a/src/sql/engine/expr/ob_expr_estimate_ndv.h b/src/sql/engine/expr/ob_expr_estimate_ndv.h index 234c9cae7..7ce494a47 100644 --- a/src/sql/engine/expr/ob_expr_estimate_ndv.h +++ b/src/sql/engine/expr/ob_expr_estimate_ndv.h @@ -18,19 +18,15 @@ namespace oceanbase { namespace sql { class ObExprEstimateNdv : public ObFuncExprOperator { - public: +public: explicit ObExprEstimateNdv(common::ObIAllocator& alloc); virtual ~ObExprEstimateNdv(); - virtual int calc_result_type1(ObExprResType &type, - ObExprResType &type1, - common::ObExprTypeCtx &type_ctx) const override; - virtual int calc_result1(common::ObObj &result, - const common::ObObj &obj, - common::ObExprCtx &expr_ctx) const override; - static int llc_estimate_ndv(common::ObObj &result, const common::ObObj &obj, - common::ObExprCtx &expr_ctx); - static void llc_estimate_ndv(int64_t &result, const common::ObString &bitmap_str); - static int llc_estimate_ndv(double &estimate_ndv, const common::ObString &bitmap_buf); + virtual int calc_result_type1( + ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override; + virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const override; + static int llc_estimate_ndv(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx); + static void llc_estimate_ndv(int64_t& result, const common::ObString& bitmap_str); + static int llc_estimate_ndv(double& estimate_ndv, const common::ObString& bitmap_buf); // high several bits of hash value are used to store bucket_id, the param value must // remove these bits by left shift, the count of valid bits after removing is bit_width. static uint64_t llc_leading_zeros(uint64_t value, uint64_t bit_width); @@ -39,13 +35,13 @@ class ObExprEstimateNdv : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_estimate_ndv_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: static inline double llc_alpha_times_m_square(const uint64_t m); // the count of buckets should be between 16 and 65536, according to Google's HLLC paper. static const int LLC_NUM_BUCKETS_MIN = (1 << 4); static const int LLC_NUM_BUCKETS_MAX = (1 << 16); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprEstimateNdv); }; } /* namespace sql */ diff --git a/src/sql/engine/expr/ob_expr_exists.h b/src/sql/engine/expr/ob_expr_exists.h index f699f9990..8facf182f 100644 --- a/src/sql/engine/expr/ob_expr_exists.h +++ b/src/sql/engine/expr/ob_expr_exists.h @@ -16,22 +16,20 @@ namespace oceanbase { namespace sql { class ObExprExists : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprExists(common::ObIAllocator& alloc); virtual ~ObExprExists(); - virtual int calc_result_type1(ObExprResType &type, - ObExprResType &type1, - common::ObExprTypeCtx &type_ctx) const override; - virtual int calc_result1(common::ObObj &result, - const common::ObObj &obj1, - common::ObExprCtx &expr_ctx) const override; + virtual int calc_result_type1( + ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override; + virtual int calc_result1( + common::ObObj& result, const common::ObObj& obj1, common::ObExprCtx& expr_ctx) const override; virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int exists_eval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprExists); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_exp.h b/src/sql/engine/expr/ob_expr_exp.h index e4d82903d..0d885491e 100644 --- a/src/sql/engine/expr/ob_expr_exp.h +++ b/src/sql/engine/expr/ob_expr_exp.h @@ -18,17 +18,17 @@ namespace oceanbase { namespace sql { class ObExprExp : public ObFuncExprOperator { - public: +public: explicit ObExprExp(common::ObIAllocator& alloc); virtual ~ObExprExp(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprExp); - private: +private: }; } // namespace sql } // namespace oceanbase diff --git a/src/sql/engine/expr/ob_expr_extra_info_factory.h b/src/sql/engine/expr/ob_expr_extra_info_factory.h index 6f7e8c4f1..a986a60d9 100644 --- a/src/sql/engine/expr/ob_expr_extra_info_factory.h +++ b/src/sql/engine/expr/ob_expr_extra_info_factory.h @@ -22,7 +22,7 @@ namespace sql { class ObIExprExtraInfo; struct ObExprExtraInfoFactory { - public: +public: typedef int (*AllocExtraInfoFunc)( common::ObIAllocator& alloc, ObIExprExtraInfo*& extra_info, const ObExprOperatorType type); // allocate extra info @@ -35,11 +35,11 @@ struct ObExprExtraInfoFactory { return type > T_INVALID && type < T_MAX_OP && NULL != ALLOC_FUNS_[type]; } - private: +private: template static int alloc(common::ObIAllocator& alloc, ObIExprExtraInfo*& extra_info, const ObExprOperatorType type); - private: +private: static AllocExtraInfoFunc ALLOC_FUNS_[T_MAX_OP]; }; diff --git a/src/sql/engine/expr/ob_expr_extract.h b/src/sql/engine/expr/ob_expr_extract.h index 840935a49..bfcf3c71d 100644 --- a/src/sql/engine/expr/ob_expr_extract.h +++ b/src/sql/engine/expr/ob_expr_extract.h @@ -20,36 +20,26 @@ namespace oceanbase { namespace sql { class ObPhysicalPlanCtx; class ObExprExtract : public ObFuncExprOperator { - public: +public: explicit ObExprExtract(common::ObIAllocator& alloc); virtual ~ObExprExtract(); - virtual int calc_result_type2(ObExprResType &type, - ObExprResType &date_unit, - ObExprResType &date, - common::ObExprTypeCtx &type_ctx) const override; + virtual int calc_result_type2(ObExprResType& type, ObExprResType& date_unit, ObExprResType& date, + common::ObExprTypeCtx& type_ctx) const override; template static int calc(T& result, const int64_t date_unit, const T& date, common::ObObjType date_type, const common::ObCastMode cast_mode, const common::ObTimeZoneInfo* tz_info, const int64_t cur_ts_value); template - static int calc_oracle(T &result, - const int64_t date_unit, - const T &date, - common::ObObjType type, - const ObSQLSessionInfo *session, - common::ObIAllocator *calc_buf); - virtual int calc_result2(common::ObObj &result, - const common::ObObj &date_unit, - const common::ObObj &date, - common::ObExprCtx &expr_ctx) const override; - virtual int cg_expr(ObExprCGCtx &op_cg_ctx, - const ObRawExpr &raw_expr, - ObExpr &rt_expr) const override; - static int calc_extract_oracle(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum); - static int calc_extract_mysql(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum); + static int calc_oracle(T& result, const int64_t date_unit, const T& date, common::ObObjType type, + const ObSQLSessionInfo* session, common::ObIAllocator* calc_buf); + virtual int calc_result2(common::ObObj& result, const common::ObObj& date_unit, const common::ObObj& date, + common::ObExprCtx& expr_ctx) const override; + virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; + static int calc_extract_oracle(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); + static int calc_extract_mysql(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); + private: - int set_result_type_oracle(common::ObExprTypeCtx &type_ctx, - const ObExprResType &date_unit, - ObExprResType &res_type) const; + int set_result_type_oracle( + common::ObExprTypeCtx& type_ctx, const ObExprResType& date_unit, ObExprResType& res_type) const; // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprExtract); }; diff --git a/src/sql/engine/expr/ob_expr_field.h b/src/sql/engine/expr/ob_expr_field.h index 4ebd79b0a..eb74ab6f6 100644 --- a/src/sql/engine/expr/ob_expr_field.h +++ b/src/sql/engine/expr/ob_expr_field.h @@ -19,18 +19,18 @@ namespace oceanbase { namespace sql { class ObExprField : public ObVectorExprOperator { - public: +public: explicit ObExprField(common::ObIAllocator& alloc); virtual ~ObExprField(){}; virtual int assign(const ObExprOperator& other); - public: +public: // serialize and deserialize virtual int serialize(char* buf, const int64_t buf_len, int64_t& pos) const; virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos); virtual int64_t get_serialize_size() const; - public: +public: virtual int calc_result_typeN( ObExprResType& type, ObExprResType* type_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; @@ -49,10 +49,10 @@ class ObExprField : public ObVectorExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_field(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprField); - private: +private: bool need_cast_; }; diff --git a/src/sql/engine/expr/ob_expr_find_in_set.h b/src/sql/engine/expr/ob_expr_find_in_set.h index fdbae4454..3b1d4247e 100644 --- a/src/sql/engine/expr/ob_expr_find_in_set.h +++ b/src/sql/engine/expr/ob_expr_find_in_set.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprFindInSet : public ObFuncExprOperator { - public: +public: explicit ObExprFindInSet(common::ObIAllocator& alloc); virtual ~ObExprFindInSet(); virtual int calc_result_type2( @@ -29,7 +29,7 @@ class ObExprFindInSet : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_find_in_set_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprFindInSet); }; diff --git a/src/sql/engine/expr/ob_expr_format.h b/src/sql/engine/expr/ob_expr_format.h index 14c49a12b..7cad29e5a 100644 --- a/src/sql/engine/expr/ob_expr_format.h +++ b/src/sql/engine/expr/ob_expr_format.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObLocale { - public: +public: uint decimal_point_; uint thousand_sep_; const char* grouping_; @@ -34,7 +34,7 @@ class ObLocale { }; class ObExprFormat : public ObFuncExprOperator { - public: +public: explicit ObExprFormat(common::ObIAllocator& alloc); virtual ~ObExprFormat(); virtual int calc_result_typeN( @@ -44,7 +44,7 @@ class ObExprFormat : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_format_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: int get_origin_param_type(ObExprResType& ori_type) const; int convert_num_to_str( const common::ObObj* objs_array, common::ObExprCtx& expr_ctx, int64_t scale, common::ObString& num_str) const; diff --git a/src/sql/engine/expr/ob_expr_found_rows.h b/src/sql/engine/expr/ob_expr_found_rows.h index 41113111f..8c959e2b5 100644 --- a/src/sql/engine/expr/ob_expr_found_rows.h +++ b/src/sql/engine/expr/ob_expr_found_rows.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprFoundRows : public ObFuncExprOperator { - public: +public: explicit ObExprFoundRows(common::ObIAllocator& alloc); virtual ~ObExprFoundRows(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -25,7 +25,7 @@ class ObExprFoundRows : public ObFuncExprOperator { static int eval_found_rows(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFoundRows); }; diff --git a/src/sql/engine/expr/ob_expr_frame_info.h b/src/sql/engine/expr/ob_expr_frame_info.h index f1109c04a..282382d7f 100644 --- a/src/sql/engine/expr/ob_expr_frame_info.h +++ b/src/sql/engine/expr/ob_expr_frame_info.h @@ -24,7 +24,7 @@ class ObPhysicalPlanCtx; struct ObFrameInfo { OB_UNIS_VERSION_V(1); - public: +public: ObFrameInfo() : expr_cnt_(0), frame_idx_(0), frame_size_(0) {} @@ -34,7 +34,7 @@ struct ObFrameInfo { TO_STRING_KV(K_(expr_cnt), K_(frame_idx), K_(frame_size)); - public: +public: uint64_t expr_cnt_; uint32_t frame_idx_; uint64_t frame_size_; @@ -61,7 +61,7 @@ struct ObExprFrameInfo { TO_STRING_KV(K_(const_frame_ptrs), K_(const_frame), K_(dynamic_frame), K_(datum_frame)); - public: +public: // count of expression need context. exec_ctx pre allocate memory according to it. int64_t need_ctx_cnt_; // all physical expressions generated by expe_code_generator @@ -74,13 +74,13 @@ struct ObExprFrameInfo { }; struct ObPreCalcExprFrameInfo : public ObExprFrameInfo, public common::ObDLinkBase { - public: +public: ObPreCalcExprFrameInfo(common::ObIAllocator& allocator) : ObExprFrameInfo(allocator), pre_calc_rt_exprs_(allocator) {} int assign(const ObPreCalcExprFrameInfo& other, common::ObIAllocator& allocator); - public: +public: common::ObFixedArray pre_calc_rt_exprs_; }; } // end namespace sql diff --git a/src/sql/engine/expr/ob_expr_from_days.h b/src/sql/engine/expr/ob_expr_from_days.h index 27b737058..31dd090d6 100644 --- a/src/sql/engine/expr/ob_expr_from_days.h +++ b/src/sql/engine/expr/ob_expr_from_days.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprFromDays : public ObFuncExprOperator { - public: +public: explicit ObExprFromDays(common::ObIAllocator& alloc); virtual ~ObExprFromDays(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& date, common::ObExprTypeCtx& type_ctx) const; @@ -25,7 +25,7 @@ class ObExprFromDays : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_fromdays(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprFromDays); }; inline int ObExprFromDays::calc_result_type1( diff --git a/src/sql/engine/expr/ob_expr_from_tz.h b/src/sql/engine/expr/ob_expr_from_tz.h index 690bb72b4..f8bb409fe 100644 --- a/src/sql/engine/expr/ob_expr_from_tz.h +++ b/src/sql/engine/expr/ob_expr_from_tz.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprFromTz : public ObFuncExprOperator { - public: +public: explicit ObExprFromTz(common::ObIAllocator& alloc); virtual ~ObExprFromTz() {} @@ -32,7 +32,7 @@ class ObExprFromTz : public ObFuncExprOperator { static int eval_from_tz(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFromTz); }; diff --git a/src/sql/engine/expr/ob_expr_from_unix_time.h b/src/sql/engine/expr/ob_expr_from_unix_time.h index 95ec7026f..f0f07167f 100644 --- a/src/sql/engine/expr/ob_expr_from_unix_time.h +++ b/src/sql/engine/expr/ob_expr_from_unix_time.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprFromUnixTime : public ObFuncExprOperator { - public: +public: explicit ObExprFromUnixTime(common::ObIAllocator& alloc); virtual ~ObExprFromUnixTime(); virtual int calc_result_typeN( @@ -38,7 +38,7 @@ class ObExprFromUnixTime : public ObFuncExprOperator { static int eval_fromtime_special(const ObExpr& expr, ObEvalCtx& eval_ctx, ObDatum& expr_datum); - private: +private: static int calc( common::ObObj& result, const common::ObObj& param, const common::ObObj& format, common::ObExprCtx& expr_ctx); static int get_usec(const common::ObObj& param, common::ObExprCtx& expr_ctx, int64_t& value); diff --git a/src/sql/engine/expr/ob_expr_fun_default.h b/src/sql/engine/expr/ob_expr_fun_default.h index fd3079a5c..8ce646b5c 100644 --- a/src/sql/engine/expr/ob_expr_fun_default.h +++ b/src/sql/engine/expr/ob_expr_fun_default.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprFunDefault : public ObFuncExprOperator { - public: +public: explicit ObExprFunDefault(common::ObIAllocator& alloc); virtual ~ObExprFunDefault(); virtual int calc_result_typeN( @@ -28,7 +28,7 @@ class ObExprFunDefault : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_default_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprFunDefault); }; diff --git a/src/sql/engine/expr/ob_expr_fun_values.h b/src/sql/engine/expr/ob_expr_fun_values.h index e83edb491..5fc0a9a77 100644 --- a/src/sql/engine/expr/ob_expr_fun_values.h +++ b/src/sql/engine/expr/ob_expr_fun_values.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprFunValues : public ObFuncExprOperator { - public: +public: explicit ObExprFunValues(common::ObIAllocator& alloc); virtual ~ObExprFunValues(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprFunValues : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_values(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFunValues); }; diff --git a/src/sql/engine/expr/ob_expr_func_addr_to_part_id.h b/src/sql/engine/expr/ob_expr_func_addr_to_part_id.h index d9b657a8a..187c24cf9 100644 --- a/src/sql/engine/expr/ob_expr_func_addr_to_part_id.h +++ b/src/sql/engine/expr/ob_expr_func_addr_to_part_id.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprFuncAddrToPartId : public ObFuncExprOperator { - public: +public: explicit ObExprFuncAddrToPartId(common::ObIAllocator& alloc); virtual ~ObExprFuncAddrToPartId(); @@ -27,7 +27,7 @@ class ObExprFuncAddrToPartId : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_addr_to_part_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprFuncAddrToPartId); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_func_ceil.h b/src/sql/engine/expr/ob_expr_func_ceil.h index b027b2c75..b7ffe50f2 100644 --- a/src/sql/engine/expr/ob_expr_func_ceil.h +++ b/src/sql/engine/expr/ob_expr_func_ceil.h @@ -22,7 +22,7 @@ class ObExprCeilFloor : public ObFuncExprOperator { static const int16_t MAX_LIMIT_WITH_SCALE = 17; static const int16_t MAX_LIMIT_WITHOUT_SCALE = 18; - public: +public: ObExprCeilFloor(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension = NOT_ROW_DIMENSION); @@ -32,43 +32,43 @@ class ObExprCeilFloor : public ObFuncExprOperator { common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx, bool is_ceil) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprCeilFloor); }; class ObExprFuncCeil : public ObExprCeilFloor { - public: +public: explicit ObExprFuncCeil(common::ObIAllocator& alloc); virtual ~ObExprFuncCeil(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFuncCeil); }; class ObExprFuncCeiling : public ObExprCeilFloor { - public: +public: explicit ObExprFuncCeiling(common::ObIAllocator& alloc); virtual ~ObExprFuncCeiling(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFuncCeiling); }; class ObExprFuncFloor : public ObExprCeilFloor { - public: +public: explicit ObExprFuncFloor(common::ObIAllocator& alloc); virtual ~ObExprFuncFloor(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFuncFloor); }; diff --git a/src/sql/engine/expr/ob_expr_func_dump.h b/src/sql/engine/expr/ob_expr_func_dump.h index c9a60c5b1..53e20e617 100644 --- a/src/sql/engine/expr/ob_expr_func_dump.h +++ b/src/sql/engine/expr/ob_expr_func_dump.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprFuncDump : public ObStringExprOperator { - public: +public: explicit ObExprFuncDump(common::ObIAllocator& alloc); virtual ~ObExprFuncDump(); virtual int calc_resultN( @@ -30,7 +30,7 @@ class ObExprFuncDump : public ObStringExprOperator { static int eval_dump(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: int calc_params(const common::ObObj* objs, const int64_t param_num, int64_t& fmt_enum, int64_t& start_pos, int64_t& print_value_len) const; int calc_number(const common::ObObj& input, const int64_t fmt_enum, int64_t& start_pos, int64_t& print_value_len, diff --git a/src/sql/engine/expr/ob_expr_func_part_hash.h b/src/sql/engine/expr/ob_expr_func_part_hash.h index fae624773..0da64022b 100644 --- a/src/sql/engine/expr/ob_expr_func_part_hash.h +++ b/src/sql/engine/expr/ob_expr_func_part_hash.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObTaskExecutorCtx; class ObExprFuncPartOldHash : public ObFuncExprOperator { - public: +public: explicit ObExprFuncPartOldHash(common::ObIAllocator& alloc); virtual ~ObExprFuncPartOldHash(); virtual int calc_result_typeN( @@ -38,7 +38,7 @@ class ObExprFuncPartOldHash : public ObFuncExprOperator { static int eval_old_part_hash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int eval_oracle_old_part_hash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, uint64_t seed); - private: +private: static int eval_vt_old_part_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, ObTaskExecutorCtx& task_exec_ctx, const uint64_t table_id); static bool is_oracle_supported_type(const common::ObObjType type); @@ -50,7 +50,7 @@ class ObExprFuncPartOldHash : public ObFuncExprOperator { // call new hash functions, solve partition row skew problem class ObTaskExecutorCtx; class ObExprFuncPartHash : public ObFuncExprOperator { - public: +public: explicit ObExprFuncPartHash(common::ObIAllocator& alloc); virtual ~ObExprFuncPartHash(); virtual int calc_result_typeN( @@ -70,12 +70,12 @@ class ObExprFuncPartHash : public ObFuncExprOperator { static int eval_part_hash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int eval_oracle_part_hash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, uint64_t seed); - private: +private: static int eval_vt_part_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, ObTaskExecutorCtx& task_exec_ctx, const uint64_t table_id); static bool is_oracle_supported_type(const common::ObObjType type); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFuncPartHash); }; diff --git a/src/sql/engine/expr/ob_expr_func_partition_key.h b/src/sql/engine/expr/ob_expr_func_partition_key.h index 855cb3999..febafc7af 100644 --- a/src/sql/engine/expr/ob_expr_func_partition_key.h +++ b/src/sql/engine/expr/ob_expr_func_partition_key.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprFuncPartOldKey : public ObFuncExprOperator { - public: +public: explicit ObExprFuncPartOldKey(common::ObIAllocator& alloc); virtual ~ObExprFuncPartOldKey(); @@ -30,13 +30,13 @@ class ObExprFuncPartOldKey : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_part_old_key(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFuncPartOldKey); }; class ObExprFuncPartKey : public ObFuncExprOperator { - public: +public: explicit ObExprFuncPartKey(common::ObIAllocator& alloc); virtual ~ObExprFuncPartKey(); @@ -47,7 +47,7 @@ class ObExprFuncPartKey : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_partition_key(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFuncPartKey); }; @@ -55,7 +55,7 @@ class ObExprFuncPartKey : public ObFuncExprOperator { // key partitioning function, third version. // solve partition row skew problem class ObExprFuncPartNewKey : public ObFuncExprOperator { - public: +public: explicit ObExprFuncPartNewKey(common::ObIAllocator& alloc); virtual ~ObExprFuncPartNewKey(); @@ -66,7 +66,7 @@ class ObExprFuncPartNewKey : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_new_partition_key(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFuncPartNewKey); }; diff --git a/src/sql/engine/expr/ob_expr_func_round.h b/src/sql/engine/expr/ob_expr_func_round.h index 8bd8204cb..13e75ce6d 100644 --- a/src/sql/engine/expr/ob_expr_func_round.h +++ b/src/sql/engine/expr/ob_expr_func_round.h @@ -20,7 +20,7 @@ namespace sql { #define ROUND_MIN_SCALE -30 #define ROUND_MAX_SCALE 30 class ObExprFuncRound : public ObFuncExprOperator { - public: +public: explicit ObExprFuncRound(common::ObIAllocator& alloc); virtual ~ObExprFuncRound(); virtual int calc_result_typeN( @@ -29,7 +29,7 @@ class ObExprFuncRound : public ObFuncExprOperator { common::ObObj& result, const common::ObObj* objs, int64_t param_num, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const; int calc_result2( common::ObObj& result, const common::ObObj& input, const common::ObObj& param, common::ObExprCtx& expr_ctx) const; diff --git a/src/sql/engine/expr/ob_expr_func_sleep.h b/src/sql/engine/expr/ob_expr_func_sleep.h index c52277f20..0285d17b0 100644 --- a/src/sql/engine/expr/ob_expr_func_sleep.h +++ b/src/sql/engine/expr/ob_expr_func_sleep.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSleep : public ObFuncExprOperator { - public: +public: explicit ObExprSleep(common::ObIAllocator& alloc); virtual ~ObExprSleep(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& param, common::ObExprTypeCtx& type_ctx) const; @@ -28,10 +28,10 @@ class ObExprSleep : public ObFuncExprOperator { static int eval_sleep(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); virtual int cg_expr(ObExprCGCtx& ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: static const int64_t CHECK_INTERVAL_IN_US = 100 * 1000LL; static const int64_t SCALE_OF_SECOND = 9; // ns - private: +private: static int sleep(int64_t usec); static int get_usec(const common::number::ObNumber& nmb, int64_t& value, common::ObIAllocator& alloc); // disallow copy diff --git a/src/sql/engine/expr/ob_expr_get_sys_var.h b/src/sql/engine/expr/ob_expr_get_sys_var.h index 79248c7bc..6332b3f51 100644 --- a/src/sql/engine/expr/ob_expr_get_sys_var.h +++ b/src/sql/engine/expr/ob_expr_get_sys_var.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { // get_sys_var(name, scope) class ObExprGetSysVar : public ObFuncExprOperator { - public: +public: static const ObExprOperatorType op_type_; ObExprGetSysVar(); explicit ObExprGetSysVar(common::ObIAllocator& alloc); @@ -32,7 +32,7 @@ class ObExprGetSysVar : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_get_sys_val_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: static int calc_(common::ObObj& result, const common::ObString& var_name, const int64_t var_scope, ObSQLSessionInfo* session, ObExecContext* exec_ctx, common::ObIAllocator& alloc); static int get_session_var(common::ObObj& result, const common::ObString& var_name, common::ObIAllocator& alloc, @@ -40,7 +40,7 @@ class ObExprGetSysVar : public ObFuncExprOperator { static int get_sys_var_disp_obj(common::ObIAllocator& allocator, const ObSQLSessionInfo& session, const common::ObString& var_name, common::ObObj& disp_obj); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprGetSysVar); }; diff --git a/src/sql/engine/expr/ob_expr_get_user_var.h b/src/sql/engine/expr/ob_expr_get_user_var.h index cd23699ee..5a9b450a1 100644 --- a/src/sql/engine/expr/ob_expr_get_user_var.h +++ b/src/sql/engine/expr/ob_expr_get_user_var.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprGetUserVar : public ObFuncExprOperator { - public: +public: explicit ObExprGetUserVar(common::ObIAllocator& alloc); virtual ~ObExprGetUserVar(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -27,7 +27,7 @@ class ObExprGetUserVar : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& expr) const override; static int eval_get_user_var(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprGetUserVar); }; diff --git a/src/sql/engine/expr/ob_expr_greater_equal.h b/src/sql/engine/expr/ob_expr_greater_equal.h index b8baeb318..b89990956 100644 --- a/src/sql/engine/expr/ob_expr_greater_equal.h +++ b/src/sql/engine/expr/ob_expr_greater_equal.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprGreaterEqual : public ObRelationalExprOperator { - public: +public: ObExprGreaterEqual(); explicit ObExprGreaterEqual(common::ObIAllocator& alloc); virtual ~ObExprGreaterEqual(){}; @@ -32,7 +32,7 @@ class ObExprGreaterEqual : public ObRelationalExprOperator { return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprGreaterEqual); }; } // end namespace sql diff --git a/src/sql/engine/expr/ob_expr_greater_than.h b/src/sql/engine/expr/ob_expr_greater_than.h index 5aa7c4cd1..69cc50acd 100644 --- a/src/sql/engine/expr/ob_expr_greater_than.h +++ b/src/sql/engine/expr/ob_expr_greater_than.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprGreaterThan : public ObRelationalExprOperator { - public: +public: ObExprGreaterThan(); explicit ObExprGreaterThan(common::ObIAllocator& alloc); virtual ~ObExprGreaterThan(){}; @@ -34,7 +34,7 @@ class ObExprGreaterThan : public ObRelationalExprOperator { return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprGreaterThan); }; diff --git a/src/sql/engine/expr/ob_expr_greatest.h b/src/sql/engine/expr/ob_expr_greatest.h index 5622c5ff7..1da1cd903 100644 --- a/src/sql/engine/expr/ob_expr_greatest.h +++ b/src/sql/engine/expr/ob_expr_greatest.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprBaseGreatest : public ObExprBaseLeastGreatest { - public: +public: explicit ObExprBaseGreatest(common::ObIAllocator& alloc, int32_t param_num, ObExprOperatorType type = T_FUN_SYS_GREATEST, const char* name = N_GREATEST); virtual ~ObExprBaseGreatest(); @@ -32,41 +32,41 @@ class ObExprBaseGreatest : public ObExprBaseLeastGreatest { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_greatest(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprBaseGreatest); }; class ObExprGreatestMySQL : public ObExprBaseGreatest { - public: +public: explicit ObExprGreatestMySQL(common::ObIAllocator& alloc); virtual ~ObExprGreatestMySQL(); virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprGreatestMySQL); }; class ObExprGreatestMySQLInner : public ObExprBaseGreatest { - public: +public: explicit ObExprGreatestMySQLInner(common::ObIAllocator& alloc); virtual ~ObExprGreatestMySQLInner(); virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprGreatestMySQLInner); }; class ObExprOracleGreatest : public ObExprBaseGreatest { - public: +public: explicit ObExprOracleGreatest(common::ObIAllocator& alloc); virtual ~ObExprOracleGreatest(); virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOracleGreatest); }; diff --git a/src/sql/engine/expr/ob_expr_hex.h b/src/sql/engine/expr/ob_expr_hex.h index 858e568cb..b3c011caa 100644 --- a/src/sql/engine/expr/ob_expr_hex.h +++ b/src/sql/engine/expr/ob_expr_hex.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprHex : public ObStringExprOperator { - public: +public: explicit ObExprHex(common::ObIAllocator& alloc); virtual ~ObExprHex(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -29,12 +29,12 @@ class ObExprHex : public ObStringExprOperator { static int eval_hex(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // helper func static int get_uint64(const common::ObObj& obj, common::ObCastCtx& cast_ctx, uint64_t& out); static int number_uint64(const common::number::ObNumber& num_val, uint64_t& out); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprHex); }; diff --git a/src/sql/engine/expr/ob_expr_hextoraw.h b/src/sql/engine/expr/ob_expr_hextoraw.h index 2f65b14ad..227bb74da 100644 --- a/src/sql/engine/expr/ob_expr_hextoraw.h +++ b/src/sql/engine/expr/ob_expr_hextoraw.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprHextoraw : public ObStringExprOperator { - public: +public: explicit ObExprHextoraw(common::ObIAllocator& alloc); virtual ~ObExprHextoraw(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -27,7 +27,7 @@ class ObExprHextoraw : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_hextoraw_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprHextoraw); }; diff --git a/src/sql/engine/expr/ob_expr_host_ip.h b/src/sql/engine/expr/ob_expr_host_ip.h index 0b3c3554a..f71760949 100644 --- a/src/sql/engine/expr/ob_expr_host_ip.h +++ b/src/sql/engine/expr/ob_expr_host_ip.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprHostIP : public ObFuncExprOperator { - public: +public: explicit ObExprHostIP(common::ObIAllocator& alloc); virtual ~ObExprHostIP(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprHostIP : public ObFuncExprOperator { static int eval_host_ip(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprHostIP); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_ifnull.h b/src/sql/engine/expr/ob_expr_ifnull.h index c893f8c83..bd60e8f91 100644 --- a/src/sql/engine/expr/ob_expr_ifnull.h +++ b/src/sql/engine/expr/ob_expr_ifnull.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprIfNull : public ObFuncExprOperator { - public: +public: explicit ObExprIfNull(common::ObIAllocator& alloc); virtual ~ObExprIfNull(); virtual int calc_result_type2( @@ -28,10 +28,10 @@ class ObExprIfNull : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_ifnull_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprIfNull); - private: +private: // data members }; diff --git a/src/sql/engine/expr/ob_expr_in.h b/src/sql/engine/expr/ob_expr_in.h index ed03f91fe..36576d0da 100644 --- a/src/sql/engine/expr/ob_expr_in.h +++ b/src/sql/engine/expr/ob_expr_in.h @@ -47,7 +47,7 @@ struct HashMapMeta { */ template class Row { - public: +public: Row() : elems_(NULL) {} ~Row() @@ -66,12 +66,12 @@ class Row { } TO_STRING_KV(KP(elems_)); - private: +private: T* elems_; }; template struct RowKey { - public: +public: RowKey() : row_(), meta_(NULL) {} ~RowKey() @@ -84,7 +84,7 @@ struct RowKey { template class ObExprInHashMap { - public: +public: const static int HASH_CMP_TRUE = 0; const static int HASH_CMP_FALSE = -1; const static int HASH_CMP_UNKNOWN = 1; @@ -124,14 +124,14 @@ class ObExprInHashMap { meta_.cmp_funcs_ = cmp_funcs; } - private: +private: common::hash::ObHashMap, common::ObArray>, common::hash::NoPthreadDefendMode> map_; HashMapMeta meta_; }; template class ObExprInHashSet { - public: +public: ObExprInHashSet() : set_(), meta_() {} ~ObExprInHashSet() @@ -169,7 +169,7 @@ class ObExprInHashSet { meta_.cmp_funcs_ = cmp_funcs; } - private: +private: common::hash::ObHashSet, common::hash::NoPthreadDefendMode> set_; HashMapMeta meta_; }; @@ -179,7 +179,7 @@ class ObSubQueryIterator; class ObExprInOrNotIn : public ObVectorExprOperator { class ObExprInCtx : public ObExprOperatorCtx { - public: + public: ObExprInCtx() : ObExprOperatorCtx(), right_has_null(false), @@ -217,7 +217,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator { } } - public: + public: int init_hashset(int64_t param_num); int init_hashset_vecs(int64_t param_num, int64_t row_dimension, ObExecContext* exec_ctx); int init_static_engine_hashset(int64_t param_num); @@ -287,7 +287,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator { bool funcs_ptr_set; bool ctx_hash_null_; - private: + private: common::ObObj** right_objs_; common::ObDatum** right_datums_; common::hash::ObHashSet hashset_; @@ -311,7 +311,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator { OB_UNIS_VERSION_V(1); - public: +public: ObExprInOrNotIn(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name); virtual ~ObExprInOrNotIn(){}; virtual int calc_resultN( @@ -332,7 +332,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator { return true; } - public: +public: static int eval_in_with_row(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int eval_in_without_row(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int eval_in_with_row_fallback(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); @@ -341,7 +341,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator { static int eval_in_with_subquery(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int calc_for_row_static_engine(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, ObExpr** l_row); - public: +public: inline void set_param_all_const(bool all_const); inline void set_param_all_same_type(bool all_same_type); inline void set_param_all_same_cs_type(bool all_same_cs_type); @@ -349,7 +349,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator { // for func visit_in_expr , when left param is subquery set true inline void set_param_is_subquery(); // static bool nd_hash_; - protected: +protected: int calc(common::ObObj& result, const common::ObObj* objs, const common::ObIArray& cmp_types, int64_t param_num, common::ObCompareCtx& cmp_ctx, common::ObExprCtx& expr_ctx, common::ObCastCtx& cast_ctx) const; // like "select 1 from dual where (select 1, 2) in ((1,2), (3,4))" @@ -384,7 +384,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator { static int setup_row(ObExpr** expr, ObEvalCtx& ctx, const bool is_iter, const int64_t cmp_func_cnt, ObSubQueryIterator*& iter, ObExpr**& row); - protected: +protected: typedef uint32_t ObExprInParamFlag; static const uint32_t IN_PARAM_ALL_CONST = 1U << 0; static const uint32_t IN_PARAM_ALL_SAME_TYPE = 1U << 1; @@ -396,20 +396,20 @@ class ObExprInOrNotIn : public ObVectorExprOperator { }; class ObExprIn : public ObExprInOrNotIn { - public: +public: explicit ObExprIn(common::ObIAllocator& alloc); virtual ~ObExprIn(){}; - protected: +protected: virtual void set_result(common::ObObj& result, bool is_exist, bool param_exist_null) const; }; class ObExprNotIn : public ObExprInOrNotIn { - public: +public: explicit ObExprNotIn(common::ObIAllocator& alloc); virtual ~ObExprNotIn(){}; - protected: +protected: virtual void set_result(common::ObObj& result, bool is_exist, bool param_exist_null) const; }; diff --git a/src/sql/engine/expr/ob_expr_initcap.h b/src/sql/engine/expr/ob_expr_initcap.h index 8a90fc353..ff2ecda0e 100644 --- a/src/sql/engine/expr/ob_expr_initcap.h +++ b/src/sql/engine/expr/ob_expr_initcap.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprInitcap : public ObStringExprOperator { - public: +public: explicit ObExprInitcap(common::ObIAllocator& alloc); virtual ~ObExprInitcap(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -28,7 +28,7 @@ class ObExprInitcap : public ObStringExprOperator { static int initcap_string(const common::ObString& text, const common::ObCollationType cs_type, common::ObIAllocator* allocator, common::ObString& res_str); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprInitcap); }; diff --git a/src/sql/engine/expr/ob_expr_inner_trim.h b/src/sql/engine/expr/ob_expr_inner_trim.h index 9532eee44..6f437278c 100644 --- a/src/sql/engine/expr/ob_expr_inner_trim.h +++ b/src/sql/engine/expr/ob_expr_inner_trim.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprInnerTrim : public ObStringExprOperator { - public: +public: explicit ObExprInnerTrim(common::ObIAllocator& alloc); virtual ~ObExprInnerTrim(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& trim_type, ObExprResType& trim_pattern, @@ -28,7 +28,7 @@ class ObExprInnerTrim : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprInnerTrim); }; diff --git a/src/sql/engine/expr/ob_expr_insert.h b/src/sql/engine/expr/ob_expr_insert.h index 1d015aae5..58f0329b1 100644 --- a/src/sql/engine/expr/ob_expr_insert.h +++ b/src/sql/engine/expr/ob_expr_insert.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprInsert : public ObStringExprOperator { - public: +public: explicit ObExprInsert(common::ObIAllocator& alloc); virtual ~ObExprInsert(); virtual int calc_result(common::ObObj& result, const common::ObObj& text, const common::ObObj& start_pos, @@ -36,7 +36,7 @@ class ObExprInsert : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_expr_insert(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprInsert); }; diff --git a/src/sql/engine/expr/ob_expr_instr.h b/src/sql/engine/expr/ob_expr_instr.h index b6cf96c7b..f0755e70a 100644 --- a/src/sql/engine/expr/ob_expr_instr.h +++ b/src/sql/engine/expr/ob_expr_instr.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprInstr : public ObLocationExprOperator { - public: +public: ObExprInstr(); explicit ObExprInstr(common::ObIAllocator& alloc); virtual ~ObExprInstr(); @@ -25,12 +25,12 @@ class ObExprInstr : public ObLocationExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_mysql_instr_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprInstr); }; class ObExprOracleInstr : public ObLocationExprOperator { - public: +public: ObExprOracleInstr(); explicit ObExprOracleInstr(common::ObIAllocator& alloc); virtual ~ObExprOracleInstr(); @@ -47,7 +47,7 @@ class ObExprOracleInstr : public ObLocationExprOperator { static int calc(common::ObObj& result, const common::ObObj& heystack, const common::ObObj& needle, const common::ObObj& position, const common::ObObj& occurrence, common::ObExprCtx& expr_ctx); - private: +private: virtual int calc_result_type2( ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const; DISALLOW_COPY_AND_ASSIGN(ObExprOracleInstr); diff --git a/src/sql/engine/expr/ob_expr_instrb.h b/src/sql/engine/expr/ob_expr_instrb.h index 0a545dd51..0f391fe24 100644 --- a/src/sql/engine/expr/ob_expr_instrb.h +++ b/src/sql/engine/expr/ob_expr_instrb.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprInstrb : public ObLocationExprOperator { - public: +public: ObExprInstrb(); explicit ObExprInstrb(common::ObIAllocator& alloc); virtual ~ObExprInstrb(); @@ -30,7 +30,7 @@ class ObExprInstrb : public ObLocationExprOperator { static int search( const common::ObString& haystack, const common::ObString& needle, int64_t start, int64_t occ, int64_t& ret_idx); - private: +private: int calc(common::ObObj& result, const common::ObObj& heystack, const common::ObObj& needle, const common::ObObj& position, const common::ObObj& occurrence, common::ObExprCtx& expr_ctx) const; virtual int calc_result_type2( diff --git a/src/sql/engine/expr/ob_expr_int2ip.h b/src/sql/engine/expr/ob_expr_int2ip.h index 9cabbb64d..111bc3fe4 100644 --- a/src/sql/engine/expr/ob_expr_int2ip.h +++ b/src/sql/engine/expr/ob_expr_int2ip.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprInt2ip : public ObStringExprOperator { - public: +public: explicit ObExprInt2ip(common::ObIAllocator& alloc); virtual ~ObExprInt2ip(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -27,12 +27,12 @@ class ObExprInt2ip : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int int2ip_varchar(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // helper func static int int2ip(common::ObObj& result, const int64_t text, common::ObExprStringBuf& string_buf); static int int2ip(common::ObDatum& result, const int64_t text); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprInt2ip); }; diff --git a/src/sql/engine/expr/ob_expr_int_div.h b/src/sql/engine/expr/ob_expr_int_div.h index a175443a1..f41496b30 100644 --- a/src/sql/engine/expr/ob_expr_int_div.h +++ b/src/sql/engine/expr/ob_expr_int_div.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprIntDiv : public ObArithExprOperator { - public: +public: ObExprIntDiv(); explicit ObExprIntDiv(common::ObIAllocator& alloc); virtual ~ObExprIntDiv(){}; @@ -35,7 +35,7 @@ class ObExprIntDiv : public ObArithExprOperator { // temporary used, remove after all expr converted virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: OB_INLINE static int intdiv_int(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObIAllocator* allocator, common::ObScale scale); OB_INLINE static int intdiv_uint(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, diff --git a/src/sql/engine/expr/ob_expr_interval.h b/src/sql/engine/expr/ob_expr_interval.h index d6d470f8b..270c13c8b 100644 --- a/src/sql/engine/expr/ob_expr_interval.h +++ b/src/sql/engine/expr/ob_expr_interval.h @@ -24,7 +24,7 @@ namespace sql { class ObExprInterval : public ObExprOperator { OB_UNIS_VERSION_V(1); - public: +public: explicit ObExprInterval(common::ObIAllocator& alloc); virtual ~ObExprInterval() @@ -44,7 +44,7 @@ class ObExprInterval : public ObExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_interval_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: bool use_binary_search_; // use binary search or sequential search during calc }; diff --git a/src/sql/engine/expr/ob_expr_ip2int.h b/src/sql/engine/expr/ob_expr_ip2int.h index edb2424c3..26f1b33c9 100644 --- a/src/sql/engine/expr/ob_expr_ip2int.h +++ b/src/sql/engine/expr/ob_expr_ip2int.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprIp2int : public ObFuncExprOperator { - public: +public: explicit ObExprIp2int(common::ObIAllocator& alloc); virtual ~ObExprIp2int(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -27,12 +27,12 @@ class ObExprIp2int : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int ip2int_varchar(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // helper func template static int ip2int(T& result, const common::ObString& text); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprIp2int); }; diff --git a/src/sql/engine/expr/ob_expr_is.h b/src/sql/engine/expr/ob_expr_is.h index a77789ecb..bde4e24e1 100644 --- a/src/sql/engine/expr/ob_expr_is.h +++ b/src/sql/engine/expr/ob_expr_is.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObConstRawExpr; class ObExprIsBase : public ObRelationalExprOperator { - public: +public: // ObExprIsBase(); explicit ObExprIsBase(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name); virtual ~ObExprIsBase(){}; @@ -43,17 +43,17 @@ class ObExprIsBase : public ObRelationalExprOperator { template static int is_zero(T number); - private: +private: // types and constants - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprIsBase); // function members - private: +private: // data members }; class ObExprIs : public ObExprIsBase { - public: +public: // ObExprIs() {} explicit ObExprIs(common::ObIAllocator& alloc) : ObExprIsBase(alloc, T_OP_IS, N_IS){}; virtual ~ObExprIs(){}; @@ -74,17 +74,17 @@ class ObExprIs : public ObExprIsBase { static int number_is_true(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int number_is_false(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // types and constants - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprIs); // function members - private: +private: // data members }; class ObExprIsNot : public ObExprIsBase { - public: +public: explicit ObExprIsNot(common::ObIAllocator& alloc) : ObExprIsBase(alloc, T_OP_IS_NOT, N_IS_NOT){}; virtual ~ObExprIsNot(){}; @@ -103,12 +103,12 @@ class ObExprIsNot : public ObExprIsBase { static int number_is_not_true(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int number_is_not_false(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // types and constants - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprIsNot); // function members - private: +private: // data members }; diff --git a/src/sql/engine/expr/ob_expr_is_serving_tenant.h b/src/sql/engine/expr/ob_expr_is_serving_tenant.h index 5de8045e3..8df4692e1 100644 --- a/src/sql/engine/expr/ob_expr_is_serving_tenant.h +++ b/src/sql/engine/expr/ob_expr_is_serving_tenant.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprIsServingTenant : public ObFuncExprOperator { - public: +public: explicit ObExprIsServingTenant(common::ObIAllocator& alloc); virtual ~ObExprIsServingTenant(); @@ -30,7 +30,7 @@ class ObExprIsServingTenant : public ObFuncExprOperator { static int eval_is_serving_tenant(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int check_serving_tenant( bool& serving, ObExecContext& exec_ctx, const common::ObString& ip, const int64_t port, const uint64_t tenant_id); /* functions */ diff --git a/src/sql/engine/expr/ob_expr_last_exec_id.h b/src/sql/engine/expr/ob_expr_last_exec_id.h index a25ac87b8..ab651a260 100644 --- a/src/sql/engine/expr/ob_expr_last_exec_id.h +++ b/src/sql/engine/expr/ob_expr_last_exec_id.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprLastExecId : public ObStringExprOperator { - public: +public: explicit ObExprLastExecId(common::ObIAllocator& alloc); virtual ~ObExprLastExecId(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -24,7 +24,7 @@ class ObExprLastExecId : public ObStringExprOperator { static int eval_last_exec_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLastExecId); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_last_insert_id.h b/src/sql/engine/expr/ob_expr_last_insert_id.h index b8fe73601..daa9ceeb0 100644 --- a/src/sql/engine/expr/ob_expr_last_insert_id.h +++ b/src/sql/engine/expr/ob_expr_last_insert_id.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprLastInsertID : public ObFuncExprOperator { - public: +public: ObExprLastInsertID(); explicit ObExprLastInsertID(common::ObIAllocator& alloc); virtual ~ObExprLastInsertID(); @@ -31,7 +31,7 @@ class ObExprLastInsertID : public ObFuncExprOperator { static int eval_last_insert_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLastInsertID); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_last_trace_id.h b/src/sql/engine/expr/ob_expr_last_trace_id.h index 375710354..6f19090dc 100644 --- a/src/sql/engine/expr/ob_expr_last_trace_id.h +++ b/src/sql/engine/expr/ob_expr_last_trace_id.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprLastTraceId : public ObStringExprOperator { - public: +public: explicit ObExprLastTraceId(common::ObIAllocator& alloc); virtual ~ObExprLastTraceId(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprLastTraceId : public ObStringExprOperator { static int eval_last_trace_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLastTraceId); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_least.h b/src/sql/engine/expr/ob_expr_least.h index 6f4275462..6f59590ed 100644 --- a/src/sql/engine/expr/ob_expr_least.h +++ b/src/sql/engine/expr/ob_expr_least.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprBaseLeastGreatest : public ObMinMaxExprOperator { - public: +public: explicit ObExprBaseLeastGreatest( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num); virtual ~ObExprBaseLeastGreatest(); @@ -29,13 +29,13 @@ class ObExprBaseLeastGreatest : public ObMinMaxExprOperator { void set_param_type(const ObExprResType& type, ObExprResType* types, int64_t param_num) const; static int calc(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, bool least); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprBaseLeastGreatest); }; class ObExprBaseLeast : public ObExprBaseLeastGreatest { - public: +public: explicit ObExprBaseLeast(common::ObIAllocator& alloc, int32_t param_num, ObExprOperatorType type = T_FUN_SYS_LEAST, const char* name = N_LEAST); virtual ~ObExprBaseLeast(); @@ -48,41 +48,41 @@ class ObExprBaseLeast : public ObExprBaseLeastGreatest { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_least(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprBaseLeast); }; class ObExprLeastMySQL : public ObExprBaseLeast { - public: +public: explicit ObExprLeastMySQL(common::ObIAllocator& alloc); virtual ~ObExprLeastMySQL(); virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLeastMySQL); }; class ObExprLeastMySQLInner : public ObExprBaseLeast { - public: +public: explicit ObExprLeastMySQLInner(common::ObIAllocator& alloc); virtual ~ObExprLeastMySQLInner(); virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLeastMySQLInner); }; class ObExprOracleLeast : public ObExprBaseLeast { - public: +public: explicit ObExprOracleLeast(common::ObIAllocator& alloc); virtual ~ObExprOracleLeast(); virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOracleLeast); }; diff --git a/src/sql/engine/expr/ob_expr_left.h b/src/sql/engine/expr/ob_expr_left.h index 8d3478af3..09ffb11ef 100644 --- a/src/sql/engine/expr/ob_expr_left.h +++ b/src/sql/engine/expr/ob_expr_left.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprLeft : public ObStringExprOperator { - public: +public: explicit ObExprLeft(common::ObIAllocator& alloc); virtual ~ObExprLeft(); virtual int calc_result_type2( @@ -27,7 +27,7 @@ class ObExprLeft : public ObStringExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& type_ctx) const; int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLeft); }; } /* namespace sql */ diff --git a/src/sql/engine/expr/ob_expr_length.h b/src/sql/engine/expr/ob_expr_length.h index 92870261a..e35d5bf7b 100644 --- a/src/sql/engine/expr/ob_expr_length.h +++ b/src/sql/engine/expr/ob_expr_length.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprLength : public ObFuncExprOperator { - public: +public: explicit ObExprLength(common::ObIAllocator& alloc); virtual ~ObExprLength(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -29,7 +29,7 @@ class ObExprLength : public ObFuncExprOperator { static int calc_oracle_mode(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int calc_mysql_mode(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLength); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_lengthb.h b/src/sql/engine/expr/ob_expr_lengthb.h index 67d637875..b8e87ea13 100644 --- a/src/sql/engine/expr/ob_expr_lengthb.h +++ b/src/sql/engine/expr/ob_expr_lengthb.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObExprLengthb : public ObFuncExprOperator { - public: +public: explicit ObExprLengthb(common::ObIAllocator& alloc); virtual ~ObExprLengthb(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -30,7 +30,7 @@ class ObExprLengthb : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_lengthb_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLengthb); }; diff --git a/src/sql/engine/expr/ob_expr_less_equal.h b/src/sql/engine/expr/ob_expr_less_equal.h index 0c6a946dc..0c349fc80 100644 --- a/src/sql/engine/expr/ob_expr_less_equal.h +++ b/src/sql/engine/expr/ob_expr_less_equal.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprLessEqual : public ObRelationalExprOperator { - public: +public: ObExprLessEqual(); explicit ObExprLessEqual(common::ObIAllocator& alloc); virtual ~ObExprLessEqual(){}; @@ -36,7 +36,7 @@ class ObExprLessEqual : public ObRelationalExprOperator { return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLessEqual); }; diff --git a/src/sql/engine/expr/ob_expr_less_than.h b/src/sql/engine/expr/ob_expr_less_than.h index 48821a744..5d270d04b 100644 --- a/src/sql/engine/expr/ob_expr_less_than.h +++ b/src/sql/engine/expr/ob_expr_less_than.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprLessThan : public ObRelationalExprOperator { - public: +public: ObExprLessThan(); explicit ObExprLessThan(common::ObIAllocator& alloc); virtual ~ObExprLessThan(){}; @@ -38,7 +38,7 @@ class ObExprLessThan : public ObRelationalExprOperator { return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLessThan); }; diff --git a/src/sql/engine/expr/ob_expr_like.h b/src/sql/engine/expr/ob_expr_like.h index 1821247ce..91d7a5a99 100644 --- a/src/sql/engine/expr/ob_expr_like.h +++ b/src/sql/engine/expr/ob_expr_like.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprLike : public ObFuncExprOperator { class ObExprLikeContext : public ObExprOperatorCtx { - public: + public: enum INSTR_MODE { START_WITH_PERCENT_SIGN = 0, //"%%a",etc START_END_WITH_PERCENT_SIGN = 1, //"%abc%%",etc @@ -91,7 +91,7 @@ class ObExprLike : public ObFuncExprOperator { }; OB_UNIS_VERSION_V(1); - public: +public: explicit ObExprLike(common::ObIAllocator& alloc); virtual ~ObExprLike(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3, @@ -138,7 +138,7 @@ class ObExprLike : public ObFuncExprOperator { static int like_varchar(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: enum STATE { INIT = 0, PERCENT = 1, //"%", "%%", "%%%",etc @@ -170,7 +170,7 @@ class ObExprLike : public ObFuncExprOperator { const common::ObString pattern_val, bool null_escape, const common::ObString escape_val, bool is_static_engine); DISALLOW_COPY_AND_ASSIGN(ObExprLike); - private: +private: // we may perform optimization via instr only when it holds that // is_text_literal_ == false and is_pattern_literal_ == true and is_escape_literal_ == true bool is_pattern_literal_; diff --git a/src/sql/engine/expr/ob_expr_ln.h b/src/sql/engine/expr/ob_expr_ln.h index c8c50a697..f0bf67b31 100644 --- a/src/sql/engine/expr/ob_expr_ln.h +++ b/src/sql/engine/expr/ob_expr_ln.h @@ -18,20 +18,20 @@ namespace oceanbase { namespace sql { class ObExprLn : public ObFuncExprOperator { - public: +public: explicit ObExprLn(common::ObIAllocator& alloc); virtual ~ObExprLn(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // help func static int calc_mysql(common::ObObj& reult, double val); static int calc_oracle(common::ObObj& result, double val); DISALLOW_COPY_AND_ASSIGN(ObExprLn); - private: +private: }; } // namespace sql } // namespace oceanbase diff --git a/src/sql/engine/expr/ob_expr_lnnvl.h b/src/sql/engine/expr/ob_expr_lnnvl.h index a164cd40b..2794ad3a8 100644 --- a/src/sql/engine/expr/ob_expr_lnnvl.h +++ b/src/sql/engine/expr/ob_expr_lnnvl.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprFuncLnnvl : public ObFuncExprOperator { - public: +public: explicit ObExprFuncLnnvl(common::ObIAllocator& alloc); virtual ~ObExprFuncLnnvl(); virtual int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const; @@ -27,7 +27,7 @@ class ObExprFuncLnnvl : public ObFuncExprOperator { static int eval_lnnvl(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprFuncLnnvl); }; diff --git a/src/sql/engine/expr/ob_expr_locate.h b/src/sql/engine/expr/ob_expr_locate.h index a00d9d52a..19afc9144 100644 --- a/src/sql/engine/expr/ob_expr_locate.h +++ b/src/sql/engine/expr/ob_expr_locate.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprLocate : public ObLocationExprOperator { - public: +public: explicit ObExprLocate(common::ObIAllocator& alloc); virtual ~ObExprLocate(); virtual int calc_result_typeN( @@ -25,7 +25,7 @@ class ObExprLocate : public ObLocationExprOperator { virtual int calc_resultN( common::ObObj& result, const common::ObObj* objs_array, int64_t param_num, common::ObExprCtx& expr_ctx) const; - private: +private: static const int8_t PARAM_NUM_TWO = 2; static const int8_t PARAM_NUM_THREE = 3; diff --git a/src/sql/engine/expr/ob_expr_log.h b/src/sql/engine/expr/ob_expr_log.h index b5cba7ddb..e28ec5ed2 100644 --- a/src/sql/engine/expr/ob_expr_log.h +++ b/src/sql/engine/expr/ob_expr_log.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { // LOG([base,] expression), when base is not specified, it is same as LN. class ObExprLog : public ObExprOperator { - public: +public: explicit ObExprLog(common::ObIAllocator& alloc); virtual ~ObExprLog(){}; @@ -29,7 +29,7 @@ class ObExprLog : public ObExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLog) const; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_log10.h b/src/sql/engine/expr/ob_expr_log10.h index a47b5953a..a7a70f2f5 100644 --- a/src/sql/engine/expr/ob_expr_log10.h +++ b/src/sql/engine/expr/ob_expr_log10.h @@ -18,14 +18,14 @@ namespace oceanbase { namespace sql { class ObExprLog10 : public ObFuncExprOperator { - public: +public: explicit ObExprLog10(common::ObIAllocator& alloc); virtual ~ObExprLog10(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLog10); }; diff --git a/src/sql/engine/expr/ob_expr_log2.h b/src/sql/engine/expr/ob_expr_log2.h index b709bb7fe..83080e23e 100644 --- a/src/sql/engine/expr/ob_expr_log2.h +++ b/src/sql/engine/expr/ob_expr_log2.h @@ -18,14 +18,14 @@ namespace oceanbase { namespace sql { class ObExprLog2 : public ObFuncExprOperator { - public: +public: explicit ObExprLog2(common::ObIAllocator& alloc); virtual ~ObExprLog2(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLog2); }; diff --git a/src/sql/engine/expr/ob_expr_lower.h b/src/sql/engine/expr/ob_expr_lower.h index a463e661a..27931230c 100644 --- a/src/sql/engine/expr/ob_expr_lower.h +++ b/src/sql/engine/expr/ob_expr_lower.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprLowerUpper : public ObStringExprOperator { - public: +public: static const char SEPARATOR_IN_NLS_SORT_PARAM = '='; ObExprLowerUpper(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num); virtual ~ObExprLowerUpper() @@ -38,19 +38,19 @@ class ObExprLowerUpper : public ObStringExprOperator { int cg_expr_common(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; int cg_expr_nls_common(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - protected: +protected: virtual int calc(const common::ObCollationType cs_type, char* src, int32_t src_len, char* dest, int32_t det_len, int32_t& out_len) const = 0; virtual int32_t get_case_mutiply(const common::ObCollationType cs_type) const = 0; - private: +private: int calc(common::ObObj& result, const common::ObString& text, common::ObCollationType cs_type, common::ObIAllocator& calc_buf) const; DISALLOW_COPY_AND_ASSIGN(ObExprLowerUpper); }; class ObExprLower : public ObExprLowerUpper { - public: +public: explicit ObExprLower(common::ObIAllocator& alloc); virtual ~ObExprLower() {} @@ -60,12 +60,12 @@ class ObExprLower : public ObExprLowerUpper { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_lower(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLower); }; class ObExprUpper : public ObExprLowerUpper { - public: +public: explicit ObExprUpper(common::ObIAllocator& alloc); virtual ~ObExprUpper() {} @@ -75,12 +75,12 @@ class ObExprUpper : public ObExprLowerUpper { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_upper(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUpper); }; class ObExprNlsLower : public ObExprLowerUpper { - public: +public: explicit ObExprNlsLower(common::ObIAllocator& alloc); virtual ~ObExprNlsLower() {} @@ -90,12 +90,12 @@ class ObExprNlsLower : public ObExprLowerUpper { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_lower(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNlsLower); }; class ObExprNlsUpper : public ObExprLowerUpper { - public: +public: explicit ObExprNlsUpper(common::ObIAllocator& alloc); virtual ~ObExprNlsUpper() {} @@ -105,7 +105,7 @@ class ObExprNlsUpper : public ObExprLowerUpper { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_upper(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNlsUpper); }; diff --git a/src/sql/engine/expr/ob_expr_lrpad.h b/src/sql/engine/expr/ob_expr_lrpad.h index 5486cb9a9..f0578e746 100644 --- a/src/sql/engine/expr/ob_expr_lrpad.h +++ b/src/sql/engine/expr/ob_expr_lrpad.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprBaseLRpad : public ObStringExprOperator { - public: +public: enum LRpadType { LPAD_TYPE = 0, RPAD_TYPE = 1 }; explicit ObExprBaseLRpad(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num); @@ -65,12 +65,12 @@ class ObExprBaseLRpad : public ObStringExprOperator { static int calc_oracle(LRpadType pad_type, const ObExpr& expr, const common::ObDatum& text, const common::ObDatum& len, const common::ObDatum& pad_text, common::ObIAllocator& res_alloc, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBaseLRpad); }; class ObExprLpad : public ObExprBaseLRpad { - public: +public: explicit ObExprLpad(common::ObIAllocator& alloc); virtual ~ObExprLpad(); @@ -83,12 +83,12 @@ class ObExprLpad : public ObExprBaseLRpad { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_mysql_lpad_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLpad); }; class ObExprRpad : public ObExprBaseLRpad { - public: +public: explicit ObExprRpad(common::ObIAllocator& alloc); explicit ObExprRpad(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name); @@ -103,12 +103,12 @@ class ObExprRpad : public ObExprBaseLRpad { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_mysql_rpad_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRpad); }; class ObExprOracleLpad : public ObExprBaseLRpad { - public: +public: explicit ObExprOracleLpad(common::ObIAllocator& alloc); virtual ~ObExprOracleLpad(); @@ -121,12 +121,12 @@ class ObExprOracleLpad : public ObExprBaseLRpad { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_oracle_lpad_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOracleLpad); }; class ObExprOracleRpad : public ObExprBaseLRpad { - public: +public: explicit ObExprOracleRpad(common::ObIAllocator& alloc); virtual ~ObExprOracleRpad(); @@ -139,7 +139,7 @@ class ObExprOracleRpad : public ObExprBaseLRpad { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_oracle_rpad_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOracleRpad); }; diff --git a/src/sql/engine/expr/ob_expr_make_set.h b/src/sql/engine/expr/ob_expr_make_set.h index 3680fdb14..7aca34e29 100644 --- a/src/sql/engine/expr/ob_expr_make_set.h +++ b/src/sql/engine/expr/ob_expr_make_set.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprMakeSet : public ObStringExprOperator { - public: +public: explicit ObExprMakeSet(common::ObIAllocator& alloc); virtual ~ObExprMakeSet(); virtual int calc_result_typeN( @@ -29,7 +29,7 @@ class ObExprMakeSet : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_make_set_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprMakeSet); }; diff --git a/src/sql/engine/expr/ob_expr_maketime.h b/src/sql/engine/expr/ob_expr_maketime.h index 9e21d5dd1..75e2f462d 100644 --- a/src/sql/engine/expr/ob_expr_maketime.h +++ b/src/sql/engine/expr/ob_expr_maketime.h @@ -26,7 +26,7 @@ namespace sql { // mysql> SELECT MAKETIME(12,15,30); // -> '12:15:30' class ObExprMakeTime : public ObFuncExprOperator { - public: +public: explicit ObExprMakeTime(common::ObIAllocator& alloc); virtual ~ObExprMakeTime(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3, @@ -37,7 +37,7 @@ class ObExprMakeTime : public ObFuncExprOperator { static int eval_maketime(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& result); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // Parse ObNumber object (arg: sec) and split it into integer/quotient part and remainder part. // Fetch the integer part. // E.G: diff --git a/src/sql/engine/expr/ob_expr_md5.h b/src/sql/engine/expr/ob_expr_md5.h index 4b8d4017b..3c78ceee2 100644 --- a/src/sql/engine/expr/ob_expr_md5.h +++ b/src/sql/engine/expr/ob_expr_md5.h @@ -18,18 +18,18 @@ namespace oceanbase { namespace sql { class ObExprMd5 : public ObStringExprOperator { - public: +public: ObExprMd5(); explicit ObExprMd5(common::ObIAllocator& alloc); virtual ~ObExprMd5(); - public: +public: virtual int calc_result_type1(ObExprResType& type, ObExprResType& str, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& str_obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_md5(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: int calc_md5(common::ObObj& result, const common::ObString& str, common::ObIAllocator* allocator, common::ObCollationType col_type) const; static const common::ObString::obstr_size_t MD5_LENGTH = 16; diff --git a/src/sql/engine/expr/ob_expr_merging_frozen_time.h b/src/sql/engine/expr/ob_expr_merging_frozen_time.h index de1ce5eeb..b62d86f12 100644 --- a/src/sql/engine/expr/ob_expr_merging_frozen_time.h +++ b/src/sql/engine/expr/ob_expr_merging_frozen_time.h @@ -17,12 +17,12 @@ namespace oceanbase { namespace sql { class ObExprMergingFrozenTime : public ObFuncExprOperator { - public: +public: explicit ObExprMergingFrozenTime(common::ObIAllocator& alloc); virtual ~ObExprMergingFrozenTime(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprMergingFrozenTime); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_mid.h b/src/sql/engine/expr/ob_expr_mid.h index 524bbc1d9..68161a848 100644 --- a/src/sql/engine/expr/ob_expr_mid.h +++ b/src/sql/engine/expr/ob_expr_mid.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprMid : public ObExprSubstr { - public: +public: explicit ObExprMid(common::ObIAllocator& alloc) : ObExprSubstr(alloc) { *(const_cast(&type_)) = T_FUN_SYS_MID; @@ -27,7 +27,7 @@ class ObExprMid : public ObExprSubstr { }; virtual ~ObExprMid(){}; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprMid); }; diff --git a/src/sql/engine/expr/ob_expr_minus.h b/src/sql/engine/expr/ob_expr_minus.h index 2714663ac..9a35f36e4 100644 --- a/src/sql/engine/expr/ob_expr_minus.h +++ b/src/sql/engine/expr/ob_expr_minus.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprCGCtx; class ObExprMinus : public ObArithExprOperator { - public: +public: ObExprMinus(); explicit ObExprMinus(common::ObIAllocator& alloc, ObExprOperatorType type = T_OP_MINUS); virtual ~ObExprMinus(){}; @@ -34,7 +34,7 @@ class ObExprMinus : public ObArithExprOperator { common::ObIAllocator* allocator, common::ObScale scale); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: OB_INLINE static int minus_int(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObIAllocator* allocator, common::ObScale scale); OB_INLINE static int minus_uint(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, @@ -54,7 +54,7 @@ class ObExprMinus : public ObArithExprOperator { DISALLOW_COPY_AND_ASSIGN(ObExprMinus); - public: +public: static int minus_null(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int minus_int_int(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int minus_int_uint(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); @@ -79,7 +79,7 @@ class ObExprMinus : public ObArithExprOperator { static int minus_datetime_datetime_oracle(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static int minus_datetime_datetime(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: OB_INLINE static bool is_int_int_out_of_range(int64_t val1, int64_t val2, int64_t res) { // top digit: @@ -119,7 +119,7 @@ class ObExprMinus : public ObArithExprOperator { return val1 < val2; } - private: +private: static ObArithFunc minus_funcs_[common::ObMaxTC]; static ObArithFunc agg_minus_funcs_[common::ObMaxTC]; static const int64_t SHIFT_OFFSET = 63; @@ -128,7 +128,7 @@ class ObExprMinus : public ObArithExprOperator { // Minus expr for aggregation, different with ObExprMinus: // No overflow check for double type. class ObExprAggMinus : public ObExprMinus { - public: +public: explicit ObExprAggMinus(common::ObIAllocator& alloc) : ObExprMinus(alloc, T_OP_AGG_MINUS) {} }; diff --git a/src/sql/engine/expr/ob_expr_mod.h b/src/sql/engine/expr/ob_expr_mod.h index 96701ed91..a6fc291e5 100644 --- a/src/sql/engine/expr/ob_expr_mod.h +++ b/src/sql/engine/expr/ob_expr_mod.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprMod : public ObArithExprOperator { - public: +public: ObExprMod(); explicit ObExprMod(common::ObIAllocator& alloc); virtual ~ObExprMod(){}; @@ -39,7 +39,7 @@ class ObExprMod : public ObArithExprOperator { // temporary used, remove after all expr converted virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: OB_INLINE static int mod_int(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObIAllocator* allocator, common::ObScale scale); OB_INLINE static int mod_uint(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, @@ -52,7 +52,7 @@ class ObExprMod : public ObArithExprOperator { common::ObIAllocator* allocator, common::ObScale scale); DISALLOW_COPY_AND_ASSIGN(ObExprMod); - private: +private: static ObArithFunc mod_funcs_[common::ObMaxTC]; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_mul.h b/src/sql/engine/expr/ob_expr_mul.h index c60c6899e..5d13b4538 100644 --- a/src/sql/engine/expr/ob_expr_mul.h +++ b/src/sql/engine/expr/ob_expr_mul.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprMul : public ObArithExprOperator { - public: +public: ObExprMul(); explicit ObExprMul(common::ObIAllocator& alloc, ObExprOperatorType type = T_OP_MUL); virtual ~ObExprMul(){}; @@ -75,10 +75,10 @@ class ObExprMul : public ObArithExprOperator { static int mul_interval(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObIAllocator* allocator, common::ObScale scale); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprMul); - public: +public: // very very effective implementation // if false is returned, the result of multiplication will be stored in res template @@ -116,7 +116,7 @@ class ObExprMul : public ObArithExprOperator { return ret; } - private: +private: static ObArithFunc mul_funcs_[common::ObMaxTC]; static ObArithFunc agg_mul_funcs_[common::ObMaxTC]; static const int64_t SHIFT_OFFSET = 32; @@ -124,7 +124,7 @@ class ObExprMul : public ObArithExprOperator { // Mul expr for aggregation, different with ObExprMul: // No overflow check for double type. class ObExprAggMul : public ObExprMul { - public: +public: explicit ObExprAggMul(common::ObIAllocator& alloc) : ObExprMul(alloc, T_OP_AGG_MUL) {} }; diff --git a/src/sql/engine/expr/ob_expr_mysql_port.h b/src/sql/engine/expr/ob_expr_mysql_port.h index 8a84c0f2a..103206128 100644 --- a/src/sql/engine/expr/ob_expr_mysql_port.h +++ b/src/sql/engine/expr/ob_expr_mysql_port.h @@ -18,17 +18,15 @@ namespace oceanbase { namespace sql { class ObExprMySQLPort : public ObFuncExprOperator { - public: +public: explicit ObExprMySQLPort(common::ObIAllocator& alloc); virtual ~ObExprMySQLPort(); - virtual int calc_result_type0(ObExprResType &type, common::ObExprTypeCtx &type_ctx) const override; - virtual int calc_result0(common::ObObj &result, common::ObExprCtx &expr_ctx) const override; - static int eval_mysql_port(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum); - virtual int cg_expr(ObExprCGCtx &op_cg_ctx, - const ObRawExpr &raw_expr, - ObExpr &rt_expr) const override; + virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const override; + virtual int calc_result0(common::ObObj& result, common::ObExprCtx& expr_ctx) const override; + static int eval_mysql_port(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); + virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprMySQLPort); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_neg.h b/src/sql/engine/expr/ob_expr_neg.h index 0869364b9..ab18e7a0b 100644 --- a/src/sql/engine/expr/ob_expr_neg.h +++ b/src/sql/engine/expr/ob_expr_neg.h @@ -20,7 +20,7 @@ namespace sql { class ObExprNeg : public ObExprOperator { typedef common::ObExprStringBuf IAllocator; - public: +public: explicit ObExprNeg(common::ObIAllocator& alloc); virtual ~ObExprNeg(){}; @@ -30,13 +30,13 @@ class ObExprNeg : public ObExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: static int calc_(const common::ObObj& param, common::ObObj& res, common::ObCastCtx& cast_ctx); static int calc_param_type( const ObExprResType& param_type, common::ObObjType& calc_type, common::ObObjType& result_type); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNeg) const; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_not.h b/src/sql/engine/expr/ob_expr_not.h index 29e588c71..a82c411aa 100644 --- a/src/sql/engine/expr/ob_expr_not.h +++ b/src/sql/engine/expr/ob_expr_not.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprNot : public ObLogicalExprOperator { - public: +public: explicit ObExprNot(common::ObIAllocator& alloc); virtual ~ObExprNot(){}; @@ -28,7 +28,7 @@ class ObExprNot : public ObLogicalExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_not(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNot) const; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_not_between.h b/src/sql/engine/expr/ob_expr_not_between.h index 6dfd6fc48..4694099c1 100644 --- a/src/sql/engine/expr/ob_expr_not_between.h +++ b/src/sql/engine/expr/ob_expr_not_between.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprNotBetween : public ObRelationalExprOperator { - public: +public: ObExprNotBetween(); explicit ObExprNotBetween(common::ObIAllocator& alloc); virtual ~ObExprNotBetween(){}; @@ -30,13 +30,13 @@ class ObExprNotBetween : public ObRelationalExprOperator { const common::ObObj& obj3, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprNotBetween); // function members - private: +private: // data members }; diff --git a/src/sql/engine/expr/ob_expr_not_equal.h b/src/sql/engine/expr/ob_expr_not_equal.h index 43ebc0ec6..b9bb45d13 100644 --- a/src/sql/engine/expr/ob_expr_not_equal.h +++ b/src/sql/engine/expr/ob_expr_not_equal.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprNotEqual : public ObRelationalExprOperator { - public: +public: ObExprNotEqual(); explicit ObExprNotEqual(common::ObIAllocator& alloc); virtual ~ObExprNotEqual(){}; @@ -40,7 +40,7 @@ class ObExprNotEqual : public ObRelationalExprOperator { return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNotEqual); }; diff --git a/src/sql/engine/expr/ob_expr_not_exists.h b/src/sql/engine/expr/ob_expr_not_exists.h index f9671ec24..39fbaf628 100644 --- a/src/sql/engine/expr/ob_expr_not_exists.h +++ b/src/sql/engine/expr/ob_expr_not_exists.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprNotExists : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprNotExists(common::ObIAllocator& alloc); virtual ~ObExprNotExists(); @@ -27,7 +27,7 @@ class ObExprNotExists : public ObSubQueryRelationalExpr { static int not_exists_eval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNotExists); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_null_safe_equal.h b/src/sql/engine/expr/ob_expr_null_safe_equal.h index b6752223a..9b4729dd6 100644 --- a/src/sql/engine/expr/ob_expr_null_safe_equal.h +++ b/src/sql/engine/expr/ob_expr_null_safe_equal.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprNullSafeEqual : public ObRelationalExprOperator { - public: +public: ObExprNullSafeEqual(); explicit ObExprNullSafeEqual(common::ObIAllocator& alloc); virtual ~ObExprNullSafeEqual(){}; @@ -44,7 +44,7 @@ class ObExprNullSafeEqual : public ObRelationalExprOperator { static int ns_equal( const ObExpr& expr, ObDatum& res, ObExpr** left, ObEvalCtx& lctx, ObExpr** right, ObEvalCtx& rctx); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNullSafeEqual); }; diff --git a/src/sql/engine/expr/ob_expr_nullif.h b/src/sql/engine/expr/ob_expr_nullif.h index 5e7303c9f..8c19c7814 100644 --- a/src/sql/engine/expr/ob_expr_nullif.h +++ b/src/sql/engine/expr/ob_expr_nullif.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprNullif : public ObFuncExprOperator { - public: +public: explicit ObExprNullif(common::ObIAllocator& alloc); virtual ~ObExprNullif(){}; @@ -33,10 +33,10 @@ class ObExprNullif : public ObFuncExprOperator { first_param_can_be_null_ = flag; } - protected: +protected: bool first_param_can_be_null_; - private: +private: int deduce_type( ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const; int se_deduce_type(ObExprResType& type, ObExprResType& cmp_type, const ObExprResType& type1, diff --git a/src/sql/engine/expr/ob_expr_nvl.h b/src/sql/engine/expr/ob_expr_nvl.h index 42069116e..19ee8f58d 100644 --- a/src/sql/engine/expr/ob_expr_nvl.h +++ b/src/sql/engine/expr/ob_expr_nvl.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprNvlUtil { - public: +public: static int calc_result_type( ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx); static int calc_nvl_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); @@ -27,7 +27,7 @@ class ObExprNvlUtil { }; class ObExprNvl : public ObFuncExprOperator { - public: +public: explicit ObExprNvl(common::ObIAllocator& alloc); virtual ~ObExprNvl(); @@ -38,17 +38,17 @@ class ObExprNvl : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy ObExprNvl(const ObExprNvl& other); ObExprNvl& operator=(const ObExprNvl& other); - protected: +protected: // data members }; class ObExprOracleNvl : public ObFuncExprOperator { - public: +public: // ObExprNvl(); explicit ObExprOracleNvl(common::ObIAllocator& alloc); virtual ~ObExprOracleNvl(); @@ -63,15 +63,15 @@ class ObExprOracleNvl : public ObFuncExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOracleNvl); - protected: +protected: // data members }; class ObExprNaNvl : public ObFuncExprOperator { - public: +public: explicit ObExprNaNvl(common::ObIAllocator& alloc); virtual ~ObExprNaNvl(); @@ -81,10 +81,10 @@ class ObExprNaNvl : public ObFuncExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNaNvl); - protected: +protected: // data members }; diff --git a/src/sql/engine/expr/ob_expr_nvl2_oracle.h b/src/sql/engine/expr/ob_expr_nvl2_oracle.h index ad4eb01e7..57057c4ec 100644 --- a/src/sql/engine/expr/ob_expr_nvl2_oracle.h +++ b/src/sql/engine/expr/ob_expr_nvl2_oracle.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { using namespace oceanbase::common; class ObExprNvl2Oracle : public ObFuncExprOperator { - public: +public: explicit ObExprNvl2Oracle(ObIAllocator& alloc); virtual ~ObExprNvl2Oracle(); @@ -32,7 +32,7 @@ class ObExprNvl2Oracle : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNvl2Oracle); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_obj_access.h b/src/sql/engine/expr/ob_expr_obj_access.h index 8ced1fb9a..ec71ffbe9 100644 --- a/src/sql/engine/expr/ob_expr_obj_access.h +++ b/src/sql/engine/expr/ob_expr_obj_access.h @@ -23,7 +23,7 @@ typedef Ob2DArray ParamArray; int init_param_array( const ParamStore& param_store, const common::ObObj* objs_stack, int64_t param_num, ParamArray& param_array) const; DISALLOW_COPY_AND_ASSIGN(ObExprObjAccess); - private: +private: uint64_t get_attr_func_; common::ObFixedArray param_idxs_; int64_t access_idx_cnt_; diff --git a/src/sql/engine/expr/ob_expr_obversion.h b/src/sql/engine/expr/ob_expr_obversion.h index 21c3cca37..a7aaac32a 100644 --- a/src/sql/engine/expr/ob_expr_obversion.h +++ b/src/sql/engine/expr/ob_expr_obversion.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprObVersion : public ObStringExprOperator { - public: +public: explicit ObExprObVersion(common::ObIAllocator& alloc); virtual ~ObExprObVersion(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; diff --git a/src/sql/engine/expr/ob_expr_operator.h b/src/sql/engine/expr/ob_expr_operator.h index 165bf6cbc..723cb35a6 100644 --- a/src/sql/engine/expr/ob_expr_operator.h +++ b/src/sql/engine/expr/ob_expr_operator.h @@ -51,10 +51,10 @@ enum CollectionPredRes { COLL_PRED_BOTH_COLL_ZERO, }; class ObFuncInputType { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObFuncInputType() : calc_meta_(), max_length_(0), flag_(0) {} ObFuncInputType(common::ObObjMeta calc_meta, common::ObLength max_length, uint32_t flag) @@ -88,7 +88,7 @@ class ObFuncInputType { TO_STRING_KV(N_CALC_META, calc_meta_, N_LENGTH, max_length_, N_FLAG, flag_); - private: +private: // connvert ObObj to this type common::ObObjMeta calc_meta_; // for zerofill @@ -97,7 +97,7 @@ class ObFuncInputType { }; class ObExprOperatorCtx { - public: +public: ObExprOperatorCtx() {} virtual ~ObExprOperatorCtx() @@ -113,7 +113,7 @@ class ObExprOperatorCtx { typedef common::ObIArray RowIterIArray; class ObIterExprCtx { - public: +public: ObIterExprCtx(ObExecContext& ctx, common::ObIAllocator& allocator) : iter_expr_ctxs_(allocator), index_scan_iters_(NULL), ctx_(ctx), allocator_(allocator), cur_row_(NULL) {} @@ -170,7 +170,7 @@ class ObIterExprCtx { return cur_row_; } - private: +private: common::ObFixedArray iter_expr_ctxs_; RowIterIArray* index_scan_iters_; ObExecContext& ctx_; @@ -179,7 +179,7 @@ class ObIterExprCtx { }; class ObFastExprOperator { - public: +public: ObFastExprOperator(ObExprOperatorType operator_type) : op_type_(operator_type) {} virtual ~ObFastExprOperator() @@ -191,14 +191,14 @@ class ObFastExprOperator { } virtual int assign(const ObFastExprOperator& other) = 0; - protected: +protected: ObExprOperatorType op_type_; }; class ObIterExprOperator { OB_UNIS_VERSION_V(1); - public: +public: ObIterExprOperator() : expr_id_(common::OB_INVALID_ID), expr_type_(T_INVALID) {} virtual ~ObIterExprOperator() @@ -224,7 +224,7 @@ class ObIterExprOperator { TO_STRING_KV(K_(expr_id), K_(expr_type)); - protected: +protected: uint64_t expr_id_; ObExprOperatorType expr_type_; }; @@ -232,7 +232,7 @@ class ObIterExprOperator { class ObExprOperator : public common::ObDLinkBase { OB_UNIS_VERSION_V(1); - public: +public: friend class ObRawExpr; enum ObSqlParamNumFlag { @@ -438,7 +438,7 @@ class ObExprOperator : public common::ObDLinkBase { return pos; } - public: +public: /* Aggregate arguments for comparison, e.g: a=b, a LIKE b, a RLIKE b - don't convert to @@character_set_connection if all arguments are numbers @@ -520,10 +520,10 @@ class ObExprOperator : public common::ObDLinkBase { int calc_trig_function_result_type2( ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const; - public: +public: virtual common::ObCastMode get_cast_mode() const; - protected: +protected: ObExpr* get_rt_expr(const ObRawExpr& raw_expr) const; inline static void calc_result_flag1(ObExprResType& type, const ObExprResType& type1); @@ -539,7 +539,7 @@ class ObExprOperator : public common::ObDLinkBase { operand_auto_cast_ = false; } - private: +private: // computation framework internally provided a universal datatype's converting // method, which is able to convert param's type to input_types_. this may // not be a expected behavior for some expression. If you want to prohibit @@ -557,7 +557,7 @@ class ObExprOperator : public common::ObDLinkBase { static const uint32_t OB_COLL_DISALLOW_NONE = 1; static const uint32_t OB_COLL_ALLOW_NUMERIC_CONV = 2; - protected: +protected: static int aggregate_collations(common::ObObjMeta& type, const common::ObObjMeta* types_array, int64_t param_num, uint32_t flag, const common::ObCollationType conn_coll_type); @@ -848,7 +848,7 @@ inline void ObExprOperator::calc_result_flagN(ObExprResType& type, const ObExprR //////////////////////////////////////////////////////////////// class ObFuncExprOperator : public ObExprOperator { - public: +public: ObFuncExprOperator( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension) : ObExprOperator(alloc, type, name, param_num, dimension){}; @@ -860,20 +860,15 @@ class ObFuncExprOperator : public ObExprOperator { // In ObRelationalExprOperator, there are three concepts: res_type, cmp_type, calc_type // The first two are relative to the expression; the latter one is relative to the parameters of the expression. // -class ObRelationalExprOperator : public ObExprOperator -{ +class ObRelationalExprOperator : public ObExprOperator { public: - virtual int deserialize(const char *buf, const int64_t data_len, int64_t &pos) override; + virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos) override; + public: - ObRelationalExprOperator(common::ObIAllocator &alloc, - ObExprOperatorType type, - const char *name, - int32_t param_num, - int32_t dimension = NOT_ROW_DIMENSION) - : ObExprOperator(alloc, type, name, param_num, dimension), - cmp_op_func2_(NULL) - { - } + ObRelationalExprOperator(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, + int32_t dimension = NOT_ROW_DIMENSION) + : ObExprOperator(alloc, type, name, param_num, dimension), cmp_op_func2_(NULL) + {} virtual ~ObRelationalExprOperator() {} @@ -937,10 +932,8 @@ public: // determine the type used for comparison of the two types // binary comparison - virtual int calc_result_type2(ObExprResType &type, - ObExprResType &type1, - ObExprResType &type2, - common::ObExprTypeCtx &type_ctx) const override; + virtual int calc_result_type2( + ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const override; // deduce binary comparison result type and parameters types static int deduce_cmp_type(const ObExprOperator& expr, ObExprResType& type, ObExprResType& type1, @@ -948,73 +941,48 @@ public: // for between...and, not between...and etc. // @todo need refactor, ....yzf....Thu, 6 Aug 2015....16:00.... - virtual int calc_result_type3(ObExprResType &type, - ObExprResType &type1, - ObExprResType &type2, - ObExprResType &type3, - common::ObExprTypeCtx &type_ctx) const override; - virtual int calc_calc_type3(ObExprResType &type1, - ObExprResType &type2, - ObExprResType &type3, - common::ObExprTypeCtx &type_ctx, - const common::ObObjType cmp_type) const; - int get_cmp_result_type3(ObExprResType &type, - bool &need_no_cast, - const ObExprResType *types, - const int64_t param_num, - const sql::ObSQLSessionInfo &my_session); + virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3, + common::ObExprTypeCtx& type_ctx) const override; + virtual int calc_calc_type3(ObExprResType& type1, ObExprResType& type2, ObExprResType& type3, + common::ObExprTypeCtx& type_ctx, const common::ObObjType cmp_type) const; + int get_cmp_result_type3(ObExprResType& type, bool& need_no_cast, const ObExprResType* types, const int64_t param_num, + const sql::ObSQLSessionInfo& my_session); // vector comparison, e.g. (a,b,c) > (1,2,3) - virtual int calc_result_typeN(ObExprResType &type, - ObExprResType *types, - int64_t param_num, - common::ObExprTypeCtx &type_ctx) const override; - virtual int calc_result2(common::ObObj &result, const common::ObObj &obj1, - const common::ObObj &obj2, - common::ObExprCtx &expr_ctx, bool is_null_safe, - common::ObCmpOp cmp_op) const; - virtual int calc_resultN(common::ObObj &result, - const common::ObObj *objs_array, - int64_t param_num, - common::ObExprCtx &expr_ctx, - bool is_null_safe, - common::ObCmpOp cmp_op) const; + virtual int calc_result_typeN( + ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const override; + virtual int calc_result2(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, + common::ObExprCtx& expr_ctx, bool is_null_safe, common::ObCmpOp cmp_op) const; + virtual int calc_resultN(common::ObObj& result, const common::ObObj* objs_array, int64_t param_num, + common::ObExprCtx& expr_ctx, bool is_null_safe, common::ObCmpOp cmp_op) const; - static int is_equivalent(const common::ObObjMeta &meta1, - const common::ObObjMeta &meta2, - const common::ObObjMeta &meta3, - bool &result); - int assign(const ObExprOperator &other) override; - int set_cmp_func(const common::ObObjType type1, - const common::ObObjType type2); - common::obj_cmp_func get_cmp_fun() const { return cmp_op_func2_; } + static int is_equivalent( + const common::ObObjMeta& meta1, const common::ObObjMeta& meta2, const common::ObObjMeta& meta3, bool& result); + int assign(const ObExprOperator& other) override; + int set_cmp_func(const common::ObObjType type1, const common::ObObjType type2); + common::obj_cmp_func get_cmp_fun() const + { + return cmp_op_func2_; + } - // pure virtual but implemented, derived classes can use this implement. - virtual int cg_expr(ObExprCGCtx &op_cg_ctx, - const ObRawExpr &raw_expr, - ObExpr &rt_expr) const override = 0; + // pure virtual but implemented, derived classes can use this implement. + virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override = 0; - static int cg_row_cmp_expr(const int row_dim, common::ObIAllocator &allocator, - const ObRawExpr &raw_expr, - const ObExprOperatorInputTypeArray &input_types, - ObExpr &rt_expr); - static int cg_datum_cmp_expr(const ObRawExpr &raw_expr, - const ObExprOperatorInputTypeArray &input_types, - ObExpr &rt_expr); + static int cg_row_cmp_expr(const int row_dim, common::ObIAllocator& allocator, const ObRawExpr& raw_expr, + const ObExprOperatorInputTypeArray& input_types, ObExpr& rt_expr); + static int cg_datum_cmp_expr( + const ObRawExpr& raw_expr, const ObExprOperatorInputTypeArray& input_types, ObExpr& rt_expr); - static int is_row_cmp(const ObRawExpr&, int &row_dim); - static int row_eval(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datm); + static int is_row_cmp(const ObRawExpr&, int& row_dim); + static int row_eval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datm); - // row compare - // CAUTION: null safe equal row compare is not included. - static int row_cmp(const ObExpr &expr, ObDatum &expr_datum, - ObExpr **l_row, ObEvalCtx &l_ctx, ObExpr **r_row, ObEvalCtx &r_ctx); + // row compare + // CAUTION: null safe equal row compare is not included. + static int row_cmp( + const ObExpr& expr, ObDatum& expr_datum, ObExpr** l_row, ObEvalCtx& l_ctx, ObExpr** r_row, ObEvalCtx& r_ctx); - OB_INLINE static int get_comparator_operands( - const ObExpr &expr, - ObEvalCtx &ctx, - common::ObDatum *&left, common::ObDatum *&right, - ObDatum &result, bool &is_finish) + OB_INLINE static int get_comparator_operands(const ObExpr& expr, ObEvalCtx& ctx, common::ObDatum*& left, + common::ObDatum*& right, ObDatum& result, bool& is_finish) { int ret = common::OB_SUCCESS; if (OB_FAIL(expr.args_[0]->eval(ctx, left))) { @@ -1060,7 +1028,7 @@ public: return need_no_cast; } - protected: +protected: static bool is_int_cmp_const_str(const ObExprResType* type1, const ObExprResType* type2, common::ObObjType& cmp_type); OB_INLINE static common::ObCmpOp get_cmp_op(const ObExprOperatorType type) { @@ -1151,7 +1119,7 @@ public: static bool can_cmp_without_cast( ObExprResType type1, ObExprResType type2, common::ObCmpOp cmp_op, const ObSQLSessionInfo& session); - protected: +protected: // only use for comparison with 2 operands(calc_result2) // if cmp_op_func2_ is not NULL, that means we can compare the 2 objs directly without any casts // otherwise, compare_cast is necessary. @@ -1162,7 +1130,7 @@ public: class ObSubQueryRelationalExpr : public ObExprOperator { OB_UNIS_VERSION(1); - public: +public: // extra info stored in ObExpr::extra_ struct ExtraInfo : public ObExprExtraInfoAccess { ObSubQueryKey subquery_key_; @@ -1205,34 +1173,23 @@ class ObSubQueryRelationalExpr : public ObExprOperator { left_is_iter_ = false; right_is_iter_ = false; } - virtual int calc_result_type2(ObExprResType &type, - ObExprResType &type1, - ObExprResType &type2, - common::ObExprTypeCtx &type_ctx) const override; - virtual int calc_result_typeN(ObExprResType &type, - ObExprResType *types, - int64_t param_num, - common::ObExprTypeCtx &type_ctx) const override; - int calc_result2(common::ObObj &result, - const common::ObObj &obj1, - const common::ObObj &obj2, - common::ObExprCtx &expr_ctx) const override; - int calc_resultN(common::ObObj &result, - const common::ObObj *param_array, - int64_t param_num, - common::ObExprCtx &expr_ctx) const override; - virtual int call(common::ObObj *stack, int64_t &stack_size, common::ObExprCtx &expr_ctx) const override; - virtual int eval(common::ObExprCtx &expr_ctx, common::ObObj &val, - common::ObObj *params, int64_t param_num) const override; + virtual int calc_result_type2( + ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const override; + virtual int calc_result_typeN( + ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const override; + int calc_result2(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, + common::ObExprCtx& expr_ctx) const override; + int calc_resultN(common::ObObj& result, const common::ObObj* param_array, int64_t param_num, + common::ObExprCtx& expr_ctx) const override; + virtual int call(common::ObObj* stack, int64_t& stack_size, common::ObExprCtx& expr_ctx) const override; + virtual int eval( + common::ObExprCtx& expr_ctx, common::ObObj& val, common::ObObj* params, int64_t param_num) const override; - static int subquery_cmp_eval(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum); + static int subquery_cmp_eval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); + + VIRTUAL_TO_STRING_KV(N_EXPR_TYPE, get_type_name(type_), N_REAL_PARAM_NUM, real_param_num_, N_RESULT_TYPE, + result_type_, K_(subquery_key), K_(left_is_iter), K_(right_is_iter)); - VIRTUAL_TO_STRING_KV(N_EXPR_TYPE, get_type_name(type_), - N_REAL_PARAM_NUM, real_param_num_, - N_RESULT_TYPE, result_type_, - K_(subquery_key), - K_(left_is_iter), - K_(right_is_iter)); protected: // The result of processing the subquery is a vector. In this case, the result // of the subquery has at most one row of data, and multiple rows of data are not allowed. @@ -1279,7 +1236,7 @@ protected: static int check_exists(const ObExpr& expr, ObEvalCtx& ctx, bool& exists); - protected: +protected: ObSubQueryKey subquery_key_; bool left_is_iter_; bool right_is_iter_; @@ -1292,7 +1249,7 @@ typedef int (*ObArithFunc)(common::ObObj& res, const common::ObObj& left, const common::ObIAllocator* allocator, common::ObScale scale); class ObArithExprOperator : public ObExprOperator { - public: +public: ObArithExprOperator(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension, ObResultTypeFunc result_type_func, ObCalcTypeFunc calc_type_func, const ObArithFunc* arith_funcs) @@ -1313,7 +1270,7 @@ class ObArithExprOperator : public ObExprOperator { return (0 != ::isinf(res)); } - protected: +protected: // temporary used, remove after all expr converted OB_INLINE static int get_arith_operand(const ObExpr& expr, ObEvalCtx& ctx, common::ObDatum*& left, common::ObDatum*& right, ObDatum& result, bool& is_finish) @@ -1361,7 +1318,7 @@ class ObArithExprOperator : public ObExprOperator { ObCalcTypeFunc calc_type_func_; const ObArithFunc* arith_funcs_; - protected: +protected: static int calc_(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObExprCtx& expr_ctx, common::ObScale calc_scale, common::ObObjType calc_type, const ObArithFunc* arith_func); @@ -1371,7 +1328,7 @@ class ObArithExprOperator : public ObExprOperator { }; class ObVectorExprOperator : public ObExprOperator { - public: +public: ObVectorExprOperator( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension) : ObExprOperator(alloc, type, name, param_num, dimension) @@ -1387,13 +1344,13 @@ class ObVectorExprOperator : public ObExprOperator { virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: int calc_result_type2_( ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const; }; class ObLogicalExprOperator : public ObExprOperator { - public: +public: ObLogicalExprOperator( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension) : ObExprOperator(alloc, type, name, param_num, dimension) @@ -1409,7 +1366,7 @@ class ObLogicalExprOperator : public ObExprOperator { virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - protected: +protected: static int is_true(const common::ObObj& obj, common::ObCastMode cast_mode, bool& result); }; @@ -1422,7 +1379,7 @@ class ObLogicalExprOperator : public ObExprOperator { // template class ObConstCArray : public common::ObIArray { - public: +public: using common::ObIArray::at; using common::ObIArray::count; @@ -1479,7 +1436,7 @@ class ObConstCArray : public common::ObIArray { virtual void extra_access_check() const override {} - protected: +protected: T local_data_[N]; using common::ObIArray::data_; using common::ObIArray::count_; @@ -1493,7 +1450,7 @@ const ObConstCArray<1 + sizeof...(TS), T> make_const_carray(const T& t, const TS // functions who's result type is string class ObStringExprOperator : public ObExprOperator { - public: +public: ObStringExprOperator(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num) : ObExprOperator(alloc, type, name, param_num, NOT_ROW_DIMENSION) {} @@ -1502,23 +1459,23 @@ class ObStringExprOperator : public ObExprOperator { static int convert_result_collation( const ObExprResType& result_type, common::ObObj& result, common::ObIAllocator* allocator); - protected: +protected: common::ObObjType get_result_type_mysql(int64_t char_length) const; static const int64_t MAX_CHAR_LENGTH_FOR_VARCAHR_RESULT = 512; static const int64_t MAX_CHAR_LENGTH_FOR_TEXT_RESULT = 65535; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObStringExprOperator); // function members - private: +private: // data members }; class ObBitwiseExprOperator : public ObExprOperator { - public: +public: ObBitwiseExprOperator( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension) : ObExprOperator(alloc, type, name, param_num, dimension) @@ -1542,7 +1499,7 @@ class ObBitwiseExprOperator : public ObExprOperator { static int calc_result2_oracle(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); static int calc_result2_mysql(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - protected: +protected: enum BitOperator { BIT_AND, BIT_OR, @@ -1577,7 +1534,7 @@ class ObBitwiseExprOperator : public ObExprOperator { }; class ObMinMaxExprOperator : public ObExprOperator { - public: +public: // constructor and destructor ObMinMaxExprOperator( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension) @@ -1588,19 +1545,19 @@ class ObMinMaxExprOperator : public ObExprOperator { {} virtual int assign(const ObExprOperator& other); - public: +public: // serialize and deserialize virtual int serialize(char* buf, const int64_t buf_len, int64_t& pos) const; virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos); virtual int64_t get_serialize_size() const; - public: +public: OB_INLINE void set_need_cast(bool need_cast) { need_cast_ = need_cast; } - protected: +protected: /* Aggregate result type for comparison is involved by greatest, least @@ -1614,12 +1571,12 @@ class ObMinMaxExprOperator : public ObExprOperator { */ int aggregate_cmp_type_for_comparison(ObExprResType& type, const ObExprResType* types, int64_t param_num) const; - protected: +protected: // calculate greatest/least's result type int calc_result_meta_for_comparison(ObExprResType& type, ObExprResType* types, int64_t param_num, const common::ObCollationType coll_type, const common::ObLengthSemantics default_length_semantics) const; - protected: +protected: // least should set cmp_op to CO_LT. // greatest should set cmp_op to CO_GT. static int calc_(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, @@ -1629,7 +1586,7 @@ class ObMinMaxExprOperator : public ObExprOperator { OB_INLINE static int calc_with_cast(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, const ObExprResType& result_type, common::ObExprCtx& expr_ctx, common::ObCmpOp cmp_op); - protected: +protected: // if all params are of same types // or if all params are numeric // need_no_cast_ will be ture and no casts are necessary during calculation @@ -1639,7 +1596,7 @@ class ObMinMaxExprOperator : public ObExprOperator { //////////////////////////////////////////////////////////////// // locate instr position class ObLocationExprOperator : public ObFuncExprOperator { - public: +public: ObLocationExprOperator( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension) : ObFuncExprOperator(alloc, type, name, param_num, dimension){}; @@ -1658,12 +1615,12 @@ class ObLocationExprOperator : public ObFuncExprOperator { static int get_calc_cs_type(const ObExpr& expr, common::ObCollationType& calc_cs_type); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: OB_INLINE static int get_pos_int64(const common::ObObj& obj, common::ObExprCtx& expr_ctx, int64_t& out); }; class ObExprTRDateFormat { - public: +public: // http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions230.htm#i1002084 // http://www.techonthenet.com/oracle/functions/trunc_date.php enum FORMAT_ID { @@ -1717,7 +1674,7 @@ class ObExprTRDateFormat { ob_time.parts_[DT_USEC] = 0; } - public: +public: static const char* FORMATS_TEXT[FORMAT_MAX_TYPE]; static uint64_t FORMATS_HASH[FORMAT_MAX_TYPE]; }; diff --git a/src/sql/engine/expr/ob_expr_operator_factory.h b/src/sql/engine/expr/ob_expr_operator_factory.h index a18459970..0af44e3b8 100644 --- a/src/sql/engine/expr/ob_expr_operator_factory.h +++ b/src/sql/engine/expr/ob_expr_operator_factory.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { typedef int (*AllocFunc)(common::ObIAllocator& alloc, ObExprOperator*& phy_op); class ObExprOperatorFactory { - public: +public: explicit ObExprOperatorFactory(common::ObIAllocator& alloc) : alloc_(alloc), next_expr_id_(NULL) {} ~ObExprOperatorFactory() @@ -46,11 +46,11 @@ class ObExprOperatorFactory { ObExprOperatorType type_; }; - private: +private: template static int alloc(common::ObIAllocator& alloc, ObExprOperator*& phy_op); - private: +private: static NameType NAME_TYPES[EXPR_OP_NUM]; static NameType NAME_TYPES_ORCL[EXPR_OP_NUM]; common::ObIAllocator& alloc_; diff --git a/src/sql/engine/expr/ob_expr_or.h b/src/sql/engine/expr/ob_expr_or.h index ce646af71..514002268 100644 --- a/src/sql/engine/expr/ob_expr_or.h +++ b/src/sql/engine/expr/ob_expr_or.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprOr : public ObLogicalExprOperator { - public: +public: ObExprOr(); explicit ObExprOr(common::ObIAllocator& alloc); virtual ~ObExprOr(){}; @@ -31,11 +31,11 @@ class ObExprOr : public ObLogicalExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: static int cacl_res_with_one_param_null( common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObExprCtx& expr_ctx); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOr); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_oracle_decode.h b/src/sql/engine/expr/ob_expr_oracle_decode.h index fcf4cdb1f..0dc584e30 100644 --- a/src/sql/engine/expr/ob_expr_oracle_decode.h +++ b/src/sql/engine/expr/ob_expr_oracle_decode.h @@ -20,7 +20,7 @@ namespace sql { class ObExprOracleDecode : public ObExprOperator { OB_UNIS_VERSION_V(1); - public: +public: explicit ObExprOracleDecode(common::ObIAllocator& alloc); virtual ~ObExprOracleDecode(); virtual int calc_result_typeN( @@ -33,19 +33,19 @@ class ObExprOracleDecode : public ObExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_decode(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - public: +public: inline void set_cond_all_same_meta(bool all_same_meta); inline void set_val_all_same_meta(bool all_same_meta); static bool can_compare_directly(common::ObObjType type1, common::ObObjType type2); - private: +private: inline static int get_cmp_type(common::ObObjType& type, const common::ObObjType& type1, const common::ObObjType& type2, const common::ObObjType& type3); inline bool is_cond_all_same_meta() const; inline bool is_val_all_same_meta() const; inline bool need_no_cast() const; - private: +private: typedef uint32_t ObExprDecodeParamFlag; static const uint32_t COND_ALL_SAME_META = 1U << 0; static const uint32_t VAL_ALL_SAME_META = 1U << 1; diff --git a/src/sql/engine/expr/ob_expr_oracle_nullif.h b/src/sql/engine/expr/ob_expr_oracle_nullif.h index 5b4f16c10..f529907bd 100644 --- a/src/sql/engine/expr/ob_expr_oracle_nullif.h +++ b/src/sql/engine/expr/ob_expr_oracle_nullif.h @@ -19,7 +19,7 @@ using namespace oceanbase::common; namespace oceanbase { namespace sql { class ObExprOracleNullif : public ObExprNullif { - public: +public: explicit ObExprOracleNullif(common::ObIAllocator& alloc); virtual ~ObExprOracleNullif(){}; @@ -30,7 +30,7 @@ class ObExprOracleNullif : public ObExprNullif { static int eval_nullif(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); static int eval_nullif_not_null(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOracleNullif); bool is_same_type(const ObExprResType& type1, const ObExprResType& type2) const; diff --git a/src/sql/engine/expr/ob_expr_oracle_to_char.h b/src/sql/engine/expr/ob_expr_oracle_to_char.h index 73f85f8c1..cb3db9a52 100644 --- a/src/sql/engine/expr/ob_expr_oracle_to_char.h +++ b/src/sql/engine/expr/ob_expr_oracle_to_char.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObExprToCharCommon : public ObStringExprOperator { - public: +public: using ObStringExprOperator::ObStringExprOperator; static int number_to_char( @@ -33,7 +33,7 @@ class ObExprToCharCommon : public ObStringExprOperator { static int eval_oracle_to_char(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - protected: +protected: static int interval_to_char( common::ObObj& result, const common::ObObj* objs_array, int64_t param_num, common::ObExprCtx& expr_ctx); @@ -73,7 +73,7 @@ class ObExprToCharCommon : public ObStringExprOperator { }; class ObExprOracleToChar : public ObExprToCharCommon { - public: +public: explicit ObExprOracleToChar(common::ObIAllocator& alloc); virtual ~ObExprOracleToChar(); virtual int calc_result_typeN( @@ -83,7 +83,7 @@ class ObExprOracleToChar : public ObExprToCharCommon { }; class ObExprOracleToNChar : public ObExprToCharCommon { - public: +public: explicit ObExprOracleToNChar(common::ObIAllocator& alloc); virtual ~ObExprOracleToNChar(); virtual int calc_result_typeN( diff --git a/src/sql/engine/expr/ob_expr_oracle_trunc.h b/src/sql/engine/expr/ob_expr_oracle_trunc.h index 4f8ffb3ef..d26cc13ff 100644 --- a/src/sql/engine/expr/ob_expr_oracle_trunc.h +++ b/src/sql/engine/expr/ob_expr_oracle_trunc.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprOracleTrunc : public ObFuncExprOperator { - public: +public: explicit ObExprOracleTrunc(common::ObIAllocator& alloc); explicit ObExprOracleTrunc(common::ObIAllocator& alloc, const char* name); virtual ~ObExprOracleTrunc() @@ -30,7 +30,7 @@ class ObExprOracleTrunc : public ObFuncExprOperator { common::ObObj& result, const common::ObObj* params, int64_t params_count, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - protected: +protected: int calc_with_date(common::ObObj& result, const common::ObObj& source, const common::ObObj& format, common::ObExprCtx& expr_ctx) const; int calc_with_decimal(common::ObObj& result, const common::ObObj& source, const common::ObObj& format, @@ -40,18 +40,18 @@ class ObExprOracleTrunc : public ObFuncExprOperator { int calc_result2( common::ObObj& result, const common::ObObj& input, const common::ObObj& param, common::ObExprCtx& expr_ctx) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprOracleTrunc); }; class ObExprTrunc : public ObExprOracleTrunc { - public: +public: explicit ObExprTrunc(common::ObIAllocator& alloc); virtual ~ObExprTrunc() {} - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprTrunc); }; diff --git a/src/sql/engine/expr/ob_expr_orahash.h b/src/sql/engine/expr/ob_expr_orahash.h index 7a5ca38af..25d226e4e 100644 --- a/src/sql/engine/expr/ob_expr_orahash.h +++ b/src/sql/engine/expr/ob_expr_orahash.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprOrahash : public ObFuncExprOperator { - public: +public: explicit ObExprOrahash(common::ObIAllocator& alloc); virtual ~ObExprOrahash(); virtual int calc_resultN( @@ -29,7 +29,7 @@ class ObExprOrahash : public ObFuncExprOperator { static int eval_orahash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprOrahash); int get_int64_value(const common::ObObj& obj, common::ObExprCtx& expr_ctx, int64_t& val) const; diff --git a/src/sql/engine/expr/ob_expr_pad.h b/src/sql/engine/expr/ob_expr_pad.h index 5b5de29c5..f2e9ec94e 100644 --- a/src/sql/engine/expr/ob_expr_pad.h +++ b/src/sql/engine/expr/ob_expr_pad.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprPad : public ObStringExprOperator { - public: +public: explicit ObExprPad(common::ObIAllocator& alloc); virtual ~ObExprPad(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& source, ObExprResType& padding_str, @@ -28,7 +28,7 @@ class ObExprPad : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_pad_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprPad); }; diff --git a/src/sql/engine/expr/ob_expr_part_id.h b/src/sql/engine/expr/ob_expr_part_id.h index 332e1b8df..a2c2d84e0 100644 --- a/src/sql/engine/expr/ob_expr_part_id.h +++ b/src/sql/engine/expr/ob_expr_part_id.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprPartId : public ObFuncExprOperator { - public: +public: explicit ObExprPartId(common::ObIAllocator& alloc); virtual ~ObExprPartId() {} @@ -32,7 +32,7 @@ class ObExprPartId : public ObFuncExprOperator { static int eval_part_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprPartId); }; } // end namespace sql diff --git a/src/sql/engine/expr/ob_expr_part_id_pseudo_column.h b/src/sql/engine/expr/ob_expr_part_id_pseudo_column.h index 28a47133b..7c5b9b499 100644 --- a/src/sql/engine/expr/ob_expr_part_id_pseudo_column.h +++ b/src/sql/engine/expr/ob_expr_part_id_pseudo_column.h @@ -25,7 +25,7 @@ namespace sql { using namespace oceanbase::common; class ObExprPartIdPseudoColumn : public ObFuncExprOperator { - public: +public: explicit ObExprPartIdPseudoColumn(ObIAllocator& alloc); virtual ~ObExprPartIdPseudoColumn(); @@ -36,7 +36,7 @@ class ObExprPartIdPseudoColumn : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_part_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprPartIdPseudoColumn); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_period_diff.h b/src/sql/engine/expr/ob_expr_period_diff.h index 6f79a9b07..d4266438f 100644 --- a/src/sql/engine/expr/ob_expr_period_diff.h +++ b/src/sql/engine/expr/ob_expr_period_diff.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprPeriodDiff : public ObFuncExprOperator { - public: +public: explicit ObExprPeriodDiff(common::ObIAllocator& alloc); virtual ~ObExprPeriodDiff(); virtual int calc_result_type2( @@ -30,7 +30,7 @@ class ObExprPeriodDiff : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_perioddiff(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int get_year_month(const uint64_t value, uint64_t& year, uint64_t& month); // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprPeriodDiff); diff --git a/src/sql/engine/expr/ob_expr_position.h b/src/sql/engine/expr/ob_expr_position.h index 910b5ad02..32fe5fd37 100644 --- a/src/sql/engine/expr/ob_expr_position.h +++ b/src/sql/engine/expr/ob_expr_position.h @@ -17,11 +17,11 @@ namespace oceanbase { namespace sql { class ObExprPosition : public ObLocationExprOperator { - public: +public: explicit ObExprPosition(common::ObIAllocator& alloc); virtual ~ObExprPosition(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprPosition); }; diff --git a/src/sql/engine/expr/ob_expr_pow.h b/src/sql/engine/expr/ob_expr_pow.h index 74eeba626..ef09972ba 100644 --- a/src/sql/engine/expr/ob_expr_pow.h +++ b/src/sql/engine/expr/ob_expr_pow.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprPow : public ObExprOperator { - public: +public: explicit ObExprPow(common::ObIAllocator& alloc); virtual ~ObExprPow(){}; @@ -33,7 +33,7 @@ class ObExprPow : public ObExprOperator { static int safe_set_double(common::ObDatum& datum, double value); static int calc_pow_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprPow) const; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_power.h b/src/sql/engine/expr/ob_expr_power.h index e16526a7b..3450cac52 100644 --- a/src/sql/engine/expr/ob_expr_power.h +++ b/src/sql/engine/expr/ob_expr_power.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprPower : public ObExprOperator { - public: +public: explicit ObExprPower(common::ObIAllocator& alloc); virtual ~ObExprPower(){}; @@ -30,7 +30,7 @@ class ObExprPower : public ObExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprPower) const; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_prior.h b/src/sql/engine/expr/ob_expr_prior.h index 1b630f79f..56323d162 100644 --- a/src/sql/engine/expr/ob_expr_prior.h +++ b/src/sql/engine/expr/ob_expr_prior.h @@ -20,7 +20,7 @@ namespace sql { class ObExprPrior : public ObExprOperator { typedef common::ObExprStringBuf IAllocator; - public: +public: explicit ObExprPrior(common::ObIAllocator& alloc); virtual ~ObExprPrior(){}; @@ -30,9 +30,9 @@ class ObExprPrior : public ObExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_prior_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: // static int calc_(const common::ObObj ¶m, common::ObObj &res, common::ObCastCtx &cast_ctx); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprPrior) const; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_promotion_util.h b/src/sql/engine/expr/ob_expr_promotion_util.h index 8421b0842..9aa531673 100644 --- a/src/sql/engine/expr/ob_expr_promotion_util.h +++ b/src/sql/engine/expr/ob_expr_promotion_util.h @@ -22,10 +22,10 @@ namespace oceanbase { namespace sql { class ObExprResType; class ObExprPromotionUtil { - public: +public: static int get_nvl_type(ObExprResType& type, const ObExprResType& type1, const ObExprResType& type2); - private: +private: static int get_calc_type(ObExprResType& type, const ObExprResType& type1, const ObExprResType& type2, const common::ObObjType map[common::ObMaxTC][common::ObMaxTC]); }; diff --git a/src/sql/engine/expr/ob_expr_quarter.h b/src/sql/engine/expr/ob_expr_quarter.h index a70e163f1..855374a42 100644 --- a/src/sql/engine/expr/ob_expr_quarter.h +++ b/src/sql/engine/expr/ob_expr_quarter.h @@ -19,7 +19,7 @@ namespace sql { // Returns the quarter of date // range from 1 to 4 class ObExprQuarter : public ObFuncExprOperator { - public: +public: ObExprQuarter(); explicit ObExprQuarter(common::ObIAllocator& alloc); virtual ~ObExprQuarter(); @@ -30,7 +30,7 @@ class ObExprQuarter : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_quater(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprQuarter); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_quote.h b/src/sql/engine/expr/ob_expr_quote.h index 15bb24826..0e46bbef3 100644 --- a/src/sql/engine/expr/ob_expr_quote.h +++ b/src/sql/engine/expr/ob_expr_quote.h @@ -17,20 +17,16 @@ namespace oceanbase { namespace sql { class ObExprQuote : public ObStringExprOperator { - public: +public: ObExprQuote(); explicit ObExprQuote(common::ObIAllocator& alloc); virtual ~ObExprQuote(); - virtual int calc_result_type1(ObExprResType &type, - ObExprResType &type1, - common::ObExprTypeCtx &type_ctx) const override; - virtual int calc_result1(common::ObObj &result, - const common::ObObj &obj, - common::ObExprCtx &expr_ctx) const override; - virtual int cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, - ObExpr &rt_expr) const override; - static int calc_quote_expr(const ObExpr &expr, ObEvalCtx &ctx, - ObDatum &res_datum); + virtual int calc_result_type1( + ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override; + virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const override; + virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; + static int calc_quote_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); + private: static const int16_t APPEND_LEN = 2; static const int16_t LEN_OF_NULL = 4; diff --git a/src/sql/engine/expr/ob_expr_radians.h b/src/sql/engine/expr/ob_expr_radians.h index 851309a27..0a70131d2 100644 --- a/src/sql/engine/expr/ob_expr_radians.h +++ b/src/sql/engine/expr/ob_expr_radians.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprRadians : public ObFuncExprOperator { - public: +public: explicit ObExprRadians(common::ObIAllocator& alloc); virtual ~ObExprRadians(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprRadians : public ObFuncExprOperator { static int calc_radians_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: const static double radians_ratio_; DISALLOW_COPY_AND_ASSIGN(ObExprRadians); }; diff --git a/src/sql/engine/expr/ob_expr_random.h b/src/sql/engine/expr/ob_expr_random.h index d71c569c6..15f1b2880 100644 --- a/src/sql/engine/expr/ob_expr_random.h +++ b/src/sql/engine/expr/ob_expr_random.h @@ -20,19 +20,19 @@ namespace sql { class ObExprRandom : public ObFuncExprOperator { OB_UNIS_VERSION(1); class ObExprRandomCtx : public ObExprOperatorCtx { - public: + public: ObExprRandomCtx(); virtual ~ObExprRandomCtx(); void set_seed(uint32_t seed); void get_next_random(double& res); - private: + private: static const uint64_t max_value_; uint64_t seed1_; uint64_t seed2_; }; - public: +public: explicit ObExprRandom(common::ObIAllocator& alloc); virtual ~ObExprRandom(); virtual int calc_result_typeN( @@ -50,10 +50,10 @@ class ObExprRandom : public ObFuncExprOperator { static int calc_random_expr_const_seed(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); static int calc_random_expr_nonconst_seed(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - public: +public: virtual int assign(const ObExprOperator& other) override; - private: +private: bool is_seed_const_; // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprRandom); diff --git a/src/sql/engine/expr/ob_expr_rawtohex.h b/src/sql/engine/expr/ob_expr_rawtohex.h index 69642322b..07f19bf76 100644 --- a/src/sql/engine/expr/ob_expr_rawtohex.h +++ b/src/sql/engine/expr/ob_expr_rawtohex.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprRawtohex : public ObStringExprOperator { - public: +public: explicit ObExprRawtohex(common::ObIAllocator& alloc); virtual ~ObExprRawtohex(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprRawtohex : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_rawtohex_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRawtohex); }; diff --git a/src/sql/engine/expr/ob_expr_regexp.h b/src/sql/engine/expr/ob_expr_regexp.h index 3d87b3a2a..1cfd9f4bf 100644 --- a/src/sql/engine/expr/ob_expr_regexp.h +++ b/src/sql/engine/expr/ob_expr_regexp.h @@ -21,7 +21,7 @@ namespace sql { class ObExprRegexp : public ObFuncExprOperator { OB_UNIS_VERSION_V(1); - public: +public: explicit ObExprRegexp(common::ObIAllocator& alloc); virtual ~ObExprRegexp(); @@ -64,15 +64,15 @@ class ObExprRegexp : public ObFuncExprOperator { static int eval_regexp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: inline int need_fast_calc(common::ObExprCtx& expr_ctx, bool& result) const; - private: +private: int16_t regexp_idx_; // idx of posix_regexp_list_ in plan ctx, for regexp operator bool pattern_is_const_; bool value_is_const_; - private: +private: // disallow copy ObExprRegexp(const ObExprRegexp& other); ObExprRegexp& operator=(const ObExprRegexp& ohter); diff --git a/src/sql/engine/expr/ob_expr_regexp_context.h b/src/sql/engine/expr/ob_expr_regexp_context.h index 436c03b73..92b985d20 100644 --- a/src/sql/engine/expr/ob_expr_regexp_context.h +++ b/src/sql/engine/expr/ob_expr_regexp_context.h @@ -31,7 +31,7 @@ namespace sql { // Return same address if alloc size less than reserved size. // Prepare is needed for every allocation. class ObInplaceAllocator : public common::ObIAllocator { - public: +public: ObInplaceAllocator() : alloc_(NULL), mem_(NULL), len_(0) {} @@ -42,18 +42,18 @@ class ObInplaceAllocator : public common::ObIAllocator { virtual void* alloc(const int64_t size) override; - private: +private: common::ObIAllocator* alloc_; void* mem_; int64_t len_; }; class ObExprRegexContext : public ObExprOperatorCtx { - public: +public: ObExprRegexContext(); virtual ~ObExprRegexContext(); - public: +public: inline bool is_inited() const { return inited_; @@ -91,14 +91,14 @@ class ObExprRegexContext : public ObExprOperatorCtx { common::ObIArray& subexpr_array) const; TO_STRING_KV(K_(inited)); - private: +private: void reset_reg(); int getwc(const common::ObString& text, wchar_t*& wc, int64_t& wc_length, common::ObExprStringBuf& string_buf) const; int w2c( const wchar_t* wc, int64_t length, char*& chr, int64_t& chr_length, common::ObExprStringBuf& string_buf) const; int convert_reg_err_code_to_ob_err_code(int reg_err) const; - private: +private: bool inited_; ob_regex_t reg_; diff --git a/src/sql/engine/expr/ob_expr_regexp_count.h b/src/sql/engine/expr/ob_expr_regexp_count.h index 8b824b736..a0088c928 100644 --- a/src/sql/engine/expr/ob_expr_regexp_count.h +++ b/src/sql/engine/expr/ob_expr_regexp_count.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprRegexpCount : public ObFuncExprOperator { - public: +public: explicit ObExprRegexpCount(common::ObIAllocator& alloc); virtual ~ObExprRegexpCount(); virtual int calc_result_typeN( @@ -34,12 +34,12 @@ class ObExprRegexpCount : public ObFuncExprOperator { static int get_regexp_flags( const common::ObCollationType calc_cs_type, const common::ObString& match_param, int& flags, int& multi_flag); - private: +private: static int calc(int64_t& ret_count, const common::ObString& text, const common::ObString& pattern, int64_t position, const common::ObCollationType calc_cs_type, const common::ObString& match_param, int64_t subexpr, bool has_null_argument, ObExprRegexContext* regexp_ptr, common::ObExprStringBuf& string_buf); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRegexpCount); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_regexp_instr.h b/src/sql/engine/expr/ob_expr_regexp_instr.h index e4ac622ae..9fa6150df 100644 --- a/src/sql/engine/expr/ob_expr_regexp_instr.h +++ b/src/sql/engine/expr/ob_expr_regexp_instr.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprRegexpInstr : public ObFuncExprOperator { - public: +public: explicit ObExprRegexpInstr(common::ObIAllocator& alloc); virtual ~ObExprRegexpInstr(); virtual int calc_result_typeN( @@ -30,13 +30,13 @@ class ObExprRegexpInstr : public ObFuncExprOperator { static int eval_regexp_instr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int calc(int64_t& ret_pos, const common::ObString& text, const common::ObString& pattern, int64_t position, int64_t occurrence, int64_t return_option, const common::ObCollationType cs_type, const common::ObString& match_param, int64_t subexpr, bool has_null_argument, ObExprRegexContext* regexp_ptr, common::ObExprStringBuf& string_buf); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRegexpInstr); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_regexp_like.h b/src/sql/engine/expr/ob_expr_regexp_like.h index 920b9fff4..161455ee9 100644 --- a/src/sql/engine/expr/ob_expr_regexp_like.h +++ b/src/sql/engine/expr/ob_expr_regexp_like.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprRegexpLike : public ObFuncExprOperator { - public: +public: explicit ObExprRegexpLike(common::ObIAllocator& alloc); virtual ~ObExprRegexpLike(); virtual int calc_result_typeN( @@ -31,7 +31,7 @@ class ObExprRegexpLike : public ObFuncExprOperator { static int eval_regexp_like(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int regexp_like(bool& match, const common::ObString& text, const common::ObString& pattern, int64_t position, int64_t occurrence, const common::ObCollationType calc_cs_type, const common::ObString& match_param, bool has_null_argument, ObExprRegexContext* regexp_ptr, common::ObExprStringBuf& string_buf); @@ -40,7 +40,7 @@ class ObExprRegexpLike : public ObFuncExprOperator { int64_t occurrence, const common::ObString& match_param, bool has_null_argument, ObExprRegexContext* regexp_ptr, common::ObExprStringBuf& string_buf) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRegexpLike); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_regexp_replace.h b/src/sql/engine/expr/ob_expr_regexp_replace.h index 1da86db5f..f9d0e1404 100644 --- a/src/sql/engine/expr/ob_expr_regexp_replace.h +++ b/src/sql/engine/expr/ob_expr_regexp_replace.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprRegexpReplace : public ObStringExprOperator { - public: +public: explicit ObExprRegexpReplace(common::ObIAllocator& alloc); virtual ~ObExprRegexpReplace(); virtual int calc_result_typeN( @@ -32,13 +32,13 @@ class ObExprRegexpReplace : public ObStringExprOperator { static int eval_regexp_replace(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int calc(common::ObString& ret_str, const common::ObString& text, const common::ObString& pattern, const common::ObString& replacement_string, int64_t position, int64_t occurrence, const common::ObCollationType cs_type, const common::ObString& match_param, int null_argument_idx, ObExprRegexContext* regexp_ptr, common::ObExprStringBuf& string_buf); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRegexpReplace); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_regexp_substr.h b/src/sql/engine/expr/ob_expr_regexp_substr.h index 604ebd699..a577d5117 100644 --- a/src/sql/engine/expr/ob_expr_regexp_substr.h +++ b/src/sql/engine/expr/ob_expr_regexp_substr.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprRegexpSubstr : public ObStringExprOperator { - public: +public: explicit ObExprRegexpSubstr(common::ObIAllocator& alloc); virtual ~ObExprRegexpSubstr(); virtual int calc_result_typeN( @@ -31,13 +31,13 @@ class ObExprRegexpSubstr : public ObStringExprOperator { static int eval_regexp_substr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int calc(common::ObString& result, bool& is_null, const common::ObString& text, const common::ObString& pattern, int64_t position, int64_t occurrence, const common::ObCollationType cs_type, const common::ObString& match_param, int64_t subexpr, bool has_null_argument, ObExprRegexContext* regexp_ptr, common::ObExprStringBuf& string_buf); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRegexpSubstr); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_remainder.h b/src/sql/engine/expr/ob_expr_remainder.h index 4ac23d99a..544bf42e0 100644 --- a/src/sql/engine/expr/ob_expr_remainder.h +++ b/src/sql/engine/expr/ob_expr_remainder.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprRemainder : public ObArithExprOperator { - public: +public: ObExprRemainder(); explicit ObExprRemainder(common::ObIAllocator& alloc); virtual ~ObExprRemainder(){}; @@ -33,7 +33,7 @@ class ObExprRemainder : public ObArithExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_remainder_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: static int remainder_float(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObIAllocator* allocator, common::ObScale scale); static int remainder_double(common::ObObj& res, const common::ObObj& left, const common::ObObj& right, @@ -42,7 +42,7 @@ class ObExprRemainder : public ObArithExprOperator { common::ObIAllocator* allocator, common::ObScale scale); DISALLOW_COPY_AND_ASSIGN(ObExprRemainder); - private: +private: static ObArithFunc remainder_funcs_[common::ObMaxTC]; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_remove_const.h b/src/sql/engine/expr/ob_expr_remove_const.h index a5f89e435..67dda2f86 100644 --- a/src/sql/engine/expr/ob_expr_remove_const.h +++ b/src/sql/engine/expr/ob_expr_remove_const.h @@ -32,7 +32,7 @@ namespace sql { // // class ObExprRemoveConst : public ObFuncExprOperator { - public: +public: explicit ObExprRemoveConst(common::ObIAllocator& alloc); virtual ~ObExprRemoveConst() {} @@ -46,7 +46,7 @@ class ObExprRemoveConst : public ObFuncExprOperator { static int eval_remove_const(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRemoveConst); }; diff --git a/src/sql/engine/expr/ob_expr_repeat.h b/src/sql/engine/expr/ob_expr_repeat.h index 8f84867a8..d6739881b 100644 --- a/src/sql/engine/expr/ob_expr_repeat.h +++ b/src/sql/engine/expr/ob_expr_repeat.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprRepeat : public ObStringExprOperator { - public: +public: explicit ObExprRepeat(common::ObIAllocator& alloc); virtual ~ObExprRepeat(); virtual int calc_result_type2( @@ -44,7 +44,7 @@ class ObExprRepeat : public ObStringExprOperator { static int repeat(common::ObString& output, bool& is_null, const common::ObString& input, const int64_t count, common::ObIAllocator& alloc, const int64_t max_result_size); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprRepeat); }; diff --git a/src/sql/engine/expr/ob_expr_replace.h b/src/sql/engine/expr/ob_expr_replace.h index 839e1aeba..f2f27f920 100644 --- a/src/sql/engine/expr/ob_expr_replace.h +++ b/src/sql/engine/expr/ob_expr_replace.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprReplace : public ObStringExprOperator { - public: +public: explicit ObExprReplace(common::ObIAllocator& alloc); virtual ~ObExprReplace(); virtual int calc_result_typeN( @@ -47,7 +47,7 @@ class ObExprReplace : public ObStringExprOperator { static int eval_replace(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprReplace); diff --git a/src/sql/engine/expr/ob_expr_res_type.h b/src/sql/engine/expr/ob_expr_res_type.h index 9e6a535ac..0fa8d4065 100644 --- a/src/sql/engine/expr/ob_expr_res_type.h +++ b/src/sql/engine/expr/ob_expr_res_type.h @@ -30,7 +30,7 @@ typedef common::ObObjMeta ObExprCalcType; class ObExprResType : public common::ObObjMeta { OB_UNIS_VERSION(1); - public: +public: ObExprResType() : ObObjMeta(), accuracy_(), @@ -77,7 +77,7 @@ class ObExprResType : public common::ObObjMeta { return !this->operator==(other); } - public: +public: OB_INLINE void reset() { accuracy_.reset(); @@ -340,7 +340,7 @@ class ObExprResType : public common::ObObjMeta { // others. INHERIT_TO_STRING_KV(N_META, ObObjMeta, N_ACCURACY, accuracy_, N_FLAG, res_flags_, N_CALC_TYPE, calc_type_); - private: +private: common::ObAccuracy accuracy_; // when it is Extend type, used to represent datatype id common::ObAccuracy calc_accuracy_; // when it is Extend type, length is used to represent datatype size common::ObObj param_; diff --git a/src/sql/engine/expr/ob_expr_res_type_map.h b/src/sql/engine/expr/ob_expr_res_type_map.h index 85b210492..3b8559962 100644 --- a/src/sql/engine/expr/ob_expr_res_type_map.h +++ b/src/sql/engine/expr/ob_expr_res_type_map.h @@ -49,7 +49,7 @@ struct ObArithRule { template class ObArithRuleMap { - public: +public: ObArithRuleMap() {} ~ObArithRuleMap() @@ -63,7 +63,7 @@ class ObArithRuleMap { return arith_rule_map_[i][j]; } - private: +private: ObArithRule arith_rule_map_[D1][D2]; }; @@ -80,7 +80,7 @@ struct ObArithResultTypeChoice { }; class ObArithFlag { - public: +public: ObArithFlag() : flags_(0) {} ObArithFlag(uint64_t flags) : flags_(flags) @@ -101,12 +101,12 @@ class ObArithFlag { } TO_STRING_KV(K(flags_)); - private: +private: uint64_t flags_; }; class ObArithResultTypeMap { - public: +public: enum OP : uint64_t { ADD = 1ULL << 0, SUB = 1ULL << 1, @@ -132,7 +132,7 @@ class ObArithResultTypeMap { } class RulesApplyer { - public: + public: RulesApplyer(ObArithResultTypeMap& map, ObArithFlag op_flags, TypeBitset& type1_bitset, TypeBitset& type2_bitset) : map_(map), op_flags_(op_flags), @@ -202,7 +202,7 @@ class ObArithResultTypeMap { return for_each(set_param2); } - private: + private: template RulesApplyer& for_each(func& f) { @@ -320,7 +320,7 @@ class ObArithResultTypeMap { return arith_rule_maps_[flag2bit(flag)].get_rule(type1, type2); } - private: +private: ObArithRuleMap arith_rule_maps_[OP_CNT]; TypeBitset types_in_tc_set_[TC_COUNT]; TypeBitset types_set_[TYPE_COUNT]; diff --git a/src/sql/engine/expr/ob_expr_result_type_util.h b/src/sql/engine/expr/ob_expr_result_type_util.h index f0ffeee99..9505fe5b9 100644 --- a/src/sql/engine/expr/ob_expr_result_type_util.h +++ b/src/sql/engine/expr/ob_expr_result_type_util.h @@ -25,7 +25,7 @@ namespace sql { class ObArithResultTypeMap; class ObExprResultTypeUtil { - public: +public: /* The way mysql calculates expressions is: first calculate a target type by column type, * Then, in the comparison stage, the value is converted to the modified type, * and then the comparison is made. diff --git a/src/sql/engine/expr/ob_expr_reverse.h b/src/sql/engine/expr/ob_expr_reverse.h index c0af07adf..f7ca4fb51 100644 --- a/src/sql/engine/expr/ob_expr_reverse.h +++ b/src/sql/engine/expr/ob_expr_reverse.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprReverse : public ObStringExprOperator { - public: +public: explicit ObExprReverse(common::ObIAllocator& alloc); virtual ~ObExprReverse(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -27,7 +27,7 @@ class ObExprReverse : public ObStringExprOperator { static int do_reverse(const common::ObString& input_str, const common::ObCollationType& cs_type, common::ObIAllocator* allocator, common::ObString& res_str); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprReverse); }; diff --git a/src/sql/engine/expr/ob_expr_right.h b/src/sql/engine/expr/ob_expr_right.h index c99136688..da74ca368 100644 --- a/src/sql/engine/expr/ob_expr_right.h +++ b/src/sql/engine/expr/ob_expr_right.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprRight : public ObStringExprOperator { - public: +public: explicit ObExprRight(common::ObIAllocator& alloc); virtual ~ObExprRight(); virtual int calc_result_type2( @@ -27,7 +27,7 @@ class ObExprRight : public ObStringExprOperator { common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRight); }; diff --git a/src/sql/engine/expr/ob_expr_row_count.h b/src/sql/engine/expr/ob_expr_row_count.h index 7d58651ca..0fd71904b 100644 --- a/src/sql/engine/expr/ob_expr_row_count.h +++ b/src/sql/engine/expr/ob_expr_row_count.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprRowCount : public ObFuncExprOperator { - public: +public: explicit ObExprRowCount(common::ObIAllocator& alloc); virtual ~ObExprRowCount(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprRowCount : public ObFuncExprOperator { static int eval_row_count(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRowCount); }; diff --git a/src/sql/engine/expr/ob_expr_rownum.h b/src/sql/engine/expr/ob_expr_rownum.h index 2de743dbc..5e76be5df 100644 --- a/src/sql/engine/expr/ob_expr_rownum.h +++ b/src/sql/engine/expr/ob_expr_rownum.h @@ -22,7 +22,7 @@ class ObExprCGCtx; class ObExprRowNum : public ObFuncExprOperator { OB_UNIS_VERSION(1); - public: +public: explicit ObExprRowNum(common::ObIAllocator& alloc); virtual ~ObExprRowNum(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -36,7 +36,7 @@ class ObExprRowNum : public ObFuncExprOperator { operator_id_ = operator_id; } - private: +private: uint64_t operator_id_; DISALLOW_COPY_AND_ASSIGN(ObExprRowNum); }; diff --git a/src/sql/engine/expr/ob_expr_rpc_port.h b/src/sql/engine/expr/ob_expr_rpc_port.h index 556c85fca..fda5a8613 100644 --- a/src/sql/engine/expr/ob_expr_rpc_port.h +++ b/src/sql/engine/expr/ob_expr_rpc_port.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprRpcPort : public ObFuncExprOperator { - public: +public: explicit ObExprRpcPort(common::ObIAllocator& alloc); virtual ~ObExprRpcPort(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprRpcPort : public ObFuncExprOperator { static int eval_rpc_port(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRpcPort); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_seq_nextval.h b/src/sql/engine/expr/ob_expr_seq_nextval.h index 71ae7a8a7..2e607371d 100644 --- a/src/sql/engine/expr/ob_expr_seq_nextval.h +++ b/src/sql/engine/expr/ob_expr_seq_nextval.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObPhysicalPlanCtx; class ObExprSeqNextval : public ObFuncExprOperator { - public: +public: explicit ObExprSeqNextval(common::ObIAllocator& alloc); virtual ~ObExprSeqNextval(); int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -27,7 +27,7 @@ class ObExprSeqNextval : public ObFuncExprOperator { int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_sequence_nextval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprSeqNextval); }; diff --git a/src/sql/engine/expr/ob_expr_shadow_uk_project.h b/src/sql/engine/expr/ob_expr_shadow_uk_project.h index a7648b202..e4e5f889c 100644 --- a/src/sql/engine/expr/ob_expr_shadow_uk_project.h +++ b/src/sql/engine/expr/ob_expr_shadow_uk_project.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprShadowUKProject : public ObExprOperator { - public: +public: ObExprShadowUKProject(common::ObIAllocator& alloc) : ObExprOperator(alloc, T_OP_SHADOW_UK_PROJECT, N_SHADOW_UK_PROJECTOR, MORE_THAN_ONE, NOT_ROW_DIMENSION) {} diff --git a/src/sql/engine/expr/ob_expr_sign.h b/src/sql/engine/expr/ob_expr_sign.h index 8a31ffb41..19ffb6758 100644 --- a/src/sql/engine/expr/ob_expr_sign.h +++ b/src/sql/engine/expr/ob_expr_sign.h @@ -18,19 +18,19 @@ namespace oceanbase { namespace sql { class ObExprSign : public ObFuncExprOperator { - public: +public: explicit ObExprSign(common::ObIAllocator& alloc); virtual ~ObExprSign(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - private: +private: // help func static int calc(common::ObObj& reult, double val); DISALLOW_COPY_AND_ASSIGN(ObExprSign); - private: +private: }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_sin.h b/src/sql/engine/expr/ob_expr_sin.h index 2bdd7dddf..6de57a9b4 100644 --- a/src/sql/engine/expr/ob_expr_sin.h +++ b/src/sql/engine/expr/ob_expr_sin.h @@ -19,14 +19,14 @@ namespace oceanbase { namespace sql { class ObExprSin : public ObFuncExprOperator { - public: +public: explicit ObExprSin(common::ObIAllocator& alloc); virtual ~ObExprSin(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& radian, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& radian_obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSin); }; diff --git a/src/sql/engine/expr/ob_expr_sinh.h b/src/sql/engine/expr/ob_expr_sinh.h index 4746b130d..11a9e6b93 100644 --- a/src/sql/engine/expr/ob_expr_sinh.h +++ b/src/sql/engine/expr/ob_expr_sinh.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObExprSinh : public ObFuncExprOperator { - public: +public: explicit ObExprSinh(common::ObIAllocator& alloc); virtual ~ObExprSinh(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSinh); }; diff --git a/src/sql/engine/expr/ob_expr_space.h b/src/sql/engine/expr/ob_expr_space.h index c09e5aa4a..f77c37a75 100644 --- a/src/sql/engine/expr/ob_expr_space.h +++ b/src/sql/engine/expr/ob_expr_space.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprSpace : public ObFuncExprOperator { - public: +public: explicit ObExprSpace(common::ObIAllocator& alloc); virtual ~ObExprSpace(){}; @@ -29,7 +29,7 @@ class ObExprSpace : public ObFuncExprOperator { static int eval_space(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSpace); }; diff --git a/src/sql/engine/expr/ob_expr_spm.h b/src/sql/engine/expr/ob_expr_spm.h index 9bc62f90d..dbe4d3d3d 100644 --- a/src/sql/engine/expr/ob_expr_spm.h +++ b/src/sql/engine/expr/ob_expr_spm.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSpmLoadPlans : public ObFuncExprOperator { - public: +public: explicit ObExprSpmLoadPlans(common::ObIAllocator& alloc); virtual ~ObExprSpmLoadPlans(); virtual int calc_result_typeN( @@ -27,12 +27,12 @@ class ObExprSpmLoadPlans : public ObFuncExprOperator { virtual int calc_resultN( common::ObObj& result, const common::ObObj* objs, int64_t param_num, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSpmLoadPlans); }; class ObExprSpmAlterBaseline : public ObFuncExprOperator { - public: +public: explicit ObExprSpmAlterBaseline(common::ObIAllocator& alloc); virtual ~ObExprSpmAlterBaseline(); virtual int calc_resultN( @@ -40,12 +40,12 @@ class ObExprSpmAlterBaseline : public ObFuncExprOperator { virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSpmAlterBaseline); }; class ObExprSpmDropBaseline : public ObFuncExprOperator { - public: +public: explicit ObExprSpmDropBaseline(common::ObIAllocator& alloc); virtual ~ObExprSpmDropBaseline(); int calc_result2( @@ -53,7 +53,7 @@ class ObExprSpmDropBaseline : public ObFuncExprOperator { int calc_result_type2( ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSpmDropBaseline); }; diff --git a/src/sql/engine/expr/ob_expr_sqrt.h b/src/sql/engine/expr/ob_expr_sqrt.h index cf4ffb2f9..87a99a50e 100644 --- a/src/sql/engine/expr/ob_expr_sqrt.h +++ b/src/sql/engine/expr/ob_expr_sqrt.h @@ -17,17 +17,17 @@ namespace oceanbase { namespace sql { class ObExprSqrt : public ObFuncExprOperator { - public: +public: explicit ObExprSqrt(common::ObIAllocator& alloc); virtual ~ObExprSqrt(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSqrt); - private: +private: }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_stmt_id.h b/src/sql/engine/expr/ob_expr_stmt_id.h index 39499f852..44c8bc98d 100644 --- a/src/sql/engine/expr/ob_expr_stmt_id.h +++ b/src/sql/engine/expr/ob_expr_stmt_id.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprStmtId : public ObFuncExprOperator { - public: +public: explicit ObExprStmtId(common::ObIAllocator& alloc); virtual ~ObExprStmtId() {} @@ -26,7 +26,7 @@ class ObExprStmtId : public ObFuncExprOperator { virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result0(common::ObObj& result, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprStmtId); }; } // end namespace sql diff --git a/src/sql/engine/expr/ob_expr_str_to_date.h b/src/sql/engine/expr/ob_expr_str_to_date.h index 3d92e5e99..9399a441b 100644 --- a/src/sql/engine/expr/ob_expr_str_to_date.h +++ b/src/sql/engine/expr/ob_expr_str_to_date.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprStrToDate : public ObFuncExprOperator { - public: +public: explicit ObExprStrToDate(common::ObIAllocator& alloc); virtual ~ObExprStrToDate(); virtual int calc_result_type2( @@ -28,13 +28,13 @@ class ObExprStrToDate : public ObFuncExprOperator { common::ObObj& result, const common::ObObj& date, const common::ObObj& format, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprStrToDate); }; class ObExprOracleToDate : public ObExprToTemporalBase { - public: +public: explicit ObExprOracleToDate(common::ObIAllocator& alloc) : ObExprToTemporalBase(alloc, T_FUN_SYS_TO_DATE, N_TO_DATE) {} virtual ~ObExprOracleToDate() diff --git a/src/sql/engine/expr/ob_expr_strcmp.h b/src/sql/engine/expr/ob_expr_strcmp.h index 836d4de73..6fd972b97 100644 --- a/src/sql/engine/expr/ob_expr_strcmp.h +++ b/src/sql/engine/expr/ob_expr_strcmp.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprStrcmp : public ObRelationalExprOperator { - public: +public: ObExprStrcmp(); explicit ObExprStrcmp(common::ObIAllocator& alloc); virtual ~ObExprStrcmp(){}; @@ -32,7 +32,7 @@ class ObExprStrcmp : public ObRelationalExprOperator { return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprStrcmp); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_subquery_equal.h b/src/sql/engine/expr/ob_expr_subquery_equal.h index 937913b4e..60bc74886 100644 --- a/src/sql/engine/expr/ob_expr_subquery_equal.h +++ b/src/sql/engine/expr/ob_expr_subquery_equal.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprSubQueryEqual : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprSubQueryEqual(common::ObIAllocator& alloc); virtual ~ObExprSubQueryEqual(); @@ -27,12 +27,10 @@ class ObExprSubQueryEqual : public ObSubQueryRelationalExpr { } private: - virtual int compare_single_row(const common::ObNewRow &left_row, - const common::ObNewRow &right_row, - common::ObExprCtx &expr_ctx, - common::ObObj &result) const override; + virtual int compare_single_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row, + common::ObExprCtx& expr_ctx, common::ObObj& result) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryEqual); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_subquery_greater_equal.h b/src/sql/engine/expr/ob_expr_subquery_greater_equal.h index 279554605..39522b8f4 100644 --- a/src/sql/engine/expr/ob_expr_subquery_greater_equal.h +++ b/src/sql/engine/expr/ob_expr_subquery_greater_equal.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSubQueryGreaterEqual : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprSubQueryGreaterEqual(common::ObIAllocator& alloc); virtual ~ObExprSubQueryGreaterEqual(); @@ -28,11 +28,11 @@ class ObExprSubQueryGreaterEqual : public ObSubQueryRelationalExpr { return ObSubQueryRelationalExpr::cg_expr(op_cg_ctx, raw_expr, rt_expr); } - private: +private: virtual int compare_single_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row, common::ObExprCtx& expr_ctx, common::ObObj& result) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryGreaterEqual); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_subquery_greater_than.h b/src/sql/engine/expr/ob_expr_subquery_greater_than.h index c3bc7cc76..b689b6964 100644 --- a/src/sql/engine/expr/ob_expr_subquery_greater_than.h +++ b/src/sql/engine/expr/ob_expr_subquery_greater_than.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSubQueryGreaterThan : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprSubQueryGreaterThan(common::ObIAllocator& alloc); virtual ~ObExprSubQueryGreaterThan(); @@ -28,11 +28,11 @@ class ObExprSubQueryGreaterThan : public ObSubQueryRelationalExpr { return ObSubQueryRelationalExpr::cg_expr(op_cg_ctx, raw_expr, rt_expr); } - private: +private: virtual int compare_single_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row, common::ObExprCtx& expr_ctx, common::ObObj& result) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryGreaterThan); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_subquery_less_equal.h b/src/sql/engine/expr/ob_expr_subquery_less_equal.h index a35ac67a6..a62a7b924 100644 --- a/src/sql/engine/expr/ob_expr_subquery_less_equal.h +++ b/src/sql/engine/expr/ob_expr_subquery_less_equal.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSubQueryLessEqual : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprSubQueryLessEqual(common::ObIAllocator& alloc); virtual ~ObExprSubQueryLessEqual(); @@ -28,11 +28,11 @@ class ObExprSubQueryLessEqual : public ObSubQueryRelationalExpr { return ObSubQueryRelationalExpr::cg_expr(op_cg_ctx, raw_expr, rt_expr); } - private: +private: virtual int compare_single_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row, common::ObExprCtx& expr_ctx, common::ObObj& result) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryLessEqual); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_subquery_less_than.h b/src/sql/engine/expr/ob_expr_subquery_less_than.h index ebd8fdfba..0d4aed572 100644 --- a/src/sql/engine/expr/ob_expr_subquery_less_than.h +++ b/src/sql/engine/expr/ob_expr_subquery_less_than.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSubQueryLessThan : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprSubQueryLessThan(common::ObIAllocator& alloc); virtual ~ObExprSubQueryLessThan(); @@ -28,11 +28,11 @@ class ObExprSubQueryLessThan : public ObSubQueryRelationalExpr { return ObSubQueryRelationalExpr::cg_expr(op_cg_ctx, raw_expr, rt_expr); } - private: +private: virtual int compare_single_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row, common::ObExprCtx& expr_ctx, common::ObObj& result) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryLessThan); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_subquery_not_equal.h b/src/sql/engine/expr/ob_expr_subquery_not_equal.h index e552f2b12..2d4818a42 100644 --- a/src/sql/engine/expr/ob_expr_subquery_not_equal.h +++ b/src/sql/engine/expr/ob_expr_subquery_not_equal.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprSubQueryNotEqual : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprSubQueryNotEqual(common::ObIAllocator& alloc); virtual ~ObExprSubQueryNotEqual(); @@ -26,11 +26,11 @@ class ObExprSubQueryNotEqual : public ObSubQueryRelationalExpr { return ObSubQueryRelationalExpr::cg_expr(op_cg_ctx, raw_expr, rt_expr); } - private: +private: virtual int compare_single_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row, common::ObExprCtx& expr_ctx, common::ObObj& result) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryNotEqual); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_subquery_ns_equal.h b/src/sql/engine/expr/ob_expr_subquery_ns_equal.h index 689898fe3..ed7fdc870 100644 --- a/src/sql/engine/expr/ob_expr_subquery_ns_equal.h +++ b/src/sql/engine/expr/ob_expr_subquery_ns_equal.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprSubQueryNSEqual : public ObSubQueryRelationalExpr { - public: +public: explicit ObExprSubQueryNSEqual(common::ObIAllocator& alloc); virtual ~ObExprSubQueryNSEqual(); @@ -26,7 +26,7 @@ class ObExprSubQueryNSEqual : public ObSubQueryRelationalExpr { return ObSubQueryRelationalExpr::cg_expr(op_cg_ctx, raw_expr, rt_expr); } - private: +private: virtual int compare_single_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row, common::ObExprCtx& expr_ctx, common::ObObj& result) const; DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryNSEqual); diff --git a/src/sql/engine/expr/ob_expr_subquery_ref.h b/src/sql/engine/expr/ob_expr_subquery_ref.h index 211e29534..bd63ca649 100644 --- a/src/sql/engine/expr/ob_expr_subquery_ref.h +++ b/src/sql/engine/expr/ob_expr_subquery_ref.h @@ -23,7 +23,7 @@ class ObSubQueryIterator; class ObExprSubQueryRef : public ObExprOperator { OB_UNIS_VERSION(1); - public: +public: // extra info stored in ObExpr::extra_ struct ExtraInfo : public ObExprExtraInfoAccess { const static uint32_t DEF_OP_ID = std::numeric_limits::max(); @@ -77,10 +77,10 @@ class ObExprSubQueryRef : public ObExprOperator { row_dimension_, N_REAL_PARAM_NUM, real_param_num_, K_(scalar_result_type), K_(result_is_scalar), K_(subquery_idx), K_(row_desc)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryRef); - private: +private: bool result_is_scalar_; ObExprResType scalar_result_type_; int64_t subquery_idx_; diff --git a/src/sql/engine/expr/ob_expr_substr.h b/src/sql/engine/expr/ob_expr_substr.h index 5a4cb259d..4be55a9c9 100644 --- a/src/sql/engine/expr/ob_expr_substr.h +++ b/src/sql/engine/expr/ob_expr_substr.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSubstr : public ObStringExprOperator { - public: +public: explicit ObExprSubstr(common::ObIAllocator& alloc); virtual ~ObExprSubstr(); virtual int calc_result2(common::ObObj& result, const common::ObObj& text, const common::ObObj& start_pos, @@ -41,7 +41,7 @@ class ObExprSubstr : public ObStringExprOperator { static int eval_substr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: int calc_result_length( ObExprResType* types_array, int64_t param_num, common::ObCollationType cs_type, int64_t& res_len) const; int calc_result2_for_mysql(common::ObObj& result, const common::ObObj& text, const common::ObObj& start_pos, diff --git a/src/sql/engine/expr/ob_expr_substrb.h b/src/sql/engine/expr/ob_expr_substrb.h index e95f9622a..ce0403481 100644 --- a/src/sql/engine/expr/ob_expr_substrb.h +++ b/src/sql/engine/expr/ob_expr_substrb.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSubstrb : public ObStringExprOperator { - public: +public: explicit ObExprSubstrb(common::ObIAllocator& alloc); virtual ~ObExprSubstrb(); virtual int calc_result2(common::ObObj& result, const common::ObObj& text, const common::ObObj& start_pos, @@ -38,7 +38,7 @@ class ObExprSubstrb : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_substrb_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: int calc_result_length_in_byte(const ObExprResType& type, ObExprResType* types_array, int64_t param_num, common::ObCollationType cs_type, int64_t& res_len) const; static int handle_invalid_byte(char* ptr, const int64_t text_len, int64_t& start, int64_t& len, char reset_char, diff --git a/src/sql/engine/expr/ob_expr_substring_index.h b/src/sql/engine/expr/ob_expr_substring_index.h index eaddef82f..1b4d59f05 100644 --- a/src/sql/engine/expr/ob_expr_substring_index.h +++ b/src/sql/engine/expr/ob_expr_substring_index.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSubstringIndex : public ObStringExprOperator { - public: +public: explicit ObExprSubstringIndex(common::ObIAllocator& alloc); virtual ~ObExprSubstringIndex(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& str, ObExprResType& delim, ObExprResType& count, @@ -31,7 +31,7 @@ class ObExprSubstringIndex : public ObStringExprOperator { static int eval_substring_index(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: /** * find m_count apperance of m_delim in m_str(from left or from right) * @param[in] result calculated result @@ -43,7 +43,7 @@ class ObExprSubstringIndex : public ObStringExprOperator { static int string_search( common::ObString& result, const common::ObString& m_str, const common::ObString& m_delim, const int64_t m_count); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSubstringIndex); }; diff --git a/src/sql/engine/expr/ob_expr_sys_connect_by_path.h b/src/sql/engine/expr/ob_expr_sys_connect_by_path.h index 721d6782c..0bcb7b1da 100644 --- a/src/sql/engine/expr/ob_expr_sys_connect_by_path.h +++ b/src/sql/engine/expr/ob_expr_sys_connect_by_path.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSysConnectByPath : public ObExprOperator { - public: +public: explicit ObExprSysConnectByPath(common::ObIAllocator& alloc); virtual ~ObExprSysConnectByPath() {} @@ -32,7 +32,7 @@ class ObExprSysConnectByPath : public ObExprOperator { static int eval_sys_connect_by_path( const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, ObNLConnectByOpBase* connect_by_op); - private: +private: static int StringContain(const common::ObString& src_str, const common::ObString& sub_str, bool& is_contain, common::ObCollationType cs_type); DISALLOW_COPY_AND_ASSIGN(ObExprSysConnectByPath) const; diff --git a/src/sql/engine/expr/ob_expr_sys_context.h b/src/sql/engine/expr/ob_expr_sys_context.h index 12b2cc9ab..fae775dbf 100644 --- a/src/sql/engine/expr/ob_expr_sys_context.h +++ b/src/sql/engine/expr/ob_expr_sys_context.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprSysContext : public ObFuncExprOperator { - public: +public: ObExprSysContext(); explicit ObExprSysContext(common::ObIAllocator& alloc); virtual ~ObExprSysContext(); @@ -76,7 +76,7 @@ class ObExprSysContext : public ObFuncExprOperator { static int eval_sys_context(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); virtual int cg_expr(ObExprCGCtx& ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: static int get_calc_fun(const common::ObString& ns_str, const common::ObString& para_str, calc_fun& fun); static int get_userenv_fun(const common::ObString& para_str, calc_fun& fun); static UserEnvParameter userenv_parameters_[]; diff --git a/src/sql/engine/expr/ob_expr_sys_extract_utc.h b/src/sql/engine/expr/ob_expr_sys_extract_utc.h index 38d70f16a..a4c6609e2 100644 --- a/src/sql/engine/expr/ob_expr_sys_extract_utc.h +++ b/src/sql/engine/expr/ob_expr_sys_extract_utc.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprSysExtractUtc : public ObFuncExprOperator { - public: +public: explicit ObExprSysExtractUtc(common::ObIAllocator& alloc); virtual ~ObExprSysExtractUtc() {} @@ -28,7 +28,7 @@ class ObExprSysExtractUtc : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_sys_extract_utc(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprSysExtractUtc); }; diff --git a/src/sql/engine/expr/ob_expr_sys_op_opnsize.h b/src/sql/engine/expr/ob_expr_sys_op_opnsize.h index de347f491..88f2066f3 100644 --- a/src/sql/engine/expr/ob_expr_sys_op_opnsize.h +++ b/src/sql/engine/expr/ob_expr_sys_op_opnsize.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprSysOpOpnsize : public ObFuncExprOperator { - public: +public: explicit ObExprSysOpOpnsize(common::ObIAllocator& alloc) : ObFuncExprOperator(alloc, T_FUN_SYS_OP_OPNSIZE, "sys_op_opnsize", 1, NOT_ROW_DIMENSION) {} @@ -32,7 +32,7 @@ class ObExprSysOpOpnsize : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_sys_op_opnsize_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSysOpOpnsize); }; diff --git a/src/sql/engine/expr/ob_expr_sys_privilege_check.h b/src/sql/engine/expr/ob_expr_sys_privilege_check.h index 0a6d51557..d099c37b9 100644 --- a/src/sql/engine/expr/ob_expr_sys_privilege_check.h +++ b/src/sql/engine/expr/ob_expr_sys_privilege_check.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObExprSysPrivilegeCheck : public ObFuncExprOperator { - public: +public: explicit ObExprSysPrivilegeCheck(common::ObIAllocator& alloc); virtual ~ObExprSysPrivilegeCheck(); virtual int calc_result_typeN( @@ -28,7 +28,7 @@ class ObExprSysPrivilegeCheck : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_sys_privilege_check(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int check_show_priv(bool& allow_show, ObExecContext& exec_ctx, const common::ObString& level, const uint64_t tenant_id, const common::ObString& db_name, const common::ObString& table_name); DISALLOW_COPY_AND_ASSIGN(ObExprSysPrivilegeCheck); diff --git a/src/sql/engine/expr/ob_expr_sys_view_bigint_param.h b/src/sql/engine/expr/ob_expr_sys_view_bigint_param.h index 531193774..a2b656069 100644 --- a/src/sql/engine/expr/ob_expr_sys_view_bigint_param.h +++ b/src/sql/engine/expr/ob_expr_sys_view_bigint_param.h @@ -16,14 +16,14 @@ namespace oceanbase { namespace sql { class ObExprSysViewBigintParam : public ObFuncExprOperator { - public: +public: explicit ObExprSysViewBigintParam(common::ObIAllocator& alloc); virtual ~ObExprSysViewBigintParam(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSysViewBigintParam); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_tan.h b/src/sql/engine/expr/ob_expr_tan.h index c3342945f..3b9621d54 100644 --- a/src/sql/engine/expr/ob_expr_tan.h +++ b/src/sql/engine/expr/ob_expr_tan.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprTan : public ObFuncExprOperator { - public: +public: explicit ObExprTan(common::ObIAllocator& alloc); virtual ~ObExprTan(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& radian, common::ObExprTypeCtx& type_ctx) const; @@ -27,7 +27,7 @@ class ObExprTan : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprTan); }; diff --git a/src/sql/engine/expr/ob_expr_tanh.h b/src/sql/engine/expr/ob_expr_tanh.h index 9084c9dbb..eea84a947 100644 --- a/src/sql/engine/expr/ob_expr_tanh.h +++ b/src/sql/engine/expr/ob_expr_tanh.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObExprTanh : public ObFuncExprOperator { - public: +public: explicit ObExprTanh(common::ObIAllocator& alloc); virtual ~ObExprTanh(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprTanh); }; diff --git a/src/sql/engine/expr/ob_expr_time.h b/src/sql/engine/expr/ob_expr_time.h index 5e57e5a47..82a5fbaff 100644 --- a/src/sql/engine/expr/ob_expr_time.h +++ b/src/sql/engine/expr/ob_expr_time.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprTime : public ObFuncExprOperator { - public: +public: explicit ObExprTime(common::ObIAllocator& alloc); virtual ~ObExprTime(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -26,13 +26,13 @@ class ObExprTime : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_time(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprTime); }; class ObExprTimeBase : public ObFuncExprOperator { - public: +public: explicit ObExprTimeBase(common::ObIAllocator& alloc, int32_t date_type, ObExprOperatorType type, const char* name); virtual ~ObExprTimeBase(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -41,7 +41,7 @@ class ObExprTimeBase : public ObFuncExprOperator { static int calc(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, int32_t type, bool with_date, bool is_dayofmonth = false); - private: +private: int32_t dt_type_; // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprTimeBase); @@ -64,73 +64,73 @@ inline int ObExprTimeBase::calc_result_type1( } class ObExprHour : public ObExprTimeBase { - public: +public: explicit ObExprHour(common::ObIAllocator& alloc); virtual ~ObExprHour(); static int calc_hour(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprHour); }; class ObExprMinute : public ObExprTimeBase { - public: +public: ObExprMinute(); explicit ObExprMinute(common::ObIAllocator& alloc); virtual ~ObExprMinute(); static int calc_minute(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprMinute); }; class ObExprSecond : public ObExprTimeBase { - public: +public: ObExprSecond(); explicit ObExprSecond(common::ObIAllocator& alloc); virtual ~ObExprSecond(); static int calc_second(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSecond); }; class ObExprMicrosecond : public ObExprTimeBase { - public: +public: ObExprMicrosecond(); explicit ObExprMicrosecond(common::ObIAllocator& alloc); virtual ~ObExprMicrosecond(); static int calc_microsecond(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprMicrosecond); }; class ObExprYear : public ObExprTimeBase { - public: +public: ObExprYear(); explicit ObExprYear(common::ObIAllocator& alloc); virtual ~ObExprYear(); static int calc_year(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprYear); }; class ObExprMonth : public ObExprTimeBase { - public: +public: ObExprMonth(); explicit ObExprMonth(common::ObIAllocator& alloc); virtual ~ObExprMonth(); static int calc_month(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprMonth); }; class ObExprMonthName : public ObExprTimeBase { - public: +public: ObExprMonthName(); explicit ObExprMonthName(common::ObIAllocator& alloc); virtual ~ObExprMonthName(); @@ -138,7 +138,7 @@ class ObExprMonthName : public ObExprTimeBase { static int calc_month_name(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); static const char* get_month_name(int month); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprMonthName); typedef struct { int32_t int_val; diff --git a/src/sql/engine/expr/ob_expr_time_diff.h b/src/sql/engine/expr/ob_expr_time_diff.h index 5381eb155..e405ff161 100644 --- a/src/sql/engine/expr/ob_expr_time_diff.h +++ b/src/sql/engine/expr/ob_expr_time_diff.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprTimeDiff : public ObFuncExprOperator { - public: +public: explicit ObExprTimeDiff(common::ObIAllocator& alloc); virtual ~ObExprTimeDiff(); virtual int calc_result_type2( @@ -32,7 +32,7 @@ class ObExprTimeDiff : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_timediff(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int get_diff_value( const common::ObObj& obj1, const common::ObObj& obj2, const common::ObTimeZoneInfo* tz_info, int64_t& diff); static int get_diff_value_with_ob_time( diff --git a/src/sql/engine/expr/ob_expr_time_to_usec.h b/src/sql/engine/expr/ob_expr_time_to_usec.h index add68b564..2ee841e3d 100644 --- a/src/sql/engine/expr/ob_expr_time_to_usec.h +++ b/src/sql/engine/expr/ob_expr_time_to_usec.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprTimeToUsec : public ObFuncExprOperator { - public: +public: explicit ObExprTimeToUsec(common::ObIAllocator& alloc); virtual ~ObExprTimeToUsec(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& date, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprTimeToUsec : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprTimeToUsec); }; diff --git a/src/sql/engine/expr/ob_expr_timestamp.h b/src/sql/engine/expr/ob_expr_timestamp.h index 0dfa1fee5..b63e8fe20 100644 --- a/src/sql/engine/expr/ob_expr_timestamp.h +++ b/src/sql/engine/expr/ob_expr_timestamp.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { // note: this is oracle only function class ObExprSysTimestamp : public ObFuncExprOperator { - public: +public: explicit ObExprSysTimestamp(common::ObIAllocator& alloc); virtual ~ObExprSysTimestamp(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -28,13 +28,13 @@ class ObExprSysTimestamp : public ObFuncExprOperator { static int eval_systimestamp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSysTimestamp); }; // note: this is oracle only function class ObExprLocalTimestamp : public ObFuncExprOperator { - public: +public: explicit ObExprLocalTimestamp(common::ObIAllocator& alloc); virtual ~ObExprLocalTimestamp(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -42,13 +42,13 @@ class ObExprLocalTimestamp : public ObFuncExprOperator { static int eval_localtimestamp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLocalTimestamp); }; // note: this is oracle only function class ObExprToTimestamp : public ObExprToTemporalBase { - public: +public: explicit ObExprToTimestamp(common::ObIAllocator& alloc) : ObExprToTemporalBase(alloc, T_FUN_SYS_TO_TIMESTAMP, N_TO_TIMESTAMP) {} @@ -61,13 +61,13 @@ class ObExprToTimestamp : public ObExprToTemporalBase { return common::ObTimestampNanoType; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToTimestamp); }; // note: this is oracle only function class ObExprToTimestampTZ : public ObExprToTemporalBase { - public: +public: explicit ObExprToTimestampTZ(common::ObIAllocator& alloc) : ObExprToTemporalBase(alloc, T_FUN_SYS_TO_TIMESTAMP_TZ, N_TO_TIMESTAMP_TZ) {} @@ -80,7 +80,7 @@ class ObExprToTimestampTZ : public ObExprToTemporalBase { return common::ObTimestampTZType; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToTimestampTZ); }; diff --git a/src/sql/engine/expr/ob_expr_timestamp_add.h b/src/sql/engine/expr/ob_expr_timestamp_add.h index 536c631ea..655c25842 100644 --- a/src/sql/engine/expr/ob_expr_timestamp_add.h +++ b/src/sql/engine/expr/ob_expr_timestamp_add.h @@ -23,7 +23,7 @@ class ObTimeConvertCtx; } namespace sql { class ObExprTimeStampAdd : public ObFuncExprOperator { - public: +public: explicit ObExprTimeStampAdd(common::ObIAllocator& alloc); virtual ~ObExprTimeStampAdd(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& unit, ObExprResType& interval, @@ -35,7 +35,7 @@ class ObExprTimeStampAdd : public ObFuncExprOperator { static int calc(const int64_t unit_value, common::ObTime& ot, const int64_t ts, const common::ObTimeConvertCtx& cvrt_ctx, int64_t interval, int64_t& delta); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprTimeStampAdd); }; diff --git a/src/sql/engine/expr/ob_expr_timestamp_diff.h b/src/sql/engine/expr/ob_expr_timestamp_diff.h index 436443028..b628fabb6 100644 --- a/src/sql/engine/expr/ob_expr_timestamp_diff.h +++ b/src/sql/engine/expr/ob_expr_timestamp_diff.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprTimeStampDiff : public ObFuncExprOperator { - public: +public: explicit ObExprTimeStampDiff(common::ObIAllocator& alloc); virtual ~ObExprTimeStampDiff(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& unit, ObExprResType& left, ObExprResType& right, @@ -33,7 +33,7 @@ class ObExprTimeStampDiff : public ObFuncExprOperator { static int eval_timestamp_diff(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); virtual int cg_expr(ObExprCGCtx& ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: static int calc(int64_t& res, bool& is_null, int64_t unit_value, int64_t usec_left, int64_t usec_right, const common::ObTimeZoneInfo* tz_info); static int calc_month_diff( diff --git a/src/sql/engine/expr/ob_expr_timestamp_nvl.h b/src/sql/engine/expr/ob_expr_timestamp_nvl.h index c9551aa88..f6ae14c59 100644 --- a/src/sql/engine/expr/ob_expr_timestamp_nvl.h +++ b/src/sql/engine/expr/ob_expr_timestamp_nvl.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprTimestampNvl : public ObStringExprOperator { - public: +public: explicit ObExprTimestampNvl(common::ObIAllocator& alloc); virtual ~ObExprTimestampNvl(); virtual int calc_result_type2( @@ -28,7 +28,7 @@ class ObExprTimestampNvl : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_timestampnvl(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprTimestampNvl); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_timezone.h b/src/sql/engine/expr/ob_expr_timezone.h index 7e9867eb2..3eb749f11 100644 --- a/src/sql/engine/expr/ob_expr_timezone.h +++ b/src/sql/engine/expr/ob_expr_timezone.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprBaseTimezone : public ObFuncExprOperator { - public: +public: explicit ObExprBaseTimezone( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, const bool is_sessiontimezone); virtual ~ObExprBaseTimezone() @@ -26,15 +26,15 @@ class ObExprBaseTimezone : public ObFuncExprOperator { virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result0(common::ObObj& result, common::ObExprCtx& expr_ctx) const = 0; - private: +private: bool is_sessiontimezone_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprBaseTimezone); }; class ObExprSessiontimezone : public ObExprBaseTimezone { - public: +public: explicit ObExprSessiontimezone(common::ObIAllocator& alloc); virtual ~ObExprSessiontimezone() {} @@ -42,12 +42,12 @@ class ObExprSessiontimezone : public ObExprBaseTimezone { static int eval_session_timezone(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSessiontimezone); }; class ObExprDbtimezone : public ObExprBaseTimezone { - public: +public: explicit ObExprDbtimezone(common::ObIAllocator& alloc); virtual ~ObExprDbtimezone() {} @@ -55,7 +55,7 @@ class ObExprDbtimezone : public ObExprBaseTimezone { static int eval_db_timezone(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprDbtimezone); }; diff --git a/src/sql/engine/expr/ob_expr_to_blob.h b/src/sql/engine/expr/ob_expr_to_blob.h index 01f174e7f..44237f89f 100644 --- a/src/sql/engine/expr/ob_expr_to_blob.h +++ b/src/sql/engine/expr/ob_expr_to_blob.h @@ -20,7 +20,7 @@ namespace sql { // https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions186.htm#SQLRF30029 class ObExprToBlob : public ObStringExprOperator { - public: +public: explicit ObExprToBlob(common::ObIAllocator& alloc); virtual ~ObExprToBlob(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -28,7 +28,7 @@ class ObExprToBlob : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int eval_to_blob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToBlob); }; diff --git a/src/sql/engine/expr/ob_expr_to_clob.h b/src/sql/engine/expr/ob_expr_to_clob.h index bbd1eb9ed..37c7c7064 100644 --- a/src/sql/engine/expr/ob_expr_to_clob.h +++ b/src/sql/engine/expr/ob_expr_to_clob.h @@ -19,7 +19,7 @@ namespace sql { // https://docs.oracle.com/cd/E11882_01/server.112/e41084/functions202.htm#SQLRF06131 class ObExprToClob : public ObExprToCharCommon { - public: +public: explicit ObExprToClob(common::ObIAllocator& alloc); virtual ~ObExprToClob(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -28,7 +28,7 @@ class ObExprToClob : public ObExprToCharCommon { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_to_clob_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToClob); }; diff --git a/src/sql/engine/expr/ob_expr_to_days.h b/src/sql/engine/expr/ob_expr_to_days.h index fdfe5bbce..055edef5c 100644 --- a/src/sql/engine/expr/ob_expr_to_days.h +++ b/src/sql/engine/expr/ob_expr_to_days.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprToDays : public ObFuncExprOperator { - public: +public: ObExprToDays(); explicit ObExprToDays(common::ObIAllocator& alloc); virtual ~ObExprToDays(); @@ -25,7 +25,7 @@ class ObExprToDays : public ObFuncExprOperator { virtual int calc_result1(common::ObObj& result, const common::ObObj& date, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToDays); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_to_interval.h b/src/sql/engine/expr/ob_expr_to_interval.h index 622f1d942..ed415b9ff 100644 --- a/src/sql/engine/expr/ob_expr_to_interval.h +++ b/src/sql/engine/expr/ob_expr_to_interval.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprToYMInterval : public ObFuncExprOperator { - public: +public: explicit ObExprToYMInterval(common::ObIAllocator& alloc); virtual ~ObExprToYMInterval(); int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -26,12 +26,12 @@ class ObExprToYMInterval : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_to_yminterval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToYMInterval); }; class ObExprToDSInterval : public ObFuncExprOperator { - public: +public: explicit ObExprToDSInterval(common::ObIAllocator& alloc); virtual ~ObExprToDSInterval(); int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; @@ -39,12 +39,12 @@ class ObExprToDSInterval : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_to_dsinterval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToDSInterval); }; class ObExprNumToYMInterval : public ObFuncExprOperator { - public: +public: explicit ObExprNumToYMInterval(common::ObIAllocator& alloc); virtual ~ObExprNumToYMInterval(); int calc_result_type2( @@ -57,12 +57,12 @@ class ObExprNumToYMInterval : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_num_to_yminterval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNumToYMInterval); }; class ObExprNumToDSInterval : public ObFuncExprOperator { - public: +public: explicit ObExprNumToDSInterval(common::ObIAllocator& alloc); virtual ~ObExprNumToDSInterval(); int calc_result_type2( @@ -74,7 +74,7 @@ class ObExprNumToDSInterval : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_num_to_dsinterval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprNumToDSInterval); }; diff --git a/src/sql/engine/expr/ob_expr_to_multi_byte.h b/src/sql/engine/expr/ob_expr_to_multi_byte.h index 0d7a53521..05f8b515d 100644 --- a/src/sql/engine/expr/ob_expr_to_multi_byte.h +++ b/src/sql/engine/expr/ob_expr_to_multi_byte.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { class ObExprToMultiByte : public ObFuncExprOperator { - public: +public: explicit ObExprToMultiByte(common::ObIAllocator& alloc); virtual ~ObExprToMultiByte(); int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToMultiByte); }; diff --git a/src/sql/engine/expr/ob_expr_to_number.h b/src/sql/engine/expr/ob_expr_to_number.h index 0e8688b5a..2b6122fe4 100644 --- a/src/sql/engine/expr/ob_expr_to_number.h +++ b/src/sql/engine/expr/ob_expr_to_number.h @@ -21,19 +21,19 @@ namespace oceanbase { namespace sql { class ObExprToNumberBase : public ObFuncExprOperator { - public: +public: explicit ObExprToNumberBase(common::ObIAllocator& alloc, const ObExprOperatorType type, const char* name); virtual ~ObExprToNumberBase(); virtual int calc_result_typeN( ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToNumberBase); }; class ObExprToNumber : public ObExprToNumberBase { - public: +public: explicit ObExprToNumber(common::ObIAllocator& alloc); virtual ~ObExprToNumber(); @@ -44,12 +44,12 @@ class ObExprToNumber : public ObExprToNumberBase { // for engine 3.0 static int calc_tonumber_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToNumber); }; class ObExprToBinaryFloat : public ObExprToNumberBase { - public: +public: explicit ObExprToBinaryFloat(common::ObIAllocator& alloc); virtual ~ObExprToBinaryFloat(); @@ -61,12 +61,12 @@ class ObExprToBinaryFloat : public ObExprToNumberBase { static int calc_(const ObString& in_str, const ObString& in_fmt_str, ObIAllocator& alloc, number::ObNumber& res_nmb); static int calc_to_binaryfloat_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToBinaryFloat); }; class ObExprToBinaryDouble : public ObExprToNumberBase { - public: +public: explicit ObExprToBinaryDouble(common::ObIAllocator& alloc); virtual ~ObExprToBinaryDouble(); @@ -77,7 +77,7 @@ class ObExprToBinaryDouble : public ObExprToNumberBase { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_to_binarydouble_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToBinaryDouble); }; diff --git a/src/sql/engine/expr/ob_expr_to_outfile_row.h b/src/sql/engine/expr/ob_expr_to_outfile_row.h index f43cedfcc..a935e6ecf 100644 --- a/src/sql/engine/expr/ob_expr_to_outfile_row.h +++ b/src/sql/engine/expr/ob_expr_to_outfile_row.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprToOutfileRow : public ObStringExprOperator { - public: +public: explicit ObExprToOutfileRow(common::ObIAllocator& alloc); virtual ~ObExprToOutfileRow(); virtual int calc_result_typeN( @@ -31,7 +31,7 @@ class ObExprToOutfileRow : public ObStringExprOperator { static int copy_string_to_buf(char* buf, const int64_t buf_len, int64_t& pos, const common::ObString& str); static int copy_char_to_buf(char* buf, const int64_t buf_len, int64_t& pos, const char c); - private: +private: enum ParameterEnum { PARAM_FIELD = 0, PARAM_LINE, PARAM_ENCLOSED, PARAM_OPTIONAL, PARAM_SELECT_ITEM }; // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprToOutfileRow) const; diff --git a/src/sql/engine/expr/ob_expr_to_single_byte.h b/src/sql/engine/expr/ob_expr_to_single_byte.h index c647b7d43..9f54d3618 100644 --- a/src/sql/engine/expr/ob_expr_to_single_byte.h +++ b/src/sql/engine/expr/ob_expr_to_single_byte.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { class ObExprToSingleByte : public ObFuncExprOperator { - public: +public: explicit ObExprToSingleByte(common::ObIAllocator& alloc); virtual ~ObExprToSingleByte(); int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToSingleByte); }; diff --git a/src/sql/engine/expr/ob_expr_to_temporal_base.h b/src/sql/engine/expr/ob_expr_to_temporal_base.h index 03ccf925d..ad58f6ad7 100644 --- a/src/sql/engine/expr/ob_expr_to_temporal_base.h +++ b/src/sql/engine/expr/ob_expr_to_temporal_base.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExprToTemporalBase : public ObFuncExprOperator { - public: +public: explicit ObExprToTemporalBase(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name); virtual ~ObExprToTemporalBase() {} @@ -34,7 +34,7 @@ class ObExprToTemporalBase : public ObFuncExprOperator { // engine3.0 virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprToTemporalBase); }; diff --git a/src/sql/engine/expr/ob_expr_to_type.h b/src/sql/engine/expr/ob_expr_to_type.h index 106bfcb35..673a4666b 100644 --- a/src/sql/engine/expr/ob_expr_to_type.h +++ b/src/sql/engine/expr/ob_expr_to_type.h @@ -22,7 +22,7 @@ namespace sql { class ObExprToType : public ObFuncExprOperator { OB_UNIS_VERSION_V(1); - public: +public: ObExprToType(); explicit ObExprToType(common::ObIAllocator& alloc); virtual ~ObExprToType(){}; @@ -33,7 +33,7 @@ class ObExprToType : public ObFuncExprOperator { virtual int assign(const ObExprOperator& other); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; - public: +public: OB_INLINE void set_expect_type(common::ObObjType expect_type) { expect_type_ = expect_type; @@ -43,11 +43,11 @@ class ObExprToType : public ObFuncExprOperator { cast_mode_ = cast_mode; } - private: +private: int calc_result_type_for_literal(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; int calc_result_type_for_column(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; - private: +private: // data members common::ObObjType expect_type_; common::ObCastMode cast_mode_; diff --git a/src/sql/engine/expr/ob_expr_translate.h b/src/sql/engine/expr/ob_expr_translate.h index 140455105..ea01f265e 100644 --- a/src/sql/engine/expr/ob_expr_translate.h +++ b/src/sql/engine/expr/ob_expr_translate.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace sql { class ObExprTranslate : public ObStringExprOperator { - public: +public: explicit ObExprTranslate(common::ObIAllocator& alloc); virtual ~ObExprTranslate(); @@ -38,7 +38,7 @@ class ObExprTranslate : public ObStringExprOperator { const common::ObString& to_str, common::ObCollationType cs_type, common::ObIAllocator& tmp_alloc, common::ObIAllocator& res_alloc, common::ObString& res_str, bool& is_null); - private: +private: typedef common::hash::ObHashMap StringHashMap; static int insert_map(const common::ObString& key_str, const common::ObString& val_str, diff --git a/src/sql/engine/expr/ob_expr_trim.h b/src/sql/engine/expr/ob_expr_trim.h index c7fdb6d8b..ac2e666dd 100644 --- a/src/sql/engine/expr/ob_expr_trim.h +++ b/src/sql/engine/expr/ob_expr_trim.h @@ -22,7 +22,7 @@ class ObExprCtx; } // namespace common namespace sql { class ObExprTrim : public ObStringExprOperator { - public: +public: enum TrimType { TYPE_LRTRIM = 0, TYPE_LTRIM = 1, TYPE_RTRIM = 2 }; explicit ObExprTrim(common::ObIAllocator& alloc); @@ -59,7 +59,7 @@ class ObExprTrim : public ObStringExprOperator { // fill ' ' to %buf with specified charset. static int fill_default_pattern(char* buf, const int64_t in_len, common::ObCollationType cs_type, int64_t& out_len); - private: +private: // helper func static int lrtrim(const common::ObString src, const common::ObString pattern, int32_t& start, int32_t& end); static int ltrim(const common::ObString src, const common::ObString pattern, int32_t& start); @@ -79,7 +79,7 @@ class ObExprTrim : public ObStringExprOperator { // Ltrim can use ObExprTrim's calc class ObExprLtrim : public ObExprTrim { - public: +public: explicit ObExprLtrim(common::ObIAllocator& alloc); explicit ObExprLtrim(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num); virtual ~ObExprLtrim(); @@ -108,12 +108,12 @@ class ObExprLtrim : public ObExprTrim { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprLtrim); }; // Rtrim can use ObExprTrim's calc class ObExprRtrim : public ObExprLtrim { - public: +public: explicit ObExprRtrim(common::ObIAllocator& alloc); virtual ~ObExprRtrim(); @@ -138,7 +138,7 @@ class ObExprRtrim : public ObExprLtrim { return ObExprLtrim::cg_expr(op_cg_ctx, raw_expr, rt_expr); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprRtrim); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_truncate.h b/src/sql/engine/expr/ob_expr_truncate.h index 0e33ecce6..9e0ec117b 100644 --- a/src/sql/engine/expr/ob_expr_truncate.h +++ b/src/sql/engine/expr/ob_expr_truncate.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprTruncate : public ObFuncExprOperator { - public: +public: explicit ObExprTruncate(common::ObIAllocator& alloc); virtual ~ObExprTruncate(){}; @@ -31,7 +31,7 @@ class ObExprTruncate : public ObFuncExprOperator { static int set_trunc_val( common::ObObj& result, common::number::ObNumber& nmb, common::ObExprCtx& expr_ctx, common::ObObjType res_type); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprTruncate); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_type_to_str.h b/src/sql/engine/expr/ob_expr_type_to_str.h index 5c2cfe9e2..68faf7963 100644 --- a/src/sql/engine/expr/ob_expr_type_to_str.h +++ b/src/sql/engine/expr/ob_expr_type_to_str.h @@ -25,7 +25,7 @@ class ObExprResType; class ObExprTypeToStr : public ObFuncExprOperator { OB_UNIS_VERSION_V(1); - public: +public: ObExprTypeToStr( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension) : ObFuncExprOperator(alloc, type, name, param_num, dimension), alloc_(alloc), str_values_(alloc) @@ -52,17 +52,17 @@ class ObExprTypeToStr : public ObFuncExprOperator { virtual int deep_copy_str_values(const common::ObIArray& str_values); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const = 0; - protected: +protected: int deep_copy_str(const common::ObString& src_str, char* dest_buf, int64_t buf_len, int64_t& pos) const; - public: +public: static const int64_t EFFECTIVE_COUNT = 64; - protected: +protected: common::ObIAllocator& alloc_; common::ObFixedArray str_values_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprTypeToStr) const; }; @@ -76,7 +76,7 @@ inline void ObExprTypeToStr::reset() struct ObEnumSetInfo : public ObIExprExtraInfo { OB_UNIS_VERSION(1); - public: +public: ObEnumSetInfo(common::ObIAllocator& alloc, ObExprOperatorType type) : ObIExprExtraInfo(alloc, type), cast_mode_(0), str_values_(alloc) {} @@ -102,7 +102,7 @@ struct ObEnumSetInfo : public ObIExprExtraInfo { }; class ObExprSetToStr : public ObExprTypeToStr { - public: +public: explicit ObExprSetToStr(common::ObIAllocator& alloc); virtual ~ObExprSetToStr(); virtual int calc( @@ -110,13 +110,13 @@ class ObExprSetToStr : public ObExprTypeToStr { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_to_str_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprSetToStr) const; }; class ObExprEnumToStr : public ObExprTypeToStr { - public: +public: explicit ObExprEnumToStr(common::ObIAllocator& alloc); virtual ~ObExprEnumToStr(); virtual int calc( @@ -124,13 +124,13 @@ class ObExprEnumToStr : public ObExprTypeToStr { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_to_str_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprEnumToStr) const; }; class ObExprSetToInnerType : public ObExprTypeToStr { - public: +public: explicit ObExprSetToInnerType(common::ObIAllocator& alloc); virtual ~ObExprSetToInnerType(); virtual int calc_result_type2( @@ -140,13 +140,13 @@ class ObExprSetToInnerType : public ObExprTypeToStr { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_to_inner_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprSetToInnerType) const; }; class ObExprEnumToInnerType : public ObExprTypeToStr { - public: +public: explicit ObExprEnumToInnerType(common::ObIAllocator& alloc); virtual ~ObExprEnumToInnerType(); virtual int calc_result_type2( @@ -156,7 +156,7 @@ class ObExprEnumToInnerType : public ObExprTypeToStr { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_to_inner_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprEnumToInnerType) const; }; diff --git a/src/sql/engine/expr/ob_expr_tz_offset.h b/src/sql/engine/expr/ob_expr_tz_offset.h index f17c45d54..07a92519c 100644 --- a/src/sql/engine/expr/ob_expr_tz_offset.h +++ b/src/sql/engine/expr/ob_expr_tz_offset.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprTzOffset : public ObFuncExprOperator { - public: +public: explicit ObExprTzOffset(common::ObIAllocator& alloc); virtual ~ObExprTzOffset() {} @@ -30,7 +30,7 @@ class ObExprTzOffset : public ObFuncExprOperator { static int eval_tz_offset(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprTzOffset); }; diff --git a/src/sql/engine/expr/ob_expr_uid.h b/src/sql/engine/expr/ob_expr_uid.h index 5206839f8..ebbc441f2 100644 --- a/src/sql/engine/expr/ob_expr_uid.h +++ b/src/sql/engine/expr/ob_expr_uid.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprUid : public ObFuncExprOperator { - public: +public: explicit ObExprUid(common::ObIAllocator& alloc); virtual ~ObExprUid(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprUid : public ObFuncExprOperator { static int eval_uid(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUid); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_unhex.h b/src/sql/engine/expr/ob_expr_unhex.h index 352a59f9c..4eba6cff1 100644 --- a/src/sql/engine/expr/ob_expr_unhex.h +++ b/src/sql/engine/expr/ob_expr_unhex.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprUnhex : public ObStringExprOperator { - public: +public: explicit ObExprUnhex(common::ObIAllocator& alloc); virtual ~ObExprUnhex(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; @@ -27,7 +27,7 @@ class ObExprUnhex : public ObStringExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_unhex(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUnhex); }; diff --git a/src/sql/engine/expr/ob_expr_unix_timestamp.h b/src/sql/engine/expr/ob_expr_unix_timestamp.h index b44ebdbd2..7940d85e8 100644 --- a/src/sql/engine/expr/ob_expr_unix_timestamp.h +++ b/src/sql/engine/expr/ob_expr_unix_timestamp.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprUnixTimestamp : public ObFuncExprOperator { - public: +public: explicit ObExprUnixTimestamp(common::ObIAllocator& alloc); virtual ~ObExprUnixTimestamp(); virtual int calc_result_typeN( @@ -30,7 +30,7 @@ class ObExprUnixTimestamp : public ObFuncExprOperator { static int eval_unix_timestamp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: int calc_result_type_literal(ObExprResType& type, ObExprResType& type1) const; int calc_result_type_column(ObExprResType& type, ObExprResType& type1) const; // disallow copy diff --git a/src/sql/engine/expr/ob_expr_usec_to_time.h b/src/sql/engine/expr/ob_expr_usec_to_time.h index 22e66a181..424ddbf82 100644 --- a/src/sql/engine/expr/ob_expr_usec_to_time.h +++ b/src/sql/engine/expr/ob_expr_usec_to_time.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObExprUsecToTime : public ObFuncExprOperator { - public: +public: explicit ObExprUsecToTime(common::ObIAllocator& alloc); virtual ~ObExprUsecToTime(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& usec, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& usec, common::ObExprCtx& expr_ctx) const; virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprUsecToTime); }; diff --git a/src/sql/engine/expr/ob_expr_user.h b/src/sql/engine/expr/ob_expr_user.h index f6608ba3d..d1706efee 100644 --- a/src/sql/engine/expr/ob_expr_user.h +++ b/src/sql/engine/expr/ob_expr_user.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprUser : public ObFuncExprOperator { - public: +public: explicit ObExprUser(common::ObIAllocator& alloc); virtual ~ObExprUser(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -26,7 +26,7 @@ class ObExprUser : public ObFuncExprOperator { static int eval_user(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUser); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_user_can_access_obj.h b/src/sql/engine/expr/ob_expr_user_can_access_obj.h index 099052f16..5b3e7c14f 100644 --- a/src/sql/engine/expr/ob_expr_user_can_access_obj.h +++ b/src/sql/engine/expr/ob_expr_user_can_access_obj.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObExprUserCanAccessObj : public ObFuncExprOperator { - public: +public: explicit ObExprUserCanAccessObj(common::ObIAllocator& alloc); virtual ~ObExprUserCanAccessObj(); virtual int calc_result_type3(ObExprResType& type, ObExprResType& arg1, ObExprResType& arg2, ObExprResType& arg3, @@ -35,14 +35,14 @@ class ObExprUserCanAccessObj : public ObFuncExprOperator { static int eval_user_can_access_obj(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum); static int build_raw_obj_priv(uint64_t obj_type, share::ObRawObjPrivArray& raw_obj_priv_array); - private: +private: static int build_real_obj_type_for_sym( uint64_t tenant_id, share::schema::ObSchemaGetterGuard* schema_guard, uint64_t& obj_type, uint64_t& obj_id); static int check_user_access_obj(share::schema::ObSchemaGetterGuard* schema_guard, ObSQLSessionInfo* session, uint64_t obj_type, uint64_t obj_id, uint64_t owner_id, bool& can_access); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUserCanAccessObj); }; diff --git a/src/sql/engine/expr/ob_expr_userenv.h b/src/sql/engine/expr/ob_expr_userenv.h index 331722746..fa833f69f 100644 --- a/src/sql/engine/expr/ob_expr_userenv.h +++ b/src/sql/engine/expr/ob_expr_userenv.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprUserEnv : public ObFuncExprOperator { - public: +public: ObExprUserEnv(); explicit ObExprUserEnv(common::ObIAllocator& alloc); virtual ~ObExprUserEnv(); @@ -44,7 +44,7 @@ class ObExprUserEnv : public ObFuncExprOperator { static int eval_schemaid_result1(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); static int eval_sessionid_result1(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: int check_arg_valid(const common::ObObj& value, UserEnvParameter& para) const; static UserEnvParameter parameters_[]; static const int DEFAULT_LENGTH = 64; diff --git a/src/sql/engine/expr/ob_expr_util.h b/src/sql/engine/expr/ob_expr_util.h index 363921ca3..cef540785 100644 --- a/src/sql/engine/expr/ob_expr_util.h +++ b/src/sql/engine/expr/ob_expr_util.h @@ -28,11 +28,11 @@ namespace sql { // template class ObNumStackAllocator : public common::ObDataBuffer { - public: +public: ObNumStackAllocator() : ObDataBuffer(local_buf_, sizeof(local_buf_)) {} - private: +private: char local_buf_[NUM_CNT * common::number::ObNumber::MAX_BYTE_LEN]; }; typedef ObNumStackAllocator<1> ObNumStackOnceAlloc; @@ -40,7 +40,7 @@ typedef ObNumStackAllocator<1> ObNumStackOnceAlloc; #define array_elements(A) ((uint)(sizeof(A) / sizeof(A[0]))) class ObExprUtil { - public: +public: static int get_trunc_int64(const common::ObObj& obj, common::ObExprCtx& expr_ctx, int64_t& out); static int get_round_int64(const common::ObObj& obj, common::ObExprCtx& expr_ctx, int64_t& out); @@ -92,7 +92,7 @@ class ObExprUtil { static int eval_stack_overflow_check(const ObExpr& rt_expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int get_int64_from_num(common::number::ObNumber& nmb, common::ObExprCtx& expr_ctx, const bool is_trunc, // true: trunc; false: round int64_t& out); diff --git a/src/sql/engine/expr/ob_expr_utl_i18n.h b/src/sql/engine/expr/ob_expr_utl_i18n.h index 67064c66f..a0e79ffed 100644 --- a/src/sql/engine/expr/ob_expr_utl_i18n.h +++ b/src/sql/engine/expr/ob_expr_utl_i18n.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExprUtlI18nStringToRaw : public ObStringExprOperator { - public: +public: explicit ObExprUtlI18nStringToRaw(common::ObIAllocator& alloc); virtual ~ObExprUtlI18nStringToRaw(); virtual int calc_result_type2( @@ -30,12 +30,12 @@ class ObExprUtlI18nStringToRaw : public ObStringExprOperator { virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlI18nStringToRaw); }; class ObExprUtlI18nRawToChar : public ObStringExprOperator { - public: +public: explicit ObExprUtlI18nRawToChar(common::ObIAllocator& alloc); virtual ~ObExprUtlI18nRawToChar(); virtual int calc_result_type2( @@ -45,7 +45,7 @@ class ObExprUtlI18nRawToChar : public ObStringExprOperator { virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlI18nRawToChar); }; diff --git a/src/sql/engine/expr/ob_expr_utl_inaddr.h b/src/sql/engine/expr/ob_expr_utl_inaddr.h index 2683f0855..11ba0f3db 100644 --- a/src/sql/engine/expr/ob_expr_utl_inaddr.h +++ b/src/sql/engine/expr/ob_expr_utl_inaddr.h @@ -19,24 +19,24 @@ namespace oceanbase { namespace sql { class ObExprUtlInaddrGetHostAddr : public ObExprOperator { - public: +public: explicit ObExprUtlInaddrGetHostAddr(common::ObIAllocator& alloc); virtual ~ObExprUtlInaddrGetHostAddr(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj1, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlInaddrGetHostAddr); }; class ObExprUtlInaddrGetHostName : public ObExprOperator { - public: +public: explicit ObExprUtlInaddrGetHostName(common::ObIAllocator& alloc); virtual ~ObExprUtlInaddrGetHostName(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj1, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlInaddrGetHostName); }; diff --git a/src/sql/engine/expr/ob_expr_utl_raw.h b/src/sql/engine/expr/ob_expr_utl_raw.h index 534edd395..d82a1d806 100644 --- a/src/sql/engine/expr/ob_expr_utl_raw.h +++ b/src/sql/engine/expr/ob_expr_utl_raw.h @@ -18,42 +18,42 @@ namespace oceanbase { namespace sql { class ObExprUtlRawCastToRaw : public ObStringExprOperator { - public: +public: explicit ObExprUtlRawCastToRaw(common::ObIAllocator& alloc); virtual ~ObExprUtlRawCastToRaw(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; static int calc(common::ObObj& result, const common::ObObj& text, common::ObCastCtx& cast_ctx); virtual int calc_result1(common::ObObj& result, const common::ObObj& text, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawCastToRaw); }; class ObExprUtlRawCastToVarchar2 : public ObStringExprOperator { - public: +public: explicit ObExprUtlRawCastToVarchar2(common::ObIAllocator& alloc); virtual ~ObExprUtlRawCastToVarchar2(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; static int calc(common::ObObj& result, const common::ObObj& text, common::ObCastCtx& cast_ctx); virtual int calc_result1(common::ObObj& result, const common::ObObj& text, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawCastToVarchar2); }; class ObExprUtlRawLength : public ObFuncExprOperator { - public: +public: explicit ObExprUtlRawLength(common::ObIAllocator& alloc); virtual ~ObExprUtlRawLength(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& text, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawLength); }; class ObRawBitwiseExprOperator : public ObExprOperator { - public: +public: ObRawBitwiseExprOperator(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num) : ObExprOperator(alloc, type, name, param_num) {} @@ -62,7 +62,7 @@ class ObRawBitwiseExprOperator : public ObExprOperator { virtual int calc_result_type2( ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const; - protected: +protected: enum BitOperator { BIT_AND, BIT_OR, @@ -74,12 +74,12 @@ class ObRawBitwiseExprOperator : public ObExprOperator { int calc_result2_(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObCastCtx& cast_ctx, BitOperator op) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRawBitwiseExprOperator); }; class ObExprUtlRawBitAnd : public ObRawBitwiseExprOperator { - public: +public: explicit ObExprUtlRawBitAnd(common::ObIAllocator& alloc); virtual ~ObExprUtlRawBitAnd(); virtual int calc_result_type2( @@ -87,12 +87,12 @@ class ObExprUtlRawBitAnd : public ObRawBitwiseExprOperator { virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawBitAnd); }; class ObExprUtlRawBitOr : public ObRawBitwiseExprOperator { - public: +public: explicit ObExprUtlRawBitOr(common::ObIAllocator& alloc); virtual ~ObExprUtlRawBitOr(); virtual int calc_result_type2( @@ -100,12 +100,12 @@ class ObExprUtlRawBitOr : public ObRawBitwiseExprOperator { virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawBitOr); }; class ObExprUtlRawBitXor : public ObRawBitwiseExprOperator { - public: +public: explicit ObExprUtlRawBitXor(common::ObIAllocator& alloc); virtual ~ObExprUtlRawBitXor(); virtual int calc_result_type2( @@ -113,35 +113,35 @@ class ObExprUtlRawBitXor : public ObRawBitwiseExprOperator { virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawBitXor); }; class ObExprUtlRawBitComplement : public ObStringExprOperator { - public: +public: explicit ObExprUtlRawBitComplement(common::ObIAllocator& alloc); virtual ~ObExprUtlRawBitComplement(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const; virtual int calc_result1(common::ObObj& result, const common::ObObj& obj1, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawBitComplement); }; class ObExprUtlRawReverse : public ObStringExprOperator { - public: +public: explicit ObExprUtlRawReverse(common::ObIAllocator& alloc); virtual ~ObExprUtlRawReverse(); virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const; static int calc(common::ObObj& result, const common::ObObj& text, common::ObCastCtx& cast_ctx); virtual int calc_result1(common::ObObj& result, const common::ObObj& text, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawReverse); }; class ObExprUtlRawCopies : public ObStringExprOperator { - public: +public: explicit ObExprUtlRawCopies(common::ObIAllocator& alloc); virtual ~ObExprUtlRawCopies(); virtual int calc_result_type2( @@ -151,12 +151,12 @@ class ObExprUtlRawCopies : public ObStringExprOperator { virtual int calc_result2( common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawCopies); }; class ObExprUtlRawCompare : public ObStringExprOperator { - public: +public: explicit ObExprUtlRawCompare(common::ObIAllocator& alloc); virtual ~ObExprUtlRawCompare(); virtual int calc_result_typeN( @@ -165,12 +165,12 @@ class ObExprUtlRawCompare : public ObStringExprOperator { virtual int calc_resultN( common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawCompare); }; class ObExprUtlRawSubstr : public ObStringExprOperator { - public: +public: explicit ObExprUtlRawSubstr(common::ObIAllocator& alloc); virtual ~ObExprUtlRawSubstr(); virtual int calc_result_typeN( @@ -179,12 +179,12 @@ class ObExprUtlRawSubstr : public ObStringExprOperator { virtual int calc_resultN( common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawSubstr); }; class ObExprUtlRawConcat : public ObStringExprOperator { - public: +public: explicit ObExprUtlRawConcat(common::ObIAllocator& alloc); virtual ~ObExprUtlRawConcat(); virtual int calc_result_typeN( @@ -193,7 +193,7 @@ class ObExprUtlRawConcat : public ObStringExprOperator { virtual int calc_resultN( common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, common::ObExprCtx& expr_ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprUtlRawConcat); }; diff --git a/src/sql/engine/expr/ob_expr_uuid.h b/src/sql/engine/expr/ob_expr_uuid.h index 57d53d6c7..fc80f0efc 100644 --- a/src/sql/engine/expr/ob_expr_uuid.h +++ b/src/sql/engine/expr/ob_expr_uuid.h @@ -19,11 +19,11 @@ namespace oceanbase { namespace sql { class ObBigEndian { - public: +public: static int put_uint16(unsigned char* b, uint16_t v); static int put_uint32(unsigned char* b, uint32_t v); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObBigEndian); }; @@ -36,10 +36,10 @@ struct ObUUIDNode { }; class ObUUIDTime { - public: +public: static int get_time(uint64_t& time, uint16_t& seq); - private: +private: static int time_now(uint64_t& now); static void reset_clock_seq(); static const uint64_t LILLIAN = 2299160; // Julian day of 15 Oct 1582 @@ -54,7 +54,7 @@ class ObUUIDTime { }; class ObExprUuid : public ObFuncExprOperator { - public: +public: explicit ObExprUuid(common::ObIAllocator& alloc); explicit ObExprUuid( common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension); @@ -65,11 +65,11 @@ class ObExprUuid : public ObFuncExprOperator { static int eval_uuid(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - protected: +protected: static int calc(unsigned char* scratch); // aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee static const common::ObLength LENGTH_UUID = 36; // chars not bytes - private: +private: static ObUUIDNode* uuid_node; // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprUuid); @@ -86,7 +86,7 @@ inline int ObExprUuid::calc_result_type0(ObExprResType& type, common::ObExprType } class ObExprSysGuid : public ObExprUuid { - public: +public: explicit ObExprSysGuid(common::ObIAllocator& alloc); virtual ~ObExprSysGuid(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -99,10 +99,10 @@ class ObExprSysGuid : public ObExprUuid { return common::OB_SUCCESS; } - private: +private: static const common::ObLength LENGTH_SYS_GUID = 16; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprSysGuid); }; diff --git a/src/sql/engine/expr/ob_expr_version.h b/src/sql/engine/expr/ob_expr_version.h index d969e419a..711990863 100644 --- a/src/sql/engine/expr/ob_expr_version.h +++ b/src/sql/engine/expr/ob_expr_version.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprVersion : public ObStringExprOperator { - public: +public: explicit ObExprVersion(common::ObIAllocator& alloc); virtual ~ObExprVersion(); virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const; @@ -27,7 +27,7 @@ class ObExprVersion : public ObStringExprOperator { static int eval_version(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprVersion); }; } // namespace sql diff --git a/src/sql/engine/expr/ob_expr_vsize.h b/src/sql/engine/expr/ob_expr_vsize.h index c2300b1ca..fcf93167d 100644 --- a/src/sql/engine/expr/ob_expr_vsize.h +++ b/src/sql/engine/expr/ob_expr_vsize.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprVsize : public ObFuncExprOperator { - public: +public: explicit ObExprVsize(common::ObIAllocator& alloc); virtual ~ObExprVsize(); virtual int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const; @@ -27,7 +27,7 @@ class ObExprVsize : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const; static int calc_vsize_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprVsize); bool is_blob_type(const common::ObObj& input) const; diff --git a/src/sql/engine/expr/ob_expr_week_of_func.h b/src/sql/engine/expr/ob_expr_week_of_func.h index 84a0b23ab..e983ec012 100644 --- a/src/sql/engine/expr/ob_expr_week_of_func.h +++ b/src/sql/engine/expr/ob_expr_week_of_func.h @@ -23,7 +23,7 @@ namespace sql { // WEEKOFYEAR() is a compatibility function // --that is equivalent to WEEK(date,3). class ObExprWeekOfYear : public ObFuncExprOperator { - public: +public: ObExprWeekOfYear(); explicit ObExprWeekOfYear(common::ObIAllocator& alloc); virtual ~ObExprWeekOfYear(); @@ -34,7 +34,7 @@ class ObExprWeekOfYear : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_weekofyear(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprWeekOfYear); }; @@ -56,7 +56,7 @@ inline int ObExprWeekOfYear::calc_result_type1( // Returns the weekday index for date // --(0 = Monday, 1 = Tuesday, ... 6 = Sunday). class ObExprWeekDay : public ObFuncExprOperator { - public: +public: ObExprWeekDay(); explicit ObExprWeekDay(common::ObIAllocator& alloc); virtual ~ObExprWeekDay(); @@ -67,7 +67,7 @@ class ObExprWeekDay : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_weekday(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprWeekDay); }; inline int ObExprWeekDay::calc_result_type1( @@ -89,7 +89,7 @@ inline int ObExprWeekDay::calc_result_type1( // example: select yearweek('2018-07-04',6) from dual; //-----------> 201827 class ObExprYearWeek : public ObFuncExprOperator { - public: +public: ObExprYearWeek(); explicit ObExprYearWeek(common::ObIAllocator& alloc); virtual ~ObExprYearWeek(); @@ -100,7 +100,7 @@ class ObExprYearWeek : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_yearweek(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprYearWeek); }; @@ -109,7 +109,7 @@ class ObExprYearWeek : public ObFuncExprOperator { // from 1 to 53 e.g., SELECT WEEK('2008-02-20',1); --> 8 // SELECT WEEK('2008-02-20'); SELECT WEEK('2008-02-20', 0); --> 7 class ObExprWeek : public ObFuncExprOperator { - public: +public: ObExprWeek(); explicit ObExprWeek(common::ObIAllocator& alloc); virtual ~ObExprWeek(); @@ -120,7 +120,7 @@ class ObExprWeek : public ObFuncExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int calc_week(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprWeek); }; diff --git a/src/sql/engine/expr/ob_expr_width_bucket.h b/src/sql/engine/expr/ob_expr_width_bucket.h index 686575593..e39df3dee 100644 --- a/src/sql/engine/expr/ob_expr_width_bucket.h +++ b/src/sql/engine/expr/ob_expr_width_bucket.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace sql { class ObExprWidthBucket : public ObFuncExprOperator { - public: +public: explicit ObExprWidthBucket(common::ObIAllocator& alloc); virtual ~ObExprWidthBucket() {} diff --git a/src/sql/engine/expr/ob_expr_word_segment.h b/src/sql/engine/expr/ob_expr_word_segment.h index 62c455d05..8101f54cf 100644 --- a/src/sql/engine/expr/ob_expr_word_segment.h +++ b/src/sql/engine/expr/ob_expr_word_segment.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExprWordSegment : public ObFuncExprOperator { - public: +public: explicit ObExprWordSegment(common::ObIAllocator& alloc); virtual ~ObExprWordSegment() {} @@ -34,7 +34,7 @@ class ObExprWordSegment : public ObFuncExprOperator { tokenizer_ = tokenizer; } - private: +private: common::ObString tokenizer_; // disallow copy DISALLOW_COPY_AND_ASSIGN(ObExprWordSegment); diff --git a/src/sql/engine/expr/ob_expr_xor.h b/src/sql/engine/expr/ob_expr_xor.h index 9bbffcbaf..221c73b19 100644 --- a/src/sql/engine/expr/ob_expr_xor.h +++ b/src/sql/engine/expr/ob_expr_xor.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObExprXor : public ObLogicalExprOperator { - public: +public: ObExprXor(); explicit ObExprXor(common::ObIAllocator& alloc); virtual ~ObExprXor(){}; @@ -36,11 +36,11 @@ class ObExprXor : public ObLogicalExprOperator { virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override; static int eval_xor(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum); - private: +private: static int cacl_res_with_one_param_null( common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObExprCtx& expr_ctx); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExprXor); static const double FLOAT_BOUND; diff --git a/src/sql/engine/expr/ob_i_expr_extra_info.h b/src/sql/engine/expr/ob_i_expr_extra_info.h index 040c1d34e..c7f4ee9de 100644 --- a/src/sql/engine/expr/ob_i_expr_extra_info.h +++ b/src/sql/engine/expr/ob_i_expr_extra_info.h @@ -25,7 +25,7 @@ struct ObIExprExtraInfo { OB_ASSERT(ObExprExtraInfoFactory::is_registered(type)); } - public: +public: virtual int serialize(char* buf, const int64_t len, int64_t& pos) const = 0; virtual int deserialize(const char* buf, const int64_t len, int64_t& pos) = 0; diff --git a/src/sql/engine/expr/ob_infix_expression.h b/src/sql/engine/expr/ob_infix_expression.h index 1279fda16..03beb30aa 100644 --- a/src/sql/engine/expr/ob_infix_expression.h +++ b/src/sql/engine/expr/ob_infix_expression.h @@ -23,7 +23,7 @@ namespace sql { class ObInfixExprItem : public ObPostExprItem { OB_UNIS_VERSION(1); - public: +public: ObInfixExprItem() : ObPostExprItem(), param_idx_(0), param_num_(0), param_lazy_eval_(false) {} @@ -58,7 +58,7 @@ class ObInfixExprItem : public ObPostExprItem { INHERIT_TO_STRING_KV("parent", ObPostExprItem, K(param_idx_), K(param_num_), K(param_lazy_eval_)); - protected: +protected: // index of first parameter uint16_t param_idx_; // number of parameter @@ -77,7 +77,7 @@ class ObInfixExprItem : public ObPostExprItem { class ObInfixExpression { OB_UNIS_VERSION(1); - public: +public: const static int64_t TSI_STACK_IDENTIFIER = 3; // 1 and 2 used in ob_postfix_expression.cpp const static int64_t STACK_ALLOC_STACK_SIZE = 128; @@ -137,7 +137,7 @@ class ObInfixExpression { TO_STRING_KV(K_(exprs)); - private: +private: OB_INLINE static int64_t& global_stack_top() { static RLOCAL(int64_t, val); @@ -150,7 +150,7 @@ class ObInfixExpression { int eval(common::ObExprCtx& expr_ctx, const common::ObNewRow& row, common::ObObj* stack, const int64_t pos) const; - private: +private: common::ObIAllocator& alloc_; ExprItemArray exprs_; // output_column_count_ ? diff --git a/src/sql/engine/expr/ob_iter_expr_index_scan.h b/src/sql/engine/expr/ob_iter_expr_index_scan.h index 99a9803fb..659ce6bb0 100644 --- a/src/sql/engine/expr/ob_iter_expr_index_scan.h +++ b/src/sql/engine/expr/ob_iter_expr_index_scan.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObIndexScanIterExpr : public ObIterExprOperator { - public: +public: ObIndexScanIterExpr() : ObIterExprOperator(), iter_idx_(common::OB_INVALID_INDEX) {} inline void set_iter_idx(int64_t iter_idx) @@ -25,7 +25,7 @@ class ObIndexScanIterExpr : public ObIterExprOperator { } int get_next_row(ObIterExprCtx& expr_ctx, const common::ObNewRow*& result) const; - private: +private: int64_t iter_idx_; }; } // namespace sql diff --git a/src/sql/engine/expr/ob_iter_expr_range_param.h b/src/sql/engine/expr/ob_iter_expr_range_param.h index 4bcbd1c40..f3e6f9281 100644 --- a/src/sql/engine/expr/ob_iter_expr_range_param.h +++ b/src/sql/engine/expr/ob_iter_expr_range_param.h @@ -18,7 +18,7 @@ namespace sql { class ObIterExprRangeParam : public ObIterExprOperator { OB_UNIS_VERSION(1); - public: +public: ObIterExprRangeParam() : ObIterExprOperator(), start_index_(common::OB_INVALID_INDEX), end_index_(common::OB_INVALID_INDEX) {} @@ -33,7 +33,7 @@ class ObIterExprRangeParam : public ObIterExprOperator { virtual int get_next_row(ObIterExprCtx& expr_ctx, const common::ObNewRow*& result) const override; TO_STRING_KV(K_(expr_id), K_(expr_type), K_(start_index), K_(end_index)); - private: +private: int64_t start_index_; int64_t end_index_; }; diff --git a/src/sql/engine/expr/ob_iter_expr_set_operation.h b/src/sql/engine/expr/ob_iter_expr_set_operation.h index d31ec3326..4d1ceb1db 100644 --- a/src/sql/engine/expr/ob_iter_expr_set_operation.h +++ b/src/sql/engine/expr/ob_iter_expr_set_operation.h @@ -16,13 +16,13 @@ namespace oceanbase { namespace sql { class ObSetOpIterExpr : public ObIterExprOperator { - private: +private: class ObSetOpIterExprCtx : public ObExprOperatorCtx { - public: + public: ObSetOpIterExprCtx() : left_row_(NULL), right_row_(NULL), left_is_end_(false), right_is_end_(false) {} - private: + private: const common::ObNewRow* left_row_; const common::ObNewRow* right_row_; bool left_is_end_; @@ -30,7 +30,7 @@ class ObSetOpIterExpr : public ObIterExprOperator { friend class ObSetOpIterExpr; }; - public: +public: ObSetOpIterExpr() : ObIterExprOperator(), left_iter_(NULL), right_iter_(NULL) {} @@ -44,7 +44,7 @@ class ObSetOpIterExpr : public ObIterExprOperator { } int get_next_row(ObIterExprCtx& expr_ctx, const common::ObNewRow*& result) const; - protected: +protected: inline int get_left_row(ObIterExprCtx& expr_ctx, ObSetOpIterExprCtx& set_ctx) const; inline int get_right_row(ObIterExprCtx& expr_ctx, ObSetOpIterExprCtx& set_ctx) const; inline int compare_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row, int& result) const; @@ -55,7 +55,7 @@ class ObSetOpIterExpr : public ObIterExprOperator { inline int get_except_next_row( ObIterExprCtx& expr_ctx, ObSetOpIterExprCtx& set_ctx, const common::ObNewRow*& result) const; - protected: +protected: const ObIterExprOperator* left_iter_; const ObIterExprOperator* right_iter_; }; diff --git a/src/sql/engine/expr/ob_postfix_expression.h b/src/sql/engine/expr/ob_postfix_expression.h index d2d8987fa..092ab891f 100644 --- a/src/sql/engine/expr/ob_postfix_expression.h +++ b/src/sql/engine/expr/ob_postfix_expression.h @@ -35,7 +35,7 @@ class ObExprOperator; template class ObSqlFixedArray { - public: +public: ObSqlFixedArray() : data_(NULL), cap_(0), count_(0) {} int init(int64_t cap, common::ObIAllocator& allocator) @@ -165,14 +165,14 @@ class ObSqlFixedArray { return data_; } - private: +private: T* data_; int32_t cap_; int32_t count_; }; class ObPostExprItem { - public: +public: ObPostExprItem() : v2_(), accuracy_(), item_type_(::T_INVALID) {} // setters @@ -243,7 +243,7 @@ class ObPostExprItem { return 0; } - protected: +protected: // members in a union can only be simple data types, so an obj can only be // constructed through a buffer in union. union { @@ -255,7 +255,7 @@ class ObPostExprItem { common::ObAccuracy accuracy_; // for const, column, questionmark ObItemType item_type_; - private: +private: // we need push ObPostExprItem object into ObIArray, so must allow copy and assign. // DISALLOW_COPY_AND_ASSIGN(ObPostExprItem); }; @@ -346,7 +346,7 @@ struct ObPostfixExpressionCalcStack { }; class ObPostfixExpression { - public: +public: ObPostfixExpression(common::ObIAllocator& alloc, int64_t item_count); ~ObPostfixExpression(); int assign(const ObPostfixExpression& other); @@ -400,22 +400,22 @@ class ObPostfixExpression { int64_t to_string(char* buf, const int64_t buf_len) const; NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: // check if the expr is const or column index. int check_expr_type(const int64_t type_val, bool& is_type, const int64_t stack_len) const; - private: +private: static const int64_t DEF_STRING_BUF_SIZE = 64 * 1024L; static const int64_t BASIC_SYMBOL_COUNT = 64; typedef ObSqlFixedArray PostfixExprArray; void data_clear(); - private: +private: PostfixExprArray post_exprs_; common::ObIAllocator& str_buf_; int64_t output_column_count_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPostfixExpression); }; // class ObPostfixExpression diff --git a/src/sql/engine/expr/ob_sql_expression.h b/src/sql/engine/expr/ob_sql_expression.h index 6161e18e6..718ecc2b6 100644 --- a/src/sql/engine/expr/ob_sql_expression.h +++ b/src/sql/engine/expr/ob_sql_expression.h @@ -56,10 +56,10 @@ class ObPhysicalPlan; class ObSqlExpression : public common::ObISqlExpression, public common::ObDLinkBase { OB_UNIS_VERSION_V(1); - public: +public: enum ExpressionType { EXPR_TYPE_SQL = 0, EXPR_TYPE_COLUMN, EXPR_TYPE_AGGREGATE, EXPR_TYPE_MAX }; - public: +public: ObSqlExpression(common::ObIAllocator& alloc, int64_t item_count = 0); virtual ~ObSqlExpression(); @@ -141,10 +141,10 @@ class ObSqlExpression : public common::ObISqlExpression, public common::ObDLinkB fast_expr_ = fast_expr; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlExpression); - protected: +protected: friend class ::ObAggregateFunctionTest; common::ObIAllocator& inner_alloc_; // data members @@ -177,7 +177,7 @@ inline bool ObSqlExpression::is_empty() const class ObColumnExpression : public ObSqlExpression, public common::ObIColumnExpression { OB_UNIS_VERSION_V(1); - public: +public: ObColumnExpression(common::ObIAllocator& alloc, int64_t item_count = 0); virtual ~ObColumnExpression(); @@ -215,10 +215,10 @@ class ObColumnExpression : public ObSqlExpression, public common::ObIColumnExpre } int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObColumnExpression); - protected: +protected: int64_t result_index_; // result's index in output row common::ObCollationType cs_type_; common::ObAccuracy accuracy_; @@ -233,7 +233,7 @@ inline void ObColumnExpression::reset() class ObAggregateExpression : public ObColumnExpression { OB_UNIS_VERSION_V(1); - public: +public: ObAggregateExpression(common::ObIAllocator& alloc, int64_t item_count = 0); virtual ~ObAggregateExpression(); @@ -324,20 +324,20 @@ class ObAggregateExpression : public ObColumnExpression { separator_param_expr_.start_gen_infix_exr(); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAggregateExpression); - protected: +protected: ObItemType aggr_func_; bool is_distinct_; common::ObFixedArray sort_columns_; ObSqlExpression separator_param_expr_; int64_t real_param_col_count_; - public: +public: common::ObFixedArray aggr_cs_types_; - protected: +protected: int64_t output_column_count_; common::ObFixedArray extra_infos_; }; @@ -373,7 +373,7 @@ inline int ObAggregateExpression::get_aggr_column( // ObExprOperatorFetcher is used fetch the ObExprOperator of ObExprGeneratorImpl. // only override the add_expr_item. struct ObExprOperatorFetcher : public ObSqlExpression { - public: +public: ObExprOperatorFetcher() // the allocator is never used : ObSqlExpression(*lib::ObMallocAllocator::get_instance(), 0) @@ -395,13 +395,16 @@ struct ObExprOperatorFetcher : public ObSqlExpression { return ret; } - void reset() override { op_ = NULL; } + void reset() override + { + op_ = NULL; + } const ObExprOperator* op_; }; class ObSqlExpressionUtil { - public: +public: static int make_sql_expr(ObPhysicalPlan* physical_plan, ObSqlExpression*& expr); static int make_sql_expr(ObPhysicalPlan* physical_plan, ObColumnExpression*& expr); static int make_sql_expr(ObPhysicalPlan* physical_plan, ObAggregateExpression*& expr); @@ -414,7 +417,7 @@ class ObSqlExpressionUtil { common::ObExprCtx& expr_ctx, const common::ObObj& src_param, const common::ObObj*& result); static bool should_gen_postfix_expr(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlExpressionUtil); ObSqlExpressionUtil(); ~ObSqlExpressionUtil(); diff --git a/src/sql/engine/expr/ob_sql_expression_factory.h b/src/sql/engine/expr/ob_sql_expression_factory.h index a9c20bfd6..bde9488d5 100644 --- a/src/sql/engine/expr/ob_sql_expression_factory.h +++ b/src/sql/engine/expr/ob_sql_expression_factory.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObSqlExpressionFactory { - public: +public: explicit ObSqlExpressionFactory(common::ObIAllocator& alloc) : alloc_(alloc) {} ~ObSqlExpressionFactory() @@ -65,10 +65,10 @@ class ObSqlExpressionFactory { // sql_expression = NULL; // } // } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlExpressionFactory); - private: +private: common::ObIAllocator& alloc_; }; } // namespace sql diff --git a/src/sql/engine/join/ob_basic_nested_loop_join.h b/src/sql/engine/join/ob_basic_nested_loop_join.h index 75cfbb230..3712e3465 100644 --- a/src/sql/engine/join/ob_basic_nested_loop_join.h +++ b/src/sql/engine/join/ob_basic_nested_loop_join.h @@ -20,15 +20,15 @@ namespace sql { class ObBasicNestedLoopJoin : public ObJoin { OB_UNIS_VERSION_V(1); - public: +public: static const int64_t DEFAULT_MEM_LIMIT = 10 * 1024 * 1024; static const int64_t DEFAULT_CACHE_LIMIT = 1000; - protected: +protected: class ObBasicNestedLoopJoinCtx : public ObJoinCtx { friend class ObBasicNestedLoopJoin; - public: + public: ObBasicNestedLoopJoinCtx(ObExecContext& ctx) : ObJoinCtx(ctx), open_right_child_(false) {} virtual ~ObBasicNestedLoopJoinCtx() @@ -47,14 +47,14 @@ class ObBasicNestedLoopJoin : public ObJoin { open_right_child_ = true; } - protected: + protected: common::ObExprCtx expr_ctx_; bool open_right_child_; }; struct RescanParam { OB_UNIS_VERSION_V(1); - public: + public: RescanParam() : my_phy_plan_(NULL), expr_(NULL), param_idx_(-1) {} RescanParam(ObPhysicalPlan* my_plan, ObSqlExpression* expr, int64_t idx) @@ -63,14 +63,14 @@ class ObBasicNestedLoopJoin : public ObJoin { ~RescanParam() {} - public: + public: ObPhysicalPlan* my_phy_plan_; ObSqlExpression* expr_; // freed by the physical plan int64_t param_idx_; TO_STRING_KV(N_EXPR, expr_, N_INDEX, param_idx_); }; - public: +public: explicit ObBasicNestedLoopJoin(common::ObIAllocator& alloc); virtual ~ObBasicNestedLoopJoin(); virtual void reset(); @@ -94,7 +94,7 @@ class ObBasicNestedLoopJoin : public ObJoin { calc_exprs_, N_JOIN_TYPE, ob_join_type_str(join_type_), N_JOIN_EQ_COND, rescan_params_, N_JOIN_OTHER_COND, other_join_conds_, N_INNER_GET, is_inner_get_, N_SELF_JOIN, is_self_join_); - protected: +protected: int get_next_left_row(ObJoinCtx& join_ctx) const; int prepare_rescan_params(ObBasicNestedLoopJoinCtx& join_ctx) const; inline bool use_batch_index_join(ObPhyOperatorType right_op_type) const @@ -114,7 +114,7 @@ class ObBasicNestedLoopJoin : public ObJoin { // open right child int open_right_child(ObBasicNestedLoopJoinCtx& join_ctx) const; - protected: +protected: common::ObFixedArray rescan_params_; // @todo a better name common::ObFixedArray left_scan_index_; bool is_inner_get_; diff --git a/src/sql/engine/join/ob_basic_nested_loop_join_op.h b/src/sql/engine/join/ob_basic_nested_loop_join_op.h index 1a591b883..8ae978038 100644 --- a/src/sql/engine/join/ob_basic_nested_loop_join_op.h +++ b/src/sql/engine/join/ob_basic_nested_loop_join_op.h @@ -18,7 +18,7 @@ namespace sql { class ObBasicNestedLoopJoinSpec : public ObJoinSpec { OB_UNIS_VERSION_V(1); - public: +public: ObBasicNestedLoopJoinSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObJoinSpec(alloc, type), rescan_params_(alloc), @@ -34,19 +34,19 @@ class ObBasicNestedLoopJoinSpec : public ObJoinSpec { int add_nlj_param(int64_t param_idx, ObExpr* org_expr, ObExpr* param_expr); - public: +public: common::ObFixedArray rescan_params_; // Indicates the location of the partition id column in the output row, // read out partition id through expr for pruning on the right ObExpr* gi_partition_id_expr_; bool enable_gi_partition_pruning_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBasicNestedLoopJoinSpec); }; class ObBasicNestedLoopJoinOp : public ObJoinOp { - public: +public: static const int64_t DEFAULT_MEM_LIMIT = 10 * 1024 * 1024; static const int64_t DEFAULT_CACHE_LIMIT = 1000; ObBasicNestedLoopJoinOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); @@ -78,10 +78,10 @@ class ObBasicNestedLoopJoinOp : public ObJoinOp { int save_left_row(); int recover_left_row(); - protected: +protected: bool open_right_child_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBasicNestedLoopJoinOp); }; diff --git a/src/sql/engine/join/ob_block_based_nested_loop_join.h b/src/sql/engine/join/ob_block_based_nested_loop_join.h index 0cee77c70..e950d0ad2 100644 --- a/src/sql/engine/join/ob_block_based_nested_loop_join.h +++ b/src/sql/engine/join/ob_block_based_nested_loop_join.h @@ -22,7 +22,7 @@ class ObExecContext; class ObTaskInfo; class ParamaterWrapper { - public: +public: ParamaterWrapper() : paramater_list_() {} @@ -63,7 +63,7 @@ class ParamaterWrapper { class ObBLKNestedLoopJoin : public ObBasicNestedLoopJoin { OB_UNIS_VERSION_V(1); - private: +private: enum ObJoinState { JS_JOIN_BEGIN = 0, JS_JOIN_LEFT_JOIN, @@ -78,7 +78,7 @@ class ObBLKNestedLoopJoin : public ObBasicNestedLoopJoin { class ObBLKNestedLoopJoinCtx : public ObBasicNestedLoopJoinCtx { friend class ObBLKNestedLoopJoin; - public: + public: ObBLKNestedLoopJoinCtx(ObExecContext& ctx) : ObBasicNestedLoopJoinCtx(ctx), state_(JS_JOIN_BEGIN), @@ -128,7 +128,7 @@ class ObBLKNestedLoopJoin : public ObBasicNestedLoopJoin { ObBasicNestedLoopJoinCtx::destroy(); } - private: + private: ObJoinState state_; common::ObNewRow left_cache_row_buf_; common::ObRowStore::StoredRow* stored_row_; @@ -144,14 +144,14 @@ class ObBLKNestedLoopJoin : public ObBasicNestedLoopJoin { typedef int (ObBLKNestedLoopJoin::*state_function_func_type)( ObBLKNestedLoopJoinCtx& join_ctx, const common::ObNewRow*& row) const; - public: +public: ObBLKNestedLoopJoin(common::ObIAllocator& alloc); virtual ~ObBLKNestedLoopJoin(); virtual void reset(); virtual void resuse(); virtual int rescan(ObExecContext& exec_ctx) const; - private: +private: virtual int inner_get_next_row(ObExecContext& exec_ctx, const common::ObNewRow*& row) const; virtual int inner_open(ObExecContext& exec_ctx) const; virtual int inner_create_operator_ctx(ObExecContext& exec_ctx, ObPhyOperatorCtx*& op_ctx) const; @@ -176,7 +176,7 @@ class ObBLKNestedLoopJoin : public ObBasicNestedLoopJoin { int init_right_child(ObBLKNestedLoopJoinCtx& join_ctx) const; int make_paramater_warpper(ObBLKNestedLoopJoinCtx& join_ctx, ParamaterWrapper& params) const; - private: +private: state_operation_func_type state_operation_func_[JS_STATE_COUNT]; state_function_func_type state_function_func_[JS_STATE_COUNT][FT_TYPE_COUNT]; }; diff --git a/src/sql/engine/join/ob_hash_join.h b/src/sql/engine/join/ob_hash_join.h index ad69fa775..294816f7d 100644 --- a/src/sql/engine/join/ob_hash_join.h +++ b/src/sql/engine/join/ob_hash_join.h @@ -29,7 +29,7 @@ class ObExecContext; class ObHashJoin : public ObJoin { OB_UNIS_VERSION_V(1); - public: +public: static const int64_t RATIO_OF_BUCKETS = 2; // min row count for estimated row count static const int64_t MIN_ROW_COUNT = 10000; @@ -96,7 +96,7 @@ class ObHashJoin : public ObJoin { hj_hash_fun hash_ptr_; }; - private: +private: enum ObJoinState { JS_JOIN_END, JS_READ_RIGHT, @@ -238,12 +238,12 @@ class ObHashJoin : public ObJoin { common::ObObjType cmp_type_; common::ObCollationType ctype_; // collation type - private: + private: DISALLOW_COPY_AND_ASSIGN(EqualConditionInfo); }; class DefaultHashJoin { - public: + public: DefaultHashJoin() {} ~DefaultHashJoin() @@ -255,7 +255,7 @@ class ObHashJoin : public ObJoin { }; class HashInnerJoin : public DefaultHashJoin { - public: + public: HashInnerJoin() {} ~HashInnerJoin() @@ -266,11 +266,11 @@ class ObHashJoin : public ObJoin { }; enum HJNestLoopState { START, GOING, RECURSIVE, END }; - public: +public: class ObHashJoinCtx : public ObJoinCtx { friend class ObHashJoin; - public: + public: enum HJState { INIT, NORMAL, NEXT_BATCH }; enum HJProcessor { NONE = 0, NEST_LOOP = 1, RECURSIVE = 2, IN_MEMORY = 4 }; @@ -315,7 +315,7 @@ class ObHashJoin : public ObJoin { ObJoinCtx::destroy(); } - private: + private: HJState hj_state_; HJProcessor hj_processor_; join::ObHJBufMgr* buf_mgr_; @@ -341,7 +341,7 @@ class ObHashJoin : public ObJoin { class ObPartHashJoinCtx : public ObHashJoinCtx { friend class ObHashJoin; - public: + public: explicit ObPartHashJoinCtx(ObExecContext& ctx); virtual ~ObPartHashJoinCtx() {} @@ -454,7 +454,7 @@ class ObHashJoin : public ObJoin { return get_mem_used() > sql_mem_processor_.get_mem_bound(); } - private: + private: ObJoinState state_; uint64_t hash_value_; // cur right row's hash_value bool right_has_matched_; // if cur right row has matched @@ -494,7 +494,7 @@ class ObHashJoin : public ObJoin { typedef int (ObHashJoin::*state_operation_func_type)(ObPartHashJoinCtx& join_ctx) const; typedef int (ObHashJoin::*state_function_func_type)(ObPartHashJoinCtx& join_ctx, const common::ObNewRow*& row) const; - public: +public: explicit ObHashJoin(common::ObIAllocator& alloc); virtual ~ObHashJoin(); virtual void reset(); @@ -502,7 +502,7 @@ class ObHashJoin : public ObJoin { virtual int rescan(ObExecContext& exec_ctx) const; virtual int part_rescan(ObExecContext& exec_ctx, bool reset_all) const; - private: +private: int init_join_ctx(ObExecContext& ctx) const; int init_join_partition(ObPartHashJoinCtx* join_ctx) const; // get next row @@ -612,7 +612,7 @@ class ObHashJoin : public ObJoin { void set_partition_memory_limit(ObPartHashJoinCtx& join_ctx, const int64_t mem_limit) const; int get_max_memory_size(ObPartHashJoinCtx& join_ctx, int64_t input_size) const; - private: +private: state_operation_func_type state_operation_func_[JS_STATE_COUNT]; state_function_func_type state_function_func_[JS_STATE_COUNT][FT_TYPE_COUNT]; int64_t mem_limit_; diff --git a/src/sql/engine/join/ob_hash_join_basic.h b/src/sql/engine/join/ob_hash_join_basic.h index c5313b780..0fc1834ee 100644 --- a/src/sql/engine/join/ob_hash_join_basic.h +++ b/src/sql/engine/join/ob_hash_join_basic.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace sql { class ObHashJoinBufMgr : public ObSqlMemoryCallback { - public: +public: ObHashJoinBufMgr() : reserve_memory_size_(0), pre_total_alloc_size_(0), @@ -95,7 +95,7 @@ class ObHashJoinBufMgr : public ObSqlMemoryCallback { return reserve_memory_size_ * RATIO / 100 < total_alloc_size_; } - private: +private: const static int64_t RATIO = 80; int64_t reserve_memory_size_; int64_t pre_total_alloc_size_; @@ -143,7 +143,7 @@ struct ObHashJoinStoredJoinRow : public sql::ObChunkDatumStore::StoredRow { }; class ObHashJoinBatch { - public: +public: ObHashJoinBatch( common::ObIAllocator& alloc, ObHashJoinBufMgr* buf_mgr, uint64_t tenant_id, int32_t part_level, int32_t batchno) : alloc_(alloc), @@ -289,7 +289,7 @@ class ObHashJoinBatch { return chunk_row_store_; } - private: +private: const int64_t ROW_CNT_PER = 0x3FF; common::ObIAllocator& alloc_; sql::ObChunkDatumStore chunk_row_store_; @@ -319,7 +319,7 @@ struct ObHashJoinBatchPair { }; class ObHashJoinBatchMgr { - public: +public: ObHashJoinBatchMgr(common::ObIAllocator& alloc, ObHashJoinBufMgr* buf_mgr, uint64_t tenant_id) : total_dump_count_(0), total_dump_size_(0), @@ -354,12 +354,12 @@ class ObHashJoinBatchMgr { } } - public: +public: int64_t total_dump_count_; int64_t total_dump_size_; int64_t batch_count_; - private: +private: uint64_t tenant_id_; common::ObIAllocator& alloc_; hj_batch_pair_list_type batch_list_; @@ -367,7 +367,7 @@ class ObHashJoinBatchMgr { }; class ObHashJoinPartition { - public: +public: ObHashJoinPartition() : buf_mgr_(nullptr), batch_mgr_(nullptr), batch_(nullptr), part_level_(-1), part_id_(-1) {} @@ -460,7 +460,7 @@ class ObHashJoinPartition { int record_pre_batch_info(int64_t pre_part_count, int64_t pre_bucket_number, int64_t total_size); - private: +private: ObHashJoinBufMgr* buf_mgr_; ObHashJoinBatchMgr* batch_mgr_; ObHashJoinBatch* batch_; diff --git a/src/sql/engine/join/ob_hash_join_op.h b/src/sql/engine/join/ob_hash_join_op.h index f362ca4f5..e4ae5fa58 100644 --- a/src/sql/engine/join/ob_hash_join_op.h +++ b/src/sql/engine/join/ob_hash_join_op.h @@ -27,7 +27,7 @@ namespace sql { class ObHashJoinSpec : public ObJoinSpec { OB_UNIS_VERSION_V(1); - public: +public: ObHashJoinSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ExprFixedArray equal_join_conds_; @@ -41,7 +41,7 @@ class ObHashJoinSpec : public ObJoinSpec { // RIGHT: overwrite with blank_right_row() in JS_FILL_LEFT state, right child also iterated end. class ObHashJoinOp : public ObJoinOp { - public: +public: ObHashJoinOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); ~ObHashJoinOp() {} @@ -49,7 +49,7 @@ class ObHashJoinOp : public ObJoinOp { using BucketFunc = std::function; using NextFunc = std::function; - private: +private: enum HJState { INIT, NORMAL, NEXT_BATCH }; enum HJProcessor { NONE = 0, NEST_LOOP = 1, RECURSIVE = 2, IN_MEMORY = 4 }; enum ObJoinState { @@ -63,7 +63,7 @@ class ObHashJoinOp : public ObJoinOp { enum ObFuncType { FT_ITER_GOING = 0, FT_ITER_END, FT_TYPE_COUNT }; enum HJLoopState { LOOP_START, LOOP_GOING, LOOP_RECURSIVE, LOOP_END }; - private: +private: struct HashTableCell { HashTableCell() = default; // do NOT init these members below in constructor, since we will set them @@ -181,7 +181,7 @@ class ObHashJoinOp : public ObJoinOp { bool is_match_; }; class HashJoinHistogram { - public: + public: HashJoinHistogram() : h1_(nullptr), h2_(nullptr), @@ -257,7 +257,7 @@ class ObHashJoinOp : public ObJoinOp { void switch_histogram(); void switch_prefix_hist_count(); - public: + public: using HistItemArray = common::ObSegmentArray; using HistPrefixArray = common::ObSegmentArray; HistItemArray* h1_; @@ -272,7 +272,7 @@ class ObHashJoinOp : public ObJoinOp { int64_t bucket_cnt_; }; class PartitionSplitter { - public: + public: PartitionSplitter() : alloc_(nullptr), part_count_(0), @@ -353,7 +353,7 @@ class ObHashJoinOp : public ObJoinOp { return total_row_count_; } - public: + public: ObIAllocator* alloc_; int64_t part_count_; ObHashJoinPartition* hj_parts_; @@ -367,14 +367,14 @@ class ObHashJoinOp : public ObJoinOp { int64_t total_row_count_; }; - public: +public: virtual int inner_open() override; virtual int rescan() override; virtual int inner_get_next_row() override; virtual void destroy() override; virtual int inner_close() override; - private: +private: void calc_cache_aware_partition_count(); int recursive_postprocess(); int insert_batch_row(const int64_t cur_partition_in_memory); @@ -480,7 +480,7 @@ class ObHashJoinOp : public ObJoinOp { int get_match_row(bool& is_matched); int get_next_right_row_for_batch(NextFunc next_func); - private: +private: OB_INLINE int64_t get_part_idx(const uint64_t hash_value) { return (hash_value >> part_shift_) & (part_count_ - 1); @@ -585,7 +585,7 @@ class ObHashJoinOp : public ObJoinOp { bool is_build_side); int get_next_probe_partition(); - private: +private: typedef int (ObHashJoinOp::*ReadFunc)(); typedef int (ObHashJoinOp::*state_function_func_type)(); typedef int (ObHashJoinOp::*state_operation_func_type)(); diff --git a/src/sql/engine/join/ob_hj_batch.h b/src/sql/engine/join/ob_hj_batch.h index 5c06aef84..5fef188d5 100644 --- a/src/sql/engine/join/ob_hj_batch.h +++ b/src/sql/engine/join/ob_hj_batch.h @@ -23,7 +23,7 @@ namespace join { class ObStoredJoinRow; class ObHJBatch { - public: +public: ObHJBatch(common::ObIAllocator& alloc, ObHJBufMgr* buf_mgr, uint64_t tenant_id, int32_t part_level, int32_t batchno) : alloc_(alloc), chunk_row_store_(&alloc), @@ -158,7 +158,7 @@ class ObHJBatch { return chunk_row_store_; } - private: +private: const int64_t ROW_CNT_PER = 0x3FF; common::ObIAllocator& alloc_; sql::ObChunkRowStore chunk_row_store_; diff --git a/src/sql/engine/join/ob_hj_batch_mgr.h b/src/sql/engine/join/ob_hj_batch_mgr.h index 9601ad169..06b17d811 100644 --- a/src/sql/engine/join/ob_hj_batch_mgr.h +++ b/src/sql/engine/join/ob_hj_batch_mgr.h @@ -30,7 +30,7 @@ struct ObHJBatchPair { }; class ObHJBatchMgr { - public: +public: ObHJBatchMgr(common::ObIAllocator& alloc, ObHJBufMgr* buf_mgr, uint64_t tenant_id) : total_dump_count_(0), total_dump_size_(0), @@ -65,12 +65,12 @@ class ObHJBatchMgr { } } - public: +public: int64_t total_dump_count_; int64_t total_dump_size_; int64_t batch_count_; - private: +private: uint64_t tenant_id_; common::ObIAllocator& alloc_; hj_batch_pair_list_type batch_list_; diff --git a/src/sql/engine/join/ob_hj_buf_mgr.h b/src/sql/engine/join/ob_hj_buf_mgr.h index c2c129a17..d594d910a 100644 --- a/src/sql/engine/join/ob_hj_buf_mgr.h +++ b/src/sql/engine/join/ob_hj_buf_mgr.h @@ -21,7 +21,7 @@ namespace sql { namespace join { class ObHJBufMgr : public ObSqlMemoryCallback { - public: +public: ObHJBufMgr() : reserve_memory_size_(0), pre_total_alloc_size_(0), @@ -93,7 +93,7 @@ class ObHJBufMgr : public ObSqlMemoryCallback { return reserve_memory_size_ * RATIO / 100 < total_alloc_size_; } - private: +private: const static int64_t RATIO = 80; int64_t reserve_memory_size_; int64_t pre_total_alloc_size_; diff --git a/src/sql/engine/join/ob_hj_partition.h b/src/sql/engine/join/ob_hj_partition.h index 0ad798c28..956e8ce04 100644 --- a/src/sql/engine/join/ob_hj_partition.h +++ b/src/sql/engine/join/ob_hj_partition.h @@ -61,7 +61,7 @@ struct ObStoredJoinRow : public sql::ObChunkRowStore::StoredRow { }; struct ObRowStoreHeader : public common::ObDLinkBase { - public: +public: ObRowStoreHeader() : row_store_(ObModIds::OB_ARENA_HASH_JOIN, OB_SERVER_TENANT_ID, true) {} virtual ~ObRowStoreHeader() @@ -75,7 +75,7 @@ struct ObRowStoreHeader : public common::ObDLinkBase { ((ObRowStoreHeader*)((char*)row_store - (int64_t)(&(((ObRowStoreHeader*)(0))->row_store_)))) class ObHJPartition { - public: +public: ObHJPartition() : buf_mgr_(nullptr), batch_mgr_(nullptr), batch_(nullptr), part_level_(-1), part_id_(-1) {} @@ -161,7 +161,7 @@ class ObHJPartition { int record_pre_batch_info(int64_t pre_part_count, int64_t pre_bucket_number, int64_t total_size); - private: +private: ObHJBufMgr* buf_mgr_; ObHJBatchMgr* batch_mgr_; ObHJBatch* batch_; diff --git a/src/sql/engine/join/ob_join.h b/src/sql/engine/join/ob_join.h index 04edacbd1..1bbf62f98 100644 --- a/src/sql/engine/join/ob_join.h +++ b/src/sql/engine/join/ob_join.h @@ -28,14 +28,14 @@ typedef common::ObFixedArray ConnectByRowDesc; class ObJoin : public ObDoubleChildrenPhyOperator { OB_UNIS_VERSION_V(1); - public: +public: const static int64_t DUMMY_OUPUT; const static int64_t UNUSED_POS; class ObJoinCtx : public ObPhyOperatorCtx { friend class ObJoin; friend class ObHashJoin; - public: + public: explicit ObJoinCtx(ObExecContext& ctx); virtual ~ObJoinCtx() {} @@ -44,18 +44,18 @@ class ObJoin : public ObDoubleChildrenPhyOperator { ObPhyOperatorCtx::destroy_base(); } - protected: + protected: const common::ObNewRow* left_row_; const common::ObNewRow* right_row_; const common::ObNewRow* last_left_row_; const common::ObNewRow* last_right_row_; bool left_row_joined_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObJoinCtx); }; - public: +public: explicit ObJoin(common::ObIAllocator& alloc); virtual ~ObJoin(); virtual void reset(); @@ -136,7 +136,7 @@ class ObJoin : public ObDoubleChildrenPhyOperator { calc_exprs_, N_JOIN_TYPE, ob_join_type_str(join_type_), N_JOIN_EQ_COND, equal_join_conds_, N_JOIN_OTHER_COND, other_join_conds_); - protected: +protected: inline bool need_left_join() const; inline bool need_right_join() const; int join_rows(ObJoinCtx& join_ctx, const common::ObNewRow*& row) const; @@ -163,7 +163,7 @@ class ObJoin : public ObDoubleChildrenPhyOperator { */ virtual int inner_open(ObExecContext& exec_ctx) const; - protected: +protected: ObJoinType join_type_; common::ObDList equal_join_conds_; common::ObDList other_join_conds_; @@ -175,7 +175,7 @@ class ObJoin : public ObDoubleChildrenPhyOperator { common::ObDList sort_siblings_exprs_; // for order siblings common::ObDList connect_by_root_exprs_; // calc connect_by_root expr bool is_nocycle_; // deal with connect loop - private: +private: DISALLOW_COPY_AND_ASSIGN(ObJoin); }; diff --git a/src/sql/engine/join/ob_join_op.h b/src/sql/engine/join/ob_join_op.h index 288e020ae..00669b4a1 100644 --- a/src/sql/engine/join/ob_join_op.h +++ b/src/sql/engine/join/ob_join_op.h @@ -20,21 +20,21 @@ namespace sql { class ObJoinSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObJoinSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), join_type_(UNKNOWN_JOIN), other_join_conds_(alloc) {} - public: +public: ObJoinType join_type_; common::ObFixedArray other_join_conds_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObJoinSpec); }; class ObJoinOp : public ObOperator { - public: +public: ObJoinOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), output_row_produced_(false), left_row_joined_(false) {} @@ -71,11 +71,11 @@ class ObJoinOp : public ObOperator { return static_cast(spec_); } - public: +public: bool output_row_produced_; bool left_row_joined_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObJoinOp); }; diff --git a/src/sql/engine/join/ob_merge_join.h b/src/sql/engine/join/ob_merge_join.h index fa37f2b4d..6c5dad3b2 100644 --- a/src/sql/engine/join/ob_merge_join.h +++ b/src/sql/engine/join/ob_merge_join.h @@ -25,7 +25,7 @@ class ObMergeJoin : public ObJoin { OB_UNIS_VERSION_V(1); friend class TestObMergeJoin; - private: +private: enum ObJoinState { // this state need not execute actually. JS_JOIN_END = 0, @@ -58,7 +58,7 @@ class ObMergeJoin : public ObJoin { class ObMergeJoinCtx : public ObJoinCtx { friend class ObMergeJoin; - public: + public: explicit ObMergeJoinCtx(ObExecContext& ctx); virtual ~ObMergeJoinCtx() {} @@ -82,7 +82,7 @@ class ObMergeJoin : public ObJoin { ObPhyOperatorCtx::destroy_base(); } - private: + private: ObJoinState state_; common::ObNewRow right_cache_row_buf_; // similar with cur_row_, used for iterator of right_cache_. common::ObRowStore::StoredRow* stored_row_; @@ -97,7 +97,7 @@ class ObMergeJoin : public ObJoin { bool left_row_matched_; }; - public: +public: explicit ObMergeJoin(common::ObIAllocator& alloc); virtual ~ObMergeJoin(); virtual void reset(); @@ -133,7 +133,7 @@ class ObMergeJoin : public ObJoin { return merge_directions_.push_back(is_ascending_direction(direction) ? MERGE_DIRECTION_ASC : MERGE_DIRECTION_DESC); } - private: +private: // state operation and transfer functions. typedef int (ObMergeJoin::*state_operation_func_type)(ObMergeJoinCtx& join_ctx) const; typedef int (ObMergeJoin::*state_function_func_type)(ObMergeJoinCtx& join_ctx, const common::ObNewRow*& row) const; @@ -151,7 +151,7 @@ class ObMergeJoin : public ObJoin { virtual int inner_close(ObExecContext& exec_ctx) const; virtual int inner_create_operator_ctx(ObExecContext& exec_ctx, ObPhyOperatorCtx*& op_ctx) const; - private: +private: // JS_JOIN_END state operation and transfer functions. int join_end_operate(ObMergeJoinCtx& join_ctx) const; int join_end_func_end(ObMergeJoinCtx& join_ctx, const common::ObNewRow*& row) const; @@ -199,13 +199,13 @@ class ObMergeJoin : public ObJoin { return is_left_unique_ && INNER_JOIN == join_type_; } - private: +private: state_operation_func_type state_operation_func_[JS_STATE_COUNT]; state_function_func_type state_function_func_[JS_STATE_COUNT][FT_TYPE_COUNT]; common::ObFixedArray merge_directions_; bool is_left_unique_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMergeJoin); }; // int ObMergeJoin::set_merge_directions(common::ObIArray &merge_directions) diff --git a/src/sql/engine/join/ob_merge_join_op.h b/src/sql/engine/join/ob_merge_join_op.h index 03b02157a..746dea74e 100644 --- a/src/sql/engine/join/ob_merge_join_op.h +++ b/src/sql/engine/join/ob_merge_join_op.h @@ -22,11 +22,11 @@ namespace sql { class ObMergeJoinSpec : public ObJoinSpec { OB_UNIS_VERSION_V(1); - public: +public: struct EqualConditionInfo { OB_UNIS_VERSION(1); - public: + public: EqualConditionInfo() : expr_(NULL), ns_cmp_func_(NULL), is_opposite_(false) {} TO_STRING_KV(K(expr_), KP(ns_cmp_func_), K(is_opposite_)); @@ -40,7 +40,7 @@ class ObMergeJoinSpec : public ObJoinSpec { bool is_opposite_; }; - public: +public: ObMergeJoinSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObJoinSpec(alloc, type), equal_cond_infos_(alloc), merge_directions_(alloc), is_left_unique_(false) {} @@ -67,7 +67,7 @@ class ObMergeJoinSpec : public ObJoinSpec { return ret; } - private: +private: static const int64_t MERGE_DIRECTION_ASC; static const int64_t MERGE_DIRECTION_DESC; int add_merge_direction(ObOrderDirection direction) @@ -75,17 +75,17 @@ class ObMergeJoinSpec : public ObJoinSpec { return merge_directions_.push_back(is_ascending_direction(direction) ? MERGE_DIRECTION_ASC : MERGE_DIRECTION_DESC); } - public: +public: common::ObFixedArray equal_cond_infos_; common::ObFixedArray merge_directions_; bool is_left_unique_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMergeJoinSpec); }; class ObMergeJoinOp : public ObJoinOp { - private: +private: struct ObStoredJoinRow : public ObChunkDatumStore::StoredRow { bool& get_extra_info() { @@ -226,7 +226,7 @@ class ObMergeJoinOp : public ObJoinOp { // iter ate side for JS_EMPTY_CACHE state. enum ObMJIterateSide { ITER_LEFT = 0b01, ITER_RIGHT = 0b10, ITER_BOTH = 0b11 }; - public: +public: ObMergeJoinOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObMergeJoinOp() { @@ -263,7 +263,7 @@ class ObMergeJoinOp : public ObJoinOp { ObJoinOp::destroy(); } - private: +private: // JS_JOIN_END state operation and transfer functions. int join_end_operate(); int join_end_func_end(); @@ -333,11 +333,11 @@ class ObMergeJoinOp : public ObJoinOp { typedef int (ObMergeJoinOp::*state_operation_func_type)(); typedef int (ObMergeJoinOp::*state_function_func_type)(); - private: +private: state_operation_func_type state_operation_func_[JS_STATE_COUNT]; state_function_func_type state_function_func_[JS_STATE_COUNT][FT_TYPE_COUNT]; - private: +private: ObJoinState state_; lib::MemoryContext* mem_context_; @@ -354,7 +354,7 @@ class ObMergeJoinOp : public ObJoinOp { // for semi join, if equal_condition and other_condition matched, output this row, else not output bool left_row_matched_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMergeJoinOp); }; diff --git a/src/sql/engine/join/ob_nested_loop_join.h b/src/sql/engine/join/ob_nested_loop_join.h index 58412465f..9016c0673 100644 --- a/src/sql/engine/join/ob_nested_loop_join.h +++ b/src/sql/engine/join/ob_nested_loop_join.h @@ -24,7 +24,7 @@ class ObTaskInfo; class ObNestedLoopJoin : public ObBasicNestedLoopJoin { OB_UNIS_VERSION_V(1); - private: +private: enum ObJoinState { JS_JOIN_END = 0, JS_READ_LEFT, JS_READ_RIGHT, JS_STATE_COUNT }; enum ObFuncType { FT_ITER_GOING = 0, FT_ITER_END, FT_TYPE_COUNT }; struct ObBatchIndexJoinCtx { @@ -37,7 +37,7 @@ class ObNestedLoopJoin : public ObBasicNestedLoopJoin { class ObNestedLoopJoinCtx : public ObBasicNestedLoopJoinCtx { friend class ObNestedLoopJoin; - public: + public: ObNestedLoopJoinCtx(ObExecContext& ctx) : ObBasicNestedLoopJoinCtx(ctx), state_(JS_READ_LEFT), batch_join_ctx_(), is_left_end_(false) // connect_by_pump_() @@ -51,14 +51,14 @@ class ObNestedLoopJoin : public ObBasicNestedLoopJoin { ObBasicNestedLoopJoinCtx::destroy(); } - private: + private: ObJoinState state_; ObBatchIndexJoinCtx batch_join_ctx_; bool is_left_end_; // ObConnectByPump connect_by_pump_; }; - public: +public: explicit ObNestedLoopJoin(common::ObIAllocator& alloc); virtual ~ObNestedLoopJoin(); virtual void reset(); @@ -91,7 +91,7 @@ class ObNestedLoopJoin : public ObBasicNestedLoopJoin { cache_limit_ = cache_limit; } - private: +private: // state operation and transfer function type. typedef int (ObNestedLoopJoin::*state_operation_func_type)(ObNestedLoopJoinCtx& join_ctx) const; typedef int (ObNestedLoopJoin::*state_function_func_type)( @@ -126,7 +126,7 @@ class ObNestedLoopJoin : public ObBasicNestedLoopJoin { // nested loop join with index seek, batch int batch_index_join_get_next(ObExecContext& exec_ctx, const common::ObNewRow*& row) const; - private: +private: int bij_fill_left_rows(ObExecContext& exec_ctx) const; int bij_join_rows(ObExecContext& exec_ctx, const common::ObNewRow*& row) const; diff --git a/src/sql/engine/join/ob_nested_loop_join_op.h b/src/sql/engine/join/ob_nested_loop_join_op.h index d59b46957..eae15a3e3 100644 --- a/src/sql/engine/join/ob_nested_loop_join_op.h +++ b/src/sql/engine/join/ob_nested_loop_join_op.h @@ -21,18 +21,18 @@ namespace sql { class ObNestedLoopJoinSpec : public ObBasicNestedLoopJoinSpec { OB_UNIS_VERSION_V(1); - public: +public: static const int64_t DEFAULT_BATCH_SIZE = 1000; ObNestedLoopJoinSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObBasicNestedLoopJoinSpec(alloc, type), use_group_(false), batch_size_(DEFAULT_BATCH_SIZE) {} - public: +public: // for group nested loop join. bool use_group_; int64_t batch_size_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNestedLoopJoinSpec); }; @@ -47,7 +47,7 @@ class ObNestedLoopJoinSpec : public ObBasicNestedLoopJoinSpec { // Overwrite in blank_right_row(), right child is iterated end when blanked. // class ObNestedLoopJoinOp : public ObBasicNestedLoopJoinOp { - public: +public: enum ObJoinState { JS_JOIN_END = 0, JS_READ_LEFT, JS_READ_RIGHT, JS_STATE_COUNT }; enum ObFuncType { FT_ITER_GOING = 0, FT_ITER_END, FT_TYPE_COUNT }; @@ -69,7 +69,7 @@ class ObNestedLoopJoinOp : public ObBasicNestedLoopJoinOp { ObBasicNestedLoopJoinOp::destroy(); } - private: +private: // state operation and transfer function type. typedef int (ObNestedLoopJoinOp::*state_operation_func_type)(); typedef int (ObNestedLoopJoinOp::*state_function_func_type)(); @@ -94,7 +94,7 @@ class ObNestedLoopJoinOp : public ObBasicNestedLoopJoinOp { // used for rescan and switch iter virtual void reset_buf_state(); - public: +public: ObJoinState state_; // for bnl join lib::MemoryContext* mem_context_; @@ -104,7 +104,7 @@ class ObNestedLoopJoinOp : public ObBasicNestedLoopJoinOp { ObChunkDatumStore::ShadowStoredRow<> last_store_row_; bool save_last_row_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNestedLoopJoinOp); }; diff --git a/src/sql/engine/ob_des_exec_context.h b/src/sql/engine/ob_des_exec_context.h index 1d955a122..e66905cb4 100644 --- a/src/sql/engine/ob_des_exec_context.h +++ b/src/sql/engine/ob_des_exec_context.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObDesExecContext : public ObExecContext { - public: +public: explicit ObDesExecContext(ObSQLSessionMgr* session_mgr); ObDesExecContext(common::ObIAllocator& allocator, ObSQLSessionMgr* session_mgr); virtual ~ObDesExecContext(); @@ -29,21 +29,21 @@ class ObDesExecContext : public ObExecContext { void show_session(); void hide_session(); - protected: +protected: ObFreeSessionCtx free_session_ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDesExecContext); }; class ObDistributedExecContext : public ObDesExecContext { - public: +public: explicit ObDistributedExecContext(ObSQLSessionMgr* session_mgr); ObDistributedExecContext(common::ObIAllocator& allocator, ObSQLSessionMgr* session_mgr); virtual ~ObDistributedExecContext(); VIRTUAL_NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: const char* phy_plan_ctx_buf_; int64_t phy_plan_ctx_len_; const char* my_session_buf_; diff --git a/src/sql/engine/ob_double_children_phy_operator.h b/src/sql/engine/ob_double_children_phy_operator.h index 143c71760..1cbf3bcff 100644 --- a/src/sql/engine/ob_double_children_phy_operator.h +++ b/src/sql/engine/ob_double_children_phy_operator.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObDoubleChildrenPhyOperator : public ObPhyOperator { - public: +public: explicit ObDoubleChildrenPhyOperator(common::ObIAllocator& alloc); virtual ~ObDoubleChildrenPhyOperator(); /// Just two children are allowed to set @@ -32,11 +32,11 @@ class ObDoubleChildrenPhyOperator : public ObPhyOperator { virtual void reuse(); virtual int accept(ObPhyOperatorVisitor& visitor) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDoubleChildrenPhyOperator); - protected: +protected: // data members ObPhyOperator* left_op_; ObPhyOperator* right_op_; diff --git a/src/sql/engine/ob_exec_context.h b/src/sql/engine/ob_exec_context.h index 767fbc7ee..ef68e0cae 100644 --- a/src/sql/engine/ob_exec_context.h +++ b/src/sql/engine/ob_exec_context.h @@ -95,7 +95,7 @@ struct ObOperatorKit { // Physical operator kit store class ObOpKitStore { - public: +public: ObOpKitStore() : size_(0), kits_(NULL) {} @@ -123,12 +123,12 @@ class ObPhyOperator; // ObExecContext serialize // ObDesExecContext for deseralize class ObExecContext { - public: +public: /** * some operator need different rescan logic for GI */ class ObPlanRestartGuard { - public: + public: explicit ObPlanRestartGuard(ObExecContext& ctx) : restart_plan_(ctx.get_restart_plan()) { restart_plan_ = true; @@ -138,11 +138,11 @@ class ObExecContext { restart_plan_ = false; } - private: + private: bool& restart_plan_; }; - public: +public: ObExecContext(); explicit ObExecContext(common::ObIAllocator& allocator); virtual ~ObExecContext(); @@ -367,12 +367,12 @@ class ObExecContext { VIRTUAL_NEED_SERIALIZE_AND_DESERIALIZE; - protected: +protected: uint64_t get_ser_version() const; const static uint64_t SER_VERSION_0 = 0; const static uint64_t SER_VERSION_1 = 1; - public: +public: ObPlanCacheManager* get_plan_cache_manager() { return plan_cache_manager_; @@ -662,7 +662,7 @@ class ObExecContext { return expr_partition_id_; } - private: +private: int set_phy_op_ctx_ptr(uint64_t index, void* phy_op); void* get_phy_op_ctx_ptr(uint64_t index) const; /** @@ -676,7 +676,7 @@ class ObExecContext { int32_t& real_input_count, bool is_full_tree) const; int serialize_operator_input_len_recursively(const ObPhyOperator* op, int64_t& len, bool is_full_tree) const; - protected: +protected: /** * @brief the memory of exec context. * ------------------------------------------------ @@ -806,7 +806,7 @@ class ObExecContext { // for expr values op use int64_t expr_partition_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExecContext); }; diff --git a/src/sql/engine/ob_multi_children_phy_operator.h b/src/sql/engine/ob_multi_children_phy_operator.h index 2e12be8b4..885661438 100644 --- a/src/sql/engine/ob_multi_children_phy_operator.h +++ b/src/sql/engine/ob_multi_children_phy_operator.h @@ -20,7 +20,7 @@ namespace sql { class ObMultiChildrenPhyOperator : public ObPhyOperator { OB_UNIS_VERSION_V(1); - public: +public: explicit ObMultiChildrenPhyOperator(common::ObIAllocator& alloc); virtual ~ObMultiChildrenPhyOperator(); /// multi children @@ -36,11 +36,11 @@ class ObMultiChildrenPhyOperator : public ObPhyOperator { virtual void reuse() override; virtual int accept(ObPhyOperatorVisitor& visitor) const override; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObMultiChildrenPhyOperator); - protected: +protected: ObPhyOperator** child_array_; int32_t child_num_; }; diff --git a/src/sql/engine/ob_no_children_phy_operator.h b/src/sql/engine/ob_no_children_phy_operator.h index 50144d238..a53ed2414 100644 --- a/src/sql/engine/ob_no_children_phy_operator.h +++ b/src/sql/engine/ob_no_children_phy_operator.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObNoChildrenPhyOperator : public ObPhyOperator { - public: +public: explicit ObNoChildrenPhyOperator(common::ObIAllocator& alloc) : ObPhyOperator(alloc) {} virtual ~ObNoChildrenPhyOperator() @@ -27,7 +27,7 @@ class ObNoChildrenPhyOperator : public ObPhyOperator { virtual int32_t get_child_num() const; virtual int accept(ObPhyOperatorVisitor& visitor) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObNoChildrenPhyOperator); }; diff --git a/src/sql/engine/ob_operator.h b/src/sql/engine/ob_operator.h index 94153deda..7dbf4d6c1 100644 --- a/src/sql/engine/ob_operator.h +++ b/src/sql/engine/ob_operator.h @@ -37,7 +37,7 @@ typedef common::Ob2DArray op_schema_objs_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPhyOperator); }; @@ -867,7 +867,7 @@ class ObDoubleChildrenPhyOperator; class ObMultiChildrenPhyOperator; class ObNoChildrenPhyOperator; class ObPhyOperatorVisitor { - public: +public: virtual int pre_visit(const ObSingleChildPhyOperator& op) = 0; virtual int post_visit(const ObSingleChildPhyOperator& op) = 0; virtual int pre_visit(const ObDoubleChildrenPhyOperator& op) = 0; diff --git a/src/sql/engine/ob_phy_operator_factory.h b/src/sql/engine/ob_phy_operator_factory.h index 8b187640a..f3a0ce101 100644 --- a/src/sql/engine/ob_phy_operator_factory.h +++ b/src/sql/engine/ob_phy_operator_factory.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObPhyOperatorFactory { - public: +public: explicit ObPhyOperatorFactory(common::ObIAllocator& alloc) : alloc_(alloc) {} ~ObPhyOperatorFactory() @@ -30,14 +30,14 @@ class ObPhyOperatorFactory { // All memory is released by alloc; } - private: +private: template static int alloc(common::ObIAllocator& alloc, ObPhyOperator*& phy_op); typedef int (*AllocFunc)(common::ObIAllocator& alloc, ObPhyOperator*& phy_op); static AllocFunc PHY_OPERATOR_ALLOC[PHY_END]; - private: +private: common::ObIAllocator& alloc_; }; diff --git a/src/sql/engine/ob_phy_operator_type.h b/src/sql/engine/ob_phy_operator_type.h index 03be9a42e..d09a3c625 100644 --- a/src/sql/engine/ob_phy_operator_type.h +++ b/src/sql/engine/ob_phy_operator_type.h @@ -150,7 +150,7 @@ struct ObPhyOperatorTypeDescSet { void set_type_str(ObPhyOperatorType type, const char* type_str); const char* get_type_str(ObPhyOperatorType type) const; - private: +private: ObPhyOperatorTypeDesc set_[PHY_END]; }; diff --git a/src/sql/engine/ob_physical_plan.h b/src/sql/engine/ob_physical_plan.h index dd9a8dc58..3b51d4618 100644 --- a/src/sql/engine/ob_physical_plan.h +++ b/src/sql/engine/ob_physical_plan.h @@ -52,7 +52,7 @@ typedef common::ObFixedArray PlanPwjC struct FlashBackQueryItem { OB_UNIS_VERSION(1); - public: +public: FlashBackQueryItem() : table_id_(common::OB_INVALID_ID), time_val_(transaction::ObTransVersion::INVALID_TRANS_VERSION), @@ -75,7 +75,7 @@ struct FlashBackQueryItem { }; class ObPhysicalPlan : public ObCacheObject { - public: +public: static const int32_t SLOW_QUERY_TIME = 100000; // 100ms static const int64_t SLOW_QUERY_TIME_FOR_PLAN_EXPIRE = 5000; // 5ms static const int64_t SLOW_QUERY_ROW_COUNT_THRESOLD = 5000; @@ -84,7 +84,7 @@ class ObPhysicalPlan : public ObCacheObject { static const int64_t EXPIRED_PLAN_TABLE_ROW_THRESHOLD = 100; OB_UNIS_VERSION(1); - public: +public: explicit ObPhysicalPlan(lib::MemoryContext& mem_context = CURRENT_CONTEXT); virtual ~ObPhysicalPlan(); @@ -603,7 +603,7 @@ class ObPhysicalPlan : public ObCacheObject { return has_link_table_; } - public: +public: static void print_tree(char* buf, const int64_t buf_len, int64_t& pos, const ObPhyOperator* op); int inc_concurrent_num(); void dec_concurrent_num(); @@ -757,10 +757,10 @@ class ObPhysicalPlan : public ObCacheObject { return need_serial_exec_; } - public: +public: static const int64_t MAX_PRINTABLE_SIZE = 2 * 1024 * 1024; - private: +private: static const int64_t COMMON_OP_NUM = 16; static const int64_t COMMON_SUB_QUERY_NUM = 6; static const int64_t COMMON_BASE_TABLE_NUM = 64; @@ -768,10 +768,10 @@ class ObPhysicalPlan : public ObCacheObject { static const int64_t COMMON_PARAM_NUM = 12; static const int64_t SAMPLE_TIMES = 10; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPhysicalPlan); - private: +private: ObQueryHint query_hint_; // hints for this plan // root phy operator for the old engine. ObPhyOperator* main_query_; @@ -855,7 +855,7 @@ class ObPhysicalPlan : public ObCacheObject { PlanPwjConstraintArray strict_constrinats_; PlanPwjConstraintArray non_strict_constrinats_; - public: +public: ObExprFrameInfo expr_frame_info_; ObPlanStat stat_; @@ -863,7 +863,7 @@ class ObPhysicalPlan : public ObCacheObject { const int64_t MAX_BINARY_CODE_LEN = 1024 * 256; // 256k ObLoctionSensitiveHint loc_sensitive_hint_; - private: +private: bool is_returning_; bool is_late_materialized_; // **** for spm **** @@ -875,7 +875,7 @@ class ObPhysicalPlan : public ObCacheObject { bool need_consistent_snapshot_; bool is_batched_multi_stmt_; #ifndef NDEBUG - public: +public: common::ObBitSet bit_set_; #endif int64_t is_new_engine_; diff --git a/src/sql/engine/ob_physical_plan_ctx.h b/src/sql/engine/ob_physical_plan_ctx.h index 1bfbb6001..4fcf3dd0b 100644 --- a/src/sql/engine/ob_physical_plan_ctx.h +++ b/src/sql/engine/ob_physical_plan_ctx.h @@ -57,7 +57,7 @@ struct ObRemoteSqlInfo { class ObPhysicalPlanCtx { OB_UNIS_VERSION(1); - public: +public: typedef common::Ob2DArray ParamStore; explicit ObPhysicalPlanCtx(common::ObIAllocator& allocator); @@ -537,14 +537,14 @@ class ObPhysicalPlanCtx { void add_px_dml_row_info(const ObPxDmlRowInfo& dml_row_info); TO_STRING_KV("tenant_id", tenant_id_); - private: +private: int extend_param_frame(const int64_t old_size); int reserve_param_frame(const int64_t capacity); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPhysicalPlanCtx); - private: +private: static const int64_t ESTIMATE_PS_RESERVE_TIME = 100 * 1000; static const int64_t ESTIMATE_TRANS_RESERVE_TIME = 70 * 1000; // oracle calc time during running, not before running. @@ -553,7 +553,7 @@ class ObPhysicalPlanCtx { static const int64_t DELTA_TARDY_TIME_US = 5; common::ObIAllocator& allocator_; - private: +private: /** * @note these member need serialize */ @@ -590,7 +590,7 @@ class ObPhysicalPlanCtx { int64_t bind_array_idx_; int64_t tenant_schema_version_; - private: +private: /** * @note these member not need serialize */ diff --git a/src/sql/engine/ob_serializable_function.h b/src/sql/engine/ob_serializable_function.h index 3c07fb2b0..785df5d13 100644 --- a/src/sql/engine/ob_serializable_function.h +++ b/src/sql/engine/ob_serializable_function.h @@ -41,7 +41,7 @@ enum ObSerFuncArrayID { SER_FUNC_ARRAY_ID_ENUM }; #define UNUSED_SER_FUNC_ARRAY_ID_ENUM OB_SFA_MIN, OB_SFA_MAX class ObFuncSerialization { - public: +public: // called before worker threads started. static void init() { @@ -95,7 +95,7 @@ class ObFuncSerialization { uint64_t bucket_size_mask_; }; - private: +private: const static int64_t ARRAY_IDX_SHIFT_BIT = 32; struct FuncArray { diff --git a/src/sql/engine/ob_single_child_phy_operator.h b/src/sql/engine/ob_single_child_phy_operator.h index a773c81d0..0889fd458 100644 --- a/src/sql/engine/ob_single_child_phy_operator.h +++ b/src/sql/engine/ob_single_child_phy_operator.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObSingleChildPhyOperator : public ObPhyOperator { - public: +public: explicit ObSingleChildPhyOperator(common::ObIAllocator& alloc); virtual ~ObSingleChildPhyOperator(); /// set the only one child @@ -31,11 +31,11 @@ class ObSingleChildPhyOperator : public ObPhyOperator { virtual void reuse(); virtual int accept(ObPhyOperatorVisitor& visitor) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSingleChildPhyOperator); - protected: +protected: // data members ObPhyOperator* child_op_; }; diff --git a/src/sql/engine/ob_sql_mem_mgr_processor.h b/src/sql/engine/ob_sql_mem_mgr_processor.h index 2ef2de9c4..ff6d35ba0 100644 --- a/src/sql/engine/ob_sql_mem_mgr_processor.h +++ b/src/sql/engine/ob_sql_mem_mgr_processor.h @@ -20,10 +20,10 @@ namespace oceanbase { namespace sql { class ObSqlMemMgrProcessor : public ObSqlMemoryCallback { - private: +private: using PredFunc = std::function; - public: +public: ObSqlMemMgrProcessor(ObSqlWorkAreaProfile& profile) : profile_(profile), sql_mem_mgr_(nullptr), @@ -188,10 +188,10 @@ class ObSqlMemMgrProcessor : public ObSqlMemoryCallback { profile_.set_number_pass(num_pass); } - private: +private: int try_upgrade_auto_mgr(ObIAllocator* allocator, int64_t mem_used); - private: +private: static const int64_t MAX_SQL_MEM_SIZE = 2 * 1024 * 1024; // 2M static const int64_t UPDATED_DELTA_SIZE = 1 * 1024 * 1024; static const int64_t EXTEND_RATIO = 10; @@ -207,7 +207,7 @@ class ObSqlMemMgrProcessor : public ObSqlMemoryCallback { }; class ObSqlWorkareaUtil { - public: +public: static int get_workarea_size(const ObSqlWorkAreaType wa_type, const int64_t tenant_id, int64_t& value); }; diff --git a/src/sql/engine/ob_tenant_sql_memory_manager.h b/src/sql/engine/ob_tenant_sql_memory_manager.h index bec0390bd..9ad4f1729 100644 --- a/src/sql/engine/ob_tenant_sql_memory_manager.h +++ b/src/sql/engine/ob_tenant_sql_memory_manager.h @@ -27,7 +27,7 @@ namespace sql { enum ObSqlWorkAreaType { HASH_WORK_AREA = 0, SORT_WORK_AREA = 1, MAX_TYPE }; class ObSqlWorkAreaProfile : public common::ObDLinkBase { - public: +public: ObSqlWorkAreaProfile(ObSqlWorkAreaType type) : ObDLinkBase(), random_id_(0), @@ -265,7 +265,7 @@ class ObSqlWorkAreaProfile : public common::ObDLinkBase { TO_STRING_KV(K_(random_id), K_(type), K_(op_id), K_(cache_size), K_(one_pass_size), K_(expect_size)); - private: +private: static const int64_t MIN_BOUND_SIZE[ObSqlWorkAreaType::MAX_TYPE]; int64_t random_id_; ObSqlWorkAreaType type_; @@ -283,7 +283,7 @@ class ObSqlWorkAreaProfile : public common::ObDLinkBase { int64_t global_bound_size_; int64_t max_bound_; - public: +public: int64_t delta_size_; int64_t data_size_; int64_t max_mem_used_; @@ -292,7 +292,7 @@ class ObSqlWorkAreaProfile : public common::ObDLinkBase { int64_t dumped_size_; double data_ratio_; - public: +public: // some statistics int64_t active_time_; // init: start_time, unregister: int64_t number_pass_; @@ -306,7 +306,7 @@ static constexpr const char* EXECUTION_AUTO_POLICY = "AUTO"; static constexpr const char* EXECUTION_MANUAL_POLICY = "MANUAL"; class ObSqlWorkAreaStat { - public: +public: ObSqlWorkAreaStat() : seqno_(INT64_MAX), workarea_key_(), @@ -326,7 +326,7 @@ class ObSqlWorkAreaStat { is_auto_policy_(false) {} - public: +public: struct WorkareaKey { WorkareaKey(uint64_t plan_id, uint64_t operator_id) : plan_id_(plan_id), operator_id_(operator_id) { @@ -376,7 +376,7 @@ class ObSqlWorkAreaStat { } TO_STRING_KV(K_(sql_id), K_(plan_id), K_(operator_id)); - public: + public: char sql_id_[common::OB_MAX_SQL_ID_LENGTH + 1]; // sql id uint64_t plan_id_; // plan id uint64_t operator_id_; // operator id @@ -492,7 +492,7 @@ class ObSqlWorkAreaStat { TO_STRING_KV(K_(workarea_key), K_(op_type), K_(seqno)); - public: +public: int64_t seqno_; WorkareaKey workarea_key_; ObPhyOperatorType op_type_; @@ -512,7 +512,7 @@ class ObSqlWorkAreaStat { }; class ObSqlWorkareaProfileInfo { - public: +public: ObSqlWorkareaProfileInfo() : profile_(ObSqlWorkAreaType::MAX_TYPE), plan_id_(0), sql_exec_id_(0), session_id_(0) { sql_id_[0] = '\0'; @@ -542,7 +542,7 @@ class ObSqlWorkareaProfileInfo { TO_STRING_KV(K_(sql_id), K_(plan_id), K_(sql_exec_id)); - public: +public: sql::ObSqlWorkAreaProfile profile_; char sql_id_[common::OB_MAX_SQL_ID_LENGTH + 1]; uint64_t plan_id_; @@ -551,7 +551,7 @@ class ObSqlWorkareaProfileInfo { }; class ObSqlWorkAreaIntervalStat { - public: +public: ObSqlWorkAreaIntervalStat() : total_hash_cnt_(0), total_hash_size_(0), @@ -562,7 +562,7 @@ class ObSqlWorkAreaIntervalStat { total_one_pass_size_(0) {} - public: +public: void reset(); int64_t get_total_hash_cnt() const { @@ -596,7 +596,7 @@ class ObSqlWorkAreaIntervalStat { int analyze_profile(ObSqlWorkAreaProfile& profile, int64_t size, const int64_t one_pass_size, const int64_t max_size, bool is_one_pass = false); - private: +private: int64_t total_hash_cnt_; int64_t total_hash_size_; int64_t total_sort_cnt_; @@ -607,11 +607,11 @@ class ObSqlWorkAreaIntervalStat { }; class ObTenantSqlMemoryCallback : public ObSqlMemoryCallback { - public: +public: ObTenantSqlMemoryCallback() : total_alloc_size_(0), total_dump_size_(0) {} - public: +public: virtual void alloc(int64_t size) override; virtual void free(int64_t size) override; virtual void dumped(int64_t size) override; @@ -630,18 +630,18 @@ class ObTenantSqlMemoryCallback : public ObSqlMemoryCallback { return total_dump_size_; } - private: +private: int64_t total_alloc_size_; int64_t total_dump_size_; }; class ObSqlWorkAreaInterval { - public: +public: ObSqlWorkAreaInterval(int64_t interval_idx, int64_t interval_cache_size) : interval_idx_(interval_idx), interval_cache_size_(interval_cache_size), mem_target_(-1), interval_stat_() {} - public: +public: OB_INLINE int64_t get_interval_idx() const { return interval_idx_; @@ -665,7 +665,7 @@ class ObSqlWorkAreaInterval { mem_target_ = mem_target; } - private: +private: int64_t interval_idx_; int64_t interval_cache_size_; int64_t mem_target_; @@ -673,7 +673,7 @@ class ObSqlWorkAreaInterval { }; class ObWorkareaHistogram { - public: +public: ObWorkareaHistogram(int64_t low_optimal_size, int64_t high_optimal_size) : low_optimal_size_(low_optimal_size), high_optimal_size_(high_optimal_size), @@ -736,7 +736,7 @@ class ObWorkareaHistogram { TO_STRING_KV(K_(low_optimal_size), K_(high_optimal_size)); - private: +private: int64_t low_optimal_size_; int64_t high_optimal_size_; int64_t optimal_executions_; @@ -746,7 +746,7 @@ class ObWorkareaHistogram { }; class ObSqlMemoryList { - public: +public: ObSqlMemoryList(int64_t seqno) : seqno_(seqno) {} ~ObSqlMemoryList() @@ -768,14 +768,14 @@ class ObSqlMemoryList { } TO_STRING_KV(K_(seqno)); - private: +private: int64_t seqno_; ObSpinLock lock_; common::ObDList profile_list_; }; class ObSqlWorkareaCurrentMemoryInfo { - public: +public: ObSqlWorkareaCurrentMemoryInfo() : enable_(false), max_workarea_size_(0), @@ -843,12 +843,12 @@ class ObSqlWorkareaCurrentMemoryInfo { }; class ObTenantSqlMemoryManager { - private: +private: static const int64_t MAX_WORKAREA_STAT_CNT = 1024; - public: +public: class ObSqlWorkAreaCalcInfo { - public: + public: ObSqlWorkAreaCalcInfo() : wa_intervals_(nullptr), profile_cnt_(0), @@ -878,12 +878,12 @@ class ObTenantSqlMemoryManager { return wa_intervals_; } - private: + private: int find_best_interval_index_by_mem_target( int64_t& interval_idx, const int64_t expect_mem_target, const int64_t total_memory_size); int calc_memory_target(int64_t idx, const int64_t pre_mem_target); - private: + private: ObSqlWorkAreaInterval* wa_intervals_; int64_t profile_cnt_; int64_t mem_target_; @@ -892,7 +892,7 @@ class ObTenantSqlMemoryManager { int64_t min_bound_size_; }; - public: +public: ObTenantSqlMemoryManager(int64_t tenant_id) : wa_intervals_(nullptr), min_bound_size_(0), @@ -917,7 +917,7 @@ class ObTenantSqlMemoryManager { ~ObTenantSqlMemoryManager() {} - public: +public: static int mtl_init(ObTenantSqlMemoryManager*& sql_mem_mgr); static void mtl_destroy(ObTenantSqlMemoryManager*& sql_mem_mgr); @@ -990,7 +990,7 @@ class ObTenantSqlMemoryManager { return sql_mem_callback_.get_total_alloc_size(); } - private: +private: OB_INLINE bool need_manual_calc_bound(); OB_INLINE bool need_manual_by_drift(); @@ -1029,7 +1029,7 @@ class ObTenantSqlMemoryManager { return val % HASH_CNT; } - private: +private: int fill_workarea_stat(ObSqlWorkAreaStat& wa_stat, ObSqlWorkAreaProfile& profile); int try_fill_workarea_stat( ObSqlWorkAreaStat::WorkareaKey& workarea_key, ObSqlWorkAreaProfile& profile, bool& need_insert); @@ -1037,7 +1037,7 @@ class ObTenantSqlMemoryManager { int fill_workarea_histogram(ObSqlWorkAreaProfile& profile); int new_and_fill_workarea_stat(ObSqlWorkAreaStat::WorkareaKey& workarea_key, ObSqlWorkAreaProfile& profile); - private: +private: static const int64_t INTERVAL_NUM = 1100; static const int64_t LESS_THAN_100M_INTERVAL_SIZE = 1 * 1024 * 1024; static const int64_t LESS_THAN_100M_CNT = 100; diff --git a/src/sql/engine/pdml/ob_batch_row_cache.h b/src/sql/engine/pdml/ob_batch_row_cache.h index 15a41fa99..a196ef6e8 100644 --- a/src/sql/engine/pdml/ob_batch_row_cache.h +++ b/src/sql/engine/pdml/ob_batch_row_cache.h @@ -29,7 +29,7 @@ class ObExecContext; // Iterator of single partition class ObPDMLRowIterator : public common::ObNewRowIterator { - public: +public: friend class ObBatchRowCache; ObPDMLRowIterator() = default; virtual ~ObPDMLRowIterator() = default; @@ -38,19 +38,19 @@ class ObPDMLRowIterator : public common::ObNewRowIterator { void reset() override {} - private: +private: int init_data_source(sql::ObChunkRowStore& row_store); - private: +private: sql::ObChunkRowStore::Iterator row_store_it_; }; class ObBatchRowCache final { - public: +public: ObBatchRowCache(); ~ObBatchRowCache(); - public: +public: int init(uint64_t tenant_id, int64_t part_cnt, bool with_barrier); // @desc the offset of the partition where the part_id row is located in the location structure // @return if the cache is full, return OB_SIZE_OVERFLOW; if the cache is successful, return OB_SUCCESS; @@ -68,11 +68,11 @@ class ObBatchRowCache final { void reuse(); void destroy(); - private: +private: int init_row_store(common::ObIAllocator& allocator, sql::ObChunkRowStore*& chunk_row_store); int create_new_bucket(int64_t part_id, sql::ObChunkRowStore*& row_store); - private: +private: typedef common::hash::ObHashMap PartitionStoreMap; // HashMap: part_id => chunk_row_store_ ptr // dynamic add row store to map, when meet a new partition @@ -87,17 +87,17 @@ class ObBatchRowCache final { }; class ObDMLDataReader { - public: +public: virtual int read_row(ObExecContext& ctx, const common::ObNewRow*& row, int64_t& part_id) const = 0; }; class ObDMLDataWriter { - public: +public: virtual int write_rows(ObExecContext& ctx, common::ObPartitionKey& pkey, ObPDMLRowIterator& iterator) const = 0; }; class ObDMLRowChecker { - public: +public: // check new row, do null check and constaint check virtual int on_process_new_row(ObExecContext& ctx, const common::ObNewRow& new_row) const = 0; }; diff --git a/src/sql/engine/pdml/ob_pdml_data_driver.h b/src/sql/engine/pdml/ob_pdml_data_driver.h index bee0d2235..8341a02b2 100644 --- a/src/sql/engine/pdml/ob_pdml_data_driver.h +++ b/src/sql/engine/pdml/ob_pdml_data_driver.h @@ -28,7 +28,7 @@ class ObExecContext; class ObDMLTableDesc; class ObPDMLDataDriver { - public: +public: ObPDMLDataDriver(ObMonitorNode& op_monitor_info) : op_monitor_info_(op_monitor_info), returning_ctx_(), @@ -55,7 +55,7 @@ class ObPDMLDataDriver { int destroy(); int get_next_row(ObExecContext& ctx, const common::ObNewRow*& row); - private: +private: int fill_cache_unitl_cache_full_or_child_iter_end(ObExecContext& ctx); inline int try_write_last_pending_row(); int switch_to_returning_state(ObExecContext& ctx); @@ -64,7 +64,7 @@ class ObPDMLDataDriver { int next_row_from_cache(const common::ObNewRow*& row); int write_partitions(ObExecContext& ctx); - private: +private: struct ReturningCtx { ReturningCtx() : next_idx_(0), row_iter_(nullptr) {} @@ -106,7 +106,7 @@ class ObPDMLDataDriver { */ enum DriverState { FILL_CACHE, ROW_RETURNING }; - private: +private: ObMonitorNode& op_monitor_info_; ReturningCtx returning_ctx_; ObBatchRowCache cache_; diff --git a/src/sql/engine/pdml/ob_px_multi_part_delete.h b/src/sql/engine/pdml/ob_px_multi_part_delete.h index fb3f68f89..2e2938d70 100644 --- a/src/sql/engine/pdml/ob_px_multi_part_delete.h +++ b/src/sql/engine/pdml/ob_px_multi_part_delete.h @@ -31,7 +31,7 @@ namespace sql { class ObPxMultiPartDeleteInput : public ObPxModifyInput { OB_UNIS_VERSION_V(1); - public: +public: ObPxMultiPartDeleteInput() = default; virtual ~ObPxMultiPartDeleteInput() = default; virtual inline ObPhyOperatorType get_phy_op_type() const @@ -43,12 +43,12 @@ class ObPxMultiPartDeleteInput : public ObPxModifyInput { class ObPxMultiPartDelete : public ObDMLDataReader, public ObDMLDataWriter, public ObTableModify { OB_UNIS_VERSION(1); - private: +private: class ObPxMultiPartDeleteCtx; /**ObPDMLRowIteratorWrapper**/ class ObPDMLRowIteratorWrapper : public common::ObNewRowIterator { - public: + public: ObPDMLRowIteratorWrapper(ObPxMultiPartDeleteCtx& op_ctx) : op_ctx_(op_ctx), iter_(nullptr), delete_projector_(nullptr), delete_projector_size_(0), delete_row_() {} @@ -72,10 +72,10 @@ class ObPxMultiPartDelete : public ObDMLDataReader, public ObDMLDataWriter, publ void reset() override {} - private: + private: int project_row(const ObNewRow& input_row, ObNewRow& output_row) const; - private: + private: ObPxMultiPartDeleteCtx& op_ctx_; ObPDMLRowIterator* iter_; int32_t* delete_projector_; @@ -84,7 +84,7 @@ class ObPxMultiPartDelete : public ObDMLDataReader, public ObDMLDataWriter, publ }; /**ObPxMultiPartDeleteCtx**/ class ObPxMultiPartDeleteCtx : public ObTableModifyCtx { - public: + public: ObPxMultiPartDeleteCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), data_driver_(op_monitor_info_), row_iter_wrapper_(*this) {} @@ -94,11 +94,11 @@ class ObPxMultiPartDelete : public ObDMLDataReader, public ObDMLDataWriter, publ ObPDMLRowIteratorWrapper row_iter_wrapper_; }; - public: +public: explicit ObPxMultiPartDelete(common::ObIAllocator& alloc); ~ObPxMultiPartDelete(); - public: +public: virtual int create_operator_input(ObExecContext& ctx) const override; virtual bool has_foreign_key() const override { @@ -134,11 +134,11 @@ class ObPxMultiPartDelete : public ObDMLDataReader, public ObDMLDataWriter, publ } int register_to_datahub(ObExecContext& ctx) const override; - private: +private: int fill_dml_base_param(uint64_t index_tid, ObSQLSessionInfo& my_session, const ObPhysicalPlan& my_phy_plan, const ObPhysicalPlanCtx& my_plan_ctx, storage::ObDMLBaseParam& dml_param) const; - private: +private: ObDMLRowDesc row_desc_; ObDMLTableDesc table_desc_; int32_t* delete_projector_; diff --git a/src/sql/engine/pdml/ob_px_multi_part_insert.h b/src/sql/engine/pdml/ob_px_multi_part_insert.h index 7cf0d822e..034e23f9d 100644 --- a/src/sql/engine/pdml/ob_px_multi_part_insert.h +++ b/src/sql/engine/pdml/ob_px_multi_part_insert.h @@ -26,7 +26,7 @@ namespace sql { class ObPxMultiPartInsertInput : public ObPxModifyInput { OB_UNIS_VERSION_V(1); - public: +public: virtual inline ObPhyOperatorType get_phy_op_type() const { return PHY_PX_MULTI_PART_INSERT; @@ -37,10 +37,10 @@ class ObTableLocation; class ObPxMultiPartInsert : public ObDMLDataReader, public ObDMLDataWriter, public ObTableModify { OB_UNIS_VERSION(1); - private: +private: class ObPxMultiPartInsertCtx; class ObPDMLRowIteratorWrapper : public common::ObNewRowIterator { - public: + public: ObPDMLRowIteratorWrapper(ObPxMultiPartInsertCtx& op_ctx) : op_ctx_(op_ctx), iter_(nullptr), insert_projector_(nullptr), insert_projector_size_(0), insert_row_() {} @@ -60,10 +60,10 @@ class ObPxMultiPartInsert : public ObDMLDataReader, public ObDMLDataWriter, publ void reset() override {} - private: + private: int project_row(const ObNewRow& input_row, ObNewRow& output_row) const; - private: + private: ObPxMultiPartInsertCtx& op_ctx_; ObPDMLRowIterator* iter_; int32_t* insert_projector_; @@ -71,7 +71,7 @@ class ObPxMultiPartInsert : public ObDMLDataReader, public ObDMLDataWriter, publ common::ObNewRow insert_row_; }; class ObPxMultiPartInsertCtx : public ObTableModifyCtx { - public: + public: explicit ObPxMultiPartInsertCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), data_driver_(op_monitor_info_), row_iter_wrapper_(*this) {} @@ -84,7 +84,7 @@ class ObPxMultiPartInsert : public ObDMLDataReader, public ObDMLDataWriter, publ ObPDMLRowIteratorWrapper row_iter_wrapper_; }; - public: +public: explicit ObPxMultiPartInsert(common::ObIAllocator& alloc); virtual ~ObPxMultiPartInsert(); @@ -120,12 +120,12 @@ class ObPxMultiPartInsert : public ObDMLDataReader, public ObDMLDataWriter, publ with_barrier_ = w; } - private: +private: int fill_dml_base_param(uint64_t index_tid, ObSQLSessionInfo& my_session, const ObPhysicalPlan& my_phy_plan, const ObPhysicalPlanCtx& my_plan_ctx, storage::ObDMLBaseParam& dml_param) const; int process_row(ObExecContext& ctx, ObPxMultiPartInsertCtx* insert_ctx, const ObNewRow*& insert_row) const; - private: +private: ObDMLRowDesc row_desc_; ObDMLTableDesc table_desc_; int32_t* insert_projector_; diff --git a/src/sql/engine/pdml/ob_px_multi_part_modify.h b/src/sql/engine/pdml/ob_px_multi_part_modify.h index 64b44812e..ceb974fb7 100644 --- a/src/sql/engine/pdml/ob_px_multi_part_modify.h +++ b/src/sql/engine/pdml/ob_px_multi_part_modify.h @@ -25,7 +25,7 @@ namespace sql { class ObDMLTableDesc { OB_UNIS_VERSION(1); - public: +public: ObDMLTableDesc() : index_tid_(common::OB_INVALID_ID), partition_cnt_(-1) {} ~ObDMLTableDesc() = default; @@ -35,7 +35,7 @@ class ObDMLTableDesc { } TO_STRING_KV(K_(index_tid), K_(partition_cnt)); - public: +public: // index table's physical table_id uint64_t index_tid_; // partition counts recorded in schema @@ -45,7 +45,7 @@ class ObDMLTableDesc { class ObDMLRowDesc { OB_UNIS_VERSION(1); - public: +public: ObDMLRowDesc() : part_id_index_(common::OB_INVALID_INDEX_INT64) {} ~ObDMLRowDesc() = default; @@ -65,14 +65,14 @@ class ObDMLRowDesc { TO_STRING_KV(K_(part_id_index)); - private: +private: int64_t part_id_index_; }; class ObPxModifyInput : public ObIPhyOperatorInput { OB_UNIS_VERSION_V(1); - public: +public: ObPxModifyInput() : task_id_(common::OB_INVALID_ID), sqc_id_(common::OB_INVALID_ID), dfo_id_(common::OB_INVALID_ID) {} virtual ~ObPxModifyInput() = default; @@ -105,7 +105,7 @@ class ObPxModifyInput : public ObIPhyOperatorInput { return dfo_id_; } - protected: +protected: int64_t task_id_; int64_t sqc_id_; int64_t dfo_id_; diff --git a/src/sql/engine/pdml/ob_px_multi_part_update.h b/src/sql/engine/pdml/ob_px_multi_part_update.h index 47ab64b74..afb1bd49a 100644 --- a/src/sql/engine/pdml/ob_px_multi_part_update.h +++ b/src/sql/engine/pdml/ob_px_multi_part_update.h @@ -31,7 +31,7 @@ namespace sql { class ObPxMultiPartUpdateInput : public ObPxModifyInput { OB_UNIS_VERSION_V(1); - public: +public: virtual inline ObPhyOperatorType get_phy_op_type() const { return PHY_PX_MULTI_PART_UPDATE; @@ -44,11 +44,11 @@ class ObPxMultiPartUpdate : public ObDMLDataReader, public ObDMLRowChecker { OB_UNIS_VERSION(1); - public: - private: +public: +private: class ObPxMultiPartUpdateCtx; class ObPDMLRowIteratorWrapper : public common::ObNewRowIterator { - public: + public: ObPDMLRowIteratorWrapper(ObPxMultiPartUpdateCtx& op_ctx) : op_ctx_(op_ctx), iter_(nullptr), @@ -81,10 +81,10 @@ class ObPxMultiPartUpdate : public ObDMLDataReader, void reset() override {} - private: + private: int project_old_and_new_row(const ObNewRow& full_row, ObNewRow& old_row, ObNewRow& new_row) const; - private: + private: ObPxMultiPartUpdateCtx& op_ctx_; ObPDMLRowIterator* iter_; int32_t* old_projector_; @@ -102,7 +102,7 @@ class ObPxMultiPartUpdate : public ObDMLDataReader, }; class ObPxMultiPartUpdateCtx : public ObTableModifyCtx { - public: + public: ObPxMultiPartUpdateCtx(ObExecContext& ctx) : ObTableModifyCtx(ctx), data_driver_(op_monitor_info_), row_iter_wrapper_(*this) {} @@ -116,11 +116,11 @@ class ObPxMultiPartUpdate : public ObDMLDataReader, ObPDMLRowIteratorWrapper row_iter_wrapper_; }; - public: +public: explicit ObPxMultiPartUpdate(common::ObIAllocator& alloc); ~ObPxMultiPartUpdate(); - public: +public: virtual int create_operator_input(ObExecContext& ctx) const override; virtual bool is_pdml_operator() const { @@ -158,12 +158,12 @@ class ObPxMultiPartUpdate : public ObDMLDataReader, return table_desc_; } - private: +private: int fill_dml_base_param(uint64_t index_tid, ObSQLSessionInfo& my_session, const ObPhysicalPlan& my_phy_plan, const ObPhysicalPlanCtx& my_plan_ctx, storage::ObDMLBaseParam& dml_param) const; int on_process_new_row(ObExecContext& ctx, const common::ObNewRow& new_row) const; - private: +private: /* functions */ /* variables */ diff --git a/src/sql/engine/pdml/static/ob_pdml_op_batch_row_cache.h b/src/sql/engine/pdml/static/ob_pdml_op_batch_row_cache.h index c9f1e6b64..5e340395a 100644 --- a/src/sql/engine/pdml/static/ob_pdml_op_batch_row_cache.h +++ b/src/sql/engine/pdml/static/ob_pdml_op_batch_row_cache.h @@ -27,17 +27,17 @@ class ObExecContext; // row cache for one partition class ObPDMLOpRowIterator { - public: +public: friend class ObPDMLOpBatchRowCache; ObPDMLOpRowIterator() = default; virtual ~ObPDMLOpRowIterator() = default; // get next row of row_store_it_ int get_next_row(const ObExprPtrIArray& row); - private: +private: int init_data_source(ObChunkDatumStore& row_datum_store, ObEvalCtx* eval_ctx); - private: +private: ObChunkDatumStore::Iterator row_store_it_; ObEvalCtx* eval_ctx_; DISALLOW_COPY_AND_ASSIGN(ObPDMLOpRowIterator); @@ -46,11 +46,11 @@ class ObPDMLOpRowIterator { // PDML row cache // cache rows for partitions class ObPDMLOpBatchRowCache final { - public: +public: explicit ObPDMLOpBatchRowCache(ObEvalCtx* eval_ctx); ~ObPDMLOpBatchRowCache(); - public: +public: int init(uint64_t tenant_id, int64_t part_cnt, bool with_barrier); int add_row(const ObExprPtrIArray& row, int64_t part_id); @@ -67,11 +67,11 @@ class ObPDMLOpBatchRowCache final { void reuse(); void destroy(); - private: +private: int init_row_store(common::ObIAllocator& allocator, ObChunkDatumStore*& chunk_row_store); int create_new_bucket(int64_t part_id, ObChunkDatumStore*& row_store); - private: +private: typedef common::hash::ObHashMap PartitionStoreMap; // HashMap: part_id => chunk_datum_store_ ptr // dynamic add row store to map, when meet a new partition @@ -86,13 +86,13 @@ class ObPDMLOpBatchRowCache final { }; class ObDMLOpDataReader { - public: +public: // read one row from DML operator and get part_id virtual int read_row(ObExecContext& ctx, const ObExprPtrIArray*& row, int64_t& part_id) = 0; }; class ObDMLOpDataWriter { - public: +public: // write rows to storage virtual int write_rows(ObExecContext& ctx, common::ObPartitionKey& pkey, ObPDMLOpRowIterator& iterator) = 0; }; diff --git a/src/sql/engine/pdml/static/ob_pdml_op_data_driver.h b/src/sql/engine/pdml/static/ob_pdml_op_data_driver.h index cf74fb20d..9ac72bd93 100644 --- a/src/sql/engine/pdml/static/ob_pdml_op_data_driver.h +++ b/src/sql/engine/pdml/static/ob_pdml_op_data_driver.h @@ -29,7 +29,7 @@ class ObDMLOpTableDesc; // The core classes that operate ObBatchRowCache and the storage layer class ObPDMLOpDataDriver { - public: +public: ObPDMLOpDataDriver(ObEvalCtx* eval_ctx, ObIAllocator& allocator, ObMonitorNode& op_monitor_info) : returning_ctx_(), op_monitor_info_(op_monitor_info), @@ -57,7 +57,7 @@ class ObPDMLOpDataDriver { int get_next_row(ObExecContext& ctx, const ObExprPtrIArray& row); - private: +private: int fill_cache_unitl_cache_full_or_child_iter_end(ObExecContext& ctx); inline int try_write_last_pending_row(); int switch_to_returning_state(ObExecContext& ctx); @@ -66,7 +66,7 @@ class ObPDMLOpDataDriver { int next_row_from_cache(const ObExprPtrIArray& row); int write_partitions(ObExecContext& ctx); - private: +private: // Because the data of multiple partitions will be cached in the cache, it is necessary in the process of iteration // Record the current status of which partition it is iterated to, which row in the partition it is iterated to, etc. // So, introduce ReturningCtx @@ -122,7 +122,7 @@ class ObPDMLOpDataDriver { and automatically switch to the state of filling cache after all rows are returned*/ }; - private: +private: ReturningCtx returning_ctx_; ObMonitorNode& op_monitor_info_; ObPDMLOpBatchRowCache cache_; // cache data diff --git a/src/sql/engine/pdml/static/ob_px_multi_part_delete_op.h b/src/sql/engine/pdml/static/ob_px_multi_part_delete_op.h index 1cd1f16f0..7e6c53e2f 100644 --- a/src/sql/engine/pdml/static/ob_px_multi_part_delete_op.h +++ b/src/sql/engine/pdml/static/ob_px_multi_part_delete_op.h @@ -31,7 +31,7 @@ namespace sql { class ObPxMultiPartDeleteOpInput : public ObPxMultiPartModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObPxMultiPartDeleteOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxMultiPartModifyOpInput(ctx, spec) {} int init(ObTaskInfo& task_info) override @@ -39,14 +39,14 @@ class ObPxMultiPartDeleteOpInput : public ObPxMultiPartModifyOpInput { return ObPxMultiPartModifyOpInput::init(task_info); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPxMultiPartDeleteOpInput); }; class ObPxMultiPartDeleteSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxMultiPartDeleteSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableModifySpec(alloc, type), row_desc_(), table_desc_(), delete_row_exprs_(&alloc), with_barrier_(false) {} @@ -60,7 +60,7 @@ class ObPxMultiPartDeleteSpec : public ObTableModifySpec { } int register_to_datahub(ObExecContext& ctx) const override; - public: +public: ObDMLOpRowDesc row_desc_; ObDMLOpTableDesc table_desc_; ExprFixedArray delete_row_exprs_; @@ -76,10 +76,10 @@ class ObPxMultiPartDeleteSpec : public ObTableModifySpec { class ObPxMultiPartDeleteOp : public ObDMLOpDataReader, public ObDMLOpDataWriter, public ObTableModifyOp { OB_UNIS_VERSION(1); - public: +public: /**ObPDMLOpRowIteratorWrapper**/ class ObPDMLOpRowIteratorWrapper : public common::ObNewRowIterator { - public: + public: ObPDMLOpRowIteratorWrapper(ObExecContext& exec_ctx, ObPxMultiPartDeleteOp* op) : ctx_(exec_ctx), iter_(nullptr), delete_row_(), read_row_from_iter_(NULL), delete_row_exprs_(NULL), op_(op) {} @@ -99,7 +99,7 @@ class ObPxMultiPartDeleteOp : public ObDMLOpDataReader, public ObDMLOpDataWriter } int get_next_row(common::ObNewRow*& row) override; - private: + private: ObExecContext& ctx_; ObPDMLOpRowIterator* iter_; common::ObNewRow delete_row_; @@ -108,14 +108,14 @@ class ObPxMultiPartDeleteOp : public ObDMLOpDataReader, public ObDMLOpDataWriter ObPxMultiPartDeleteOp* op_; }; - public: +public: ObPxMultiPartDeleteOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableModifyOp(exec_ctx, spec, input), data_driver_(exec_ctx.get_eval_ctx(), exec_ctx.get_allocator(), op_monitor_info_), row_iter_wrapper_(exec_ctx, this) {} - public: +public: virtual bool has_foreign_key() const { return false; @@ -131,11 +131,11 @@ class ObPxMultiPartDeleteOp : public ObDMLOpDataReader, public ObDMLOpDataWriter virtual int inner_open(); virtual int inner_close(); - private: +private: int fill_dml_base_param(uint64_t index_tid, ObSQLSessionInfo& my_session, const ObPhysicalPlan& my_phy_plan, const ObPhysicalPlanCtx& my_plan_ctx, storage::ObDMLBaseParam& dml_param) const; - private: +private: ObPDMLOpDataDriver data_driver_; // Used to calc the child output row and return the row required by the DML operation ObPDMLOpRowIteratorWrapper row_iter_wrapper_; diff --git a/src/sql/engine/pdml/static/ob_px_multi_part_insert_op.h b/src/sql/engine/pdml/static/ob_px_multi_part_insert_op.h index 58f45b2ec..3cab258d2 100644 --- a/src/sql/engine/pdml/static/ob_px_multi_part_insert_op.h +++ b/src/sql/engine/pdml/static/ob_px_multi_part_insert_op.h @@ -24,7 +24,7 @@ namespace sql { class ObPxMultiPartInsertOpInput : public ObPxMultiPartModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObPxMultiPartInsertOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxMultiPartModifyOpInput(ctx, spec) {} int init(ObTaskInfo& task_info) override @@ -32,14 +32,14 @@ class ObPxMultiPartInsertOpInput : public ObPxMultiPartModifyOpInput { return ObPxMultiPartModifyOpInput::init(task_info); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPxMultiPartInsertOpInput); }; class ObPxMultiPartInsertSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxMultiPartInsertSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableModifySpec(alloc, type), row_desc_(), table_desc_(), insert_row_exprs_(&alloc) {} @@ -48,7 +48,7 @@ class ObPxMultiPartInsertSpec : public ObTableModifySpec { return true; } - public: +public: ObDMLOpRowDesc row_desc_; ObDMLOpTableDesc table_desc_; ExprFixedArray insert_row_exprs_; @@ -58,10 +58,10 @@ class ObPxMultiPartInsertSpec : public ObTableModifySpec { class ObPxMultiPartInsertOp : public ObDMLOpDataReader, public ObDMLOpDataWriter, public ObTableModifyOp { OB_UNIS_VERSION(1); - public: +public: /**ObPDMLOpRowIteratorWrapper**/ class ObPDMLOpRowIteratorWrapper : public common::ObNewRowIterator { - public: + public: ObPDMLOpRowIteratorWrapper(ObExecContext& exec_ctx, ObPxMultiPartInsertOp* op) : ctx_(exec_ctx), iter_(nullptr), insert_row_(), read_row_from_iter_(NULL), insert_row_exprs_(NULL), op_(op) {} @@ -81,7 +81,7 @@ class ObPxMultiPartInsertOp : public ObDMLOpDataReader, public ObDMLOpDataWriter } int get_next_row(common::ObNewRow*& row) override; - private: + private: ObExecContext& ctx_; ObPDMLOpRowIterator* iter_; common::ObNewRow insert_row_; @@ -90,14 +90,14 @@ class ObPxMultiPartInsertOp : public ObDMLOpDataReader, public ObDMLOpDataWriter ObPxMultiPartInsertOp* op_; }; - public: +public: ObPxMultiPartInsertOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableModifyOp(exec_ctx, spec, input), data_driver_(exec_ctx.get_eval_ctx(), exec_ctx.get_allocator(), op_monitor_info_), row_iter_wrapper_(exec_ctx, this) {} - public: +public: virtual bool has_foreign_key() const { return false; @@ -111,13 +111,13 @@ class ObPxMultiPartInsertOp : public ObDMLOpDataReader, public ObDMLOpDataWriter virtual int inner_open(); virtual int inner_close(); - private: +private: int fill_dml_base_param(uint64_t index_tid, ObSQLSessionInfo& my_session, const ObPhysicalPlan& my_phy_plan, const ObPhysicalPlanCtx& my_plan_ctx, storage::ObDMLBaseParam& dml_param) const; int process_row(); - private: +private: ObPDMLOpDataDriver data_driver_; // Used to calc the child output row and return the row required by the DML operation ObPDMLOpRowIteratorWrapper row_iter_wrapper_; diff --git a/src/sql/engine/pdml/static/ob_px_multi_part_modify_op.h b/src/sql/engine/pdml/static/ob_px_multi_part_modify_op.h index 51826a7a0..9bb6d0407 100644 --- a/src/sql/engine/pdml/static/ob_px_multi_part_modify_op.h +++ b/src/sql/engine/pdml/static/ob_px_multi_part_modify_op.h @@ -21,7 +21,7 @@ namespace sql { class ObDMLOpTableDesc { OB_UNIS_VERSION(1); - public: +public: ObDMLOpTableDesc() : index_tid_(common::OB_INVALID_ID), partition_cnt_(-1) {} ~ObDMLOpTableDesc() = default; @@ -31,7 +31,7 @@ class ObDMLOpTableDesc { } TO_STRING_KV(K_(index_tid), K_(partition_cnt)); - public: +public: // phy table/index id uint64_t index_tid_; int64_t partition_cnt_; @@ -40,7 +40,7 @@ class ObDMLOpTableDesc { class ObDMLOpRowDesc { OB_UNIS_VERSION(1); - public: +public: ObDMLOpRowDesc() : part_id_index_(common::OB_INVALID_INDEX_INT64) {} ~ObDMLOpRowDesc() = default; @@ -60,7 +60,7 @@ class ObDMLOpRowDesc { TO_STRING_KV(K_(part_id_index)); - private: +private: // part id offset in input row with pseodu column int64_t part_id_index_; }; @@ -68,7 +68,7 @@ class ObDMLOpRowDesc { class ObPxMultiPartModifyOpInput : public ObOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObPxMultiPartModifyOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObOpInput(ctx, spec) {} virtual int init(ObTaskInfo& task_info) override @@ -103,7 +103,7 @@ class ObPxMultiPartModifyOpInput : public ObOpInput { return dfo_id_; } - protected: +protected: int64_t task_id_; int64_t sqc_id_; int64_t dfo_id_; diff --git a/src/sql/engine/pdml/static/ob_px_multi_part_update_op.h b/src/sql/engine/pdml/static/ob_px_multi_part_update_op.h index dbe40e108..d38c25526 100644 --- a/src/sql/engine/pdml/static/ob_px_multi_part_update_op.h +++ b/src/sql/engine/pdml/static/ob_px_multi_part_update_op.h @@ -22,7 +22,7 @@ namespace sql { class ObPxMultiPartUpdateOpInput : public ObPxMultiPartModifyOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObPxMultiPartUpdateOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxMultiPartModifyOpInput(ctx, spec) {} int init(ObTaskInfo& task_info) override @@ -30,14 +30,14 @@ class ObPxMultiPartUpdateOpInput : public ObPxMultiPartModifyOpInput { return ObPxMultiPartModifyOpInput::init(task_info); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPxMultiPartUpdateOpInput); }; class ObPxMultiPartUpdateSpec : public ObTableModifySpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxMultiPartUpdateSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableModifySpec(alloc, type), row_desc_(), @@ -63,7 +63,7 @@ class ObPxMultiPartUpdateSpec : public ObTableModifySpec { return true; } - public: +public: ObDMLOpRowDesc row_desc_; ObDMLOpTableDesc table_desc_; common::ObFixedArray updated_column_ids_; @@ -76,10 +76,10 @@ class ObPxMultiPartUpdateSpec : public ObTableModifySpec { class ObPxMultiPartUpdateOp : public ObDMLOpDataReader, public ObDMLOpDataWriter, public ObTableModifyOp { OB_UNIS_VERSION(1); - public: +public: /**ObPDMLOpRowIteratorWrapper**/ class ObPDMLOpRowIteratorWrapper : public common::ObNewRowIterator { - public: + public: ObPDMLOpRowIteratorWrapper(common::ObPartitionKey& pkey, storage::ObDMLBaseParam& dml_param, ObPDMLOpRowIterator& iter, ObPxMultiPartUpdateOp& op) : pkey_(pkey), dml_param_(dml_param), iter_(iter), op_(op) @@ -90,14 +90,14 @@ class ObPxMultiPartUpdateOp : public ObDMLOpDataReader, public ObDMLOpDataWriter {} int get_next_row(common::ObNewRow*& row) override; - private: + private: common::ObPartitionKey& pkey_; storage::ObDMLBaseParam& dml_param_; ObPDMLOpRowIterator& iter_; ObPxMultiPartUpdateOp& op_; }; - public: +public: ObPxMultiPartUpdateOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableModifyOp(exec_ctx, spec, input), data_driver_(exec_ctx.get_eval_ctx(), exec_ctx.get_allocator(), op_monitor_info_), @@ -110,7 +110,7 @@ class ObPxMultiPartUpdateOp : public ObDMLOpDataReader, public ObDMLOpDataWriter {} virtual ~ObPxMultiPartUpdateOp() = default; - public: +public: virtual bool has_foreign_key() const { return false; @@ -145,12 +145,12 @@ class ObPxMultiPartUpdateOp : public ObDMLOpDataReader, public ObDMLOpDataWriter return found_rows_; } - private: +private: int fill_dml_base_param(uint64_t index_tid, ObSQLSessionInfo& my_session, const ObPhysicalPlan& my_phy_plan, const ObPhysicalPlanCtx& my_plan_ctx, storage::ObDMLBaseParam& dml_param) const; int process_row(); - private: +private: ObPDMLOpDataDriver data_driver_; bool has_got_old_row_; int64_t found_rows_; diff --git a/src/sql/engine/prepare/ob_deallocate_executor.h b/src/sql/engine/prepare/ob_deallocate_executor.h index d50fbbc69..085a117c4 100644 --- a/src/sql/engine/prepare/ob_deallocate_executor.h +++ b/src/sql/engine/prepare/ob_deallocate_executor.h @@ -23,14 +23,14 @@ class ObExecContext; class ObDeallocateStmt; class ObDeallocateExecutor { - public: +public: ObDeallocateExecutor() {} virtual ~ObDeallocateExecutor() {} int execute(ObExecContext& ctx, ObDeallocateStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDeallocateExecutor); }; diff --git a/src/sql/engine/prepare/ob_execute_executor.h b/src/sql/engine/prepare/ob_execute_executor.h index eaaa407fe..5836d866d 100644 --- a/src/sql/engine/prepare/ob_execute_executor.h +++ b/src/sql/engine/prepare/ob_execute_executor.h @@ -23,14 +23,14 @@ class ObExecContext; class ObExecuteStmt; class ObExecuteExecutor { - public: +public: ObExecuteExecutor() {} virtual ~ObExecuteExecutor() {} int execute(ObExecContext& ctx, ObExecuteStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExecuteExecutor); }; diff --git a/src/sql/engine/prepare/ob_prepare_executor.h b/src/sql/engine/prepare/ob_prepare_executor.h index cf96a7489..91613714f 100644 --- a/src/sql/engine/prepare/ob_prepare_executor.h +++ b/src/sql/engine/prepare/ob_prepare_executor.h @@ -23,14 +23,14 @@ class ObExecContext; class ObPrepareStmt; class ObPrepareExecutor { - public: +public: ObPrepareExecutor() {} virtual ~ObPrepareExecutor() {} int execute(ObExecContext& ctx, ObPrepareStmt& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPrepareExecutor); }; diff --git a/src/sql/engine/px/datahub/components/ob_dh_barrier.h b/src/sql/engine/px/datahub/components/ob_dh_barrier.h index e8f5aa33c..8005d4bef 100644 --- a/src/sql/engine/px/datahub/components/ob_dh_barrier.h +++ b/src/sql/engine/px/datahub/components/ob_dh_barrier.h @@ -34,18 +34,18 @@ class ObBarrierPieceMsg : public ObDatahubPieceMsg, K_(op_id)); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObBarrierPieceMsg); @@ -54,10 +54,10 @@ class ObBarrierPieceMsg : public ObDatahubPieceMsg { OB_UNIS_VERSION_V(1); - public: +public: using WholeMsgProvider = ObWholeMsgProvider; - public: +public: ObBarrierWholeMsg() : ready_state_(0) {} ~ObBarrierWholeMsg() = default; @@ -75,7 +75,7 @@ class ObBarrierWholeMsg : public ObDatahubWholeMsg& sqcs, const ObBarrierPieceMsg& pkt); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObBarrierPieceMsgListener); diff --git a/src/sql/engine/px/datahub/components/ob_dh_winbuf.h b/src/sql/engine/px/datahub/components/ob_dh_winbuf.h index c319a3f82..f4c502aae 100644 --- a/src/sql/engine/px/datahub/components/ob_dh_winbuf.h +++ b/src/sql/engine/px/datahub/components/ob_dh_winbuf.h @@ -35,11 +35,11 @@ class ObWinbufPieceMsg : public ObDatahubPieceMsg, K_(op_id)); - public: +public: /* functions */ /* variables */ @@ -73,10 +73,10 @@ class ObWinbufPieceMsg : public ObDatahubPieceMsg { OB_UNIS_VERSION_V(1); - public: +public: using WholeMsgProvider = ObWholeMsgProvider; - public: +public: ObWinbufWholeMsg() : ready_state_(0), is_empty_(true), is_datum_(false), row_store_(), datum_store_(), assign_allocator_() {} @@ -100,7 +100,7 @@ class ObWinbufWholeMsg : public ObDatahubWholeMsg& sqcs, const ObWinbufPieceMsg& pkt); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObWinbufPieceMsgListener); diff --git a/src/sql/engine/px/datahub/ob_dh_dtl_proc.h b/src/sql/engine/px/datahub/ob_dh_dtl_proc.h index a4d943772..2efc88b9b 100644 --- a/src/sql/engine/px/datahub/ob_dh_dtl_proc.h +++ b/src/sql/engine/px/datahub/ob_dh_dtl_proc.h @@ -28,7 +28,7 @@ class ObIPxCoordMsgProc; template class ObPieceMsgP : public dtl::ObDtlPacketProc { - public: +public: ObPieceMsgP(ObExecContext& ctx, ObIPxCoordMsgProc& msg_proc) : ctx_(ctx), msg_proc_(msg_proc) {} virtual ~ObPieceMsgP() = default; @@ -37,7 +37,7 @@ class ObPieceMsgP : public dtl::ObDtlPacketProc { return msg_proc_.on_piece_msg(ctx_, pkt); } - private: +private: ObExecContext& ctx_; ObIPxCoordMsgProc& msg_proc_; }; @@ -45,7 +45,7 @@ class ObPieceMsgP : public dtl::ObDtlPacketProc { //////////////////////////// FOR SQC //////////////////////////// template class ObWholeMsgP : public dtl::ObDtlPacketProc { - public: +public: ObWholeMsgP(ObIPxSubCoordMsgProc& msg_proc) : msg_proc_(msg_proc) {} virtual ~ObWholeMsgP() = default; @@ -54,7 +54,7 @@ class ObWholeMsgP : public dtl::ObDtlPacketProc { return msg_proc_.on_whole_msg(pkt); } - private: +private: ObIPxSubCoordMsgProc& msg_proc_; }; diff --git a/src/sql/engine/px/datahub/ob_dh_msg.h b/src/sql/engine/px/datahub/ob_dh_msg.h index 7abca6417..618268fdd 100644 --- a/src/sql/engine/px/datahub/ob_dh_msg.h +++ b/src/sql/engine/px/datahub/ob_dh_msg.h @@ -24,7 +24,7 @@ template class ObDatahubPieceMsg : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: ObDatahubPieceMsg() : op_id_(common::OB_INVALID_ID), dfo_id_(common::OB_INVALID_ID), thread_id_(0) {} virtual ~ObDatahubPieceMsg() = default; @@ -38,7 +38,7 @@ template class ObDatahubWholeMsg : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: ObDatahubWholeMsg() : op_id_(common::OB_INVALID_ID) {} virtual ~ObDatahubWholeMsg() = default; diff --git a/src/sql/engine/px/datahub/ob_dh_msg_ctx.h b/src/sql/engine/px/datahub/ob_dh_msg_ctx.h index 50a6acda8..ee435b2e8 100644 --- a/src/sql/engine/px/datahub/ob_dh_msg_ctx.h +++ b/src/sql/engine/px/datahub/ob_dh_msg_ctx.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObPieceMsgCtx { - public: +public: ObPieceMsgCtx(uint64_t op_id, int64_t task_cnt, int64_t timeout_ts) : op_id_(op_id), task_cnt_(task_cnt), timeout_ts_(timeout_ts) {} @@ -30,7 +30,7 @@ class ObPieceMsgCtx { }; class ObPieceMsgCtxMgr { - public: +public: ObPieceMsgCtxMgr() = default; ~ObPieceMsgCtxMgr() = default; void reset() @@ -55,7 +55,7 @@ class ObPieceMsgCtxMgr { return ctxs_.push_back(ctx); } - private: +private: common::ObSEArray ctxs_; }; diff --git a/src/sql/engine/px/datahub/ob_dh_msg_provider.h b/src/sql/engine/px/datahub/ob_dh_msg_provider.h index 3eeb0eb6d..847d33c23 100644 --- a/src/sql/engine/px/datahub/ob_dh_msg_provider.h +++ b/src/sql/engine/px/datahub/ob_dh_msg_provider.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObPxDatahubDataProvider { - public: +public: virtual int get_msg_nonblock(const dtl::ObDtlMsg*& msg, int64_t timeout_ts) = 0; virtual void reset() {} @@ -31,7 +31,7 @@ class ObPxDatahubDataProvider { template class ObWholeMsgProvider : public ObPxDatahubDataProvider { - public: +public: ObWholeMsgProvider() : msg_set_(false) {} virtual ~ObWholeMsgProvider() = default; @@ -63,7 +63,7 @@ class ObWholeMsgProvider : public ObPxDatahubDataProvider { } TO_STRING_KV(K_(msg_set), K_(msg)); - private: +private: int check_status(int64_t timeout_ts) { int ret = common::OB_SUCCESS; @@ -79,7 +79,7 @@ class ObWholeMsgProvider : public ObPxDatahubDataProvider { return ret; } - private: +private: bool msg_set_; T msg_; common::ObThreadCond msg_ready_cond_; diff --git a/src/sql/engine/px/exchange/ob_px_dist_transmit.h b/src/sql/engine/px/exchange/ob_px_dist_transmit.h index c3dcbe5c8..5b80f7fdb 100644 --- a/src/sql/engine/px/exchange/ob_px_dist_transmit.h +++ b/src/sql/engine/px/exchange/ob_px_dist_transmit.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObPxDistTransmitInput : public ObPxTransmitInput { - public: +public: OB_UNIS_VERSION_V(1); virtual ObPhyOperatorType get_phy_op_type() const @@ -28,7 +28,7 @@ class ObPxDistTransmitInput : public ObPxTransmitInput { }; class ObPxDistTransmit : public ObPxTransmit { - public: +public: ObPxDistTransmit(common::ObIAllocator& alloc) : ObPxTransmit(alloc) {} virtual ~ObPxDistTransmit() = default; @@ -39,7 +39,7 @@ class ObPxDistTransmit : public ObPxTransmit { virtual int init_op_ctx(ObExecContext& ctx) const override; virtual int create_operator_input(ObExecContext& ctx) const override; - private: +private: int do_hash_dist(ObExecContext& ctx, ObPxTransmitCtx& op_ctx) const; int do_bc2host_dist(ObExecContext& ctx, ObPxTransmitCtx& op_ctx) const; int do_random_dist(ObExecContext& ctx, ObPxTransmitCtx& op_ctx) const; diff --git a/src/sql/engine/px/exchange/ob_px_dist_transmit_op.h b/src/sql/engine/px/exchange/ob_px_dist_transmit_op.h index 92f212fe7..aae38b47a 100644 --- a/src/sql/engine/px/exchange/ob_px_dist_transmit_op.h +++ b/src/sql/engine/px/exchange/ob_px_dist_transmit_op.h @@ -21,7 +21,7 @@ namespace sql { class ObPxDistTransmitOpInput : public ObPxTransmitOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObPxDistTransmitOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxTransmitOpInput(ctx, spec) {} virtual ~ObPxDistTransmitOpInput() @@ -31,7 +31,7 @@ class ObPxDistTransmitOpInput : public ObPxTransmitOpInput { class ObPxDistTransmitSpec : public ObPxTransmitSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxDistTransmitSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObPxTransmitSpec(alloc, type), dist_exprs_(alloc), dist_hash_funcs_(alloc) {} @@ -42,14 +42,14 @@ class ObPxDistTransmitSpec : public ObPxTransmitSpec { }; class ObPxDistTransmitOp : public ObPxTransmitOp { - public: +public: ObPxDistTransmitOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObPxTransmitOp(exec_ctx, spec, input) {} virtual ~ObPxDistTransmitOp() {} - public: +public: virtual int inner_open() override; virtual int rescan() override { @@ -63,7 +63,7 @@ class ObPxDistTransmitOp : public ObPxTransmitOp { virtual int do_transmit() override; - private: +private: int do_hash_dist(); int do_bc2host_dist(); int do_random_dist(); diff --git a/src/sql/engine/px/exchange/ob_px_fifo_coord_op.h b/src/sql/engine/px/exchange/ob_px_fifo_coord_op.h index 23723ba50..bb081a831 100644 --- a/src/sql/engine/px/exchange/ob_px_fifo_coord_op.h +++ b/src/sql/engine/px/exchange/ob_px_fifo_coord_op.h @@ -31,10 +31,10 @@ namespace oceanbase { namespace sql { class ObPxFifoCoordOpInput : public ObPxReceiveOpInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxFifoCoordOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxReceiveOpInput(ctx, spec) {} virtual ~ObPxFifoCoordOpInput() @@ -44,7 +44,7 @@ class ObPxFifoCoordOpInput : public ObPxReceiveOpInput { class ObPxFifoCoordSpec : public ObPxCoordSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxFifoCoordSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObPxCoordSpec(alloc, type) {} ~ObPxFifoCoordSpec() @@ -52,21 +52,21 @@ class ObPxFifoCoordSpec : public ObPxCoordSpec { }; class ObPxFifoCoordOp : public ObPxCoordOp { - public: +public: ObPxFifoCoordOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObPxFifoCoordOp() {} - public: +public: class ObPxFifoCoordOpEventListener : public ObIPxCoordEventListener { - public: + public: virtual int on_root_data_channel_setup() { return common::OB_SUCCESS; } }; - public: +public: virtual int inner_open() override; virtual void destroy() override { @@ -85,11 +85,11 @@ class ObPxFifoCoordOp : public ObPxCoordOp { return listener_; } - private: +private: int next_row(bool& wait_next_msg); int setup_loop_proc() override; - private: +private: ObPxFifoCoordOpEventListener listener_; ObSerialDfoScheduler serial_scheduler_; ObParallelDfoScheduler parallel_scheduler_; diff --git a/src/sql/engine/px/exchange/ob_px_merge_sort_receive.h b/src/sql/engine/px/exchange/ob_px_merge_sort_receive.h index c7971e57e..dc2d1c60c 100644 --- a/src/sql/engine/px/exchange/ob_px_merge_sort_receive.h +++ b/src/sql/engine/px/exchange/ob_px_merge_sort_receive.h @@ -30,10 +30,10 @@ namespace oceanbase { namespace sql { class ObPxMergeSortReceiveInput : public ObPxReceiveInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxMergeSortReceiveInput() : ObPxReceiveInput() {} virtual ~ObPxMergeSortReceiveInput() @@ -45,13 +45,13 @@ class ObPxMergeSortReceiveInput : public ObPxReceiveInput { }; class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: class ObPxMergeSortReceiveCtx; class MergeSortInput { - public: + public: explicit MergeSortInput( ObRARowStore* get_row_store, ObRARowStore* add_row_ptr, int64_t pos, bool finish, bool can_free) : get_row_store_(get_row_store), add_row_store_(add_row_ptr), pos_(pos), finish_(finish), can_free_(can_free) @@ -76,7 +76,7 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { TO_STRING_KV(K_(pos)); - public: + public: ObRARowStore* get_row_store_; ObRARowStore* add_row_store_; @@ -86,7 +86,7 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { }; class GlobalOrderInput : public MergeSortInput { - public: + public: explicit GlobalOrderInput(uint64_t tenant_id) : MergeSortInput(nullptr, nullptr, 0, false, true) { tenant_id_ = tenant_id; @@ -105,13 +105,13 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { virtual void clean_row_store(ObPxMergeSortReceiveCtx& recv_ctx); virtual bool is_empty(); - private: + private: virtual int reset_add_row_store(bool& reset); virtual int switch_get_row_store(); int get_one_row_from_channels( ObPxMergeSortReceiveCtx& recv_ctx, ObPhysicalPlanCtx* phy_plan_ctx, int64_t channel_idx) const; - private: + private: static const int64_t MAX_ROWS_PER_STORE = 50L; uint64_t tenant_id_; int64_t add_saved_pos_; @@ -119,7 +119,7 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { }; class LocalOrderInput : public MergeSortInput { - public: + public: explicit LocalOrderInput(ObRARowStore* get_row_store, int64_t pos, int64_t end_count) : MergeSortInput(get_row_store, get_row_store, pos, false, 0 == pos), org_start_pos_(pos), @@ -138,17 +138,17 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { virtual void destroy(); virtual void clean_row_store(ObPxMergeSortReceiveCtx& recv_ctx); - private: + private: int64_t org_start_pos_; // save origin start position, it can't be changed int64_t end_count_; ObRARowStore::Reader reader_; }; class ObPxMergeSortReceiveCtx : public ObPxReceiveCtx { - public: + public: friend class ObPxMergeSortReceive; - public: + public: explicit ObPxMergeSortReceiveCtx(ObExecContext& ctx) : ObPxReceive::ObPxReceiveCtx(ctx), ptr_px_row_(&px_row_), @@ -180,7 +180,7 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { return task_channels_.count(); } - private: + private: ObPxNewRow* ptr_px_row_; dtl::ObDtlChannelLoop* ptr_row_msg_loop_; ObPxInterruptP interrupt_proc_; @@ -194,7 +194,7 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { bool finish_; }; - public: +public: explicit ObPxMergeSortReceive(common::ObIAllocator& alloc, bool local_order = false) : ObPxReceive(alloc), ObSortableTrait(alloc), local_order_(local_order) {} @@ -204,7 +204,7 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { local_order_ = local_order; } - protected: +protected: virtual int create_operator_input(ObExecContext& ctx) const; virtual int init_op_ctx(ObExecContext& ctx) const; virtual int inner_open(ObExecContext& ctx) const; @@ -213,14 +213,14 @@ class ObPxMergeSortReceive : public ObPxReceive, public ObSortableTrait { virtual int init_merge_sort_input(ObExecContext& ctx, ObPxMergeSortReceiveCtx* recv_ctx, int64_t n_channel) const; virtual int release_merge_inputs(ObExecContext& ctx, ObPxMergeSortReceiveCtx* recv_ctx) const; - private: +private: int get_one_row_from_channels(ObPxMergeSortReceiveCtx* recv_ctx, ObPhysicalPlanCtx* phy_plan_ctx, int64_t channel_idx, // row heap require data from the channel_idx channel const common::ObNewRow*& in_row) const; int get_all_rows_from_channels(ObPxMergeSortReceiveCtx& recv_ctx, ObPhysicalPlanCtx* phy_plan_ctx) const; int try_link_channel(ObExecContext& ctx) const override; - private: +private: static const int64_t MAX_INPUT_NUMBER = 10000L; bool local_order_; }; diff --git a/src/sql/engine/px/exchange/ob_px_ms_coord_op.h b/src/sql/engine/px/exchange/ob_px_ms_coord_op.h index eb5a9c4e4..736be796a 100644 --- a/src/sql/engine/px/exchange/ob_px_ms_coord_op.h +++ b/src/sql/engine/px/exchange/ob_px_ms_coord_op.h @@ -30,10 +30,10 @@ namespace oceanbase { namespace sql { class ObPxMSCoordOpInput : public ObPxReceiveOpInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxMSCoordOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxReceiveOpInput(ctx, spec) {} virtual ~ObPxMSCoordOpInput() @@ -43,7 +43,7 @@ class ObPxMSCoordOpInput : public ObPxReceiveOpInput { class ObPxMSCoordSpec : public ObPxCoordSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxMSCoordSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObPxCoordSpec(alloc, type), all_exprs_(alloc), sort_collations_(alloc), sort_cmp_funs_(alloc) {} @@ -55,23 +55,23 @@ class ObPxMSCoordSpec : public ObPxCoordSpec { }; class ObPxMSCoordOp : public ObPxCoordOp { - public: +public: ObPxMSCoordOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObPxMSCoordOp() {} - public: +public: class ObPxMSCoordOpEventListener : public ObIPxCoordEventListener { - public: + public: ObPxMSCoordOpEventListener(ObPxMSCoordOp& px_coord_op) : px_coord_op_(px_coord_op) {} int on_root_data_channel_setup(); - private: + private: ObPxMSCoordOp& px_coord_op_; }; class ObMsgReceiveFilter : public dtl::ObIDltChannelLoopPred { - public: + public: ObMsgReceiveFilter(ObRowHeap>& heap) : data_ch_idx_start_(-1), data_ch_idx_end_(-1), heap_(heap) {} @@ -93,13 +93,13 @@ class ObPxMSCoordOp : public ObPxCoordOp { return data_ch_idx_start_; } - private: + private: int64_t data_ch_idx_start_; int64_t data_ch_idx_end_; ObRowHeap>& heap_; }; - public: +public: virtual int inner_open() override; virtual void destroy() override; virtual int inner_close() override; @@ -111,13 +111,13 @@ class ObPxMSCoordOp : public ObPxCoordOp { } int init_row_heap(int64_t n_ways); - private: +private: virtual int free_allocator(); int next_row(bool& wait_next_msg); virtual int setup_loop_proc() override; int init_store_rows(int64_t n_ways); - private: +private: ObPxMSCoordOpEventListener listener_; ObSerialDfoScheduler serial_scheduler_; ObParallelDfoScheduler parallel_scheduler_; diff --git a/src/sql/engine/px/exchange/ob_px_ms_receive_op.h b/src/sql/engine/px/exchange/ob_px_ms_receive_op.h index 61619c9bb..74c032b3c 100644 --- a/src/sql/engine/px/exchange/ob_px_ms_receive_op.h +++ b/src/sql/engine/px/exchange/ob_px_ms_receive_op.h @@ -31,10 +31,10 @@ namespace oceanbase { namespace sql { class ObPxMSReceiveOpInput : public ObPxReceiveOpInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxMSReceiveOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxReceiveOpInput(ctx, spec) {} virtual ~ObPxMSReceiveOpInput() @@ -44,7 +44,7 @@ class ObPxMSReceiveOpInput : public ObPxReceiveOpInput { class ObPxMSReceiveSpec : public ObPxReceiveSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxMSReceiveSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); // [sort_exprs, output_exprs]The first is the sorting column, and the second is the receive output column ExprFixedArray all_exprs_; @@ -54,14 +54,14 @@ class ObPxMSReceiveSpec : public ObPxReceiveSpec { }; class ObPxMSReceiveOp : public ObPxReceiveOp { - public: +public: ObPxMSReceiveOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObPxMSReceiveOp() {} - private: +private: class MergeSortInput { - public: + public: MergeSortInput(ObChunkDatumStore* get_row_store, ObChunkDatumStore* add_row_ptr, bool finish) : get_row_store_(get_row_store), add_row_store_(add_row_ptr), finish_(finish), reader_() {} @@ -86,7 +86,7 @@ class ObPxMSReceiveOp : public ObPxReceiveOp { TO_STRING_KV(K_(finish)); - public: + public: ObChunkDatumStore* get_row_store_; ObChunkDatumStore* add_row_store_; bool finish_; @@ -104,7 +104,7 @@ class ObPxMSReceiveOp : public ObPxReceiveOp { // and switch add_row_store_ to get_row_store_ , get_row_store_ to add_row_store_ // Switch the add and get of the data back and forth like this class GlobalOrderInput : public MergeSortInput { - public: + public: GlobalOrderInput(uint64_t tenant_id) : MergeSortInput(nullptr, nullptr, false), get_reader_(), add_row_reader_(nullptr), get_row_reader_(nullptr) { @@ -124,14 +124,14 @@ class ObPxMSReceiveOp : public ObPxReceiveOp { virtual void clean_row_store(ObExecContext& ctx); virtual bool is_empty(); - private: + private: int create_chunk_datum_store(ObExecContext& ctx, uint64_t tenant_id, ObChunkDatumStore*& row_store); virtual int reset_add_row_store(bool& reset); virtual int switch_get_row_store(); int get_one_row_from_channels(ObPxMSReceiveOp* ms_receive_op, ObPhysicalPlanCtx* phy_plan_ctx, int64_t channel_idx, const common::ObIArray& exprs, ObEvalCtx& eval_ctx); - private: + private: static const int64_t MAX_ROWS_PER_STORE = 50L; uint64_t tenant_id_; // Due to the need for two datum stores to switch back and forth, @@ -156,7 +156,7 @@ class ObPxMSReceiveOp : public ObPxReceiveOp { // channel will have a row_store to cache all data, and LocalOrderInput will specify the range of its own order // segment [start_pos, end_pos). Then continue to pop the data according to the range class LocalOrderInput : public MergeSortInput { - public: + public: explicit LocalOrderInput() : MergeSortInput(nullptr, nullptr, false), datum_store_() { get_row_store_ = &datum_store_; @@ -175,12 +175,12 @@ class ObPxMSReceiveOp : public ObPxReceiveOp { virtual void clean_row_store(ObExecContext& ctx); int open(); - public: + public: ObChunkDatumStore datum_store_; }; class Compare { - public: + public: Compare(); int init(const ObIArray* sort_collations, const ObIArray* sort_cmp_funs); @@ -202,13 +202,13 @@ class ObPxMSReceiveOp : public ObPxReceiveOp { new (this) Compare(); } - public: + public: int ret_; const ObIArray* sort_collations_; const ObIArray* sort_cmp_funs_; const common::ObIArray* rows_; - private: + private: DISALLOW_COPY_AND_ASSIGN(Compare); }; @@ -222,7 +222,7 @@ class ObPxMSReceiveOp : public ObPxReceiveOp { return task_channels_.count(); } - private: +private: int new_local_order_input(MergeSortInput*& out_msi); int get_all_rows_from_channels(ObPhysicalPlanCtx* phy_plan_ctx); int try_link_channel() override; @@ -231,7 +231,7 @@ class ObPxMSReceiveOp : public ObPxReceiveOp { int get_one_row_from_channels(ObPhysicalPlanCtx* phy_plan_ctx, int64_t channel_idx, const ObIArray& exprs, ObEvalCtx& eval_ctx, const ObChunkDatumStore::StoredRow*& store_row); - private: +private: static const int64_t MAX_INPUT_NUMBER = 10000L; ObPxNewRow* ptr_px_row_; dtl::ObDtlChannelLoop* ptr_row_msg_loop_; diff --git a/src/sql/engine/px/exchange/ob_px_receive.h b/src/sql/engine/px/exchange/ob_px_receive.h index 9b7f74b02..c41c99c5d 100644 --- a/src/sql/engine/px/exchange/ob_px_receive.h +++ b/src/sql/engine/px/exchange/ob_px_receive.h @@ -28,10 +28,10 @@ namespace oceanbase { namespace sql { class ObPxReceiveInput : public ObPxExchangeInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxReceiveInput() : child_dfo_id_(common::OB_INVALID_ID), ch_provider_ptr_(0) {} virtual ~ObPxReceiveInput() @@ -61,18 +61,18 @@ class ObPxReceiveInput : public ObPxExchangeInput { return ch_provider_ptr_; } - protected: +protected: int64_t child_dfo_id_; uint64_t ch_provider_ptr_; }; // ObPxReceive is pure base class, no get_type() info provided class ObPxReceive : public ObReceive { - public: +public: class ObPxReceiveCtx : public ObReceiveCtx { friend class ObPxReceive; - public: + public: explicit ObPxReceiveCtx(ObExecContext& ctx) : ObReceiveCtx(ctx), task_ch_set_(), @@ -150,7 +150,7 @@ class ObPxReceive : public ObReceive { return task_channels_; } - protected: + protected: ObPxTaskChSet task_ch_set_; bool iter_end_; bool channel_linked_; @@ -166,7 +166,7 @@ class ObPxReceive : public ObReceive { dtl::ObDtlLocalFirstBufferCache* proxy_first_buffer_cache_; }; - public: +public: explicit ObPxReceive(common::ObIAllocator& alloc); virtual ~ObPxReceive(); virtual int rescan(ObExecContext& ctx) const override; @@ -174,23 +174,23 @@ class ObPxReceive : public ObReceive { virtual int try_link_channel(ObExecContext& ctx) const = 0; virtual int active_all_receive_channel(ObPxReceiveCtx& recv_ctx, ObExecContext& ctx) const; - protected: +protected: // helper func static int link_ch_sets( ObPxTaskChSet& ch_set, common::ObIArray& channels, dtl::ObDtlFlowControl* dfc = nullptr); int get_sqc_id(ObExecContext& ctx, int64_t& sqc_id) const; - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObPxReceive); }; class ObPxFifoReceiveInput : public ObPxReceiveInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxFifoReceiveInput() : ObPxReceiveInput() {} virtual ~ObPxFifoReceiveInput() @@ -202,12 +202,12 @@ class ObPxFifoReceiveInput : public ObPxReceiveInput { }; class ObPxFifoReceive : public ObPxReceive { - public: +public: class ObPxFifoReceiveCtx : public ObPxReceiveCtx { - public: + public: friend class ObPxFifoReceive; - public: + public: explicit ObPxFifoReceiveCtx(ObExecContext& ctx); virtual ~ObPxFifoReceiveCtx(); virtual void destroy() @@ -216,15 +216,15 @@ class ObPxFifoReceive : public ObPxReceive { // no need to reset interrupt_proc_ } - private: + private: ObPxInterruptP interrupt_proc_; }; - public: +public: explicit ObPxFifoReceive(common::ObIAllocator& alloc); virtual ~ObPxFifoReceive(); - protected: +protected: virtual int create_operator_input(ObExecContext& ctx) const; virtual int init_op_ctx(ObExecContext& ctx) const; virtual int inner_open(ObExecContext& ctx) const; @@ -232,7 +232,7 @@ class ObPxFifoReceive : public ObPxReceive { virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; virtual int try_link_channel(ObExecContext& ctx) const override; - private: +private: int get_one_row_from_channels(ObPxFifoReceiveCtx& recv_ctx, dtl::ObDtlChannelLoop& loop, int64_t timeout_us, const common::ObNewRow*& row) const; }; diff --git a/src/sql/engine/px/exchange/ob_px_receive_op.h b/src/sql/engine/px/exchange/ob_px_receive_op.h index 87b89e459..59d3e6e7f 100644 --- a/src/sql/engine/px/exchange/ob_px_receive_op.h +++ b/src/sql/engine/px/exchange/ob_px_receive_op.h @@ -28,10 +28,10 @@ namespace oceanbase { namespace sql { class ObPxReceiveOpInput : public ObPxExchangeOpInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxReceiveOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxExchangeOpInput(ctx, spec), child_dfo_id_(common::OB_INVALID_ID), ch_provider_ptr_(0) {} @@ -59,7 +59,7 @@ class ObPxReceiveOpInput : public ObPxExchangeOpInput { return ch_provider_ptr_; } - protected: +protected: int64_t child_dfo_id_; uint64_t ch_provider_ptr_; }; @@ -67,7 +67,7 @@ class ObPxReceiveOpInput : public ObPxExchangeOpInput { class ObPxReceiveSpec : public ObReceiveSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxReceiveSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObPxReceiveSpec() {} @@ -76,7 +76,7 @@ class ObPxReceiveSpec : public ObReceiveSpec { }; class ObPxReceiveOp : public ObReceiveOp { - public: +public: ObPxReceiveOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObPxReceiveOp() {} @@ -124,7 +124,7 @@ class ObPxReceiveOp : public ObReceiveOp { int64_t get_sqc_id(); - public: +public: void reset_for_rescan() { iter_end_ = false; @@ -148,7 +148,7 @@ class ObPxReceiveOp : public ObReceiveOp { return ts_; } - protected: +protected: ObPxTaskChSet task_ch_set_; bool iter_end_; bool channel_linked_; @@ -166,10 +166,10 @@ class ObPxReceiveOp : public ObReceiveOp { }; class ObPxFifoReceiveOpInput : public ObPxReceiveOpInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxFifoReceiveOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxReceiveOpInput(ctx, spec) {} virtual ~ObPxFifoReceiveOpInput() @@ -179,7 +179,7 @@ class ObPxFifoReceiveOpInput : public ObPxReceiveOpInput { class ObPxFifoReceiveSpec : public ObPxReceiveSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxFifoReceiveSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObPxReceiveSpec(alloc, type) {} ~ObPxFifoReceiveSpec() @@ -187,12 +187,12 @@ class ObPxFifoReceiveSpec : public ObPxReceiveSpec { }; class ObPxFifoReceiveOp : public ObPxReceiveOp { - public: +public: ObPxFifoReceiveOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObPxFifoReceiveOp() {} - protected: +protected: virtual void destroy() { ObPxReceiveOp::destroy(); @@ -202,10 +202,10 @@ class ObPxFifoReceiveOp : public ObPxReceiveOp { virtual int inner_get_next_row(); virtual int try_link_channel() override; - private: +private: int get_one_row_from_channels(int64_t timeout_us); - private: +private: ObPxInterruptP interrupt_proc_; }; diff --git a/src/sql/engine/px/exchange/ob_px_reduce_transmit.h b/src/sql/engine/px/exchange/ob_px_reduce_transmit.h index 8a18b9b08..0a3feaf54 100644 --- a/src/sql/engine/px/exchange/ob_px_reduce_transmit.h +++ b/src/sql/engine/px/exchange/ob_px_reduce_transmit.h @@ -19,10 +19,10 @@ namespace oceanbase { namespace sql { class ObPxReduceTransmitInput : public ObPxTransmitInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxReduceTransmitInput() : ObPxTransmitInput() {} virtual ~ObPxReduceTransmitInput() @@ -34,21 +34,21 @@ class ObPxReduceTransmitInput : public ObPxTransmitInput { }; class ObPxReduceTransmit : public ObPxTransmit { - public: +public: class ObPxReduceTransmitCtx : public ObPxTransmitCtx { - public: + public: friend class ObPxReduceTransmit; - public: + public: explicit ObPxReduceTransmitCtx(ObExecContext& ctx); virtual ~ObPxReduceTransmitCtx(); }; - public: +public: explicit ObPxReduceTransmit(common::ObIAllocator& alloc); virtual ~ObPxReduceTransmit(); - protected: +protected: virtual int inner_open(ObExecContext& ctx) const; virtual int do_transmit(ObExecContext& ctx) const override; virtual int inner_close(ObExecContext& exec_ctx) const; diff --git a/src/sql/engine/px/exchange/ob_px_reduce_transmit_op.h b/src/sql/engine/px/exchange/ob_px_reduce_transmit_op.h index 7873d31fd..6190f0c74 100644 --- a/src/sql/engine/px/exchange/ob_px_reduce_transmit_op.h +++ b/src/sql/engine/px/exchange/ob_px_reduce_transmit_op.h @@ -19,10 +19,10 @@ namespace oceanbase { namespace sql { class ObPxReduceTransmitOpInput : public ObPxTransmitOpInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxReduceTransmitOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxTransmitOpInput(ctx, spec) {} virtual ~ObPxReduceTransmitOpInput() @@ -32,7 +32,7 @@ class ObPxReduceTransmitOpInput : public ObPxTransmitOpInput { class ObPxReduceTransmitSpec : public ObPxTransmitSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxReduceTransmitSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObPxTransmitSpec(alloc, type) {} ~ObPxReduceTransmitSpec() @@ -40,14 +40,14 @@ class ObPxReduceTransmitSpec : public ObPxTransmitSpec { }; class ObPxReduceTransmitOp : public ObPxTransmitOp { - public: +public: ObPxReduceTransmitOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObPxTransmitOp(exec_ctx, spec, input) {} virtual ~ObPxReduceTransmitOp() {} - public: +public: virtual int inner_open() override; virtual int rescan() override { diff --git a/src/sql/engine/px/exchange/ob_px_repart_transmit.h b/src/sql/engine/px/exchange/ob_px_repart_transmit.h index 6cf2a7f1d..6a88ef6e1 100644 --- a/src/sql/engine/px/exchange/ob_px_repart_transmit.h +++ b/src/sql/engine/px/exchange/ob_px_repart_transmit.h @@ -19,10 +19,10 @@ namespace oceanbase { namespace sql { class ObRepartSliceIdxCalc; class ObPxRepartTransmitInput : public ObPxTransmitInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxRepartTransmitInput() : ObPxTransmitInput() {} virtual ~ObPxRepartTransmitInput() @@ -34,29 +34,29 @@ class ObPxRepartTransmitInput : public ObPxTransmitInput { }; class ObPxRepartTransmit : public ObPxTransmit { - public: +public: class ObPxRepartTransmitCtx : public ObPxTransmitCtx { - public: + public: friend class ObPxRepartTransmit; - public: + public: explicit ObPxRepartTransmitCtx(ObExecContext& ctx); virtual ~ObPxRepartTransmitCtx(); }; - public: +public: explicit ObPxRepartTransmit(common::ObIAllocator& alloc); virtual ~ObPxRepartTransmit(); virtual int add_compute(ObColumnExpression* expr) override; - protected: +protected: virtual int inner_open(ObExecContext& ctx) const; virtual int do_transmit(ObExecContext& ctx) const override; virtual int inner_close(ObExecContext& exec_ctx) const; virtual int init_op_ctx(ObExecContext& ctx) const; virtual int create_operator_input(ObExecContext& ctx) const; - private: +private: int do_repart_transmit(ObExecContext& exec_ctx, ObRepartSliceIdxCalc& repart_slice_calc) const; }; diff --git a/src/sql/engine/px/exchange/ob_px_repart_transmit_op.h b/src/sql/engine/px/exchange/ob_px_repart_transmit_op.h index fa35968c2..dcfe57fde 100644 --- a/src/sql/engine/px/exchange/ob_px_repart_transmit_op.h +++ b/src/sql/engine/px/exchange/ob_px_repart_transmit_op.h @@ -21,10 +21,10 @@ namespace sql { class ObRepartSliceIdxCalc; class ObPxRepartTransmitOpInput : public ObPxTransmitOpInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxRepartTransmitOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxTransmitOpInput(ctx, spec) {} virtual ~ObPxRepartTransmitOpInput() @@ -34,12 +34,12 @@ class ObPxRepartTransmitOpInput : public ObPxTransmitOpInput { class ObPxRepartTransmitSpec : public ObPxTransmitSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxRepartTransmitSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObPxRepartTransmitSpec() {} - public: +public: // for pkey,pkey-hash,pkey-range etc.. ObExpr* calc_part_id_expr_; // for pkey-hash @@ -48,7 +48,7 @@ class ObPxRepartTransmitSpec : public ObPxTransmitSpec { }; class ObPxRepartTransmitOp : public ObPxTransmitOp { - public: +public: ObPxRepartTransmitOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObPxRepartTransmitOp() {} @@ -66,7 +66,7 @@ class ObPxRepartTransmitOp : public ObPxTransmitOp { int do_transmit(); - private: +private: int do_repart_transmit(ObRepartSliceIdxCalc& repart_slice_calc); }; diff --git a/src/sql/engine/px/exchange/ob_px_transmit.h b/src/sql/engine/px/exchange/ob_px_transmit.h index 148b95fc1..69392f4e0 100644 --- a/src/sql/engine/px/exchange/ob_px_transmit.h +++ b/src/sql/engine/px/exchange/ob_px_transmit.h @@ -40,10 +40,10 @@ class ObTableSchema; namespace sql { class ObSliceIdxCalc; class ObPxTransmitInput : public ObPxExchangeInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxTransmitInput() : ObPxExchangeInput(), ch_provider_ptr_(0) {} virtual ~ObPxTransmitInput() @@ -68,18 +68,18 @@ class ObPxTransmitInput : public ObPxExchangeInput { return ch_provider_ptr_; } - protected: +protected: uint64_t ch_provider_ptr_; }; // ObPxTransmit is pure base class, no get_type() info provided class ObPxTransmit : public ObTransmit { - public: +public: class ObPxTransmitCtx : public ObTransmitCtx { - public: + public: friend class ObPxTransmit; - public: + public: explicit ObPxTransmitCtx(ObExecContext& ctx); virtual ~ObPxTransmitCtx(); virtual void destroy(); @@ -95,7 +95,7 @@ class ObPxTransmit : public ObTransmit { return task_channels_; } - public: + public: common::ObArray task_channels_; common::ObArenaAllocator px_row_allocator_; ObPxTaskChSet task_ch_set_; @@ -113,7 +113,7 @@ class ObPxTransmit : public ObTransmit { ObPxPartChInfo part_ch_info_; }; - public: +public: explicit ObPxTransmit(common::ObIAllocator& alloc); virtual ~ObPxTransmit(); // This interface only used to calculate the pseudo column of the part_id to which the current row belongs @@ -122,7 +122,7 @@ class ObPxTransmit : public ObTransmit { partition_id_idx_ = idx; } - protected: +protected: OB_INLINE bool has_partition_id_column_idx() const { return partition_id_idx_ != OB_INVALID_INDEX; @@ -141,7 +141,7 @@ class ObPxTransmit : public ObTransmit { int send_rows(ObExecContext& exec_ctx, ObPxTransmitCtx& transmit_ctx, ObSliceIdxCalc& slice_calc) const; int broadcast_rows(ObExecContext& exec_ctx, ObPxTransmitCtx& transmit_ctx, ObSliceIdxCalc& slice_calc) const; - private: +private: int update_row(common::ObNewRow& row, int partition_id_column_idx, common::ObObj& partition_id) const; int send_row(ObExecContext& ctx, ObPxTransmitCtx& transmit_ctx, int64_t slice_idx, common::ObObj& partition_id, const common::ObNewRow& row, int64_t& time_recorder) const; @@ -149,7 +149,7 @@ class ObPxTransmit : public ObTransmit { int broadcast_eof_row(ObPxTransmitCtx& transmit_ctx) const; int next_row(ObExecContext& ctx, const common::ObNewRow*& row, ObPxTransmitCtx& transmit_ctx) const; - private: +private: }; } // namespace sql diff --git a/src/sql/engine/px/exchange/ob_px_transmit_op.h b/src/sql/engine/px/exchange/ob_px_transmit_op.h index 81fe04add..3603b73cb 100644 --- a/src/sql/engine/px/exchange/ob_px_transmit_op.h +++ b/src/sql/engine/px/exchange/ob_px_transmit_op.h @@ -33,7 +33,7 @@ namespace sql { class ObPxTransmitOpInput : public ObPxExchangeOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObPxTransmitOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObPxExchangeOpInput(ctx, spec), ch_provider_ptr_(0) {} virtual ~ObPxTransmitOpInput() @@ -63,7 +63,7 @@ class ObPxTransmitOpInput : public ObPxExchangeOpInput { class ObPxTransmitSpec : public ObTransmitSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxTransmitSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObPxTransmitSpec() {} @@ -83,13 +83,13 @@ class ObPxTransmitSpec : public ObTransmitSpec { return partition_id_idx_; } - private: +private: // in pdm, partition_id_exprs position of output_exprs int32_t partition_id_idx_; }; class ObPxTransmitOp : public ObTransmitOp { - public: +public: ObPxTransmitOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObPxTransmitOp() {} @@ -103,7 +103,7 @@ class ObPxTransmitOp : public ObTransmitOp { virtual int inner_close() override; virtual int inner_get_next_row() override; - public: +public: int init_channel(ObPxTransmitOpInput& trans_input); int init_dfc(dtl::ObDtlDfoKey& key); @@ -116,21 +116,21 @@ class ObPxTransmitOp : public ObTransmitOp { return task_channels_; } - protected: +protected: virtual int do_transmit() = 0; static int link_ch_sets( ObPxTaskChSet& ch_set, common::ObIArray& channels, dtl::ObDtlFlowControl* dfc = nullptr); int send_rows(ObSliceIdxCalc& slice_calc); int broadcast_rows(ObSliceIdxCalc& slice_calc); - private: +private: int update_row(int partition_id_column_idx, int64_t partition_id); int send_row(int64_t slice_idx, int64_t& time_recorder, int64_t partition_id); int send_eof_row(); int broadcast_eof_row(); int next_row(); - protected: +protected: common::ObArray task_channels_; common::ObArenaAllocator px_row_allocator_; ObPxTaskChSet task_ch_set_; diff --git a/src/sql/engine/px/exchange/ob_receive_op.h b/src/sql/engine/px/exchange/ob_receive_op.h index 22af471ef..4ab46f453 100644 --- a/src/sql/engine/px/exchange/ob_receive_op.h +++ b/src/sql/engine/px/exchange/ob_receive_op.h @@ -25,7 +25,7 @@ namespace sql { class ObReceiveOpInput : public ObOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObReceiveOpInput(ObExecContext& ctx, const ObOpSpec& spec); virtual ~ObReceiveOpInput(); virtual void reset() override; @@ -46,7 +46,7 @@ class ObReceiveOpInput : public ObOpInput { }; int get_result_location(const int64_t child_job_id, const int64_t child_task_id, common::ObAddr& svr); - protected: +protected: uint64_t pull_slice_id_; int64_t child_job_id_; uint64_t child_op_id_; @@ -56,7 +56,7 @@ class ObReceiveOpInput : public ObOpInput { class ObReceiveSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObReceiveSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); bool is_receive() const override @@ -75,7 +75,7 @@ class ObReceiveSpec : public ObOpSpec { }; class ObReceiveOp : public ObOperator { - public: +public: ObReceiveOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObReceiveOp() {} diff --git a/src/sql/engine/px/exchange/ob_row_heap.h b/src/sql/engine/px/exchange/ob_row_heap.h index fb4c59d74..aa158eece 100644 --- a/src/sql/engine/px/exchange/ob_row_heap.h +++ b/src/sql/engine/px/exchange/ob_row_heap.h @@ -27,7 +27,7 @@ class ObNewRow; namespace sql { class ObRowComparer { - public: +public: ObRowComparer() : columns_(NULL), rows_(NULL), ret_(common::OB_SUCCESS) {} ~ObRowComparer() = default; @@ -38,14 +38,14 @@ class ObRowComparer { return ret_; } - protected: +protected: const common::ObIArray* columns_; const common::ObIArray* rows_; int ret_; }; class ObDatumRowCompare { - public: +public: ObDatumRowCompare(); int init(const ObIArray* sort_collations, const ObIArray* sort_cmp_funs, const common::ObIArray& rows); @@ -73,7 +73,7 @@ class ObDatumRowCompare { return ret_; } - public: +public: int ret_; const ObIArray* sort_collations_; const ObIArray* sort_cmp_funs_; @@ -81,7 +81,7 @@ class ObDatumRowCompare { }; class ObMaxDatumRowCompare { - public: +public: ObMaxDatumRowCompare(); int init(const ObIArray* sort_collations, const ObIArray* sort_cmp_funs, const common::ObIArray*>& rows); @@ -109,7 +109,7 @@ class ObMaxDatumRowCompare { return ret_; } - public: +public: int ret_; const ObIArray* sort_collations_; const ObIArray* sort_cmp_funs_; @@ -121,7 +121,7 @@ class ObMaxDatumRowCompare { */ template class ObRowHeap { - public: +public: ObRowHeap(); ~ObRowHeap(); @@ -165,7 +165,7 @@ class ObRowHeap { TO_STRING_KV(K_(writable_ch_idx), K_(capacity), "count", count()); - private: +private: /* functions */ /* variables */ bool inited_; diff --git a/src/sql/engine/px/exchange/ob_transmit_op.h b/src/sql/engine/px/exchange/ob_transmit_op.h index dc495be85..24e9eb2da 100644 --- a/src/sql/engine/px/exchange/ob_transmit_op.h +++ b/src/sql/engine/px/exchange/ob_transmit_op.h @@ -21,7 +21,7 @@ namespace sql { class ObTransmitOpInput : public ObOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObTransmitOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObOpInput(ctx, spec) {} virtual ~ObTransmitOpInput() @@ -33,7 +33,7 @@ class ObTransmitOpInput : public ObOpInput { class ObTransmitSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObTransmitSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObTransmitSpec() {} @@ -163,7 +163,7 @@ class ObTransmitSpec : public ObOpSpec { }; class ObTransmitOp : public ObOperator { - public: +public: ObTransmitOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObTransmitOp() {} diff --git a/src/sql/engine/px/ob_dfo.h b/src/sql/engine/px/ob_dfo.h index dea521ad8..0c6382119 100644 --- a/src/sql/engine/px/ob_dfo.h +++ b/src/sql/engine/px/ob_dfo.h @@ -46,7 +46,7 @@ class ObSqcTaskMgr; class ObPxSqcHandler; class ObPxTaskMeta { - public: +public: ObPxTaskMeta() : exec_addr_(), sqc_id_(common::OB_INVALID_INDEX), @@ -88,7 +88,7 @@ class ObPxTaskMeta { } TO_STRING_KV(K_(exec_addr), K_(sqc_id), K_(task_id)); - private: +private: common::ObAddr exec_addr_; int64_t sqc_id_; int64_t task_id_; @@ -99,11 +99,11 @@ class ObPxTaskMeta { class ObPxSqcMeta { OB_UNIS_VERSION(1); - public: +public: struct PartitionIdValue { OB_UNIS_VERSION(1); - public: + public: PartitionIdValue() : partition_id_(0), location_idx_(0), value_begin_idx_(0), value_count_(0) {} int64_t partition_id_; @@ -113,7 +113,7 @@ class ObPxSqcMeta { TO_STRING_KV(K_(partition_id), K_(location_idx), K_(value_begin_idx), K_(value_count)); }; - public: +public: ObPxSqcMeta() : execution_id_(common::OB_INVALID_ID), qc_id_(common::OB_INVALID_ID), @@ -437,7 +437,7 @@ class ObPxSqcMeta { K_(px_int_id), K_(is_fulltree), K_(is_rpc_worker), K_(transmit_use_interm_result), K_(recieve_use_interm_result), K(interm_result_ids_)); - private: +private: uint64_t execution_id_; uint64_t qc_id_; int64_t sqc_id_; @@ -481,10 +481,10 @@ class ObDfo { friend class ObDfoMgr; using TaskFilterFunc = std::function; - public: +public: static const int64_t MAX_DFO_ID = INT32_MAX; - public: +public: ObDfo(common::ObIAllocator& allocator) : allocator_(allocator), execution_id_(common::OB_INVALID_ID), @@ -900,13 +900,13 @@ class ObDfo { K_(has_scan), K_(sqcs), KP_(depend_sibling), KP_(parent), "child", get_child_count(), K_(slave_mapping_type), K_(dist_method)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDfo); - private: +private: int calc_total_task_count(); - private: +private: common::ObIAllocator& allocator_; uint64_t execution_id_; uint64_t qc_id_; @@ -954,7 +954,7 @@ class ObDfo { struct ObPxRpcInitSqcArgs { OB_UNIS_VERSION(1); - public: +public: ObPxRpcInitSqcArgs() : sqc_(), exec_ctx_(NULL), @@ -982,7 +982,7 @@ struct ObPxRpcInitSqcArgs { } TO_STRING_KV(K_(sqc)); - public: +public: ObPxSqcMeta sqc_; ObExecContext* exec_ctx_; const ObPhysicalPlan* ser_phy_plan_; @@ -1000,7 +1000,7 @@ struct ObPxRpcInitSqcArgs { class ObPxTask { OB_UNIS_VERSION(1); - public: +public: ObPxTask() : qc_id_(common::OB_INVALID_ID), dfo_id_(0), @@ -1042,7 +1042,7 @@ class ObPxTask { return *this; } - public: +public: TO_STRING_KV(K_(qc_id), K_(dfo_id), K_(sqc_id), K_(task_id), K_(execution_id), K_(sqc_ch_info), K_(task_ch_info), K_(sqc_addr), K_(exec_addr), K_(qc_addr), K_(rc), K_(task_co_id), K_(px_int_id), K_(is_fulltree), K_(affected_rows), K_(dml_row_info)); @@ -1199,11 +1199,11 @@ class ObPxTask { return affected_rows_; } - public: +public: // if less than 0, rc is set. task default ret is 1 static const int64_t TASK_DEFAULT_RET_VALUE = 1; - public: +public: uint64_t qc_id_; int64_t dfo_id_; int64_t sqc_id_; @@ -1229,7 +1229,7 @@ class ObPxTask { class ObPxRpcInitTaskArgs { OB_UNIS_VERSION(1); - public: +public: ObPxRpcInitTaskArgs() : task_(), exec_ctx_(NULL), @@ -1293,7 +1293,7 @@ class ObPxRpcInitTaskArgs { } TO_STRING_KV(K_(task)); - public: +public: ObPxTask task_; ObExecContext* exec_ctx_; const ObPhysicalPlan* ser_phy_plan_; @@ -1309,31 +1309,31 @@ class ObPxRpcInitTaskArgs { struct ObPxRpcInitTaskResponse { OB_UNIS_VERSION(1); - public: +public: ObPxRpcInitTaskResponse() : task_co_id_(0) {} TO_STRING_KV(K_(task_co_id)); - public: +public: uint64_t task_co_id_; }; struct ObPxRpcInitSqcResponse { OB_UNIS_VERSION(1); - public: +public: ObPxRpcInitSqcResponse() : rc_(common::OB_NOT_INIT), reserved_thread_count_(0), partitions_info_() {} TO_STRING_KV(K_(rc), K_(reserved_thread_count)); - public: +public: int rc_; int64_t reserved_thread_count_; ObSEArray partitions_info_; }; class ObPxWorkerEnvArgs { - public: +public: ObPxWorkerEnvArgs() : trace_id_(nullptr), log_level_(OB_LOG_LEVEL_NONE), @@ -1406,7 +1406,7 @@ class ObPxWorkerEnvArgs { return group_id_; } - private: +private: const uint64_t* trace_id_; uint8_t log_level_; bool is_oracle_mode_; @@ -1416,7 +1416,7 @@ class ObPxWorkerEnvArgs { }; class ObExecCtxDfoRootOpGuard { - public: +public: ObExecCtxDfoRootOpGuard(ObExecContext* exec_ctx, const ObPhyOperator* op) { exec_ctx_ = NULL; @@ -1434,7 +1434,7 @@ class ObExecCtxDfoRootOpGuard { } } - private: +private: ObExecContext* exec_ctx_; const ObPhyOperator* op_; DISALLOW_COPY_AND_ASSIGN(ObExecCtxDfoRootOpGuard); diff --git a/src/sql/engine/px/ob_dfo_mgr.h b/src/sql/engine/px/ob_dfo_mgr.h index d1b322269..87786eb74 100644 --- a/src/sql/engine/px/ob_dfo_mgr.h +++ b/src/sql/engine/px/ob_dfo_mgr.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObDfoMgr { - public: +public: explicit ObDfoMgr(common::ObIAllocator& allocator) : allocator_(allocator), inited_(false), root_dfo_(NULL) {} virtual ~ObDfoMgr() = default; @@ -54,7 +54,7 @@ class ObDfoMgr { DECLARE_TO_STRING; - private: +private: int do_split(ObExecContext& exec_ctx, common::ObIAllocator& allocator, const ObPhyOperator* phy_op, ObDfo*& parent_dfo, const ObDfoInterruptIdGen& dfo_id_gen) const; int create_dfo(common::ObIAllocator& allocator, const ObPhyOperator* dfo_root_op, ObDfo*& dfo) const; @@ -62,33 +62,33 @@ class ObDfoMgr { const ObDfoInterruptIdGen& dfo_id_gen) const; int create_dfo(common::ObIAllocator& allocator, const ObOpSpec* dfo_root_op, ObDfo*& dfo) const; - protected: +protected: common::ObIAllocator& allocator_; bool inited_; ObDfo* root_dfo_; common::ObSEArray edges_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDfoMgr); }; class ObDfoTreeNormalizer { - public: +public: // Rotate the leaf node to the right, making sure that the middle node is on the left. // at the same time check the bushy tree situation, report an error and exit static int normalize(ObDfo& root); }; class ObDfoSchedOrderGenerator { - public: +public: static int generate_sched_order(ObDfoMgr& dfo_mgr); - private: +private: static int do_generate_sched_order(ObDfoMgr& dfo_mgr, ObDfo& root); }; class ObDfoWorkerAssignment { - public: +public: static int assign_worker(ObDfoMgr& dfo_mgr, int64_t expected_worker_count, int64_t allocated_worker_count); }; diff --git a/src/sql/engine/px/ob_dfo_scheduler.h b/src/sql/engine/px/ob_dfo_scheduler.h index e4d41c92d..9f9593ed2 100644 --- a/src/sql/engine/px/ob_dfo_scheduler.h +++ b/src/sql/engine/px/ob_dfo_scheduler.h @@ -23,10 +23,10 @@ class ObPxRootDfoAction; class ObPxMsgProc; class ObDfoSchedulerBasic { - public: +public: ObDfoSchedulerBasic(ObPxCoordInfo& coord_info, ObPxRootDfoAction& root_dfo_action, ObIPxCoordEventListener& listener); - public: +public: virtual int dispatch_dtl_data_channel_info(ObExecContext& ctx, ObDfo& child, ObDfo& parent) const = 0; virtual int try_schedule_next_dfo(ObExecContext& ctx) const = 0; virtual int schedule_dfo_for_temp_table(ObExecContext& exec_ctx, ObDfo& child) const; @@ -39,10 +39,10 @@ class ObDfoSchedulerBasic { virtual int dispatch_root_dfo_channel_info(ObExecContext& ctx, ObDfo& child, ObDfo& parent) const; int get_tenant_id(ObExecContext& ctx, uint64_t& tenant_id) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDfoSchedulerBasic); - protected: +protected: ObPxCoordInfo& coord_info_; ObPxRootDfoAction& root_dfo_action_; ObIPxCoordEventListener& listener_; @@ -50,26 +50,26 @@ class ObDfoSchedulerBasic { }; class ObSerialDfoScheduler : public ObDfoSchedulerBasic { - public: +public: using ObDfoSchedulerBasic::ObDfoSchedulerBasic; virtual int init_all_dfo_channel(ObExecContext& ctx) const; virtual int dispatch_dtl_data_channel_info(ObExecContext& ctx, ObDfo& child, ObDfo& parent) const; virtual int try_schedule_next_dfo(ObExecContext& ctx) const; - private: +private: int build_transmit_recieve_channel(ObExecContext& ctx, ObDfo* dfo) const; int init_dfo_channel(ObExecContext& ctx, ObDfo* child, ObDfo* parent) const; int init_data_xchg_ch(ObExecContext& ctx, ObDfo* dfo) const; int dispatch_sqcs(ObExecContext& exec_ctx, ObDfo& dfo, ObArray& sqcs) const; int do_schedule_dfo(ObExecContext& ctx, ObDfo& dfo) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSerialDfoScheduler); }; class ObParallelDfoScheduler : public ObDfoSchedulerBasic { - public: +public: ObParallelDfoScheduler(ObPxCoordInfo& coord_info, ObPxRootDfoAction& root_dfo_action, ObIPxCoordEventListener& listener, ObPxMsgProc& proc) : ObDfoSchedulerBasic(coord_info, root_dfo_action, listener), proc_(proc) @@ -77,7 +77,7 @@ class ObParallelDfoScheduler : public ObDfoSchedulerBasic { virtual int dispatch_dtl_data_channel_info(ObExecContext& ctx, ObDfo& child, ObDfo& parent) const; virtual int try_schedule_next_dfo(ObExecContext& ctx) const; - private: +private: int dispatch_transmit_channel_info(ObExecContext& ctx, ObDfo& child, ObDfo& parent) const; int dispatch_receive_channel_info(ObExecContext& ctx, ObDfo& child, ObDfo& parent) const; int do_schedule_dfo(ObExecContext& exec_ctx, ObDfo& dfo, bool& need_retry) const; @@ -96,10 +96,10 @@ class ObParallelDfoScheduler : public ObDfoSchedulerBasic { int schedule_pair(ObExecContext& exec_ctx, ObDfo& child, ObDfo& parent) const; int wait_for_dfo_finish(ObDfoMgr& dfo_mgr) const; - private: +private: ObPxMsgProc& proc_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObParallelDfoScheduler); }; diff --git a/src/sql/engine/px/ob_dlt_data_channel_group.h b/src/sql/engine/px/ob_dlt_data_channel_group.h index cb1f4338e..38b029e28 100644 --- a/src/sql/engine/px/ob_dlt_data_channel_group.h +++ b/src/sql/engine/px/ob_dlt_data_channel_group.h @@ -15,14 +15,14 @@ namespace oceanbase { namespace sql { class ObDTLDataChannelGroup { - public: +public: ObDTLDataChannelGroup(); virtual ~ObDTLDataChannelGroup(); int wait(int64_t timeout_ts); int notify(); int add_channel_info(ObDtlChannelInfo& producer, common::ObIArray& consumers); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObDTLDataChannelGroup); diff --git a/src/sql/engine/px/ob_granule_iterator.h b/src/sql/engine/px/ob_granule_iterator.h index 1ea634951..b94724a8b 100644 --- a/src/sql/engine/px/ob_granule_iterator.h +++ b/src/sql/engine/px/ob_granule_iterator.h @@ -34,7 +34,7 @@ class ObGIInput : public ObIPhyOperatorInput { friend class ObGranuleIteratorCtx; OB_UNIS_VERSION_V(1); - public: +public: ObGIInput() : parallelism_(-1), worker_id_(common::OB_INVALID_INDEX), @@ -72,10 +72,10 @@ class ObGIInput : public ObIPhyOperatorInput { return worker_id_; } - private: +private: int deep_copy_range(ObIAllocator* allocator, const ObNewRange& src, ObNewRange& dst); - private: +private: // the dop, the QC deside the dop before our task send to SQC server // but the dop may be change as the worker server don't has enough process. int64_t parallelism_; @@ -86,7 +86,7 @@ class ObGIInput : public ObIPhyOperatorInput { common::ObSEArray pkeys_; ObGranulePump* pump_; - private: +private: common::ObIAllocator* deserialize_allocator_; DISALLOW_COPY_AND_ASSIGN(ObGIInput); }; @@ -94,7 +94,7 @@ class ObGIInput : public ObIPhyOperatorInput { class ObGranuleIterator : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - private: +private: enum ObGranuleIteratorState { GI_UNINITIALIZED, GI_PREPARED, @@ -103,9 +103,9 @@ class ObGranuleIterator : public ObSingleChildPhyOperator { GI_END, }; - public: +public: class ObGranuleIteratorCtx : public ObPhyOperatorCtx { - public: + public: ObGranuleIteratorCtx(ObExecContext& exec_ctx) : ObPhyOperatorCtx(exec_ctx), parallelism_(-1), @@ -148,7 +148,7 @@ class ObGranuleIterator : public ObSingleChildPhyOperator { int64_t rescan_task_idx_; }; - public: +public: explicit ObGranuleIterator(common::ObIAllocator& alloc); virtual ~ObGranuleIterator(); virtual void reset() override; @@ -170,7 +170,7 @@ class ObGranuleIterator : public ObSingleChildPhyOperator { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObGranuleIterator); - public: +public: int set_tscs(common::ObIArray& tscs); int set_dml_op(ObTableModify* dml_op); void set_related_id(uint64_t ref_id) @@ -228,7 +228,7 @@ class ObGranuleIterator : public ObSingleChildPhyOperator { return gi_attri_flag_; } - private: +private: int try_fetch_task(ObExecContext& ctx, ObGranuleTaskInfo& info) const; int fetch_full_pw_tasks( ObExecContext& ctx, ObIArray& infos, const ObIArray& op_ids) const; @@ -241,7 +241,7 @@ class ObGranuleIterator : public ObSingleChildPhyOperator { } int get_gi_task_consumer_node(const ObPhyOperator* cur, ObPhyOperator*& child) const; - private: +private: uint64_t ref_table_id_; int64_t tablet_size_; // work and task affinitize diff --git a/src/sql/engine/px/ob_granule_iterator_op.h b/src/sql/engine/px/ob_granule_iterator_op.h index 4409ca324..d4bf26d2b 100644 --- a/src/sql/engine/px/ob_granule_iterator_op.h +++ b/src/sql/engine/px/ob_granule_iterator_op.h @@ -28,7 +28,7 @@ namespace sql { class ObGIOpInput : public ObOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObGIOpInput(ObExecContext& ctx, const ObOpSpec& spec); virtual ~ObGIOpInput() {} @@ -60,10 +60,10 @@ class ObGIOpInput : public ObOpInput { return worker_id_; } - private: +private: int deep_copy_range(ObIAllocator* allocator, const ObNewRange& src, ObNewRange& dst); - public: +public: // the dop, the QC deside the dop before our task send to SQC server // but the dop may be change as the worker server don't has enough process. int64_t parallelism_; @@ -76,14 +76,14 @@ class ObGIOpInput : public ObOpInput { common::ObSEArray pkeys_; ObGranulePump* pump_; - private: +private: common::ObIAllocator* deserialize_allocator_; }; class ObGranuleIteratorSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObGranuleIteratorSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObGranuleIteratorSpec() {} @@ -157,7 +157,7 @@ class ObGranuleIteratorSpec : public ObOpSpec { return partition_wise_join_ && !affinitize_; } - public: +public: uint64_t ref_table_id_; int64_t tablet_size_; // indicate whether has binds between threads and tasks @@ -173,7 +173,7 @@ class ObGranuleIteratorSpec : public ObOpSpec { }; class ObGranuleIteratorOp : public ObOperator { - private: +private: enum ObGranuleIteratorState { GI_UNINITIALIZED, GI_PREPARED, @@ -182,7 +182,7 @@ class ObGranuleIteratorOp : public ObOperator { GI_END, }; - public: +public: ObGranuleIteratorOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); ~ObGranuleIteratorOp() {} @@ -203,7 +203,7 @@ class ObGranuleIteratorOp : public ObOperator { return OPEN_SELF_FIRST; } - private: +private: int parameters_init(); int try_fetch_task(ObGranuleTaskInfo& info); int fetch_full_pw_tasks(ObIArray& infos, const ObIArray& op_ids); @@ -218,7 +218,7 @@ class ObGranuleIteratorOp : public ObOperator { int get_gi_task_consumer_node(ObOperator* cur, ObOperator*& child) const; int try_pruning_partition(const ObGITaskSet& taskset, ObGITaskSet::Pos& pos, bool& partition_pruned); - private: +private: int64_t parallelism_; int64_t worker_id_; uint64_t tsc_op_id_; diff --git a/src/sql/engine/px/ob_granule_pump.h b/src/sql/engine/px/ob_granule_pump.h index 3824869f8..a9e8e61d5 100644 --- a/src/sql/engine/px/ob_granule_pump.h +++ b/src/sql/engine/px/ob_granule_pump.h @@ -34,7 +34,7 @@ namespace sql { #define ModifyOp typename ObEngineOpTraits::TableModify class ObGranulePumpArgs { - public: +public: ObGranulePumpArgs(ObExecContext& ctx, const common::ObIArray& pkey_arrays, common::ObIArray& partitions_info, storage::ObPartitionService& part_ser) : ctx_(ctx), @@ -90,7 +90,7 @@ class ObGranulePumpArgs { int64_t tablet_size_; uint64_t gi_attri_flag_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGranulePumpArgs); }; @@ -98,7 +98,7 @@ class ObGranulePumpArgs { // For single table scan, there is only on element in partition_keys_ in ObGITaskSet. // For Partition Wise N table scan(multiple tables in one GI ), there are N elements in partition_keys_ of ObGITaskSet. class ObGITaskSet { - public: +public: struct Pos { Pos() : task_idx_(0), partition_idx_(0) {} @@ -118,18 +118,18 @@ class ObGITaskSet { int assign(const ObGITaskSet& other); int set_pw_affi_partition_order(bool asc); - private: +private: // reverse all tasks in the GI Task set. int reverse_task(); - public: +public: common::ObArray partition_keys_; common::ObArray ranges_; common::ObSEArray offsets_; common::ObSEArray partition_offsets_; Pos cur_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGITaskSet); }; @@ -159,24 +159,24 @@ static const int64_t PARTITION_WISE_JOIN_TSC_HASH_BUCKET_NUM = 8; typedef common::hash::ObHashMap TaskSetMap; class ObGranuleSplitter { - public: +public: ObGranuleSplitter() = default; virtual ~ObGranuleSplitter() = default; static int get_query_range(ObExecContext& ctx, const ObQueryRange& tsc_pre_query_range, ObIArray& ranges, int64_t table_id, bool partition_granule); - protected: +protected: int split_gi_task(ObExecContext& ctx, const ObQueryRange& tsc_pre_query_range, int64_t table_id, const common::ObIArray& pkeys, int64_t parallelism, int64_t tablet_size, storage::ObPartitionService& partition_service, bool partition_granule, ObGITaskSet& task_set); - public: +public: ObSEArray partitions_info_; }; class ObRandomGranuleSplitter : public ObGranuleSplitter { - public: +public: ObRandomGranuleSplitter() = default; virtual ~ObRandomGranuleSplitter() = default; template @@ -185,11 +185,11 @@ class ObRandomGranuleSplitter : public ObGranuleSplitter { storage::ObPartitionService& partition_service, GITaskArrayMap& gi_task_array_result, bool partition_granule = true); - private: +private: }; class ObAccessAllGranuleSplitter : public ObGranuleSplitter { - public: +public: ObAccessAllGranuleSplitter() = default; virtual ~ObAccessAllGranuleSplitter() = default; template @@ -198,12 +198,12 @@ class ObAccessAllGranuleSplitter : public ObGranuleSplitter { storage::ObPartitionService& partition_service, GITaskArrayMap& gi_task_array_result, bool partition_granule = true); - private: +private: int split_tasks_access_all(ObGITaskSet& taskset, int64_t parallelism, ObGITaskArray& taskset_array); }; class ObPartitionWiseGranuleSplitter : public ObGranuleSplitter { - public: +public: ObPartitionWiseGranuleSplitter() = default; virtual ~ObPartitionWiseGranuleSplitter() = default; template @@ -217,7 +217,7 @@ class ObPartitionWiseGranuleSplitter : public ObGranuleSplitter { storage::ObPartitionService& partition_service, GITaskArrayMap& gi_task_array_result, bool partition_granule = true); - private: +private: int split_insert_gi_task(ObExecContext& ctx, const uint64_t insert_table_id, const int64_t row_key_count, const common::ObIArray& pkeys, int64_t parallelism, int64_t tablet_size, storage::ObPartitionService& partition_service, bool partition_granule, ObGITaskSet& task_set); @@ -230,16 +230,16 @@ class ObPartitionWiseGranuleSplitter : public ObGranuleSplitter { }; class ObAffinitizeGranuleSplitter : public ObGranuleSplitter { - public: +public: ObAffinitizeGranuleSplitter() = default; virtual ~ObAffinitizeGranuleSplitter() = default; - protected: +protected: int split_tasks_affinity(ObExecContext& ctx, ObGITaskSet& taskset, int64_t parallelism, ObGITaskArray& taskset_array); }; class ObNormalAffinitizeGranuleSplitter : public ObAffinitizeGranuleSplitter { - public: +public: ObNormalAffinitizeGranuleSplitter() = default; virtual ~ObNormalAffinitizeGranuleSplitter() = default; template @@ -250,7 +250,7 @@ class ObNormalAffinitizeGranuleSplitter : public ObAffinitizeGranuleSplitter { }; class ObPWAffinitizeGranuleSplitter : public ObAffinitizeGranuleSplitter { - public: +public: ObPWAffinitizeGranuleSplitter() = default; virtual ~ObPWAffinitizeGranuleSplitter() = default; template @@ -267,7 +267,7 @@ class ObPWAffinitizeGranuleSplitter : public ObAffinitizeGranuleSplitter { // the worker who revice the DFO will genrate a ObGranulePump object, // and the worker who end last destroy this object. class ObGranulePump { - private: +private: static const int64_t OB_GRANULE_SHARED_POOL_POS = 0; enum ObGranuleSplitterType { GIT_UNINITIALIZED, @@ -278,7 +278,7 @@ class ObGranulePump { GIT_RANDOM, }; - public: +public: ObGranulePump() : lock_(), parallelism_(-1), @@ -303,7 +303,7 @@ class ObGranulePump { int try_fetch_pwj_tasks(ObIArray& infos, const ObIArray& op_ids, int64_t worker_id); DECLARE_TO_STRING; - private: +private: template int add_new_gi_task_inner(ObGranulePumpArgs& args, ObIArray& scan_ops, const ModifyOp* modify_op); @@ -321,7 +321,7 @@ class ObGranulePump { int find_taskset_by_tsc_id(uint64_t op_id, ObGITaskArray*& taskset_array); - private: +private: common::ObSpinLock lock_; int64_t parallelism_; int64_t tablet_size_; diff --git a/src/sql/engine/px/ob_granule_util.h b/src/sql/engine/px/ob_granule_util.h index 54f8501c8..dd306f8fd 100644 --- a/src/sql/engine/px/ob_granule_util.h +++ b/src/sql/engine/px/ob_granule_util.h @@ -129,7 +129,7 @@ struct ObParallelBlockRangeTaskParams { }; class ObGranuleUtil { - public: +public: /** * * params IN we got total task count by rules; the rule needs these params @@ -187,7 +187,7 @@ class ObGranuleUtil { static int remove_false_range(const common::ObIArray& in_ranges, common::ObIArray& ranges, bool& only_false_range); - public: +public: /** * split tasks by block granule method * allocator IN memory allocator @@ -210,7 +210,7 @@ class ObGranuleUtil { common::ObIArray& tasks_ranges, common::ObIArray& tasks_offsets, common::ObIArray& tasks_partition_offsets); - private: +private: /** * get the total task count for all partitions * params IN the parameters for splitting diff --git a/src/sql/engine/px/ob_light_granule_iterator.h b/src/sql/engine/px/ob_light_granule_iterator.h index a2204ee37..c618da6b6 100644 --- a/src/sql/engine/px/ob_light_granule_iterator.h +++ b/src/sql/engine/px/ob_light_granule_iterator.h @@ -29,7 +29,7 @@ class ObLGIInput : public ObIPhyOperatorInput { struct ObArrayParamInfo { OB_UNIS_VERSION(1); - public: + public: ObArrayParamInfo() : param_store_idx_(common::OB_INVALID_INDEX), array_param_() {} TO_STRING_KV(K_(param_store_idx), K_(array_param)); @@ -41,7 +41,7 @@ class ObLGIInput : public ObIPhyOperatorInput { friend class ObLGICtx; OB_UNIS_VERSION_V(1); - public: +public: ObLGIInput() : location_idx_list_(), part_stmt_ids_(), deserialize_allocator_(nullptr) {} virtual ~ObLGIInput() @@ -58,25 +58,25 @@ class ObLGIInput : public ObIPhyOperatorInput { int assign_pkeys(const common::ObIArray& pkeys); TO_STRING_KV(K_(location_idx_list), K_(param_array_list), K_(part_stmt_ids)); - private: +private: int init_param_array_list(ObPhysicalPlanCtx& plan_ctx, ObPhyTableLocation& table_loc, ObTaskInfo& task_info, const ObLightGranuleIterator& op); - private: +private: ObFixedArray location_idx_list_; // nested table param for every partition. common::ObSEArray param_array_list_; // stmt_id for every partition. common::ObFixedArray, common::ObIAllocator> part_stmt_ids_; - private: +private: common::ObIAllocator* deserialize_allocator_; DISALLOW_COPY_AND_ASSIGN(ObLGIInput); }; class ObLightGranuleIterator : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - private: +private: enum ObGranuleIteratorState { LGI_UNINITIALIZED, LGI_PREPARED, @@ -85,11 +85,11 @@ class ObLightGranuleIterator : public ObSingleChildPhyOperator { LGI_END, }; - public: +public: struct ObLGIScanInfo { OB_UNIS_VERSION(1); - public: + public: ObLGIScanInfo() : ref_table_id_(common::OB_INVALID_ID), table_location_key_(common::OB_INVALID_ID), @@ -103,7 +103,7 @@ class ObLightGranuleIterator : public ObSingleChildPhyOperator { class ObLGICtx : public ObPhyOperatorCtx { friend class ObLightGranuleIterator; - public: + public: ObLGICtx(ObExecContext& exec_ctx) : ObPhyOperatorCtx(exec_ctx), cur_granule_pos_(0), @@ -122,14 +122,14 @@ class ObLightGranuleIterator : public ObSingleChildPhyOperator { } TO_STRING_KV(K_(cur_granule_pos), K_(cur_part_id), K_(cur_param_idx), K_(state)); - private: + private: int64_t cur_granule_pos_; int64_t cur_part_id_; int64_t cur_param_idx_; ObGranuleIteratorState state_; }; - public: +public: explicit ObLightGranuleIterator(common::ObIAllocator& alloc); virtual ~ObLightGranuleIterator(); virtual void reset() override; @@ -152,7 +152,7 @@ class ObLightGranuleIterator : public ObSingleChildPhyOperator { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObLightGranuleIterator); - public: +public: void set_dml_location_key(uint64_t table_location_key) { dml_location_key_ = table_location_key; @@ -186,7 +186,7 @@ class ObLightGranuleIterator : public ObSingleChildPhyOperator { return array_param_idxs_; } - private: +private: int try_fetch_task(ObExecContext& ctx, ObGranuleTaskInfo& info) const; int try_fetch_task_with_pwj(ObExecContext& ctx, common::ObIArray& lgi_tasks) const; int try_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; @@ -195,7 +195,7 @@ class ObLightGranuleIterator : public ObSingleChildPhyOperator { int handle_batch_stmt_implicit_cursor(ObExecContext& ctx) const; static bool is_task_end(ObLGICtx& lgi_ctx, ObLGIInput& lgi_input); - private: +private: uint64_t dml_location_key_; uint64_t dml_op_id_; bool is_pwj_; diff --git a/src/sql/engine/px/ob_px_admission.h b/src/sql/engine/px/ob_px_admission.h index 34cd62eba..2e8bebf5d 100644 --- a/src/sql/engine/px/ob_px_admission.h +++ b/src/sql/engine/px/ob_px_admission.h @@ -27,7 +27,7 @@ class ObPhysicalPlan; class ObExecContext; class ObPxAdmission { - public: +public: ObPxAdmission() = default; ~ObPxAdmission() = default; static bool admit(int64_t cnt, int64_t& admit_cnt); @@ -36,13 +36,13 @@ class ObPxAdmission { sql::ObSQLSessionInfo& session, sql::ObExecContext& exec_ctx, sql::ObPhysicalPlan& plan, int64_t& worker_count); static void exit_query_admission(int64_t worker_count); - private: +private: /* variables */ DISALLOW_COPY_AND_ASSIGN(ObPxAdmission); }; class ObPxPoolStat { - public: +public: static int mtl_init(ObPxPoolStat*& pool) { int ret = common::OB_SUCCESS; @@ -64,7 +64,7 @@ class ObPxPoolStat { pool = nullptr; } - public: +public: // PARALLEL_SERVERS_TARGET inline int64_t get_target() const { @@ -93,7 +93,7 @@ class ObPxPoolStat { TO_STRING_KV(K_(target), K_(parallel_servers_target_used), K_(pool_size), K_(max_parallel_servers_used)); - private: +private: // PARALLEL_SERVERS_TARGET int64_t target_; int64_t parallel_servers_target_used_; // The number of threads currently occupied by the worker @@ -106,13 +106,13 @@ class ObPxPoolStat { }; class ObPxSubAdmission { - public: +public: ObPxSubAdmission() = default; ~ObPxSubAdmission() = default; static void acquire(int64_t max, int64_t min, int64_t& acquired_cnt); static void release(int64_t acquired_cnt); - private: +private: /* variables */ DISALLOW_COPY_AND_ASSIGN(ObPxSubAdmission); }; diff --git a/src/sql/engine/px/ob_px_coord.h b/src/sql/engine/px/ob_px_coord.h index ecb0e4efe..c066c71bd 100644 --- a/src/sql/engine/px/ob_px_coord.h +++ b/src/sql/engine/px/ob_px_coord.h @@ -37,11 +37,11 @@ class ObPxMergeSortCoord; class ObPxCoord : public ObPxReceive { OB_UNIS_VERSION_V(1); - public: +public: class ObPxCoordCtx : public ObPxReceiveCtx, public ObPxRootDfoAction { static const int64_t QC_INTP_CONTEXT_HASH_BUCKET = 32; - public: + public: explicit ObPxCoordCtx(ObExecContext& ctx); virtual ~ObPxCoordCtx(); virtual void destroy() @@ -79,7 +79,7 @@ class ObPxCoord : public ObPxReceive { virtual int receive_channel_root_dfo(ObExecContext& ctx, ObDfo& parent, ObPxTaskChSets& parent_ch_sets); virtual int receive_channel_root_dfo(ObExecContext& ctx, ObDfo& parent, dtl::ObDtlChTotalInfo& ch_info); - protected: + protected: common::ObArenaAllocator allocator_; common::ObArenaAllocator row_allocator_; ObPxCoordInfo coord_info_; @@ -100,7 +100,7 @@ class ObPxCoord : public ObPxReceive { friend class ObPxCoord; }; - public: +public: explicit ObPxCoord(common::ObIAllocator& alloc); virtual ~ObPxCoord(); inline void set_expected_worker_count(int64_t c) @@ -114,7 +114,7 @@ class ObPxCoord : public ObPxReceive { // int open(); // for debug purpose, should remove later // inline void set_dfo_tree(ObDfo &root) { root_ = &root;} - protected: +protected: /** * @brief open operator, not including children operators. * called by open. @@ -135,7 +135,7 @@ class ObPxCoord : public ObPxReceive { return common::OB_SUCCESS; } - protected: +protected: /* destroy all channel */ int destroy_all_channel(ObPxCoordCtx& px_ctx) const; /* setup input for every op with in dfo */ @@ -170,7 +170,7 @@ class ObPxCoord : public ObPxReceive { int register_interrupt(ObPxCoordCtx* px_ctx) const; void clear_interrupt(ObPxCoordCtx* px_ctx) const; - private: +private: // for multi-px concurrent limiting int64_t px_expected_worker_count_; /* variables */ diff --git a/src/sql/engine/px/ob_px_coord_msg_proc.cpp b/src/sql/engine/px/ob_px_coord_msg_proc.cpp index 80f4e3686..859717b52 100644 --- a/src/sql/engine/px/ob_px_coord_msg_proc.cpp +++ b/src/sql/engine/px/ob_px_coord_msg_proc.cpp @@ -21,7 +21,7 @@ using namespace oceanbase::sql; template class ObDhWholeeMsgProc { - public: +public: ObDhWholeeMsgProc() = default; ~ObDhWholeeMsgProc() = default; int on_whole_msg(ObSqcCtx& sqc_ctx, const WholeMsg& pkt) const diff --git a/src/sql/engine/px/ob_px_coord_msg_proc.h b/src/sql/engine/px/ob_px_coord_msg_proc.h index b47271d5d..3ddfffe3c 100644 --- a/src/sql/engine/px/ob_px_coord_msg_proc.h +++ b/src/sql/engine/px/ob_px_coord_msg_proc.h @@ -24,7 +24,7 @@ class ObBarrierPieceMsg; class ObWinbufWholeMsg; class ObWinbufPieceMsg; class ObIPxCoordMsgProc { - public: +public: // msg processor callback virtual int on_sqc_init_msg(ObExecContext& ctx, const ObPxInitSqcResultMsg& pkt) = 0; virtual int on_sqc_finish_msg(ObExecContext& ctx, const ObPxFinishSqcResultMsg& pkt) = 0; @@ -36,7 +36,7 @@ class ObIPxCoordMsgProc { }; class ObIPxSubCoordMsgProc { - public: +public: virtual int on_transmit_data_ch_msg(const ObPxTransmitDataChannelMsg& pkt) const = 0; virtual int on_receive_data_ch_msg(const ObPxReceiveDataChannelMsg& pkt) const = 0; virtual int on_whole_msg(const ObBarrierWholeMsg& pkt) const = 0; @@ -47,7 +47,7 @@ class ObIPxSubCoordMsgProc { class ObPxRpcInitSqcArgs; class ObSqcCtx; class ObPxSubCoordMsgProc : public ObIPxSubCoordMsgProc { - public: +public: ObPxSubCoordMsgProc(ObPxRpcInitSqcArgs& sqc_arg, ObSqcCtx& sqc_ctx) : sqc_arg_(sqc_arg), sqc_ctx_(sqc_ctx) {} ~ObPxSubCoordMsgProc() = default; @@ -57,7 +57,7 @@ class ObPxSubCoordMsgProc : public ObIPxSubCoordMsgProc { virtual int on_whole_msg(const ObBarrierWholeMsg& pkt) const; virtual int on_whole_msg(const ObWinbufWholeMsg& pkt) const; - private: +private: ObPxRpcInitSqcArgs& sqc_arg_; ObSqcCtx& sqc_ctx_; }; diff --git a/src/sql/engine/px/ob_px_coord_op.h b/src/sql/engine/px/ob_px_coord_op.h index 3c6f8b4ec..afefacb48 100644 --- a/src/sql/engine/px/ob_px_coord_op.h +++ b/src/sql/engine/px/ob_px_coord_op.h @@ -31,7 +31,7 @@ namespace sql { class ObPxCoordSpec : public ObPxReceiveSpec { OB_UNIS_VERSION_V(1); - public: +public: ObPxCoordSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObPxReceiveSpec(alloc, type), px_expected_worker_count_(0), qc_id_(common::OB_INVALID_ID) {} @@ -51,12 +51,12 @@ class ObPxCoordSpec : public ObPxReceiveSpec { }; class ObPxCoordOp : public ObPxReceiveOp, public ObPxRootDfoAction { - public: +public: ObPxCoordOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObPxCoordOp() {} - public: +public: virtual int inner_open() override; virtual int rescan() override; virtual int inner_close() override; @@ -89,7 +89,7 @@ class ObPxCoordOp : public ObPxReceiveOp, public ObPxRootDfoAction { virtual int receive_channel_root_dfo(ObExecContext& ctx, ObDfo& parent, ObPxTaskChSets& parent_ch_sets) override; virtual int receive_channel_root_dfo(ObExecContext& ctx, ObDfo& parent, dtl::ObDtlChTotalInfo& ch_info) override; - protected: +protected: virtual int free_allocator() { return common::OB_SUCCESS; @@ -135,7 +135,7 @@ class ObPxCoordOp : public ObPxReceiveOp, public ObPxRootDfoAction { return &first_buffer_cache_; } - protected: +protected: common::ObArenaAllocator allocator_; common::ObArenaAllocator row_allocator_; ObPxCoordInfo coord_info_; diff --git a/src/sql/engine/px/ob_px_data_ch_provider.h b/src/sql/engine/px/ob_px_data_ch_provider.h index 0baff5337..fe6cbb693 100644 --- a/src/sql/engine/px/ob_px_data_ch_provider.h +++ b/src/sql/engine/px/ob_px_data_ch_provider.h @@ -22,13 +22,13 @@ namespace oceanbase { namespace sql { class ObPxChProviderUtil { - public: +public: static int inner_get_data_ch(bool ch_map_opt, ObPxTaskChSets& ch_sets, dtl::ObDtlChTotalInfo& ch_total_info, const int64_t sqc_id, const int64_t task_id, ObPxTaskChSet& ch_set, bool is_transmit); }; class ObPxTransmitChProvider { - public: +public: ObPxTransmitChProvider() : msg_set_(false) {} virtual ~ObPxTransmitChProvider() = default; @@ -41,19 +41,19 @@ class ObPxTransmitChProvider { int get_part_ch_map_nonblock(ObPxPartChInfo& map, int64_t timeout_ts); int add_msg(const ObPxTransmitDataChannelMsg& msg); - private: +private: int wait_msg(int64_t timeout_ts); int check_status(int64_t timeout_ts); int inner_get_part_ch_map(ObPxPartChInfo& map); - private: +private: bool msg_set_; ObPxTransmitDataChannelMsg msg_; common::ObThreadCond msg_ready_cond_; }; class ObPxReceiveChProvider { - public: +public: ObPxReceiveChProvider() {} virtual ~ObPxReceiveChProvider() = default; @@ -64,16 +64,16 @@ class ObPxReceiveChProvider { ObPxTaskChSet& ch_set, dtl::ObDtlChTotalInfo* ch_info); int add_msg(const ObPxReceiveDataChannelMsg& msg); - private: +private: /* functions */ int wait_msg(int64_t child_dfo_id, int64_t timeout_ts); int check_status(int64_t timeout_ts); int reserve_msg_set_array_size(int64_t size); - private: +private: static const int64_t MSG_SET_DEFAULT_SIZE = 16; - private: +private: /* variables */ common::ObSEArray msgs_; common::ObThreadCond msg_ready_cond_; @@ -84,7 +84,7 @@ class ObPxReceiveChProvider { // Root Dfo Provider class ObPxRootReceiveChProvider { - public: +public: ObPxRootReceiveChProvider() : root_dfo_(NULL) {} ~ObPxRootReceiveChProvider() = default; @@ -108,7 +108,7 @@ class ObPxRootReceiveChProvider { root_dfo_ = nullptr; } - private: +private: ObDfo* root_dfo_; }; diff --git a/src/sql/engine/px/ob_px_dtl_msg.h b/src/sql/engine/px/ob_px_dtl_msg.h index c29dfe7cf..48563e23c 100644 --- a/src/sql/engine/px/ob_px_dtl_msg.h +++ b/src/sql/engine/px/ob_px_dtl_msg.h @@ -30,7 +30,7 @@ namespace sql { struct ObPxPartitionInfo { OB_UNIS_VERSION(1); - public: +public: ObPxPartitionInfo() : partition_key_(), logical_row_count_(0), physical_row_count_(0) {} virtual ~ObPxPartitionInfo() = default; @@ -48,7 +48,7 @@ struct ObPxPartitionInfo { struct ObPxDmlRowInfo { OB_UNIS_VERSION(1); - public: +public: ObPxDmlRowInfo() : row_match_count_(0), row_duplicated_count_(0), row_deleted_count_(0) {} ~ObPxDmlRowInfo() = default; @@ -66,7 +66,7 @@ struct ObPxDmlRowInfo { row_deleted_count_ += row_info.row_deleted_count_; } TO_STRING_KV(K_(row_match_count), K_(row_duplicated_count), K_(row_deleted_count)) - public: +public: int64_t row_match_count_; int64_t row_duplicated_count_; int64_t row_deleted_count_; @@ -75,7 +75,7 @@ struct ObPxDmlRowInfo { class ObPxTaskMonitorInfo { OB_UNIS_VERSION(1); - public: +public: ObPxTaskMonitorInfo() : sched_exec_time_start_(0), sched_exec_time_end_(0), exec_time_start_(0), exec_time_end_(0) {} ObPxTaskMonitorInfo& operator=(const ObPxTaskMonitorInfo& other) @@ -125,7 +125,7 @@ class ObPxTaskMonitorInfo { TO_STRING_KV( K_(sched_exec_time_start), K_(sched_exec_time_end), K_(exec_time_start), K_(exec_time_end), K(metrics_.count())); - private: +private: int64_t sched_exec_time_start_; int64_t sched_exec_time_end_; int64_t exec_time_start_; @@ -138,7 +138,7 @@ typedef common::ObSEArray ObPxTaskMonitorInfoArray; class ObPxTaskChSet : public dtl::ObDtlChSet { OB_UNIS_VERSION(1); - public: +public: ObPxTaskChSet() : sqc_id_(common::OB_INVALID_INDEX), task_id_(common::OB_INVALID_INDEX), sm_group_id_(common::OB_INVALID_INDEX) {} @@ -169,7 +169,7 @@ class ObPxTaskChSet : public dtl::ObDtlChSet { } int assign(const ObPxTaskChSet& ch_set); - private: +private: int64_t sqc_id_; int64_t task_id_; int64_t sm_group_id_; @@ -185,7 +185,7 @@ typedef common::ObArray { OB_UNIS_VERSION_V(1); - public: +public: ObPxReceiveDataChannelMsg() : child_dfo_id_(-1), ch_sets_(), ch_map_opt_(false), ch_total_info_() {} virtual ~ObPxReceiveDataChannelMsg() = default; @@ -282,7 +282,7 @@ class ObPxReceiveDataChannelMsg : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: ObPxTransmitDataChannelMsg() : ch_sets_(), ch_total_info_(), part_affinity_map_(), ch_map_opt_(false) {} virtual ~ObPxTransmitDataChannelMsg() = default; @@ -368,7 +368,7 @@ class ObPxTransmitDataChannelMsg : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: ObPxInitSqcResultMsg() : dfo_id_(common::OB_INVALID_ID), sqc_id_(common::OB_INVALID_ID), rc_(common::OB_SUCCESS), task_count_(0) {} @@ -387,7 +387,7 @@ class ObPxInitSqcResultMsg : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: ObPxFinishSqcResultMsg() : dfo_id_(common::OB_INVALID_ID), sqc_id_(common::OB_INVALID_ID), @@ -430,7 +430,7 @@ class ObPxFinishSqcResultMsg : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: ObPxFinishTaskResultMsg() : dfo_id_(common::OB_INVALID_ID), sqc_id_(common::OB_INVALID_ID), @@ -465,7 +465,7 @@ class ObPxFinishTaskResultMsg : public dtl::ObDtlMsgTemp { - public: +public: ObPxFinishSqcResultP(ObExecContext& ctx, ObIPxCoordMsgProc& msg_proc) : ctx_(ctx), msg_proc_(msg_proc) {} virtual ~ObPxFinishSqcResultP() = default; int process(const ObPxFinishSqcResultMsg& pkt) override; - private: +private: ObExecContext& ctx_; ObIPxCoordMsgProc& msg_proc_; }; class ObPxInitSqcResultP : public dtl::ObDtlPacketProc { - public: +public: ObPxInitSqcResultP(ObExecContext& ctx, ObIPxCoordMsgProc& msg_proc) : ctx_(ctx), msg_proc_(msg_proc) {} virtual ~ObPxInitSqcResultP() = default; int process(const ObPxInitSqcResultMsg& pkt) override; - private: +private: ObExecContext& ctx_; ObIPxCoordMsgProc& msg_proc_; }; class ObPxQcInterruptedP : public dtl::ObDtlInterruptProc { - public: +public: ObPxQcInterruptedP(ObExecContext& ctx, ObIPxCoordMsgProc& msg_proc) : ctx_(ctx), msg_proc_(msg_proc) {} virtual ~ObPxQcInterruptedP() = default; int process(const common::ObInterruptCode& ic) override; - private: +private: ObExecContext& ctx_; ObIPxCoordMsgProc& msg_proc_; }; @@ -68,40 +68,40 @@ class ObPxQcInterruptedP : public dtl::ObDtlInterruptProc { //////////////////////////// FOR SQC //////////////////////////// class ObPxReceiveDataChannelMsgP : public dtl::ObDtlPacketProc { - public: +public: ObPxReceiveDataChannelMsgP(ObIPxSubCoordMsgProc& msg_proc) : msg_proc_(msg_proc) {} virtual ~ObPxReceiveDataChannelMsgP() = default; int process(const ObPxReceiveDataChannelMsg& pkt) override; - private: +private: ObIPxSubCoordMsgProc& msg_proc_; }; class ObPxTransmitDataChannelMsgP : public dtl::ObDtlPacketProc { - public: +public: ObPxTransmitDataChannelMsgP(ObIPxSubCoordMsgProc& msg_proc) : msg_proc_(msg_proc) {} virtual ~ObPxTransmitDataChannelMsgP() = default; int process(const ObPxTransmitDataChannelMsg& pkt) override; - private: +private: ObIPxSubCoordMsgProc& msg_proc_; }; class ObPxSqcInterruptedP : public dtl::ObDtlInterruptProc { - public: +public: ObPxSqcInterruptedP(ObIPxSubCoordMsgProc& msg_proc) : msg_proc_(msg_proc) {} virtual ~ObPxSqcInterruptedP() = default; int process(const common::ObInterruptCode& ic) override; - private: +private: ObIPxSubCoordMsgProc& msg_proc_; }; class ObPxReceiveRowP : public dtl::ObDtlPacketProc { - public: +public: explicit ObPxReceiveRowP(ObPxNewRow& px_row) : row_allocator_(common::ObModIds::OB_SQL_PX), px_row_(px_row) {} virtual ~ObPxReceiveRowP() = default; @@ -120,13 +120,13 @@ class ObPxReceiveRowP : public dtl::ObDtlPacketProc { return px_row_.has_iter(); } - private: +private: ObArenaAllocator row_allocator_; ObPxNewRow& px_row_; }; class ObPxInterruptP : public dtl::ObDtlInterruptProc { - public: +public: virtual ~ObPxInterruptP() = default; int process(const common::ObInterruptCode& ic) override; }; diff --git a/src/sql/engine/px/ob_px_exchange.h b/src/sql/engine/px/ob_px_exchange.h index 7be0eaf2f..19dad6ab4 100644 --- a/src/sql/engine/px/ob_px_exchange.h +++ b/src/sql/engine/px/ob_px_exchange.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObPxExchangeInput : public ObIPhyOperatorInput { - public: +public: ObPxExchangeInput() : task_id_(common::OB_INVALID_ID), sqc_id_(common::OB_INVALID_ID), dfo_id_(common::OB_INVALID_ID) {} virtual ~ObPxExchangeInput() = default; @@ -52,14 +52,14 @@ class ObPxExchangeInput : public ObIPhyOperatorInput { return dfo_id_; } - protected: +protected: int64_t task_id_; int64_t sqc_id_; int64_t dfo_id_; }; class ObPxExchangeOpInput : public ObOpInput { - public: +public: ObPxExchangeOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObOpInput(ctx, spec), task_id_(common::OB_INVALID_ID), @@ -95,7 +95,7 @@ class ObPxExchangeOpInput : public ObOpInput { return dfo_id_; } - protected: +protected: int64_t task_id_; int64_t sqc_id_; int64_t dfo_id_; diff --git a/src/sql/engine/px/ob_px_fifo_coord.h b/src/sql/engine/px/ob_px_fifo_coord.h index 35dab0ff7..f933c055f 100644 --- a/src/sql/engine/px/ob_px_fifo_coord.h +++ b/src/sql/engine/px/ob_px_fifo_coord.h @@ -33,10 +33,10 @@ class ObPxFifoCoord; class ObPxMergeSortCoord; class ObPxFifoCoordInput : public ObPxReceiveInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxFifoCoordInput() : ObPxReceiveInput() {} virtual ~ObPxFifoCoordInput() @@ -48,19 +48,19 @@ class ObPxFifoCoordInput : public ObPxReceiveInput { }; class ObPxFifoCoord : public ObPxCoord { - public: +public: class ObPxFifoCoordCtx; - public: +public: class ObPxFifoCoordEventListener : public ObIPxCoordEventListener { - public: + public: virtual int on_root_data_channel_setup() { return common::OB_SUCCESS; } }; class ObPxFifoCoordCtx : public ObPxCoordCtx { - public: + public: explicit ObPxFifoCoordCtx(ObExecContext& ctx) : ObPxCoordCtx(ctx), serial_scheduler_(coord_info_, *this, listener_), @@ -102,7 +102,7 @@ class ObPxFifoCoord : public ObPxCoord { return msg_proc_; } - protected: + protected: ObPxFifoCoordEventListener listener_; ObSerialDfoScheduler serial_scheduler_; ObPxMsgProc msg_proc_; // dtl message callback for msg_loop @@ -115,13 +115,13 @@ class ObPxFifoCoord : public ObPxCoord { friend class ObPxFifoCoord; }; - public: +public: explicit ObPxFifoCoord(common::ObIAllocator& alloc); virtual ~ObPxFifoCoord(); // int open(); // for debug purpose, should remove later // inline void set_dfo_tree(ObDfo &root) { root_ = &root;} - private: +private: /** * @brief called by get_next_row(), get a row from the child operator or row_store * @param ctx[in], execute context diff --git a/src/sql/engine/px/ob_px_interruption.h b/src/sql/engine/px/ob_px_interruption.h index 51ba4b44b..2097f7c50 100644 --- a/src/sql/engine/px/ob_px_interruption.h +++ b/src/sql/engine/px/ob_px_interruption.h @@ -29,7 +29,7 @@ class ObPxSqcMeta; struct ObPxInterruptID { OB_UNIS_VERSION(1); - public: +public: ObPxInterruptID() : query_interrupt_id_(0), px_interrupt_id_(0) {} void operator=(const ObPxInterruptID& other) @@ -49,16 +49,16 @@ struct ObPxInterruptID { }; class ObPxInterruptGuard { - public: +public: ObPxInterruptGuard(const common::ObInterruptibleTaskID& interrupt_id_); ~ObPxInterruptGuard(); - private: +private: common::ObInterruptibleTaskID interrupt_id_; }; class ObInterruptUtil { - public: +public: // QC send interrupt to all SQC and tasks in the px. static int broadcast_px(common::ObIArray& dfos, int code); // QC send interrupt to all SQC and tasks in the dfo @@ -78,7 +78,7 @@ class ObInterruptUtil { }; class ObDfoInterruptIdGen { - public: +public: ObDfoInterruptIdGen(const common::ObInterruptibleTaskID& query_interrupt_id, const uint32_t server_id, const uint32_t qc_id, const uint64_t px_sequence_id) : query_interrupt_id_(query_interrupt_id), server_id_(server_id), qc_id_(qc_id), px_sequence_id_(px_sequence_id) @@ -96,7 +96,7 @@ class ObDfoInterruptIdGen { return px_sequence_id_; } - private: +private: const common::ObInterruptibleTaskID& query_interrupt_id_; const uint32_t server_id_; const uint32_t qc_id_; diff --git a/src/sql/engine/px/ob_px_merge_sort_coord.h b/src/sql/engine/px/ob_px_merge_sort_coord.h index f2eb1e04e..384fa9590 100644 --- a/src/sql/engine/px/ob_px_merge_sort_coord.h +++ b/src/sql/engine/px/ob_px_merge_sort_coord.h @@ -36,10 +36,10 @@ class ObPxMergeSortCoord; class ObPxMergeSortCoord; class ObPxMergeSortCoordInput : public ObPxReceiveInput { - public: +public: OB_UNIS_VERSION_V(1); - public: +public: ObPxMergeSortCoordInput() : ObPxReceiveInput() {} virtual ~ObPxMergeSortCoordInput() @@ -51,7 +51,7 @@ class ObPxMergeSortCoordInput : public ObPxReceiveInput { }; class ObMsgReceiveSortOrder : public dtl::ObIDltChannelLoopPred { - public: +public: ObMsgReceiveSortOrder(ObRowHeap<>& heap) : data_ch_idx_start_(-1), data_ch_idx_end_(-1), heap_(heap) {} ~ObMsgReceiveSortOrder() = default; @@ -74,28 +74,28 @@ class ObMsgReceiveSortOrder : public dtl::ObIDltChannelLoopPred { return data_ch_idx_start_; } - private: +private: int64_t data_ch_idx_start_; int64_t data_ch_idx_end_; ObRowHeap<>& heap_; }; class ObPxMergeSortCoord : public ObPxCoord, public ObSortableTrait { - public: +public: class ObPxMergeSortCoordCtx; - public: +public: class ObPxMergeSortCoordEventListener : public ObIPxCoordEventListener { - public: + public: ObPxMergeSortCoordEventListener(ObPxMergeSortCoordCtx& px_ctx) : px_ctx_(px_ctx) {} int on_root_data_channel_setup(); - private: + private: ObPxMergeSortCoordCtx& px_ctx_; }; class ObPxMergeSortCoordCtx : public ObPxCoordCtx { - public: + public: explicit ObPxMergeSortCoordCtx(ObExecContext& ctx) : ObPxCoordCtx(ctx), listener_(*this), @@ -153,7 +153,7 @@ class ObPxMergeSortCoord : public ObPxCoord, public ObSortableTrait { return msg_proc_; } - protected: + protected: ObPxMergeSortCoordEventListener listener_; ObSerialDfoScheduler serial_scheduler_; ObPxMsgProc msg_proc_; @@ -171,14 +171,14 @@ class ObPxMergeSortCoord : public ObPxCoord, public ObSortableTrait { friend class ObPxMergeSortCoord; }; - public: +public: explicit ObPxMergeSortCoord(common::ObIAllocator& alloc) : ObPxCoord(alloc), ObSortableTrait(alloc) {} virtual ~ObPxMergeSortCoord() = default; // int open(); // for debug purpose, should remove later // inline void set_dfo_tree(ObDfo &root) { root_ = &root;} - private: +private: /** * @brief called by get_next_row(), get a row from the child operator or row_store * @param ctx[in], execute context diff --git a/src/sql/engine/px/ob_px_op_size_factor.h b/src/sql/engine/px/ob_px_op_size_factor.h index 7b2af52a8..cadfa1f20 100644 --- a/src/sql/engine/px/ob_px_op_size_factor.h +++ b/src/sql/engine/px/ob_px_op_size_factor.h @@ -22,7 +22,7 @@ namespace sql { struct PxOpSizeFactor { OB_UNIS_VERSION(1); - public: +public: PxOpSizeFactor() : block_granule_child_(false), block_granule_parent_(false), diff --git a/src/sql/engine/px/ob_px_row_store.h b/src/sql/engine/px/ob_px_row_store.h index 2164e6950..c6cee7198 100644 --- a/src/sql/engine/px/ob_px_row_store.h +++ b/src/sql/engine/px/ob_px_row_store.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace sql { class ObDtlMsgReader : public dtl::ObDtlMsgIterator { - public: +public: virtual void set_iterator_end() = 0; virtual bool has_next() = 0; @@ -39,7 +39,7 @@ class ObDtlMsgReader : public dtl::ObDtlMsgIterator { }; class ObPxNewRowIterator : public ObDtlMsgReader { - public: +public: ObPxNewRowIterator(); virtual ~ObPxNewRowIterator(); @@ -91,7 +91,7 @@ class ObPxNewRowIterator : public ObDtlMsgReader { } void set_end() override; - private: +private: bool is_eof_; bool is_iter_end_; int64_t rows_; @@ -101,7 +101,7 @@ class ObPxNewRowIterator : public ObDtlMsgReader { }; class ObPxDatumRowIterator : public ObDtlMsgReader { - public: +public: ObPxDatumRowIterator(); virtual ~ObPxDatumRowIterator(); @@ -152,7 +152,7 @@ class ObPxDatumRowIterator : public ObDtlMsgReader { } void set_end() override; - private: +private: bool is_eof_; bool is_iter_end_; int64_t rows_; @@ -164,7 +164,7 @@ class ObPxDatumRowIterator : public ObDtlMsgReader { class ObPxNewRow : public dtl::ObDtlMsgTemp { OB_UNIS_VERSION_V(1); - public: +public: // for deserialize ObPxNewRow() : des_row_buf_(nullptr), @@ -240,7 +240,7 @@ class ObPxNewRow : public dtl::ObDtlMsgTemp { } TO_STRING_KV(K_(row_cell_count), K_(des_row_buf_size)); - private: +private: static const int64_t EOF_ROW_FLAG = -1; char* des_row_buf_; int64_t des_row_buf_size_; diff --git a/src/sql/engine/px/ob_px_rpc_processor.h b/src/sql/engine/px/ob_px_rpc_processor.h index 82dbc0141..59990e227 100644 --- a/src/sql/engine/px/ob_px_rpc_processor.h +++ b/src/sql/engine/px/ob_px_rpc_processor.h @@ -25,7 +25,7 @@ namespace sql { class ObPxSqcHandler; class ObInitSqcP : public obrpc::ObRpcProcessor> { - public: +public: ObInitSqcP(const observer::ObGlobalContext& gctx) : gctx_(gctx), exec_ctx_(gctx.session_mgr_), @@ -39,10 +39,10 @@ class ObInitSqcP : public obrpc::ObRpcProcessor> { - public: +public: ObInitTaskP(const observer::ObGlobalContext& gctx) : gctx_(gctx), exec_ctx_(gctx.session_mgr_), phy_plan_(), des_allocator_(ObModIds::OB_SQL_PX) {} @@ -60,7 +60,7 @@ class ObInitTaskP : public obrpc::ObRpcProcessor> { - public: +public: ObInitFastSqcP(const observer::ObGlobalContext& gctx) : gctx_(gctx), exec_ctx_(gctx.session_mgr_), @@ -84,10 +84,10 @@ class ObInitFastSqcP : public obrpc::ObRpcProcessor& entry); - private: +private: ObPxSqcMeta* sqc_; }; class ObDealWithRpcTimeoutCall { - public: +public: ObDealWithRpcTimeoutCall( common::ObAddr addr, ObQueryRetryInfo* retry_info, int64_t timeout_ts, common::ObCurTraceId::TraceId& trace_id) : addr_(addr), retry_info_(retry_info), timeout_ts_(timeout_ts), trace_id_(trace_id), ret_(common::OB_TIMEOUT) @@ -116,7 +116,7 @@ class ObDealWithRpcTimeoutCall { void operator()(hash::HashMapPair& entry); void deal_with_rpc_timeout_err(); - public: +public: common::ObAddr addr_; ObQueryRetryInfo* retry_info_; int64_t timeout_ts_; @@ -125,7 +125,7 @@ class ObDealWithRpcTimeoutCall { }; class ObFastInitSqcCB : public obrpc::ObPxRpcProxy::AsyncCB { - public: +public: ObFastInitSqcCB(const common::ObAddr& server, const common::ObCurTraceId::TraceId& trace_id, ObQueryRetryInfo* retry_info, int64_t timeout_ts, ObInterruptibleTaskID tid, ObPxSqcMeta* sqc) : addr_(server), retry_info_(retry_info), timeout_ts_(timeout_ts), interrupt_id_(tid), sqc_(sqc) @@ -135,7 +135,7 @@ class ObFastInitSqcCB : public obrpc::ObPxRpcProxy::AsyncCB class ObDhPieceMsgProc { - public: +public: ObDhPieceMsgProc() = default; ~ObDhPieceMsgProc() = default; int on_piece_msg(ObPxCoordInfo& coord_info, ObExecContext& ctx, const PieceMsg& pkt) diff --git a/src/sql/engine/px/ob_px_scheduler.h b/src/sql/engine/px/ob_px_scheduler.h index d010eab03..b33d6c03b 100644 --- a/src/sql/engine/px/ob_px_scheduler.h +++ b/src/sql/engine/px/ob_px_scheduler.h @@ -30,14 +30,14 @@ namespace oceanbase { namespace sql { class ObPxRootDfoAction { - public: +public: virtual int receive_channel_root_dfo(ObExecContext& ctx, ObDfo& parent, ObPxTaskChSets& parent_ch_sets) = 0; virtual int receive_channel_root_dfo(ObExecContext& ctx, ObDfo& parent, dtl::ObDtlChTotalInfo& ch_info) = 0; }; // following infos are varibles on which scheduling depends. class ObPxCoordInfo { - public: +public: ObPxCoordInfo(ObIAllocator& allocator, dtl::ObDtlChannelLoop& msg_loop, ObInterruptibleTaskID& interrupt_id) : dfo_mgr_(allocator), rpc_proxy_(), @@ -60,7 +60,7 @@ class ObPxCoordInfo { piece_msg_ctx_mgr_.reset(); } - public: +public: ObDfoMgr dfo_mgr_; ObPieceMsgCtxMgr piece_msg_ctx_mgr_; obrpc::ObPxRpcProxy rpc_proxy_; @@ -74,7 +74,7 @@ class ObPxCoordInfo { class ObDfoSchedulerBasic; class ObPxTerminateMsgProc : public ObIPxCoordMsgProc { - public: +public: ObPxTerminateMsgProc(ObPxCoordInfo& coord_info, ObIPxCoordEventListener& listener) : coord_info_(coord_info), listener_(listener) {} @@ -94,7 +94,7 @@ class ObPxTerminateMsgProc : public ObIPxCoordMsgProc { ObIPxCoordEventListener& listener_; }; class ObPxMsgProc : public ObIPxCoordMsgProc { - public: +public: ObPxMsgProc(ObPxCoordInfo& coord_info, ObIPxCoordEventListener& listener, ObPxRootDfoAction& root_dfo_action) : coord_info_(coord_info), listener_(listener), root_dfo_action_(root_dfo_action), scheduler_(NULL) {} @@ -119,12 +119,12 @@ class ObPxMsgProc : public ObIPxCoordMsgProc { int on_piece_msg(ObExecContext& ctx, const ObBarrierPieceMsg& pkt); int on_piece_msg(ObExecContext& ctx, const ObWinbufPieceMsg& pkt); // end DATAHUB msg processing - private: +private: int do_cleanup_dfo(ObDfo& dfo); int fast_dispatch_sqc(ObExecContext& exec_ctx, ObDfo& dfo, ObArray& sqcs); int wait_for_dfo_finish(ObDfoMgr& dfo_mgr); - private: +private: ObPxCoordInfo& coord_info_; ObIPxCoordEventListener& listener_; ObPxRootDfoAction& root_dfo_action_; diff --git a/src/sql/engine/px/ob_px_sqc_async_proxy.h b/src/sql/engine/px/ob_px_sqc_async_proxy.h index a6ab0bae5..6f2044eb5 100644 --- a/src/sql/engine/px/ob_px_sqc_async_proxy.h +++ b/src/sql/engine/px/ob_px_sqc_async_proxy.h @@ -33,7 +33,7 @@ using namespace common; namespace sql { class ObSqcAsyncCB : public obrpc::ObPxRpcProxy::AsyncCB { - public: +public: ObSqcAsyncCB(ObThreadCond& cond, const ObCurTraceId::TraceId trace_id) : cond_(cond), trace_id_(trace_id) { reset(); @@ -108,7 +108,7 @@ class ObSqcAsyncCB : public obrpc::ObPxRpcProxy::AsyncCB& sqcs) : proxy_(proxy), @@ -156,14 +156,14 @@ class ObPxSqcAsyncProxy { return error_index_; } - private: +private: void destroy(); // asynchronously request a single sqc rpc task int launch_one_rpc_request(int64_t idx, ObSqcAsyncCB* cb); bool check_for_retry(ObSqcAsyncCB& callback); void fail_process(); - private: +private: obrpc::ObPxRpcProxy& proxy_; ObDfo& dfo_; ObExecContext& exec_ctx_; diff --git a/src/sql/engine/px/ob_px_sqc_handler.h b/src/sql/engine/px/ob_px_sqc_handler.h index 2561a1ffb..711b632a5 100644 --- a/src/sql/engine/px/ob_px_sqc_handler.h +++ b/src/sql/engine/px/ob_px_sqc_handler.h @@ -25,7 +25,7 @@ namespace sql { #define OB_SQC_HANDLER_QC_SQC_LINKED (1ULL << 1) class ObPxWorkNotifier { - public: +public: ObPxWorkNotifier() : start_worker_count_(0), finish_worker_count_(0), expect_worker_count_(0), cond_() {} ~ObPxWorkNotifier() = default; @@ -44,7 +44,7 @@ class ObPxWorkNotifier { TO_STRING_KV(K_(start_worker_count), K_(finish_worker_count), K_(expect_worker_count), K_(tid_array)) - private: +private: volatile int64_t start_worker_count_; volatile int64_t finish_worker_count_; int64_t expect_worker_count_; @@ -53,10 +53,10 @@ class ObPxWorkNotifier { }; class ObPxSqcHandler : public common::ObDLinkBase { - public: +public: typedef uint64_t ObPxSQCHandlerId; - public: +public: ObPxSqcHandler() : mem_context_(NULL), tenant_id_(UINT64_MAX), @@ -177,14 +177,14 @@ class ObPxSqcHandler : public common::ObDLinkBase { TO_STRING_KV(K_(tenant_id), K_(reserved_px_thread_count), KP_(notifier), K_(exec_ctx), K_(des_phy_plan), K_(sqc_init_args), KP_(sub_coord)); - private: +private: int destroy_sqc(); void add_flag(uint64_t flag) { process_flags_ |= flag; }; - private: +private: lib::MemoryContext* mem_context_; uint64_t tenant_id_; int64_t reserved_px_thread_count_; diff --git a/src/sql/engine/px/ob_px_sqc_proxy.h b/src/sql/engine/px/ob_px_sqc_proxy.h index fb7b66328..e0dac1351 100644 --- a/src/sql/engine/px/ob_px_sqc_proxy.h +++ b/src/sql/engine/px/ob_px_sqc_proxy.h @@ -29,7 +29,7 @@ class ObDtlLocalFirstBufferCache; } // namespace dtl class ObSqcLeaderTokenGuard { - public: +public: ObSqcLeaderTokenGuard(common::ObSpinLock& lock) : lock_(lock), hold_lock_(false) { if (common::OB_SUCCESS == lock_.trylock()) { @@ -47,14 +47,14 @@ class ObSqcLeaderTokenGuard { return hold_lock_; } - private: +private: common::ObSpinLock& lock_; bool hold_lock_; }; class ObSqcCtx; class ObPxSQCProxy { - public: +public: ObPxSQCProxy(ObSqcCtx& sqc_ctx, ObPxRpcInitSqcArgs& arg); virtual ~ObPxSQCProxy(); @@ -107,7 +107,7 @@ class ObPxSQCProxy { return sqc_arg_.sqc_.get_dfo_id(); } - private: +private: /* functions */ int setup_loop_proc(ObSqcCtx& sqc_ctx) const; int process_dtl_msg(int64_t timeout_ts); diff --git a/src/sql/engine/px/ob_px_sub_coord.h b/src/sql/engine/px/ob_px_sub_coord.h index a8981c61b..d74a90b98 100644 --- a/src/sql/engine/px/ob_px_sub_coord.h +++ b/src/sql/engine/px/ob_px_sub_coord.h @@ -39,7 +39,7 @@ class ObPxSQCHandler; #define ENG_OP typename ObEngineOpTraits class ObPxSubCoord { - public: +public: explicit ObPxSubCoord(const observer::ObGlobalContext& gctx, ObPxRpcInitSqcArgs& arg) : gctx_(gctx), sqc_arg_(arg), @@ -88,7 +88,7 @@ class ObPxSubCoord { int init_first_buffer_cache(bool is_rpc_worker, int64_t dop); void destroy_first_buffer_cache(); - private: +private: int setup_loop_proc(ObSqcCtx& sqc_ctx) const; int setup_op_input(ObExecContext& ctx, ObPhyOperator& root, ObSqcCtx& sqc_ctx, ObPartitionReplicaLocationIArray& tsc_locations, int64_t& tsc_locations_idx, @@ -121,7 +121,7 @@ class ObPxSubCoord { return &first_buffer_cache_; } - private: +private: const observer::ObGlobalContext& gctx_; ObPxRpcInitSqcArgs& sqc_arg_; ObSqcCtx sqc_ctx_; diff --git a/src/sql/engine/px/ob_px_task_process.h b/src/sql/engine/px/ob_px_task_process.h index 1fd4b1a00..2c83a0017 100644 --- a/src/sql/engine/px/ob_px_task_process.h +++ b/src/sql/engine/px/ob_px_task_process.h @@ -23,9 +23,9 @@ namespace oceanbase { namespace sql { class ObPxTaskProcess { - private: +private: class OpPreparation : public ObPxOperatorVisitor::ApplyFunc { - public: + public: OpPreparation() : task_id_(common::OB_INVALID_ID), sqc_id_(common::OB_INVALID_ID), @@ -73,7 +73,7 @@ class ObPxTaskProcess { ctx_ = ctx; } - private: + private: int64_t task_id_; int64_t sqc_id_; int64_t dfo_id_; @@ -87,7 +87,7 @@ class ObPxTaskProcess { ObExecContext* ctx_; }; class OpPreCloseProcessor : public ObPxOperatorVisitor::ApplyFunc { - public: + public: OpPreCloseProcessor(ObPxTask& task) : task_(task) {} ~OpPreCloseProcessor() = default; @@ -97,11 +97,11 @@ class ObPxTaskProcess { virtual int apply(ObExecContext& ctx, ObOpSpec& op); virtual int reset(ObOpSpec& op); - private: + private: ObPxTask& task_; }; - public: +public: ObPxTaskProcess(const observer::ObGlobalContext& gctx, ObPxRpcInitTaskArgs& arg); virtual ~ObPxTaskProcess(); int process(); @@ -122,7 +122,7 @@ class ObPxTaskProcess { return arg_.sqc_handler_; } - public: +public: // for sql audit to monitor worker exec time void set_enqueue_timestamp(int64_t v) { @@ -187,7 +187,7 @@ class ObPxTaskProcess { int execute(ObPhyOperator& root); int execute(ObOpSpec& root); - private: +private: /* functions */ int do_process(); int check_inner_stat(); diff --git a/src/sql/engine/px/ob_px_util.h b/src/sql/engine/px/ob_px_util.h index 31d415135..e1862afa5 100644 --- a/src/sql/engine/px/ob_px_util.h +++ b/src/sql/engine/px/ob_px_util.h @@ -37,12 +37,12 @@ enum ObBcastOptimization { // monitor various events, such as root dfo scheduling events, etc class ObIPxCoordEventListener { - public: +public: virtual int on_root_data_channel_setup() = 0; }; class ObPxSqcUtil { - public: +public: static double get_sqc_partition_ratio(ObExecContext* exec_ctx); static double get_sqc_est_worker_ratio(ObExecContext* exec_ctx); @@ -63,13 +63,13 @@ class ObPxSqcUtil { // consider compatibility, currently set as not mutually exclusive class ObPxEstimateSizeUtil { - public: +public: static int get_px_size( ObExecContext* exec_ctx, const PxOpSizeFactor factor, const int64_t total_size, int64_t& ret_size); }; class ObSlaveMapItem { - public: +public: ObSlaveMapItem() : group_id_(0), l_worker_count_(0), @@ -98,7 +98,7 @@ class ObSlaveMapItem { class ObPXServerAddrUtil { class ObPxSqcTaskCountMeta { - public: + public: ObPxSqcTaskCountMeta() : partition_count_(0), thread_count_(0), time_(0), idx_(0), finish_(false) {} ~ObPxSqcTaskCountMeta() = default; @@ -110,7 +110,7 @@ class ObPXServerAddrUtil { TO_STRING_KV(K_(partition_count), K_(thread_count), K_(time), K_(idx), K_(finish)); }; - public: +public: ObPXServerAddrUtil() = default; ~ObPXServerAddrUtil() = default; static int alloc_by_data_distribution(ObExecContext& ctx, ObDfo& dfo); @@ -125,7 +125,7 @@ class ObPXServerAddrUtil { static int split_parallel_into_task(const int64_t parallelism, const common::ObIArray& sqc_partition_count, common::ObIArray& results); - private: +private: static int find_dml_ops(common::ObIArray& insert_ops, const ObPhyOperator& op); static int find_dml_ops(common::ObIArray& insert_ops, const ObOpSpec& op); @@ -187,7 +187,7 @@ class ObPXServerAddrUtil { }; class ObPxPartitionLocationUtil { - public: +public: /** * get all tables' partition info, and store them to sqc_ctx's partition_array_. * we need these infos to start trans. @@ -200,22 +200,22 @@ class ObPxPartitionLocationUtil { }; class ObPxOperatorVisitor { - public: +public: class ApplyFunc { - public: + public: virtual int apply(ObExecContext& ctx, ObPhyOperator& input) = 0; virtual int reset(ObPhyOperator& input) = 0; virtual int apply(ObExecContext& ctx, ObOpSpec& input) = 0; virtual int reset(ObOpSpec& input) = 0; }; - public: +public: static int visit(ObExecContext& ctx, ObPhyOperator& root, ApplyFunc& func); static int visit(ObExecContext& ctx, ObOpSpec& root, ApplyFunc& func); }; class ObPxTreeSerializer { - public: +public: static int serialize_tree( char* buf, int64_t buf_len, int64_t& pos, ObPhyOperator& root, bool is_fulltree, ObPhyOpSeriCtx* seri_ctx = NULL); static int deserialize_tree(const char* buf, int64_t data_len, int64_t& pos, ObPhysicalPlan& phy_plan, @@ -273,7 +273,7 @@ class ObPxTreeSerializer { }; class ObPxChannelUtil { - public: +public: static int unlink_ch_set(ObPxTaskChSet& ch_set, sql::dtl::ObDtlFlowControl* dfc); static int flush_rows(common::ObIArray& channels); @@ -286,7 +286,7 @@ class ObPxChannelUtil { }; class ObPxAffinityByRandom { - public: +public: struct PartitionHashValue { int64_t partition_id_; int64_t partition_idx_; @@ -296,7 +296,7 @@ class ObPxAffinityByRandom { TO_STRING_KV(K_(partition_id), K_(partition_idx), K_(hash_value), K_(worker_id), K_(partition_info)); }; - public: +public: ObPxAffinityByRandom() : worker_cnt_(0), partition_hash_values_() {} virtual ~ObPxAffinityByRandom() = default; @@ -310,19 +310,19 @@ class ObPxAffinityByRandom { static int get_partition_info( int64_t partition_id, ObIArray& partitions_info, ObPxPartitionInfo& partition_info); - private: +private: int64_t worker_cnt_; ObSEArray partition_hash_values_; }; class ObPxAdmissionUtil { - public: +public: static int check_parallel_max_servers_value( const common::ObIArray& units, const int64_t user_max_servers, int64_t& max_servers); }; class ObSlaveMapUtil { - public: +public: ObSlaveMapUtil() = default; ~ObSlaveMapUtil() = default; static int build_mn_ch_map(ObExecContext& ctx, ObDfo& child, ObDfo& parent, uint64_t tenant_id); @@ -331,7 +331,7 @@ class ObSlaveMapUtil { static int build_bf_mn_channel( dtl::ObDtlChTotalInfo& transmit_ch_info, ObDfo& child, ObDfo& parent, const uint64_t tenant_id); - private: +private: // new channel map generate static int build_ppwj_ch_mn_map(ObExecContext& ctx, ObDfo& parent, ObDfo& child, uint64_t tenant_id); static int build_pkey_random_ch_mn_map(ObDfo& parent, ObDfo& child, uint64_t tenant_id); @@ -349,7 +349,7 @@ class ObSlaveMapUtil { }; class ObDtlChannelUtil { - public: +public: static int link_ch_set( dtl::ObDtlChSet& ch_set, common::ObIArray& channels, dtl::ObDtlFlowControl* dfc = nullptr); static int get_receive_dtl_channel_set( diff --git a/src/sql/engine/px/ob_px_worker.h b/src/sql/engine/px/ob_px_worker.h index bba02d34c..dbeac70f6 100644 --- a/src/sql/engine/px/ob_px_worker.h +++ b/src/sql/engine/px/ob_px_worker.h @@ -27,13 +27,13 @@ class ObPxPool; } namespace sql { class ObPxWorkerRunnable { - public: +public: virtual int run(ObPxRpcInitTaskArgs& arg) = 0; }; // Use RPC worker thread as the execution container of Px Worker class ObPxRpcWorker : public ObPxWorkerRunnable { - public: +public: ObPxRpcWorker(const observer::ObGlobalContext& gctx, obrpc::ObPxRpcProxy& rpc_proxy, common::ObIAllocator& alloc); virtual ~ObPxRpcWorker(); int run(ObPxRpcInitTaskArgs& arg); @@ -43,7 +43,7 @@ class ObPxRpcWorker : public ObPxWorkerRunnable { } TO_STRING_KV(K_(resp)); - private: +private: const observer::ObGlobalContext& gctx_; obrpc::ObPxRpcProxy& rpc_proxy_; common::ObIAllocator& alloc_; @@ -52,7 +52,7 @@ class ObPxRpcWorker : public ObPxWorkerRunnable { // Use coroutine as the execution container of Px Worker class ObPxCoroWorker : public ObPxWorkerRunnable { - public: +public: ObPxCoroWorker(const observer::ObGlobalContext& gctx, common::ObIAllocator& alloc); virtual ~ObPxCoroWorker() = default; int run(ObPxRpcInitTaskArgs& arg); @@ -63,7 +63,7 @@ class ObPxCoroWorker : public ObPxWorkerRunnable { } TO_STRING_KV(K_(task_co_id)); - private: +private: int deep_copy_assign(const ObPxRpcInitTaskArgs& src, ObPxRpcInitTaskArgs& dest); /* variables */ const observer::ObGlobalContext& gctx_; @@ -78,7 +78,7 @@ class ObPxCoroWorker : public ObPxWorkerRunnable { }; class ObPxThreadWorker : public ObPxWorkerRunnable { - public: +public: ObPxThreadWorker(const observer::ObGlobalContext& gctx); virtual ~ObPxThreadWorker(); @@ -91,10 +91,10 @@ class ObPxThreadWorker : public ObPxWorkerRunnable { TO_STRING_KV(K_(task_co_id)); - private: +private: int run_at(ObPxRpcInitTaskArgs& task_arg, omt::ObPxPool& px_pool); - private: +private: /* variables */ const observer::ObGlobalContext& gctx_; uint64_t task_co_id_; @@ -102,18 +102,18 @@ class ObPxThreadWorker : public ObPxWorkerRunnable { }; class ObPxLocalWorker : public ObPxWorkerRunnable { - public: +public: ObPxLocalWorker(const observer::ObGlobalContext& gctx) : gctx_(gctx) {} virtual ~ObPxLocalWorker() = default; virtual int run(ObPxRpcInitTaskArgs& arg) override; - private: +private: const observer::ObGlobalContext& gctx_; }; class ObPxRpcWorkerFactory { - public: +public: ObPxRpcWorkerFactory( const observer::ObGlobalContext& gctx, obrpc::ObPxRpcProxy& rpc_proxy, common::ObIAllocator& alloc) : gctx_(gctx), rpc_proxy_(rpc_proxy), alloc_(alloc) @@ -125,10 +125,10 @@ class ObPxRpcWorkerFactory { return common::OB_SUCCESS; } - private: +private: void destroy(); - private: +private: const observer::ObGlobalContext& gctx_; obrpc::ObPxRpcProxy& rpc_proxy_; common::ObIAllocator& alloc_; @@ -136,7 +136,7 @@ class ObPxRpcWorkerFactory { }; class ObPxThreadWorkerFactory { - public: +public: ObPxThreadWorkerFactory(const observer::ObGlobalContext& gctx, common::ObIAllocator& alloc) : gctx_(gctx), alloc_(alloc) {} @@ -144,51 +144,51 @@ class ObPxThreadWorkerFactory { ObPxThreadWorker* create_worker(); int join(); - private: +private: void destroy(); - private: +private: const observer::ObGlobalContext& gctx_; common::ObIAllocator& alloc_; common::ObSEArray workers_; }; class ObPxCoroWorkerFactory { - public: +public: ObPxCoroWorkerFactory(const observer::ObGlobalContext& gctx, common::ObIAllocator& alloc) : gctx_(gctx), alloc_(alloc) {} virtual ~ObPxCoroWorkerFactory(); ObPxCoroWorker* create_worker(); int join(); - private: +private: void destroy(); - private: +private: const observer::ObGlobalContext& gctx_; common::ObIAllocator& alloc_; common::ObSEArray workers_; }; class ObPxLocalWorkerFactory { - public: +public: ObPxLocalWorkerFactory(const observer::ObGlobalContext& gctx, common::ObIAllocator& alloc) : gctx_(gctx), alloc_(alloc), worker_(gctx) {} virtual ~ObPxLocalWorkerFactory(); ObPxWorkerRunnable* create_worker(); - private: +private: void destroy(); - private: +private: const observer::ObGlobalContext& gctx_; common::ObIAllocator& alloc_; ObPxLocalWorker worker_; }; class PxWorkerFunctor { - public: +public: explicit PxWorkerFunctor(ObPxWorkerEnvArgs& env_arg, ObPxRpcInitTaskArgs& task_arg) { env_arg_ = env_arg; @@ -212,7 +212,7 @@ class PxWorkerFunctor { }; class PxWorkerFinishFunctor { - public: +public: explicit PxWorkerFinishFunctor() {} ~PxWorkerFinishFunctor() = default; diff --git a/src/sql/engine/px/ob_px_worker_stat.h b/src/sql/engine/px/ob_px_worker_stat.h index 3850e116e..898c22968 100644 --- a/src/sql/engine/px/ob_px_worker_stat.h +++ b/src/sql/engine/px/ob_px_worker_stat.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObPxWorkerStat : public common::ObDLinkBase { - public: +public: ObPxWorkerStat(); ~ObPxWorkerStat(); int init(uint64_t session_id, uint64_t tenant_id, const uint64_t* trace_id, uint64_t qc_id, int64_t sqc_id, @@ -95,7 +95,7 @@ class ObPxWorkerStat : public common::ObDLinkBase { return thread_id_; } - private: +private: uint64_t session_id_; uint64_t tenant_id_; const uint64_t* trace_id_; @@ -108,18 +108,18 @@ class ObPxWorkerStat : public common::ObDLinkBase { }; class ObPxWorkerStatList { - public: +public: static ObPxWorkerStatList& instance(); int push(ObPxWorkerStat& stat_value); int remove(ObPxWorkerStat& stat_value); int list_to_array(common::ObArray& stat_array); - private: +private: common::ObDList worker_stat_list_; common::ObArenaAllocator allocator_; mutable common::ObSpinLock lock_; - private: +private: ObPxWorkerStatList(); ~ObPxWorkerStatList(); DISALLOW_COPY_AND_ASSIGN(ObPxWorkerStatList); diff --git a/src/sql/engine/px/ob_sqc_ctx.h b/src/sql/engine/px/ob_sqc_ctx.h index 54e154632..aa4295a77 100644 --- a/src/sql/engine/px/ob_sqc_ctx.h +++ b/src/sql/engine/px/ob_sqc_ctx.h @@ -28,7 +28,7 @@ namespace sql { // SQC status class ObSqcCtx { - public: +public: ObSqcCtx(ObPxRpcInitSqcArgs& sqc_arg) : msg_proc_(sqc_arg, *this), receive_data_ch_msg_proc_(msg_proc_), @@ -97,11 +97,11 @@ class ObSqcCtx { return temp_table_id_; } - public: +public: int add_whole_msg_provider(uint64_t op_id, ObPxDatahubDataProvider& provider); int get_whole_msg_provider(uint64_t op_id, ObPxDatahubDataProvider*& provider); - public: +public: common::ObArray tasks_; ObPxReceiveChProvider receive_data_ch_provider_; ObPxTransmitChProvider transmit_data_ch_provider_; @@ -121,7 +121,7 @@ class ObSqcCtx { uint64_t temp_table_id_; common::ObSEArray interm_result_ids_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqcCtx); }; diff --git a/src/sql/engine/px/ob_sub_trans_ctrl.h b/src/sql/engine/px/ob_sub_trans_ctrl.h index 1e650fa6c..90cf34676 100644 --- a/src/sql/engine/px/ob_sub_trans_ctrl.h +++ b/src/sql/engine/px/ob_sub_trans_ctrl.h @@ -21,13 +21,13 @@ namespace sql { class ObExecContext; class ObPxSqcMeta; class ObSubTransCtrl { - public: +public: ObSubTransCtrl() = default; ~ObSubTransCtrl() = default; int start_participants(ObExecContext& ctx, ObPxSqcMeta& sqc); int end_participants(ObExecContext& ctx, bool is_rb); - private: +private: /* functions */ int get_participants(ObPxSqcMeta& sqc, common::ObPartitionArray& participants) const; /* variables */ diff --git a/src/sql/engine/recursive_cte/ob_fake_cte_table.h b/src/sql/engine/recursive_cte/ob_fake_cte_table.h index e57dae8db..491c965f8 100644 --- a/src/sql/engine/recursive_cte/ob_fake_cte_table.h +++ b/src/sql/engine/recursive_cte/ob_fake_cte_table.h @@ -27,9 +27,9 @@ class ObExecContext; class ObFakeCTETable : public ObNoChildrenPhyOperator { OB_UNIS_VERSION_V(1); - public: +public: class ObFakeCTETableOperatorCtx : public ObPhyOperatorCtx { - public: + public: explicit ObFakeCTETableOperatorCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), empty_(false), pump_row_(nullptr), alloc_(ctx.get_allocator()) {} @@ -45,14 +45,14 @@ class ObFakeCTETable : public ObNoChildrenPhyOperator { int add_row(common::ObNewRow*& row); void reuse(); - public: + public: bool empty_; common::ObNewRow* pump_row_; common::ObSEArray column_involved_offset_; ObIAllocator& alloc_; }; - public: +public: explicit ObFakeCTETable(common::ObIAllocator& alloc) : ObNoChildrenPhyOperator(alloc), column_involved_offset_(alloc) {} virtual ~ObFakeCTETable() diff --git a/src/sql/engine/recursive_cte/ob_fake_cte_table_op.h b/src/sql/engine/recursive_cte/ob_fake_cte_table_op.h index 4f06f70f8..f8af39cea 100644 --- a/src/sql/engine/recursive_cte/ob_fake_cte_table_op.h +++ b/src/sql/engine/recursive_cte/ob_fake_cte_table_op.h @@ -27,7 +27,7 @@ class ObExecContext; class ObFakeCTETableSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: explicit ObFakeCTETableSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), column_involved_offset_(alloc), column_involved_exprs_(alloc) {} @@ -40,7 +40,7 @@ class ObFakeCTETableSpec : public ObOpSpec { }; class ObFakeCTETableOp : public ObOperator { - public: +public: explicit ObFakeCTETableOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), empty_(false), pump_row_(nullptr), allocator_(exec_ctx.get_allocator()) {} @@ -70,7 +70,7 @@ class ObFakeCTETableOp : public ObOperator { const common::ObIArray& chosen_index, int64_t extra_size, common::ObIAllocator& allocator); const static int64_t ROW_EXTRA_SIZE = 0; - private: +private: bool empty_; const ObChunkDatumStore::StoredRow* pump_row_; ObIAllocator& allocator_; diff --git a/src/sql/engine/recursive_cte/ob_recursive_inner_data.h b/src/sql/engine/recursive_cte/ob_recursive_inner_data.h index dc486b91f..70b9ec436 100644 --- a/src/sql/engine/recursive_cte/ob_recursive_inner_data.h +++ b/src/sql/engine/recursive_cte/ob_recursive_inner_data.h @@ -31,12 +31,12 @@ class ObRecursiveInnerData { friend class ObRecursiveUnionAllOperatorCtx; friend class ObRecursiveUnionAll; - public: +public: struct RowComparer; enum RecursiveUnionState { R_UNION_BEGIN, R_UNION_READ_LEFT, R_UNION_READ_RIGHT, R_UNION_END, R_UNION_STATE_COUNT }; enum SearchStrategyType { DEPTH_FRIST, BREADTH_FRIST }; - public: +public: explicit ObRecursiveInnerData(common::ObIAllocator& alloc) : state_(RecursiveUnionState::R_UNION_READ_LEFT), stored_row_buf_(ObModIds::OB_SQL_CTE_ROW), @@ -89,7 +89,7 @@ class ObRecursiveInnerData { calc_buf_ = calc_buf; } - private: +private: void destroy(); int add_pseudo_column(const ObNewRow* row, bool cycle = false); int try_get_left_rows(ObExecContext& exec_ctx, const ObNewRow*& row); @@ -110,7 +110,7 @@ class ObRecursiveInnerData { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRecursiveInnerData); - private: +private: RecursiveUnionState state_; common::ObArenaAllocator stored_row_buf_; const ObFakeCTETable* pump_operator_; diff --git a/src/sql/engine/recursive_cte/ob_recursive_inner_data_op.h b/src/sql/engine/recursive_cte/ob_recursive_inner_data_op.h index 63154c129..fe4e6c8e0 100644 --- a/src/sql/engine/recursive_cte/ob_recursive_inner_data_op.h +++ b/src/sql/engine/recursive_cte/ob_recursive_inner_data_op.h @@ -30,12 +30,12 @@ class ObRecursiveInnerDataOp { friend class ObRecursiveUnionAllOp; friend class ObRecursiveUnionAllSpec; - public: +public: struct RowComparer; enum RecursiveUnionState { R_UNION_BEGIN, R_UNION_READ_LEFT, R_UNION_READ_RIGHT, R_UNION_END, R_UNION_STATE_COUNT }; enum SearchStrategyType { DEPTH_FRIST, BREADTH_FRIST }; - public: +public: explicit ObRecursiveInnerDataOp(ObEvalCtx& eval_ctx, ObExecContext& exec_ctx, const ExprFixedArray& left_output, const common::ObIArray& sort_collations, const common::ObIArray& cycle_by_col_lists, const common::ObIArray& output_union_exprs) @@ -89,7 +89,7 @@ class ObRecursiveInnerDataOp { cte_columns_ = exprs; } - private: +private: void destroy(); int add_pseudo_column(bool cycle = false); int try_get_left_rows(); @@ -115,7 +115,7 @@ class ObRecursiveInnerDataOp { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRecursiveInnerDataOp); - private: +private: RecursiveUnionState state_; common::ObArenaAllocator stored_row_buf_; ObFakeCTETableOp* pump_operator_; diff --git a/src/sql/engine/recursive_cte/ob_recursive_union_all.h b/src/sql/engine/recursive_cte/ob_recursive_union_all.h index f1feb8d11..9ae4bf1f9 100644 --- a/src/sql/engine/recursive_cte/ob_recursive_union_all.h +++ b/src/sql/engine/recursive_cte/ob_recursive_union_all.h @@ -28,9 +28,9 @@ namespace sql { class ObRecursiveUnionAll : public ObMergeSetOperator { OB_UNIS_VERSION_V(1); - protected: +protected: class ObRecursiveUnionAllOperatorCtx : public ObPhyOperatorCtx { - public: + public: explicit ObRecursiveUnionAllOperatorCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), inner_data_(ctx.get_allocator()) {} @@ -52,12 +52,12 @@ class ObRecursiveUnionAll : public ObMergeSetOperator { int init(); int ctx_close(); - public: + public: common::ObExprCtx expr_ctx_; ObRecursiveInnerData inner_data_; }; - public: +public: explicit ObRecursiveUnionAll(common::ObIAllocator& alloc); ~ObRecursiveUnionAll(); virtual void reset(); @@ -74,7 +74,7 @@ class ObRecursiveUnionAll : public ObMergeSetOperator { }; int set_cycle_pseudo_values(ObSqlExpression& v, ObSqlExpression& d_v); - protected: +protected: /** * @brief for specified phy operator to print it's member variable with json key-value format * @param buf[in] to string buffer @@ -116,11 +116,11 @@ class ObRecursiveUnionAll : public ObMergeSetOperator { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRecursiveUnionAll); - public: +public: common::ObFixedArray search_by_col_lists_; common::ObFixedArray cycle_by_col_lists_; - protected: +protected: static const int32_t CMP_DIRECTION_ASC = 1; static const int32_t CMP_DIRECTION_DESC = -1; const ObFakeCTETable* pump_operator_; diff --git a/src/sql/engine/recursive_cte/ob_recursive_union_all_op.h b/src/sql/engine/recursive_cte/ob_recursive_union_all_op.h index 1225c7d88..5b06acc8f 100644 --- a/src/sql/engine/recursive_cte/ob_recursive_union_all_op.h +++ b/src/sql/engine/recursive_cte/ob_recursive_union_all_op.h @@ -26,7 +26,7 @@ namespace sql { class ObRecursiveUnionAllSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: explicit ObRecursiveUnionAllSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); ~ObRecursiveUnionAllSpec(); friend class ObRecursiveUnionAllOp; @@ -49,7 +49,7 @@ class ObRecursiveUnionAllSpec : public ObOpSpec { int set_cycle_pseudo_values(ObExpr* v, ObExpr* d_v); static const int64_t UNUSED_POS; - protected: +protected: /** * @brief for specified phy operator to print it's member variable with json key-value format * @param buf[in] to string buffer @@ -60,14 +60,14 @@ class ObRecursiveUnionAllSpec : public ObOpSpec { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRecursiveUnionAllSpec); - public: +public: common::ObFixedArray sort_collations_; common::ObFixedArray cycle_by_col_lists_; // T_OP_UNION expression in the output of recursive uion all operator. // copy datums of inner_data rows to datums of these exprs. common::ObFixedArray output_union_exprs_; - protected: +protected: static const int32_t CMP_DIRECTION_ASC = 1; static const int32_t CMP_DIRECTION_DESC = -1; uint64_t pump_operator_id_; @@ -79,7 +79,7 @@ class ObRecursiveUnionAllSpec : public ObOpSpec { }; class ObRecursiveUnionAllOp : public ObOperator { - public: +public: explicit ObRecursiveUnionAllOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), inner_data_(*exec_ctx.get_eval_ctx(), exec_ctx, // spec.output_, @@ -106,7 +106,7 @@ class ObRecursiveUnionAllOp : public ObOperator { return static_cast(spec_); } - public: +public: ObRecursiveInnerDataOp inner_data_; }; diff --git a/src/sql/engine/recursive_cte/ob_search_method.h b/src/sql/engine/recursive_cte/ob_search_method.h index 5491cf93e..7205f0404 100644 --- a/src/sql/engine/recursive_cte/ob_search_method.h +++ b/src/sql/engine/recursive_cte/ob_search_method.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace sql { class ObSearchMethod { - public: +public: typedef struct _BreadthFirstSearchTreeNode { _BreadthFirstSearchTreeNode() : child_num_(0), row_(nullptr), children_(nullptr), parent_(nullptr) {} @@ -70,7 +70,7 @@ class ObSearchMethod { return bret; } - private: + private: const common::ObIArray& sort_columns_; int* err_; }; @@ -78,7 +78,7 @@ class ObSearchMethod { // initial size of hash table for loop search static const int64_t CTE_SET_NUM = 1 << 5l; - public: +public: explicit ObSearchMethod(common::ObIAllocator& allocator) : allocator_(allocator), input_rows_(), sort_columns_(), cycle_by_columns_(), sort_(), op_schema_objs_(nullptr){}; virtual ~ObSearchMethod() = default; @@ -105,7 +105,7 @@ class ObSearchMethod { return input_rows_.count(); } - protected: +protected: common::ObIAllocator& allocator_; common::ObArray input_rows_; common::ObSEArray sort_columns_; @@ -118,7 +118,7 @@ class ObSearchMethod { class ObDepthFisrtSearch : public ObSearchMethod { typedef common::hash::ObHashSet RowMap; - public: +public: ObDepthFisrtSearch(common::ObIAllocator& allocator) : ObSearchMethod(allocator), hash_filter_rows_(), @@ -150,10 +150,10 @@ class ObDepthFisrtSearch : public ObSearchMethod { int get_next_non_cycle_node( common::ObList& result_output, ObTreeNode& node) override; - private: +private: int is_depth_cycle_node(ObTreeNode& node); - private: +private: RowMap hash_filter_rows_; common::ObSEArray hash_col_idx_; // record level of current row in the tree. @@ -163,7 +163,7 @@ class ObDepthFisrtSearch : public ObSearchMethod { }; class ObBreadthFisrtSearch : public ObSearchMethod { - public: +public: ObBreadthFisrtSearch(common::ObIAllocator& allocator) : ObSearchMethod(allocator), bst_root_(), @@ -185,12 +185,12 @@ class ObBreadthFisrtSearch : public ObSearchMethod { common::ObList& result_output, ObTreeNode& node) override; int update_parent_node(ObTreeNode& node); - private: +private: int init_new_nodes(ObBFSTreeNode* last_bstnode, int64_t child_num); int is_breadth_cycle_node(ObTreeNode& node); int add_new_level(); - private: +private: ObBFSTreeNode bst_root_; /** * A diff --git a/src/sql/engine/recursive_cte/ob_search_method_op.h b/src/sql/engine/recursive_cte/ob_search_method_op.h index ab6a95023..c36faa3f0 100644 --- a/src/sql/engine/recursive_cte/ob_search_method_op.h +++ b/src/sql/engine/recursive_cte/ob_search_method_op.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace sql { class ObSearchMethodOp { - public: +public: typedef struct _BreadthFirstSearchTreeNode { _BreadthFirstSearchTreeNode() : child_num_(0), stored_row_(nullptr), children_(nullptr), parent_(nullptr) {} @@ -97,14 +97,14 @@ class ObSearchMethodOp { return bret; } - private: + private: const common::ObIArray& sort_collations_; const common::ObIArray& exprs_; int* err_; }; class ObCycleHash { - public: + public: ObCycleHash() : row_(NULL), hash_col_idx_(NULL), exprs_(NULL), hash_val_(0) {} ObCycleHash(const ObChunkDatumStore::StoredRow* row, const common::ObIArray* hash_col_idx, @@ -125,7 +125,7 @@ class ObSearchMethodOp { uint64_t inner_hash() const; bool operator==(const ObCycleHash& other) const; - public: + public: const ObChunkDatumStore::StoredRow* row_; const common::ObIArray* hash_col_idx_; const common::ObIArray* exprs_; @@ -136,7 +136,7 @@ class ObSearchMethodOp { // initial size of hash table for loop search static const int64_t CTE_SET_NUM = 1 << 5l; - public: +public: explicit ObSearchMethodOp(common::ObIAllocator& allocator, const ExprFixedArray& left_output, const common::ObIArray& sort_collations, const common::ObIArray& cycle_by_columns) : allocator_(allocator), @@ -163,7 +163,7 @@ class ObSearchMethodOp { } const static int64_t ROW_EXTRA_SIZE = 0; - protected: +protected: // hard code seed, 24bit max prime number static const int64_t HASH_SEED = 16777213; common::ObIAllocator& allocator_; @@ -177,7 +177,7 @@ class ObSearchMethodOp { class ObDepthFisrtSearchOp : public ObSearchMethodOp { typedef common::hash::ObHashSet RowMap; - public: +public: ObDepthFisrtSearchOp(common::ObIAllocator& allocator, const ExprFixedArray& left_output, const common::ObIArray& sort_collations, const common::ObIArray& cycle_by_columns) : ObSearchMethodOp(allocator, left_output, sort_collations, cycle_by_columns), @@ -206,10 +206,10 @@ class ObDepthFisrtSearchOp : public ObSearchMethodOp { int get_next_non_cycle_node( common::ObList& result_output, ObTreeNode& node) override; - private: +private: int is_depth_cycle_node(ObTreeNode& node); - private: +private: RowMap hash_filter_rows_; common::ObSEArray hash_col_idx_; // record level of current row in the tree. @@ -219,7 +219,7 @@ class ObDepthFisrtSearchOp : public ObSearchMethodOp { }; class ObBreadthFisrtSearchOp : public ObSearchMethodOp { - public: +public: ObBreadthFisrtSearchOp(common::ObIAllocator& allocator, const ExprFixedArray& left_output, const common::ObIArray& sort_collations, const common::ObIArray& cycle_by_columns) : ObSearchMethodOp(allocator, left_output, sort_collations, cycle_by_columns), @@ -242,12 +242,12 @@ class ObBreadthFisrtSearchOp : public ObSearchMethodOp { common::ObList& result_output, ObTreeNode& node) override; int update_parent_node(ObTreeNode& node); - private: +private: int init_new_nodes(ObBFSTreeNode* last_bstnode, int64_t child_num); int is_breadth_cycle_node(ObTreeNode& node); int add_new_level(); - private: +private: ObBFSTreeNode bst_root_; /** * A diff --git a/src/sql/engine/sequence/ob_sequence.cpp b/src/sql/engine/sequence/ob_sequence.cpp index 9d036df31..df13417f1 100644 --- a/src/sql/engine/sequence/ob_sequence.cpp +++ b/src/sql/engine/sequence/ob_sequence.cpp @@ -25,7 +25,7 @@ using namespace share; using namespace share::schema; namespace sql { class ObSequence::ObSequenceCtx : public ObPhyOperatorCtx { - public: +public: explicit ObSequenceCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), sequence_cache_(nullptr) { sequence_cache_ = &share::ObSequenceCache::get_instance(); @@ -47,7 +47,7 @@ class ObSequence::ObSequenceCtx : public ObPhyOperatorCtx { ObPhyOperatorCtx::destroy_base(); } - private: +private: share::ObSequenceCache* sequence_cache_; common::ObSEArray seq_schemas_; friend class ObSequence; diff --git a/src/sql/engine/sequence/ob_sequence.h b/src/sql/engine/sequence/ob_sequence.h index 6441ffa7c..fb14a93c9 100644 --- a/src/sql/engine/sequence/ob_sequence.h +++ b/src/sql/engine/sequence/ob_sequence.h @@ -20,10 +20,10 @@ class ObSqlExpression; class ObSequence : public ObMultiChildrenPhyOperator { OB_UNIS_VERSION_V(1); - private: +private: class ObSequenceCtx; - public: +public: explicit ObSequence(common::ObIAllocator& alloc); virtual ~ObSequence(); @@ -31,7 +31,7 @@ class ObSequence : public ObMultiChildrenPhyOperator { virtual void reuse(); int add_uniq_nextval_sequence_id(uint64_t seq_id); - private: +private: bool is_valid() const; /** * @brief init operator context, will create a physical operator context (and a current row space) @@ -68,7 +68,7 @@ class ObSequence : public ObMultiChildrenPhyOperator { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSequence); - private: +private: common::ObSEArray nextval_seq_ids_; }; } // end namespace sql diff --git a/src/sql/engine/sequence/ob_sequence_op.h b/src/sql/engine/sequence/ob_sequence_op.h index 1801cfe64..43e509849 100644 --- a/src/sql/engine/sequence/ob_sequence_op.h +++ b/src/sql/engine/sequence/ob_sequence_op.h @@ -22,7 +22,7 @@ namespace sql { class ObSequenceSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObSequenceSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); INHERIT_TO_STRING_KV("op_spec", ObOpSpec, K_(nextval_seq_ids)); @@ -32,7 +32,7 @@ class ObSequenceSpec : public ObOpSpec { }; class ObSequenceOp : public ObOperator { - public: +public: ObSequenceOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); ~ObSequenceOp(); @@ -53,7 +53,7 @@ class ObSequenceOp : public ObOperator { ObOperator::destroy(); } - private: +private: bool is_valid(); int init_op(); /** @@ -65,7 +65,7 @@ class ObSequenceOp : public ObOperator { int try_get_next_row(); - private: +private: share::ObSequenceCache* sequence_cache_; common::ObSEArray seq_schemas_; }; diff --git a/src/sql/engine/set/ob_append.cpp b/src/sql/engine/set/ob_append.cpp index f913488a2..f62067706 100644 --- a/src/sql/engine/set/ob_append.cpp +++ b/src/sql/engine/set/ob_append.cpp @@ -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_; }; diff --git a/src/sql/engine/set/ob_append.h b/src/sql/engine/set/ob_append.h index 18957cfd4..25407528d 100644 --- a/src/sql/engine/set/ob_append.h +++ b/src/sql/engine/set/ob_append.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObAppend : public ObMultiChildrenPhyOperator { - public: +public: class ObAppendCtx; explicit ObAppend(common::ObIAllocator& alloc); ~ObAppend(); diff --git a/src/sql/engine/set/ob_append_op.h b/src/sql/engine/set/ob_append_op.h index 45b5d7fa5..a9fd9e2d2 100644 --- a/src/sql/engine/set/ob_append_op.h +++ b/src/sql/engine/set/ob_append_op.h @@ -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); }; diff --git a/src/sql/engine/set/ob_hash_except.cpp b/src/sql/engine/set/ob_hash_except.cpp index d98ea0cce..3db60cc89 100644 --- a/src/sql/engine/set/ob_hash_except.cpp +++ b/src/sql/engine/set/ob_hash_except.cpp @@ -26,7 +26,7 @@ class ObHashExcept::ObHashExceptCtx : public ObHashSetOperatorCtx { ~ObHashExceptCtx() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHashExceptCtx); friend class ObHashExcept; }; diff --git a/src/sql/engine/set/ob_hash_except.h b/src/sql/engine/set/ob_hash_except.h index 5b8593ab4..d054aefdc 100644 --- a/src/sql/engine/set/ob_hash_except.h +++ b/src/sql/engine/set/ob_hash_except.h @@ -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; diff --git a/src/sql/engine/set/ob_hash_except_op.h b/src/sql/engine/set/ob_hash_except_op.h index dcb902445..edb945736 100644 --- a/src/sql/engine/set/ob_hash_except_op.h +++ b/src/sql/engine/set/ob_hash_except_op.h @@ -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(); }; diff --git a/src/sql/engine/set/ob_hash_intersect.cpp b/src/sql/engine/set/ob_hash_intersect.cpp index e714dbd22..4b3676494 100644 --- a/src/sql/engine/set/ob_hash_intersect.cpp +++ b/src/sql/engine/set/ob_hash_intersect.cpp @@ -26,7 +26,7 @@ class ObHashIntersect::ObHashIntersectCtx : public ObHashSetOperatorCtx { ~ObHashIntersectCtx() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHashIntersectCtx); friend class ObHashIntersect; }; diff --git a/src/sql/engine/set/ob_hash_intersect.h b/src/sql/engine/set/ob_hash_intersect.h index daaaf5570..0ebc4c422 100644 --- a/src/sql/engine/set/ob_hash_intersect.h +++ b/src/sql/engine/set/ob_hash_intersect.h @@ -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; diff --git a/src/sql/engine/set/ob_hash_intersect_op.h b/src/sql/engine/set/ob_hash_intersect_op.h index 1dd469143..2228fb76f 100644 --- a/src/sql/engine/set/ob_hash_intersect_op.h +++ b/src/sql/engine/set/ob_hash_intersect_op.h @@ -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(); }; diff --git a/src/sql/engine/set/ob_hash_set_op.h b/src/sql/engine/set/ob_hash_set_op.h index 216234bef..ac4a70036 100644 --- a/src/sql/engine/set/ob_hash_set_op.h +++ b/src/sql/engine/set/ob_hash_set_op.h @@ -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& src_exprs, const common::ObIArray& dst_exprs); - protected: +protected: // used by intersect and except bool first_get_left_; bool has_got_part_; diff --git a/src/sql/engine/set/ob_hash_set_operator.h b/src/sql/engine/set/ob_hash_set_operator.h index 45a7e7c6b..9a80224a5 100644 --- a/src/sql/engine/set/ob_hash_set_operator.h +++ b/src/sql/engine/set/ob_hash_set_operator.h @@ -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* 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 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); }; diff --git a/src/sql/engine/set/ob_hash_union.cpp b/src/sql/engine/set/ob_hash_union.cpp index 2c7b9b099..9463e2897 100644 --- a/src/sql/engine/set/ob_hash_union.cpp +++ b/src/sql/engine/set/ob_hash_union.cpp @@ -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_; diff --git a/src/sql/engine/set/ob_hash_union.h b/src/sql/engine/set/ob_hash_union.h index 1e2ab52da..a568c1bbb 100644 --- a/src/sql/engine/set/ob_hash_union.h +++ b/src/sql/engine/set/ob_hash_union.h @@ -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; diff --git a/src/sql/engine/set/ob_hash_union_op.h b/src/sql/engine/set/ob_hash_union_op.h index 31d181046..7b47522e8 100644 --- a/src/sql/engine/set/ob_hash_union_op.h +++ b/src/sql/engine/set/ob_hash_union_op.h @@ -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_; }; diff --git a/src/sql/engine/set/ob_merge_except.cpp b/src/sql/engine/set/ob_merge_except.cpp index 974654ee8..9ac8d33f3 100644 --- a/src/sql/engine/set/ob_merge_except.cpp +++ b/src/sql/engine/set/ob_merge_except.cpp @@ -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; diff --git a/src/sql/engine/set/ob_merge_except.h b/src/sql/engine/set/ob_merge_except.h index 4928b6f29..03137b8ef 100644 --- a/src/sql/engine/set/ob_merge_except.h +++ b/src/sql/engine/set/ob_merge_except.h @@ -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); diff --git a/src/sql/engine/set/ob_merge_except_op.h b/src/sql/engine/set/ob_merge_except_op.h index 1d073a4fb..fb0b2d469 100644 --- a/src/sql/engine/set/ob_merge_except_op.h +++ b/src/sql/engine/set/ob_merge_except_op.h @@ -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_; }; diff --git a/src/sql/engine/set/ob_merge_intersect.cpp b/src/sql/engine/set/ob_merge_intersect.cpp index 1dbab6c10..239bd4992 100644 --- a/src/sql/engine/set/ob_merge_intersect.cpp +++ b/src/sql/engine/set/ob_merge_intersect.cpp @@ -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_; diff --git a/src/sql/engine/set/ob_merge_intersect.h b/src/sql/engine/set/ob_merge_intersect.h index 62b1ace7b..60d10f271 100644 --- a/src/sql/engine/set/ob_merge_intersect.h +++ b/src/sql/engine/set/ob_merge_intersect.h @@ -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); diff --git a/src/sql/engine/set/ob_merge_intersect_op.h b/src/sql/engine/set/ob_merge_intersect_op.h index 2bccefd25..bec922e0d 100644 --- a/src/sql/engine/set/ob_merge_intersect_op.h +++ b/src/sql/engine/set/ob_merge_intersect_op.h @@ -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_; }; diff --git a/src/sql/engine/set/ob_merge_set_op.h b/src/sql/engine/set/ob_merge_set_op.h index 52c1026ce..9c2ea18f9 100644 --- a/src/sql/engine/set/ob_merge_set_op.h +++ b/src/sql/engine/set/ob_merge_set_op.h @@ -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* 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& compare_row, const common::ObIArray*& row, int& cmp); template @@ -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_; diff --git a/src/sql/engine/set/ob_merge_set_operator.h b/src/sql/engine/set/ob_merge_set_operator.h index 22693dcc3..1a8e39946 100644 --- a/src/sql/engine/set/ob_merge_set_operator.h +++ b/src/sql/engine/set/ob_merge_set_operator.h @@ -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& 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 set_directions_; diff --git a/src/sql/engine/set/ob_merge_union.cpp b/src/sql/engine/set/ob_merge_union.cpp index cb3429ba1..57dc565e7 100644 --- a/src/sql/engine/set/ob_merge_union.cpp +++ b/src/sql/engine/set/ob_merge_union.cpp @@ -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_; diff --git a/src/sql/engine/set/ob_merge_union.h b/src/sql/engine/set/ob_merge_union.h index 9f868cc15..29e9dae60 100644 --- a/src/sql/engine/set/ob_merge_union.h +++ b/src/sql/engine/set/ob_merge_union.h @@ -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); }; diff --git a/src/sql/engine/set/ob_merge_union_op.h b/src/sql/engine/set/ob_merge_union_op.h index 072cae944..87a51d825 100644 --- a/src/sql/engine/set/ob_merge_union_op.h +++ b/src/sql/engine/set/ob_merge_union_op.h @@ -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*& 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_; diff --git a/src/sql/engine/set/ob_set_op.h b/src/sql/engine/set/ob_set_op.h index eae4e3372..036d411af 100644 --- a/src/sql/engine/set/ob_set_op.h +++ b/src/sql/engine/set/ob_set_op.h @@ -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)); diff --git a/src/sql/engine/set/ob_set_operator.h b/src/sql/engine/set/ob_set_operator.h index 6f7b1a377..cb8f44780 100644 --- a/src/sql/engine/set/ob_set_operator.h +++ b/src/sql/engine/set/ob_set_operator.h @@ -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 cs_types_; int32_t child_num_; diff --git a/src/sql/engine/sort/ob_base_sort.cpp b/src/sql/engine/sort/ob_base_sort.cpp index d00b06fb0..b77a5e25c 100644 --- a/src/sql/engine/sort/ob_base_sort.cpp +++ b/src/sql/engine/sort/ob_base_sort.cpp @@ -212,7 +212,7 @@ struct ObBaseSort::TypedRowComparer { return bret; } - private: +private: bool inited_; ObSortColumn* sort_columns_; ObCmpNullPos* null_poses_; @@ -285,7 +285,7 @@ struct ObBaseSort::TypelessRowComparer { return bret; } - private: +private: bool inited_; ObSortColumn* sort_columns_; ObCmpNullPos* null_poses_; diff --git a/src/sql/engine/sort/ob_base_sort.h b/src/sql/engine/sort/ob_base_sort.h index b313704f2..f3346d1d2 100644 --- a/src/sql/engine/sort/ob_base_sort.h +++ b/src/sql/engine/sort/ob_base_sort.h @@ -30,7 +30,7 @@ namespace sql { struct ObSortColumnExtra { OB_UNIS_VERSION(1); - public: +public: static const uint8_t SORT_COL_EXTRA_MASK = 0x7F; static const uint8_t SORT_COL_EXTRA_BIT = 0x80; static const uint8_t SORT_COL_ASC_MASK = 0xFE; @@ -47,7 +47,7 @@ struct ObSortColumnExtra { }; class ObSortColumn : public common::ObColumnInfo, public ObSortColumnExtra { - public: +public: // +--------------------------------+----+---------+ // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | // +-------------------------------------+---------+ @@ -140,7 +140,7 @@ class ObSortColumn : public common::ObColumnInfo, public ObSortColumnExtra { }; class ObSortableTrait { - public: +public: ObSortableTrait(common::ObIAllocator& alloc) : sort_columns_(alloc) {} ~ObSortableTrait() @@ -167,7 +167,7 @@ class ObSortableTrait { sort_columns_.reuse(); } - protected: +protected: common::ObFixedArray sort_columns_; // for merge sort }; @@ -176,7 +176,7 @@ class ObBaseSort : public common::ObOuterRowIterator { struct TypedRowComparer; struct TypelessRowComparer; - public: +public: struct StrongTypeRow { common::ObObj* objs_; const common::ObNewRow* row_; @@ -200,7 +200,7 @@ class ObBaseSort : public common::ObOuterRowIterator { TO_STRING_KV(K_(objs), K_(row)); }; - public: +public: explicit ObBaseSort(); virtual ~ObBaseSort(){}; virtual void reset(); @@ -263,20 +263,20 @@ class ObBaseSort : public common::ObOuterRowIterator { static int enable_typed_sort(const common::ObIArray& sort_columns, const int64_t prefix_pos, const common::ObNewRow& row, bool& is_typed_sort); - private: +private: int inner_sort_rows(const bool is_typed_sort); - protected: +protected: int add_typed_row(const common::ObNewRow& row, common::ObIAllocator& alloc); - protected: +protected: int64_t topn_cnt_; // for topn - private: +private: // current allocator && next block allocator common::ObArenaAllocator row_alloc0_; common::ObArenaAllocator row_alloc1_; - protected: +protected: common::ObArenaAllocator* cur_alloc_; // deep copy current block row common::ObArenaAllocator* next_block_alloc_; // deep copy next block row common::ObArray sort_array_; @@ -284,7 +284,7 @@ class ObBaseSort : public common::ObOuterRowIterator { // put all nulls in one buffer, and put non-nulls in another buffer common::ObArray null_array_; - private: +private: int64_t row_count_; int64_t prefix_keys_pos_; // prefix columns keys pos int64_t row_array_pos_; // for get next row, cur array pos diff --git a/src/sql/engine/sort/ob_in_memory_sort.h b/src/sql/engine/sort/ob_in_memory_sort.h index 956cca970..dff5d5d35 100644 --- a/src/sql/engine/sort/ob_in_memory_sort.h +++ b/src/sql/engine/sort/ob_in_memory_sort.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace sql { class ObInMemorySort : public ObBaseSort { - public: +public: ObInMemorySort(); virtual ~ObInMemorySort(); virtual void reset(); @@ -52,12 +52,12 @@ class ObInMemorySort : public ObBaseSort { } TO_STRING_KV(K_(sort_array_pos)); - private: +private: // types struct StaticComparer; struct Comparer; - private: +private: // data members common::ObArenaAllocator allocator_; common::ObRowStore row_store_; diff --git a/src/sql/engine/sort/ob_in_memory_topn_sort.h b/src/sql/engine/sort/ob_in_memory_topn_sort.h index 51464a584..374816be3 100644 --- a/src/sql/engine/sort/ob_in_memory_topn_sort.h +++ b/src/sql/engine/sort/ob_in_memory_topn_sort.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace sql { class ObInMemoryTopnSort : public ObBaseSort { - public: +public: ObInMemoryTopnSort(); virtual ~ObInMemoryTopnSort(); virtual void reset(); @@ -51,7 +51,7 @@ class ObInMemoryTopnSort : public ObBaseSort { return iter_end_; } // TO_STRING_KV(K_(sort_array_pos)); - private: +private: // Optimize mem usage/performance of top-n sort: // Record buf_len of each allocated row. When old row pop-ed out of the heap // and has enough space for new row, use the space of old row to store new row @@ -78,10 +78,10 @@ class ObInMemoryTopnSort : public ObBaseSort { const common::ObIArray* sort_columns_; }; - private: +private: int adjust_topn_heap(const common::ObNewRow& row); - private: +private: // data members int64_t topn_sort_array_pos_; bool is_fetch_with_ties_; // for fetch with ties diff --git a/src/sql/engine/sort/ob_local_merge_sort.h b/src/sql/engine/sort/ob_local_merge_sort.h index 0c6c8cff4..84d1bd6fe 100644 --- a/src/sql/engine/sort/ob_local_merge_sort.h +++ b/src/sql/engine/sort/ob_local_merge_sort.h @@ -23,14 +23,14 @@ namespace sql { class ObExecContext; class ObLMSRowCompare : public ObRowComparer { - public: +public: bool operator()(int64_t row_idx1, int64_t row_idx2); }; class ObLocalMergeSort : public ObBaseSort { - private: +private: class InputReader { - public: + public: InputReader(int64_t start_pos, int64_t end_pos) : start_pos_(start_pos), end_pos_(end_pos), cur_pos_(start_pos) {} ~InputReader() @@ -39,13 +39,13 @@ class ObLocalMergeSort : public ObBaseSort { TO_STRING_KV(K_(start_pos), K_(end_pos)); - private: + private: int64_t start_pos_; int64_t end_pos_; int64_t cur_pos_; }; - public: +public: ObLocalMergeSort(); virtual ~ObLocalMergeSort(); @@ -64,7 +64,7 @@ class ObLocalMergeSort : public ObBaseSort { cur_input_ = nth_input; } - private: +private: virtual int cleanup(); virtual int save_last_row(); virtual int inner_add_row(const common::ObNewRow& row); @@ -79,7 +79,7 @@ class ObLocalMergeSort : public ObBaseSort { } virtual int alloc_reader(int64_t& start_pos, int64_t end_pos); - private: +private: bool is_finish_; bool is_heap_get_row_; int64_t cur_input_; diff --git a/src/sql/engine/sort/ob_merge_sort.h b/src/sql/engine/sort/ob_merge_sort.h index 588d4f67e..facbea6d1 100644 --- a/src/sql/engine/sort/ob_merge_sort.h +++ b/src/sql/engine/sort/ob_merge_sort.h @@ -32,7 +32,7 @@ class ObMergeSort : public ObIMergeSort, public common::ObOuterRowIterator { static const int64_t MEM_LIMIT_SIZE = 128 * 1024 * 1024; // 128M static const int64_t FILE_BUF_SIZE = 2 * 1024 * 1024; // 2M static const int64_t EXPIRE_TIMESTAMP = 0; // no time limit - public: +public: ObMergeSort(common::ObIAllocator& allocator); virtual ~ObMergeSort(); virtual void reset(); @@ -60,7 +60,7 @@ class ObMergeSort : public ObIMergeSort, public common::ObOuterRowIterator { virtual int build_cur_fragment(); int attach_row(const common::ObNewRow& src, common::ObNewRow& dst); - private: +private: // types and constants struct RowRun { RowRun() : id_(0), row_(NULL) @@ -82,12 +82,12 @@ class ObMergeSort : public ObIMergeSort, public common::ObOuterRowIterator { sort_columns_ = sort_columns; } - private: + private: const common::ObIArray* sort_columns_; int& ret_; }; - private: +private: // data members ObSortRun sort_run_[2]; ObSortRun* cur_round_; diff --git a/src/sql/engine/sort/ob_merge_sort_interface.h b/src/sql/engine/sort/ob_merge_sort_interface.h index 57a67230a..5767944ec 100644 --- a/src/sql/engine/sort/ob_merge_sort_interface.h +++ b/src/sql/engine/sort/ob_merge_sort_interface.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObIMergeSort { - public: +public: virtual int dump_base_run(common::ObOuterRowIterator& row_iterator, bool build_fragment = true) = 0; virtual int build_cur_fragment() = 0; }; diff --git a/src/sql/engine/sort/ob_run_file.h b/src/sql/engine/sort/ob_run_file.h index 3604e88e1..c1247f198 100644 --- a/src/sql/engine/sort/ob_run_file.h +++ b/src/sql/engine/sort/ob_run_file.h @@ -22,7 +22,7 @@ namespace sql { // support multi-bucket, multi-run in one physical file // @note not thread-safe class ObRunFile { - public: +public: ObRunFile(); virtual ~ObRunFile(); @@ -39,7 +39,7 @@ class ObRunFile { int get_next_row(const int64_t run_idx, common::ObNewRow& row); int end_read_bucket(); - private: +private: // types and constants static const int64_t MAGIC_NUMBER = 0x656c69666e7572; // "runfile" struct RunTrailer { @@ -66,7 +66,7 @@ class ObRunFile { TO_STRING_KV(K_(run_end_offset), K_(block_offset), K_(block_data_size), K_(next_row_pos)); }; - private: +private: // function members int find_last_run_trailer(const int64_t bucket_idx, RunTrailer*& bucket_info); int read_next_run_block(RunBlock& run_block); @@ -74,7 +74,7 @@ class ObRunFile { // @return OB_BUF_NOT_ENOUGH or OB_SUCCESS or other errors int parse_row(const char* buf, const int64_t buf_len, common::ObString& compact_row, common::ObNewRow& row); - private: +private: // data members common::ObFileAppender file_appender_; common::ObFileReader file_reader_; diff --git a/src/sql/engine/sort/ob_sort.h b/src/sql/engine/sort/ob_sort.h index b446a7eda..1d4ec6ec9 100644 --- a/src/sql/engine/sort/ob_sort.h +++ b/src/sql/engine/sort/ob_sort.h @@ -28,7 +28,7 @@ namespace sql { class ObExecContext; class ObPrefixSort : public ObSortImpl { - public: +public: ObPrefixSort(); // init && start fetch %op rows @@ -40,12 +40,12 @@ class ObPrefixSort : public ObSortImpl { void reuse(); void reset(); - private: +private: // fetch rows in same prefix && do sort, set %cur_row_ to NULL all child rows are fetched. int fetch_rows(); using ObSortImpl::init; - private: +private: int64_t prefix_pos_; const SortColumns* full_sort_columns_; common::ObArrayHelper base_sort_columns_; @@ -61,17 +61,17 @@ class ObPrefixSort : public ObSortImpl { class ObSort : public ObSingleChildPhyOperator, public ObSortableTrait { OB_UNIS_VERSION_V(1); static const int64_t MEM_LIMIT_SIZE = 128 * 1024 * 1024; // 128M - private: +private: class ObSortCtx : public ObPhyOperatorCtx { friend class ObSort; - public: + public: explicit ObSortCtx(ObExecContext& ctx); virtual ~ObSortCtx() {} virtual void destroy(); - private: + private: ObSortImpl sort_impl_; ObPrefixSort prefix_sort_impl_; ObInMemoryTopnSort topn_sort_; @@ -81,7 +81,7 @@ class ObSort : public ObSingleChildPhyOperator, public ObSortableTrait { int64_t ret_row_count_; }; - public: +public: explicit ObSort(common::ObIAllocator& alloc); virtual ~ObSort() {} @@ -125,7 +125,7 @@ class ObSort : public ObSingleChildPhyOperator, public ObSortableTrait { calc_exprs_, N_ORDER_BY, sort_columns_, N_LIMIT, mem_limit_, "minimum_row_count", minimum_row_count_, "topk_precision", topk_precision_); - private: +private: // function members int process_sort(ObExecContext& exec_ctx, ObSortCtx& sort_ctx) const; int get_int_value(ObExecContext& ctx, const ObSqlExpression* in_val, int64_t& out_val) const; @@ -177,7 +177,7 @@ class ObSort : public ObSingleChildPhyOperator, public ObSortableTrait { int topn_sort_next(ObExecContext& exec_ctx, ObSortCtx& sort_ctx, const ObNewRow*& row) const; - private: +private: int64_t mem_limit_; // unused, use GCONF.__sort_area_size as mem limit instead ObSqlExpression* topn_expr_; // used for topk diff --git a/src/sql/engine/sort/ob_sort_basic_info.h b/src/sql/engine/sort/ob_sort_basic_info.h index d1278109f..b3a6da796 100644 --- a/src/sql/engine/sort/ob_sort_basic_info.h +++ b/src/sql/engine/sort/ob_sort_basic_info.h @@ -22,7 +22,7 @@ namespace sql { struct ObSortFieldCollation { OB_UNIS_VERSION(1); - public: +public: ObSortFieldCollation( uint32_t field_idx, common::ObCollationType cs_type, bool is_ascending, common::ObCmpNullPos null_pos) : field_idx_(field_idx), cs_type_(cs_type), is_ascending_(is_ascending), null_pos_(null_pos) diff --git a/src/sql/engine/sort/ob_sort_impl.h b/src/sql/engine/sort/ob_sort_impl.h index 0283fafda..520143652 100644 --- a/src/sql/engine/sort/ob_sort_impl.h +++ b/src/sql/engine/sort/ob_sort_impl.h @@ -31,7 +31,7 @@ struct ObSortChunk : public common::ObDLinkBase { ObChunkRowStore::Iterator iter_; const ObChunkRowStore::StoredRow* row_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSortChunk); }; @@ -70,7 +70,7 @@ struct ObSortChunk : public common::ObDLinkBase { // ems/EMS: external merge sort // class ObSortImpl { - public: +public: static const int64_t EXTEND_MULTIPLE = 2; static const int64_t MAX_MERGE_WAYS = 256; static const int64_t INMEMORY_MERGE_SORT_WARN_WAYS = 10000; @@ -145,9 +145,9 @@ class ObSortImpl { void unregister_profile(); int get_sort_columns(common::ObIArray& sort_columns); - protected: +protected: class MemEntifyFreeGuard { - public: + public: explicit MemEntifyFreeGuard(lib::MemoryContext*& entify) : entify_(entify) {} ~MemEntifyFreeGuard() @@ -160,7 +160,7 @@ class ObSortImpl { lib::MemoryContext*& entify_; }; class Compare { - public: + public: Compare(); int init(common::ObArenaAllocator& alloc, const common::ObNewRow& row, const SortColumns* sort_columns, const SortExtraInfos* extra_infos); @@ -189,7 +189,7 @@ class ObSortImpl { new (this) Compare(); } - public: + public: int ret_; const SortColumns* sort_columns_; int32_t* indexes_; @@ -197,12 +197,12 @@ class ObSortImpl { obj_cmp_func_nullsafe* cmp_funcs_; ObCompareCtx cmp_ctx_; - private: + private: DISALLOW_COPY_AND_ASSIGN(Compare); }; class CopyableComparer { - public: + public: CopyableComparer(Compare& compare) : compare_(compare) {} bool operator()(const ObChunkRowStore::StoredRow* l, const ObChunkRowStore::StoredRow* r) @@ -259,7 +259,7 @@ class ObSortImpl { DISALLOW_COPY_AND_ASSIGN(ObSortImpl); - protected: +protected: typedef common::ObBinaryHeap IMMSHeap; typedef common::ObBinaryHeap EMSHeap; static const int64_t MAX_ROW_CNT = 268435456; // (2G / 8) @@ -300,7 +300,7 @@ class ObSortImpl { // NOTE: // Can not be accessed by base class pointer, since methods are not virtual. class ObUniqueSort : public ObSortImpl { - public: +public: ObUniqueSort() : prev_row_(NULL), prev_buf_size_(0) {} @@ -331,11 +331,11 @@ class ObUniqueSort : public ObSortImpl { return ObSortImpl::rewind(); } - private: +private: int save_prev_row(const ObChunkRowStore::StoredRow& sr); void free_prev_row(); - private: +private: ObChunkRowStore::StoredRow* prev_row_; int64_t prev_buf_size_; }; diff --git a/src/sql/engine/sort/ob_sort_op.h b/src/sql/engine/sort/ob_sort_op.h index d2d5b5ab9..19bd2ef83 100644 --- a/src/sql/engine/sort/ob_sort_op.h +++ b/src/sql/engine/sort/ob_sort_op.h @@ -25,13 +25,13 @@ namespace sql { class ObSortSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObSortSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); INHERIT_TO_STRING_KV("op_spec", ObOpSpec, K_(topn_expr), K_(topk_limit_expr), K_(topk_offset_expr), K_(prefix_pos), K_(minimum_row_count), K_(topk_precision), K_(prefix_pos), K_(is_local_merge_sort)); - public: +public: ObExpr* topn_expr_; ObExpr* topk_limit_expr_; ObExpr* topk_offset_expr_; @@ -54,7 +54,7 @@ class ObSortSpec : public ObOpSpec { }; class ObSortOp : public ObOperator { - public: +public: ObSortOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; @@ -68,7 +68,7 @@ class ObSortOp : public ObOperator { return sort_row_count_; } - private: +private: void reset(); int topn_sort_next(); template @@ -90,7 +90,7 @@ class ObSortOp : public ObOperator { int get_topn_count(int64_t& topn_cnt); int process_sort(); - private: +private: ObSortOpImpl sort_impl_; ObPrefixSortImpl prefix_sort_impl_; ObInMemoryTopnSortImpl topn_sort_; diff --git a/src/sql/engine/sort/ob_sort_op_impl.h b/src/sql/engine/sort/ob_sort_op_impl.h index 28012c270..762780c24 100644 --- a/src/sql/engine/sort/ob_sort_op_impl.h +++ b/src/sql/engine/sort/ob_sort_op_impl.h @@ -31,7 +31,7 @@ struct ObSortOpChunk : public common::ObDLinkBase { ObChunkDatumStore::Iterator iter_; const ObChunkDatumStore::StoredRow* row_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSortOpChunk); }; @@ -66,7 +66,7 @@ struct ObSortOpChunk : public common::ObDLinkBase { * ems/EMS: external merge sort */ class ObSortOpImpl { - public: +public: static const int64_t EXTEND_MULTIPLE = 2; static const int64_t MAX_MERGE_WAYS = 256; static const int64_t INMEMORY_MERGE_SORT_WARN_WAYS = 10000; @@ -159,7 +159,7 @@ class ObSortOpImpl { void unregister_profile(); class Compare { - public: + public: Compare(); int init(const ObIArray* sort_collations, const ObIArray* sort_cmp_funs); @@ -189,17 +189,17 @@ class ObSortOpImpl { new (this) Compare(); } - public: + public: int ret_; const ObIArray* sort_collations_; const ObIArray* sort_cmp_funs_; - private: + private: DISALLOW_COPY_AND_ASSIGN(Compare); }; class CopyableComparer { - public: + public: CopyableComparer(Compare& compare) : compare_(compare) {} bool operator()(const ObChunkDatumStore::StoredRow* l, const ObChunkDatumStore::StoredRow* r) @@ -209,9 +209,9 @@ class ObSortOpImpl { Compare& compare_; }; - protected: +protected: class MemEntifyFreeGuard { - public: + public: explicit MemEntifyFreeGuard(lib::MemoryContext*& entify) : entify_(entify) {} ~MemEntifyFreeGuard() @@ -273,7 +273,7 @@ class ObSortOpImpl { DISALLOW_COPY_AND_ASSIGN(ObSortOpImpl); - protected: +protected: typedef common::ObBinaryHeap IMMSHeap; typedef common::ObBinaryHeap EMSHeap; static const int64_t MAX_ROW_CNT = 268435456; // (2G / 8) @@ -312,7 +312,7 @@ class ObSortOpImpl { }; class ObPrefixSortImpl : public ObSortOpImpl { - public: +public: ObPrefixSortImpl(); // init && start fetch %op rows @@ -325,13 +325,13 @@ class ObPrefixSortImpl : public ObSortOpImpl { void reuse(); void reset(); - private: +private: // fetch rows in same prefix && do sort, set %next_prefix_row_ to NULL // when all child rows are fetched. int fetch_rows(const common::ObIArray& all_exprs); using ObSortOpImpl::init; - private: +private: int64_t prefix_pos_; const ObIArray* full_sort_collations_; const ObIArray* full_sort_cmp_funs_; @@ -349,7 +349,7 @@ class ObPrefixSortImpl : public ObSortOpImpl { }; class ObUniqueSortImpl : public ObSortOpImpl { - public: +public: ObUniqueSortImpl() : prev_row_(NULL), prev_buf_size_(0) {} @@ -383,17 +383,17 @@ class ObUniqueSortImpl : public ObSortOpImpl { return ObSortOpImpl::rewind(); } - private: +private: int save_prev_row(const ObChunkDatumStore::StoredRow& sr); void free_prev_row(); - private: +private: ObChunkDatumStore::StoredRow* prev_row_; int64_t prev_buf_size_; }; class ObInMemoryTopnSortImpl { - public: +public: ObInMemoryTopnSortImpl(); virtual ~ObInMemoryTopnSortImpl(); int init(const int64_t tenant_id, int64_t prefix_pos_, const ObIArray* sort_collations, @@ -425,7 +425,7 @@ class ObInMemoryTopnSortImpl { is_fetch_with_ties_ = is_fetch_with_ties; } // TO_STRING_KV(K_(sort_array_pos)); - private: +private: // Optimize mem usage/performance of top-n sort: // Record buf_len of each allocated row. When old row pop-ed out of the heap // and has enough space for new row, use the space of old row to store new row @@ -457,7 +457,7 @@ class ObInMemoryTopnSortImpl { } }; - private: +private: int adjust_topn_heap(const common::ObIArray& exprs); int convert_row(const SortStoredRow* sr, const common::ObIArray& exprs); int check_block_row(const common::ObIArray& exprs, const SortStoredRow* last_row, bool& is_cur_block); @@ -466,7 +466,7 @@ class ObInMemoryTopnSortImpl { return prefix_pos_ > 0; } - private: +private: static const int64_t STORE_ROW_HEADER_SIZE = sizeof(SortStoredRow); static const int64_t STORE_ROW_EXTRA_SIZE = sizeof(uint64_t); // data members diff --git a/src/sql/engine/sort/ob_sort_round.h b/src/sql/engine/sort/ob_sort_round.h index e647afe26..f120aa037 100644 --- a/src/sql/engine/sort/ob_sort_round.h +++ b/src/sql/engine/sort/ob_sort_round.h @@ -20,7 +20,7 @@ namespace sql { class ObSortRun { friend class ObMergeSort; - public: +public: typedef storage::ObFragmentWriterV2 FragmentWriter; typedef storage::ObFragmentReaderV2 FragmentReader; typedef common::ObArray FragmentIteratorList; @@ -39,11 +39,11 @@ class ObSortRun { return is_inited_; } - protected: +protected: FragmentWriter writer_; FragmentIteratorList iters_; - private: +private: bool is_inited_; int64_t buf_size_; int64_t expire_timestamp_; diff --git a/src/sql/engine/sort/ob_specific_columns_sort.h b/src/sql/engine/sort/ob_specific_columns_sort.h index b12342ea1..d81dcbeb7 100644 --- a/src/sql/engine/sort/ob_specific_columns_sort.h +++ b/src/sql/engine/sort/ob_specific_columns_sort.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObSpecificColumnsSort : public ObBaseSort { - public: +public: explicit ObSpecificColumnsSort(); ObSpecificColumnsSort(const char* label, uint64_t malloc_block_size, uint64_t tenant_id, oceanbase::common::ObCtxIds::ObCtxIdEnum ctx_id); @@ -65,13 +65,13 @@ class ObSpecificColumnsSort : public ObBaseSort { int deep_copy_new_row(const common::ObNewRow& row, common::ObNewRow*& new_row, common::ObArenaAllocator& alloc); TO_STRING_KV(K_(row_count), K_(prefix_keys_pos), K_(row_array_pos)); // private funs - private: +private: int init_specific_columns(); static int specific_columns_cmp(const void* p1, const void* p2); - protected: +protected: common::ObArenaAllocator row_alloc_; // deep copy row - private: +private: int64_t row_count_; int64_t prefix_keys_pos_; // prefix columns keys pos int64_t row_array_pos_; // for get next row, cur array pos diff --git a/src/sql/engine/subquery/ob_subplan_filter.cpp b/src/sql/engine/subquery/ob_subplan_filter.cpp index 06dc43c02..5b372858a 100644 --- a/src/sql/engine/subquery/ob_subplan_filter.cpp +++ b/src/sql/engine/subquery/ob_subplan_filter.cpp @@ -21,7 +21,7 @@ namespace oceanbase { using namespace common; namespace sql { class ObSubPlanFilter::ObSubPlanIterator : public ObNewRowIterator { - public: +public: ObSubPlanIterator(ObExecContext& ctx, const ObPhyOperator& op) : ObNewRowIterator(), ctx_(ctx), @@ -139,7 +139,7 @@ class ObSubPlanFilter::ObSubPlanIterator : public ObNewRowIterator { return ret; } - private: +private: ObExecContext& ctx_; const ObPhyOperator& op_; bool onetime_plan_; @@ -169,7 +169,7 @@ class ObSubPlanFilter::ObSubPlanFilterCtx : public ObPhyOperatorCtx { ObPhyOperatorCtx::destroy_base(); } - private: +private: ObSEArray subplan_iters_; friend class ObSubPlanFilter; }; diff --git a/src/sql/engine/subquery/ob_subplan_filter.h b/src/sql/engine/subquery/ob_subplan_filter.h index 8ca79f2c2..c1811ae6c 100644 --- a/src/sql/engine/subquery/ob_subplan_filter.h +++ b/src/sql/engine/subquery/ob_subplan_filter.h @@ -22,7 +22,7 @@ class ObSubPlanFilter : public ObMultiChildrenPhyOperator { class ObSubPlanFilterCtx; class ObSubPlanIterator; - public: +public: explicit ObSubPlanFilter(common::ObIAllocator& alloc); virtual ~ObSubPlanFilter(); @@ -68,7 +68,7 @@ class ObSubPlanFilter : public ObMultiChildrenPhyOperator { virtual int open(ObExecContext& ctx) const; virtual int switch_iterator(ObExecContext& ctx) const override; - private: +private: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -105,10 +105,10 @@ class ObSubPlanFilter : public ObMultiChildrenPhyOperator { int handle_update_set(ObSubPlanFilterCtx* subplan_ctx, const common::ObNewRow*& row) const; int construct_array_params(ObExecContext& ctx) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSubPlanFilter); - private: +private: common::ObFixedArray, common::ObIAllocator> rescan_params_; common::ObFixedArray, common::ObIAllocator> onetime_exprs_; common::ObBitSet init_plan_idxs_; diff --git a/src/sql/engine/subquery/ob_subplan_filter_op.h b/src/sql/engine/subquery/ob_subplan_filter_op.h index 43a28705c..c1d894ffb 100644 --- a/src/sql/engine/subquery/ob_subplan_filter_op.h +++ b/src/sql/engine/subquery/ob_subplan_filter_op.h @@ -21,7 +21,7 @@ namespace sql { // iterator subquery rows class ObSubQueryIterator { - public: +public: explicit ObSubQueryIterator(ObOperator& op); ~ObSubQueryIterator() {} @@ -55,7 +55,7 @@ class ObSubQueryIterator { TO_STRING_KV(K(onetime_plan_), K(init_plan_), K(inited_)); - private: +private: ObOperator& op_; bool onetime_plan_; bool init_plan_; @@ -69,7 +69,7 @@ class ObSubQueryIterator { class ObSubPlanFilterSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObSubPlanFilterSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); DECLARE_VIRTUAL_TO_STRING; @@ -88,7 +88,7 @@ class ObSubPlanFilterSpec : public ObOpSpec { }; class ObSubPlanFilterOp : public ObOperator { - public: +public: typedef ObSubQueryIterator Iterator; ObSubPlanFilterOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); @@ -109,7 +109,7 @@ class ObSubPlanFilterOp : public ObOperator { return subplan_iters_; } - private: +private: int set_param_null(); void destroy_subplan_iters(); void destroy_update_set_mem() @@ -124,7 +124,7 @@ class ObSubPlanFilterOp : public ObOperator { int prepare_onetime_exprs(); int handle_update_set(); - private: +private: common::ObSEArray subplan_iters_; lib::MemoryContext* update_set_mem_; }; diff --git a/src/sql/engine/subquery/ob_subplan_scan.cpp b/src/sql/engine/subquery/ob_subplan_scan.cpp index 312e6a47b..fed5633ad 100644 --- a/src/sql/engine/subquery/ob_subplan_scan.cpp +++ b/src/sql/engine/subquery/ob_subplan_scan.cpp @@ -18,7 +18,7 @@ namespace oceanbase { using namespace common; namespace sql { class ObSubPlanScan::ObSubPlanScanCtx : public ObPhyOperatorCtx { - public: +public: explicit ObSubPlanScanCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual void destroy() diff --git a/src/sql/engine/subquery/ob_subplan_scan.h b/src/sql/engine/subquery/ob_subplan_scan.h index 54385debb..d213922af 100644 --- a/src/sql/engine/subquery/ob_subplan_scan.h +++ b/src/sql/engine/subquery/ob_subplan_scan.h @@ -19,10 +19,10 @@ namespace sql { class ObSubPlanScan : public ObSingleChildPhyOperator { OB_UNIS_VERSION(1); - private: +private: class ObSubPlanScanCtx; - public: +public: explicit ObSubPlanScan(common::ObIAllocator& alloc); virtual ~ObSubPlanScan(); virtual void reset(); @@ -34,7 +34,7 @@ class ObSubPlanScan : public ObSingleChildPhyOperator { return init_array_size<>(output_indexs_, count); } - private: +private: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -66,11 +66,11 @@ class ObSubPlanScan : public ObSingleChildPhyOperator { */ virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSubPlanScan); - private: +private: // The information saved by output_indexs_ is the index of the column iterated by the lower operator that needs to be // output common::ObFixedArray output_indexs_; diff --git a/src/sql/engine/subquery/ob_subplan_scan_op.h b/src/sql/engine/subquery/ob_subplan_scan_op.h index 681c94850..e10cf485e 100644 --- a/src/sql/engine/subquery/ob_subplan_scan_op.h +++ b/src/sql/engine/subquery/ob_subplan_scan_op.h @@ -21,7 +21,7 @@ namespace sql { class ObSubPlanScanSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObSubPlanScanSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); // project child output to subplan scan column. // projector_is filled with [child output, scan column] paires, even index is child output, @@ -31,7 +31,7 @@ class ObSubPlanScanSpec : public ObOpSpec { }; class ObSubPlanScanOp : public ObOperator { - public: +public: ObSubPlanScanOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual int inner_open() override; diff --git a/src/sql/engine/subquery/ob_unpivot.cpp b/src/sql/engine/subquery/ob_unpivot.cpp index b24826e2c..f60199b6c 100644 --- a/src/sql/engine/subquery/ob_unpivot.cpp +++ b/src/sql/engine/subquery/ob_unpivot.cpp @@ -18,7 +18,7 @@ namespace oceanbase { using namespace common; namespace sql { class ObUnpivot::ObUnpivotCtx : public ObPhyOperatorCtx { - public: +public: explicit ObUnpivotCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), last_input_row_(NULL), is_end_(false), curr_part_idx_(common::OB_INVALID_INDEX) {} @@ -34,7 +34,7 @@ class ObUnpivot::ObUnpivotCtx : public ObPhyOperatorCtx { } friend class ObUnpivot; - public: +public: const ObNewRow* last_input_row_; bool is_end_; int64_t curr_part_idx_; diff --git a/src/sql/engine/subquery/ob_unpivot.h b/src/sql/engine/subquery/ob_unpivot.h index a97b9dc43..a6b804568 100644 --- a/src/sql/engine/subquery/ob_unpivot.h +++ b/src/sql/engine/subquery/ob_unpivot.h @@ -20,10 +20,10 @@ namespace sql { class ObUnpivot : public ObSingleChildPhyOperator { OB_UNIS_VERSION(1); - private: +private: class ObUnpivotCtx; - public: +public: explicit ObUnpivot(common::ObIAllocator& alloc); virtual ~ObUnpivot(); virtual void reset(); @@ -35,7 +35,7 @@ class ObUnpivot : public ObSingleChildPhyOperator { return init_array_size<>(output_indexs_, count); } - private: +private: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -67,11 +67,11 @@ class ObUnpivot : public ObSingleChildPhyOperator { */ virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; - public: +public: common::ObFixedArray output_indexs_; ObUnpivotInfo unpivot_info_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUnpivot); }; diff --git a/src/sql/engine/table/ob_block_sample_scan.h b/src/sql/engine/table/ob_block_sample_scan.h index 7d455f0e8..17209ad7b 100644 --- a/src/sql/engine/table/ob_block_sample_scan.h +++ b/src/sql/engine/table/ob_block_sample_scan.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObBlockSampleScanInput : public ObTableScanInput { - public: +public: virtual ObPhyOperatorType get_phy_op_type() const { return PHY_BLOCK_SAMPLE_SCAN; @@ -29,9 +29,9 @@ class ObBlockSampleScanInput : public ObTableScanInput { class ObBlockSampleScan : public ObTableScan { OB_UNIS_VERSION_V(1); - public: +public: class ObBlockSampleScanCtx : public ObTableScanCtx { - public: + public: ObBlockSampleScanCtx(ObExecContext& ctx) : ObTableScanCtx(ctx) {} }; @@ -60,7 +60,7 @@ class ObBlockSampleScan : public ObTableScan { return true; } - private: +private: common::SampleInfo sample_info_; }; diff --git a/src/sql/engine/table/ob_block_sample_scan_op.h b/src/sql/engine/table/ob_block_sample_scan_op.h index 482ec784f..1c897745d 100644 --- a/src/sql/engine/table/ob_block_sample_scan_op.h +++ b/src/sql/engine/table/ob_block_sample_scan_op.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObBlockSampleScanOpInput : public ObTableScanOpInput { - public: +public: ObBlockSampleScanOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableScanOpInput(ctx, spec) {} }; @@ -27,7 +27,7 @@ class ObBlockSampleScanOpInput : public ObTableScanOpInput { class ObBlockSampleScanSpec : public ObTableScanSpec { OB_UNIS_VERSION_V(1); - public: +public: explicit ObBlockSampleScanSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableScanSpec(alloc, type) {} @@ -47,12 +47,12 @@ class ObBlockSampleScanSpec : public ObTableScanSpec { return sample_info_; } - private: +private: common::SampleInfo sample_info_; }; class ObBlockSampleScanOp : public ObTableScanOp { - public: +public: ObBlockSampleScanOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableScanOp(exec_ctx, spec, input) {} diff --git a/src/sql/engine/table/ob_domain_index.h b/src/sql/engine/table/ob_domain_index.h index 6ade25c2b..dfe78fb14 100644 --- a/src/sql/engine/table/ob_domain_index.h +++ b/src/sql/engine/table/ob_domain_index.h @@ -24,9 +24,9 @@ class ObIterExprOperator; class ObDomainIndex : public ObNoChildrenPhyOperator { OB_UNIS_VERSION_V(1); - protected: +protected: class ObDomainIndexCtx : public ObPhyOperatorCtx { - public: + public: explicit ObDomainIndexCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), index_scan_iters_(ctx.get_allocator()), @@ -42,7 +42,7 @@ class ObDomainIndex : public ObNoChildrenPhyOperator { ObPhyOperatorCtx::destroy_base(); } - private: + private: common::ObFixedArray index_scan_iters_; common::ObFixedArray index_scan_params_; common::ObArenaAllocator index_allocator_; @@ -66,7 +66,7 @@ class ObDomainIndex : public ObNoChildrenPhyOperator { // ObSqlExpression *fulltext_filter_; // ObQueryRange *index_range_; // }; - public: +public: explicit ObDomainIndex(common::ObIAllocator& allocator); virtual ~ObDomainIndex(); @@ -119,7 +119,7 @@ class ObDomainIndex : public ObNoChildrenPhyOperator { } int rescan(ObExecContext& ctx) const; - private: +private: /** * @brief get next row, call get_next to get a row, * if filters exist, call each filter in turn to filter the row, @@ -160,7 +160,7 @@ class ObDomainIndex : public ObNoChildrenPhyOperator { ObExecContext& ctx, const common::ObObj& keyword, ObSqlExpression*& fulltext_filter, bool need_deep_copy) const; inline int replace_key_range(common::ObNewRange& key_range, const common::ObObj& keyword) const; - private: +private: uint64_t table_op_id_; common::ObIAllocator& allocator_; // common::ObFixedArray index_scan_info_; diff --git a/src/sql/engine/table/ob_i_virtual_table_iterator_factory.h b/src/sql/engine/table/ob_i_virtual_table_iterator_factory.h index 7e692898d..0b6e0cb0e 100644 --- a/src/sql/engine/table/ob_i_virtual_table_iterator_factory.h +++ b/src/sql/engine/table/ob_i_virtual_table_iterator_factory.h @@ -24,7 +24,7 @@ class ObVTableScanParam; namespace sql { class ObExecContext; class ObCreateVirtualTableParams { - public: +public: ObCreateVirtualTableParams() : table_id_(common::OB_INVALID_ID), key_ranges_() {} virtual ~ObCreateVirtualTableParams() @@ -36,7 +36,7 @@ class ObCreateVirtualTableParams { }; class ObIVirtualTableIteratorFactory { - public: +public: ObIVirtualTableIteratorFactory() {} virtual ~ObIVirtualTableIteratorFactory() @@ -46,7 +46,7 @@ class ObIVirtualTableIteratorFactory { common::ObVTableScanParam& params, common::ObVirtualTableIterator*& vt_iter) = 0; virtual int revert_virtual_table_iterator(common::ObVirtualTableIterator* vt_iter) = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIVirtualTableIteratorFactory); }; } // namespace sql diff --git a/src/sql/engine/table/ob_link_scan.h b/src/sql/engine/table/ob_link_scan.h index dc1fa27d6..783ea7031 100644 --- a/src/sql/engine/table/ob_link_scan.h +++ b/src/sql/engine/table/ob_link_scan.h @@ -24,9 +24,9 @@ namespace sql { class ObLinkScan : public ObNoChildrenPhyOperator { OB_UNIS_VERSION_V(1); - protected: +protected: class ObLinkScanCtx : public ObPhyOperatorCtx { - public: + public: typedef ObPhysicalPlanCtx::ParamStore ObParamStore; explicit ObLinkScanCtx(ObExecContext& ctx); virtual ~ObLinkScanCtx() @@ -51,7 +51,7 @@ class ObLinkScan : public ObNoChildrenPhyOperator { int get_next(const ObNewRow*& row); int rescan(); - private: + private: int combine_link_stmt(const common::ObString& link_stmt_fmt, const common::ObIArray& param_infos, const ObParamStore& param_store); int extend_stmt_buf(int64_t need_size = 0); @@ -59,7 +59,7 @@ class ObLinkScan : public ObNoChildrenPhyOperator { void reset_stmt(); void reset_result(); - private: + private: uint64_t dblink_id_; common::ObDbLinkProxy* dblink_proxy_; common::sqlclient::ObMySQLConnection* dblink_conn_; @@ -72,7 +72,7 @@ class ObLinkScan : public ObNoChildrenPhyOperator { static const int64_t STMT_BUF_BLOCK; }; - public: +public: explicit ObLinkScan(common::ObIAllocator& allocator); virtual ~ObLinkScan(); virtual void reset(); @@ -86,7 +86,7 @@ class ObLinkScan : public ObNoChildrenPhyOperator { dblink_id_ = dblink_id; } - protected: +protected: virtual int init_op_ctx(ObExecContext& ctx) const; virtual int inner_open(ObExecContext& ctx) const; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; @@ -94,7 +94,7 @@ class ObLinkScan : public ObNoChildrenPhyOperator { virtual int rescan(ObExecContext& ctx) const; void reset_inner(); - private: +private: common::ObIAllocator& allocator_; common::ObFixedArray param_infos_; common::ObString stmt_fmt_; diff --git a/src/sql/engine/table/ob_lookup_task_builder.h b/src/sql/engine/table/ob_lookup_task_builder.h index b635ab3b6..cad840e7d 100644 --- a/src/sql/engine/table/ob_lookup_task_builder.h +++ b/src/sql/engine/table/ob_lookup_task_builder.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace sql { class ObPartitionScanRanges; class ObLookupTaskBuilder { - public: +public: explicit ObLookupTaskBuilder(common::ObIAllocator& allocator) : allocator_(allocator), exec_ctx_(NULL), @@ -62,7 +62,7 @@ class ObLookupTaskBuilder { return lookup_taskinfo_list_; } - private: +private: int get_partition_server(int64_t partition_id, ObAddr& run_server); int add_range_to_taskinfo(int64_t partition_id, ObIArray& ranges, const ObAddr& run_server); int create_op_input(ObExecContext& ctx, const ObPhyOperator& root_op); @@ -77,7 +77,7 @@ class ObLookupTaskBuilder { int64_t& succ_range_count, common::ObIArray& retry_task_list, common::ObIArray& retry_task_info_list); - private: +private: common::ObIAllocator& allocator_; ObExecContext* exec_ctx_; const ObPhysicalPlan* my_plan_; @@ -91,7 +91,7 @@ class ObLookupTaskBuilder { uint64_t new_task_id_; bool weak_read_; - private: +private: static const int64_t LOCAL_TASK_POS = 0; }; diff --git a/src/sql/engine/table/ob_multi_part_table_scan.h b/src/sql/engine/table/ob_multi_part_table_scan.h index 89b276b9c..b147a7304 100644 --- a/src/sql/engine/table/ob_multi_part_table_scan.h +++ b/src/sql/engine/table/ob_multi_part_table_scan.h @@ -22,7 +22,7 @@ namespace sql { class ObMultiPartTableScanInput : public ObTableScanInput { OB_UNIS_VERSION_V(1); - public: +public: ObMultiPartTableScanInput() : allocator_(common::ObModIds::OB_SQL_TABLE_LOOKUP), partitions_ranges_() {} virtual ~ObMultiPartTableScanInput(); @@ -39,12 +39,12 @@ class ObMultiPartTableScanInput : public ObTableScanInput { }; class ObMultiPartTableScan : public ObTableScan { - private: +private: enum MultiPartScanState { DO_PARTITION_SCAN, OUTPUT_ROWS, EXECUTION_FINISHED }; class ObMultiPartTableScanCtx : public ObTableScanCtx { friend class ObMultiPartTableScan; - public: + public: explicit ObMultiPartTableScanCtx(ObExecContext& ctx) : ObTableScanCtx(ctx), input_part_offset_(NOT_INIT), multi_part_scan_state_(DO_PARTITION_SCAN), scan_times_(0) {} @@ -65,7 +65,7 @@ class ObMultiPartTableScan : public ObTableScan { int64_t scan_times_; }; - public: +public: explicit ObMultiPartTableScan(common::ObIAllocator& allocator); virtual ~ObMultiPartTableScan(); virtual int rescan(ObExecContext& ctx) const; @@ -81,10 +81,10 @@ class ObMultiPartTableScan : public ObTableScan { virtual int init_op_ctx(ObExecContext& ctx) const override final; void get_used_range_count(ObExecContext& ctx, int64_t& range_count) const; - private: +private: int do_next_partition_scan(ObExecContext& ctx) const; - private: +private: static const int64_t NOT_INIT = 0; }; } // namespace sql diff --git a/src/sql/engine/table/ob_multi_part_table_scan_op.h b/src/sql/engine/table/ob_multi_part_table_scan_op.h index 2b15010f9..c5f0c11b6 100644 --- a/src/sql/engine/table/ob_multi_part_table_scan_op.h +++ b/src/sql/engine/table/ob_multi_part_table_scan_op.h @@ -24,7 +24,7 @@ class ObMultiPartTableScanOpInput : public ObTableScanOpInput { OB_UNIS_VERSION_V(1); friend ObMultiPartTableScanOp; - public: +public: ObMultiPartTableScanOpInput(ObExecContext& ctx, const ObOpSpec& spec); virtual ~ObMultiPartTableScanOpInput() { @@ -36,7 +36,7 @@ class ObMultiPartTableScanOpInput : public ObTableScanOpInput { int reassign_ranges(int64_t table_location_key, int64_t ref_table_id, int64_t& partition_offset); - public: +public: common::ObArenaAllocator allocator_; ObMultiPartitionsRangesWarpper partitions_ranges_; @@ -46,18 +46,18 @@ class ObMultiPartTableScanOpInput : public ObTableScanOpInput { class ObMultiPartTableScanSpec : public ObTableScanSpec { OB_UNIS_VERSION_V(1); - public: +public: ObMultiPartTableScanSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableScanSpec(alloc, type) {} virtual ~ObMultiPartTableScanSpec(){}; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultiPartTableScanSpec); }; class ObMultiPartTableScanOp : public ObTableScanOp { - public: +public: ObMultiPartTableScanOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); ~ObMultiPartTableScanOp() { @@ -84,17 +84,17 @@ class ObMultiPartTableScanOp : public ObTableScanOp { void get_used_range_count(int64_t& range_count) const; - private: +private: enum MultiPartScanState { DO_PARTITION_SCAN, OUTPUT_ROWS, EXECUTION_FINISHED }; int do_next_partition_scan(); - private: +private: static const int64_t NOT_INIT = 0; int64_t input_part_offset_; MultiPartScanState multi_part_scan_state_; int64_t scan_times_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultiPartTableScanOp); }; diff --git a/src/sql/engine/table/ob_mv_table_scan.h b/src/sql/engine/table/ob_mv_table_scan.h index b77bc6c0e..6b0e3f8eb 100644 --- a/src/sql/engine/table/ob_mv_table_scan.h +++ b/src/sql/engine/table/ob_mv_table_scan.h @@ -20,18 +20,18 @@ namespace oceanbase { namespace sql { class ObMVTableScanInput : public ObTableScanInput { - public: +public: virtual ObPhyOperatorType get_phy_op_type() const; }; class ObMVTableScan : public ObTableScan { OB_UNIS_VERSION_V(1); - protected: +protected: class ObMVTableScanCtx : public ObTableScanCtx { friend class ObMVTableScan; - public: + public: ObMVTableScanCtx(ObExecContext& ctx) : ObTableScanCtx(ctx) {} virtual void destroy() @@ -40,11 +40,11 @@ class ObMVTableScan : public ObTableScan { ObTableScanCtx::destroy(); } - protected: + protected: storage::ObTableScanParam right_scan_param_; }; - public: +public: explicit ObMVTableScan(common::ObIAllocator& allocator); virtual ~ObMVTableScan() {} @@ -72,17 +72,17 @@ class ObMVTableScan : public ObTableScan { virtual int init_op_ctx(ObExecContext& ctx) const; virtual int prepare_scan_param(ObExecContext& ctx) const; - protected: +protected: int do_table_scan(ObExecContext& ctx, bool is_rescan) const; - private: +private: share::schema::ObTableParam right_table_param_; uint64_t right_table_location_key_; }; // TODO : not implemented right row, Added here to adapt the template. class ObMVTableScanSpec : public ObTableScanSpec { - public: +public: uint64_t get_right_table_location_key() const { return 0; diff --git a/src/sql/engine/table/ob_row_sample_scan.h b/src/sql/engine/table/ob_row_sample_scan.h index 95942cdb1..aca9099ec 100644 --- a/src/sql/engine/table/ob_row_sample_scan.h +++ b/src/sql/engine/table/ob_row_sample_scan.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObRowSampleScanInput : public ObTableScanInput { - public: +public: virtual ObPhyOperatorType get_phy_op_type() const { return PHY_ROW_SAMPLE_SCAN; @@ -29,9 +29,9 @@ class ObRowSampleScanInput : public ObTableScanInput { class ObRowSampleScan : public ObTableScan { OB_UNIS_VERSION_V(1); - public: +public: class ObRowSampleScanCtx : public ObTableScanCtx { - public: + public: ObRowSampleScanCtx(ObExecContext& ctx) : ObTableScanCtx(ctx) {} }; @@ -61,7 +61,7 @@ class ObRowSampleScan : public ObTableScan { return true; } - private: +private: common::SampleInfo sample_info_; }; diff --git a/src/sql/engine/table/ob_row_sample_scan_op.h b/src/sql/engine/table/ob_row_sample_scan_op.h index a6ad83401..2cf3ba742 100644 --- a/src/sql/engine/table/ob_row_sample_scan_op.h +++ b/src/sql/engine/table/ob_row_sample_scan_op.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObRowSampleScanOpInput : public ObTableScanOpInput { - public: +public: ObRowSampleScanOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTableScanOpInput(ctx, spec) {} }; @@ -27,7 +27,7 @@ class ObRowSampleScanOpInput : public ObTableScanOpInput { class ObRowSampleScanSpec : public ObTableScanSpec { OB_UNIS_VERSION_V(1); - public: +public: explicit ObRowSampleScanSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTableScanSpec(alloc, type) {} virtual ~ObRowSampleScanSpec() @@ -46,12 +46,12 @@ class ObRowSampleScanSpec : public ObTableScanSpec { return sample_info_; } - private: +private: common::SampleInfo sample_info_; }; class ObRowSampleScanOp : public ObTableScanOp { - public: +public: ObRowSampleScanOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableScanOp(exec_ctx, spec, input) {} diff --git a/src/sql/engine/table/ob_table_lookup.cpp b/src/sql/engine/table/ob_table_lookup.cpp index 3740154f8..9b75ae0c7 100644 --- a/src/sql/engine/table/ob_table_lookup.cpp +++ b/src/sql/engine/table/ob_table_lookup.cpp @@ -28,7 +28,7 @@ namespace sql { class ObTableLookup::ObTableLookupCtx : public ObPhyOperatorCtx { friend class ObTableLookup; - public: +public: explicit ObTableLookupCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), allocator_(), @@ -72,7 +72,7 @@ class ObTableLookup::ObTableLookupCtx : public ObPhyOperatorCtx { partitions_ranges_.set_mem_attr(attr); } - private: +private: common::ObArenaAllocator allocator_; // for result ObMiniTaskResult result_; diff --git a/src/sql/engine/table/ob_table_lookup.h b/src/sql/engine/table/ob_table_lookup.h index f089c3f23..e56579bef 100644 --- a/src/sql/engine/table/ob_table_lookup.h +++ b/src/sql/engine/table/ob_table_lookup.h @@ -27,7 +27,7 @@ namespace sql { typedef struct _ObLookupInfo { OB_UNIS_VERSION_V(1); - public: +public: _ObLookupInfo() : ref_table_id_(common::OB_INVALID_ID), table_id_(common::OB_INVALID_ID), @@ -59,10 +59,10 @@ class ObTableLookup : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); class ObTableLookupCtx; - private: +private: enum LookupState { INDEX_SCAN, DISTRIBUTED_LOOKUP, OUTPUT_ROWS, EXECUTION_FINISHED }; - public: +public: explicit ObTableLookup(common::ObIAllocator& alloc); virtual ~ObTableLookup(); @@ -83,7 +83,7 @@ class ObTableLookup : public ObSingleChildPhyOperator { return table_location_; } - protected: +protected: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -115,11 +115,11 @@ class ObTableLookup : public ObSingleChildPhyOperator { */ virtual int inner_close(ObExecContext& ctx) const; - private: +private: int process_row(ObExecContext& ctx, const common::ObNewRow* row, int64_t& part_row_cnt) const; int wait_all_task(ObTableLookupCtx& dml_ctx, ObPhysicalPlanCtx* plan_ctx) const; - private: +private: /* * default row count * */ diff --git a/src/sql/engine/table/ob_table_lookup_op.h b/src/sql/engine/table/ob_table_lookup_op.h index 8c636b95b..00c04611a 100644 --- a/src/sql/engine/table/ob_table_lookup_op.h +++ b/src/sql/engine/table/ob_table_lookup_op.h @@ -24,26 +24,26 @@ namespace sql { class ObTableLookupSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableLookupSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), remote_tsc_spec_(NULL), lookup_info_(), calc_part_id_expr_(NULL) {} virtual ~ObTableLookupSpec(){}; - public: +public: ObOpSpec* remote_tsc_spec_; ObLookupInfo lookup_info_; ObExpr* calc_part_id_expr_; - public: - private: +public: +private: DISALLOW_COPY_AND_ASSIGN(ObTableLookupSpec); }; class ObTableLookupOp : public ObOperator { - public: +public: ObTableLookupOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); ~ObTableLookupOp() { @@ -56,7 +56,7 @@ class ObTableLookupOp : public ObOperator { int inner_close() override; void destroy() override; - private: +private: enum LookupState { INDEX_SCAN, DISTRIBUTED_LOOKUP, OUTPUT_ROWS, EXECUTION_FINISHED }; int process_row(int64_t& part_row_cnt); int store_row(int64_t part_id, const common::ObNewRow* row); @@ -79,7 +79,7 @@ class ObTableLookupOp : public ObOperator { bool is_target_partition(int64_t pid); int wait_all_task(ObPhysicalPlanCtx* plan_ctx); - private: +private: const static int64_t DEFAULT_BATCH_ROW_COUNT = 1024l * 1024; const static int64_t DEFAULT_PARTITION_BATCH_ROW_COUNT = 1000L; @@ -97,7 +97,7 @@ class ObTableLookupOp : public ObOperator { int64_t partition_cnt_; share::schema::ObSchemaGetterGuard* schema_guard_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableLookupOp); }; diff --git a/src/sql/engine/table/ob_table_partition_ranges.h b/src/sql/engine/table/ob_table_partition_ranges.h index a0af77f8f..55db1c855 100644 --- a/src/sql/engine/table/ob_table_partition_ranges.h +++ b/src/sql/engine/table/ob_table_partition_ranges.h @@ -30,7 +30,7 @@ class ObEvalCtx; class ObPartitionScanRanges { OB_UNIS_VERSION_V(1); - public: +public: ObPartitionScanRanges() : ranges_(), partition_id_(common::OB_INVALID_INDEX), deserialize_allocator_(NULL) {} explicit ObPartitionScanRanges(common::ObIAllocator* allocator) @@ -51,20 +51,20 @@ class ObPartitionScanRanges { int64_t partition_id_; TO_STRING_KV(K_(partition_id), K_(ranges)); - private: +private: common::ObIAllocator* deserialize_allocator_; }; class ObMultiPartitionsRangesWarpper { OB_UNIS_VERSION_V(1); - private: +private: enum GetRangeMode { PARTITION_PARTICLE, RANGE_PARTICLE, }; - public: +public: explicit ObMultiPartitionsRangesWarpper() : allocator_(common::ObModIds::OB_SQL_TABLE_LOOKUP), partitions_ranges_(common::OB_MALLOC_NORMAL_BLOCK_SIZE, allocator_), @@ -102,10 +102,10 @@ class ObMultiPartitionsRangesWarpper { allocator_.set_attr(attr); } - private: +private: int init_main_table_rowkey(const int64_t column_count, common::ObNewRow& row); - private: +private: common::ObArenaAllocator allocator_; common::ObArray partitions_ranges_; common::ObNewRow main_table_rowkey_; diff --git a/src/sql/engine/table/ob_table_row_store.cpp b/src/sql/engine/table/ob_table_row_store.cpp index 2c4da751b..4cc69bd08 100644 --- a/src/sql/engine/table/ob_table_row_store.cpp +++ b/src/sql/engine/table/ob_table_row_store.cpp @@ -106,7 +106,7 @@ OB_DEF_DESERIALIZE(ObTableRowStoreInput) OB_SERIALIZE_MEMBER((ObTableRowStore, ObNoChildrenPhyOperator)); class ObTableRowStore::ObTableRowStoreCtx : public ObPhyOperatorCtx { - public: +public: explicit ObTableRowStoreCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), row_store_it_(), row_store_idx_(OB_INVALID_INDEX) {} @@ -115,7 +115,7 @@ class ObTableRowStore::ObTableRowStoreCtx : public ObPhyOperatorCtx { ObPhyOperatorCtx::destroy_base(); } - private: +private: ObRowStore::Iterator row_store_it_; int64_t row_store_idx_; friend class ObTableRowStore; diff --git a/src/sql/engine/table/ob_table_row_store.h b/src/sql/engine/table/ob_table_row_store.h index d9df2d7f8..3835f1085 100644 --- a/src/sql/engine/table/ob_table_row_store.h +++ b/src/sql/engine/table/ob_table_row_store.h @@ -23,7 +23,7 @@ class ObTableRowStoreInput : public ObIPhyOperatorInput { friend class ObTableRowStore; OB_UNIS_VERSION_V(1); - public: +public: ObTableRowStoreInput() : multi_row_store_(), allocator_(NULL) {} virtual ~ObTableRowStoreInput() @@ -44,11 +44,11 @@ class ObTableRowStoreInput : public ObIPhyOperatorInput { */ virtual void set_deserialize_allocator(common::ObIAllocator* allocator); - private: +private: common::ObFixedArray multi_row_store_; common::ObIAllocator* allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableRowStoreInput); }; @@ -56,7 +56,7 @@ class ObTableRowStore : public ObNoChildrenPhyOperator { OB_UNIS_VERSION(1); class ObTableRowStoreCtx; - public: +public: explicit ObTableRowStore(common::ObIAllocator& alloc) : ObNoChildrenPhyOperator(alloc), table_id_(common::OB_INVALID_ID) {} @@ -74,7 +74,7 @@ class ObTableRowStore : public ObNoChildrenPhyOperator { } virtual int create_operator_input(ObExecContext& ctx) const; - private: +private: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -101,7 +101,7 @@ class ObTableRowStore : public ObNoChildrenPhyOperator { virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const; DISALLOW_COPY_AND_ASSIGN(ObTableRowStore); - private: +private: uint64_t table_id_; }; } // namespace sql diff --git a/src/sql/engine/table/ob_table_row_store_op.h b/src/sql/engine/table/ob_table_row_store_op.h index 05572a99a..e1f0502e2 100644 --- a/src/sql/engine/table/ob_table_row_store_op.h +++ b/src/sql/engine/table/ob_table_row_store_op.h @@ -23,7 +23,7 @@ class ObTableRowStoreOpInput : public ObOpInput { friend class ObTableRowStoreOp; OB_UNIS_VERSION(1); - public: +public: ObTableRowStoreOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObOpInput(ctx, spec), multi_row_store_(), allocator_(NULL) {} @@ -43,34 +43,34 @@ class ObTableRowStoreOpInput : public ObOpInput { */ virtual void set_deserialize_allocator(common::ObIAllocator* allocator); - private: +private: // One partition corresponds to one row store common::ObFixedArray multi_row_store_; common::ObIAllocator* allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableRowStoreOpInput); }; class ObTableRowStoreSpec : public ObOpSpec { OB_UNIS_VERSION(1); - public: +public: ObTableRowStoreSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObOpSpec(alloc, type), table_id_(common::OB_INVALID_ID) {} ~ObTableRowStoreSpec() {} - public: +public: uint64_t table_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableRowStoreSpec); }; class ObTableRowStoreOp : public ObOperator { - public: +public: ObTableRowStoreOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObOperator(exec_ctx, spec, input), row_store_idx_(0) {} @@ -106,11 +106,11 @@ class ObTableRowStoreOp : public ObOperator { int fetch_stored_row(); - private: +private: ObChunkDatumStore::Iterator row_store_it_; int64_t row_store_idx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableRowStoreOp); }; } // namespace sql diff --git a/src/sql/engine/table/ob_table_scan.h b/src/sql/engine/table/ob_table_scan.h index 2b6807b08..ff5c42cf9 100644 --- a/src/sql/engine/table/ob_table_scan.h +++ b/src/sql/engine/table/ob_table_scan.h @@ -50,7 +50,7 @@ class ObTableScanInput : public ObIPhyOperatorInput { friend class ObMultiPartitionTableScan; OB_UNIS_VERSION_V(1); - public: +public: ObTableScanInput(); virtual ~ObTableScanInput(); virtual void reset() override; @@ -67,20 +67,20 @@ class ObTableScanInput : public ObIPhyOperatorInput { int translate_pid_to_ldx(ObExecContext& ctx, int64_t partition_id, int64_t table_location_key, int64_t ref_table_id, int64_t& location_idx); - private: +private: int deep_copy_range(common::ObIAllocator* allocator, const common::ObNewRange& src, common::ObNewRange& dst); - protected: +protected: int64_t location_idx_; - protected: +protected: common::ObSEArray key_ranges_; common::ObPosArray range_array_pos_; // This variable is reserved for compatibility. Because 2.0 will // serialize and deserialize this variable common::ObSEArray partition_ranges_; - protected: +protected: common::ObIAllocator* deserialize_allocator_; DISALLOW_COPY_AND_ASSIGN(ObTableScanInput); }; @@ -88,7 +88,7 @@ class ObTableScanInput : public ObIPhyOperatorInput { class ObTableScan : public ObNoChildrenPhyOperator { OB_UNIS_VERSION_V(1); - public: +public: class ObTableScanCtx : public ObPhyOperatorCtx { friend class ObTableScan; friend class ObDomainIndex; @@ -100,7 +100,7 @@ class ObTableScan : public ObNoChildrenPhyOperator { friend class ObTableScanCreateDomainIndex; friend class ObMultiPartTableScan; - public: + public: explicit ObTableScanCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), result_(NULL), @@ -170,7 +170,7 @@ class ObTableScan : public ObNoChildrenPhyOperator { } virtual int init_table_allocator(ObExecContext& ctx); - public: + public: common::ObNewRowIterator* result_; // used for array binding common::ObNewIterIterator* iter_result_; @@ -190,7 +190,7 @@ class ObTableScan : public ObNoChildrenPhyOperator { sql::ObVirtualTableResultConverter* vt_result_converter_; }; - public: +public: explicit ObTableScan(common::ObIAllocator& allocator); virtual ~ObTableScan(); virtual void reset(); @@ -568,7 +568,7 @@ class ObTableScan : public ObNoChildrenPhyOperator { static int transform_rowid_range( common::ObIAllocator& allocator, const ObIArray& rowkey_descs, ObNewRange& key_range); - protected: +protected: /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context @@ -623,7 +623,7 @@ class ObTableScan : public ObNoChildrenPhyOperator { static int transform_rowid_rowkey( common::ObIAllocator& allocator, const ObIArray& rowkey_descs, ObRowkey& row_key); - protected: +protected: // params uint64_t ref_table_id_; // real table id for table to scan // @param: table_name_ & index_name_ @@ -693,13 +693,13 @@ class ObTableScan : public ObNoChildrenPhyOperator { // used for partition cutting ObTableLocation part_filter_; - private: +private: bool is_whole_range_scan_; // used for batch nested loop join bool batch_scan_flag_; bool need_scn_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableScan); }; diff --git a/src/sql/engine/table/ob_table_scan_create_domain_index.h b/src/sql/engine/table/ob_table_scan_create_domain_index.h index 16a46c4c8..e6aca0bdf 100644 --- a/src/sql/engine/table/ob_table_scan_create_domain_index.h +++ b/src/sql/engine/table/ob_table_scan_create_domain_index.h @@ -19,24 +19,24 @@ namespace oceanbase { namespace sql { class ObTableScanCreateDomainIndex : public ObTableScan { - public: +public: explicit ObTableScanCreateDomainIndex(common::ObIAllocator& allocator); virtual ~ObTableScanCreateDomainIndex(); void set_create_index_table_id(const uint64_t create_index_id); uint64_t get_create_index_table_id() const; - protected: +protected: virtual int inner_open(ObExecContext& ctx) const override; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const override; - private: +private: int get_domain_index_col_pos(ObExecContext& ctx, const common::ObIArray& col_ids, const int64_t schema_version, int64_t& domain_index_pos) const; - protected: +protected: using ObTableScan::ObTableScanCtx; - private: +private: static const int64_t DEFAULT_WORD_COUNT = 8; mutable ObSEArray words_; mutable int64_t word_index_; diff --git a/src/sql/engine/table/ob_table_scan_op.h b/src/sql/engine/table/ob_table_scan_op.h index 6c0ea257b..accc286ff 100644 --- a/src/sql/engine/table/ob_table_scan_op.h +++ b/src/sql/engine/table/ob_table_scan_op.h @@ -43,7 +43,7 @@ class ObTableScanOpInput : public ObOpInput { OB_UNIS_VERSION_V(1); friend ObTableScanOp; - public: +public: ObTableScanOpInput(ObExecContext& ctx, const ObOpSpec& spec); virtual ~ObTableScanOpInput(); @@ -66,7 +66,7 @@ class ObTableScanOpInput : public ObOpInput { int translate_pid_to_ldx( int64_t partition_id, int64_t table_location_key, int64_t ref_table_id, int64_t& location_idx); - protected: +protected: int64_t location_idx_; common::ObSEArray key_ranges_; common::ObPosArray range_array_pos_; @@ -79,7 +79,7 @@ class ObTableScanOpInput : public ObOpInput { class ObTableScanSpec : public ObOpSpec { OB_UNIS_VERSION_V(1); - public: +public: ObTableScanSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); uint64_t get_location_table_id() const @@ -136,7 +136,7 @@ class ObTableScanSpec : public ObOpSpec { DECLARE_VIRTUAL_TO_STRING; - public: +public: /* * ref_table_id_ is the physical id of main table of table scan, such as 1101710651081732 * index_id_ is the physical id of global/local index of the table scan, such as 1101710651081734 @@ -237,7 +237,7 @@ class ObTableScanSpec : public ObOpSpec { }; class ObTableScanOp : public ObOperator { - public: +public: static constexpr int64_t CHECK_STATUS_ROWS_INTERVAL = 1 << 13; ObTableScanOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); @@ -284,7 +284,7 @@ class ObTableScanOp : public ObOperator { int init_converter(); - protected: +protected: int init_pushdown_storage_filter(); int calc_expr_int_value(const ObExpr& expr, int64_t& retval, bool& is_null_value); virtual int do_table_scan(bool is_rescan, bool need_prepare = true); @@ -320,10 +320,10 @@ class ObTableScanOp : public ObOperator { void fill_table_scan_stat(const ObTableScanStatistic& statistic, ObTableScanStat& scan_stat) const; void set_cache_stat(const ObPlanStat& plan_stat, storage::ObTableScanParam& param); - private: +private: int get_next_row_with_mode(); - protected: +protected: common::ObNewRowIterator* result_; // result iterator of array binding common::ObNewIterIterator* ab_iters_; diff --git a/src/sql/engine/table/ob_table_scan_with_checksum.h b/src/sql/engine/table/ob_table_scan_with_checksum.h index 88bc195aa..0527c7c1d 100644 --- a/src/sql/engine/table/ob_table_scan_with_checksum.h +++ b/src/sql/engine/table/ob_table_scan_with_checksum.h @@ -21,7 +21,7 @@ namespace sql { class ObTableScanWithChecksumInput : public ObTableScanInput { OB_UNIS_VERSION_V(1); - public: +public: ObTableScanWithChecksumInput(); virtual ~ObTableScanWithChecksumInput(); virtual void reset() override; @@ -35,24 +35,24 @@ class ObTableScanWithChecksumInput : public ObTableScanInput { return PHY_TABLE_SCAN_WITH_CHECKSUM; } - private: +private: ObTaskID task_id_; }; // when builds index, this operator is used to calculate checksum of data table class ObTableScanWithChecksum : public ObTableScan { - public: +public: explicit ObTableScanWithChecksum(common::ObIAllocator& allocator); virtual ~ObTableScanWithChecksum(); - protected: +protected: virtual int inner_open(ObExecContext& ctx) const override; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const override; virtual int init_op_ctx(ObExecContext& ctx) const override; - protected: +protected: class ObTableScanWithChecksumCtx : public ObTableScan::ObTableScanCtx { - public: + public: explicit ObTableScanWithChecksumCtx(ObExecContext& ctx); virtual ~ObTableScanWithChecksumCtx(); virtual void destroy(); @@ -61,7 +61,7 @@ class ObTableScanWithChecksum : public ObTableScan { int add_row_checksum(const common::ObNewRow* row); int report_checksum(const int64_t execution_id); - public: + public: int64_t* checksum_; ObArray col_ids_; uint64_t task_id_; diff --git a/src/sql/engine/table/ob_table_scan_with_index_back.h b/src/sql/engine/table/ob_table_scan_with_index_back.h index 8edd7a90b..762b125d8 100644 --- a/src/sql/engine/table/ob_table_scan_with_index_back.h +++ b/src/sql/engine/table/ob_table_scan_with_index_back.h @@ -17,26 +17,26 @@ namespace oceanbase { namespace sql { class ObDomainIndex; class ObTableScanWithIndexBack : public ObTableScan { - private: +private: enum READ_ACTION { INVALID_ACTION, READ_ITERATOR, READ_TABLE_PARTITION, READ_ITER_END }; - public: +public: class ObTableScanWithIndexBackCtx : public ObTableScanCtx { friend class ObDomainIndex; friend class ObTableScanWithIndexBack; - public: + public: explicit ObTableScanWithIndexBackCtx(ObExecContext& ctx) : ObTableScanCtx(ctx), is_index_end_(false), use_table_allocator_(false), read_action_(INVALID_ACTION) {} - private: + private: bool is_index_end_; bool use_table_allocator_; READ_ACTION read_action_; }; - public: +public: explicit ObTableScanWithIndexBack(common::ObIAllocator& allocator); virtual ~ObTableScanWithIndexBack(); inline void set_index_scan_tree(ObPhyOperator* index_scan_tree) @@ -49,7 +49,7 @@ class ObTableScanWithIndexBack : public ObTableScan { } int rescan(ObExecContext& ctx) const; - protected: +protected: virtual int inner_open(ObExecContext& ctx) const; virtual int inner_close(ObExecContext& ctx) const; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; @@ -64,7 +64,7 @@ class ObTableScanWithIndexBack : public ObTableScan { int do_table_rescan_with_index(ObExecContext& ctx) const; int open_index_scan(ObExecContext& ctx) const; - private: +private: ObPhyOperator* index_scan_tree_; }; } // namespace sql diff --git a/src/sql/engine/table/ob_table_scan_with_index_back_op.h b/src/sql/engine/table/ob_table_scan_with_index_back_op.h index ba0c1f042..9527d8bb1 100644 --- a/src/sql/engine/table/ob_table_scan_with_index_back_op.h +++ b/src/sql/engine/table/ob_table_scan_with_index_back_op.h @@ -19,7 +19,7 @@ namespace sql { class ObTableScanWithIndexBackSpec : public ObTableScanSpec { OB_UNIS_VERSION_V(1); - public: +public: explicit ObTableScanWithIndexBackSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type); virtual ~ObTableScanWithIndexBackSpec(); inline void set_index_scan_tree_id(uint64_t index_scan_tree_id) @@ -31,15 +31,15 @@ class ObTableScanWithIndexBackSpec : public ObTableScanSpec { return index_scan_tree_id_; } - private: +private: uint64_t index_scan_tree_id_; }; class ObTableScanWithIndexBackOp : public ObTableScanOp { - private: +private: enum READ_ACTION { INVALID_ACTION, READ_ITERATOR, READ_TABLE_PARTITION, READ_ITER_END }; - public: +public: explicit ObTableScanWithIndexBackOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObTableScanOp(exec_ctx, spec, input), is_index_end_(false), @@ -52,13 +52,13 @@ class ObTableScanWithIndexBackOp : public ObTableScanOp { virtual int inner_get_next_row() override; virtual int rescan() override; - protected: +protected: int open_index_scan(); int extract_range_from_index(); int do_table_scan_with_index(); int do_table_rescan_with_index(); - private: +private: bool is_index_end_; bool use_table_allocator_; READ_ACTION read_action_; diff --git a/src/sql/engine/table/ob_uk_row_transform.cpp b/src/sql/engine/table/ob_uk_row_transform.cpp index 2f690af3c..7595e5300 100644 --- a/src/sql/engine/table/ob_uk_row_transform.cpp +++ b/src/sql/engine/table/ob_uk_row_transform.cpp @@ -26,7 +26,7 @@ namespace sql { using namespace common; class ObUKRowTransform::ObUKRowTransformCtx : public ObPhyOperatorCtx { - public: +public: explicit ObUKRowTransformCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual void destroy() override diff --git a/src/sql/engine/table/ob_uk_row_transform.h b/src/sql/engine/table/ob_uk_row_transform.h index a56fb01e9..e6af4a044 100644 --- a/src/sql/engine/table/ob_uk_row_transform.h +++ b/src/sql/engine/table/ob_uk_row_transform.h @@ -23,7 +23,7 @@ namespace sql { class ObUKRowTransform : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - public: +public: explicit ObUKRowTransform(common::ObIAllocator& alloc); virtual ~ObUKRowTransform() {} @@ -59,16 +59,16 @@ class ObUKRowTransform : public ObSingleChildPhyOperator { INHERIT_TO_STRING_KV("parent", ObSingleChildPhyOperator, K(uk_col_cnt_), K(shadow_pk_cnt_), K(columns_)); - protected: +protected: virtual int inner_open(ObExecContext& ctx) const override; virtual int inner_close(ObExecContext& ctx) const override; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; - private: +private: class ObUKRowTransformCtx; - private: +private: int64_t uk_col_cnt_; int64_t shadow_pk_cnt_; common::ObFixedArray columns_; diff --git a/src/sql/engine/table/ob_virtual_table_ctx.h b/src/sql/engine/table/ob_virtual_table_ctx.h index a6507af8d..a1cb372cf 100644 --- a/src/sql/engine/table/ob_virtual_table_ctx.h +++ b/src/sql/engine/table/ob_virtual_table_ctx.h @@ -28,7 +28,7 @@ namespace sql { class ObIVirtualTableIteratorFactory; class ObSQLSessionInfo; class ObVirtualTableCtx { - public: +public: ObVirtualTableCtx() : vt_iter_factory_(NULL), schema_guard_(NULL), partition_table_operator_(NULL), session_(NULL) {} ~ObVirtualTableCtx() diff --git a/src/sql/engine/user_defined_function/ob_udf_ctx_mgr.h b/src/sql/engine/user_defined_function/ob_udf_ctx_mgr.h index cd6cc0899..424f595db 100644 --- a/src/sql/engine/user_defined_function/ob_udf_ctx_mgr.h +++ b/src/sql/engine/user_defined_function/ob_udf_ctx_mgr.h @@ -21,10 +21,10 @@ namespace sql { class ObExprDllUdf; class ObUdfCtxMgr { - private: +private: static const int64_t BUKET_NUM = 100; - public: +public: ObUdfCtxMgr() : allocator_(common::ObModIds::OB_SQL_UDF), ctxs_() {} ~ObUdfCtxMgr(); @@ -37,11 +37,11 @@ class ObUdfCtxMgr { } int reset(); - private: +private: common::ObArenaAllocator allocator_; common::hash::ObHashMap ctxs_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUdfCtxMgr); }; diff --git a/src/sql/engine/user_defined_function/ob_udf_util.h b/src/sql/engine/user_defined_function/ob_udf_util.h index 0305ac706..06dc1ca79 100644 --- a/src/sql/engine/user_defined_function/ob_udf_util.h +++ b/src/sql/engine/user_defined_function/ob_udf_util.h @@ -33,7 +33,7 @@ class ObPhysicalPlanCtx; class obUdfConstArgs; class ObUdfFunction; class ObUdfUtil { - public: +public: /* * for example, if the defined func named 'my_udf_add', we wanna load the auxiliary function. * then we use 'my_udf_add_init' 'my_udf_add_deinit' 'my_udf_add_clear' or 'my_udf_add_add' to load @@ -49,7 +49,7 @@ class ObUdfUtil { (UDF_DECIMAL_BUFF_LENGTH * 9); /* the number of digits that my_decimal can possibly contain */ static const int UDF_DECIMAL_MAX_STR_LENGTH = (UDF_DECIMAL_MAX_POSSIBLE_PRECISION + 2); - public: +public: enum load_function_type { UDF_ORIGIN, UDF_INIT, @@ -63,7 +63,7 @@ class ObUdfUtil { return load_function_postfix[type]; } - public: +public: /* * calc udf's result type * */ diff --git a/src/sql/engine/user_defined_function/ob_user_defined_function.h b/src/sql/engine/user_defined_function/ob_user_defined_function.h index f5d080fd3..456c49667 100644 --- a/src/sql/engine/user_defined_function/ob_user_defined_function.h +++ b/src/sql/engine/user_defined_function/ob_user_defined_function.h @@ -72,7 +72,7 @@ class ObSqlExpression; struct ObUdfConstArgs { OB_UNIS_VERSION_V(1); - public: +public: ObUdfConstArgs() : sql_calc_(nullptr), idx_in_udf_arg_(common::OB_INVALID_INDEX){}; virtual ~ObUdfConstArgs() = default; ObUdfConstArgs& operator=(const ObUdfConstArgs& other) @@ -87,10 +87,10 @@ struct ObUdfConstArgs { }; class ObUdfFunction { - private: +private: static const int OB_MYSQL_ERRMSG_SIZE = 512; - public: +public: friend class ObGetUdfFunctor; friend class ObResetUdfFunctor; friend class ObForceDelUdfFunctor; @@ -101,7 +101,7 @@ class ObUdfFunction { UDF_DEINIT, }; class ObUdfCtx { - public: + public: ObUdfCtx() : state_(UDF_UNINITIALIZED), udf_init_(), udf_args_() {} virtual ~ObUdfCtx() = default; @@ -110,7 +110,7 @@ class ObUdfFunction { ObUdfArgs udf_args_; }; - public: +public: ObUdfFunction() : udf_meta_(), dlhandle_(nullptr), @@ -127,7 +127,7 @@ class ObUdfFunction { virtual int process_init_func(ObUdfFunction::ObUdfCtx& udf_ctx) const; virtual void process_deinit_func(ObUdfFunction::ObUdfCtx& udf_ctx) const; - protected: +protected: share::schema::ObUDFMeta udf_meta_; ObUdfSoHandler dlhandle_; ObUdfFuncAny func_origin_; @@ -139,8 +139,8 @@ class ObUdfFunction { }; class ObNormalUdfFunction : public ObUdfFunction { - private: - public: +private: +public: ObNormalUdfFunction() = default; virtual ~ObNormalUdfFunction() = default; int process_origin_func(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, @@ -148,8 +148,8 @@ class ObNormalUdfFunction : public ObUdfFunction { }; class ObAggUdfFunction : public ObUdfFunction { - private: - public: +private: +public: ObAggUdfFunction() = default; virtual ~ObAggUdfFunction() = default; @@ -164,7 +164,7 @@ class ObAggUdfFunction : public ObUdfFunction { class ObAggUdfMeta { OB_UNIS_VERSION_V(1); - public: +public: ObAggUdfMeta() : udf_meta_(), udf_attributes_(), udf_attributes_types_(), calculable_results_() {} explicit ObAggUdfMeta(const share::schema::ObUDFMeta& meta) @@ -180,7 +180,7 @@ class ObAggUdfMeta { }; class ObAggUdfExeUnit { - public: +public: ObAggUdfExeUnit(ObAggUdfFunction* agg_func, ObUdfFunction::ObUdfCtx* udf_ctx) : agg_func_(agg_func), udf_ctx_(udf_ctx) {} ObAggUdfExeUnit() : agg_func_(nullptr), udf_ctx_(nullptr) @@ -191,7 +191,7 @@ class ObAggUdfExeUnit { }; class ObNormalUdfExeUnit { - public: +public: ObNormalUdfExeUnit(ObNormalUdfFunction* normal_func, ObUdfFunction::ObUdfCtx* udf_ctx) : normal_func_(normal_func), udf_ctx_(udf_ctx) {} diff --git a/src/sql/engine/window_function/ob_window_function.h b/src/sql/engine/window_function/ob_window_function.h index 6893c82fb..85b2f0847 100644 --- a/src/sql/engine/window_function/ob_window_function.h +++ b/src/sql/engine/window_function/ob_window_function.h @@ -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 { - 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 int alloc(BaseFunc*& return_func); common::ObIAllocator* local_allocator_; @@ -373,7 +373,7 @@ class ObWindowFunction : public ObSingleChildPhyOperator { friend class ObWindowFunction; typedef common::ObDList 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 func_infos_; bool is_parallel_; }; diff --git a/src/sql/engine/window_function/ob_window_function_op.h b/src/sql/engine/window_function/ob_window_function_op.h index e0211df60..916922f0c 100644 --- a/src/sql/engine/window_function/ob_window_function_op.h +++ b/src/sql/engine/window_function/ob_window_function_op.h @@ -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 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 { - 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& 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 WinFuncCellList; class FuncAllocer { - public: + public: template 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_; diff --git a/src/sql/executor/ob_addrs_provider.h b/src/sql/executor/ob_addrs_provider.h index b97a17ec0..6aac703c4 100644 --- a/src/sql/executor/ob_addrs_provider.h +++ b/src/sql/executor/ob_addrs_provider.h @@ -19,19 +19,19 @@ namespace oceanbase { namespace sql { class ObAddrsProvider { - public: +public: enum { INVALID_PROVIDER = 0, RANDOM_PROVIDER = 1, }; - public: +public: ObAddrsProvider() {} virtual ~ObAddrsProvider() {} - public: +public: virtual int select_servers(int64_t select_count, common::ObIArray& servers) = 0; virtual int64_t to_string(char* buf, const int64_t buf_len) const = 0; }; diff --git a/src/sql/executor/ob_addrs_provider_factory.h b/src/sql/executor/ob_addrs_provider_factory.h index 966c54d70..a9b46d796 100644 --- a/src/sql/executor/ob_addrs_provider_factory.h +++ b/src/sql/executor/ob_addrs_provider_factory.h @@ -21,16 +21,16 @@ namespace sql { class ObAddrsProvider; class ObExecContext; class ObAddrsProviderFactory { - public: +public: ObAddrsProviderFactory(); virtual ~ObAddrsProviderFactory(); void reset(); int create(ObExecContext& exec_ctx, int provider_type, ObAddrsProvider*& servers_provider); - private: +private: common::ObSEArray store_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAddrsProviderFactory); }; } // namespace sql diff --git a/src/sql/executor/ob_bkgd_dist_task.cpp b/src/sql/executor/ob_bkgd_dist_task.cpp index 51733d752..4b5b3efac 100644 --- a/src/sql/executor/ob_bkgd_dist_task.cpp +++ b/src/sql/executor/ob_bkgd_dist_task.cpp @@ -106,7 +106,7 @@ ObBKGDDistTask::~ObBKGDDistTask() } class ObBKGDDistTask::ObDistTaskProcessor : public ObDistExecuteBaseP { - public: +public: ObDistTaskProcessor(ObBKGDDistTask& task) : ObDistExecuteBaseP(GCTX, false /* do not send result */), task_(task) {} @@ -134,7 +134,7 @@ class ObBKGDDistTask::ObDistTaskProcessor : public ObDistExecuteBaseP { return ret; } - private: +private: ObBKGDDistTask& task_; }; @@ -208,7 +208,7 @@ int ObBKGDDistTask::get_index_tid(const ObTask& task, uint64_t& tid) const } class ObExtraIndexBuildCheck : public ObIExtraStatusCheck { - public: +public: ObExtraIndexBuildCheck(const uint64_t index_tid) : index_tid_(index_tid), last_check_time_(0) {} @@ -265,7 +265,7 @@ class ObExtraIndexBuildCheck : public ObIExtraStatusCheck { return ret; } - private: +private: uint64_t index_tid_; mutable int64_t last_check_time_; }; diff --git a/src/sql/executor/ob_bkgd_dist_task.h b/src/sql/executor/ob_bkgd_dist_task.h index fd0a9b521..79b180c2f 100644 --- a/src/sql/executor/ob_bkgd_dist_task.h +++ b/src/sql/executor/ob_bkgd_dist_task.h @@ -21,7 +21,7 @@ namespace sql { // dag information for background executing distributed task class ObBKGDDistTaskDag : public share::ObIDag { - public: +public: ObBKGDDistTaskDag(); int init(const uint64_t tenant_id, const ObTaskID& task_id, const uint64_t scheduler_id); @@ -46,7 +46,7 @@ class ObBKGDDistTaskDag : public share::ObIDag { } virtual int64_t get_compat_mode() const override; - private: +private: uint64_t tenant_id_; ObTaskID task_id_; uint64_t scheduler_id_; @@ -56,7 +56,7 @@ class ObBKGDDistTaskDag : public share::ObIDag { // background executing distributed task class ObBKGDDistTask : public share::ObITask { - public: +public: ObBKGDDistTask(); virtual ~ObBKGDDistTask(); @@ -65,7 +65,7 @@ class ObBKGDDistTask : public share::ObITask { virtual int process() override; int get_index_tid(const ObTask& task, uint64_t& tid) const; - private: +private: class ObDistTaskProcessor; common::ObAddr return_addr_; @@ -81,7 +81,7 @@ class ObBKGDDistTask : public share::ObITask { // background executing distributed task global schedule info (scheduled by RS). // Memory are self managed, so we disable default copy constructor and assign function. class ObSchedBKGDDistTask { - public: +public: ObSchedBKGDDistTask() : tenant_id_(common::OB_INVALID_ID), abs_timeout_us_(0), scheduler_id_(0) {} @@ -143,7 +143,7 @@ class ObSchedBKGDDistTask { return serialized_task_; } - private: +private: uint64_t tenant_id_; int64_t abs_timeout_us_; ObTaskID task_id_; diff --git a/src/sql/executor/ob_cmd_executor.h b/src/sql/executor/ob_cmd_executor.h index 47afd27ae..aefa25bfc 100644 --- a/src/sql/executor/ob_cmd_executor.h +++ b/src/sql/executor/ob_cmd_executor.h @@ -20,10 +20,10 @@ namespace sql { class ObICmd; class ObExecContext; class ObCmdExecutor { - public: +public: static int execute(ObExecContext& ctx, ObICmd& cmd); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObCmdExecutor); diff --git a/src/sql/executor/ob_determinate_task_spliter.h b/src/sql/executor/ob_determinate_task_spliter.h index 3e19b0975..317195297 100644 --- a/src/sql/executor/ob_determinate_task_spliter.h +++ b/src/sql/executor/ob_determinate_task_spliter.h @@ -20,7 +20,7 @@ namespace sql { class ObDeterminateTaskTransmit; class ObDeterminateTaskSpliter : public ObTaskSpliter { - public: +public: ObDeterminateTaskSpliter(); virtual ~ObDeterminateTaskSpliter(); virtual int get_next_task(ObTaskInfo*& task) override; @@ -29,10 +29,10 @@ class ObDeterminateTaskSpliter : public ObTaskSpliter { return ObTaskSpliter::DETERMINATE_TASK_SPLIT; } - private: +private: struct SliceIDCompare; - private: +private: int fetch_child_result(const ObTaskID& task_id, ObTaskInfo& task); int set_task_destination(const ObDeterminateTaskTransmit& transmit, const ObTaskID& task_id, ObTaskInfo& task); @@ -40,7 +40,7 @@ class ObDeterminateTaskSpliter : public ObTaskSpliter { int task_executed_servers( const int64_t sys_job_id, const ObTaskID& task_id, common::ObIArray& servers); - private: +private: int64_t task_idx_; common::ObAddr pre_addr_; diff --git a/src/sql/executor/ob_determinate_task_transmit.cpp b/src/sql/executor/ob_determinate_task_transmit.cpp index fc8ccc43e..834960b19 100644 --- a/src/sql/executor/ob_determinate_task_transmit.cpp +++ b/src/sql/executor/ob_determinate_task_transmit.cpp @@ -51,7 +51,7 @@ struct ObDeterminateTaskTransmit::RangeStartCompare { return cmp < 0; } - private: +private: ObNewRow start_row_; int& ret_; }; diff --git a/src/sql/executor/ob_determinate_task_transmit.h b/src/sql/executor/ob_determinate_task_transmit.h index 691781369..abe87db7b 100644 --- a/src/sql/executor/ob_determinate_task_transmit.h +++ b/src/sql/executor/ob_determinate_task_transmit.h @@ -25,9 +25,9 @@ class ObTableLocation; class ObDeterminateTaskTransmit : public ObDistributedTransmit { OB_UNIS_VERSION_V(1); - public: +public: class ITaskRouting { - public: + public: enum Policy { DATA_REPLICA_PICKER, INDEX_REPLICA_PICKER, @@ -46,7 +46,7 @@ class ObDeterminateTaskTransmit : public ObDistributedTransmit { struct TaskIndex { OB_UNIS_VERSION_V(1); - public: + public: int32_t loc_idx_; int32_t part_loc_idx_; @@ -58,7 +58,7 @@ class ObDeterminateTaskTransmit : public ObDistributedTransmit { struct IdRange { OB_UNIS_VERSION_V(1); - public: + public: int32_t begin_; int32_t end_; @@ -70,7 +70,7 @@ class ObDeterminateTaskTransmit : public ObDistributedTransmit { struct ResultRange { OB_UNIS_VERSION_V(1); - public: + public: IdRange task_range_; IdRange slice_range_; @@ -80,9 +80,9 @@ class ObDeterminateTaskTransmit : public ObDistributedTransmit { // compare ObNewRange::start_ and ObNewRow struct RangeStartCompare; - private: +private: class ObDeterminateTaskTransmitCtx : public ObDistributedTransmitCtx { - public: + public: explicit ObDeterminateTaskTransmitCtx(ObExecContext& ctx) : ObDistributedTransmitCtx(ctx), close_child_manually_(false) {} @@ -94,23 +94,25 @@ class ObDeterminateTaskTransmit : public ObDistributedTransmit { ObDistributedTransmitCtx::destroy(); } - public: + public: bool close_child_manually_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObDeterminateTaskTransmitCtx); }; typedef common::hash::ObHashMap Id2IdxMap; typedef common::hash::ObHashSet TaskIDSet; -public: - explicit ObDeterminateTaskTransmit(common::ObIAllocator &alloc); - virtual ~ObDeterminateTaskTransmit() {} - virtual int init_op_ctx(ObExecContext &exec_ctx) const override; - virtual int inner_open(ObExecContext &exec_ctx) const override; - virtual int inner_close(ObExecContext &ctx) const override; - virtual OperatorOpenOrder get_operator_open_order(ObExecContext &ctx) const override; +public: + explicit ObDeterminateTaskTransmit(common::ObIAllocator& alloc); + virtual ~ObDeterminateTaskTransmit() + {} + + virtual int init_op_ctx(ObExecContext& exec_ctx) const override; + virtual int inner_open(ObExecContext& exec_ctx) const override; + virtual int inner_close(ObExecContext& ctx) const override; + virtual OperatorOpenOrder get_operator_open_order(ObExecContext& ctx) const override; typedef common::ObFixedArray RangeLocations; typedef common::ObFixedArray Tasks; typedef common::ObFixedArray, common::ObIAllocator> @@ -179,7 +181,7 @@ public: return background_; } - private: +private: int alloc_result_array( ObExecContext& exec_ctx, ObIntermResultManager& mgr, const int64_t cnt, ObIntermResult**& results) const; int free_result_array(ObIntermResultManager& mgr, const int64_t cnt, ObIntermResult**& results) const; @@ -188,12 +190,12 @@ public: int shuffle_row(ObExecContext& exec_ctx, ObSqlSchemaGuard& schema_guard, ObTableLocation& table_location, Id2IdxMap& partition_id2idx_map, const common::ObNewRow& row, int64_t& slice_idx) const; - private: +private: static common::ObLatch task_set_init_lock_; static TaskIDSet executing_task_set_instance_; static TaskIDSet* executing_tasks(); - private: +private: bool result_reusable_; RangeLocations range_locations_; Tasks tasks_; diff --git a/src/sql/executor/ob_direct_receive.h b/src/sql/executor/ob_direct_receive.h index 3c9a8167e..bc0994c29 100644 --- a/src/sql/executor/ob_direct_receive.h +++ b/src/sql/executor/ob_direct_receive.h @@ -28,25 +28,25 @@ class ObTaskInfo; class ObDirectReceiveInput : public ObReceiveInput { OB_UNIS_VERSION_V(1); - public: +public: ObDirectReceiveInput(); virtual ~ObDirectReceiveInput(); virtual void reset() override; virtual int init(ObExecContext& ctx, ObTaskInfo& task_info, const ObPhyOperator& op) override; virtual ObPhyOperatorType get_phy_op_type() const; - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObDirectReceiveInput); }; class ObDirectReceive : public ObReceive { - private: +private: class ObDirectReceiveCtx : public ObPhyOperatorCtx { friend class ObDirectReceive; - public: + public: explicit ObDirectReceiveCtx(ObExecContext& ctx); virtual ~ObDirectReceiveCtx(); virtual void destroy() @@ -61,19 +61,19 @@ class ObDirectReceive : public ObReceive { bool first_request_received_; int64_t found_rows_; - private: + private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObDirectReceiveCtx); }; - public: +public: explicit ObDirectReceive(common::ObIAllocator& alloc); virtual ~ObDirectReceive(); virtual int rescan(ObExecContext& ctx) const; - private: +private: /* functions */ int setup_next_scanner(ObExecContext& ctx) const; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; @@ -87,7 +87,7 @@ class ObDirectReceive : public ObReceive { */ virtual int init_op_ctx(ObExecContext& ctx) const; - private: +private: /* macros */ DISALLOW_COPY_AND_ASSIGN(ObDirectReceive); }; diff --git a/src/sql/executor/ob_direct_receive_op.h b/src/sql/executor/ob_direct_receive_op.h index 7651c7f0e..606b3543d 100644 --- a/src/sql/executor/ob_direct_receive_op.h +++ b/src/sql/executor/ob_direct_receive_op.h @@ -22,7 +22,7 @@ class ObExecContext; class ObDirectReceiveSpec : public ObReceiveSpec { OB_UNIS_VERSION_V(1); - public: +public: ObDirectReceiveSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObReceiveSpec(alloc, type) {} @@ -30,7 +30,7 @@ class ObDirectReceiveSpec : public ObReceiveSpec { }; class ObDirectReceiveOp : public ObReceiveOp { - public: +public: ObDirectReceiveOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input); virtual ~ObDirectReceiveOp() @@ -45,12 +45,12 @@ class ObDirectReceiveOp : public ObReceiveOp { ObReceiveOp::destroy(); } - private: +private: int setup_next_scanner(); int get_next_row_from_cur_scanner(); int update_user_var(); - private: +private: common::ObScanner* scanner_; ObChunkDatumStore::Iterator scanner_iter_; bool all_data_empty_; @@ -58,7 +58,7 @@ class ObDirectReceiveOp : public ObReceiveOp { bool first_request_received_; int64_t found_rows_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDirectReceiveOp); }; diff --git a/src/sql/executor/ob_direct_transmit.h b/src/sql/executor/ob_direct_transmit.h index 6644548f7..2e5dfa780 100644 --- a/src/sql/executor/ob_direct_transmit.h +++ b/src/sql/executor/ob_direct_transmit.h @@ -23,7 +23,7 @@ namespace sql { class ObDirectTransmitInput : public ObTransmitInput { OB_UNIS_VERSION_V(1); - public: +public: ObDirectTransmitInput(); virtual ~ObDirectTransmitInput(); virtual int init(ObExecContext& ctx, ObTaskInfo& task_info, const ObPhyOperator& op); @@ -32,16 +32,16 @@ class ObDirectTransmitInput : public ObTransmitInput { return PHY_DIRECT_TRANSMIT; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDirectTransmitInput); }; class ObDirectTransmit : public ObTransmit { - private: +private: class ObDirectTransmitCtx : public ObTransmitCtx { friend class ObDirectTransmit; - public: + public: explicit ObDirectTransmitCtx(ObExecContext& ctx) : ObTransmitCtx(ctx) {} virtual ~ObDirectTransmitCtx() @@ -51,20 +51,20 @@ class ObDirectTransmit : public ObTransmit { ObTransmitCtx::destroy(); } - private: + private: DISALLOW_COPY_AND_ASSIGN(ObDirectTransmitCtx); }; - public: +public: explicit ObDirectTransmit(common::ObIAllocator& alloc); virtual ~ObDirectTransmit(); virtual int create_operator_input(ObExecContext& ctx) const; - protected: +protected: int get_next_row(ObExecContext& ctx, const ObNewRow*& row) const override; - private: +private: virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; /** * @brief init operator context, will create a physical operator context (and a current row space) @@ -73,7 +73,7 @@ class ObDirectTransmit : public ObTransmit { */ virtual int init_op_ctx(ObExecContext& ctx) const; - private: +private: // disallow copy assign DISALLOW_COPY_AND_ASSIGN(ObDirectTransmit); }; diff --git a/src/sql/executor/ob_direct_transmit_op.h b/src/sql/executor/ob_direct_transmit_op.h index 48c815586..955932f6d 100644 --- a/src/sql/executor/ob_direct_transmit_op.h +++ b/src/sql/executor/ob_direct_transmit_op.h @@ -21,7 +21,7 @@ namespace sql { class ObDirectTransmitOpInput : public ObTransmitOpInput { OB_UNIS_VERSION_V(1); - public: +public: ObDirectTransmitOpInput(ObExecContext& ctx, const ObOpSpec& spec) : ObTransmitOpInput(ctx, spec) {} virtual ~ObDirectTransmitOpInput(){}; @@ -31,14 +31,14 @@ class ObDirectTransmitOpInput : public ObTransmitOpInput { return common::OB_NOT_SUPPORTED; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDirectTransmitOpInput); }; class ObDirectTransmitSpec : public ObTransmitSpec { OB_UNIS_VERSION_V(1); - public: +public: ObDirectTransmitSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type) : ObTransmitSpec(alloc, type) {} @@ -46,7 +46,7 @@ class ObDirectTransmitSpec : public ObTransmitSpec { }; class ObDirectTransmitOp : public ObTransmitOp { - public: +public: ObDirectTransmitOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input) : ObTransmitOp(exec_ctx, spec, input) {} @@ -63,7 +63,7 @@ class ObDirectTransmitOp : public ObTransmitOp { return common::OB_NOT_SUPPORTED; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDirectTransmitOp); }; diff --git a/src/sql/executor/ob_distributed_job_control.h b/src/sql/executor/ob_distributed_job_control.h index d5d2b582f..64bcfb308 100644 --- a/src/sql/executor/ob_distributed_job_control.h +++ b/src/sql/executor/ob_distributed_job_control.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObDistributedJobControl : public ObJobControl { - public: +public: ObDistributedJobControl(); virtual ~ObDistributedJobControl(); @@ -27,7 +27,7 @@ class ObDistributedJobControl : public ObJobControl { virtual int init_job_finish_queue(ObExecContext& ctx) override; int get_root_job(ObJob*& root_job) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistributedJobControl); }; } // namespace sql diff --git a/src/sql/executor/ob_distributed_job_executor.h b/src/sql/executor/ob_distributed_job_executor.h index a5e54d531..0408a8f02 100644 --- a/src/sql/executor/ob_distributed_job_executor.h +++ b/src/sql/executor/ob_distributed_job_executor.h @@ -25,7 +25,7 @@ namespace sql { class ObJob; class ObExecContext; class ObDistributedJobExecutor { - public: +public: ObDistributedJobExecutor(); virtual ~ObDistributedJobExecutor(); @@ -51,13 +51,13 @@ class ObDistributedJobExecutor { executor_ = NULL; } - private: +private: int get_executable_tasks(const ObExecContext& ctx, common::ObArray& ready_tasks); ObJob* job_; ObDistributedTaskExecutor* executor_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistributedJobExecutor); }; } // namespace sql diff --git a/src/sql/executor/ob_distributed_scheduler.h b/src/sql/executor/ob_distributed_scheduler.h index f963c2ce7..01158e3b6 100644 --- a/src/sql/executor/ob_distributed_scheduler.h +++ b/src/sql/executor/ob_distributed_scheduler.h @@ -39,7 +39,7 @@ class ObDistributedSchedulerManager; class ObDistributedSchedulerCtx; class ObDistributedExecContext; class ObDistributedScheduler : public ObSqlScheduler { - public: +public: friend class ObSignalFinishQueue; friend class ObDistributedSchedulerManager; @@ -100,7 +100,7 @@ class ObDistributedScheduler : public ObSqlScheduler { int atomic_push_err_rpc_addr(const common::ObAddr& addr); - private: +private: static const int64_t OB_MAX_SKIPPED_TASK_EVENTS_QUEUE_CAPACITY = 1024L * 16L; typedef int (ObDistributedScheduler::*ObCheckStatus)(); @@ -125,7 +125,7 @@ class ObDistributedScheduler : public ObSqlScheduler { uint64_t next_scheduler_id(); - private: +private: static const int64_t MAX_FINISH_QUEUE_CAPACITY = 4096; static const int64_t NOP_EVENT = INT64_MIN + 1; static const int64_t SCHE_ITER_END = INT64_MIN + 2; @@ -166,7 +166,7 @@ class ObSchedulerThreadPool : public lib::TGTaskHandler { }; class ObDistributedSchedulerManager { - public: +public: // private static variable static const int64_t DEFAULT_ID_MAP_SIZE = (1 << 20); static const int64_t MINI_MODE_ID_MAP_SIZE = (128 << 10); @@ -174,14 +174,14 @@ class ObDistributedSchedulerManager { static const int64_t MINI_MODE_SCHEDULER_THREAD_NUM = 4; static const int64_t SCHEDULER_THREAD_QUEUE = 256; - private: +private: // private static variable static ObDistributedSchedulerManager* instance_; typedef ObSqlExecutionIDMap ExecutionIDMap; - public: +public: class ObDistributedSchedulerHolder { - public: + public: ObDistributedSchedulerHolder(); virtual ~ObDistributedSchedulerHolder(); @@ -189,18 +189,18 @@ class ObDistributedSchedulerManager { int init(ObDistributedScheduler* scheduler, uint64_t execution_id, ExecutionIDMap& execution_id_map); int get_scheduler(ObDistributedScheduler*& scheduler); - private: + private: bool inited_; uint64_t execution_id_; ObDistributedScheduler* scheduler_; ExecutionIDMap* execution_id_map_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObDistributedSchedulerHolder); }; class ObDistributedSchedulerKiller { - public: + public: ObDistributedSchedulerKiller() {} virtual ~ObDistributedSchedulerKiller() @@ -210,11 +210,11 @@ class ObDistributedSchedulerManager { {} void operator()(const uint64_t execution_id); - private: + private: DISALLOW_COPY_AND_ASSIGN(ObDistributedSchedulerKiller); }; - public: +public: friend class ObDistributedSchedulerKiller; static int build_instance(); @@ -238,11 +238,11 @@ class ObDistributedSchedulerManager { int set_task_status(const ObTaskID& task_id, ObTaskStatus status); int stop(); - private: +private: // private function int init(); - private: +private: // private common variable bool inited_; ExecutionIDMap execution_id_map_; @@ -270,14 +270,14 @@ inline int ObDistributedScheduler::init_trans_result(ObSQLSessionInfo& session, } class ObDistributedSchedulerCtx { - public: +public: const uint64_t* trace_id_; uint64_t execution_id_; ObExecContext* exec_ctx_; char* exec_ctx_buf_; int64_t buf_len_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistributedSchedulerCtx); }; diff --git a/src/sql/executor/ob_distributed_task_executor.h b/src/sql/executor/ob_distributed_task_executor.h index 78638da90..fb4c92f33 100644 --- a/src/sql/executor/ob_distributed_task_executor.h +++ b/src/sql/executor/ob_distributed_task_executor.h @@ -24,7 +24,7 @@ class ObExecutorRpcImpl; class ObExecutorRpcCtx; class ObTransResultCollector; class ObDistributedTaskExecutor : public ObTaskExecutor { - public: +public: explicit ObDistributedTaskExecutor(const uint64_t scheduler_id); virtual ~ObDistributedTaskExecutor(); @@ -40,13 +40,13 @@ class ObDistributedTaskExecutor : public ObTaskExecutor { trans_result_ = trans_result; } - private: +private: int send_close_result_rpc(ObExecContext& ctx, const ObTaskInfo* task_info); int build_task(ObExecContext& query_ctx, ObJob& job, ObTaskInfo& task_info, ObTask& task); int task_dispatch( ObExecContext& exec_ctx, ObExecutorRpcImpl& rpc, ObExecutorRpcCtx& rpc_ctx, ObTask& task, ObTaskInfo& task_info); - private: +private: uint64_t scheduler_id_; ObTransResultCollector* trans_result_; DISALLOW_COPY_AND_ASSIGN(ObDistributedTaskExecutor); diff --git a/src/sql/executor/ob_distributed_task_runner.h b/src/sql/executor/ob_distributed_task_runner.h index d53f5c0b6..030b05db5 100644 --- a/src/sql/executor/ob_distributed_task_runner.h +++ b/src/sql/executor/ob_distributed_task_runner.h @@ -20,12 +20,12 @@ namespace sql { class ObExecContext; class ObPhysicalPlan; class ObDistributedTaskRunner { - public: +public: ObDistributedTaskRunner(); virtual ~ObDistributedTaskRunner(); int execute(ObExecContext& ctx, ObPhysicalPlan& phy_plan, common::ObIArray& slice_events); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistributedTaskRunner); }; } // namespace sql diff --git a/src/sql/executor/ob_distributed_transmit.h b/src/sql/executor/ob_distributed_transmit.h index f487720f8..f61898319 100644 --- a/src/sql/executor/ob_distributed_transmit.h +++ b/src/sql/executor/ob_distributed_transmit.h @@ -24,7 +24,7 @@ class ObExecContext; class ObDistributedTransmitInput : public ObTransmitInput { OB_UNIS_VERSION_V(1); - public: +public: ObDistributedTransmitInput() : ObTransmitInput(), expire_time_(0), ob_task_id_(), force_save_interm_result_(false), slice_events_(NULL) {} @@ -70,22 +70,22 @@ class ObDistributedTransmitInput : public ObTransmitInput { return expire_time_; } - private: +private: int64_t expire_time_; ObTaskID ob_task_id_; bool force_save_interm_result_; common::ObIArray* slice_events_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistributedTransmitInput); }; class ObDistributedTransmit : public ObTransmit { OB_UNIS_VERSION_V(1); - private: +private: class ObSliceInfo { - public: + public: ObSliceInfo() : part_offset_(OB_INVALID_INDEX_INT64), subpart_offset_(OB_INVALID_INDEX_INT64), @@ -102,11 +102,11 @@ class ObDistributedTransmit : public ObTransmit { int64_t slice_idx_; }; - protected: +protected: class ObDistributedTransmitCtx : public ObTransmitCtx { friend class ObDistributedTransmit; - public: + public: explicit ObDistributedTransmitCtx(ObExecContext& ctx) : ObTransmitCtx(ctx) {} virtual ~ObDistributedTransmitCtx() @@ -116,11 +116,11 @@ class ObDistributedTransmit : public ObTransmit { ObTransmitCtx::destroy(); } - private: + private: DISALLOW_COPY_AND_ASSIGN(ObDistributedTransmitCtx); }; - public: +public: explicit ObDistributedTransmit(common::ObIAllocator& alloc); virtual ~ObDistributedTransmit(); @@ -135,33 +135,26 @@ class ObDistributedTransmit : public ObTransmit { private: int init_slice_infos( - const share::schema::ObTableSchema &table_schema, - common::ObIArray &slices_info) const; - int get_slice_idx( - ObExecContext &exec_ctx, - const share::schema::ObTableSchema *table_schema, - const common::ObNewRow *row, - const ObSqlExpression &part_partition_func, - const ObSqlExpression &subpart_partition_func, - const ObIArray &repart_columns, - const ObIArray &repart_sub_columns, - int64_t slices_count, - int64_t &slice_idx, - bool &no_match_partiton) const; + const share::schema::ObTableSchema& table_schema, common::ObIArray& slices_info) const; + int get_slice_idx(ObExecContext& exec_ctx, const share::schema::ObTableSchema* table_schema, + const common::ObNewRow* row, const ObSqlExpression& part_partition_func, + const ObSqlExpression& subpart_partition_func, const ObIArray& repart_columns, + const ObIArray& repart_sub_columns, int64_t slices_count, int64_t& slice_idx, + bool& no_match_partiton) const; protected: - virtual int inner_open(ObExecContext &exec_ctx) const override; + virtual int inner_open(ObExecContext& exec_ctx) const override; /** * @brief init operator context, will create a physical operator context (and a current row space) * @param ctx[in], execute context * @return if success, return OB_SUCCESS, otherwise, return errno */ - virtual int init_op_ctx(ObExecContext &ctx) const override; + virtual int init_op_ctx(ObExecContext& ctx) const override; bool skip_empty_slice() const; - int prepare_interm_result(ObIntermResultManager &interm_result_mgr, - ObIntermResult *&interm_result) const; - int get_next_row(ObExecContext &ctx, const ObNewRow *&row) const override; - int inner_get_next_row(ObExecContext &ctx, const ObNewRow *&row) const override; + int prepare_interm_result(ObIntermResultManager& interm_result_mgr, ObIntermResult*& interm_result) const; + int get_next_row(ObExecContext& ctx, const ObNewRow*& row) const override; + int inner_get_next_row(ObExecContext& ctx, const ObNewRow*& row) const override; + private: const static int64_t NO_MATCH_PARTITION = -2; ObSqlExpression* shuffle_func_; diff --git a/src/sql/executor/ob_execute_result.h b/src/sql/executor/ob_execute_result.h index d63dfe770..d45c6c1ed 100644 --- a/src/sql/executor/ob_execute_result.h +++ b/src/sql/executor/ob_execute_result.h @@ -24,7 +24,7 @@ class ObOperator; class ObOpSpec; class ObIExecuteResult { - public: +public: virtual ~ObIExecuteResult() {} @@ -37,7 +37,7 @@ class ObExecuteResult : public ObIExecuteResult { friend class ObLocalTaskExecutor; friend class ObExecutor; - public: +public: ObExecuteResult(); virtual ~ObExecuteResult() {} @@ -73,7 +73,7 @@ class ObExecuteResult : public ObIExecuteResult { root_op_ = root_op; } - private: +private: int err_code_; ObPhyOperator* root_op_; ObOperator* static_engine_root_; @@ -81,12 +81,12 @@ class ObExecuteResult : public ObIExecuteResult { // row used to adapt old get_next_row interface. mutable common::ObNewRow row_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExecuteResult); }; class ObAsyncExecuteResult : public ObIExecuteResult { - public: +public: ObAsyncExecuteResult(); virtual ~ObAsyncExecuteResult() {} @@ -113,7 +113,7 @@ class ObAsyncExecuteResult : public ObIExecuteResult { spec_ = spec; } - private: +private: int64_t field_count_; common::ObScanner* scanner_; common::ObNewRow* cur_row_; diff --git a/src/sql/executor/ob_execution_id.h b/src/sql/executor/ob_execution_id.h index fbb2b8c99..ab2a22f99 100644 --- a/src/sql/executor/ob_execution_id.h +++ b/src/sql/executor/ob_execution_id.h @@ -24,8 +24,8 @@ static const uint64_t ET_MINI_TASK = 1; class ObExecutionID final { OB_UNIS_VERSION(1); - public: - public: +public: +public: ObExecutionID(const common::ObAddr& server, uint64_t execution_id) : server_(server), execution_id_(execution_id), task_type_(ET_DIST_TASK) {} @@ -106,7 +106,7 @@ class ObExecutionID final { // fake control server address for global execution_id static const common::ObAddr& global_id_addr(); - private: +private: common::ObAddr server_; uint64_t execution_id_; union { diff --git a/src/sql/executor/ob_executor.h b/src/sql/executor/ob_executor.h index 37515a7b4..6d866b2be 100644 --- a/src/sql/executor/ob_executor.h +++ b/src/sql/executor/ob_executor.h @@ -22,7 +22,7 @@ class ObExecContext; class ObPhyOperator; class ObExecutor { - public: +public: ObExecutor(); ~ObExecutor(){}; int init(ObPhysicalPlan* plan); @@ -30,19 +30,19 @@ class ObExecutor { int execute_plan(ObExecContext& ctx); int close(ObExecContext& ctx); - private: +private: // disallow copy ObExecutor(const ObExecutor& other); ObExecutor& operator=(const ObExecutor& ohter); - private: +private: int execute_local_single_partition_plan(ObExecContext& ctx); int execute_remote_single_partition_plan(ObExecContext& ctx); int execute_distributed_plan(ObExecContext& ctx); int execute_old_px_plan(ObExecContext& ctx); int execute_static_cg_px_plan(ObExecContext& ctx); - private: +private: bool inited_; ObPhysicalPlan* phy_plan_; uint64_t execution_id_; diff --git a/src/sql/executor/ob_executor_rpc_impl.h b/src/sql/executor/ob_executor_rpc_impl.h index 3c14afa73..e6469fb19 100644 --- a/src/sql/executor/ob_executor_rpc_impl.h +++ b/src/sql/executor/ob_executor_rpc_impl.h @@ -37,7 +37,7 @@ class ObAPMiniTaskMgr; * the same as ObResultSet, essentially a variable on the stack. reference:obmp_query.cpp */ template class MyStreamHandle { - public: +public: typedef typename obrpc::ObExecutorRpcProxy::SSHandle MyHandle; typedef common::ObScanner MyResult; explicit MyStreamHandle(const char* label) : result_(label), rc_(common::OB_SUCCESS) @@ -96,7 +96,7 @@ class MyStreamHandle { return task_id_; } - private: +private: ObTaskID task_id_; MyHandle handle_; MyResult result_; @@ -105,7 +105,7 @@ class MyStreamHandle { template class MySSHandle { - public: +public: typedef typename obrpc::ObExecutorRpcProxy::SSHandle MyHandle; typedef ObIntermResultItem MyResult; explicit MySSHandle(const char* label) : result_(label), rc_(common::OB_SUCCESS) @@ -152,7 +152,7 @@ class MySSHandle { return rc_; } - private: +private: MyHandle handle_; MyResult result_; int rc_; @@ -164,7 +164,7 @@ typedef MyStreamHandle FetchResultStreamHandle; typedef MySSHandle FetchIntermResultStreamHandle; class RemoteExecuteStreamHandle { - public: +public: RemoteExecuteStreamHandle(const char* label) : use_remote_protocol_v2_(false), sync_stream_handle_(label), sync_stream_handle_v2_(label) {} @@ -289,17 +289,17 @@ class RemoteExecuteStreamHandle { return sync_stream_handle_v2_; } - private: +private: bool use_remote_protocol_v2_; RemoteStreamHandle sync_stream_handle_; RemoteStreamHandleV2 sync_stream_handle_v2_; }; class ObExecutorRpcCtx { - public: +public: static const uint64_t INVALID_CLUSTER_VERSION = 0; - public: +public: ObExecutorRpcCtx(uint64_t rpc_tenant_id, int64_t timeout_timestamp, uint64_t min_cluster_version, ObQueryRetryInfo* retry_info, ObSQLSessionInfo* session, bool is_plain_select, ObAPMiniTaskMgr* ap_mini_task_mgr = NULL) @@ -350,7 +350,7 @@ class ObExecutorRpcCtx { int check_status() const; TO_STRING_KV(K_(rpc_tenant_id), K_(timeout_timestamp), K_(min_cluster_version), K_(retry_info), K_(is_plain_select)); - private: +private: uint64_t rpc_tenant_id_; int64_t timeout_timestamp_; uint64_t min_cluster_version_; @@ -360,13 +360,13 @@ class ObExecutorRpcCtx { bool is_plain_select_; // stmt_type == T_SELECT && not select...for update ObAPMiniTaskMgr* ap_mini_task_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExecutorRpcCtx); }; class ObDistributedSchedulerManager; class ObExecutorPingRpcCtx { - public: +public: ObExecutorPingRpcCtx(uint64_t rpc_tenant_id, int64_t wait_timeout, ObDistributedSchedulerManager* dist_task_mgr, ObAPMiniTaskMgr* mini_task_mgr) : rpc_tenant_id_(rpc_tenant_id), @@ -393,13 +393,13 @@ class ObExecutorPingRpcCtx { return mini_task_mgr_; } - private: +private: uint64_t rpc_tenant_id_; int64_t wait_timeout_; ObDistributedSchedulerManager* dist_task_mgr_; ObAPMiniTaskMgr* mini_task_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExecutorPingRpcCtx); }; @@ -408,7 +408,7 @@ class ObExecutorPingRpcCtx { // All calls to rpc must use the to function to support concurrent calls class ObExecutorRpcImpl { - public: +public: ObExecutorRpcImpl() : proxy_(NULL), batch_rpc_(nullptr) {} virtual ~ObExecutorRpcImpl() @@ -487,11 +487,11 @@ class ObExecutorRpcImpl { return proxy_; } - private: +private: void deal_with_rpc_timeout_err(ObExecutorRpcCtx& rpc_ctx, int& err, const common::ObAddr& dist_server) const; int get_sql_batch_req_type(int64_t execution_id) const; - private: +private: /* functions */ /* variables */ obrpc::ObExecutorRpcProxy* proxy_; diff --git a/src/sql/executor/ob_executor_rpc_processor.h b/src/sql/executor/ob_executor_rpc_processor.h index b0a6eebdb..66cbdb9e3 100644 --- a/src/sql/executor/ob_executor_rpc_processor.h +++ b/src/sql/executor/ob_executor_rpc_processor.h @@ -30,17 +30,17 @@ #define OB_DEFINE_SQL_TASK_PROCESSOR(cls, pcode, pname) \ OB_DEFINE_SQL_PROCESSOR(cls, obrpc::pcode, pname) \ { \ - public: \ + public: \ pname(const observer::ObGlobalContext& gctx) : gctx_(gctx) exec_ctx_(), phy_plan_() \ {} \ virturl ~pname() \ {} \ virtual int init(); \ \ - protected: \ + protected: \ virtual int process(); \ \ - private: \ + private: \ const observer::ObGlobalContext& gctx_; \ sql::ObExecContext& exec_ctx_; \ sql::ObPhysicalPlan& phy_plan_; \ @@ -49,17 +49,17 @@ #define OB_DEFINE_SQL_CMD_PROCESSOR(cls, pcode, pname) \ OB_DEFINE_SQL_PROCESSOR(cls, obrpc::pcode, pname) \ { \ - public: \ + public: \ pname(const observer::ObGlobalContext& gctx) : gctx_(gctx) \ {} \ virtual ~pname() \ {} \ \ - protected: \ + protected: \ int process(); \ int preprocess_arg(); \ \ - private: \ + private: \ const observer::ObGlobalContext& gctx_; \ common::ObArenaAllocator alloc_; \ } @@ -78,13 +78,13 @@ class ObIntermResultManager; class ObIntermResultIterator; class ObWorkerSessionGuard { - public: +public: ObWorkerSessionGuard(ObSQLSessionInfo* session); ~ObWorkerSessionGuard(); }; class ObDistExecuteBaseP { - public: +public: ObDistExecuteBaseP(const observer::ObGlobalContext& gctx, bool sync) : gctx_(gctx), exec_ctx_(gctx.session_mgr_), @@ -123,15 +123,15 @@ class ObDistExecuteBaseP { return exec_ctx_; } - protected: +protected: virtual int param_preprocess(ObTask& task); virtual int execute_dist_plan(ObTask& task, ObTaskCompleteEvent& task_event); virtual void record_exec_timestamp(bool is_first, ObExecTimestamp& exec_timestamp) = 0; - private: +private: int get_participants(common::ObPartitionIArray& participants, const ObTask& task); - private: +private: const observer::ObGlobalContext& gctx_; sql::ObDesExecContext exec_ctx_; observer::ObVirtualTableIteratorFactory vt_iter_factory_; @@ -152,7 +152,7 @@ class ObDistExecuteBaseP { // Remain this class, only for compatibility class ObRpcDistExecuteP : public ObDistExecuteBaseP, public obrpc::ObRpcProcessor> { - public: +public: ObRpcDistExecuteP(const observer::ObGlobalContext& gctx) : ObDistExecuteBaseP(gctx, true) { set_preserve_recv_data(); @@ -165,7 +165,7 @@ class ObRpcDistExecuteP : public ObDistExecuteBaseP, ObExecStatUtils::record_exec_timestamp(*this, is_first, exec_timestamp); } - protected: +protected: virtual int before_process(); virtual int process(); virtual int after_process(); @@ -174,7 +174,7 @@ class ObRpcDistExecuteP : public ObDistExecuteBaseP, class ObRpcAPDistExecuteP : public ObDistExecuteBaseP, public obrpc::ObRpcProcessor> { - public: +public: ObRpcAPDistExecuteP(const observer::ObGlobalContext& gctx) : ObDistExecuteBaseP(gctx, false) { set_preserve_recv_data(); @@ -187,7 +187,7 @@ class ObRpcAPDistExecuteP : public ObDistExecuteBaseP, ObExecStatUtils::record_exec_timestamp(*this, is_first, exec_timestamp); } - protected: +protected: virtual int before_process(); virtual int process(); virtual int after_process(); @@ -196,7 +196,7 @@ class ObRpcAPDistExecuteP : public ObDistExecuteBaseP, }; class ObRpcAPDistExecuteCB : public obrpc::ObExecutorRpcProxy::AsyncCB { - public: +public: ObRpcAPDistExecuteCB(const common::ObAddr& server, const ObTaskID& ob_task_id, const ObCurTraceId::TraceId& trace_id, int64_t timeout_ts) : task_loc_(server, ob_task_id), timeout_ts_(timeout_ts) @@ -206,7 +206,7 @@ class ObRpcAPDistExecuteCB : public obrpc::ObExecutorRpcProxy::AsyncCB> { - public: +public: ObRpcMiniTaskExecuteP(const observer::ObGlobalContext& gctx) : ObMiniTaskBaseP(gctx) { set_preserve_recv_data(); } virtual int init(); - protected: +protected: virtual void record_exec_timestamp(bool is_first, ObExecTimestamp& exec_timestamp) { ObExecStatUtils::record_exec_timestamp(*this, is_first, exec_timestamp); } - protected: +protected: virtual int before_process(); virtual int process(); virtual int before_response(); @@ -327,20 +327,20 @@ class ObRpcMiniTaskExecuteP class ObRpcAPMiniDistExecuteP : public ObMiniTaskBaseP, public obrpc::ObRpcProcessor> { - public: +public: ObRpcAPMiniDistExecuteP(const observer::ObGlobalContext& gctx) : ObMiniTaskBaseP(gctx) { set_preserve_recv_data(); } virtual int init(); - protected: +protected: virtual void record_exec_timestamp(bool is_first, ObExecTimestamp& exec_timestamp) { ObExecStatUtils::record_exec_timestamp(*this, is_first, exec_timestamp); } - protected: +protected: virtual int before_process(); virtual int process(); virtual int before_response(); @@ -352,7 +352,7 @@ class ObRpcAPMiniDistExecuteP }; class ObRpcAPMiniDistExecuteCB : public obrpc::ObExecutorRpcProxy::AsyncCB { - public: +public: ObRpcAPMiniDistExecuteCB(ObAPMiniTaskMgr* ap_mini_task_mgr, const ObTaskID& task_id, const ObCurTraceId::TraceId& trace_id, const ObAddr& dist_server_, int64_t timeout_ts); virtual ~ObRpcAPMiniDistExecuteCB() @@ -360,7 +360,7 @@ class ObRpcAPMiniDistExecuteCB : public obrpc::ObExecutorRpcProxy::AsyncCB> { - public: +public: ObRpcAPPingSqlTaskP(const observer::ObGlobalContext& gctx) : ObPingSqlTaskBaseP(gctx) {} virtual ~ObRpcAPPingSqlTaskP() {} - protected: +protected: virtual int process(); }; class ObDistributedSchedulerManager; class ObRpcAPPingSqlTaskCB : public obrpc::ObExecutorRpcProxy::AsyncCB { - public: +public: ObRpcAPPingSqlTaskCB(const ObTaskID& task_id); virtual ~ObRpcAPPingSqlTaskCB() { free_my_memory(); } - public: +public: int set_dist_task_mgr(ObDistributedSchedulerManager* dist_task_mgr); int set_mini_task_mgr(ObAPMiniTaskMgr* mini_task_mgr); virtual int process(); @@ -470,10 +470,10 @@ class ObRpcAPPingSqlTaskCB : public obrpc::ObExecutorRpcProxy::AsyncCB> { - public: +public: ObRpcTaskFetchResultP(const observer::ObGlobalContext& gctx) : gctx_(gctx) { set_preserve_recv_data(); @@ -491,19 +491,19 @@ class ObRpcTaskFetchResultP {} virtual int init(); - protected: +protected: virtual int process(); - private: +private: int sync_send_result(ObIntermResultIterator& iter); - private: +private: const observer::ObGlobalContext& gctx_; }; class ObRpcTaskFetchIntermResultP : public obrpc::ObRpcProcessor> { - public: +public: ObRpcTaskFetchIntermResultP(const observer::ObGlobalContext& gctx) : gctx_(gctx) { set_preserve_recv_data(); @@ -511,19 +511,19 @@ class ObRpcTaskFetchIntermResultP virtual ~ObRpcTaskFetchIntermResultP() {} // virtual int init(); - protected: +protected: virtual int process(); - private: +private: int sync_send_result(ObIntermResultIterator& iter); - private: +private: const observer::ObGlobalContext& gctx_; }; class ObRpcBKGDTaskCompleteP : public obrpc::ObRpcProcessor> { - public: +public: ObRpcBKGDTaskCompleteP(const observer::ObGlobalContext&) { set_preserve_recv_data(); diff --git a/src/sql/executor/ob_executor_rpc_proxy.h b/src/sql/executor/ob_executor_rpc_proxy.h index fb656ec64..c266ab5c4 100644 --- a/src/sql/executor/ob_executor_rpc_proxy.h +++ b/src/sql/executor/ob_executor_rpc_proxy.h @@ -30,7 +30,7 @@ namespace sql { struct ObBKGDDistExecuteArg { OB_UNIS_VERSION(1); - public: +public: ObBKGDDistExecuteArg() : tenant_id_(OB_INVALID_ID), scheduler_id_(0) {} TO_STRING_KV(K_(tenant_id), K_(task_id), K_(scheduler_id), K_(return_addr), K(serialized_task_.length())); @@ -51,7 +51,7 @@ struct ObBKGDDistExecuteArg { struct ObBKGDTaskCompleteArg { OB_UNIS_VERSION(1); - public: +public: ObBKGDTaskCompleteArg() : scheduler_id_(0), return_code_(common::OB_SUCCESS) {} TO_STRING_KV(K_(task_id), K_(scheduler_id), K_(return_code), K_(event)); @@ -65,7 +65,7 @@ struct ObBKGDTaskCompleteArg { struct ObFetchIntermResultItemArg { OB_UNIS_VERSION(1); - public: +public: ObFetchIntermResultItemArg() : index_(OB_INVALID_INDEX) {} @@ -78,7 +78,7 @@ struct ObFetchIntermResultItemArg { struct ObFetchIntermResultItemRes { OB_UNIS_VERSION(1); - public: +public: ObFetchIntermResultItemRes() : total_item_cnt_(-1) {} @@ -92,7 +92,7 @@ struct ObFetchIntermResultItemRes { namespace obrpc { class ObExecutorRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObExecutorRpcProxy); RPC_SS(@PR5 task_execute, obrpc::OB_REMOTE_EXECUTE, (sql::ObTask), common::ObScanner); diff --git a/src/sql/executor/ob_fifo_receive.cpp b/src/sql/executor/ob_fifo_receive.cpp index c35b234ef..512420186 100644 --- a/src/sql/executor/ob_fifo_receive.cpp +++ b/src/sql/executor/ob_fifo_receive.cpp @@ -1359,7 +1359,7 @@ struct ObFifoReceive::MergeRowComparer { return ret; } - private: +private: const ObIArray& sort_columns_; int* err_; }; diff --git a/src/sql/executor/ob_fifo_receive.h b/src/sql/executor/ob_fifo_receive.h index 35d408d24..e35470382 100644 --- a/src/sql/executor/ob_fifo_receive.h +++ b/src/sql/executor/ob_fifo_receive.h @@ -25,13 +25,13 @@ class ObTaskInfo; class ObPhyOperator; class ObTaskResultIter { - public: +public: enum IterType { IT_ROOT, IT_DISTRIBUTED, }; - public: +public: explicit ObTaskResultIter(IterType iter_tyep); virtual ~ObTaskResultIter(); virtual int get_next_task_result(ObTaskResult& task_result) = 0; @@ -41,19 +41,19 @@ class ObTaskResultIter { return iter_type_; } - protected: +protected: IterType iter_type_; }; class ObRootTaskResultIter : public ObTaskResultIter { - public: +public: ObRootTaskResultIter(ObExecContext& exec_ctx, uint64_t exec_id, uint64_t child_op_id, int64_t ts_timeout); virtual ~ObRootTaskResultIter(); virtual int get_next_task_result(ObTaskResult& task_result); virtual int check_status(); int init(); - private: +private: ObExecContext& exec_ctx_; uint64_t exec_id_; ObDistributedSchedulerManager::ObDistributedSchedulerHolder scheduler_holder_; @@ -63,13 +63,13 @@ class ObRootTaskResultIter : public ObTaskResultIter { }; class ObDistributedTaskResultIter : public ObTaskResultIter { - public: +public: explicit ObDistributedTaskResultIter(const ObIArray& task_results); virtual ~ObDistributedTaskResultIter(); virtual int get_next_task_result(ObTaskResult& task_result); virtual int check_status(); - private: +private: const ObIArray& task_results_; int64_t cur_idx_; }; @@ -90,7 +90,7 @@ class ObDistributedTaskResultIter : public ObTaskResultIter { class ObDistributedReceiveInput : public ObIPhyOperatorInput { OB_UNIS_VERSION_V(1); - public: +public: ObDistributedReceiveInput(); virtual ~ObDistributedReceiveInput(); virtual void reset() override; @@ -108,13 +108,13 @@ class ObDistributedReceiveInput : public ObIPhyOperatorInput { child_job_id_ = child_job_id; } - private: +private: common::ObSEArray child_task_results_; uint64_t child_job_id_; // need serialized, but only used for init child_task_results. }; class ObIDataSource { - public: +public: ObIDataSource(); virtual ~ObIDataSource(); @@ -124,7 +124,7 @@ class ObIDataSource { virtual int close() = 0; TO_STRING_KV(K_(inited), K_(cur_scanner)); - protected: +protected: virtual int fetch_next_scanner() = 0; common::ObScanner cur_scanner_; @@ -139,12 +139,12 @@ class ObIDataSource { // Fetch interm result using stream RPC (occupy one peer thread). // Only for compatibility, can be removed after all cluster upgrade to 2.1.0 class ObStreamDataSource : public ObIDataSource { - public: +public: ObStreamDataSource(); ~ObStreamDataSource(); virtual int close() override; - private: +private: virtual int fetch_next_scanner() override; /* * ObExecutorRpcImpl::task_fetch_interm_result() => FetchIntermResultStreamHandle @@ -159,13 +159,13 @@ class ObStreamDataSource : public ObIDataSource { // Fetch interm result using normal RPC, specify interm item index every time. class ObSpecifyDataSource : public ObIDataSource { - public: +public: ObSpecifyDataSource(); ~ObSpecifyDataSource(); virtual int close() override; - private: +private: virtual int fetch_next_scanner() override; int64_t fetch_index_; @@ -173,19 +173,19 @@ class ObSpecifyDataSource : public ObIDataSource { }; class ObAsyncReceive : public ObReceive { - protected: +protected: class ObAsyncReceiveCtx : public ObReceiveCtx { friend class ObAsyncReceive; friend class ObFifoReceiveV2; - public: + public: explicit ObAsyncReceiveCtx(ObExecContext& exec_ctx); virtual ~ObAsyncReceiveCtx(); virtual void destroy(); int init_root_iter(uint64_t child_op_id); int init_distributed_iter(const ObIArray& task_results); - protected: + protected: ObTaskResultIter* task_result_iter_; int64_t found_rows_; int64_t affected_rows_; @@ -194,7 +194,7 @@ class ObAsyncReceive : public ObReceive { bool iter_end_; }; - public: +public: explicit ObAsyncReceive(common::ObIAllocator& alloc); virtual ~ObAsyncReceive(); void set_in_root_job(bool in_root_job) @@ -206,7 +206,7 @@ class ObAsyncReceive : public ObReceive { return in_root_job_; } - protected: +protected: virtual int create_operator_input(ObExecContext& exec_ctx) const; virtual int create_op_ctx(ObExecContext& exec_ctx, ObAsyncReceiveCtx*& op_ctx) const = 0; virtual int init_op_ctx(ObExecContext& exec_ctx) const; @@ -216,56 +216,56 @@ class ObAsyncReceive : public ObReceive { int create_data_source(ObExecContext& exec_ctx, ObIDataSource*& data_source) const; - protected: +protected: bool in_root_job_; }; class ObSerialReceive : public ObAsyncReceive { - protected: +protected: class ObSerialReceiveCtx : public ObAsyncReceiveCtx { friend class ObSerialReceive; - public: + public: explicit ObSerialReceiveCtx(ObExecContext& exec_ctx); virtual ~ObSerialReceiveCtx(); virtual void destroy(); - protected: + protected: ObIDataSource* data_source_; }; - public: +public: explicit ObSerialReceive(common::ObIAllocator& alloc); virtual ~ObSerialReceive(); - protected: +protected: virtual int inner_open(ObExecContext& exec_ctx) const; virtual int inner_get_next_row(ObExecContext& exec_ctx, const common::ObNewRow*& row) const; virtual int inner_close(ObExecContext& exec_ctx) const; }; class ObParallelReceive : public ObAsyncReceive { - protected: +protected: class ObParallelReceiveCtx : public ObAsyncReceiveCtx { friend class ObParallelReceive; friend class ObMergeSortReceive; - public: + public: explicit ObParallelReceiveCtx(ObExecContext& exec_ctx); virtual ~ObParallelReceiveCtx(); virtual void destroy(); - protected: + protected: common::ObSEArray data_sources_; common::ObSEArray child_rows_; common::ObSEArray row_idxs_; }; - public: +public: explicit ObParallelReceive(common::ObIAllocator& alloc); virtual ~ObParallelReceive(); - protected: +protected: virtual int inner_open(ObExecContext& exec_ctx) const; virtual int inner_get_next_row(ObExecContext& exec_ctx, const common::ObNewRow*& row) const = 0; virtual int inner_close(ObExecContext& exec_ctx) const; @@ -275,17 +275,17 @@ class ObParallelReceive : public ObAsyncReceive { class ObFifoReceiveV2 : public ObSerialReceive { typedef ObSerialReceiveCtx ObFifoReceiveCtx; - public: +public: explicit ObFifoReceiveV2(common::ObIAllocator& alloc); virtual ~ObFifoReceiveV2(); - protected: +protected: virtual int create_op_ctx(ObExecContext& exec_ctx, ObAsyncReceiveCtx*& op_ctx) const; }; class ObTaskOrderReceive : public ObSerialReceive { struct ObTaskComparer { - public: + public: ObTaskComparer(); virtual ~ObTaskComparer(); bool operator()(const ObTaskResult& task1, const ObTaskResult& task2); @@ -293,26 +293,26 @@ class ObTaskOrderReceive : public ObSerialReceive { class ObTaskOrderReceiveCtx : public ObSerialReceiveCtx { friend class ObTaskOrderReceive; - public: + public: explicit ObTaskOrderReceiveCtx(ObExecContext& exec_ctx); virtual ~ObTaskOrderReceiveCtx(); virtual void destroy(); - protected: + protected: common::ObSEArray task_results_; ObTaskComparer task_comparer_; uint64_t cur_task_id_; }; - public: +public: explicit ObTaskOrderReceive(common::ObIAllocator& alloc); virtual ~ObTaskOrderReceive(); - protected: +protected: virtual int create_op_ctx(ObExecContext& exec_ctx, ObAsyncReceiveCtx*& op_ctx) const; virtual int get_next_task_result(ObAsyncReceiveCtx& op_ctx, ObTaskResult& task_result) const; - private: +private: int get_next_task_result_root(ObAsyncReceiveCtx& op_ctx, ObTaskResult& task_result) const; int get_next_task_result_distributed(ObAsyncReceiveCtx& op_ctx, ObTaskResult& task_result) const; }; @@ -320,9 +320,9 @@ class ObTaskOrderReceive : public ObSerialReceive { class ObMergeSortReceive : public ObParallelReceive, public ObSortableTrait { OB_UNIS_VERSION_V(1); - private: +private: struct ObRowComparer { - public: + public: ObRowComparer(); virtual ~ObRowComparer(); void init(const common::ObIArray& columns, const common::ObIArray& rows); @@ -332,7 +332,7 @@ class ObMergeSortReceive : public ObParallelReceive, public ObSortableTrait { return ret_; } - private: + private: const common::ObIArray* columns_; const common::ObIArray* rows_; int ret_; @@ -340,20 +340,20 @@ class ObMergeSortReceive : public ObParallelReceive, public ObSortableTrait { class ObMergeSortReceiveCtx : public ObParallelReceiveCtx { friend class ObMergeSortReceive; - public: + public: explicit ObMergeSortReceiveCtx(ObExecContext& exec_ctx); virtual ~ObMergeSortReceiveCtx(); - private: + private: ObRowComparer row_comparer_; int64_t last_row_idx_; }; - public: +public: explicit ObMergeSortReceive(common::ObIAllocator& alloc); virtual ~ObMergeSortReceive(); - protected: +protected: virtual int create_op_ctx(ObExecContext& exec_ctx, ObAsyncReceiveCtx*& op_ctx) const; virtual int inner_get_next_row(ObExecContext& exec_ctx, const common::ObNewRow*& row) const; }; @@ -362,7 +362,7 @@ class ObFifoReceiveInput : public ObReceiveInput { friend class ObFifoReceive; OB_UNIS_VERSION_V(1); - public: +public: ObFifoReceiveInput(){}; virtual ~ObFifoReceiveInput() {} @@ -373,7 +373,7 @@ class ObFifoReceiveInput : public ObReceiveInput { class ObDistributedScheduler; class ObFifoReceive : public ObReceive, public ObSortableTrait { - private: +private: struct MergeRowComparer; struct MergeSortHandle { MergeSortHandle() @@ -413,7 +413,7 @@ class ObFifoReceive : public ObReceive, public ObSortableTrait { class ObFifoReceiveCtx : public ObReceiveCtx { friend class ObFifoReceive; - public: + public: explicit ObFifoReceiveCtx(ObExecContext& ctx); virtual ~ObFifoReceiveCtx(); virtual void destroy() @@ -431,7 +431,7 @@ class ObFifoReceive : public ObReceive, public ObSortableTrait { ObReceiveCtx::destroy(); } - private: + private: int64_t found_rows_; FetchIntermResultStreamHandle stream_handler_; FetchResultStreamHandle old_stream_handler_; @@ -451,13 +451,13 @@ class ObFifoReceive : public ObReceive, public ObSortableTrait { common::ObSEArray heap_sort_rows_; }; - public: +public: explicit ObFifoReceive(common::ObIAllocator& aloc); virtual ~ObFifoReceive(); virtual int create_operator_input(ObExecContext& ctx) const; virtual int rescan(ObExecContext& ctx) const; - private: +private: /* functions */ virtual int inner_open(ObExecContext& ctx) const; virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; @@ -501,7 +501,7 @@ class ObFifoReceive : public ObReceive, public ObSortableTrait { int push_a_row_into_heap(ObFifoReceiveCtx& fifo_receive_ctx, ObSortRow& row) const; TO_STRING_KV(N_ORDER_BY, sort_columns_); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFifoReceive); }; } // namespace sql diff --git a/src/sql/executor/ob_interm_result.h b/src/sql/executor/ob_interm_result.h index 5d4bceb9c..6f1d35654 100644 --- a/src/sql/executor/ob_interm_result.h +++ b/src/sql/executor/ob_interm_result.h @@ -35,7 +35,7 @@ union AtomicCntAndState { }; class ObIntermResultInfo { - public: +public: ObIntermResultInfo() : slice_id_() {} virtual ~ObIntermResultInfo() @@ -67,7 +67,7 @@ class ObIntermResultInfo { }; class ObIntermResult { - public: +public: friend class ObIntermResultIterator; static const int32_t STATE_NORMAL = 0; @@ -169,7 +169,7 @@ class ObIntermResult { int get_item(const int64_t index, ObIIntermResultItem*& item); - private: +private: int alloc_scanner(); void free_scanner(); @@ -181,7 +181,7 @@ class ObIntermResult { int reset_and_init_cur_scanner(); int check_and_init_cur_scanner(); - private: +private: static const int64_t DEFAULT_INTERM_RESULT_ITEM_NUM = 2; common::ObScanner* cur_scanner_; ObIntermResultItemPool* ir_item_pool_; @@ -200,12 +200,12 @@ class ObIntermResult { int64_t offset_; ObPhyOperator::reclaim_row_t row_reclaim_func_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIntermResult); }; class ObIntermResultIterator { - public: +public: friend class ObIntermResultManager; ObIntermResultIterator(); virtual ~ObIntermResultIterator(); @@ -221,7 +221,7 @@ class ObIntermResultIterator { return ir_; } // int64_t get_col_count(); - private: +private: int set_interm_result(const ObIntermResultInfo& ir_info, ObIntermResult* ir, bool has_inc_cnt); int get_interm_result_info(ObIntermResultInfo& ir_info); diff --git a/src/sql/executor/ob_interm_result_item.h b/src/sql/executor/ob_interm_result_item.h index 16fb098e5..5eae0830f 100644 --- a/src/sql/executor/ob_interm_result_item.h +++ b/src/sql/executor/ob_interm_result_item.h @@ -23,7 +23,7 @@ class ObScanner; } namespace sql { class ObIIntermResultItem { - public: +public: ObIIntermResultItem() : row_count_(0), data_len_(0) {} virtual ~ObIIntermResultItem() @@ -47,7 +47,7 @@ class ObIIntermResultItem { VIRTUAL_TO_STRING_KV(K_(row_count), K_(data_len)); - protected: +protected: int64_t row_count_; int64_t data_len_; @@ -58,7 +58,7 @@ class ObDiskIntermResultItem; class ObIntermResultItem : public ObIIntermResultItem { OB_UNIS_VERSION(1); - public: +public: ObIntermResultItem(const char* label = common::ObModIds::OB_SQL_EXECUTOR_INTERM_RESULT_ITEM, uint64_t tenant_id = common::OB_SERVER_TENANT_ID); virtual ~ObIntermResultItem(); @@ -87,16 +87,16 @@ class ObIntermResultItem : public ObIIntermResultItem { INHERIT_TO_STRING_KV("iinterm_result", ObIIntermResultItem, KP_(data_buf)); - private: +private: common::ObArenaAllocator allocator_; char* data_buf_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIntermResultItem); }; class ObDiskIntermResultItem : public ObIIntermResultItem { - public: +public: ObDiskIntermResultItem(); virtual ~ObDiskIntermResultItem(); @@ -119,7 +119,7 @@ class ObDiskIntermResultItem : public ObIIntermResultItem { INHERIT_TO_STRING_KV("iinterm_result", ObIIntermResultItem, K_(fd), K_(offset), K_(tenant_id)); - private: +private: uint64_t tenant_id_; int64_t fd_; int64_t dir_id_; diff --git a/src/sql/executor/ob_interm_result_item_pool.h b/src/sql/executor/ob_interm_result_item_pool.h index 47c4fe915..8f0c06b89 100644 --- a/src/sql/executor/ob_interm_result_item_pool.h +++ b/src/sql/executor/ob_interm_result_item_pool.h @@ -23,7 +23,7 @@ class ObIntermResultItem; class ObDiskIntermResultItem; class ObIntermResultItemPool { - public: +public: static const int64_t MAX_INTERM_RESULT_ITEM_POOL_CAPACITY = ObIntermResultPool::INTERM_RESULT_CAPACITY; ObIntermResultItemPool(); virtual ~ObIntermResultItemPool(); @@ -44,14 +44,14 @@ class ObIntermResultItemPool { return MAX_INTERM_RESULT_ITEM_POOL_CAPACITY; } - private: +private: int init(); inline common::ObSmallAllocator& get_allocator(const bool is_memory_item) { return is_memory_item ? mem_item_allocator_ : disk_item_allocator_; } - private: +private: static ObIntermResultItemPool* instance_; bool inited_; @@ -59,7 +59,7 @@ class ObIntermResultItemPool { common::ObSmallAllocator mem_item_allocator_; common::ObSmallAllocator disk_item_allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIntermResultItemPool); }; } // namespace sql diff --git a/src/sql/executor/ob_interm_result_manager.cpp b/src/sql/executor/ob_interm_result_manager.cpp index 13e6459aa..5154a0710 100644 --- a/src/sql/executor/ob_interm_result_manager.cpp +++ b/src/sql/executor/ob_interm_result_manager.cpp @@ -25,7 +25,7 @@ using namespace oceanbase::common; using namespace common::hash; class ObUpdateIRExpireTime { - public: +public: ObUpdateIRExpireTime(const int64_t expire_time) : ret_(OB_SUCCESS), expire_time_(expire_time) {} @@ -39,10 +39,10 @@ class ObUpdateIRExpireTime { } } - public: +public: int ret_; - private: +private: const int64_t expire_time_; }; diff --git a/src/sql/executor/ob_interm_result_manager.h b/src/sql/executor/ob_interm_result_manager.h index 731d089de..f29bc0f77 100644 --- a/src/sql/executor/ob_interm_result_manager.h +++ b/src/sql/executor/ob_interm_result_manager.h @@ -23,7 +23,7 @@ namespace sql { class ObIntermResultPool; class ObIntermResultManager; class ObIntermResultRead { - public: +public: ObIntermResultRead() : ret_(common::OB_SUCCESS), value_(NULL) {} @@ -50,13 +50,13 @@ class ObIntermResultRead { return value_; } - private: +private: int ret_; ObIntermResult* value_; }; class ObIntermResultRecycle { - public: +public: ObIntermResultRecycle() : ret_(common::OB_SUCCESS), value_(NULL) {} @@ -83,13 +83,13 @@ class ObIntermResultRecycle { return value_; } - private: +private: int ret_; ObIntermResult* value_; }; class ObIntermResultGC : public common::ObTimerTask { - public: +public: ObIntermResultGC(); virtual ~ObIntermResultGC(); @@ -99,10 +99,10 @@ class ObIntermResultGC : public common::ObTimerTask { void set_ir_map(common::hash::ObHashMap* ir_map); void set_ir_manager(ObIntermResultManager* ir_manager); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIntermResultGC); - private: +private: // ir map common::hash::ObHashMap* ir_map_; // ir manager @@ -117,7 +117,7 @@ class ObIntermResultGC : public common::ObTimerTask { }; class ObIntermResultManager { - public: +public: friend class ObIntermResultGC; static const int64_t DEFAULT_INTERM_RESULT_GC_DELAY_TIME = 1000000; @@ -143,12 +143,12 @@ class ObIntermResultManager { int free_result(ObIntermResult* interm_result); const common::hash::ObHashMap& get_ir_map() const; - private: +private: int init(); int free_result(const ObIntermResultInfo& ir_info); DISALLOW_COPY_AND_ASSIGN(ObIntermResultManager); - private: +private: static ObIntermResultManager* instance_; bool inited_; common::hash::ObHashMap ir_map_; diff --git a/src/sql/executor/ob_interm_result_pool.h b/src/sql/executor/ob_interm_result_pool.h index 96282309b..ac8c1ce1e 100644 --- a/src/sql/executor/ob_interm_result_pool.h +++ b/src/sql/executor/ob_interm_result_pool.h @@ -23,7 +23,7 @@ class ObScanner; namespace sql { class ObIntermResult; class ObIntermResultPool { - public: +public: // Assume than one interm result is 1MB and we need manage 10TB intermediate data, // we need 10TB/1MB = 10M interm result. static const int64_t INTERM_RESULT_CAPACITY = 10L << 20; // 10M @@ -46,10 +46,10 @@ class ObIntermResultPool { int alloc_scanner(common::ObScanner*& scanner); void free_scanner(common::ObScanner* scanner); - private: +private: int init(); - private: +private: static ObIntermResultPool* instance_; // this interm result pool is initialized bool inited_; diff --git a/src/sql/executor/ob_interm_task_spliter.h b/src/sql/executor/ob_interm_task_spliter.h index f8d63e3b0..8a0ffd46f 100644 --- a/src/sql/executor/ob_interm_task_spliter.h +++ b/src/sql/executor/ob_interm_task_spliter.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObIntermTaskSpliter : public ObTaskSpliter { - public: +public: ObIntermTaskSpliter(); virtual ~ObIntermTaskSpliter(); virtual int get_next_task(ObTaskInfo*& task); @@ -28,18 +28,18 @@ class ObIntermTaskSpliter : public ObTaskSpliter { return ObTaskSpliter::INTERM_SPLIT; } - private: +private: /* functions */ int prepare(); - private: +private: /* variables */ bool prepare_done_flag_; int64_t next_task_idx_; int64_t total_task_count_; common::ObSEArray store_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIntermTaskSpliter); }; } // namespace sql diff --git a/src/sql/executor/ob_job.h b/src/sql/executor/ob_job.h index c2cc55cee..ca79d542c 100644 --- a/src/sql/executor/ob_job.h +++ b/src/sql/executor/ob_job.h @@ -38,7 +38,7 @@ class ObAddrsProvider; class ObExecContext; class ObOpSpec; class ObMiniJob { - public: +public: ObMiniJob() : phy_plan_(NULL), root_op_(NULL), extend_op_(NULL), root_spec_(NULL), extend_spec_(NULL) {} @@ -86,7 +86,7 @@ class ObMiniJob { DECLARE_TO_STRING; - private: +private: const ObPhysicalPlan* phy_plan_; const ObPhyOperator* root_op_; const ObPhyOperator* extend_op_; @@ -96,7 +96,7 @@ class ObMiniJob { }; class ObJob { - public: +public: ObJob(); virtual ~ObJob(); // different task needs different spliter @@ -245,7 +245,7 @@ class ObJob { DECLARE_TO_STRING; - private: +private: int prepare_task_control(const ObExecContext& exec_ctx); int get_parallel_degree(const ObExecContext& exec_ctx, int64_t& stmt_parallel_degree); int is_valid_finished_task_infos(const common::ObIArray& task_infos, bool& is_valid) const; @@ -253,7 +253,7 @@ class ObJob { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObJob); - private: +private: static const int64_t MAX_CHILD_JOB_NUM = 16; ObJobID ob_job_id_; bool is_root_job_; diff --git a/src/sql/executor/ob_job_conf.h b/src/sql/executor/ob_job_conf.h index f16f5d079..904899e35 100644 --- a/src/sql/executor/ob_job_conf.h +++ b/src/sql/executor/ob_job_conf.h @@ -26,7 +26,7 @@ typedef common::ObIArray RangeIArray; typedef common::ObSEArray RangeSEArray; class ObJobConf { - public: +public: ObJobConf(); virtual ~ObJobConf(); void reset(); @@ -43,11 +43,11 @@ class ObJobConf { task_split_type_ = type; } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObJobConf); - private: +private: // Task Split Type int task_split_type_; // If a table scan Job, we need this info: diff --git a/src/sql/executor/ob_job_control.h b/src/sql/executor/ob_job_control.h index e2acb9f94..e20b33d25 100644 --- a/src/sql/executor/ob_job_control.h +++ b/src/sql/executor/ob_job_control.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObTaskEvent; class ObJobControl { - public: +public: explicit ObJobControl(); virtual ~ObJobControl(); @@ -61,7 +61,7 @@ class ObJobControl { DECLARE_TO_STRING; - private: +private: int build_job_ctx(ObExecContext& ctx, ObJob& job); int build_job_op_input(ObExecContext& ctx, ObJob& job); // int jobs_quick_sort(common::ObIArray &jobs, @@ -69,9 +69,9 @@ class ObJobControl { // int64_t high); void print_job_tree(char* buf, const int64_t buf_len, int64_t& pos, ObJob* job) const; - protected: +protected: common::ObSEArray jobs_; // remote plan has two jobs - private: +private: mutable uint64_t local_job_id_; static volatile uint64_t global_job_id_; DISALLOW_COPY_AND_ASSIGN(ObJobControl); diff --git a/src/sql/executor/ob_job_id.h b/src/sql/executor/ob_job_id.h index 819140d0c..0bcd02337 100644 --- a/src/sql/executor/ob_job_id.h +++ b/src/sql/executor/ob_job_id.h @@ -20,7 +20,7 @@ namespace sql { class ObJobID final { OB_UNIS_VERSION(1); - public: +public: ObJobID(const ObExecutionID& ob_execution_id, uint64_t job_id) : ob_execution_id_(ob_execution_id), job_id_(job_id), root_op_id_(0) {} @@ -112,7 +112,7 @@ class ObJobID final { TO_STRING_KV(N_OB_EXECUTION_ID, ob_execution_id_, N_JOB_ID, job_id_); DECLARE_TO_YSON_KV; - private: +private: /* variables */ ObExecutionID ob_execution_id_; uint64_t job_id_; diff --git a/src/sql/executor/ob_job_parser.h b/src/sql/executor/ob_job_parser.h index c77ad7647..32fcfe141 100644 --- a/src/sql/executor/ob_job_parser.h +++ b/src/sql/executor/ob_job_parser.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObJobParser { - public: +public: ObJobParser(); virtual ~ObJobParser(); @@ -31,7 +31,7 @@ class ObJobParser { int parse_job(ObExecContext& ctx, ObPhysicalPlan* plan, const ObExecutionID& ob_execution_id, ObTaskSpliterFactory& spliter_factory, ObJobControl& jc) const; - private: +private: int split_jobs(ObExecContext& ctx, ObPhysicalPlan* phy_plan, ObPhyOperator* op, const ObExecutionID& ob_execution_id, ObJobControl& jc, ObTaskSpliterFactory& spliter_factory, ObJob& cur_job) const; @@ -40,7 +40,7 @@ class ObJobParser { bool is_outer_join_child(const ObPhyOperator& phy_op) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObJobParser); }; } // namespace sql diff --git a/src/sql/executor/ob_local_identity_task_spliter.h b/src/sql/executor/ob_local_identity_task_spliter.h index 7e6f6b12f..da4f59a46 100644 --- a/src/sql/executor/ob_local_identity_task_spliter.h +++ b/src/sql/executor/ob_local_identity_task_spliter.h @@ -25,7 +25,7 @@ class ObTaskInfo; // it will be directly optimized without the process of splitting the job, // which is equivalent to the size of this class. Some functions will not be called class ObLocalIdentityTaskSpliter : public ObTaskSpliter { - public: +public: ObLocalIdentityTaskSpliter(); virtual ~ObLocalIdentityTaskSpliter(); virtual int get_next_task(ObTaskInfo*& task); @@ -34,11 +34,11 @@ class ObLocalIdentityTaskSpliter : public ObTaskSpliter { return ObTaskSpliter::LOCAL_IDENTITY_SPLIT; } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObLocalIdentityTaskSpliter); - private: +private: ObTaskInfo* task_; }; } // namespace sql diff --git a/src/sql/executor/ob_local_job_control.h b/src/sql/executor/ob_local_job_control.h index 2ecae5e46..b887eafed 100644 --- a/src/sql/executor/ob_local_job_control.h +++ b/src/sql/executor/ob_local_job_control.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { class ObLocalJobControl : public ObJobControl { - public: +public: explicit ObLocalJobControl(); virtual ~ObLocalJobControl(); virtual int get_ready_jobs(common::ObIArray& jobs, bool serial_sched = false) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLocalJobControl); }; } // namespace sql diff --git a/src/sql/executor/ob_local_job_executor.h b/src/sql/executor/ob_local_job_executor.h index 71860941b..2d8cc4c82 100644 --- a/src/sql/executor/ob_local_job_executor.h +++ b/src/sql/executor/ob_local_job_executor.h @@ -19,7 +19,7 @@ class ObJob; class ObTaskExecutor; class ObExecContext; class ObLocalJobExecutor { - public: +public: ObLocalJobExecutor(); virtual ~ObLocalJobExecutor(); void set_job(ObJob& job) @@ -37,14 +37,14 @@ class ObLocalJobExecutor { executor_ = NULL; } - private: +private: // disallow copy ObLocalJobExecutor(const ObLocalJobExecutor& other); ObLocalJobExecutor& operator=(const ObLocalJobExecutor& ohter); int get_executable_task(ObExecContext& ctx, ObTaskInfo*& task); - private: +private: ObJob* job_; ObTaskExecutor* executor_; }; diff --git a/src/sql/executor/ob_local_scheduler.h b/src/sql/executor/ob_local_scheduler.h index b671fb006..1913c32ed 100644 --- a/src/sql/executor/ob_local_scheduler.h +++ b/src/sql/executor/ob_local_scheduler.h @@ -22,16 +22,16 @@ namespace oceanbase { namespace sql { class ObLocalScheduler : public ObSqlScheduler { - public: +public: ObLocalScheduler(); virtual ~ObLocalScheduler(); virtual int schedule(ObExecContext& ctx, ObPhysicalPlan* phy_plan); - private: +private: int direct_generate_task_and_execute( ObExecContext& ctx, const ObExecutionID& ob_execution_id, ObPhyOperator* root_op); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObLocalScheduler); }; diff --git a/src/sql/executor/ob_local_task_executor.h b/src/sql/executor/ob_local_task_executor.h index 07489c38e..a3fbf3143 100644 --- a/src/sql/executor/ob_local_task_executor.h +++ b/src/sql/executor/ob_local_task_executor.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLocalTaskExecutor : public ObTaskExecutor { - public: +public: ObLocalTaskExecutor(); virtual ~ObLocalTaskExecutor(); virtual int execute(ObExecContext& ctx, ObJob* job, ObTaskInfo* task_info); @@ -26,7 +26,7 @@ class ObLocalTaskExecutor : public ObTaskExecutor { ObTaskExecutor::reset(); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLocalTaskExecutor); }; } // namespace sql diff --git a/src/sql/executor/ob_mini_task_executor.h b/src/sql/executor/ob_mini_task_executor.h index acdad864e..e56c7c6c0 100644 --- a/src/sql/executor/ob_mini_task_executor.h +++ b/src/sql/executor/ob_mini_task_executor.h @@ -20,7 +20,7 @@ namespace sql { class ObAPMiniTaskMgr : public common::ObDLinkBase { static const int64_t MAX_FINISH_QUEUE_CAPACITY = 512; - public: +public: ObAPMiniTaskMgr() : ref_count_(0), mgr_rcode_(common::OB_SUCCESS), @@ -77,7 +77,7 @@ class ObAPMiniTaskMgr : public common::ObDLinkBase { return trans_result_.wait_all_task(timeout); } - private: +private: int64_t ref_count_; int mgr_rcode_; common::ObArray rcode_addrs_; @@ -126,7 +126,7 @@ inline void ObAPMiniTaskMgr::free(ObAPMiniTaskMgr* item) class ObSQLSessionInfo; class ObMiniTaskExecutor { - public: +public: explicit ObMiniTaskExecutor(common::ObIAllocator& allocator) : ap_mini_task_mgr_(NULL) { UNUSED(allocator); @@ -142,7 +142,7 @@ class ObMiniTaskExecutor { static int add_invalid_servers_to_retry_info( const int ret, const ObIArray& addr, ObQueryRetryInfo& retry_info); - protected: +protected: int mini_task_local_execute(ObExecContext& query_ctx, ObMiniTask& task, ObMiniTaskResult& task_result); int sync_fetch_local_result(ObExecContext& ctx, const ObPhyOperator& root_op, common::ObScanner& result); int sync_fetch_local_result(ObExecContext& ctx, const ObOpSpec& root_spec, ObScanner& result); @@ -152,12 +152,12 @@ class ObMiniTaskExecutor { ObExecContext& ctx, int64_t ap_task_cnt, ObMiniTaskResult& result, ObMiniTaskRetryInfo& retry_info); int pop_ap_mini_task_event(ObExecContext& ctx, ObMiniTaskEvent*& complete_task); - protected: +protected: ObAPMiniTaskMgr* ap_mini_task_mgr_; }; class ObDMLMiniTaskExecutor : public ObMiniTaskExecutor { - public: +public: explicit ObDMLMiniTaskExecutor(common::ObIAllocator& allocator) : ObMiniTaskExecutor(allocator) {} virtual ~ObDMLMiniTaskExecutor() @@ -177,7 +177,7 @@ class ObDMLMiniTaskExecutor : public ObMiniTaskExecutor { }; class ObLookupMiniTaskExecutor : public ObMiniTaskExecutor { - public: +public: explicit ObLookupMiniTaskExecutor(common::ObIAllocator& allocator) : ObMiniTaskExecutor(allocator) {} virtual ~ObLookupMiniTaskExecutor() diff --git a/src/sql/executor/ob_multiinsert_task_spliter.h b/src/sql/executor/ob_multiinsert_task_spliter.h index 999763a2c..8a2936831 100644 --- a/src/sql/executor/ob_multiinsert_task_spliter.h +++ b/src/sql/executor/ob_multiinsert_task_spliter.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace sql { class ObMultiInsertTaskSpliter : public ObTaskSpliter { - public: +public: ObMultiInsertTaskSpliter(); virtual ~ObMultiInsertTaskSpliter(); virtual int get_next_task(ObTaskInfo*& task); @@ -31,19 +31,19 @@ class ObMultiInsertTaskSpliter : public ObTaskSpliter { return ObTaskSpliter::INSERT_SPLIT; } - private: +private: /* functions */ int prepare(); int get_next_range_location(ObTaskInfo::ObRangeLocation& range_loc); - private: +private: /* variables */ const ObPhyTableLocation* phy_table_loc_; bool prepare_done_flag_; common::ObSEArray store_; int64_t next_task_idx_; - private: +private: /* other */ DISALLOW_COPY_AND_ASSIGN(ObMultiInsertTaskSpliter); }; diff --git a/src/sql/executor/ob_multiscan_task_spliter.h b/src/sql/executor/ob_multiscan_task_spliter.h index bbea34a0f..f2995c1b4 100644 --- a/src/sql/executor/ob_multiscan_task_spliter.h +++ b/src/sql/executor/ob_multiscan_task_spliter.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace sql { class ObIntraPartitionTaskSpliter : public ObTaskSpliter { - public: +public: ObIntraPartitionTaskSpliter(); virtual ~ObIntraPartitionTaskSpliter(); virtual int get_next_task(ObTaskInfo*& task); @@ -31,13 +31,13 @@ class ObIntraPartitionTaskSpliter : public ObTaskSpliter { return ObTaskSpliter::INTRA_PARTITION_SPLIT; } - private: +private: int prepare(); int get_part_and_ranges( const share::ObPartitionReplicaLocation*& part_rep_loc, const ObSplittedRanges*& splitted_ranges); int get_scan_ranges(const ObSplittedRanges& splitted_ranges, ObTaskInfo::ObPartLoc& part_loc); - private: +private: const ObPhyTableLocation* table_loc_; const ObPartitionReplicaLocationIArray* part_rep_loc_list_; const ObSplittedRangesIArray* splitted_ranges_list_; @@ -48,7 +48,7 @@ class ObIntraPartitionTaskSpliter : public ObTaskSpliter { }; class ObDistributedTaskSpliter : public ObTaskSpliter { - private: +private: enum ObMatchType { MT_ONLY_MATCH = 0, MT_ALL_PART = 1, @@ -56,7 +56,7 @@ class ObDistributedTaskSpliter : public ObTaskSpliter { MT_ALL_BOTH = MT_ALL_PART | MT_ALL_SLICE, }; struct ObPartComparer { - public: + public: ObPartComparer(common::ObIArray& shuffle_keys, bool cmp_part, bool cmp_subpart, int sort_order); virtual ~ObPartComparer(); bool operator()(int64_t idx1, int64_t idx2); @@ -65,7 +65,7 @@ class ObDistributedTaskSpliter : public ObTaskSpliter { return ret_; } - private: + private: common::ObIArray& shuffle_keys_; bool cmp_part_; bool cmp_subpart_; @@ -73,7 +73,7 @@ class ObDistributedTaskSpliter : public ObTaskSpliter { int ret_; }; struct ObSliceComparer { - public: + public: ObSliceComparer(bool cmp_part, bool cmp_subpart, int sort_order); virtual ~ObSliceComparer(); bool operator()(const ObSliceEvent* slice1, const ObSliceEvent* slice2); @@ -82,14 +82,14 @@ class ObDistributedTaskSpliter : public ObTaskSpliter { return ret_; } - private: + private: bool cmp_part_; bool cmp_subpart_; int sort_order_; // asc: 1, desc: -1. int ret_; }; struct ObPhyTableLoc { - public: + public: ObPhyTableLoc() : table_loc_(NULL), depend_table_keys_(common::ObModIds::OB_SQL_EXECUTOR_TASK_SPLITER, OB_MALLOC_NORMAL_BLOCK_SIZE) @@ -130,12 +130,12 @@ class ObDistributedTaskSpliter : public ObTaskSpliter { } TO_STRING_KV(K_(table_loc), K_(depend_table_keys)); - private: + private: const ObPhyTableLocation* table_loc_; common::ObSEArray depend_table_keys_; }; - public: +public: ObDistributedTaskSpliter(); virtual ~ObDistributedTaskSpliter(); virtual int get_next_task(ObTaskInfo*& task); @@ -144,7 +144,7 @@ class ObDistributedTaskSpliter : public ObTaskSpliter { return ObTaskSpliter::DISTRIBUTED_SPLIT; } - private: +private: int prepare(); int init_match_type(); int init_table_locations(ObPhyOperator* root_op); @@ -175,7 +175,7 @@ class ObDistributedTaskSpliter : public ObTaskSpliter { int get_task_runner_server(common::ObAddr& runner_server) const; int need_split_task_by_partition(bool& by_partition) const; - private: +private: // table informations. common::ObSEArray table_locations_; common::ObSEArray part_shuffle_keys_; @@ -195,7 +195,7 @@ class ObDistributedTaskSpliter : public ObTaskSpliter { bool repart_subpart_; bool prepare_done_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistributedTaskSpliter); }; diff --git a/src/sql/executor/ob_random_addrs_provider.h b/src/sql/executor/ob_random_addrs_provider.h index 460a12795..060e1f28e 100644 --- a/src/sql/executor/ob_random_addrs_provider.h +++ b/src/sql/executor/ob_random_addrs_provider.h @@ -19,14 +19,14 @@ namespace oceanbase { namespace sql { class ObRandomAddrsProvider : public ObAddrsProvider { - public: +public: ObRandomAddrsProvider(); virtual ~ObRandomAddrsProvider(); virtual int select_servers(int64_t select_count, common::ObIArray& servers); VIRTUAL_TO_STRING_KV(K_(servers)); - private: +private: common::ObSEArray servers_; DISALLOW_COPY_AND_ASSIGN(ObRandomAddrsProvider); }; diff --git a/src/sql/executor/ob_range_hash_key_getter.h b/src/sql/executor/ob_range_hash_key_getter.h index 8c30cabb9..2b109a7f1 100644 --- a/src/sql/executor/ob_range_hash_key_getter.h +++ b/src/sql/executor/ob_range_hash_key_getter.h @@ -28,7 +28,7 @@ class ObTableSchema; namespace sql { class ObRangeHashKeyGetter { - public: +public: ObRangeHashKeyGetter(const int64_t& repartition_table_id, const common::ObFixedArray& repart_columns, const common::ObFixedArray& repart_sub_columns) @@ -44,7 +44,7 @@ class ObRangeHashKeyGetter { // int64_t slice_idx, // int64_t &part_idx, // int64_t &subpart_idx) const; - private: +private: const int64_t& repartition_table_id_; const common::ObFixedArray& repart_columns_; const common::ObFixedArray& repart_sub_columns_; diff --git a/src/sql/executor/ob_receive.h b/src/sql/executor/ob_receive.h index 82afd5f01..8aa35e622 100644 --- a/src/sql/executor/ob_receive.h +++ b/src/sql/executor/ob_receive.h @@ -38,7 +38,7 @@ class ObReceiveInput : public ObIPhyOperatorInput { friend class ObReceive; OB_UNIS_VERSION_V(1); - public: +public: ObReceiveInput(); virtual ~ObReceiveInput(); virtual void reset() override; @@ -59,7 +59,7 @@ class ObReceiveInput : public ObIPhyOperatorInput { }; int get_result_location(const int64_t child_job_id, const int64_t child_task_id, common::ObAddr& svr) const; - protected: +protected: uint64_t pull_slice_id_; int64_t child_job_id_; uint64_t child_op_id_; @@ -69,9 +69,9 @@ class ObReceiveInput : public ObIPhyOperatorInput { class ObReceive : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - protected: +protected: class ObReceiveCtx : public ObPhyOperatorCtx { - public: + public: explicit ObReceiveCtx(ObExecContext& ctx); virtual ~ObReceiveCtx(); virtual void destroy() @@ -80,7 +80,7 @@ class ObReceive : public ObSingleChildPhyOperator { } }; - public: +public: explicit ObReceive(common::ObIAllocator& alloc); virtual ~ObReceive(); virtual int switch_iterator(ObExecContext& ctx) const override; @@ -125,12 +125,12 @@ class ObReceive : public ObSingleChildPhyOperator { return common::OB_SUCCESS; } - protected: +protected: bool partition_order_specified_; bool need_set_affected_row_; bool is_merge_sort_; - private: +private: // disallow copy ObReceive(const ObReceive& other); ObReceive& operator=(const ObReceive& ohter); diff --git a/src/sql/executor/ob_remote_executor_processor.h b/src/sql/executor/ob_remote_executor_processor.h index 5b0ce5e4d..41c94d67d 100644 --- a/src/sql/executor/ob_remote_executor_processor.h +++ b/src/sql/executor/ob_remote_executor_processor.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { template class ObRemoteBaseExecuteP : public obrpc::ObRpcProcessor { - public: +public: ObRemoteBaseExecuteP(const observer::ObGlobalContext& gctx, bool is_execute_remote_plan = false) : obrpc::ObRpcProcessor(), gctx_(gctx), @@ -60,7 +60,7 @@ class ObRemoteBaseExecuteP : public obrpc::ObRpcProcessor { return is_execute_remote_plan_; } - protected: +protected: int base_init(); int base_before_process( int64_t tenant_schema_version, int64_t sys_schema_version, const DependenyTableStore& dependency_tables); @@ -82,7 +82,7 @@ class ObRemoteBaseExecuteP : public obrpc::ObRpcProcessor { virtual void clean_result_buffer() = 0; bool query_can_retry_in_remote(int& last_err, int& err, ObSQLSessionInfo& session, int64_t& retry_times); - protected: +protected: const observer::ObGlobalContext& gctx_; sql::ObDesExecContext exec_ctx_; ObSqlPartitionLocationCache partition_location_cache_; @@ -103,14 +103,14 @@ class ObRemoteBaseExecuteP : public obrpc::ObRpcProcessor { }; /* Handle remote single partition situation (REMOTE) */ class ObRpcRemoteExecuteP : public ObRemoteBaseExecuteP > { - public: +public: ObRpcRemoteExecuteP(const observer::ObGlobalContext& gctx) : ObRemoteBaseExecuteP(gctx, true) {} virtual ~ObRpcRemoteExecuteP() {} virtual int init(); - protected: +protected: virtual int send_result_to_controller(ObExecContext& exec_ctx, const ObPhysicalPlan& plan) override; virtual int before_process(); virtual int process(); @@ -119,23 +119,23 @@ class ObRpcRemoteExecuteP : public ObRemoteBaseExecuteP > { - public: +public: ObRpcRemoteSyncExecuteP(const observer::ObGlobalContext& gctx) : ObRemoteBaseExecuteP(gctx) {} virtual ~ObRpcRemoteSyncExecuteP() {} virtual int init(); - protected: +protected: virtual int send_result_to_controller(ObExecContext& exec_ctx, const ObPhysicalPlan& plan) override; virtual int before_process(); virtual int process(); @@ -147,7 +147,7 @@ class ObRpcRemoteSyncExecuteP class ObRpcRemoteASyncExecuteP : public ObRemoteBaseExecuteP > { - public: +public: ObRpcRemoteASyncExecuteP(const observer::ObGlobalContext& gctx) : ObRemoteBaseExecuteP(gctx), remote_result_(), is_from_batch_(false) {} @@ -168,19 +168,19 @@ class ObRpcRemoteASyncExecuteP is_from_batch_ = true; } - protected: +protected: virtual int send_result_to_controller(ObExecContext& exec_ctx, const ObPhysicalPlan& plan) override; int send_remote_result(ObRemoteResult& remote_result); virtual void clean_result_buffer() override; - private: +private: ObRemoteResult remote_result_; bool is_from_batch_; }; class ObRpcRemotePostResultP : public obrpc::ObRpcProcessor > { - public: +public: ObRpcRemotePostResultP(const observer::ObGlobalContext& gctx) : gctx_(gctx), is_from_batch_(false) { set_preserve_recv_data(); @@ -228,7 +228,7 @@ class ObRpcRemotePostResultP } } - private: +private: const observer::ObGlobalContext& gctx_; bool is_from_batch_; }; diff --git a/src/sql/executor/ob_remote_identity_task_spliter.h b/src/sql/executor/ob_remote_identity_task_spliter.h index 5e11f10fa..89ee97bbe 100644 --- a/src/sql/executor/ob_remote_identity_task_spliter.h +++ b/src/sql/executor/ob_remote_identity_task_spliter.h @@ -21,7 +21,7 @@ namespace sql { class ObPhysicalPlan; class ObTaskInfo; class ObRemoteIdentityTaskSpliter : public ObTaskSpliter { - public: +public: ObRemoteIdentityTaskSpliter(); virtual ~ObRemoteIdentityTaskSpliter(); virtual int get_next_task(ObTaskInfo*& task); @@ -30,10 +30,10 @@ class ObRemoteIdentityTaskSpliter : public ObTaskSpliter { return ObTaskSpliter::REMOTE_IDENTITY_SPLIT; } - private: +private: ObTaskInfo* task_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRemoteIdentityTaskSpliter); }; } // namespace sql diff --git a/src/sql/executor/ob_remote_job_control.h b/src/sql/executor/ob_remote_job_control.h index 6c75a0218..b7564c09d 100644 --- a/src/sql/executor/ob_remote_job_control.h +++ b/src/sql/executor/ob_remote_job_control.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { class ObRemoteJobControl : public ObJobControl { - public: +public: explicit ObRemoteJobControl(); virtual ~ObRemoteJobControl(); virtual int get_ready_jobs(common::ObIArray& jobs, bool serial_schedule = false) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRemoteJobControl); }; } // namespace sql diff --git a/src/sql/executor/ob_remote_job_executor.h b/src/sql/executor/ob_remote_job_executor.h index 1a67cd84e..181213cbc 100644 --- a/src/sql/executor/ob_remote_job_executor.h +++ b/src/sql/executor/ob_remote_job_executor.h @@ -19,7 +19,7 @@ class ObJob; class ObTaskExecutor; class ObExecContext; class ObRemoteJobExecutor { - public: +public: ObRemoteJobExecutor(); virtual ~ObRemoteJobExecutor(); // set job waiting for schedule @@ -39,14 +39,14 @@ class ObRemoteJobExecutor { executor_ = NULL; } - private: +private: // disallow copy ObRemoteJobExecutor(const ObRemoteJobExecutor& other); ObRemoteJobExecutor& operator=(const ObRemoteJobExecutor& ohter); int get_executable_task(ObExecContext& ctx, ObTaskInfo*& task); - private: +private: ObJob* job_; ObTaskExecutor* executor_; }; diff --git a/src/sql/executor/ob_remote_scheduler.h b/src/sql/executor/ob_remote_scheduler.h index 0160c18c4..bf5fc2cd4 100644 --- a/src/sql/executor/ob_remote_scheduler.h +++ b/src/sql/executor/ob_remote_scheduler.h @@ -22,13 +22,13 @@ class ObPhysicalPlan; class ObExecContext; class ObRemoteTask; class ObRemoteScheduler { - public: +public: ObRemoteScheduler(); virtual ~ObRemoteScheduler(); int schedule(ObExecContext& ctx, ObPhysicalPlan* phy_plan); int async_execute_with_sql(ObExecContext& ctx, ObPhysicalPlan*); - private: +private: int execute_with_plan(ObExecContext& ctx, ObPhysicalPlan* phy_plan); int execute_with_sql(ObExecContext& ctx, ObPhysicalPlan* phy_plan); int build_remote_task(ObExecContext& ctx, ObRemoteTask& remote_task, const DependenyTableStore& dependency_tables); diff --git a/src/sql/executor/ob_remote_task_executor.h b/src/sql/executor/ob_remote_task_executor.h index 6fc08db11..b76f320ed 100644 --- a/src/sql/executor/ob_remote_task_executor.h +++ b/src/sql/executor/ob_remote_task_executor.h @@ -22,7 +22,7 @@ class ObExecContext; class ObTaskInfo; class ObTask; class ObRemoteTaskExecutor : public ObTaskExecutor { - public: +public: ObRemoteTaskExecutor(); virtual ~ObRemoteTaskExecutor(); virtual int execute(ObExecContext& query_ctx, ObJob* job, ObTaskInfo* task_info); @@ -31,10 +31,10 @@ class ObRemoteTaskExecutor : public ObTaskExecutor { ObTaskExecutor::reset(); } - private: +private: int build_task(ObExecContext& query_ctx, ObJob& job, ObTaskInfo& task_info, ObTask& task); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRemoteTaskExecutor); }; } // namespace sql diff --git a/src/sql/executor/ob_root_transmit.h b/src/sql/executor/ob_root_transmit.h index 26cc6b16a..6f3c7c10a 100644 --- a/src/sql/executor/ob_root_transmit.h +++ b/src/sql/executor/ob_root_transmit.h @@ -21,7 +21,7 @@ namespace sql { class ObRootTransmitInput : public ObTransmitInput { OB_UNIS_VERSION_V(1); - public: +public: ObRootTransmitInput() : ObTransmitInput() {} virtual ~ObRootTransmitInput() @@ -34,9 +34,9 @@ class ObRootTransmitInput : public ObTransmitInput { }; class ObRootTransmit : public ObTransmit { - private: +private: class ObRootTransmitCtx : public ObTransmitCtx { - public: + public: explicit ObRootTransmitCtx(ObExecContext& ctx) : ObTransmitCtx(ctx) {} ~ObRootTransmitCtx() @@ -47,12 +47,12 @@ class ObRootTransmit : public ObTransmit { } }; - public: +public: explicit ObRootTransmit(common::ObIAllocator& alloc); virtual ~ObRootTransmit(); virtual int process_expect_error(ObExecContext& ctx, int errcode) const; - private: +private: virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; virtual int init_op_ctx(ObExecContext& ctx) const; // disallow copy diff --git a/src/sql/executor/ob_scheduler_thread_ctx.h b/src/sql/executor/ob_scheduler_thread_ctx.h index 554da26be..41ce5cccb 100644 --- a/src/sql/executor/ob_scheduler_thread_ctx.h +++ b/src/sql/executor/ob_scheduler_thread_ctx.h @@ -20,7 +20,7 @@ namespace sql { class ObDistributedExecContext; class ObSchedulerThreadCtx { - public: +public: explicit ObSchedulerThreadCtx(ObIAllocator& allocator) : scheduler_retry_info_(), dis_exec_ctx_(NULL), @@ -91,7 +91,7 @@ class ObSchedulerThreadCtx { return is_build_index_plan_; } - private: +private: ObQueryRetryInfo scheduler_retry_info_; ObDistributedExecContext* dis_exec_ctx_; bool is_plain_select_stmt_; @@ -101,7 +101,7 @@ class ObSchedulerThreadCtx { common::ObFixedArray last_failed_partitions_; TransResult trans_result_; - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObSchedulerThreadCtx); diff --git a/src/sql/executor/ob_shuffle_service.h b/src/sql/executor/ob_shuffle_service.h index 596babac6..6308c293f 100644 --- a/src/sql/executor/ob_shuffle_service.h +++ b/src/sql/executor/ob_shuffle_service.h @@ -25,11 +25,11 @@ namespace sql { using namespace share::schema; class ObShuffleService { - public: +public: typedef common::hash::ObHashMap PartIdx2PartIdMap; typedef common::hash::ObHashMap SubPartIdx2SubPartIdMap; - public: +public: ObShuffleService(ObIAllocator& allocator) : allocator_(allocator), row_cache_(), @@ -97,7 +97,7 @@ class ObShuffleService { return ret; } - private: +private: int init_expr_ctx(ObExecContext& exec_ctx); int get_part_id(ObExecContext& exec_ctx, const share::schema::ObTableSchema& table_schema, const common::ObNewRow& row, const ObSqlExpression& part_func, @@ -123,10 +123,10 @@ class ObShuffleService { int get_hash_subpart_id(const common::ObNewRow& row, const int64_t subpart_num, common::ObIArray& subpart_ids, const SubPartIdx2SubPartIdMap& subpart_map); - public: +public: constexpr static int64_t NO_MATCH_PARTITION = -2; - private: +private: common::ObIAllocator& allocator_; common::ObNewRow row_cache_; int64_t current_cell_count_; diff --git a/src/sql/executor/ob_slice_calc.h b/src/sql/executor/ob_slice_calc.h index 5966a6f36..c1bd5399c 100644 --- a/src/sql/executor/ob_slice_calc.h +++ b/src/sql/executor/ob_slice_calc.h @@ -38,7 +38,7 @@ namespace sql { class ObRangeHashKeyGetter; class ObExecContext; class ObSliceIdxCalc { - public: +public: static const int64_t DEFAULT_CHANNEL_CNT = 64; static const int64_t DEFAULT_CHANNEL_IDX_TO_DROP_ROW = -2; typedef common::ObSEArray SliceIdxArray; @@ -51,7 +51,7 @@ class ObSliceIdxCalc { // get partition_if of the row of previous get_slice_indexes() call. virtual int get_previous_row_partition_id(ObObj& partition_id); - protected: +protected: virtual int get_slice_idx(const common::ObNewRow& row, int64_t& slice_idx) = 0; virtual int get_slice_idx(const ObIArray& exprs, ObEvalCtx& eval_ctx, int64_t& slice_idx) { @@ -67,12 +67,12 @@ class ObSliceIdxCalc { // For transmit which need send one row to more than one channel. (e.g.: broadcast) class ObMultiSliceIdxCalc : public ObSliceIdxCalc { - public: +public: ObMultiSliceIdxCalc(common::ObIAllocator& alloc) : ObSliceIdxCalc(alloc) {} virtual int get_slice_indexes(const common::ObNewRow& row, SliceIdxArray& slice_idx_array) = 0; - protected: +protected: virtual int get_slice_idx(const common::ObNewRow& row, int64_t& slice_idx) { UNUSED(row); @@ -83,18 +83,18 @@ class ObMultiSliceIdxCalc : public ObSliceIdxCalc { // for root dfo only. class ObAllToOneSliceIdxCalc : public ObSliceIdxCalc { - public: +public: ObAllToOneSliceIdxCalc(common::ObIAllocator& alloc) : ObSliceIdxCalc(alloc) {} virtual ~ObAllToOneSliceIdxCalc() = default; virtual int get_slice_idx(const common::ObNewRow& row, int64_t& slice_idx) override; virtual int get_slice_idx(const ObIArray& exprs, ObEvalCtx& eval_ctx, int64_t& slice_idx); - protected: +protected: }; class ObRepartSliceIdxCalc : virtual public ObSliceIdxCalc { - public: +public: ObRepartSliceIdxCalc(ObExecContext& exec_ctx, const share::schema::ObTableSchema& table_schema, const ObSqlExpression* repart_func, const ObSqlExpression* repart_sub_func, const ObIArray* repart_columns, @@ -175,14 +175,14 @@ class ObRepartSliceIdxCalc : virtual public ObSliceIdxCalc { int build_repart_ch_map(ObPxPartChMap& map); - private: +private: // this is a trick! // get part id from hashmap, implicate that only one level-1 part in the map virtual int get_part_id_by_one_level_sub_ch_map(int64_t& part_id); virtual int get_sub_part_id_by_one_level_first_ch_map(const int64_t part_id, int64_t& sub_part_id); int init_cache_map(hash::ObHashMap& map); - protected: +protected: ObExecContext& exec_ctx_; const share::schema::ObTableSchema& table_schema_; const ObSqlExpression* repart_func_; @@ -205,7 +205,7 @@ class ObRepartSliceIdxCalc : virtual public ObSliceIdxCalc { }; class ObSlaveMapRepartIdxCalcBase : public ObRepartSliceIdxCalc { - protected: +protected: ObSlaveMapRepartIdxCalcBase(ObExecContext& exec_ctx, const share::schema::ObTableSchema& table_schema, const ObSqlExpression* repart_func, const ObSqlExpression* repart_sub_func, const ObIArray* repart_columns, @@ -224,11 +224,11 @@ class ObSlaveMapRepartIdxCalcBase : public ObRepartSliceIdxCalc { {} ~ObSlaveMapRepartIdxCalcBase() = default; - protected: +protected: virtual int init() override; virtual int destroy() override; - protected: +protected: typedef common::ObSEArray TaskIdxArray; typedef common::hash::ObHashMap PartId2TaskIdxArrayMap; @@ -236,7 +236,7 @@ class ObSlaveMapRepartIdxCalcBase : public ObRepartSliceIdxCalc { }; class ObRepartRandomSliceIdxCalc : public ObSlaveMapRepartIdxCalcBase { - public: +public: ObRepartRandomSliceIdxCalc(ObExecContext& exec_ctx, const share::schema::ObTableSchema& table_schema, const ObSqlExpression* repart_func, const ObSqlExpression* repart_sub_func, const ObIArray* repart_columns, @@ -261,12 +261,12 @@ class ObRepartRandomSliceIdxCalc : public ObSlaveMapRepartIdxCalcBase { virtual int init() override; virtual int destroy() override; - private: +private: int get_task_idx_by_partition_id(int64_t partition_id, int64_t& task_idx); }; class ObAffinitizedRepartSliceIdxCalc : public ObRepartSliceIdxCalc { - public: +public: ObAffinitizedRepartSliceIdxCalc(ObExecContext& exec_ctx, const share::schema::ObTableSchema& table_schema, const ObSqlExpression* repart_func, const ObSqlExpression* repart_sub_func, const ObIArray* repart_columns, @@ -292,12 +292,12 @@ class ObAffinitizedRepartSliceIdxCalc : public ObRepartSliceIdxCalc { virtual int get_slice_idx(const ObIArray& exprs, ObEvalCtx& eval_ctx, int64_t& slice_idx) override; - private: +private: const int64_t task_count_; }; class ObSlaveMapBcastIdxCalc : virtual public ObRepartSliceIdxCalc { - public: +public: ObSlaveMapBcastIdxCalc(ObExecContext& exec_ctx, const share::schema::ObTableSchema& table_schema, const ObSqlExpression* repart_func, const ObSqlExpression* repart_sub_func, const ObIArray* repart_columns, @@ -312,12 +312,12 @@ class ObSlaveMapBcastIdxCalc : virtual public ObRepartSliceIdxCalc { virtual int get_slice_indexes(const common::ObNewRow& row, SliceIdxArray& slice_idx_array); - protected: +protected: const int64_t task_count_; }; class ObBc2HostSliceIdCalc : public ObMultiSliceIdxCalc { - public: +public: struct HostIndex { HostIndex() : begin_(0), end_(0), idx_(0) {} @@ -338,13 +338,13 @@ class ObBc2HostSliceIdCalc : public ObMultiSliceIdxCalc { virtual int get_slice_indexes(const common::ObNewRow& row, SliceIdxArray& slice_idx_array) override; virtual int get_slice_indexes(const ObIArray& exprs, ObEvalCtx& eval_ctx, SliceIdxArray& slice_idx_array); - private: +private: const ChannelIdxArray& channel_idx_; const HostIdxArray& host_idx_; }; class ObRandomSliceIdCalc : public ObSliceIdxCalc { - public: +public: ObRandomSliceIdCalc(common::ObIAllocator& alloc, const uint64_t slice_cnt) : ObSliceIdxCalc(alloc), idx_(0), slice_cnt_(slice_cnt) {} @@ -352,13 +352,13 @@ class ObRandomSliceIdCalc : public ObSliceIdxCalc { virtual int get_slice_idx(const common::ObNewRow& row, int64_t& slice_idx) override; virtual int get_slice_idx(const ObIArray& exprs, ObEvalCtx& eval_ctx, int64_t& slice_idx) override; - private: +private: uint64_t idx_; uint64_t slice_cnt_; }; class ObBroadcastSliceIdCalc : public ObMultiSliceIdxCalc { - public: +public: ObBroadcastSliceIdCalc(common::ObIAllocator& alloc, uint64_t slice_cnt) : ObMultiSliceIdxCalc(alloc), slice_cnt_(slice_cnt) {} @@ -366,12 +366,12 @@ class ObBroadcastSliceIdCalc : public ObMultiSliceIdxCalc { virtual int get_slice_indexes(const common::ObNewRow& row, SliceIdxArray& slice_idx_array) override; virtual int get_slice_indexes(const ObIArray& exprs, ObEvalCtx& eval_ctx, SliceIdxArray& slice_idx_array); - private: +private: uint64_t slice_cnt_; }; class ObHashSliceIdCalc : virtual public ObSliceIdxCalc { - public: +public: ObHashSliceIdCalc(ObIAllocator& alloc, common::ObExprCtx& expr_ctx, const common::ObIArray& hash_dist_columns, const common::ObIArray& dist_exprs, const int64_t task_cnt) @@ -416,7 +416,7 @@ class ObHashSliceIdCalc : virtual public ObSliceIdxCalc { }; class ObSlaveMapPkeyHashIdxCalc : public ObSlaveMapRepartIdxCalcBase, public ObHashSliceIdCalc { - public: +public: ObSlaveMapPkeyHashIdxCalc(ObExecContext& exec_ctx, const share::schema::ObTableSchema& table_schema, const ObSqlExpression* repart_func, const ObSqlExpression* repart_sub_func, const ObIArray* repart_columns, @@ -451,13 +451,13 @@ class ObSlaveMapPkeyHashIdxCalc : public ObSlaveMapRepartIdxCalcBase, public ObH // for static engine virtual int get_slice_idx(const ObIArray& exprs, ObEvalCtx& eval_ctx, int64_t& slice_idx) override; - private: +private: virtual int get_part_id_by_one_level_sub_ch_map(int64_t& part_id) override; virtual int get_sub_part_id_by_one_level_first_ch_map(const int64_t part_id, int64_t& sub_part_id) override; int get_task_idx_by_partition_id(ObEvalCtx& eval_ctx, int64_t partition_id, int64_t& task_idx); int build_affi_hash_map(hash::ObHashMap& affi_hash_map); - private: +private: hash::ObHashMap affi_hash_map_; }; diff --git a/src/sql/executor/ob_slice_id.h b/src/sql/executor/ob_slice_id.h index 6862082df..e45801068 100644 --- a/src/sql/executor/ob_slice_id.h +++ b/src/sql/executor/ob_slice_id.h @@ -24,7 +24,7 @@ namespace sql { class ObSliceID final { OB_UNIS_VERSION(1); - public: +public: ObSliceID() : ob_task_id_(), slice_id_(common::OB_INVALID_ID){}; inline void set_ob_task_id(const ObTaskID& ob_task_id) @@ -109,7 +109,7 @@ class ObSliceID final { TO_STRING_KV(N_OB_TASK_ID, ob_task_id_, N_SLICE_ID, slice_id_); - private: +private: /* variables */ ObTaskID ob_task_id_; uint64_t slice_id_; diff --git a/src/sql/executor/ob_sql_execution_id_map.cpp b/src/sql/executor/ob_sql_execution_id_map.cpp index 7a5e4d522..66069ee2d 100644 --- a/src/sql/executor/ob_sql_execution_id_map.cpp +++ b/src/sql/executor/ob_sql_execution_id_map.cpp @@ -20,7 +20,7 @@ namespace sql { using namespace common; struct OuterMapOp { - public: +public: OuterMapOp(const FetchMod fetch_mod) : scheduler_(NULL), fetch_mod_(fetch_mod) {} diff --git a/src/sql/executor/ob_sql_execution_id_map.h b/src/sql/executor/ob_sql_execution_id_map.h index 7632551ad..19946bb41 100644 --- a/src/sql/executor/ob_sql_execution_id_map.h +++ b/src/sql/executor/ob_sql_execution_id_map.h @@ -22,7 +22,7 @@ namespace sql { class ObDistributedScheduler; class ObSqlExecutionIDMap { - public: +public: static const uint64_t OUTER_ID_BASE = UINT64_MAX / 4; static const int64_t EXECUTION_ID_TSI_HOLD_NUM = 4096; @@ -59,7 +59,7 @@ class ObSqlExecutionIDMap { } } - private: +private: bool inited_; common::ObIDMap inner_id_map_; common::hash::ObHashMap > outer_id_map_; diff --git a/src/sql/executor/ob_sql_scheduler.h b/src/sql/executor/ob_sql_scheduler.h index 36e2230ac..52d8cab1b 100644 --- a/src/sql/executor/ob_sql_scheduler.h +++ b/src/sql/executor/ob_sql_scheduler.h @@ -20,7 +20,7 @@ namespace sql { class ObPhysicalPlan; class ObExecContext; class ObSqlScheduler { - public: +public: ObSqlScheduler() {} virtual ~ObSqlScheduler() @@ -28,7 +28,7 @@ class ObSqlScheduler { virtual int schedule(ObExecContext& ctx, ObPhysicalPlan* phy_plan) = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlScheduler); }; /* end class */ diff --git a/src/sql/executor/ob_task.h b/src/sql/executor/ob_task.h index 24dfde05c..5d534a9f8 100644 --- a/src/sql/executor/ob_task.h +++ b/src/sql/executor/ob_task.h @@ -36,7 +36,7 @@ class ObOpSpec; class ObTask { OB_UNIS_VERSION_V(1); - public: +public: ObTask(); virtual ~ObTask(); void set_ob_task_id(const ObTaskID& ob_task_id) @@ -139,12 +139,12 @@ class ObTask { N_OB_TASK_ID, ob_task_id_, K_(runner_svr), K_(ctrl_svr), K_(partition_keys), K_(ranges), K_(location_idx)); DECLARE_TO_YSON_KV; - protected: +protected: int serialize_tree(char* buf, int64_t buf_len, int64_t& pos, const ObPhyOperator& root) const; int deserialize_tree(const char* buf, int64_t data_len, int64_t& pos, ObPhysicalPlan& phy_plan, ObPhyOperator*& root); int64_t get_tree_serialize_size(const ObPhyOperator& root) const; - protected: +protected: ObExecContext* exec_ctx_; const ObPhysicalPlan* ser_phy_plan_; ObPhysicalPlan* des_phy_plan_; @@ -190,7 +190,7 @@ inline void ObTask::set_deserialize_param(ObExecContext& exec_ctx, ObPhysicalPla class ObMiniTask : public ObTask { OB_UNIS_VERSION_V(1); - public: +public: ObMiniTask() : ObTask(), extend_root_(NULL), extend_root_spec_(NULL) {} ~ObMiniTask() @@ -217,7 +217,7 @@ class ObMiniTask : public ObTask { TO_STRING_KV(K_(ob_task_id), K_(runner_svr), K_(ctrl_svr), K_(partition_keys), K_(ranges), K_(location_idx), KPC_(extend_root), KP_(extend_root_spec)); - private: +private: // For mini tasks, it is allowed to execute an extended plan when the main plan is executed, // this is mainly used to obtain the primary key of the conflict row of the unique index when // the conflict is checked. you can also bring back other column information of the conflicting @@ -229,12 +229,12 @@ class ObMiniTask : public ObTask { class ObPingSqlTask { OB_UNIS_VERSION_V(1); - public: +public: ObPingSqlTask(); virtual ~ObPingSqlTask(); TO_STRING_KV(K(trans_id_), K(sql_no_), K(task_id_), K(exec_svr_), K(part_keys_), K(cur_status_)); - public: +public: transaction::ObTransID trans_id_; uint64_t sql_no_; ObTaskID task_id_; @@ -246,12 +246,12 @@ class ObPingSqlTask { class ObPingSqlTaskResult { OB_UNIS_VERSION_V(1); - public: +public: ObPingSqlTaskResult(); virtual ~ObPingSqlTaskResult(); TO_STRING_KV(K(err_code_), K(ret_status_)); - public: +public: int err_code_; int64_t ret_status_; }; @@ -260,7 +260,7 @@ class ObDesExecContext; class ObRemoteTask : public obrpc::ObIFill { OB_UNIS_VERSION(1); - public: +public: ObRemoteTask() : tenant_schema_version_(-1), sys_schema_version_(-1), @@ -346,7 +346,7 @@ class ObRemoteTask : public obrpc::ObIFill { KPC_(remote_sql_info)); DECLARE_TO_YSON_KV; - private: +private: int64_t tenant_schema_version_; int64_t sys_schema_version_; common::ObAddr runner_svr_; diff --git a/src/sql/executor/ob_task_control.h b/src/sql/executor/ob_task_control.h index 71a83f227..26acef518 100644 --- a/src/sql/executor/ob_task_control.h +++ b/src/sql/executor/ob_task_control.h @@ -23,7 +23,7 @@ class ObAddrsProvider; class ObTaskEvent; class ObTaskResult { - public: +public: ObTaskResult() : slice_events_(NULL) {} virtual ~ObTaskResult() @@ -58,14 +58,14 @@ class ObTaskResult { TO_STRING_KV(K_(task_location), K_(slice_events)); - protected: +protected: ObTaskLocation task_location_; const common::ObIArray* slice_events_; }; // Base class of all kinds of job control class ObTaskControl { - public: +public: ObTaskControl(); virtual ~ObTaskControl(); int init_finish_queue(int64_t dop); @@ -121,7 +121,7 @@ class ObTaskControl { } TO_STRING_KV("tasks", tasks_); - private: +private: int get_task_by_state(common::ObIArray& tasks, int state) const; inline void* id_to_ptr(uint64_t id) { @@ -135,7 +135,7 @@ class ObTaskControl { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObTaskControl); - private: +private: common::ObSEArray tasks_; // bool is_scan_job_; bool is_root_job_; diff --git a/src/sql/executor/ob_task_event.h b/src/sql/executor/ob_task_event.h index 2ff7378be..0825569db 100644 --- a/src/sql/executor/ob_task_event.h +++ b/src/sql/executor/ob_task_event.h @@ -36,7 +36,7 @@ class ObEvalCtx; class ObTaskSmallResult { OB_UNIS_VERSION(1); - public: +public: const static int64_t MAX_DATA_BUF_LEN = 8 * 1024L; ObTaskSmallResult(); @@ -117,7 +117,7 @@ class ObTaskSmallResult { TO_STRING_KV(K_(has_data), K_(data_len), K_(affected_rows), K_(found_rows), K_(last_insert_id), K_(matched_rows), K_(duplicated_rows)); - private: +private: bool has_data_; int64_t data_len_; char data_buf_[MAX_DATA_BUF_LEN]; @@ -127,7 +127,7 @@ class ObTaskSmallResult { int64_t matched_rows_; int64_t duplicated_rows_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTaskSmallResult); }; @@ -142,7 +142,7 @@ enum ObShuffleType { class ObShuffleKey final { OB_UNIS_VERSION(1); - public: +public: ObShuffleKey() : type_(ST_NONE) {} void reset() @@ -175,7 +175,7 @@ class ObShuffleKey final { int set_sub_shuffle_type(const share::schema::ObTableSchema& table_schema); DECLARE_TO_STRING; - private: +private: ObShuffleType type_; common::ObObj values_[2]; static const int64_t HASH_IDX; @@ -187,7 +187,7 @@ class ObShuffleKey final { class ObShuffleKeys final { OB_UNIS_VERSION(1); - public: +public: ObShuffleKeys() : part_key_(), subpart_key_() {} void reset(); @@ -195,7 +195,7 @@ class ObShuffleKeys final { int compare(const ObShuffleKeys& other, bool cmp_part, bool cmp_subpart, int& cmp) const; TO_STRING_KV(K_(part_key), K_(subpart_key)); - public: +public: ObShuffleKey part_key_; ObShuffleKey subpart_key_; }; @@ -203,7 +203,7 @@ class ObShuffleKeys final { class ObSliceEvent final { OB_UNIS_VERSION(1); - public: +public: ObSliceEvent() : ob_slice_id_(), shuffle_keys_(), shuffle_partition_key_(), small_result_() {} @@ -289,20 +289,20 @@ class ObSliceEvent final { TO_STRING_KV(K_(ob_slice_id), K_(shuffle_keys), K_(shuffle_partition_key), K_(small_result)); - private: +private: ObSliceID ob_slice_id_; ObShuffleKeys shuffle_keys_; common::ObPartitionKey shuffle_partition_key_; ObTaskSmallResult small_result_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSliceEvent); }; class ObTaskEvent { OB_UNIS_VERSION(1); - public: +public: ObTaskEvent(); virtual ~ObTaskEvent(); @@ -351,7 +351,7 @@ class ObTaskEvent { } TO_STRING_KV("task_loc", task_loc_, "err_code", err_code_, "inited", inited_, K_(slice_events)); - protected: +protected: ObTaskLocation task_loc_; int64_t err_code_; bool inited_; @@ -360,14 +360,14 @@ class ObTaskEvent { int64_t ts_task_recv_done_; int64_t ts_result_send_begin_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTaskEvent); }; class ObTaskCompleteEvent : public ObTaskEvent { OB_UNIS_VERSION(1); - public: +public: ObTaskCompleteEvent() : ObTaskEvent(), extend_info_(), trans_result_(){}; virtual ~ObTaskCompleteEvent(){}; @@ -400,19 +400,19 @@ class ObTaskCompleteEvent : public ObTaskEvent { return trans_result_; } - protected: +protected: common::ObString extend_info_; TransResult trans_result_; common::ObSEArray implicit_cursors_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTaskCompleteEvent); }; class ObTaskResultBuf { OB_UNIS_VERSION_V(1); - public: +public: ObTaskResultBuf() {} virtual ~ObTaskResultBuf() @@ -441,7 +441,7 @@ class ObTaskResultBuf { } TO_STRING_KV(K_(task_location), K_(slice_events_buf)); - protected: +protected: ObTaskLocation task_location_; common::ObSEArray slice_events_buf_; }; @@ -449,7 +449,7 @@ class ObTaskResultBuf { class ObMiniTaskResult { OB_UNIS_VERSION(1); - public: +public: ObMiniTaskResult(bool use_compact_row = true) : task_result_(common::ObModIds::OB_NEW_SCANNER, nullptr, common::ObScanner::DEFAULT_MAX_SERIALIZE_SIZE, common::OB_SERVER_TENANT_ID, use_compact_row), @@ -509,7 +509,7 @@ class ObMiniTaskResult { } TO_STRING_KV(K_(task_result), K_(extend_result)); - private: +private: common::ObScanner task_result_; // mini task can taek a sub plan to get the rowkey of conflict rows caused by unique index, // extend_result_ will store these rowkeys as result, to reduce rpc times. @@ -517,7 +517,7 @@ class ObMiniTaskResult { }; class ObMiniTaskEvent { - public: +public: ObMiniTaskEvent(const common::ObAddr& task_addr, int64_t task_id, int32_t ret_code) : task_addr_(task_addr), task_id_(task_id), ret_code_(ret_code), task_result_(false) {} @@ -554,7 +554,7 @@ class ObMiniTaskEvent { } TO_STRING_KV(K_(task_addr), K_(task_id), K_(ret_code)); - private: +private: const ObAddr task_addr_; // debug purpose when minitask async call fail int64_t task_id_; int32_t ret_code_; @@ -562,7 +562,7 @@ class ObMiniTaskEvent { }; class ObMiniTaskRetryInfo { - public: +public: ObMiniTaskRetryInfo() : need_retry_(true), failed_task_lists_(), @@ -632,7 +632,7 @@ class ObMiniTaskRetryInfo { TO_STRING_KV(K_(need_retry), K_(failed_task_lists), K_(retry_ret), K_(retry_times), K_(retry_execution), K_(retry_by_single_range)); - private: +private: bool need_retry_; // pair common::ObSEArray, 16> failed_task_lists_; @@ -642,14 +642,14 @@ class ObMiniTaskRetryInfo { bool retry_by_single_range_; common::ObSEArray not_master_tasks_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMiniTaskRetryInfo); }; class ObRemoteResult : public obrpc::ObIFill { OB_UNIS_VERSION(1); - public: +public: ObRemoteResult() : task_id_(), result_(), has_more_(false) {} int init() @@ -691,7 +691,7 @@ class ObRemoteResult : public obrpc::ObIFill { } TO_STRING_KV(K_(task_id), K_(result), K_(has_more)); - private: +private: ObTaskID task_id_; common::ObScanner result_; bool has_more_; diff --git a/src/sql/executor/ob_task_executor.h b/src/sql/executor/ob_task_executor.h index d6d2cab55..16df7f556 100644 --- a/src/sql/executor/ob_task_executor.h +++ b/src/sql/executor/ob_task_executor.h @@ -20,18 +20,18 @@ class ObJob; class ObTaskInfo; class ObExecContext; class ObTaskExecutor { - public: +public: ObTaskExecutor(); virtual ~ObTaskExecutor(); virtual int execute(ObExecContext& query_ctx, ObJob* job, ObTaskInfo* task_info) = 0; inline virtual void reset() {} - protected: +protected: int build_task_op_input(ObExecContext& query_ctx, ObTaskInfo& task_info, const ObPhyOperator& root_op); int should_skip_failed_tasks(ObTaskInfo& task_info, bool& skip_failed_tasks) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTaskExecutor); }; } // namespace sql diff --git a/src/sql/executor/ob_task_executor_ctx.h b/src/sql/executor/ob_task_executor_ctx.h index 9fb3977b9..c76eb3430 100644 --- a/src/sql/executor/ob_task_executor_ctx.h +++ b/src/sql/executor/ob_task_executor_ctx.h @@ -45,9 +45,9 @@ class ObExecContext; class ObTaskExecutorCtx { OB_UNIS_VERSION(1); - public: +public: class CalcVirtualPartitionIdParams { - public: + public: CalcVirtualPartitionIdParams() : inited_(false), ref_table_id_(common::OB_INVALID_ID) {} ~CalcVirtualPartitionIdParams() @@ -70,7 +70,7 @@ class ObTaskExecutorCtx { TO_STRING_KV(K_(inited), K_(ref_table_id)); - private: + private: bool inited_; uint64_t ref_table_id_; }; @@ -253,10 +253,10 @@ class ObTaskExecutorCtx { } // alias int append_table_locations_no_dup(const ObTablePartitionInfoArray& table_partition_infos); - private: +private: int is_valid_addr(uint64_t ref_table_id, const common::ObAddr& addr, bool& is_valid) const; - private: +private: // BEGIN local variables RemoteExecuteStreamHandle* task_resp_handler_; ObExecuteResult execute_result_; @@ -279,7 +279,7 @@ class ObTaskExecutorCtx { int64_t sys_job_id_; - public: +public: // BEGIN global singleton share::ObIPartitionLocationCache* partition_location_cache_; ObExecutorRpcImpl* task_executor_rpc_; @@ -297,7 +297,7 @@ class ObTaskExecutorCtx { class ObExecutorRpcImpl; class ObTaskExecutorCtxUtil { - public: +public: static int get_stream_handler(ObExecContext& ctx, RemoteExecuteStreamHandle*& handler); static int get_task_executor_rpc(ObExecContext& ctx, ObExecutorRpcImpl*& rpc); static int get_phy_table_location(ObExecContext& ctx, uint64_t table_location_key, uint64_t ref_table_id, diff --git a/src/sql/executor/ob_task_id.h b/src/sql/executor/ob_task_id.h index e82a16867..4f35b3c9f 100644 --- a/src/sql/executor/ob_task_id.h +++ b/src/sql/executor/ob_task_id.h @@ -22,7 +22,7 @@ namespace sql { class ObTaskID final { OB_UNIS_VERSION(1); - public: +public: ObTaskID(const ObJobID& ob_job_id, uint64_t task_id) : ob_job_id_(ob_job_id), task_id_(task_id), task_cnt_(0) {} ObTaskID() : ob_job_id_(), task_id_(common::OB_INVALID_ID), task_cnt_(0) @@ -131,7 +131,7 @@ class ObTaskID final { TO_STRING_KV(N_OB_JOB_ID, ob_job_id_, N_TASK_ID, task_id_, K_(task_cnt)); TO_YSON_KV(OB_ID(job_id), ob_job_id_, OB_ID(task_id), task_id_); - private: +private: /* variables */ ObJobID ob_job_id_; uint64_t task_id_; diff --git a/src/sql/executor/ob_task_info.h b/src/sql/executor/ob_task_info.h index 128c3739a..2a7ae35a7 100644 --- a/src/sql/executor/ob_task_info.h +++ b/src/sql/executor/ob_task_info.h @@ -80,14 +80,14 @@ enum ObTaskState { class ObPhyOperator; class ObGranuleTaskInfo { - public: +public: ObGranuleTaskInfo() : ranges_(), partition_id_(-1), task_id_(0) {} virtual ~ObGranuleTaskInfo() {} TO_STRING_KV(K_(ranges), K_(partition_id), K_(task_id)); - public: +public: common::ObSEArray ranges_; // idx, part_locs in obtaskinfo's ObPartLoc // also represent the partition @@ -98,7 +98,7 @@ class ObGranuleTaskInfo { // for NLJ partition pruning class ObGIPruningInfo { - public: +public: ObGIPruningInfo() : part_id_(common::OB_INVALID_ID) {} @@ -111,16 +111,16 @@ class ObGIPruningInfo { part_id_ = part_id; } - private: +private: int64_t part_id_; }; typedef common::hash::ObHashMap GIPrepareTaskMap; class ObTaskInfo { - public: +public: class ObPartLoc { - public: + public: ObPartLoc() : partition_key_(), depend_table_keys_(common::ObModIds::OB_SQL_EXECUTOR_TASK_INFO, OB_MALLOC_NORMAL_BLOCK_SIZE), @@ -160,7 +160,7 @@ class ObTaskInfo { ObChunkDatumStore* datum_store_; }; class ObRangeLocation { - public: + public: ObRangeLocation() : inner_alloc_("RangeLocation"), part_locs_(&inner_alloc_) {} explicit ObRangeLocation(common::ObIAllocator& allocator) : part_locs_(allocator), server_() @@ -192,7 +192,7 @@ class ObTaskInfo { common::ObAddr server_; }; - public: +public: explicit ObTaskInfo(common::ObIAllocator& allocator); virtual ~ObTaskInfo(); void set_root_op(ObPhyOperator* root_op) @@ -362,11 +362,11 @@ class ObTaskInfo { TO_STRING_KV(N_TASK_LOC, task_location_, K_(range_location), K_(location_idx), K_(location_idx_list), K_(state), K_(child_task_results), K_(slice_count_pos), K_(background), K_(retry_times), K_(location_idx_list)); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObTaskInfo); - private: +private: ObRangeLocation range_location_; int64_t task_split_type_; @@ -389,7 +389,7 @@ class ObTaskInfo { int32_t retry_times_; - private: +private: int64_t ts_task_send_begin_; int64_t ts_task_recv_done_; int64_t ts_result_send_begin_; diff --git a/src/sql/executor/ob_task_location.h b/src/sql/executor/ob_task_location.h index d650af694..f7a2c92d3 100644 --- a/src/sql/executor/ob_task_location.h +++ b/src/sql/executor/ob_task_location.h @@ -20,7 +20,7 @@ namespace sql { class ObTaskLocation final { OB_UNIS_VERSION(1); - public: +public: ObTaskLocation(const common::ObAddr& server, const ObTaskID& ob_task_id); ObTaskLocation(); @@ -97,7 +97,7 @@ class ObTaskLocation final { } TO_STRING_KV(N_SERVER, server_, N_OB_TASK_ID, ob_task_id_); - private: +private: common::ObAddr server_; // immediate result server address ObTaskID ob_task_id_; }; diff --git a/src/sql/executor/ob_task_runner_notifier.h b/src/sql/executor/ob_task_runner_notifier.h index b3c8c55e3..04486184a 100644 --- a/src/sql/executor/ob_task_runner_notifier.h +++ b/src/sql/executor/ob_task_runner_notifier.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObTaskRunnerNotifier { - public: +public: ObTaskRunnerNotifier(ObSQLSessionInfo* session, ObSQLSessionMgr* mgr) : session_(session), mgr_(mgr) {} @@ -37,11 +37,11 @@ class ObTaskRunnerNotifier { return ret; } - private: +private: ObSQLSessionInfo* session_; ObSQLSessionMgr* mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTaskRunnerNotifier); }; } // namespace sql diff --git a/src/sql/executor/ob_task_runner_notifier_service.h b/src/sql/executor/ob_task_runner_notifier_service.h index 97631d34f..76826b3e4 100644 --- a/src/sql/executor/ob_task_runner_notifier_service.h +++ b/src/sql/executor/ob_task_runner_notifier_service.h @@ -24,9 +24,9 @@ namespace sql { class ObTask; class ObTaskInfo; class ObTaskRunnerNotifierService { - public: +public: class ObKillTaskRunnerNotifier { - public: + public: ObKillTaskRunnerNotifier() : ret_(common::OB_ERR_UNEXPECTED) {} virtual ~ObKillTaskRunnerNotifier() @@ -37,19 +37,19 @@ class ObTaskRunnerNotifierService { return ret_; } - private: + private: int ret_; - private: + private: DISALLOW_COPY_AND_ASSIGN(ObKillTaskRunnerNotifier); }; class Guard { - public: + public: Guard(const ObTaskID& task_id, ObTaskRunnerNotifier* notifier); ~Guard(); - private: + private: const ObTaskID task_id_; }; @@ -65,7 +65,7 @@ class ObTaskRunnerNotifierService { void reset(); int init(); - private: +private: static const int64_t NOTIFIER_MAP_BUCKET_SIZE = 1024; static ObTaskRunnerNotifierService* instance_; @@ -78,7 +78,7 @@ class ObTaskRunnerNotifierService { bool inited_; common::hash::ObHashMap notifier_map_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTaskRunnerNotifierService); }; diff --git a/src/sql/executor/ob_task_spliter.h b/src/sql/executor/ob_task_spliter.h index 172ab5278..f42eb9dbe 100644 --- a/src/sql/executor/ob_task_spliter.h +++ b/src/sql/executor/ob_task_spliter.h @@ -39,7 +39,7 @@ class ObTableModify; #define ENG_OP typename ObEngineOpTraits class ObTaskSpliter { - public: +public: enum TaskSplitType { INVALID_SPLIT = 0, LOCAL_IDENTITY_SPLIT = 1, // root(local) transmit task splitter @@ -52,7 +52,7 @@ class ObTaskSpliter { DETERMINATE_TASK_SPLIT = 8 // tasks are splited already }; - public: +public: ObTaskSpliter(); virtual ~ObTaskSpliter(); int init(ObPhysicalPlanCtx* plan_ctx, ObExecContext* exec_ctx, ObJob& job, common::ObIAllocator& allocator); @@ -76,7 +76,7 @@ class ObTaskSpliter { return NULL != job_; } - protected: +protected: int create_task_info(ObTaskInfo*& task); template @@ -89,7 +89,7 @@ class ObTaskSpliter { static int find_all_table_location_keys_inner( common::ObIArray& table_location_keys, const ENG_OP::Root& op); - protected: +protected: common::ObAddr server_; ObPhysicalPlanCtx* plan_ctx_; ObExecContext* exec_ctx_; diff --git a/src/sql/executor/ob_task_spliter_factory.h b/src/sql/executor/ob_task_spliter_factory.h index 72c1167fb..add94da5d 100644 --- a/src/sql/executor/ob_task_spliter_factory.h +++ b/src/sql/executor/ob_task_spliter_factory.h @@ -22,16 +22,16 @@ class ObIAllocator; } namespace sql { class ObTaskSpliterFactory { - public: +public: ObTaskSpliterFactory(); virtual ~ObTaskSpliterFactory(); void reset(); int create(ObExecContext& exec_ctx, ObJob& job, int spliter_type, ObTaskSpliter*& spliter); - private: +private: common::ObSEArray store_; - private: +private: /* variables */ DISALLOW_COPY_AND_ASSIGN(ObTaskSpliterFactory); }; diff --git a/src/sql/executor/ob_trans_result_collector.h b/src/sql/executor/ob_trans_result_collector.h index e36f377ef..ac7c0037c 100644 --- a/src/sql/executor/ob_trans_result_collector.h +++ b/src/sql/executor/ob_trans_result_collector.h @@ -42,14 +42,14 @@ enum ObTaskStatus { }; class ObReporter { - public: +public: ObReporter(); ObReporter(const ObTaskID& task_id); virtual ~ObReporter(); bool operator==(const ObReporter& rv) const; int assign(const ObReporter& rv); - public: +public: void set_task_id(const ObTaskID& task_id); void set_exec_svr(const common::ObAddr& exec_svr); void set_status(ObTaskStatus status); @@ -77,7 +77,7 @@ class ObReporter { } TO_STRING_KV(K(task_id_), K(exec_svr_), K(part_keys_), K(status_)); - private: +private: // const attributes. ObTaskID task_id_; common::ObAddr exec_svr_; @@ -86,7 +86,7 @@ class ObReporter { ObTaskStatus status_; common::ObSpinLock lock_; - private: +private: static const int64_t TTL_THRESHOLD = 5; }; @@ -95,7 +95,7 @@ typedef common::Ob2DArray ObRep class ObDistributedSchedulerManager; class ObAPMiniTaskMgr; class ObTransResultCollector { - public: +public: ObTransResultCollector() : trans_result_(NULL), err_code_(OB_SUCCESS), @@ -111,7 +111,7 @@ class ObTransResultCollector { virtual ~ObTransResultCollector() {} - public: +public: int init(ObSQLSessionInfo& session, ObExecutorRpcImpl* exec_rpc, ObDistributedSchedulerManager* dist_task_mgr, ObAPMiniTaskMgr* mini_task_mgr); int wait_all_task(int64_t timeout, const bool is_build_index = false); @@ -125,13 +125,13 @@ class ObTransResultCollector { int recv_result(const ObTaskID& task_id, const TransResult& trans_result); int set_task_status(const ObTaskID& task_id, ObTaskStatus status); - private: +private: int set_task_info(const ObTaskInfo& task_info, ObTaskStatus status); int get_reporter(const ObTaskID& task_id, bool allow_exist, ObReporter*& reporter); int ping_reporter(ObReporter& reporter); void wait_reporter_event(int64_t wait_timeout); - private: +private: TransResult* trans_result_; int err_code_; common::ObSpinLock lock_; @@ -145,7 +145,7 @@ class ObTransResultCollector { ObReporterArray reporters_; obrpc::SingleWaitCond reporter_cond_; - private: +private: static const int64_t TTL_THRESHOLD = 5; static const int64_t WAIT_ONCE_TIME = 500000; // 500ms. }; diff --git a/src/sql/executor/ob_transmit.h b/src/sql/executor/ob_transmit.h index cdb5e58c7..bbf5d9a3d 100644 --- a/src/sql/executor/ob_transmit.h +++ b/src/sql/executor/ob_transmit.h @@ -27,7 +27,7 @@ class ObJob; class ObTransmitInput : public ObIPhyOperatorInput { OB_UNIS_VERSION_V(1); - public: +public: ObTransmitInput() : ObIPhyOperatorInput(), job_(NULL) {} virtual ~ObTransmitInput() @@ -43,7 +43,7 @@ class ObTransmitInput : public ObIPhyOperatorInput { return job_; } - private: +private: ObJob* job_; }; @@ -52,7 +52,7 @@ typedef common::ObColumnInfo ObTransmitRepartColumn; struct ObHashColumn : public common::ObColumnInfo { OB_UNIS_VERSION_V(1); - public: +public: ObHashColumn() : expr_idx_(OB_INVALID_INDEX), cmp_type_(common::ObNullType) {} @@ -65,11 +65,11 @@ struct ObHashColumn : public common::ObColumnInfo { class ObTransmit : public ObSingleChildPhyOperator { OB_UNIS_VERSION_V(1); - protected: +protected: class ObTransmitCtx : public ObPhyOperatorCtx { friend class ObTransmit; - public: + public: explicit ObTransmitCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual ~ObTransmitCtx() @@ -80,7 +80,7 @@ class ObTransmit : public ObSingleChildPhyOperator { } }; - public: +public: explicit ObTransmit(common::ObIAllocator& alloc); virtual ~ObTransmit(); // virtual int close(ObExecContext &ctx) const; @@ -207,12 +207,12 @@ class ObTransmit : public ObSingleChildPhyOperator { return SlaveMappingType::SM_NONE != slave_mapping_type_; } - protected: +protected: virtual int inner_get_next_row(ObExecContext& ctx, const common::ObNewRow*& row) const; virtual int inner_open(ObExecContext& ctx) const; virtual int64_t to_string_kv(char* buf, const int64_t buf_len) const override; - protected: +protected: inline bool is_repart_exchange() const { return OB_REPARTITION_NO_REPARTITION != repartition_type_; @@ -222,7 +222,7 @@ class ObTransmit : public ObSingleChildPhyOperator { return OB_REPARTITION_NO_REPARTITION == repartition_type_; } // more goes here - protected: +protected: int64_t split_task_count_; int64_t parallel_server_count_; int64_t server_parallel_thread_count_; @@ -250,7 +250,7 @@ class ObTransmit : public ObSingleChildPhyOperator { bool has_lgi_; int partition_id_idx_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObTransmit); }; diff --git a/src/sql/monitor/ob_exec_stat.h b/src/sql/monitor/ob_exec_stat.h index 27763d80b..7f5a4a81e 100644 --- a/src/sql/monitor/ob_exec_stat.h +++ b/src/sql/monitor/ob_exec_stat.h @@ -248,7 +248,7 @@ struct ObExecTimestamp { }; class ObSchedInfo { - public: +public: ObSchedInfo() : sched_info_(NULL), sched_info_len_(0) {} void reset() @@ -291,7 +291,7 @@ class ObSchedInfo { return sched_info_len_; } - private: +private: char* sched_info_; int64_t sched_info_len_; }; diff --git a/src/sql/monitor/ob_exec_stat_collector.h b/src/sql/monitor/ob_exec_stat_collector.h index 4b6f261d8..1463bbcca 100644 --- a/src/sql/monitor/ob_exec_stat_collector.h +++ b/src/sql/monitor/ob_exec_stat_collector.h @@ -31,7 +31,7 @@ class ObSql; class ObPhysicalPlan; class ObSQLSessionInfo; class ObExecStatCollector { - public: +public: ObExecStatCollector() : length_(0) {} ~ObExecStatCollector() @@ -43,7 +43,7 @@ class ObExecStatCollector { int get_extend_info(common::ObIAllocator& allocator, common::ObString& str); void reset(); - private: +private: template int add_stat(const T* value); @@ -55,25 +55,25 @@ class ObExecStatCollector { }; class ObExecStatDispatch { - public: +public: ObExecStatDispatch() : stat_str_(), pos_(0){}; ~ObExecStatDispatch(){}; int set_extend_info(const common::ObString& str); int dispatch(bool need_add_monitor, ObPhyPlanMonitorInfo* monitor_info, bool need_update_plan, ObPhysicalPlan* plan); - private: +private: int get_next_type(StatType& type); template int get_value(T* value); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExecStatDispatch); common::ObString stat_str_; int64_t pos_; }; class ObExecStatUtils { - public: +public: template OB_INLINE static void record_exec_timestamp(const T& process, bool is_first, // fir execution, not retry @@ -105,7 +105,7 @@ class ObExecStatUtils { // K(exec_timestamp.single_process_ts_)); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExecStatUtils); ObExecStatUtils(); ~ObExecStatUtils(); diff --git a/src/sql/monitor/ob_i_collect_value.h b/src/sql/monitor/ob_i_collect_value.h index 2c8e825ce..4a573e817 100644 --- a/src/sql/monitor/ob_i_collect_value.h +++ b/src/sql/monitor/ob_i_collect_value.h @@ -17,7 +17,7 @@ namespace sql { enum StatType { OB_INVALID_STAT_TYPE = 0, PLAN_MONITOR_INFO }; class ObIValue { - public: +public: explicit ObIValue(StatType type) { value_type_ = type; @@ -29,7 +29,7 @@ class ObIValue { return value_type_; } - protected: +protected: StatType value_type_; }; } // namespace sql diff --git a/src/sql/monitor/ob_monitor_info_elimination_task.h b/src/sql/monitor/ob_monitor_info_elimination_task.h index 18887d93c..599d4c5fd 100644 --- a/src/sql/monitor/ob_monitor_info_elimination_task.h +++ b/src/sql/monitor/ob_monitor_info_elimination_task.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObMonitorInfoManager; class ObMonitorInfoEliminationTask : public common::ObTimerTask { - public: +public: ObMonitorInfoEliminationTask() : monitor_info_(NULL) {} ~ObMonitorInfoEliminationTask() @@ -25,10 +25,10 @@ class ObMonitorInfoEliminationTask : public common::ObTimerTask { int init(ObMonitorInfoManager* monitor_info); virtual void runTimerTask(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMonitorInfoEliminationTask); - private: +private: ObMonitorInfoManager* monitor_info_; }; diff --git a/src/sql/monitor/ob_monitor_info_manager.h b/src/sql/monitor/ob_monitor_info_manager.h index 64809e440..fbe96fd6d 100644 --- a/src/sql/monitor/ob_monitor_info_manager.h +++ b/src/sql/monitor/ob_monitor_info_manager.h @@ -38,7 +38,7 @@ struct PlanKey { class ObMonitorInfoManager { friend class TestMonitorInfoManager_tets_duplicated_Test; struct ReclainCond { - public: + public: ReclainCond(int64_t curr_timestamp, int64_t max_remain_interval) : curr_timestamp_(curr_timestamp), max_remain_interval_(max_remain_interval) {} @@ -57,7 +57,7 @@ class ObMonitorInfoManager { }; typedef common::ObRaQueue::Ref Ref; - public: +public: ObMonitorInfoManager(); ~ObMonitorInfoManager(); int init(); @@ -102,7 +102,7 @@ class ObMonitorInfoManager { static const int64_t OB_BATCH_GC_COUNT = 2000; static const int64_t OB_MAX_PUSH_INTERVAL = 10 * 1000 * 1000; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMonitorInfoManager); void clear_queue(int64_t limit); int reclain_map(); @@ -111,7 +111,7 @@ class ObMonitorInfoManager { max_push_interval_ = time; } - private: +private: common::ObConcurrentFIFOAllocator allocator_; common::ObRaQueue slow_query_queue_; common::ObTimer timer_; // for timing task for cleaning data. diff --git a/src/sql/monitor/ob_phy_operator_monitor_info.h b/src/sql/monitor/ob_phy_operator_monitor_info.h index fe1710bdc..0b242fabd 100644 --- a/src/sql/monitor/ob_phy_operator_monitor_info.h +++ b/src/sql/monitor/ob_phy_operator_monitor_info.h @@ -49,7 +49,7 @@ static const MonitorName OB_OPERATOR_MONITOR_INFOS[] = { class ObPhyOperatorMonitorInfo : public ObIValue { OB_UNIS_VERSION(1); - public: +public: ObPhyOperatorMonitorInfo(); virtual ~ObPhyOperatorMonitorInfo(); int set_operator_id(int64_t op_id); @@ -85,15 +85,15 @@ class ObPhyOperatorMonitorInfo : public ObIValue { void increase_value(ObOperatorMonitorInfoIds index); static const int64_t OB_MAX_INFORMATION_COUNT = MONITOR_INFO_END; - private: +private: int64_t get_valid_info_count() const; virtual bool is_timestamp(int64_t index) const; - protected: +protected: int64_t op_id_; int64_t job_id_; // Effective in distributed execution plan int64_t task_id_; // Effective in distributed execution plan - private: +private: ObPhyOperatorType op_type_; uint64_t info_array_[OB_MAX_INFORMATION_COUNT]; }; diff --git a/src/sql/monitor/ob_phy_operator_stats.h b/src/sql/monitor/ob_phy_operator_stats.h index ce096bbac..633e6660e 100644 --- a/src/sql/monitor/ob_phy_operator_stats.h +++ b/src/sql/monitor/ob_phy_operator_stats.h @@ -27,7 +27,7 @@ namespace StatId { enum StatId { INPUT_ROWS = 0, RESCAN_TIMES, OUTPUT_ROWS, MAX_STAT }; } class ObPhyOperatorStats { - public: +public: friend class TestPhyOperatorStats_init_Test; friend class TestPhyOperatorStats_test_add_Test; friend class TestPhyOperatorStats_test_accumulation_Test; @@ -52,7 +52,7 @@ class ObPhyOperatorStats { return execution_times_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPhyOperatorStats); int64_t* op_stats_array_; int64_t op_count_; diff --git a/src/sql/monitor/ob_phy_plan_exec_info.h b/src/sql/monitor/ob_phy_plan_exec_info.h index 9d33093a1..69f4c8b73 100644 --- a/src/sql/monitor/ob_phy_plan_exec_info.h +++ b/src/sql/monitor/ob_phy_plan_exec_info.h @@ -52,7 +52,7 @@ static const MonitorName OB_PLAN_MONITOR_INFOS[] = { {MAX_EVENT_ID, "max_event"}}; class ObPhyPlanExecInfo final : public ObPhyOperatorMonitorInfo { - public: +public: ObPhyPlanExecInfo() {} inline virtual int64_t print_info(char* buf, int64_t buf_len) const; @@ -63,7 +63,7 @@ class ObPhyPlanExecInfo final : public ObPhyOperatorMonitorInfo { return print_info(buf, buf_len); } - private: +private: void set_value(ObPlanMonitorInfoIds index, int64_t value) { plan_info_array_[index] = value; @@ -74,7 +74,7 @@ class ObPhyPlanExecInfo final : public ObPhyOperatorMonitorInfo { } DISALLOW_COPY_AND_ASSIGN(ObPhyPlanExecInfo); - private: +private: common::ObWaitEventDesc max_wait_event_; int64_t plan_info_array_[MAX_EVENT_ID]; }; diff --git a/src/sql/monitor/ob_phy_plan_monitor_info.h b/src/sql/monitor/ob_phy_plan_monitor_info.h index ef9682b9f..fa7479e66 100644 --- a/src/sql/monitor/ob_phy_plan_monitor_info.h +++ b/src/sql/monitor/ob_phy_plan_monitor_info.h @@ -21,10 +21,10 @@ namespace oceanbase { namespace sql { class ObPhyPlanMonitorInfo final { - public: +public: OB_UNIS_VERSION(1); - public: +public: const static int OPERATOR_LOCAL_COUNT = 8; explicit ObPhyPlanMonitorInfo(common::ObConcurrentFIFOAllocator& allocator); virtual void destroy() @@ -107,10 +107,10 @@ class ObPhyPlanMonitorInfo final { return scheduler_addr_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPhyPlanMonitorInfo); - private: +private: common::ObConcurrentFIFOAllocator& allocator_; int64_t request_id_; common::ObAddr scheduler_addr_; diff --git a/src/sql/ob_delete_stmt_printer.h b/src/sql/ob_delete_stmt_printer.h index 73e6f6019..b7d676469 100644 --- a/src/sql/ob_delete_stmt_printer.h +++ b/src/sql/ob_delete_stmt_printer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObDeleteStmtPrinter : public ObDMLStmtPrinter { - public: +public: ObDeleteStmtPrinter() {} ObDeleteStmtPrinter( @@ -34,7 +34,7 @@ class ObDeleteStmtPrinter : public ObDMLStmtPrinter { void init(char* buf, int64_t buf_len, int64_t* pos, ObDeleteStmt* stmt); virtual int do_print(); - private: +private: int print(); int print_basic_stmt(); @@ -43,7 +43,7 @@ class ObDeleteStmtPrinter : public ObDMLStmtPrinter { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDeleteStmtPrinter); - private: +private: // data members }; diff --git a/src/sql/ob_dml_stmt_printer.h b/src/sql/ob_dml_stmt_printer.h index 808441bac..6dcae2220 100644 --- a/src/sql/ob_dml_stmt_printer.h +++ b/src/sql/ob_dml_stmt_printer.h @@ -48,7 +48,7 @@ namespace sql { } while (0) class ObDMLStmtPrinter { - public: +public: ObDMLStmtPrinter(); ObDMLStmtPrinter( char* buf, int64_t buf_len, int64_t* pos, const ObDMLStmt* stmt, common::ObObjPrintParams print_params); @@ -84,13 +84,13 @@ class ObDMLStmtPrinter { print_params_ = obj_print_params; } - private: +private: int print_parens_for_leading_hint( int64_t cur_idx, const ObIArray>* join_order_pairs, bool is_left_parent); // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDMLStmtPrinter); - protected: +protected: // data members char* buf_; int64_t buf_len_; diff --git a/src/sql/ob_end_trans_callback.h b/src/sql/ob_end_trans_callback.h index 72f376b45..66ee94b53 100644 --- a/src/sql/ob_end_trans_callback.h +++ b/src/sql/ob_end_trans_callback.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace sql { class ObSharedEndTransCallback : public ObIEndTransCallback { - public: +public: ObSharedEndTransCallback(); virtual ~ObSharedEndTransCallback(); @@ -37,14 +37,14 @@ class ObSharedEndTransCallback : public ObIEndTransCallback { }; class ObExclusiveEndTransCallback : public ObIEndTransCallback { - public: +public: enum EndTransType { END_TRANS_TYPE_INVALID, END_TRANS_TYPE_EXPLICIT, // Explicit commit END_TRANS_TYPE_IMPLICIT, // Implicit commit }; - public: +public: ObExclusiveEndTransCallback(); virtual ~ObExclusiveEndTransCallback(); @@ -79,7 +79,7 @@ class ObExclusiveEndTransCallback : public ObIEndTransCallback { is_txs_end_trans_called_ = false; } - protected: +protected: ObExclusiveEndTransCallback::EndTransType end_trans_type_; bool has_set_need_rollback_; bool is_need_rollback_; @@ -87,7 +87,7 @@ class ObExclusiveEndTransCallback : public ObIEndTransCallback { }; class ObEndTransSyncCallback : public ObExclusiveEndTransCallback { - public: +public: ObEndTransSyncCallback(); virtual ~ObEndTransSyncCallback(); virtual void callback(int cb_param); @@ -104,7 +104,7 @@ class ObEndTransSyncCallback : public ObExclusiveEndTransCallback { int init(const transaction::ObTransDesc* trans_desc, ObSQLSessionInfo* session); void reset(); - private: +private: /* functions */ /* variables */ @@ -117,7 +117,7 @@ class ObEndTransSyncCallback : public ObExclusiveEndTransCallback { }; class ObEndTransAsyncCallback : public ObExclusiveEndTransCallback { - public: +public: ObEndTransAsyncCallback(); virtual ~ObEndTransAsyncCallback(); virtual void callback(int cb_param); @@ -140,14 +140,14 @@ class ObEndTransAsyncCallback : public ObExclusiveEndTransCallback { mysql_end_trans_cb_.reset(); } - private: +private: /* macro */ observer::ObSqlEndTransCb mysql_end_trans_cb_; DISALLOW_COPY_AND_ASSIGN(ObEndTransAsyncCallback); }; class ObNullEndTransCallback : public ObSharedEndTransCallback { - public: +public: ObNullEndTransCallback() : ObSharedEndTransCallback() {} virtual ~ObNullEndTransCallback() @@ -171,10 +171,10 @@ class ObNullEndTransCallback : public ObSharedEndTransCallback { } virtual int init(const transaction::ObTransID& trans_id); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNullEndTransCallback); - private: +private: transaction::ObTransID trans_id_; }; diff --git a/src/sql/ob_end_trans_cb_packet_param.h b/src/sql/ob_end_trans_cb_packet_param.h index 280a75794..2170bcded 100644 --- a/src/sql/ob_end_trans_cb_packet_param.h +++ b/src/sql/ob_end_trans_cb_packet_param.h @@ -21,7 +21,7 @@ namespace sql { class ObResultSet; class ObSQLSessionInfo; class ObEndTransCbPacketParam { - public: +public: ObEndTransCbPacketParam() : affected_rows_(0), last_insert_id_to_client_(0), is_partition_hit_(true), trace_id_(), is_valid_(false) { @@ -74,7 +74,7 @@ class ObEndTransCbPacketParam { TO_STRING_KV( K_(message), K_(affected_rows), K_(last_insert_id_to_client), K_(is_partition_hit), K_(trace_id), K_(is_valid)); - private: +private: char message_[common::MSG_SIZE]; // null terminated message string int64_t affected_rows_; // number of rows affected by INSERT/UPDATE/DELETE uint64_t last_insert_id_to_client_; diff --git a/src/sql/ob_i_end_trans_callback.h b/src/sql/ob_i_end_trans_callback.h index 576a665e5..a31851526 100644 --- a/src/sql/ob_i_end_trans_callback.h +++ b/src/sql/ob_i_end_trans_callback.h @@ -64,7 +64,7 @@ enum ObEndTransCallbackType { * */ class ObIEndTransCallback { - public: +public: ObIEndTransCallback() { reset(); @@ -113,7 +113,7 @@ class ObIEndTransCallback { callback_counter_ = 0; } - protected: +protected: inline void CHECK_BALANCE(const char* type) const { if (OB_UNLIKELY(callback_counter_ != call_counter_)) { @@ -127,7 +127,7 @@ class ObIEndTransCallback { } } - protected: +protected: int last_err_; volatile uint64_t call_counter_; volatile uint64_t callback_counter_; diff --git a/src/sql/ob_index_sstable_builder.cpp b/src/sql/ob_index_sstable_builder.cpp index b3dbf647f..4caaa80ca 100644 --- a/src/sql/ob_index_sstable_builder.cpp +++ b/src/sql/ob_index_sstable_builder.cpp @@ -44,7 +44,7 @@ using namespace share::schema; class ObIndexSSTableBuilder::BuildParam { OB_UNIS_VERSION_V(1); - public: +public: BuildParam( uint64_t& data_table_id, RangeArrayArray& data_ranges, RangeArrayArray& index_ranges, common::ObIAllocator& alloc) : scan_table_id_(data_table_id), scan_ranges_(data_ranges), index_ranges_(index_ranges), alloc_(alloc) @@ -52,7 +52,7 @@ class ObIndexSSTableBuilder::BuildParam { TO_STRING_KV(K(scan_table_id_), K(scan_ranges_), K(index_ranges_)); - private: +private: uint64_t& scan_table_id_; RangeArrayArray& scan_ranges_; RangeArrayArray& index_ranges_; @@ -60,7 +60,7 @@ class ObIndexSSTableBuilder::BuildParam { }; class ObIndexSSTableBuilder::ObBuildExecutor : public sqlclient::ObIExecutor { - public: +public: ObBuildExecutor(ObIndexSSTableBuilder& builder) : ObIExecutor(), builder_(builder) {} virtual ~ObBuildExecutor() @@ -95,12 +95,12 @@ class ObIndexSSTableBuilder::ObBuildExecutor : public sqlclient::ObIExecutor { } INHERIT_TO_STRING_KV("build index sstable", ObIExecutor, "job", builder_.job_); - private: +private: ObIndexSSTableBuilder& builder_; }; class ObIndexSSTableBuilder::ObClearExecutor : public sqlclient::ObIExecutor { - public: +public: ObClearExecutor(int64_t job_id) : ObIExecutor(), job_id_(job_id) {} virtual ~ObClearExecutor() @@ -114,12 +114,12 @@ class ObIndexSSTableBuilder::ObClearExecutor : public sqlclient::ObIExecutor { } INHERIT_TO_STRING_KV("clear index sstable builder intermediate result", ObIExecutor, K(job_id_)); - private: +private: int64_t job_id_; }; class ObIndexSSTableBuilder::BuildIndexGuard : public common::ObDLinkBase { - public: +public: typedef ObIndexSSTableBuilder::BuildIndexGuard self_t; BuildIndexGuard(const uint64_t index_table_id) : unique_(true), index_table_id_(index_table_id) { @@ -148,7 +148,7 @@ class ObIndexSSTableBuilder::BuildIndexGuard : public common::ObDLinkBase> RangeArrayArray; struct BuildIndexJob { int64_t job_id_; // system job id @@ -66,7 +66,7 @@ class ObIndexSSTableBuilder { }; class ReplicaPicker : public ObDeterminateTaskTransmit::ITaskRouting { - public: + public: ReplicaPicker(){}; virtual ~ReplicaPicker() {} @@ -83,7 +83,7 @@ class ObIndexSSTableBuilder { // routeing task && record task location class TaskRoutingPorxy : public ObDeterminateTaskTransmit::ITaskRouting { - public: + public: TaskRoutingPorxy(ObIndexSSTableBuilder& builder) : routing_(NULL), builder_(builder) {} virtual int route(Policy policy, const ObTaskInfo& task, const common::ObIArray& previous, @@ -93,7 +93,7 @@ class ObIndexSSTableBuilder { routing_ = routing; } - private: + private: ObDeterminateTaskTransmit::ITaskRouting* routing_; ObIndexSSTableBuilder& builder_; }; @@ -125,7 +125,7 @@ class ObIndexSSTableBuilder { static int query_execution_id( uint64_t& execution_id, const int64_t job_id, const int64_t snapshot_version, common::ObMySQLProxy& sql_proxy); - private: +private: class BuildIndexGuard; int build(ObSql& sql_engine, ObSqlCtx& sql_ctx, ObResultSet& result); @@ -166,7 +166,7 @@ class ObIndexSSTableBuilder { return oracle_mode_ ? "\"" : "`"; } - private: +private: bool inited_; common::ObMySQLProxy* sql_proxy_; common::ObCommonSqlProxy* user_sql_proxy_; diff --git a/src/sql/ob_insert_stmt_printer.h b/src/sql/ob_insert_stmt_printer.h index bc4d4d594..ce3825658 100644 --- a/src/sql/ob_insert_stmt_printer.h +++ b/src/sql/ob_insert_stmt_printer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObInsertStmtPrinter : public ObDMLStmtPrinter { - public: +public: ObInsertStmtPrinter() {} ObInsertStmtPrinter( @@ -34,7 +34,7 @@ class ObInsertStmtPrinter : public ObDMLStmtPrinter { void init(char* buf, int64_t buf_len, int64_t* pos, ObInsertStmt* stmt); virtual int do_print(); - private: +private: int print(); int print_basic_stmt(); @@ -53,7 +53,7 @@ class ObInsertStmtPrinter : public ObDMLStmtPrinter { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObInsertStmtPrinter); - private: +private: // data members }; diff --git a/src/sql/ob_merge_stmt_printer.h b/src/sql/ob_merge_stmt_printer.h index 959fa7cff..827c38ba6 100644 --- a/src/sql/ob_merge_stmt_printer.h +++ b/src/sql/ob_merge_stmt_printer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObMergeStmtPrinter : public ObDMLStmtPrinter { - public: +public: ObMergeStmtPrinter() {} ObMergeStmtPrinter( @@ -34,7 +34,7 @@ class ObMergeStmtPrinter : public ObDMLStmtPrinter { void init(char* buf, int64_t buf_len, int64_t* pos, ObMergeStmt* stmt); virtual int do_print(); - private: +private: int print(); int print_conds(const ObIArray& conds); @@ -43,7 +43,7 @@ class ObMergeStmtPrinter : public ObDMLStmtPrinter { int print_insert_clause(const ObMergeStmt& merge_stmt); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObMergeStmtPrinter); }; diff --git a/src/sql/ob_phy_table_location.h b/src/sql/ob_phy_table_location.h index be4094c58..a907b0681 100644 --- a/src/sql/ob_phy_table_location.h +++ b/src/sql/ob_phy_table_location.h @@ -30,7 +30,7 @@ typedef common::ObSEArray ObPartitionRepli class ObSplittedRanges { OB_UNIS_VERSION(1); - public: +public: const common::ObIArray& get_ranges() const { return ranges_; @@ -58,7 +58,7 @@ class ObSplittedRanges { TO_STRING_KV(K_(ranges), K_(offsets)); - private: +private: common::ObSEArray ranges_; common::ObSEArray offsets_; }; @@ -75,13 +75,13 @@ enum class ObDuplicateType : int64_t { class ObPhyTableLocation final { OB_UNIS_VERSION(1); - public: +public: static bool compare_phy_part_loc_info_asc( const ObPhyPartitionLocationInfo*& left, const ObPhyPartitionLocationInfo*& right); static bool compare_phy_part_loc_info_desc( const ObPhyPartitionLocationInfo*& left, const ObPhyPartitionLocationInfo*& right); - public: +public: ObPhyTableLocation(); void reset(); int assign(const ObPhyTableLocation& other); @@ -159,7 +159,7 @@ class ObPhyTableLocation final { static common::ObPartitionType get_partition_type(const common::ObPartitionKey& pkey, const common::ObIArray& table_locations, bool is_retry_for_dup_tbl); - private: +private: uint64_t table_location_key_; uint64_t ref_table_id_; /* locations */ diff --git a/src/sql/ob_query_exec_ctx_mgr.h b/src/sql/ob_query_exec_ctx_mgr.h index 39595ed5a..fa7000777 100644 --- a/src/sql/ob_query_exec_ctx_mgr.h +++ b/src/sql/ob_query_exec_ctx_mgr.h @@ -31,7 +31,7 @@ class ObQueryExecCtx { friend ObClassConstructor; friend ObClassAllocator; - public: +public: static ObQueryExecCtx* alloc(ObSQLSessionInfo& session); static void free(ObQueryExecCtx* query_ctx); inline int64_t inc_ref_count() @@ -71,7 +71,7 @@ class ObQueryExecCtx { return ((NULL == cache_schema_info_) ? NULL : &(cache_schema_info_->get_schema_guard())); } - private: +private: ObQueryExecCtx(ObSQLSessionInfo& session, lib::MemoryContext& mem_context) : mem_context_(mem_context), result_set_(session, mem_context.get_arena_allocator()), @@ -82,7 +82,7 @@ class ObQueryExecCtx { ~ObQueryExecCtx() {} - private: +private: lib::MemoryContext& mem_context_; observer::ObMySQLResultSet result_set_; volatile int64_t ref_count_; @@ -91,7 +91,7 @@ class ObQueryExecCtx { }; class ObITaskExecCtx { - public: +public: ObITaskExecCtx() : ref_count_(0), ctx_lock_(), execution_id_(), query_exec_ctx_(nullptr) {} virtual ~ObITaskExecCtx() @@ -130,7 +130,7 @@ class ObITaskExecCtx { return query_exec_ctx_; } - protected: +protected: volatile int64_t ref_count_; common::ObSpinLock ctx_lock_; ObExecutionID execution_id_; @@ -138,7 +138,7 @@ class ObITaskExecCtx { }; class ObRemoteTaskCtx : public TaskExecCtxHashValue, public ObITaskExecCtx { - public: +public: ObRemoteTaskCtx() : ObITaskExecCtx(), sql_ctx_(), @@ -201,7 +201,7 @@ class ObRemoteTaskCtx : public TaskExecCtxHashValue, public ObITaskExecCtx { return runner_svr_; } - private: +private: ObSqlCtx sql_ctx_; observer::ObQueryRetryCtrl retry_ctrl_; observer::ObMPPacketSender mppacket_sender_; @@ -215,7 +215,7 @@ class ObRemoteTaskCtx : public TaskExecCtxHashValue, public ObITaskExecCtx { }; class ObTaskExecCtxAlloc { - public: +public: ObQueryExecCtx* alloc_value() { return NULL; @@ -240,7 +240,7 @@ typedef common::ObLinkHashMap UIntFastArray; typedef common::ObFastArray RawExprFastArray; // query result set class ObResultSet { - public: +public: class ExternalRetrieveInfo { - public: + public: ExternalRetrieveInfo(common::ObIAllocator& allocator) : allocator_(allocator), external_params_(allocator), @@ -95,7 +95,7 @@ class ObResultSet { typedef common::ObFastArray CandidatePlanArray; - public: +public: explicit ObResultSet(ObSQLSessionInfo& session); explicit ObResultSet(ObSQLSessionInfo& session, common::ObIAllocator& allocator); virtual ~ObResultSet(); @@ -418,11 +418,11 @@ class ObResultSet { } static void replace_lob_type(const ObSQLSessionInfo& session, const ObField& field, obmysql::ObMySQLField& mfield); - private: +private: // types and constants static const int64_t TRANSACTION_SET_VIOLATION_MAX_RETRY = 3; - private: +private: // disallow copy ObResultSet(const ObResultSet& other); ObResultSet& operator=(const ObResultSet& other); @@ -450,10 +450,10 @@ class ObResultSet { // delete useless spaces static int64_t remove_extra_space(char* buff, int64_t len); - protected: +protected: bool is_user_sql_; - private: +private: // data members common::ObArenaAllocator inner_mem_pool_; common::ObIAllocator& mem_pool_; diff --git a/src/sql/ob_select_stmt_printer.h b/src/sql/ob_select_stmt_printer.h index 0808ea594..1a6278abf 100644 --- a/src/sql/ob_select_stmt_printer.h +++ b/src/sql/ob_select_stmt_printer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObSelectStmtPrinter : public ObDMLStmtPrinter { - public: +public: ObSelectStmtPrinter() : ObDMLStmtPrinter(), column_list_(NULL), @@ -48,7 +48,7 @@ class ObSelectStmtPrinter : public ObDMLStmtPrinter { virtual int do_print(); static int remove_double_quotation_for_string(ObString& alias_string, ObIAllocator& allocator); - private: +private: int print(); int print_unpivot(); int print_set_op_stmt(); @@ -71,7 +71,7 @@ class ObSelectStmtPrinter : public ObDMLStmtPrinter { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSelectStmtPrinter); - private: +private: // data members // create view v(column_list) as... common::ObIArray* column_list_; diff --git a/src/sql/ob_sql.h b/src/sql/ob_sql.h index 0860bc2e2..75fe30901 100644 --- a/src/sql/ob_sql.h +++ b/src/sql/ob_sql.h @@ -55,7 +55,7 @@ class ObSql { static const int64_t max_error_length; static const int64_t SQL_MEM_SIZE_LIMIT; - public: +public: /// init SQL module int init(common::ObStatManager* stat_mgr, common::ObOptStatManager* opt_stat_mgr, rpc::frame::ObReqTransport* transport, storage::ObPartitionService* partition_service, @@ -63,11 +63,11 @@ class ObSql { common::ObAddr& addr, share::ObRsMgr& rs_mgr); void destroy(); - public: +public: /// print statatistics of SQL module void stat(); - public: +public: // These interface are one one mapping whit MySQL request type currently // Interface of SQL Engine for OB_MYSQL_COM_QUERY request @@ -166,12 +166,12 @@ class ObSql { int init_result_set(ObSqlCtx& context, ObResultSet& result_set); - public: +public: // for sql test only friend bool compare_stmt(const char* schema_file, const char* str1, const char* str2); int fill_result_set(const ObPsStmtId stmt_id, const ObPsStmtInfo& stmt_info, ObResultSet& result); - public: +public: ObSql() : inited_(false), stat_mgr_(NULL), @@ -199,12 +199,12 @@ class ObSql { return partition_service_; } - private: +private: // disallow copy ObSql(const ObSql& other); ObSql& operator=(const ObSql& other); - private: +private: int construct_param_store(const ParamStore& params, ParamStore& param_store); int do_real_prepare(const ObString& stmt, ObSqlCtx& context, ObResultSet& result, bool is_inner_sql); @@ -307,7 +307,7 @@ class ObSql { typedef hash::ObHashMap PlanCacheMap; friend class ::test::TestOptimizerUtils; - private: +private: bool inited_; // BEGIN Global singleton dependent interface common::ObStatManager* stat_mgr_; diff --git a/src/sql/ob_sql_config_provider.h b/src/sql/ob_sql_config_provider.h index bb26048b5..395d218ae 100644 --- a/src/sql/ob_sql_config_provider.h +++ b/src/sql/ob_sql_config_provider.h @@ -16,14 +16,14 @@ namespace oceanbase { namespace sql { class ObSQLConfigProvider { - public: +public: ObSQLConfigProvider(){}; virtual ~ObSQLConfigProvider(){}; virtual bool is_read_only() const = 0; virtual int64_t get_nlj_cache_limit() const = 0; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSQLConfigProvider); }; diff --git a/src/sql/ob_sql_context.h b/src/sql/ob_sql_context.h index b64f0c546..6ae91d187 100644 --- a/src/sql/ob_sql_context.h +++ b/src/sql/ob_sql_context.h @@ -148,7 +148,7 @@ class ObSQLSessionInfo; class ObSelectStmt; class ObMultiStmtItem { - public: +public: ObMultiStmtItem() : is_part_of_multi_stmt_(false), seq_num_(0), sql_(), batched_queries_(NULL) {} ObMultiStmtItem(bool is_part_of_multi, int64_t seq_num, const common::ObString& sql) @@ -196,7 +196,7 @@ class ObMultiStmtItem { TO_STRING_KV(K_(is_part_of_multi_stmt), K_(seq_num), K_(sql)); - private: +private: bool is_part_of_multi_stmt_; int64_t seq_num_; // Indicates which item is in the multi stmt common::ObString sql_; @@ -205,7 +205,7 @@ class ObMultiStmtItem { }; class ObQueryRetryInfo { - public: +public: ObQueryRetryInfo() : inited_(false), is_rpc_timeout_(false), invalid_servers_(), last_query_retry_err_(common::OB_SUCCESS) {} @@ -240,7 +240,7 @@ class ObQueryRetryInfo { TO_STRING_KV(K_(inited), K_(is_rpc_timeout), K_(invalid_servers), K_(last_query_retry_err)); - private: +private: bool inited_; // This variable is used to write some defensive code, basically useless // Used to mark whether it is the timeout error code returned by rpc (including the local timeout and the timeout // error code in the response packet) @@ -254,12 +254,12 @@ class ObQueryRetryInfo { // overwritten by type 1 or 2 error codes. int last_query_retry_err_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObQueryRetryInfo); }; class ObSqlSchemaGuard { - public: +public: ObSqlSchemaGuard() { reset(); @@ -285,14 +285,14 @@ class ObSqlSchemaGuard { int get_can_read_index_array(uint64_t table_id, uint64_t* index_tid_array, int64_t& size, bool with_mv, bool with_global_index = true, bool with_domain_index = true); - private: +private: int get_link_table_schema(uint64_t table_id, const share::schema::ObTableSchema*& table_schema) const; int get_link_column_schema(uint64_t table_id, const common::ObString& column_name, const share::schema::ObColumnSchemaV2*& column_schema) const; int get_link_column_schema( uint64_t table_id, uint64_t column_id, const share::schema::ObColumnSchemaV2*& column_schema) const; - private: +private: share::schema::ObSchemaGetterGuard* schema_guard_; common::ModulePageAllocator allocator_; common::ObSEArray table_schemas_; @@ -300,7 +300,7 @@ class ObSqlSchemaGuard { }; struct ObSqlCtx { - public: +public: ObSqlCtx(); ~ObSqlCtx() { @@ -322,7 +322,7 @@ struct ObSqlCtx { // release dynamic allocated memory void clear(); - public: +public: ObMultiStmtItem multi_stmt_item_; ObSQLSessionInfo* session_info_; ObSqlSchemaGuard sql_schema_guard_; @@ -395,7 +395,7 @@ struct ObSqlCtx { }; struct ObQueryCtx { - public: +public: struct IdNamePair final { IdNamePair() : id_(common::OB_INVALID_STMT_ID), name_(), origin_name_(), stmt_type_(stmt::T_NONE) {} @@ -524,11 +524,11 @@ struct ObQueryCtx { int add_temp_table(ObSqlTempTableInfo* temp_table_info); int get_temp_table_plan(const uint64_t temp_table_id, ObLogicalOperator*& temp_table_insert); - public: +public: static const int64_t CALCULABLE_EXPR_NUM = 16; typedef common::ObSEArray CalculableItems; - public: +public: int64_t question_marks_count_; CalculableItems calculable_items_; common::ObSEArray table_partition_infos_; diff --git a/src/sql/ob_sql_mock_schema_utils.h b/src/sql/ob_sql_mock_schema_utils.h index c697add24..3d9500b78 100644 --- a/src/sql/ob_sql_mock_schema_utils.h +++ b/src/sql/ob_sql_mock_schema_utils.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace share {} namespace sql { class ObSQLMockSchemaUtils { - public: +public: static int mock_rowid_index( const share::schema::ObTableSchema* base_table_schema, const share::schema::ObTableSchema*& rowid_index_schema); static int mock_rowid_column(share::schema::ObTableSchema& table_schema); @@ -49,21 +49,21 @@ class ObSQLMockSchemaUtils { static const char* get_rowid_index_name(); - private: +private: static int add_mock_index(const uint64_t table_id); }; class ObSQLMockedTables { - private: +private: // hit 25 bits // normal table id, high 24 bits is tenant_id, then 1 bit to determine this is table group id // so here we use 25 bits to specify this is a mocked rowid index table id const static uint64_t ROWID_INDEX_HIGH_BITS = 0xFEFDFC8; - public: +public: const static uint64_t ROWID_INDEX_MASK = (ROWID_INDEX_HIGH_BITS << 39UL); - public: +public: struct ObMockedRowIDIndexInfo { uint64_t org_table_id_; uint64_t mocked_table_id_; @@ -91,7 +91,7 @@ class ObSQLMockedTables { typedef common::ObSEArray MockRowIDIdxArray; const static int64_t MOCKED_TABLE_IDENTIFIER = 0; - public: +public: ObSQLMockedTables() : table_ids_() {} virtual ~ObSQLMockedTables() @@ -131,13 +131,13 @@ class ObSQLMockedTables { return rowid_idx_ids_; } - private: +private: MockTableIDArray table_ids_; MockRowIDIdxArray rowid_idx_ids_; }; class ObSQLMockSchemaGuard { - public: +public: ObSQLMockSchemaGuard(); ~ObSQLMockSchemaGuard(); }; diff --git a/src/sql/ob_sql_partition_location_cache.h b/src/sql/ob_sql_partition_location_cache.h index 8dbd4ff0b..c0676af09 100644 --- a/src/sql/ob_sql_partition_location_cache.h +++ b/src/sql/ob_sql_partition_location_cache.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObTaskExecutorCtx; class ObSqlPartitionLocationCache : public share::ObIPartitionLocationCache { - public: +public: enum LocationDistributedMode { LOC_DIST_MODE_INVALID = 0, LOC_DIST_MODE_ONLY_LOCAL, @@ -27,7 +27,7 @@ class ObSqlPartitionLocationCache : public share::ObIPartitionLocationCache { LOC_DIST_MODE_ONLY_RS, }; - public: +public: ObSqlPartitionLocationCache(); virtual ~ObSqlPartitionLocationCache(){}; @@ -99,7 +99,7 @@ class ObSqlPartitionLocationCache : public share::ObIPartitionLocationCache { schema_guard_ = schema_guard; } - private: +private: int virtual_get(const uint64_t table_id, const int64_t partition_id, share::ObPartitionLocation& location, const int64_t expire_renew_time, bool& is_cache_hit); int build_local_location(uint64_t table_id, share::ObPartitionLocation& location); @@ -108,13 +108,13 @@ class ObSqlPartitionLocationCache : public share::ObIPartitionLocationCache { int get_phy_key( const uint64_t table_id, const int64_t partition_id, uint64_t& tg_id, int64_t& pg_id, common::ObPGKey& pg_key); - private: +private: share::ObIPartitionLocationCache* loc_cache_; common::ObAddr self_addr_; ObTaskExecutorCtx* task_exec_ctx_; // used for multi-partition virtual-table to get table_location from partition_id share::schema::ObSchemaGetterGuard* schema_guard_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlPartitionLocationCache); }; diff --git a/src/sql/ob_sql_task.h b/src/sql/ob_sql_task.h index 1a212de99..e97d1e663 100644 --- a/src/sql/ob_sql_task.h +++ b/src/sql/ob_sql_task.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObSql; class ObSqlTaskHandler : public rpc::frame::ObReqProcessor { - public: +public: ObSqlTaskHandler() : task_(NULL), sql_engine_(NULL) {} ~ObSqlTaskHandler() @@ -28,7 +28,7 @@ class ObSqlTaskHandler : public rpc::frame::ObReqProcessor { int init(observer::ObSrvTask* task, ObSql* sql_engine); void reset(); - protected: +protected: int deserialize() { return common::OB_SUCCESS; @@ -49,7 +49,7 @@ class ObSqlTaskHandler : public rpc::frame::ObReqProcessor { return common::OB_SUCCESS; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlTaskHandler); observer::ObSrvTask* task_; ObSql* sql_engine_; @@ -58,7 +58,7 @@ class ObSqlTaskHandler : public rpc::frame::ObReqProcessor { class ObSqlTask : public observer::ObSrvTask { friend class ObSqlTaskFactory; - public: +public: ObSqlTask() : msg_type_(0), size_(0), is_fixed_alloc_(false), handler_() {} ~ObSqlTask() @@ -87,10 +87,10 @@ class ObSqlTask : public observer::ObSrvTask { } TO_STRING_KV(KP(this), K_(msg_type)); - public: +public: static const int64_t MAX_SQL_TASK_SIZE = 16 * 1024 - 128; - private: +private: void set_fixed_alloc() { is_fixed_alloc_ = true; @@ -100,7 +100,7 @@ class ObSqlTask : public observer::ObSrvTask { return is_fixed_alloc_; } - private: +private: int msg_type_; char buf_[MAX_SQL_TASK_SIZE]; int64_t size_; @@ -110,7 +110,7 @@ class ObSqlTask : public observer::ObSrvTask { }; class ObSqlTaskFactory { - public: +public: ObSqlTaskFactory() {} ~ObSqlTaskFactory() @@ -120,20 +120,20 @@ class ObSqlTaskFactory { int init(); void destroy(); - public: +public: ObSqlTask* alloc(const uint64_t tenant_id); void free(ObSqlTask* task); static ObSqlTaskFactory& get_instance(); - private: +private: ObSqlTask* alloc_(const uint64_t tenant_id); void free_(ObSqlTask* task); - private: +private: static const int64_t NORMAL_FIXED_TASK_NUM = 4096; static const int64_t MINI_FIXED_TASK_NUM = 128; - private: +private: ObFixedQueue fixed_queue_; }; diff --git a/src/sql/ob_sql_temp_table.h b/src/sql/ob_sql_temp_table.h index 134e779a1..ef23e019c 100644 --- a/src/sql/ob_sql_temp_table.h +++ b/src/sql/ob_sql_temp_table.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { struct ObTempTableSqcInfo { - public: +public: ObTempTableSqcInfo() : sqc_id_(0), temp_sqc_addr_(), @@ -47,7 +47,7 @@ struct ObTempTableSqcInfo { }; class ObSqlTempTableCtx { - public: +public: ObSqlTempTableCtx() : temp_table_id_(0) {} virtual ~ObSqlTempTableCtx() @@ -61,7 +61,7 @@ class ObSqlTempTableCtx { }; class ObSqlTempTableInfo { - public: +public: ObSqlTempTableInfo() : ref_table_id_(OB_INVALID_ID), table_name_(), table_query_(NULL), table_plan_(NULL) {} virtual ~ObSqlTempTableInfo() @@ -76,7 +76,7 @@ class ObSqlTempTableInfo { } TO_STRING_KV(K_(ref_table_id), K_(table_name)); - public: +public: uint64_t ref_table_id_; common::ObString table_name_; ObSelectStmt* table_query_; diff --git a/src/sql/ob_sql_trans_control.h b/src/sql/ob_sql_trans_control.h index 4828f11b0..4aa70dc04 100644 --- a/src/sql/ob_sql_trans_control.h +++ b/src/sql/ob_sql_trans_control.h @@ -44,7 +44,7 @@ class ObNullEndTransCallback; class ObExclusiveEndTransCallback; class TransState { - private: +private: static const uint32_t START_TRANS_EXECUTED_BIT = (1 << 0); static const uint32_t END_TRANS_EXECUTED_BIT = (1 << 2); static const uint32_t START_STMT_EXECUTED_BIT = (1 << 4); @@ -70,7 +70,7 @@ class TransState { static const uint32_t START_PART_EXECUTED_MASK = (0xFFFFFFFF ^ (0x3 << 8)); static const uint32_t END_PART_EXECUTED_MASK = (0xFFFFFFFF ^ (0x3 << 10)); - public: +public: TransState() : state_(0) {} ~TransState() @@ -188,14 +188,14 @@ class TransState { return participants_; } - private: +private: uint32_t state_; // cached for start_stmt, start_participants, end_participants common::ObPartitionArray participants_; }; class ObConsistencyLevelAdaptor { - public: +public: explicit ObConsistencyLevelAdaptor(common::ObConsistencyLevel sql_consistency) { switch (sql_consistency) { @@ -215,12 +215,12 @@ class ObConsistencyLevelAdaptor { return trans_consistency_; } - private: +private: int64_t trans_consistency_; }; class ObSqlTransControl { - public: +public: static int on_plan_start(ObExecContext& exec_ctx, bool is_remote = false); // static int on_plan_end(ObExecContext &exec_ctx, bool is_rollback, ObExclusiveEndTransCallback &callback); @@ -293,7 +293,7 @@ class ObSqlTransControl { static int xa_rollback_all_changes(ObExecContext& exec_ctx); static int start_cursor_stmt(ObExecContext& exec_ctx); - public: +public: static int get_participants(ObExecContext& exec_ctx, common::ObPartitionArray& participants); static int get_root_job_participants( ObExecContext& exec_ctx, const ObPhyOperator& root_job_root_op, common::ObPartitionArray& participants); @@ -323,7 +323,7 @@ class ObSqlTransControl { ObExecContext& exec_ctx, ObSQLSessionInfo& session_info, ObPhysicalPlanCtx& phy_plan_ctx, bool is_remote); static bool is_isolation_RR_or_SE(int32_t isolation); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlTransControl); /* functions */ static int implicit_start_trans(ObExecContext& exec_ctx, bool is_remote = false); diff --git a/src/sql/ob_sql_trans_hook.h b/src/sql/ob_sql_trans_hook.h index 19a7ee14d..bb4e95969 100644 --- a/src/sql/ob_sql_trans_hook.h +++ b/src/sql/ob_sql_trans_hook.h @@ -28,11 +28,11 @@ class ObStmt; class ObSQLSessionInfo; class ObSqlTransHook { - public: +public: static int before_end_trans(ObSQLSessionInfo* session); static int after_end_trans(ObSQLSessionInfo* session, ObExclusiveEndTransCallback& callback, int64_t timeout); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlTransHook); }; diff --git a/src/sql/ob_sql_trans_util.h b/src/sql/ob_sql_trans_util.h index 38d852af3..ee2a404ee 100644 --- a/src/sql/ob_sql_trans_util.h +++ b/src/sql/ob_sql_trans_util.h @@ -23,7 +23,7 @@ class ObSQLSessionInfo; class TransResult { OB_UNIS_VERSION(1); - public: +public: TransResult() : is_incomplete_(false), lock_(), max_sql_no_(0), trans_desc_(NULL) {} @@ -65,7 +65,7 @@ class TransResult { void clear_stmt_result(); TO_STRING_KV(K_(total_partitions), K_(part_epoch_list), K_(response_partitions), K_(max_sql_no)); - private: +private: // collect all partitions for foreign key. common::ObPartitionArray total_partitions_; // discard_partitions_ indicates that the transaction in the partition is enabled, @@ -97,7 +97,7 @@ class TransResult { }; class ObSqlTransUtil { - public: +public: /* Determine whether a statement should start a transaction remotely */ static bool is_remote_trans(bool ac, bool in_trans, ObPhyPlanType ptype) { @@ -124,7 +124,7 @@ class ObSqlTransUtil { return true == in_trans; } - private: +private: ObSqlTransUtil(){}; ~ObSqlTransUtil(){}; DISALLOW_COPY_AND_ASSIGN(ObSqlTransUtil); diff --git a/src/sql/ob_sql_utils.h b/src/sql/ob_sql_utils.h index 16780e408..8655dae74 100644 --- a/src/sql/ob_sql_utils.h +++ b/src/sql/ob_sql_utils.h @@ -91,7 +91,7 @@ struct ObHiddenColumnItem { }; class ObSQLUtils { - public: +public: const static int64_t WITHOUT_FUNC_REGEXP = 1; const static int64_t WITHOUT_FUNC_ADDR_TO_PARTITION_ID = 2; const static int64_t OB_MYSQL50_TABLE_NAME_PREFIX_LENGTH = 9; @@ -332,7 +332,7 @@ class ObSQLUtils { static int print_identifier(char* buf, const int64_t buf_len, int64_t& pos, common::ObCollationType connection_collation, const common::ObString& identifier_name); - private: +private: static int check_ident_name(const common::ObCollationType cs_type, common::ObString& name, const bool check_for_path_char, const int64_t max_ident_len); static bool check_mysql50_prefix(common::ObString& db_name); @@ -379,7 +379,7 @@ struct ObAcsIndexInfo { }; class RelExprCheckerBase { - public: +public: const static int32_t FIELD_LIST_SCOPE; const static int32_t WHERE_SCOPE; const static int32_t GROUP_SCOPE; @@ -401,7 +401,7 @@ class RelExprCheckerBase { const static int32_t JOIN_CONDITION_SCOPE; const static int32_t EXTRA_OUTPUT_SCOPE; - public: +public: RelExprCheckerBase() : duplicated_checker_(), ignore_scope_(0) {} RelExprCheckerBase(int32_t ignore_scope) : duplicated_checker_(), ignore_scope_(ignore_scope) @@ -418,14 +418,14 @@ class RelExprCheckerBase { virtual int add_expr(ObRawExpr*& expr) = 0; int add_exprs(common::ObIArray& exprs); - protected: +protected: static const int64_t CHECKER_BUCKET_NUM = 1000; common::hash::ObHashSet duplicated_checker_; int32_t ignore_scope_; }; class RelExprChecker : public RelExprCheckerBase { - public: +public: RelExprChecker(common::ObIArray& rel_array) : RelExprCheckerBase(), rel_array_(rel_array) {} @@ -436,25 +436,25 @@ class RelExprChecker : public RelExprCheckerBase { {} int add_expr(ObRawExpr*& expr); - private: +private: common::ObIArray& rel_array_; }; class FastRelExprChecker : public RelExprCheckerBase { - public: +public: FastRelExprChecker(common::ObIArray& rel_array); FastRelExprChecker(common::ObIArray& rel_array, int32_t ignore_scope); virtual ~FastRelExprChecker(); int add_expr(ObRawExpr*& expr); int dedup(); - private: +private: common::ObIArray& rel_array_; int64_t init_size_; }; class RelExprPointerChecker : public RelExprCheckerBase { - public: +public: RelExprPointerChecker(common::ObIArray& rel_array) : RelExprCheckerBase(), rel_array_(rel_array), expr_id_map_() {} @@ -464,14 +464,15 @@ class RelExprPointerChecker : public RelExprCheckerBase { virtual ~RelExprPointerChecker() {} virtual int init(int64_t bucket_num = CHECKER_BUCKET_NUM) override; - int add_expr(ObRawExpr *&expr) override; + int add_expr(ObRawExpr*& expr) override; + private: - common::ObIArray &rel_array_; + common::ObIArray& rel_array_; common::hash::ObHashMap expr_id_map_; }; class AllExprPointerCollector : public RelExprCheckerBase { - public: +public: AllExprPointerCollector(common::ObIArray& rel_array) : RelExprCheckerBase(), rel_array_(rel_array) {} AllExprPointerCollector(common::ObIArray& rel_array, int32_t ignore_scope) @@ -481,7 +482,7 @@ class AllExprPointerCollector : public RelExprCheckerBase { {} int add_expr(ObRawExpr*& expr); - private: +private: common::ObIArray& rel_array_; }; @@ -509,7 +510,7 @@ struct ObSqlTraits { template class ObValueChecker { - public: +public: ObValueChecker() = delete; constexpr ObValueChecker(ValueType min_value, ValueType max_value, int err_ret_code) @@ -528,7 +529,7 @@ class ObValueChecker { TO_STRING_KV(K_(min_value), K_(max_value), K_(err_ret_code)); - private: +private: ValueType min_value_; ValueType max_value_; int err_ret_code_; @@ -536,7 +537,7 @@ class ObValueChecker { template class ObPointerChecker { - public: +public: ObPointerChecker() = delete; constexpr ObPointerChecker(int err_ret_code) : err_ret_code_(err_ret_code) @@ -549,7 +550,7 @@ class ObPointerChecker { TO_STRING_KV(K_(err_ret_code)); - private: +private: int err_ret_code_; }; @@ -559,7 +560,7 @@ class ObEnumBitSet { static_assert(std::is_enum::value, "typename must be a enum type"); static_assert(static_cast(T::MAX_VALUE) < MAX_ENUM_VALUE, "Please add MAX_VALUE in enum class"); - public: +public: inline ObEnumBitSet() : flag_(0) {} inline ObEnumBitSet(T value) @@ -602,7 +603,7 @@ class ObEnumBitSet { } TO_STRING_KV(K_(flag)); - private: +private: inline uint64_t bit2flag(int bit) const { uint64_t v = 1; @@ -617,7 +618,7 @@ OB_SERIALIZE_MEMBER_TEMP(template , ObEnumBitSet, flag_); struct ObImplicitCursorInfo { OB_UNIS_VERSION(1); - public: +public: ObImplicitCursorInfo() : stmt_id_(common::OB_INVALID_INDEX), affected_rows_(0), @@ -641,7 +642,7 @@ struct ObImplicitCursorInfo { struct ObParamPosIdx { OB_UNIS_VERSION_V(1); - public: +public: ObParamPosIdx() : pos_(0), idx_(0) {} ObParamPosIdx(int32_t pos, int32_t idx) : pos_(pos), idx_(idx) @@ -654,7 +655,7 @@ struct ObParamPosIdx { }; class ObVirtualTableResultConverter { - public: +public: ObVirtualTableResultConverter() : key_alloc_(nullptr), key_cast_ctx_(), @@ -698,7 +699,7 @@ class ObVirtualTableResultConverter { ObEvalCtx& eval_ctx, const common::ObIArray& src_exprs, const common::ObIArray& dst_exprs); int convert_column(ObObj& obj, uint64_t column_id, uint64_t idx); - private: +private: int process_tenant_id(const ObIArray* extract_tenant_ids, const int64_t nth_col, ObIAllocator& allocator, bool decode, ObObj& obj); int convert_key(const ObRowkey& src, ObRowkey& dst, bool is_start_key, int64_t pos); @@ -707,7 +708,7 @@ class ObVirtualTableResultConverter { int init_output_row(int64_t cell_cnt); int get_need_convert_key_ranges_pos(ObNewRange& key_range, int64_t& pos); - public: +public: // the memory that allocated must be reset by caller ObIAllocator* key_alloc_; ObCastCtx key_cast_ctx_; @@ -735,17 +736,17 @@ class ObVirtualTableResultConverter { }; class ObLinkStmtParam { - public: +public: static int write(char* buf, int64_t buf_len, int64_t& pos, int64_t param_idx); static int read_next(const char* buf, int64_t buf_len, int64_t& pos, int64_t& param_idx); static int64_t get_param_len(); - private: +private: static const int64_t PARAM_LEN; }; class ObSqlFatalErrExtraInfoGuard : public common::ObFatalErrExtraInfoGuard { - public: +public: ObSqlFatalErrExtraInfoGuard() { reset(); @@ -776,7 +777,7 @@ class ObSqlFatalErrExtraInfoGuard : public common::ObFatalErrExtraInfoGuard { } DECLARE_TO_STRING; - private: +private: uint64_t tenant_id_; common::ObString cur_sql_; const ObPhysicalPlan* plan_; diff --git a/src/sql/ob_update_stmt_printer.h b/src/sql/ob_update_stmt_printer.h index b24669ee7..fa2cf47a0 100644 --- a/src/sql/ob_update_stmt_printer.h +++ b/src/sql/ob_update_stmt_printer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObUpdateStmtPrinter : public ObDMLStmtPrinter { - public: +public: ObUpdateStmtPrinter() {} ObUpdateStmtPrinter( @@ -34,7 +34,7 @@ class ObUpdateStmtPrinter : public ObDMLStmtPrinter { void init(char* buf, int64_t buf_len, int64_t* pos, ObUpdateStmt* stmt); virtual int do_print(); - private: +private: int print(); int print_basic_stmt(); @@ -48,7 +48,7 @@ class ObUpdateStmtPrinter : public ObDMLStmtPrinter { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUpdateStmtPrinter); - private: +private: // data members }; diff --git a/src/sql/optimizer/ob_delete_log_plan.h b/src/sql/optimizer/ob_delete_log_plan.h index 44c297365..385c21b05 100644 --- a/src/sql/optimizer/ob_delete_log_plan.h +++ b/src/sql/optimizer/ob_delete_log_plan.h @@ -23,7 +23,7 @@ namespace sql { */ class ObLogDelete; class ObDeleteLogPlan : public ObLogPlan { - public: +public: ObDeleteLogPlan(ObOptimizerContext& ctx, const ObDeleteStmt* delete_stmt) : ObLogPlan(ctx, delete_stmt), delete_op_(NULL) {} @@ -32,12 +32,12 @@ class ObDeleteLogPlan : public ObLogPlan { int generate_raw_plan(); virtual int generate_plan(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDeleteLogPlan); int allocate_delete_as_top(ObLogicalOperator*& top); int allocate_pdml_delete_as_top(ObLogicalOperator*& top); - private: +private: ObLogDelete* delete_op_; }; } // namespace sql diff --git a/src/sql/optimizer/ob_explain_log_plan.h b/src/sql/optimizer/ob_explain_log_plan.h index 63be402bf..a448365be 100644 --- a/src/sql/optimizer/ob_explain_log_plan.h +++ b/src/sql/optimizer/ob_explain_log_plan.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObExplainLogPlan : public ObLogPlan { - public: +public: ObExplainLogPlan(ObOptimizerContext& ctx, const ObDMLStmt* explain_stmt) : ObLogPlan(ctx, explain_stmt) {} virtual ~ObExplainLogPlan() @@ -27,7 +27,7 @@ class ObExplainLogPlan : public ObLogPlan { virtual int generate_plan(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExplainLogPlan); }; } // namespace sql diff --git a/src/sql/optimizer/ob_fd_item.h b/src/sql/optimizer/ob_fd_item.h index b8a445097..c2758d26d 100644 --- a/src/sql/optimizer/ob_fd_item.h +++ b/src/sql/optimizer/ob_fd_item.h @@ -27,7 +27,7 @@ enum FdLevel { INVALID_LEVEL = -1, TABLE_LEVEL, EXPR_LEVEL }; * {t1} is child tables */ class ObFdItem { - public: +public: ObFdItem(const bool is_unique = false, ObRawExprSet* parent_exprs = NULL, const int32_t stmt_level = -1) : parent_exprs_(parent_exprs), is_unique_(is_unique), stmt_level_(stmt_level) {} @@ -81,7 +81,7 @@ class ObFdItem { VIRTUAL_TO_STRING_KV(K_(parent_exprs), K_(is_unique), K_(stmt_level)); - protected: +protected: ObRawExprSet* parent_exprs_; bool is_unique_; int32_t stmt_level_; @@ -90,7 +90,7 @@ class ObFdItem { typedef common::ObSEArray ObFdItemSet; class ObTableFdItem : public ObFdItem { - public: +public: ObTableFdItem() : ObFdItem(), child_tables_() {} ObTableFdItem(const bool is_unique, ObRawExprSet* parent_exprs, const int32_t stmt_level) @@ -115,7 +115,7 @@ class ObTableFdItem : public ObFdItem { VIRTUAL_TO_STRING_KV(K_(parent_exprs), K_(is_unique), K_(stmt_level), K_(child_tables)); - protected: +protected: ObRelIds child_tables_; }; inline FdLevel ObTableFdItem::get_level() const @@ -128,7 +128,7 @@ inline bool ObTableFdItem::is_table_fd_item() const } class ObExprFdItem : public ObFdItem { - public: +public: ObExprFdItem() : ObFdItem(), inner_alloc_("ExprFdItem"), child_exprs_(&inner_alloc_) {} ObExprFdItem(const bool is_unique, ObRawExprSet* parent_exprs, const int32_t stmt_level) @@ -153,7 +153,7 @@ class ObExprFdItem : public ObFdItem { VIRTUAL_TO_STRING_KV(K_(parent_exprs), K_(is_unique), K_(stmt_level), K_(child_exprs)); - protected: +protected: common::ModulePageAllocator inner_alloc_; ObRawExprSet child_exprs_; }; @@ -167,7 +167,7 @@ inline bool ObExprFdItem::is_expr_fd_item() const } class ObFdItemFactory { - public: +public: explicit ObFdItemFactory(common::ObIAllocator& alloc) : allocator_(alloc), item_store_(alloc), item_set_store_(alloc) {} ~ObFdItemFactory() @@ -209,13 +209,13 @@ class ObFdItemFactory { } TO_STRING_KV("", ""); - private: +private: common::ObIAllocator& allocator_; common::ObObjStore item_store_; common::ObObjStore item_set_store_; ObRawExprSets parent_sets_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFdItemFactory); }; diff --git a/src/sql/optimizer/ob_index_info_cache.h b/src/sql/optimizer/ob_index_info_cache.h index 9c7a5d5bf..249c59667 100644 --- a/src/sql/optimizer/ob_index_info_cache.h +++ b/src/sql/optimizer/ob_index_info_cache.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class QueryRangeInfo { - public: +public: QueryRangeInfo() : is_valid_(false), contain_always_false_(false), @@ -125,7 +125,7 @@ class QueryRangeInfo { TO_STRING_KV(K_(is_valid), K_(contain_always_false), K_(range_columns), K_(equal_prefix_count), K_(equal_prefix_null_count), K_(range_prefix_count), K_(index_column_count)); - private: +private: bool is_valid_; bool contain_always_false_; ObQueryRange* query_range_; @@ -139,7 +139,7 @@ class QueryRangeInfo { }; class OrderingInfo { - public: +public: OrderingInfo() : scan_direction_(default_asc_direction()), index_keys_(), ordering_() {} ObOrderDirection get_scan_direction() const @@ -169,7 +169,7 @@ class OrderingInfo { } TO_STRING_KV(K_(scan_direction), K_(index_keys)); - private: +private: ObOrderDirection scan_direction_; common::ObArray index_keys_; common::ObArray ordering_; @@ -177,7 +177,7 @@ class OrderingInfo { }; class IndexInfoEntry { - public: +public: IndexInfoEntry() : index_id_(common::OB_INVALID_ID), is_unique_index_(false), @@ -263,7 +263,7 @@ class IndexInfoEntry { TO_STRING_KV(K_(index_id), K_(is_unique_index), K_(is_index_back), K_(is_index_global), K_(range_info), K_(ordering_info), K_(interesting_order_info), K_(interesting_order_prefix_count)); - private: +private: uint64_t index_id_; bool is_unique_index_; bool is_index_back_; @@ -276,7 +276,7 @@ class IndexInfoEntry { }; class ObIndexInfoCache { - public: +public: ObIndexInfoCache() : table_id_(common::OB_INVALID_ID), base_table_id_(common::OB_INVALID_ID), entry_count_(0) { MEMSET(index_entrys_, 0, sizeof(index_entrys_)); @@ -301,7 +301,7 @@ class ObIndexInfoCache { int add_index_info_entry(IndexInfoEntry*); TO_STRING_KV(K_(table_id), K_(base_table_id), K_(entry_count)); - private: +private: uint64_t table_id_; uint64_t base_table_id_; int64_t entry_count_; diff --git a/src/sql/optimizer/ob_insert_log_plan.h b/src/sql/optimizer/ob_insert_log_plan.h index 05767e550..34119c508 100644 --- a/src/sql/optimizer/ob_insert_log_plan.h +++ b/src/sql/optimizer/ob_insert_log_plan.h @@ -24,7 +24,7 @@ typedef common::ObSEArray RowParamMap; class ObInsertLogPlan : public ObLogPlan { - public: +public: ObInsertLogPlan(ObOptimizerContext& ctx, const ObDMLStmt* insert_stmt) : ObLogPlan(ctx, insert_stmt), insert_op_(NULL) {} virtual ~ObInsertLogPlan() @@ -36,7 +36,7 @@ class ObInsertLogPlan : public ObLogPlan { return row_params_map_; } - protected: +protected: int generate_values_op_as_child(ObLogicalOperator*& expr_values); bool is_self_part_insert(); int map_value_param_index(); @@ -47,10 +47,10 @@ class ObInsertLogPlan : public ObLogPlan { int allocate_insert_all_op(ObInsertStmt& insert_stmt, ObLogInsert*& insert_op); int allocate_pdml_insert_as_top(ObLogicalOperator*& top_op); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObInsertLogPlan); - private: +private: RowParamMap row_params_map_; ObLogInsert* insert_op_; }; diff --git a/src/sql/optimizer/ob_intersect_route_policy.h b/src/sql/optimizer/ob_intersect_route_policy.h index ebe4f49c3..ba10b3fe6 100644 --- a/src/sql/optimizer/ob_intersect_route_policy.h +++ b/src/sql/optimizer/ob_intersect_route_policy.h @@ -29,7 +29,7 @@ namespace sql { class ObPhyPartitionLocationInfo; class ObPhyTableLocationInfo; class ObIntersectRoutePolicy : public ObRoutePolicy { - public: +public: using ObRoutePolicy::ObRoutePolicy; int init_candidate_replicas(const common::ObList& candidate_server_list, common::ObIArray& candi_replicas); diff --git a/src/sql/optimizer/ob_join_order.h b/src/sql/optimizer/ob_join_order.h index 38517a370..174b9c61e 100644 --- a/src/sql/optimizer/ob_join_order.h +++ b/src/sql/optimizer/ob_join_order.h @@ -132,7 +132,7 @@ struct BaseTableOptInfo { }; class Path { - public: +public: Path() : path_type_(INVALID), parent_(NULL), @@ -256,7 +256,7 @@ class Path { TO_STRING_KV(K_(path_type), K_(cost), K_(op_cost), K_(exec_params), K_(ordering), K_(is_inner_path), K_(inner_row_count), K_(interesting_order_info)); - public: +public: // member variables PathType path_type_; ObJoinOrder* parent_; @@ -274,12 +274,12 @@ class Path { common::ObSEArray, 4, common::ModulePageAllocator, true> nl_params_; // parameters for // inner path - private: +private: DISALLOW_COPY_AND_ASSIGN(Path); }; class AccessPath : public Path { - public: +public: AccessPath( uint64_t table_id, uint64_t ref_table_id, uint64_t index_id, ObJoinOrder* parent, ObOrderDirection direction) : Path(ACCESS, parent), @@ -408,7 +408,7 @@ class AccessPath : public Path { K_(output_row_count), K_(phy_query_range_row_count), K_(query_range_row_count), K_(index_back_row_count), K_(index_back_cost), K_(est_cost_info), K_(sample_info), K_(range_prefix_count)); - public: +public: // member variables uint64_t table_id_; uint64_t ref_table_id_; @@ -436,12 +436,12 @@ class AccessPath : public Path { int64_t range_prefix_count_; // prefix count BaseTableOptInfo* table_opt_info_; - private: +private: DISALLOW_COPY_AND_ASSIGN(AccessPath); }; class JoinPath : public Path { - public: +public: JoinPath() : Path(JOIN, NULL), left_path_(NULL), @@ -514,7 +514,7 @@ class JoinPath : public Path { BUF_PRINTF(">"); } - public: +public: const Path* left_path_; const Path* right_path_; JoinAlgo join_algo_; // join method @@ -529,12 +529,12 @@ class JoinPath : public Path { common::ObSEArray equal_join_condition_; common::ObSEArray other_join_condition_; - private: +private: DISALLOW_COPY_AND_ASSIGN(JoinPath); }; class SubQueryPath : public Path { - public: +public: SubQueryPath() : Path(SUBQUERY, NULL), subquery_id_(common::OB_INVALID_ID), root_(NULL) {} SubQueryPath(ObLogicalOperator* root) : Path(SUBQUERY, NULL), subquery_id_(common::OB_INVALID_ID), root_(root) @@ -548,11 +548,11 @@ class SubQueryPath : public Path { BUF_PRINTF("%lu", subquery_id_); } - public: +public: uint64_t subquery_id_; ObLogicalOperator* root_; - private: +private: DISALLOW_COPY_AND_ASSIGN(SubQueryPath); }; @@ -581,7 +581,7 @@ struct InnerPathInfo { typedef common::ObSEArray InnerPathInfos; class ObJoinOrder { - public: +public: struct PathHelper { PathHelper() : is_inner_path_(false), @@ -1026,7 +1026,7 @@ class ObJoinOrder { } TO_STRING_KV(K_(type), K_(output_rows), K_(interesting_paths)); - private: +private: int add_access_filters( AccessPath* path, const common::ObIArray& index_keys, const ObIArray& restrict_infos); @@ -1128,11 +1128,11 @@ class ObJoinOrder { const ObIArray& join_condition, const ObIArray& equal_join_condition, const ObJoinType join_type); - private: +private: int find_matching_cond(const ObIArray& join_conditions, const OrderItem& left_ordering, const OrderItem& right_ordering, const EqualSets& equal_sets, int64_t& common_prefix_idx); - private: +private: int compute_cost_and_prune_access_path(PathHelper& helper, ObIArray& access_paths); int revise_output_rows_after_creating_path(PathHelper& helper, ObIArray& access_paths); int fill_filters(const common::ObIArray& all_filters, const ObQueryRange* query_range, @@ -1195,7 +1195,7 @@ class ObJoinOrder { int add_partition_column( ObDMLStmt& stmt, const uint64_t table_id, const uint64_t column_id, ObIArray& partition_columns); - public: +public: inline double get_average_output_row_size() { return avg_output_row_size_; @@ -1209,7 +1209,7 @@ class ObJoinOrder { avg_output_row_size_ = average_row_size; } - private: +private: int choose_best_inner_path(const ObJoinOrder* left_tree, const ObJoinOrder* right_tree, const ObIArray& join_conditions, const ObJoinType join_type, const bool force_mat, ObIArray& right_inner_paths); @@ -1262,7 +1262,7 @@ class ObJoinOrder { friend class ::test::TestJoinOrder_ob_join_order_param_check_Test; friend class ::test::TestJoinOrder_ob_join_order_src_Test; - private: +private: common::ObIAllocator* allocator_; ObLogPlan* plan_; PathType type_; @@ -1299,7 +1299,7 @@ class ObJoinOrder { // cache for all inner path InnerPathInfos inner_path_infos_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObJoinOrder); }; } // namespace sql diff --git a/src/sql/optimizer/ob_log_append.h b/src/sql/optimizer/ob_log_append.h index 0a3066d2e..1f8f15e58 100644 --- a/src/sql/optimizer/ob_log_append.h +++ b/src/sql/optimizer/ob_log_append.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObLogAppend : public ObLogicalOperator { - public: +public: ObLogAppend(ObLogPlan& plan); virtual ~ObLogAppend() {} @@ -47,7 +47,7 @@ class ObLogAppend : public ObLogicalOperator { } VIRTUAL_TO_STRING_KV(K_(sub_plan_num)); - private: +private: ObLogPlan* sub_plan_[OB_SQL_MAX_CHILD_OPERATOR_NUM]; int64_t sub_plan_num_; }; diff --git a/src/sql/optimizer/ob_log_conflict_row_fetcher.h b/src/sql/optimizer/ob_log_conflict_row_fetcher.h index 3a04d37b0..74a40c1a4 100644 --- a/src/sql/optimizer/ob_log_conflict_row_fetcher.h +++ b/src/sql/optimizer/ob_log_conflict_row_fetcher.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogConflictRowFetcher : public ObLogicalOperator { - public: +public: ObLogConflictRowFetcher(ObLogPlan& plan) : ObLogicalOperator(plan), table_id_(common::OB_INVALID_ID), @@ -79,10 +79,10 @@ class ObLogConflictRowFetcher : public ObLogicalOperator { virtual int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const override; TO_STRING_KV(K_(table_id), K_(index_tid), K_(only_data_table), K_(conflict_exprs), K_(access_exprs)); - private: +private: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); - private: +private: uint64_t table_id_; uint64_t index_tid_; bool only_data_table_; diff --git a/src/sql/optimizer/ob_log_count.h b/src/sql/optimizer/ob_log_count.h index df2a258d1..6c124ba5f 100644 --- a/src/sql/optimizer/ob_log_count.h +++ b/src/sql/optimizer/ob_log_count.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObLogCount : public ObLogicalOperator { - public: +public: ObLogCount(ObLogPlan& plan) : ObLogicalOperator(plan), rownum_limit_expr_(NULL) {} virtual ~ObLogCount() @@ -43,7 +43,7 @@ class ObLogCount : public ObLogicalOperator { virtual int allocate_expr_pre(ObAllocExprContext& ctx) override; virtual int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const; - private: +private: ObRawExpr* rownum_limit_expr_; DISALLOW_COPY_AND_ASSIGN(ObLogCount); }; diff --git a/src/sql/optimizer/ob_log_del_upd.h b/src/sql/optimizer/ob_log_del_upd.h index f32feed75..bc91f1692 100644 --- a/src/sql/optimizer/ob_log_del_upd.h +++ b/src/sql/optimizer/ob_log_del_upd.h @@ -43,7 +43,7 @@ namespace sql { } class ObLogDelUpd : public ObLogicalOperator { - public: +public: ObLogDelUpd(ObLogPlan& plan); virtual ~ObLogDelUpd() = default; inline const common::ObIArray* get_all_table_columns() @@ -240,7 +240,7 @@ class ObLogDelUpd : public ObLogicalOperator { return table_phy_location_type_; } - protected: +protected: int generate_table_sharding_info(uint64_t loc_table_id, uint64_t ref_table_id, const ObPartHint* part_hint, ObTablePartitionInfo& table_partition_info, ObShardingInfo& sharding_info); int calculate_table_location(uint64_t loc_table_id, uint64_t ref_table_id, const ObPartHint* part_hint, @@ -252,14 +252,14 @@ class ObLogDelUpd : public ObLogicalOperator { ObShardingInfo& sharding_info, const ObPhyTableLocationInfo* phy_table_locaion_info, bool& is_needed); int add_all_table_assignments_to_ctx(const ObTablesAssignments* tables_assignments, ObAllocExprContext& ctx); - private: +private: int get_modify_table_id(uint64_t& table_id) const; int allocate_exchange_post_non_pdml(AllocExchContext* ctx); int allocate_exchange_post_pdml(AllocExchContext* ctx); int check_pdml_need_exchange(AllocExchContext* ctx, ObShardingInfo& target_sharding_info, bool& need_exchange); int do_reordering_project_columns(ObLogicalOperator& child); - protected: +protected: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); virtual int add_exprs_to_ctx_for_pdml( ObAllocExprContext& ctx, const ObIArray& input_exprs, uint64_t producer_id); @@ -267,7 +267,7 @@ class ObLogDelUpd : public ObLogicalOperator { int check_multi_table_dml_for_nested_execution(bool& is_needed); int set_hash_dist_column_exprs(ObExchangeInfo& exch_info, uint64_t index_id) const; - protected: +protected: const common::ObIArray* all_table_columns_; const common::ObIArray* check_constraint_exprs_; const common::ObIArray* table_columns_; @@ -287,11 +287,11 @@ class ObLogDelUpd : public ObLogicalOperator { ObTableLocationType table_phy_location_type_; bool table_location_uncertain_; - private: +private: ObRawExpr* pdml_partition_id_expr_; bool pdml_is_returning_; - protected: +protected: bool need_alloc_part_id_expr_; }; } // namespace sql diff --git a/src/sql/optimizer/ob_log_delete.h b/src/sql/optimizer/ob_log_delete.h index 453ac5a68..13a7b5aac 100644 --- a/src/sql/optimizer/ob_log_delete.h +++ b/src/sql/optimizer/ob_log_delete.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogDelete : public ObLogDelUpd { - public: +public: ObLogDelete(ObLogPlan& plan) : ObLogDelUpd(plan) {} virtual ~ObLogDelete() @@ -43,7 +43,7 @@ class ObLogDelete : public ObLogDelUpd { } virtual const char* get_name() const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogDelete); }; } // namespace sql diff --git a/src/sql/optimizer/ob_log_distinct.h b/src/sql/optimizer/ob_log_distinct.h index 3e8953854..c3240f527 100644 --- a/src/sql/optimizer/ob_log_distinct.h +++ b/src/sql/optimizer/ob_log_distinct.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObLogDistinct : public ObLogicalOperator { - public: +public: ObLogDistinct(ObLogPlan& plan) : ObLogicalOperator(plan), algo_(AGGREGATE_UNINITIALIZED), is_block_mode_(false) {} virtual ~ObLogDistinct() @@ -91,12 +91,12 @@ class ObLogDistinct : public ObLogicalOperator { virtual int compute_op_ordering() override; virtual int generate_link_sql_pre(GenLinkStmtContext& link_ctx) override; - private: +private: common::ObSEArray distinct_exprs_; AggregateAlgo algo_; bool is_block_mode_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogDistinct); }; diff --git a/src/sql/optimizer/ob_log_exchange.h b/src/sql/optimizer/ob_log_exchange.h index e72fa4f68..75e746ae4 100644 --- a/src/sql/optimizer/ob_log_exchange.h +++ b/src/sql/optimizer/ob_log_exchange.h @@ -20,7 +20,7 @@ namespace sql { class ObLogExchange : public ObLogicalOperator { typedef common::ObSEArray RepartColumnExprs; - public: +public: ObLogExchange(ObLogPlan& plan) : ObLogicalOperator(plan), is_producer_(false), @@ -233,14 +233,14 @@ class ObLogExchange : public ObLogicalOperator { } int update_sharding_conds(AllocExchContext& ctx); - private: +private: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); virtual int print_plan_head_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type) override; virtual int inner_replace_generated_agg_expr( const common::ObIArray >& to_replace_exprs) override; - private: +private: // the 'partition key' expressions bool is_producer_; /* true if the exchange the producer */ bool is_remote_; /* true if the exchange is remote single-server */ diff --git a/src/sql/optimizer/ob_log_expr_values.h b/src/sql/optimizer/ob_log_expr_values.h index 24db2dfa8..677afea50 100644 --- a/src/sql/optimizer/ob_log_expr_values.h +++ b/src/sql/optimizer/ob_log_expr_values.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogExprValues : public ObLogicalOperator { - public: +public: ObLogExprValues(ObLogPlan& plan) : ObLogicalOperator(plan), need_columnlized_(false) {} virtual int allocate_exchange_post(AllocExchContext* ctx) override; @@ -61,10 +61,10 @@ class ObLogExprValues : public ObLogicalOperator { virtual int allocate_expr_post(ObAllocExprContext& ctx) override; virtual int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const override; - private: +private: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); - private: +private: bool need_columnlized_; common::ObSEArray value_exprs_; // only engine 3.0 used diff --git a/src/sql/optimizer/ob_log_for_update.h b/src/sql/optimizer/ob_log_for_update.h index d554fed1f..f1472f336 100644 --- a/src/sql/optimizer/ob_log_for_update.h +++ b/src/sql/optimizer/ob_log_for_update.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogForUpdate : public ObLogDelUpd { - public: +public: ObLogForUpdate(ObLogPlan& plan); virtual ~ObLogForUpdate() {} @@ -64,7 +64,7 @@ class ObLogForUpdate : public ObLogDelUpd { int is_rowkey_nullable(const uint64_t table_id, bool& is_nullable) const; int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const; - private: +private: bool skip_locked_; int64_t wait_ts_; ObSEArray lock_tables_; diff --git a/src/sql/optimizer/ob_log_function_table.h b/src/sql/optimizer/ob_log_function_table.h index c42f88e4d..055ad8cac 100644 --- a/src/sql/optimizer/ob_log_function_table.h +++ b/src/sql/optimizer/ob_log_function_table.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogFunctionTable : public ObLogicalOperator { - public: +public: ObLogFunctionTable(ObLogPlan& plan) : ObLogicalOperator(plan), table_id_(OB_INVALID_ID), value_expr_(NULL) {} @@ -58,10 +58,10 @@ class ObLogFunctionTable : public ObLogicalOperator { } int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const; - private: +private: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); - private: +private: uint64_t table_id_; ObRawExpr* value_expr_; DISALLOW_COPY_AND_ASSIGN(ObLogFunctionTable); diff --git a/src/sql/optimizer/ob_log_granule_iterator.h b/src/sql/optimizer/ob_log_granule_iterator.h index b4116bc55..9fcaa58b5 100644 --- a/src/sql/optimizer/ob_log_granule_iterator.h +++ b/src/sql/optimizer/ob_log_granule_iterator.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObLogGranuleIterator : public ObLogicalOperator { - public: +public: ObLogGranuleIterator(ObLogPlan& plan) : ObLogicalOperator(plan), tablet_size_(common::OB_DEFAULT_TABLET_SIZE), @@ -131,7 +131,7 @@ class ObLogGranuleIterator : public ObLogicalOperator { int is_partition_gi(bool& partition_granule) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogGranuleIterator); int64_t tablet_size_; uint64_t gi_attri_flag_; diff --git a/src/sql/optimizer/ob_log_group_by.h b/src/sql/optimizer/ob_log_group_by.h index 175fde49a..aabd45ef9 100644 --- a/src/sql/optimizer/ob_log_group_by.h +++ b/src/sql/optimizer/ob_log_group_by.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObLogSort; class ObLogGroupBy : public ObLogicalOperator { - public: +public: ObLogGroupBy(ObLogPlan& plan) : ObLogicalOperator(plan), group_exprs_(), @@ -130,7 +130,7 @@ class ObLogGroupBy : public ObLogicalOperator { VIRTUAL_TO_STRING_KV(K_(group_exprs), K_(rollup_exprs), K_(aggr_exprs), K_(avg_div_exprs), K_(approx_count_distinct_estimate_ndv_exprs), K_(algo), K_(distinct_card)); - private: +private: /** * Aggregation functions analysis for child group-by operator * @@ -172,7 +172,7 @@ class ObLogGroupBy : public ObLogicalOperator { int child_has_exchange(const ObLogicalOperator* op, bool& find); virtual int compute_one_row_info() override; - private: +private: // the 'group-by' expressions common::ObSEArray group_exprs_; // the rollup expressions diff --git a/src/sql/optimizer/ob_log_insert.h b/src/sql/optimizer/ob_log_insert.h index edc260aab..1357bfbae 100644 --- a/src/sql/optimizer/ob_log_insert.h +++ b/src/sql/optimizer/ob_log_insert.h @@ -21,7 +21,7 @@ namespace sql { class ObSelectLogPlan; class ObPartIdRowMapManager; class ObLogDupKeyChecker { - public: +public: ObLogDupKeyChecker() : unique_index_cnt_(0), gui_lookup_root_(NULL), @@ -100,7 +100,7 @@ class ObLogDupKeyChecker { TO_STRING_KV( K_(unique_index_cnt), KPC_(gui_lookup_root), KPC_(table_scan_root), K_(gui_scan_roots), KPC_(constraint_infos)); - private: +private: int64_t unique_index_cnt_; ObLogicalOperator* gui_lookup_root_; ObRawExpr* gui_lookup_calc_part_expr_; @@ -112,7 +112,7 @@ class ObLogDupKeyChecker { }; class ObLogInsert : public ObLogDelUpd { - public: +public: ObLogInsert(ObLogPlan& plan) : ObLogDelUpd(plan), is_replace_(false), @@ -255,11 +255,11 @@ class ObLogInsert : public ObLogDelUpd { return value_exprs_; } - private: +private: void calc_phy_location_type(); int set_hash_dist_column_exprs(ObExchangeInfo& exch_info, uint64_t index_tid) const; - protected: +protected: int add_exprs_without_column_conv( const common::ObIArray& src_exprs, common::ObIArray& dst_exprs); virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); @@ -268,7 +268,7 @@ class ObLogInsert : public ObLogDelUpd { bool is_table_insert_sequence_part_key() const; virtual int check_output_dep_specific(ObRawExprCheckDep& checker); - protected: +protected: bool is_replace_; /** * @note These fields are added for the compatiblity of MySQL syntax and are not diff --git a/src/sql/optimizer/ob_log_insert_all.h b/src/sql/optimizer/ob_log_insert_all.h index 1c9cf02ba..a93c7a670 100644 --- a/src/sql/optimizer/ob_log_insert_all.h +++ b/src/sql/optimizer/ob_log_insert_all.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObLogInsertAll : public ObLogInsert { - public: +public: ObLogInsertAll(ObLogPlan& plan) : ObLogInsert(plan), is_multi_table_insert_(false), @@ -102,12 +102,12 @@ class ObLogInsertAll : public ObLogInsert { } int remove_const_expr(const common::ObIArray& old_exprs, common::ObIArray& new_exprs) const; - protected: +protected: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); virtual int need_multi_table_dml(AllocExchContext& ctx, ObShardingInfo& sharding_info, bool& is_needed) override; int is_insert_table_id(uint64_t table_id, bool& is_true) const; - private: +private: bool is_multi_table_insert_; bool is_multi_insert_first_; bool is_multi_conditions_insert_; diff --git a/src/sql/optimizer/ob_log_join.h b/src/sql/optimizer/ob_log_join.h index 4631ff4f2..d47d00e60 100644 --- a/src/sql/optimizer/ob_log_join.h +++ b/src/sql/optimizer/ob_log_join.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObLogicalOperator; class ObLogJoin : public ObLogicalOperator { - public: +public: ObLogJoin(ObLogPlan& plan) : ObLogicalOperator(plan), join_conditions_(), @@ -291,7 +291,7 @@ class ObLogJoin : public ObLogicalOperator { return connect_by_extra_exprs_.assign(exprs); } - private: +private: inline bool can_enable_gi_partition_pruning() { return (NESTED_LOOP_JOIN == join_algo_) && join_dist_algo_ == JoinDistAlgo::DIST_PARTITION_NONE; @@ -335,7 +335,7 @@ class ObLogJoin : public ObLogicalOperator { return SM_NONE != slave_mapping_type_; } - private: +private: // all join predicates common::ObSEArray join_conditions_; // equal join condition, for // merge-join diff --git a/src/sql/optimizer/ob_log_limit.h b/src/sql/optimizer/ob_log_limit.h index 7a782400e..fd2556945 100644 --- a/src/sql/optimizer/ob_log_limit.h +++ b/src/sql/optimizer/ob_log_limit.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogLimit : public ObLogicalOperator { - public: +public: ObLogLimit(ObLogPlan& plan) : ObLogicalOperator(plan), is_calc_found_rows_(false), @@ -106,7 +106,7 @@ class ObLogLimit : public ObLogicalOperator { return is_fetch_with_ties_; } - private: +private: bool is_calc_found_rows_; bool has_union_child_; bool is_top_limit_; diff --git a/src/sql/optimizer/ob_log_link.h b/src/sql/optimizer/ob_log_link.h index 9b305f338..c24beeea4 100644 --- a/src/sql/optimizer/ob_log_link.h +++ b/src/sql/optimizer/ob_log_link.h @@ -21,7 +21,7 @@ namespace sql { typedef common::ObIArray ObStringIArray; class ObLogLink : public ObLogicalOperator { - public: +public: ObLogLink(ObLogPlan& plan); virtual ~ObLogLink() {} @@ -47,11 +47,11 @@ class ObLogLink : public ObLogicalOperator { return stmt_fmt_len_; } - private: +private: int gen_link_stmt_fmt_buf(); int gen_link_stmt_param_infos(); - private: +private: common::ObIAllocator& allocator_; ObLinkStmt link_stmt_; char* stmt_fmt_buf_; diff --git a/src/sql/optimizer/ob_log_material.h b/src/sql/optimizer/ob_log_material.h index e04d02868..d047576b6 100644 --- a/src/sql/optimizer/ob_log_material.h +++ b/src/sql/optimizer/ob_log_material.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObLogMaterial : public ObLogicalOperator { - public: +public: ObLogMaterial(ObLogPlan& plan) : ObLogicalOperator(plan) {} virtual ~ObLogMaterial() @@ -36,7 +36,7 @@ class ObLogMaterial : public ObLogicalOperator { return true; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogMaterial); }; } // namespace sql diff --git a/src/sql/optimizer/ob_log_merge.h b/src/sql/optimizer/ob_log_merge.h index 06dfeb98a..8e5e48416 100644 --- a/src/sql/optimizer/ob_log_merge.h +++ b/src/sql/optimizer/ob_log_merge.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogMerge : public ObLogInsert { - public: +public: ObLogMerge(ObLogPlan& plan) : ObLogInsert(plan), match_condition_exprs_(NULL), @@ -89,13 +89,13 @@ class ObLogMerge : public ObLogInsert { int classify_merge_subquery_expr(const ObIArray& exprs, ObIArray& subquery_exprs, ObIArray& non_subquery_exprs); - private: +private: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); virtual int check_output_dep_specific(ObRawExprCheckDep& checker) override; int add_all_source_table_columns_to_ctx(ObAllocExprContext& ctx); DISALLOW_COPY_AND_ASSIGN(ObLogMerge); - private: +private: const common::ObIArray* match_condition_exprs_; const common::ObIArray* insert_condition_exprs_; const common::ObIArray* update_condition_exprs_; diff --git a/src/sql/optimizer/ob_log_monitoring_dump.h b/src/sql/optimizer/ob_log_monitoring_dump.h index 54a96e8a5..f9d04f638 100644 --- a/src/sql/optimizer/ob_log_monitoring_dump.h +++ b/src/sql/optimizer/ob_log_monitoring_dump.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObLogMonitoringDump : public ObLogicalOperator { - public: +public: ObLogMonitoringDump(ObLogPlan& plan) : ObLogicalOperator(plan), flags_(0), dst_op_line_id_(0) {} virtual ~ObLogMonitoringDump() = default; @@ -49,7 +49,7 @@ class ObLogMonitoringDump : public ObLogicalOperator { return dst_op_line_id_; } - private: +private: uint64_t flags_; uint64_t dst_op_line_id_; DISALLOW_COPY_AND_ASSIGN(ObLogMonitoringDump); diff --git a/src/sql/optimizer/ob_log_mv_table_scan.h b/src/sql/optimizer/ob_log_mv_table_scan.h index 49c501e5f..bb4b47d01 100644 --- a/src/sql/optimizer/ob_log_mv_table_scan.h +++ b/src/sql/optimizer/ob_log_mv_table_scan.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObLogMVTableScan : public ObLogTableScan { - public: +public: ObLogMVTableScan(ObLogPlan& plan); virtual ~ObLogMVTableScan() {} @@ -33,7 +33,7 @@ class ObLogMVTableScan : public ObLogTableScan { depend_table_id_ = depend_tid; } - private: +private: ObTablePartitionInfo right_table_partition_info_; uint64_t depend_table_id_; }; diff --git a/src/sql/optimizer/ob_log_operator_factory.h b/src/sql/optimizer/ob_log_operator_factory.h index 3fbbff7cc..e953a7ed6 100644 --- a/src/sql/optimizer/ob_log_operator_factory.h +++ b/src/sql/optimizer/ob_log_operator_factory.h @@ -148,7 +148,7 @@ inline const char* JoinAlgo_to_hint_str(JoinAlgo algo) } class ObLogPlan; class ObLogOperatorFactory { - public: +public: explicit ObLogOperatorFactory(common::ObIAllocator& allocator); ~ObLogOperatorFactory() { @@ -157,7 +157,7 @@ class ObLogOperatorFactory { ObLogicalOperator* allocate(ObLogPlan& plan, log_op_def::ObLogOpType type); void destory(); - private: +private: common::ObIAllocator& allocator_; common::ObObjStore op_store_; }; diff --git a/src/sql/optimizer/ob_log_plan.h b/src/sql/optimizer/ob_log_plan.h index 6248eccf7..f5b362002 100644 --- a/src/sql/optimizer/ob_log_plan.h +++ b/src/sql/optimizer/ob_log_plan.h @@ -108,7 +108,7 @@ struct plan_line { // explain plan text class planText { - public: +public: static const int64_t SIMPLE_COLUMN_NUM = 3; planText(char* buffer, const int64_t buffer_len, ExplainType type) : level(0), @@ -167,7 +167,7 @@ typedef common::ObSEArray JoinOrderArray; * Base class for logical plan for all DML/select statements */ class ObLogPlan { - public: +public: friend class ::test::ObLogPlanTest_ob_explain_test_Test; typedef common::ObList ObAddrList; @@ -177,7 +177,7 @@ class ObLogPlan { static int select_replicas(ObExecContext& exec_ctx, bool is_weak, const common::ObAddr& local_server, common::ObIArray& phy_tbl_loc_info_list); - public: +public: ObLogPlan(ObOptimizerContext& ctx, const ObDMLStmt* stmt); virtual ~ObLogPlan(); @@ -531,7 +531,7 @@ class ObLogPlan { int check_fullfill_safe_update_mode(ObLogicalOperator* op); int do_check_fullfill_safe_update_mode(ObLogicalOperator* top, bool& is_not_fullfill); - public: +public: struct CandidatePlan { CandidatePlan(ObLogicalOperator* plan_tree) : plan_tree_(plan_tree) {} @@ -809,7 +809,7 @@ class ObLogPlan { return startup_filters_; } - protected: +protected: int update_plans_interesting_order_info(ObIArray& candidate_plans, const int64_t check_scope); int prune_and_keep_best_plans(ObIArray& candidate_plans); @@ -1053,7 +1053,7 @@ class ObLogPlan { int calc_plan_resource(); - private: // member functions +private: // member functions static int set_table_location( ObTaskExecutorCtx& task_exec_ctx, common::ObIArray& phy_tbl_loc_info_list); @@ -1082,10 +1082,10 @@ class ObLogPlan { const common::ObIArray& base_location_cons, ObIArray& pwj_tables, ObPwjComparer& pwj_comparer, PWJPartitionIdMap& pwj_map) const; - private: +private: static const int64_t DEFAULT_SEARCH_SPACE_RELS = 10; - protected: // member variable +protected: // member variable ObOptimizerContext& optimizer_context_; common::ObIAllocator& allocator_; const ObDMLStmt* stmt_; @@ -1097,7 +1097,7 @@ class ObLogPlan { common::ObSEArray pushdown_filters_; - private: // member variable +private: // member variable ObQueryRefRawExpr* query_ref_; ObLogicalOperator* root_; // root operator common::ObString sql_text_; // SQL string @@ -1109,7 +1109,7 @@ class ObLogPlan { common::ObSEArray startup_filters_; common::ObSEArray user_var_filters_; - private: +private: struct LeadingInfo { TO_STRING_KV(K_(table_set), K_(left_table_set), K_(right_table_set)); diff --git a/src/sql/optimizer/ob_log_plan_factory.h b/src/sql/optimizer/ob_log_plan_factory.h index 4b1197da2..a1bcaa7c4 100644 --- a/src/sql/optimizer/ob_log_plan_factory.h +++ b/src/sql/optimizer/ob_log_plan_factory.h @@ -24,17 +24,17 @@ class ObLogPlan; class ObOptimizerContext; class ObDMLStmt; class ObLogPlanFactory { - public: +public: explicit ObLogPlanFactory(common::ObIAllocator& allocator); ~ObLogPlanFactory(); ObLogPlan* create(ObOptimizerContext& ctx, const ObDMLStmt& stmt); void destroy(); - private: +private: common::ObIAllocator& allocator_; common::ObObjStore plan_store_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogPlanFactory); }; } // namespace sql diff --git a/src/sql/optimizer/ob_log_select_into.h b/src/sql/optimizer/ob_log_select_into.h index 8b1bf4875..849a99221 100644 --- a/src/sql/optimizer/ob_log_select_into.h +++ b/src/sql/optimizer/ob_log_select_into.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObLogSelectInto : public ObLogicalOperator { - public: +public: ObLogSelectInto(ObLogPlan& plan) : ObLogicalOperator(plan), into_type_(T_INTO_OUTFILE), @@ -102,7 +102,7 @@ class ObLogSelectInto : public ObLogicalOperator { virtual uint64_t hash(uint64_t seed) const; virtual int copy_without_child(ObLogicalOperator*& out); - private: +private: ObItemType into_type_; common::ObObj outfile_name_; common::ObObj filed_str_; diff --git a/src/sql/optimizer/ob_log_sequence.h b/src/sql/optimizer/ob_log_sequence.h index 50f606918..e7fd91945 100644 --- a/src/sql/optimizer/ob_log_sequence.h +++ b/src/sql/optimizer/ob_log_sequence.h @@ -17,10 +17,10 @@ namespace oceanbase { namespace sql { class ObLogSequence : public ObLogicalOperator { - private: +private: typedef common::ObSEArray SequenceIdArray; - public: +public: ObLogSequence(ObLogPlan& plan) : ObLogicalOperator(plan) {} virtual ~ObLogSequence() @@ -39,7 +39,7 @@ class ObLogSequence : public ObLogicalOperator { } virtual int est_cost() override; - private: +private: SequenceIdArray nextval_seq_ids_; }; } // namespace sql diff --git a/src/sql/optimizer/ob_log_set.h b/src/sql/optimizer/ob_log_set.h index ea719be31..d776069df 100644 --- a/src/sql/optimizer/ob_log_set.h +++ b/src/sql/optimizer/ob_log_set.h @@ -20,7 +20,7 @@ namespace sql { class ObBasicCostInfo; class ObLogSet : public ObLogicalOperator { - public: +public: ObLogSet(ObLogPlan& plan) : ObLogicalOperator(plan), is_distinct_(true), @@ -180,7 +180,7 @@ class ObLogSet : public ObLogicalOperator { return SM_NONE != slave_mapping_type_; } - private: +private: virtual int inner_replace_generated_agg_expr( const common::ObIArray>& to_replace_exprs) override; int allocate_implicit_sort_v2_for_set(const int64_t index, common::ObIArray& order_keys); @@ -206,7 +206,7 @@ class ObLogSet : public ObLogicalOperator { return ret; } - private: +private: bool is_distinct_; bool is_recursive_union_; bool is_breadth_search_; diff --git a/src/sql/optimizer/ob_log_sort.h b/src/sql/optimizer/ob_log_sort.h index 678d42de9..a609eeadb 100644 --- a/src/sql/optimizer/ob_log_sort.h +++ b/src/sql/optimizer/ob_log_sort.h @@ -23,7 +23,7 @@ class ObLogSort : public ObLogicalOperator { // for calc pushed down sort cost static constexpr double DISTRIBUTED_SORT_COST_RATIO = .8; - public: +public: ObLogSort(ObLogPlan& plan) : ObLogicalOperator(plan), sort_keys_(), @@ -134,14 +134,14 @@ class ObLogSort : public ObLogicalOperator { virtual int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const; virtual int generate_link_sql_pre(GenLinkStmtContext& link_ctx) override; - protected: +protected: virtual int inner_replace_generated_agg_expr( const common::ObIArray>& to_replace_exprs); - private: +private: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); - private: +private: common::ObSEArray sort_keys_; ObRawExpr* topn_count_; int64_t minimum_row_count_; diff --git a/src/sql/optimizer/ob_log_subplan_filter.h b/src/sql/optimizer/ob_log_subplan_filter.h index c3d5f1fcd..f9d891a66 100644 --- a/src/sql/optimizer/ob_log_subplan_filter.h +++ b/src/sql/optimizer/ob_log_subplan_filter.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObBasicCostInfo; class ObLogSubPlanFilter : public ObLogicalOperator { - public: +public: ObLogSubPlanFilter(ObLogPlan& plan) : ObLogicalOperator(plan), exec_params_(), @@ -127,14 +127,14 @@ class ObLogSubPlanFilter : public ObLogicalOperator { int allocate_granule_post(AllocGIContext& ctx); virtual int compute_one_row_info() override; - protected: +protected: common::ObSEArray, 8, common::ModulePageAllocator, true> exec_params_; common::ObSEArray, 8, common::ModulePageAllocator, true> onetime_exprs_; common::ObBitSet<> init_plan_idxs_; common::ObBitSet<> one_time_idxs_; bool update_set_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogSubPlanFilter); }; } // end of namespace sql diff --git a/src/sql/optimizer/ob_log_subplan_scan.h b/src/sql/optimizer/ob_log_subplan_scan.h index fe5e5e281..44638bc1a 100644 --- a/src/sql/optimizer/ob_log_subplan_scan.h +++ b/src/sql/optimizer/ob_log_subplan_scan.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogSubPlanScan : public ObLogicalOperator { - public: +public: ObLogSubPlanScan(ObLogPlan& plan) : ObLogicalOperator(plan), subquery_id_(common::OB_INVALID_ID), subquery_name_(), access_exprs_() {} @@ -60,12 +60,12 @@ class ObLogSubPlanScan : public ObLogicalOperator { virtual int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const; virtual int generate_link_sql_pre(GenLinkStmtContext& link_ctx) override; - private: +private: virtual int print_operator_for_outline(planText& plan_text); virtual int is_used_join_type_hint(JoinAlgo join_algo, bool& is_used); virtual int is_used_in_leading_hint(bool& is_used); - private: +private: uint64_t subquery_id_; common::ObString subquery_name_; common::ObSEArray access_exprs_; diff --git a/src/sql/optimizer/ob_log_table_lookup.h b/src/sql/optimizer/ob_log_table_lookup.h index 83d401009..fb0d7f0dd 100644 --- a/src/sql/optimizer/ob_log_table_lookup.h +++ b/src/sql/optimizer/ob_log_table_lookup.h @@ -21,7 +21,7 @@ namespace sql { class Path; class ObLogTableLookup : public ObLogicalOperator { - public: +public: ObLogTableLookup(ObLogPlan& plan) : ObLogicalOperator(plan), table_id_(common::OB_INVALID_ID), @@ -99,7 +99,7 @@ class ObLogTableLookup : public ObLogicalOperator { int init_calc_part_id_expr(); int replace_gen_column(ObRawExpr* part_expr, ObRawExpr*& new_part_expr); - private: +private: uint64_t table_id_; uint64_t ref_table_id_; uint64_t index_id_; diff --git a/src/sql/optimizer/ob_log_table_scan.h b/src/sql/optimizer/ob_log_table_scan.h index d8ca2353c..110664154 100644 --- a/src/sql/optimizer/ob_log_table_scan.h +++ b/src/sql/optimizer/ob_log_table_scan.h @@ -27,7 +27,7 @@ class ObLogTableScan : public ObLogicalOperator { // ObLogTableLookup has a log tsc to read remote data table. friend class ObLogTableLookup; - public: +public: ObLogTableScan(ObLogPlan& plan) : ObLogicalOperator(plan), table_id_(common::OB_INVALID_ID), @@ -692,7 +692,7 @@ class ObLogTableScan : public ObLogicalOperator { int add_mapping_column_for_vt(ObColumnRefRawExpr* col_expr); - private: // member functions +private: // member functions // called when index_back_ set int pick_out_query_range_exprs(); int pick_out_startup_filters(); @@ -724,7 +724,7 @@ class ObLogTableScan : public ObLogicalOperator { virtual int check_output_dep_specific(ObRawExprCheckDep& checker) override; int try_add_extra_access_exprs_for_lob_col(); - protected: // memeber variables +protected: // memeber variables // basic info uint64_t table_id_; // table id or alias table id uint64_t ref_table_id_; // base table id diff --git a/src/sql/optimizer/ob_log_temp_table_access.h b/src/sql/optimizer/ob_log_temp_table_access.h index 0cea2262b..72beb615b 100644 --- a/src/sql/optimizer/ob_log_temp_table_access.h +++ b/src/sql/optimizer/ob_log_temp_table_access.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObLogTempTableAccess : public ObLogicalOperator { - public: +public: ObLogTempTableAccess(ObLogPlan& plan); virtual ~ObLogTempTableAccess(); virtual int copy_without_child(ObLogicalOperator*& out) @@ -74,10 +74,10 @@ class ObLogTempTableAccess : public ObLogicalOperator { } virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogTempTableAccess); - private: +private: uint64_t table_id_; uint64_t ref_table_id_; common::ObString temp_table_name_; diff --git a/src/sql/optimizer/ob_log_temp_table_insert.h b/src/sql/optimizer/ob_log_temp_table_insert.h index 82813c1d2..59b27bee7 100644 --- a/src/sql/optimizer/ob_log_temp_table_insert.h +++ b/src/sql/optimizer/ob_log_temp_table_insert.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObLogTempTableInsert : public ObLogicalOperator { - public: +public: ObLogTempTableInsert(ObLogPlan& plan); virtual ~ObLogTempTableInsert(); @@ -48,7 +48,7 @@ class ObLogTempTableInsert : public ObLogicalOperator { return temp_table_name_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogTempTableInsert); uint64_t ref_table_id_; common::ObString temp_table_name_; diff --git a/src/sql/optimizer/ob_log_temp_table_transformation.h b/src/sql/optimizer/ob_log_temp_table_transformation.h index 928ef2d0f..fb1c00d15 100644 --- a/src/sql/optimizer/ob_log_temp_table_transformation.h +++ b/src/sql/optimizer/ob_log_temp_table_transformation.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObLogTempTableTransformation : public ObLogicalOperator { - public: +public: ObLogTempTableTransformation(ObLogPlan& plan); virtual ~ObLogTempTableTransformation(); diff --git a/src/sql/optimizer/ob_log_topk.h b/src/sql/optimizer/ob_log_topk.h index 16698ef70..bdaf78df7 100644 --- a/src/sql/optimizer/ob_log_topk.h +++ b/src/sql/optimizer/ob_log_topk.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogTopk : public ObLogicalOperator { - public: +public: ObLogTopk(ObLogPlan& plan) : ObLogicalOperator(plan), minimum_row_count_(0), @@ -55,7 +55,7 @@ class ObLogTopk : public ObLogicalOperator { virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); virtual int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const; - private: +private: int64_t minimum_row_count_; int64_t topk_precision_; ObRawExpr* topk_limit_count_; diff --git a/src/sql/optimizer/ob_log_unpivot.h b/src/sql/optimizer/ob_log_unpivot.h index 4fd88d438..d18406797 100644 --- a/src/sql/optimizer/ob_log_unpivot.h +++ b/src/sql/optimizer/ob_log_unpivot.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObLogUnpivot : public ObLogicalOperator { - public: +public: ObLogUnpivot(ObLogPlan& plan) : ObLogicalOperator(plan), subquery_id_(common::OB_INVALID_ID), subquery_name_(), access_exprs_() {} @@ -64,13 +64,13 @@ class ObLogUnpivot : public ObLogicalOperator { virtual int compute_fd_item_set() override; virtual int compute_one_row_info() override; - public: +public: uint64_t subquery_id_; common::ObString subquery_name_; common::ObArray access_exprs_; ObUnpivotInfo unpivot_info_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLogUnpivot); }; diff --git a/src/sql/optimizer/ob_log_update.h b/src/sql/optimizer/ob_log_update.h index e05c70395..8c6f9e278 100644 --- a/src/sql/optimizer/ob_log_update.h +++ b/src/sql/optimizer/ob_log_update.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogUpdate : public ObLogDelUpd { - public: +public: ObLogUpdate(ObLogPlan& plan) : ObLogDelUpd(plan), tables_assignments_(NULL), update_set_(false) {} virtual ~ObLogUpdate() @@ -54,14 +54,14 @@ class ObLogUpdate : public ObLogDelUpd { virtual int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const; - private: +private: virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type); int get_update_table(ObDMLStmt* stmt, ObColumnRefRawExpr* col_expr, uint64_t& ref_id); virtual int need_multi_table_dml(AllocExchContext& ctx, ObShardingInfo& sharding_info, bool& is_needed) override; - private: +private: // MySQL only, https://dev.mysql.com/doc/refman/8.0/en/update.html const ObTablesAssignments* tables_assignments_; // update ... set (a,b) = (subquery), (d,e) = (subquery) diff --git a/src/sql/optimizer/ob_log_values.h b/src/sql/optimizer/ob_log_values.h index 320b2ca70..8fd27b73b 100644 --- a/src/sql/optimizer/ob_log_values.h +++ b/src/sql/optimizer/ob_log_values.h @@ -23,7 +23,7 @@ namespace sql { * ObLogValues is currently being used as 'explain' and 'help' operator. */ class ObLogValues : public ObLogicalOperator { - public: +public: static const int64_t MAX_EXPLAIN_BUFFER_SIZE = 1024 * 1024; ObLogValues(ObLogPlan& plan) : ObLogicalOperator(plan), explain_plan_(NULL), stmt_(NULL), row_store_(plan.get_allocator()) @@ -96,7 +96,7 @@ class ObLogValues : public ObLogicalOperator { return ret; } - private: +private: ObLogPlan* explain_plan_; ObStmt* stmt_; common::ObRowStore row_store_; diff --git a/src/sql/optimizer/ob_log_window_function.h b/src/sql/optimizer/ob_log_window_function.h index 51529cbc1..bb0e253c3 100644 --- a/src/sql/optimizer/ob_log_window_function.h +++ b/src/sql/optimizer/ob_log_window_function.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLogWindowFunction : public ObLogicalOperator { - public: +public: ObLogWindowFunction(ObLogPlan& plan) : ObLogicalOperator(plan), is_parallel_(false) {} virtual ~ObLogWindowFunction() @@ -52,7 +52,7 @@ class ObLogWindowFunction : public ObLogicalOperator { } int match_parallel_condition(bool& can_parallel); - private: +private: ObSEArray win_exprs_; bool is_parallel_; }; diff --git a/src/sql/optimizer/ob_logical_operator.h b/src/sql/optimizer/ob_logical_operator.h index 5312dfe7c..ca5f4be1d 100644 --- a/src/sql/optimizer/ob_logical_operator.h +++ b/src/sql/optimizer/ob_logical_operator.h @@ -279,7 +279,7 @@ struct FilterCompare { }; class AdjustSortContext { - public: +public: bool has_exchange_; // count the exchange, in-out will be add 2 int64_t exchange_cnt_; @@ -289,7 +289,7 @@ class AdjustSortContext { }; class AllocGIContext { - public: +public: enum GIState { GIS_NORMAL = 0, GIS_IN_PARTITION_WISE, @@ -297,7 +297,7 @@ class AllocGIContext { GIS_PARTITION, }; - public: +public: explicit AllocGIContext(int64_t parallel) : alloc_gi_(false), tablet_size_(common::OB_DEFAULT_TABLET_SIZE), @@ -394,7 +394,7 @@ class AllocGIContext { }; class ObAllocGIInfo { - public: +public: ObAllocGIInfo() : state_(AllocGIContext::GIS_NORMAL), pw_op_ptr_(nullptr), @@ -424,14 +424,14 @@ class ObAllocGIInfo { }; class AllocMDContext { - public: +public: AllocMDContext() : org_op_id_(0){}; ~AllocMDContext() = default; int64_t org_op_id_; }; class AllocExchContext { - public: +public: enum DistrStat { UNINITIALIZED = 0, LOCAL, @@ -591,7 +591,7 @@ struct ObExchangeInfo { K_(hash_dist_exprs), "dist_method", ObPQDistributeMethod::get_type_string(dist_method_), K_(px_dop), K_(px_single), K_(repartition_func_exprs), K_(keep_ordering), K_(pdml_pkey), K_(slave_mapping_type)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObExchangeInfo); }; @@ -599,7 +599,7 @@ struct ObExchangeInfo { * Expr and its producer operator */ class ExprProducer { - public: +public: ExprProducer() : expr_(NULL), producer_branch_(common::OB_INVALID_ID), @@ -678,7 +678,7 @@ struct ObAllocExprContext { struct ObPxPipeBlockingCtx { // Look through the pipe (may be blocked by block operator), ended with a exchange operator or not. class PipeEnd { - public: + public: PipeEnd() : exch_(false) {} explicit PipeEnd(const bool is_exch) : exch_(is_exch) @@ -693,7 +693,7 @@ struct ObPxPipeBlockingCtx { } TO_STRING_KV(K_(exch)); - private: + private: bool exch_; }; @@ -730,7 +730,7 @@ struct ObPxPipeBlockingCtx { OpCtx* alloc(); TO_STRING_KV(K(op_ctxs_)); - private: +private: common::ObIAllocator& alloc_; common::ObArray op_ctxs_; }; @@ -745,7 +745,7 @@ typedef common::ObArray ObRawExprArray; class GenLinkStmtContext; class ObLinkStmt { - public: +public: explicit ObLinkStmt(common::ObIAllocator& alloc, const ObRawExprIArray& output_exprs) : link_ctx_(NULL), alloc_(alloc), @@ -810,7 +810,7 @@ class ObLinkStmt { int fill_orderby_strs(const ObOrderItemIArray& order_items, const ObRawExprIArray& output_exprs); int32_t get_total_size() const; - private: +private: int fill_exprs( const ObRawExprIArray& exprs, const common::ObString& sep, ObStringList& strs, bool skip_nl_param = false); int fill_exprs(const ObRawExprIArray& exprs, const common::ObString& sep, ObStringList& strs, ObStringListIter& iter, @@ -833,7 +833,7 @@ class ObLinkStmt { int do_expr_in_nl_param(ObRawExpr* expr, bool& in_nl_param); int get_nl_param_columns(ObRawExpr* param_expr, ObRawExprIArray& access_exprs, ObRawExprIArray& param_columns); - public: +public: GenLinkStmtContext* link_ctx_; common::ObIAllocator& alloc_; const ObRawExprIArray& root_output_exprs_; @@ -855,7 +855,7 @@ class ObLinkStmt { bool is_inited_; bool is_distinct_; - public: +public: static const common::ObString TABLE_BLANK_; static const common::ObString JOIN_ON_; static const common::ObString LEFT_BRACKET_; @@ -882,7 +882,7 @@ class ObLinkStmt { }; class GenLinkStmtContext { - public: +public: GenLinkStmtContext() : dblink_id_(OB_INVALID_ID), link_stmt_(NULL), nl_param_idxs_() {} uint64_t dblink_id_; @@ -894,7 +894,7 @@ class GenLinkStmtContext { class Path; class ObLogPlan; class ObLogicalOperator { - public: +public: friend class ObLogExprValues; friend class ObLogFunctionTable; typedef common::ObBitSet PPDeps; @@ -1982,12 +1982,12 @@ class ObLogicalOperator { int check_fulfill_cut_ratio_condition(int64_t dop, double ndv, bool& is_fulfill); - public: +public: /* child operators */ ObSEArray child_; // ObLogicalOperator *child_[max_num_of_child]; - protected: +protected: enum TraverseType { JOIN_METHOD, MATERIAL_NL, LEADING, PQ_DIST, PQ_MAP }; enum JoinTreeType { INVALID_TYPE, LEFT_DEEP, RIGHT_DEEP, BUSHY }; @@ -2106,7 +2106,7 @@ class ObLogicalOperator { int check_need_sort_for_local_order(const int64_t index, const common::ObIArray* order_items, bool& need); - protected: +protected: int alloc_partition_id_expr(uint64_t table_id, ObAllocExprContext& ctx, ObPseudoColumnRawExpr*& partition_id_expr); void add_join_dist_flag(uint64_t& flags, JoinDistAlgo method) const @@ -2129,7 +2129,7 @@ class ObLogicalOperator { flags = 0; } - protected: +protected: log_op_def::ObLogOpType type_; ObLogPlan* my_plan_; // the entry point of the plan common::ObSEArray output_exprs_; // expressions produced @@ -2149,7 +2149,7 @@ class ObLogicalOperator { uint64_t branch_id_; uint64_t op_id_; - private: +private: /** * Numbering the operator */ @@ -2199,11 +2199,11 @@ class ObLogicalOperator { // get the table dop for this dfo int calc_current_dfo_table_dop(ObLogicalOperator* root, int64_t& table_dop, bool& found_base_table); - private: +private: int64_t child_id_; // parent child ObLogicalOperator* parent_; // parent operator bool is_plan_root_; // plan root operator - protected: +protected: double cost_; // cost up to this point double op_cost_; // cost for this operator double card_; // cardinality @@ -2224,7 +2224,7 @@ class ObLogicalOperator { uint64_t dblink_id_; int64_t plan_depth_; - private: +private: // unify to use get, set and reset function instead of using op_ordering_ bool is_at_most_one_row_; common::ObSEArray op_ordering_; diff --git a/src/sql/optimizer/ob_merge_log_plan.h b/src/sql/optimizer/ob_merge_log_plan.h index 2c24c1b94..9a5fc771d 100644 --- a/src/sql/optimizer/ob_merge_log_plan.h +++ b/src/sql/optimizer/ob_merge_log_plan.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObMergeLogPlan : public ObInsertLogPlan { - public: +public: ObMergeLogPlan(ObOptimizerContext& ctx, const ObDMLStmt* merge_stmt) : ObInsertLogPlan(ctx, merge_stmt) {} virtual ~ObMergeLogPlan() @@ -26,7 +26,7 @@ class ObMergeLogPlan : public ObInsertLogPlan { int generate_raw_plan(); virtual int generate_plan(); - private: +private: int allocate_merge_operator_as_top(ObLogicalOperator*& top); int allocate_merge_subquery(); int get_update_insert_condition_subquery(ObRawExpr* matched_expr, ObRawExpr* null_expr, bool& update_has_subquery, diff --git a/src/sql/optimizer/ob_opt_est_cost.h b/src/sql/optimizer/ob_opt_est_cost.h index 771ba5b61..4800d6f89 100644 --- a/src/sql/optimizer/ob_opt_est_cost.h +++ b/src/sql/optimizer/ob_opt_est_cost.h @@ -77,7 +77,7 @@ struct ObTableMetaInfo { bool is_only_memtable_data_; // whether has only memtable data EstimatedPartition table_est_part_; ObEstimateType cost_est_type_; // cost estimation type - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableMetaInfo); }; @@ -106,7 +106,7 @@ struct ObIndexMetaInfo { bool is_index_back_; // is index back bool is_unique_index_; // is unique index bool is_global_index_; // whether is global index - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIndexMetaInfo); }; @@ -208,7 +208,7 @@ struct ObCostTableScanInfo { common::ObSimpleBatch::ObBatchType batch_type_; SampleInfo sample_info_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCostTableScanInfo); }; @@ -241,7 +241,7 @@ struct ObCostBaseJoinInfo : public ObTwoChildrenNodeCostInfo { const common::ObIArray& other_join_condition_; ObEstSelInfo* est_sel_info_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCostBaseJoinInfo); }; @@ -265,7 +265,7 @@ struct ObCostNLJoinInfo : public ObCostBaseJoinInfo { bool with_nl_param_; bool need_mat_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCostNLJoinInfo); }; @@ -287,7 +287,7 @@ struct ObCostMergeJoinInfo : public ObCostBaseJoinInfo { const common::ObIArray& left_need_ordering_; const common::ObIArray& right_need_ordering_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCostMergeJoinInfo); }; @@ -306,7 +306,7 @@ struct ObCostHashJoinInfo : public ObCostBaseJoinInfo { K_(left_ids), K_(right_ids), K_(join_type), K_(equal_join_condition), K_(other_join_condition)); virtual ~ObCostHashJoinInfo(){}; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCostHashJoinInfo); }; @@ -365,7 +365,7 @@ struct ObSortCostInfo { }; class ObOptEstCost { - public: +public: const static int64_t MAX_STORAGE_RANGE_ESTIMATION_NUM; struct ObCostParams { @@ -585,7 +585,7 @@ class ObOptEstCost { ObIArray* all_predicate_sel, double& output_row_count, double& query_range_row_count, double& phy_query_range_row_count, double& index_back_row_count); - private: +private: static int cost_prefix_sort(const ObSortCostInfo& cost_info, const ObIArray& order_exprs, double& cost); static int cost_topn_sort(const ObSortCostInfo& cost_info, const ObIArray& types, double& cost); static int cost_topn_sort_inner(const ObIArray& types, double rows, double n, double& cost); @@ -640,7 +640,7 @@ class ObOptEstCost { const static double hash_params_[common::ObMaxTC + 1]; const static ObCostParams cost_params_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOptEstCost); }; diff --git a/src/sql/optimizer/ob_opt_est_sel.h b/src/sql/optimizer/ob_opt_est_sel.h index ad9e9e008..2fbc014dc 100644 --- a/src/sql/optimizer/ob_opt_est_sel.h +++ b/src/sql/optimizer/ob_opt_est_sel.h @@ -60,7 +60,7 @@ enum ObEstimateType { }; class ObEstColumnStat { - public: +public: int assign(const ObEstColumnStat& other); int init(const uint64_t column_id, const double rows, const int64_t ndv, const bool is_single_pkey); @@ -93,14 +93,14 @@ class ObEstColumnStat { TO_STRING_KV(K_(column_id), K_(ndv), K_(origin_ndv)); - private: +private: uint64_t column_id_; double ndv_; double origin_ndv_; }; class ObEstTableStat { - public: +public: int assign(const ObEstTableStat& other); int init(const uint64_t table_id, const ObPartitionKey& pkey, const int32_t rel_id, const double rows, @@ -185,7 +185,7 @@ class ObEstTableStat { TO_STRING_KV( K_(table_id), K_(ref_id), K_(rel_id), K_(rows), K_(origin_rows), K_(all_used_parts), K_(pk_ids), K_(all_cstat)); - private: +private: uint64_t table_id_; uint64_t ref_id_; int64_t part_id_; // best_partition id @@ -199,7 +199,7 @@ class ObEstTableStat { }; class ObEstAllTableStat { - public: +public: int assign(const ObEstAllTableStat& other); /** @@ -247,7 +247,7 @@ class ObEstAllTableStat { TO_STRING_KV(K_(all_tstat)); - private: +private: common::ObSEArray all_tstat_; }; @@ -279,7 +279,7 @@ struct ObEstColRangeInfo { }; class ObEstSelInfo { - public: +public: ObEstSelInfo(ObOptimizerContext& ctx, ObDMLStmt* stmt, const ObLogicalOperator* op = NULL) : opt_ctx_(ctx), stmt_(stmt), op_(op), use_origin_stat_(false) {} @@ -389,7 +389,7 @@ class ObEstSelInfo { } TO_STRING_KV(K_(table_stats)); - private: +private: ObOptimizerContext& opt_ctx_; ObDMLStmt* stmt_; // in join order, op_ is NULL @@ -399,7 +399,7 @@ class ObEstSelInfo { bool use_origin_stat_; }; class ObOptEstSel { - public: +public: static double DEFAULT_COLUMN_DISTINCT_RATIO; // calculate selectivity for predicates with conjective relationship @@ -440,7 +440,7 @@ class ObOptEstSel { return num < 0 ? 0 : (num > 1 ? 1 : num); } - private: +private: struct RangeSel { RangeSel() : var_(NULL), has_lt_(false), has_gt_(false), lt_sel_(0), gt_sel_(0) {} @@ -479,7 +479,7 @@ class ObOptEstSel { double gt_sel_; }; - private: +private: // use real params to calc selectivity // @param in plan the plan // @param in qual the filter to calc selectivity, should be const or calculable expr @@ -692,7 +692,7 @@ class ObOptEstSel { return fabs(num) < OB_DOUBLE_EPSINON; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOptEstSel); }; } // namespace sql diff --git a/src/sql/optimizer/ob_opt_est_utils.h b/src/sql/optimizer/ob_opt_est_utils.h index cb0f9c61d..5a9a33985 100644 --- a/src/sql/optimizer/ob_opt_est_utils.h +++ b/src/sql/optimizer/ob_opt_est_utils.h @@ -35,7 +35,7 @@ struct RangeExprs { }; class ObOptEstUtils { - public: +public: // check if op is monotonic, some type may not considered. static bool is_monotonic_op(const ObItemType type); @@ -91,7 +91,7 @@ class ObOptEstUtils { }; class ObOptEstObjToScalar { - public: +public: // Functionality: convert objs to scalars(double). // One Optimization : Limited precision of double type cannot distinguish long strs using // a static base of 256 (max distinguishable length is 6). We need to firstly truncate the @@ -120,7 +120,7 @@ class ObOptEstObjToScalar { static int convert_string_to_scalar_for_number(const common::ObString& str, double& scala); - private: +private: static int add_to_string_conversion_array( const common::ObObj& strobj, common::ObIArray& arr, uint64_t& convertable_map, int64_t pos); // 1, find common prefix length of strings diff --git a/src/sql/optimizer/ob_optimizer.h b/src/sql/optimizer/ob_optimizer.h index 33d8e4279..383750226 100644 --- a/src/sql/optimizer/ob_optimizer.h +++ b/src/sql/optimizer/ob_optimizer.h @@ -121,7 +121,7 @@ struct NumberingCtx { }; struct NumberingExchangeCtx { - private: +private: struct IdStruct { IdStruct() : current_px_id_(common::OB_INVALID_ID), next_dfo_id_(common::OB_INVALID_ID) {} @@ -132,7 +132,7 @@ struct NumberingExchangeCtx { TO_STRING_KV(K_(current_px_id), K_(next_dfo_id)); }; - public: +public: NumberingExchangeCtx() : next_px_id_(common::OB_INVALID_ID), ids_() {} int64_t next_px() @@ -163,7 +163,7 @@ struct NumberingExchangeCtx { return ids_.pop_back(dummy); } - private: +private: int64_t next_px_id_; common::ObSEArray ids_; }; @@ -189,7 +189,7 @@ struct ObExprSelPair { }; class ObOptimizer { - public: +public: ObOptimizer(ObOptimizerContext& ctx) : ctx_(ctx) {} virtual ~ObOptimizer() @@ -197,7 +197,7 @@ class ObOptimizer { virtual int optimize(ObDMLStmt& stmt, ObLogPlan*& plan); virtual int get_optimization_cost(ObDMLStmt& stmt, double& cost); - private: +private: int generate_plan_for_temp_table(ObDMLStmt& stmt); int init_env_info(ObDMLStmt& stmt); int get_stmt_max_table_dop(ObDMLStmt& stmt, int64_t& max_dop); @@ -207,7 +207,7 @@ class ObOptimizer { int check_pdml_supported_feature(const ObDMLStmt& stmt, const ObSQLSessionInfo& session, bool& is_use_pdml); int check_unique_index(const common::ObIArray& column_exprs, bool& has_unique_index) const; - private: +private: ObOptimizerContext& ctx_; DISALLOW_COPY_AND_ASSIGN(ObOptimizer); }; diff --git a/src/sql/optimizer/ob_optimizer_context.h b/src/sql/optimizer/ob_optimizer_context.h index b7b893206..0c0242206 100644 --- a/src/sql/optimizer/ob_optimizer_context.h +++ b/src/sql/optimizer/ob_optimizer_context.h @@ -30,7 +30,7 @@ class ObLogPlanFactory; enum PXParallelRule { USE_PX_DEFAULT, MANUAL_HINT, SESSION_FORCE_PARALLEL, MANUAL_TABLE_DOP, MAX_OPTION }; class ObOptimizerContext { - public: +public: ObOptimizerContext(ObSQLSessionInfo* session_info, ObExecContext* exec_ctx, ObSqlSchemaGuard* sql_schema_guard, common::ObStatManager* stat_manager, common::ObOptStatManager* opt_stat_manager, storage::ObPartitionService* partition_service, common::ObIAllocator& allocator, @@ -294,7 +294,7 @@ class ObOptimizerContext { return parallel_ > 1; } - private: +private: ObSQLSessionInfo* session_info_; ObExecContext* exec_ctx_; ObSqlSchemaGuard* sql_schema_guard_; diff --git a/src/sql/optimizer/ob_optimizer_partition_location_cache.h b/src/sql/optimizer/ob_optimizer_partition_location_cache.h index d4166d828..5e869c4b8 100644 --- a/src/sql/optimizer/ob_optimizer_partition_location_cache.h +++ b/src/sql/optimizer/ob_optimizer_partition_location_cache.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObOptimizerPartitionLocationCache : public share::ObIPartitionLocationCache { - public: +public: static const int64_t LOCATION_CACHE_BUCKET_NUM = 32; ObOptimizerPartitionLocationCache(common::ObIAllocator& allocator, share::ObIPartitionLocationCache* location_cache); virtual ~ObOptimizerPartitionLocationCache(); @@ -75,10 +75,10 @@ class ObOptimizerPartitionLocationCache : public share::ObIPartitionLocationCach return location_cache_; } - private: +private: int insert_or_replace_optimizer_cache(share::ObLocationCacheKey& key, share::ObPartitionLocation* location); - private: +private: typedef common::hash::ObHashMap PartitionLocationMap; @@ -86,7 +86,7 @@ class ObOptimizerPartitionLocationCache : public share::ObIPartitionLocationCach share::ObIPartitionLocationCache* location_cache_; PartitionLocationMap optimizer_cache_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOptimizerPartitionLocationCache); }; diff --git a/src/sql/optimizer/ob_optimizer_util.h b/src/sql/optimizer/ob_optimizer_util.h index 96b8b4d78..a99c15910 100644 --- a/src/sql/optimizer/ob_optimizer_util.h +++ b/src/sql/optimizer/ob_optimizer_util.h @@ -53,7 +53,7 @@ class ObShardingInfo; class ObTablePartitionInfo; struct SubPlanInfo; class ObOptimizerUtil { - public: +public: static int is_prefix_ordering(const common::ObIArray& pre, const common::ObIArray& full, const EqualSets& equal_sets, const common::ObIArray& const_exprs, bool& is_prefix); @@ -668,7 +668,7 @@ class ObOptimizerUtil { static int check_pushdown_filter_to_base_table(ObLogPlan& plan, const uint64_t table_id, const ObIArray& pushdown_filters, const ObIArray& restrict_infos, bool& can_pushdown); - private: +private: // disallow construct ObOptimizerUtil(); ~ObOptimizerUtil(); diff --git a/src/sql/optimizer/ob_phy_table_location_info.h b/src/sql/optimizer/ob_phy_table_location_info.h index e7321ffab..3fdafc24b 100644 --- a/src/sql/optimizer/ob_phy_table_location_info.h +++ b/src/sql/optimizer/ob_phy_table_location_info.h @@ -22,7 +22,7 @@ namespace sql { class ObOptPartLoc { OB_UNIS_VERSION(1); // friend class ObPartitionReplicaLocation; - public: +public: typedef common::ObSEArray ObSmartReplicaLocationArray; @@ -88,7 +88,7 @@ class ObOptPartLoc { TO_STRING_KV(KT_(table_id), K_(partition_id), K_(partition_cnt), K_(pg_key), K_(replica_locations), K_(renew_time), K_(is_mark_fail)); - private: +private: uint64_t table_id_; int64_t partition_id_; int64_t partition_cnt_; @@ -99,7 +99,7 @@ class ObOptPartLoc { }; class ObPhyPartitionLocationInfo { - public: +public: ObPhyPartitionLocationInfo(); virtual ~ObPhyPartitionLocationInfo(); @@ -144,14 +144,14 @@ class ObPhyPartitionLocationInfo { bool is_server_in_replica(const common::ObAddr& server, int64_t& idx) const; TO_STRING_KV(K_(partition_location), K_(selected_replica_idx), K_(priority_replica_idxs)); - private: +private: ObOptPartLoc partition_location_; int64_t selected_replica_idx_; common::ObSEArray priority_replica_idxs_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPhyPartitionLocationInfo); }; @@ -160,11 +160,11 @@ typedef common::ObSEArray PWJPartitionIdMap; class ObPwjComparer { - public: +public: ObPwjComparer(bool is_strict) : is_strict_(is_strict), pwj_tables_(), @@ -182,7 +182,7 @@ class ObPwjComparer { TO_STRING_KV(K_(is_strict), K_(pwj_tables), K_(partition_id_group)); - private: +private: bool is_strict_; common::ObSEArray pwj_tables_; common::ObSEArray, 32, common::ModulePageAllocator, true> part_id_map_; diff --git a/src/sql/optimizer/ob_px_resource_analyzer.cpp b/src/sql/optimizer/ob_px_resource_analyzer.cpp index b095a878e..ddc82f561 100644 --- a/src/sql/optimizer/ob_px_resource_analyzer.cpp +++ b/src/sql/optimizer/ob_px_resource_analyzer.cpp @@ -25,7 +25,7 @@ namespace sql { template class DfoTreeNormalizer { - public: +public: static int normalize(T& root); }; @@ -98,7 +98,7 @@ int DfoTreeNormalizer::normalize(T& root) } class SchedOrderGenerator { - public: +public: SchedOrderGenerator() = default; ~SchedOrderGenerator() = default; int generate(DfoInfo& root, ObIArray& edges); diff --git a/src/sql/optimizer/ob_px_resource_analyzer.h b/src/sql/optimizer/ob_px_resource_analyzer.h index c083a0a81..2b17afaa1 100644 --- a/src/sql/optimizer/ob_px_resource_analyzer.h +++ b/src/sql/optimizer/ob_px_resource_analyzer.h @@ -127,12 +127,12 @@ struct PxInfo { }; class ObPxResourceAnalyzer { - public: +public: ObPxResourceAnalyzer(); ~ObPxResourceAnalyzer() = default; int analyze(ObLogicalOperator& root_op, int64_t& max_parallel_thread_group_count); - private: +private: int convert_log_plan_to_nested_px_tree(common::ObIArray& px_trees, ObLogicalOperator& root_op); int create_dfo_tree(ObIArray& px_trees, ObLogExchange& root_op); int do_split(common::ObIArray& px_trees, PxInfo& px_info, ObLogicalOperator& root_op, DfoInfo* parent_dfo); @@ -140,7 +140,7 @@ class ObPxResourceAnalyzer { int walk_through_dfo_tree(PxInfo& px_root, int64_t& max_parallel_thread_group_count); int create_dfo(DfoInfo*& dfo, int64_t dop); - private: +private: /* variables */ common::ObArenaAllocator dfo_allocator_; DISALLOW_COPY_AND_ASSIGN(ObPxResourceAnalyzer); diff --git a/src/sql/optimizer/ob_raw_expr_add_to_context.h b/src/sql/optimizer/ob_raw_expr_add_to_context.h index 7d62eae10..73f5ecc1f 100644 --- a/src/sql/optimizer/ob_raw_expr_add_to_context.h +++ b/src/sql/optimizer/ob_raw_expr_add_to_context.h @@ -23,7 +23,7 @@ namespace sql { * during output expr allocation. */ class ObRawExprAddToContext : public ObRawExprVisitor { - public: +public: ObRawExprAddToContext(common::ObIArray* ctx, uint64_t id) : ctx_(ctx), consumer_id_(id), keep_working_(true) {} @@ -48,13 +48,13 @@ class ObRawExprAddToContext : public ObRawExprVisitor { virtual int visit(ObWinFunRawExpr& expr); virtual int visit(ObPseudoColumnRawExpr& expr); - private: +private: int add_expr(ObRawExpr& expr); // types and constants - private: +private: // function members - private: +private: common::ObIArray* ctx_; uint64_t consumer_id_; bool keep_working_; diff --git a/src/sql/optimizer/ob_raw_expr_check_dep.h b/src/sql/optimizer/ob_raw_expr_check_dep.h index 0df74b12d..25004c177 100644 --- a/src/sql/optimizer/ob_raw_expr_check_dep.h +++ b/src/sql/optimizer/ob_raw_expr_check_dep.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObRawExpr; class ObRawExprCheckDep { - public: +public: ObRawExprCheckDep( common::ObIArray& dep_exprs, common::ObBitSet& deps, bool is_access) : dep_exprs_(dep_exprs), dep_indices_(&deps), is_access_(is_access) @@ -37,10 +37,10 @@ class ObRawExprCheckDep { return dep_indices_; } - private: +private: int check_expr(const ObRawExpr& expr, bool& found); - private: +private: common::ObIArray& dep_exprs_; common::ObBitSet* dep_indices_; bool is_access_; // mark whether we are do project pruning for access exprs diff --git a/src/sql/optimizer/ob_raw_expr_connectby_level_visitor.h b/src/sql/optimizer/ob_raw_expr_connectby_level_visitor.h index 73cf58f5c..12d68c947 100644 --- a/src/sql/optimizer/ob_raw_expr_connectby_level_visitor.h +++ b/src/sql/optimizer/ob_raw_expr_connectby_level_visitor.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObRawConnectByLevelVisitor : public ObRawExprVisitor { - public: +public: ObRawConnectByLevelVisitor() : level_exprs_(nullptr){}; virtual ~ObRawConnectByLevelVisitor() = default; @@ -50,7 +50,7 @@ class ObRawConnectByLevelVisitor : public ObRawExprVisitor { virtual int visit(ObWinFunRawExpr& expr); virtual int visit(ObPseudoColumnRawExpr& expr); - private: +private: common::ObIArray* level_exprs_; }; diff --git a/src/sql/optimizer/ob_raw_expr_get_hash_value.h b/src/sql/optimizer/ob_raw_expr_get_hash_value.h index 8bebda5e5..45594b389 100644 --- a/src/sql/optimizer/ob_raw_expr_get_hash_value.h +++ b/src/sql/optimizer/ob_raw_expr_get_hash_value.h @@ -23,7 +23,7 @@ namespace sql { * during output expr allocation. */ class ObRawExprGetHashValue : public ObRawExprVisitor { - public: +public: ObRawExprGetHashValue(uint64_t seed) : seed_(seed) {} virtual ~ObRawExprGetHashValue() @@ -45,10 +45,10 @@ class ObRawExprGetHashValue : public ObRawExprVisitor { virtual int visit(ObSysFunRawExpr& expr); virtual int visit(ObSetOpRawExpr& expr); - private: +private: int add_expr(ObRawExpr& expr); - private: +private: uint64_t seed_; // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprGetHashValue); diff --git a/src/sql/optimizer/ob_raw_expr_pull_up_aggr_expr.h b/src/sql/optimizer/ob_raw_expr_pull_up_aggr_expr.h index 80d7af9db..128c3fac8 100644 --- a/src/sql/optimizer/ob_raw_expr_pull_up_aggr_expr.h +++ b/src/sql/optimizer/ob_raw_expr_pull_up_aggr_expr.h @@ -23,7 +23,7 @@ namespace sql { * during output expr allocation. */ class ObRawExprPullUpAggrExpr : public ObRawExprVisitor { - public: +public: ObRawExprPullUpAggrExpr(ObRawExprFactory& expr_factory, const ObSQLSessionInfo* session_info) : expr_factory_(expr_factory), new_expr_(NULL), @@ -68,7 +68,7 @@ class ObRawExprPullUpAggrExpr : public ObRawExprVisitor { return merge_synopsis_; } - private: +private: // ObIArray *ctx_; // uint64_t consumer_id_; // disallow copy diff --git a/src/sql/optimizer/ob_raw_expr_push_down_aggr_expr.h b/src/sql/optimizer/ob_raw_expr_push_down_aggr_expr.h index 39569ed2b..025ddfb87 100644 --- a/src/sql/optimizer/ob_raw_expr_push_down_aggr_expr.h +++ b/src/sql/optimizer/ob_raw_expr_push_down_aggr_expr.h @@ -24,7 +24,7 @@ class ObStmt; * during output expr allocation. */ class ObRawExprPushDownAggrExpr : public ObRawExprVisitor { - public: +public: ObRawExprPushDownAggrExpr(const ObSQLSessionInfo* session_info, ObRawExprFactory& expr_factory) : session_info_(session_info), expr_factory_(expr_factory), push_down_avg_expr_(NULL) {} @@ -60,7 +60,7 @@ class ObRawExprPushDownAggrExpr : public ObRawExprVisitor { return new_exprs_.count(); } - private: +private: const ObSQLSessionInfo* session_info_; ObRawExprFactory& expr_factory_; common::ObSEArray new_exprs_; diff --git a/src/sql/optimizer/ob_replica_compare.h b/src/sql/optimizer/ob_replica_compare.h index f68e65626..31695e9b4 100644 --- a/src/sql/optimizer/ob_replica_compare.h +++ b/src/sql/optimizer/ob_replica_compare.h @@ -17,11 +17,11 @@ namespace oceanbase { namespace sql { class ObReplicaCompare { - public: +public: enum CompareType { IS_OTHER_REGION, ZONE_TYPE, MERGE_STATUS, POS_TYPE, CMP_CNT }; enum CompareRes { EQUAL, LESS, GREATER }; - public: +public: explicit ObReplicaCompare(ObRoutePolicyType policy_type); virtual ~ObReplicaCompare() {} @@ -43,7 +43,7 @@ class ObReplicaCompare { typedef CompareRes (ObReplicaCompare::*CmpFuncPtr)( const ObRoutePolicy::CandidateReplica& replica1, const ObRoutePolicy::CandidateReplica& replica2); - private: +private: int ret_; ObRoutePolicyType policy_type_; CmpFuncPtr cmp_func_array_[CMP_CNT]; diff --git a/src/sql/optimizer/ob_route_policy.h b/src/sql/optimizer/ob_route_policy.h index 2b2f94e15..b78d9d2bb 100644 --- a/src/sql/optimizer/ob_route_policy.h +++ b/src/sql/optimizer/ob_route_policy.h @@ -52,7 +52,7 @@ struct ObRoutePolicyCtx { }; class ObRoutePolicy { - public: +public: enum PositionType { SAME_SERVER = 0, SAME_IDC = 1, @@ -66,7 +66,7 @@ class ObRoutePolicy { MERGE_STATUS_MAX, }; class ReplicaAttribute { - public: + public: ReplicaAttribute() : pos_type_(POSITION_TYPE_MAX), merge_status_(MERGE_STATUS_MAX), @@ -113,7 +113,7 @@ class ObRoutePolicy { share::ObServerStatus::DisplayStatus server_status_; }; class CandidateReplica final : public share::ObReplicaLocation { - public: + public: CandidateReplica() : ObReplicaLocation(), attr_(), is_filter_(false), replica_idx_(common::OB_INVALID_INDEX) {} CandidateReplica(const share::ObReplicaLocation& replica_location) @@ -143,14 +143,14 @@ class ObRoutePolicy { return ret; } - public: + public: TO_STRING_KV(K(server_), K(role_), K(sql_port_), K(replica_type_), K(attr_), K(is_filter_), K(replica_idx_)); ReplicaAttribute attr_; bool is_filter_; int64_t replica_idx_; // invalid }; - public: +public: ObRoutePolicy(const common::ObAddr& addr, storage::ObPartitionService& part_service) : local_addr_(addr), local_locality_(), @@ -185,7 +185,7 @@ class ObRoutePolicy { static bool is_same_idc(const share::ObServerLocality& locality1, const share::ObServerLocality& locality2); static bool is_same_region(const share::ObServerLocality& locality1, const share::ObServerLocality& locality2); - protected: +protected: int init_candidate_replica( const common::ObIArray& server_locality_array, CandidateReplica& candi_replica); int calc_position_type(const share::ObServerLocality& candi_locality, CandidateReplica& candi_replica); @@ -213,7 +213,7 @@ class ObRoutePolicy { return type; } - protected: +protected: common::ObAddr local_addr_; share::ObServerLocality local_locality_; common::ObSEArray server_locality_array_; diff --git a/src/sql/optimizer/ob_select_log_plan.h b/src/sql/optimizer/ob_select_log_plan.h index 11dc00006..f665cbf11 100644 --- a/src/sql/optimizer/ob_select_log_plan.h +++ b/src/sql/optimizer/ob_select_log_plan.h @@ -34,7 +34,7 @@ struct MergeKeyInfo; class ObSelectLogPlan : public ObLogPlan { friend class ::test::ObLogPlanTest_ob_explain_test_Test; - public: +public: ObSelectLogPlan(ObOptimizerContext& ctx, const ObSelectStmt* select_stmt); virtual ~ObSelectLogPlan(); @@ -66,7 +66,7 @@ class ObSelectLogPlan : public ObLogPlan { return const_cast(static_cast(*this).get_stmt()); } - private: +private: // @brief Allocate a hash group by on top of a plan tree // ObLogicalOperator * candi_allocate_hash_group_by(); @@ -175,7 +175,7 @@ class ObSelectLogPlan : public ObLogPlan { int allocate_distinct_as_top(ObLogicalOperator*& top, const AggregateAlgo algo, ObIArray& distinct_exprs, const ObIArray& expected_ordering); - private: +private: int decide_sort_keys_for_runion( const common::ObIArray& order_items, common::ObIArray& new_order_items); int init_merge_set_structure(common::ObIAllocator& allocator, const common::ObIArray& plans, diff --git a/src/sql/optimizer/ob_sharding_info.cpp b/src/sql/optimizer/ob_sharding_info.cpp index 2ecaef27c..1af96221c 100644 --- a/src/sql/optimizer/ob_sharding_info.cpp +++ b/src/sql/optimizer/ob_sharding_info.cpp @@ -282,13 +282,10 @@ int ObShardingInfo::is_compatible_partition_key(const common::ObIArray &left_keys, - const common::ObIArray &right_keys, - const ObShardingInfo &left_sharding, - const ObShardingInfo &right_sharding, - bool &is_partition_wise) +int ObShardingInfo::check_if_match_partition_wise(ObLogPlan& log_plan __attribute__((unused)), + const EqualSets& equal_sets, const common::ObIArray& left_keys, + const common::ObIArray& right_keys, const ObShardingInfo& left_sharding, + const ObShardingInfo& right_sharding, bool& is_partition_wise) { int ret = OB_SUCCESS; bool is_key_covered = false; @@ -388,10 +385,8 @@ int ObShardingInfo::check_if_match_repart(const EqualSets& equal_sets, const ObI return ret; } -int ObShardingInfo::is_physically_equal_partitioned(ObLogPlan &log_plan __attribute__((unused)), - const ObShardingInfo &left_sharding, - const ObShardingInfo &right_sharding, - bool &is_physical_equal) +int ObShardingInfo::is_physically_equal_partitioned(ObLogPlan& log_plan __attribute__((unused)), + const ObShardingInfo& left_sharding, const ObShardingInfo& right_sharding, bool& is_physical_equal) { int ret = OB_SUCCESS; ret = is_physically_equal_partitioned(left_sharding, right_sharding, is_physical_equal); diff --git a/src/sql/optimizer/ob_sharding_info.h b/src/sql/optimizer/ob_sharding_info.h index 065e4696a..9d2b11582 100644 --- a/src/sql/optimizer/ob_sharding_info.h +++ b/src/sql/optimizer/ob_sharding_info.h @@ -33,7 +33,7 @@ typedef common::ObSEArray O typedef ObRawExprSets EqualSets; class ObShardingInfo { - public: +public: ObShardingInfo() : part_level_(share::schema::PARTITION_LEVEL_ZERO), part_func_type_(share::schema::PARTITION_FUNC_TYPE_MAX), @@ -260,7 +260,7 @@ class ObShardingInfo { K_(part_func_type), K_(subpart_func_type), K_(part_num), K_(subpart_num), K_(location_type), K_(can_reselect_replica), K_(phy_table_location_info)); - private: +private: int set_partition_key(ObRawExpr* part_expr, const share::schema::ObPartitionFuncType part_func_type, common::ObIArray& partition_keys); @@ -275,7 +275,7 @@ class ObShardingInfo { static int is_compatible_partition_key(const common::ObIArray& first_part_keys, const common::ObIArray& second_part_keys, bool& is_compatible); - private: +private: share::schema::ObPartitionLevel part_level_; share::schema::ObPartitionFuncType part_func_type_; diff --git a/src/sql/optimizer/ob_skyline_prunning.h b/src/sql/optimizer/ob_skyline_prunning.h index fda237701..4c2d8579b 100644 --- a/src/sql/optimizer/ob_skyline_prunning.h +++ b/src/sql/optimizer/ob_skyline_prunning.h @@ -28,7 +28,7 @@ class ObRawExpr; */ class ObSkylineDim { - public: +public: enum Dimension { INDEX_BACK = 0, INTERESTING_ORDER, @@ -58,12 +58,12 @@ class ObSkylineDim { ; TO_STRING_KV(K(dim_type_)); - private: +private: const Dimension dim_type_; }; class ObIndexBackDim : public ObSkylineDim { - public: +public: ObIndexBackDim() : ObSkylineDim(INDEX_BACK), need_index_back_(false), @@ -98,7 +98,7 @@ class ObIndexBackDim : public ObSkylineDim { TO_STRING_KV(K_(need_index_back), K_(has_interesting_order), K_(can_extract_range), K_(index_column_cnt), "restrcit_ids", common::ObArrayWrap(filter_column_ids_, filter_column_cnt_)); - private: +private: bool need_index_back_; bool has_interesting_order_; bool can_extract_range_; @@ -117,7 +117,7 @@ class ObIndexBackDim : public ObSkylineDim { * we save the column_ids that can be use */ class ObInterestOrderDim : public ObSkylineDim { - public: +public: ObInterestOrderDim() : ObSkylineDim(INTERESTING_ORDER), is_interesting_order_(false), @@ -152,7 +152,7 @@ class ObInterestOrderDim : public ObSkylineDim { K_(filter_column_cnt), "filter column_ids", common::ObArrayWrap(filter_column_ids_, filter_column_cnt_)); - private: +private: bool is_interesting_order_; int64_t column_cnt_; uint64_t column_ids_[common::OB_USER_MAX_ROWKEY_COLUMN_NUMBER]; @@ -172,7 +172,7 @@ class ObInterestOrderDim : public ObSkylineDim { * id in ascending order, for quick compare */ class ObQueryRangeDim : public ObSkylineDim { - public: +public: ObQueryRangeDim() : ObSkylineDim(QUERY_RANGE), column_cnt_(0) { MEMSET(column_ids_, 0, sizeof(uint64_t) * common::OB_USER_MAX_ROWKEY_COLUMN_NUMBER); @@ -183,7 +183,7 @@ class ObQueryRangeDim : public ObSkylineDim { int add_rowkey_ids(const common::ObIArray& column_ids); TO_STRING_KV(K_(column_cnt), "rowkey_ids", common::ObArrayWrap(column_ids_, column_cnt_)); - private: +private: int64_t column_cnt_; uint64_t column_ids_[common::OB_USER_MAX_ROWKEY_COLUMN_NUMBER]; }; @@ -198,14 +198,14 @@ struct KeyPrefixComp { return status_; } - private: +private: static int do_compare(const uint64_t* left, const int64_t left_cnt, const uint64_t* right, const bool* right_const, const int64_t right_cnt, ObSkylineDim::CompareStat& status); ObSkylineDim::CompareStat status_; }; struct RangeSubsetComp { - public: +public: RangeSubsetComp() : status_(ObSkylineDim::UNCOMPARABLE) {} int operator()(const uint64_t* left, const int64_t left_cnt, const uint64_t* right, const int64_t right_cnt); @@ -214,7 +214,7 @@ struct RangeSubsetComp { return status_; } - private: +private: static int do_compare(const uint64_t* left, const int64_t left_cnt, const uint64_t* right, const int64_t right_cnt, ObSkylineDim::CompareStat& status); ObSkylineDim::CompareStat status_; @@ -222,7 +222,7 @@ struct RangeSubsetComp { // dimension for each index class ObIndexSkylineDim { - public: +public: ObIndexSkylineDim() : index_id_(common::OB_INVALID_ID), dim_count_(ObSkylineDim::DIM_COUNT), can_prunning_(true) { MEMSET(skyline_dims_, 0, sizeof(const ObSkylineDim*) * ObSkylineDim::DIM_COUNT); @@ -256,7 +256,7 @@ class ObIndexSkylineDim { TO_STRING_KV( K_(index_id), K_(dim_count), "dims", common::ObArrayWrap(skyline_dims_, dim_count_)); - private: +private: uint64_t index_id_; const int64_t dim_count_; bool can_prunning_; // whether this index can prunning other index or not @@ -264,7 +264,7 @@ class ObIndexSkylineDim { }; class ObSkylineDimRecorder { - public: +public: ObSkylineDimRecorder() {} virtual ~ObSkylineDimRecorder() @@ -279,17 +279,17 @@ class ObSkylineDimRecorder { static int extract_column_ids( const common::ObIArray& keys, const int64_t prefix_count, common::ObIArray& column_ids); - private: +private: common::ObArray index_dims_; }; class ObSkylineDimFactory { - public: +public: static ObSkylineDimFactory& get_instance(); template int create_skyline_dim(common::ObIAllocator& allocator, SkylineDimType*& skyline_dim); - private: +private: ObSkylineDimFactory() {} DISALLOW_COPY_AND_ASSIGN(ObSkylineDimFactory); diff --git a/src/sql/optimizer/ob_table_location.h b/src/sql/optimizer/ob_table_location.h index d86fb660f..10187e2a3 100644 --- a/src/sql/optimizer/ob_table_location.h +++ b/src/sql/optimizer/ob_table_location.h @@ -31,18 +31,18 @@ class ObColumnRefRawExpr; class ObExprEqualCheckContext; typedef common::ObSEArray RowkeyArray; class ObPartIdRowMapManager { - public: +public: ObPartIdRowMapManager() : manager_(), part_idx_(common::OB_INVALID_INDEX) {} typedef common::ObSEArray ObRowIdList; struct MapEntry { - public: + public: MapEntry() : list_() {} TO_STRING_KV(K_(list)); int assign(const MapEntry& entry); - public: + public: ObRowIdList list_; }; typedef common::ObSEArray ObPartRowManager; @@ -76,12 +76,12 @@ class ObPartIdRowMapManager { } TO_STRING_KV(K_(manager), K_(part_idx)); - private: +private: ObPartRowManager manager_; int64_t part_idx_; // used for parameter pass only. common::ObNewRow part_row_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartIdRowMapManager); }; @@ -337,7 +337,7 @@ struct TableLocationKey { class ObOptimizerContext; class ObTableLocation { - public: +public: enum TablePartType { NONE, HASH, @@ -357,7 +357,7 @@ class ObTableLocation { class PartProjector { OB_UNIS_VERSION(1); - public: + public: PartProjector(common::ObIAllocator& allocator, ObSqlExpressionFactory& sql_expr_factory, ObExprOperatorFactory& expr_op_factory) : allocator_(allocator), sql_expr_factory_(sql_expr_factory), expr_op_factory_(expr_op_factory) @@ -388,11 +388,11 @@ class ObTableLocation { common::ObArrayWrap(part_projector_, part_projector_size_), "subpart_projector", common::ObArrayWrap(subpart_projector_, subpart_projector_size_)); - private: + private: int init_part_projector( const ObRawExpr* part_expr, RowDesc& row_desc, int32_t*& projector, int64_t& projector_size); - private: + private: common::ObDList virtual_column_exprs_; int64_t column_cnt_; int32_t* part_projector_; @@ -415,7 +415,7 @@ class ObTableLocation { ObExecContext& exec_ctx, const uint64_t ref_table_id, common::ObIArray* partition_ids, int64_t* fake_id); OB_UNIS_VERSION(1); - public: +public: // for array: new(&data_[count_]) T(); // for normal usage, like plan set ObTableLocation() @@ -841,7 +841,7 @@ class ObTableLocation { TO_STRING_KV(K_(table_id), K_(ref_table_id), K_(part_num), K_(is_global_index), K_(duplicate_type), K_(part_expr_param_idxs), K_(part_projector), K_(part_expr), K_(gen_col_expr)); - private: +private: // get partition columns and generate partition_expr_ // partition_columns:partition columns // gen_cols: columns dependented by generated partition column @@ -1037,7 +1037,7 @@ class ObTableLocation { int recursive_convert_generated_column(const ObIArray& table_column, const ObIArray& column_conv_exprs, ObRawExpr*& expr); - private: +private: bool inited_; uint64_t table_id_; uint64_t ref_table_id_; diff --git a/src/sql/optimizer/ob_table_partition_info.h b/src/sql/optimizer/ob_table_partition_info.h index 15a04fc17..8b5b605b5 100644 --- a/src/sql/optimizer/ob_table_partition_info.h +++ b/src/sql/optimizer/ob_table_partition_info.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObTablePartitionInfo { - public: +public: ObTablePartitionInfo() : inner_allocator_(common::ObModIds::OB_SQL_TABLE_LOCATION), allocator_(inner_allocator_), @@ -115,10 +115,10 @@ class ObTablePartitionInfo { } TO_STRING_KV(K_(table_location), K_(phy_tbl_location_info)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTablePartitionInfo); - private: +private: /** * ObTableLocation is the structure we stored to calculate the physical table location, * which is represented by ObPhyTableLocation, for a given table(logical) in a given statement. diff --git a/src/sql/optimizer/ob_update_log_plan.h b/src/sql/optimizer/ob_update_log_plan.h index 18cbed277..7f515cb84 100644 --- a/src/sql/optimizer/ob_update_log_plan.h +++ b/src/sql/optimizer/ob_update_log_plan.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObLogUpdate; class ObUpdateLogPlan : public ObLogPlan { - public: +public: ObUpdateLogPlan(ObOptimizerContext& ctx, const ObUpdateStmt* update_stmt) : ObLogPlan(ctx, update_stmt) {} virtual ~ObUpdateLogPlan(){}; @@ -31,7 +31,7 @@ class ObUpdateLogPlan : public ObLogPlan { */ int generate_plan(); - private: +private: int allocate_update_as_top(ObLogicalOperator*& top); int allocate_pdml_update_as_top(ObLogicalOperator*& top); @@ -47,7 +47,7 @@ class ObUpdateLogPlan : public ObLogPlan { DISALLOW_COPY_AND_ASSIGN(ObUpdateLogPlan); - private: +private: }; } // namespace sql } // namespace oceanbase diff --git a/src/sql/parser/ob_parser.h b/src/sql/parser/ob_parser.h index b2da31ef6..8c993d875 100644 --- a/src/sql/parser/ob_parser.h +++ b/src/sql/parser/ob_parser.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace sql { struct ObMPParseStat { - public: +public: ObMPParseStat() : parse_fail_(false), fail_ret_(common::OB_SUCCESS), fail_query_idx_(-1) {} void reset() @@ -43,7 +43,7 @@ struct PreParseResult { }; class ObParser { - public: +public: explicit ObParser(common::ObIAllocator& allocator, ObSQLMode mode, common::ObCollationType conn_collation = common::CS_TYPE_UTF8MB4_GENERAL_CI); virtual ~ObParser(); @@ -78,16 +78,16 @@ class ObParser { int prepare_parse(const common::ObString& query, void* ns, ParseResult& parse_result); static int pre_parse(const common::ObString& stmt, PreParseResult& res); - private: +private: static int scan_trace_id(const char* ptr, int64_t len, int32_t& pos, common::ObString& trace_id); static bool is_trace_id_end(char ch); static bool is_space(char ch); // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObParser); // function members - private: +private: // data members common::ObIAllocator* allocator_; // when sql_mode = "ANSI_QUOTES", Treat " as an identifier quote character diff --git a/src/sql/parser/ob_parser_utils.h b/src/sql/parser/ob_parser_utils.h index c97524705..3033df217 100644 --- a/src/sql/parser/ob_parser_utils.h +++ b/src/sql/parser/ob_parser_utils.h @@ -97,7 +97,7 @@ inline void databuff_simple_print_obj( } class ObParserResultTreePrintWrapper { - public: +public: explicit ObParserResultTreePrintWrapper(const ParseNode& parse_tree) : parse_tree_(parse_tree) {} int64_t to_string(char* buf, const int64_t buf_len) const @@ -108,15 +108,15 @@ class ObParserResultTreePrintWrapper { return pos; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObParserResultTreePrintWrapper); - private: +private: const ParseNode& parse_tree_; }; class ObParserResultPrintWrapper { - public: +public: explicit ObParserResultPrintWrapper(const ParseNode& parse_tree) : parse_tree_(parse_tree) {} int64_t to_string(char* buf, const int64_t buf_len) const @@ -126,10 +126,10 @@ class ObParserResultPrintWrapper { return pos; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObParserResultPrintWrapper); - private: +private: const ParseNode& parse_tree_; }; diff --git a/src/sql/parser/ob_sql_parser.h b/src/sql/parser/ob_sql_parser.h index d4ec76bf1..1a71d7811 100644 --- a/src/sql/parser/ob_sql_parser.h +++ b/src/sql/parser/ob_sql_parser.h @@ -25,7 +25,7 @@ class ObIAllocator; namespace sql { class ObSQLParser { - public: +public: ObSQLParser(common::ObIAllocator& allocator, ObSQLMode mode) : allocator_(allocator), sql_mode_(mode) {} @@ -36,10 +36,10 @@ class ObSQLParser { int parse_and_gen_sqlid( void* malloc_pool, const char* str_ptr, const int64_t str_len, const int64_t len, char* sql_id); - private: +private: int gen_sqlid(const char* paramed_sql, const int64_t sql_len, const int64_t len, char* sql_id); - private: +private: common::ObIAllocator& allocator_; ObSQLMode sql_mode_; }; diff --git a/src/sql/parser/sql_parser_base.c b/src/sql/parser/sql_parser_base.c index 55b3ab655..a8eb923ae 100644 --- a/src/sql/parser/sql_parser_base.c +++ b/src/sql/parser/sql_parser_base.c @@ -216,9 +216,8 @@ int parse_sql_stmt(ParseResult* parse_result) return ret; } -void setup_token_pos_info(ParseNode *node __attribute__((unused)), - int off __attribute__((unused)), - int len __attribute__((unused))) +void setup_token_pos_info( + ParseNode* node __attribute__((unused)), int off __attribute__((unused)), int len __attribute__((unused))) { #ifdef SQL_PARSER_COMPILATION node->token_off_ = off; @@ -228,10 +227,8 @@ void setup_token_pos_info(ParseNode *node __attribute__((unused)), #endif } -int setup_token_pos_info_and_dup_string(ParseNode *node __attribute__((unused)), - ParseResult *result __attribute__((unused)), - int start __attribute__((unused)), - int end __attribute__((unused))) +int setup_token_pos_info_and_dup_string(ParseNode* node __attribute__((unused)), + ParseResult* result __attribute__((unused)), int start __attribute__((unused)), int end __attribute__((unused))) { int ret = OB_PARSER_SUCCESS; #ifdef SQL_PARSER_COMPILATION diff --git a/src/sql/plan_cache/ob_cache_object.h b/src/sql/plan_cache/ob_cache_object.h index 61b37788b..724e951a3 100644 --- a/src/sql/plan_cache/ob_cache_object.h +++ b/src/sql/plan_cache/ob_cache_object.h @@ -48,7 +48,7 @@ enum ObCacheObjType { struct ObOutlineState { OB_UNIS_VERSION(1); - public: +public: ObOutlineState() : outline_version_(), is_plan_fixed_(false) {} ~ObOutlineState() @@ -106,7 +106,7 @@ class ObCacheObject { friend class ObCacheObjectFactory; friend class ::test::MockCacheObjectFactory; - public: +public: ObCacheObject(ObCacheObjType co_type, lib::MemoryContext& mem_context = CURRENT_CONTEXT); virtual ~ObCacheObject() {} @@ -343,14 +343,14 @@ class ObCacheObject { K_(object_id), K_(dependency_tables), K_(outline_state), K_(pre_calc_exprs), K_(params_info), K_(is_contain_virtual_table), K_(is_contain_inner_table), K_(fetch_cur_time)); - protected: +protected: static int construct_array_params(const ObSqlExpression& expr, common::ObIAllocator& allocator, common::ObExprCtx& expr_ctx, common::ObNewRow& row, common::ObObjParam& result); - private: +private: int64_t dec_ref_count(const CacheRefHandleID ref_handle); - protected: +protected: lib::MemoryContext& mem_context_; common::ObIAllocator& allocator_; ObCacheObjType type_; diff --git a/src/sql/plan_cache/ob_cache_object_factory.h b/src/sql/plan_cache/ob_cache_object_factory.h index 875305648..0b545842f 100644 --- a/src/sql/plan_cache/ob_cache_object_factory.h +++ b/src/sql/plan_cache/ob_cache_object_factory.h @@ -25,7 +25,7 @@ class ObCacheObjectFactory { friend class ObCacheObject; friend class ObPlanCacheManager; - public: +public: static int alloc(ObCacheObject*& cache_obj, const CacheRefHandleID ref_handle, ObCacheObjType co_type, uint64_t tenant_id = common::OB_SERVER_TENANT_ID); static int alloc( @@ -45,7 +45,7 @@ class ObCacheObjectFactory { DEF_FREE_CACHE_FUNC(ObPhysicalPlan) DEF_FREE_CACHE_FUNC(ObCacheObject) - private: +private: static void inner_free(ObCacheObject* cache_obj); static ObPlanCache* get_plan_cache(const uint64_t tenant_id); diff --git a/src/sql/plan_cache/ob_dist_plans.h b/src/sql/plan_cache/ob_dist_plans.h index 295a4e1bc..016040a06 100644 --- a/src/sql/plan_cache/ob_dist_plans.h +++ b/src/sql/plan_cache/ob_dist_plans.h @@ -28,7 +28,7 @@ class ObPhyTableLocationInfo; class ObSqlPlanSet; class ObDistPlans { - public: +public: ObDistPlans() : plan_set_(NULL), should_get_plan_directly_(false) {} @@ -98,7 +98,7 @@ class ObDistPlans { // get first plan in the array if possible ObPhysicalPlan* get_first_plan(); - private: +private: /** * @brief check if loc constraint can meet in current loc cache. * if yes, return the plan @@ -166,13 +166,13 @@ class ObDistPlans { const common::ObIArray& phy_tbl_infos, ObIArray& pwj_tables, ObPwjComparer& pwj_comparer, PWJPartitionIdMap& pwj_map, bool& is_same) const; - private: +private: common::ObSEArray dist_plans_; ObSqlPlanSet* plan_set_; // optimize perf for single table distributed plan bool should_get_plan_directly_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistPlans); }; diff --git a/src/sql/plan_cache/ob_id_manager_allocator.h b/src/sql/plan_cache/ob_id_manager_allocator.h index 9e57a544b..fc1c1fa79 100644 --- a/src/sql/plan_cache/ob_id_manager_allocator.h +++ b/src/sql/plan_cache/ob_id_manager_allocator.h @@ -25,7 +25,7 @@ namespace sql { // Use ObSmallAllocator for size less than object_size_, else use ObMalloc. // ALLOC_MAGIC is used to mark and check the memory allocated. class ObIdManagerAllocator : public common::ObIAllocator { - public: +public: ObIdManagerAllocator(); ~ObIdManagerAllocator(); @@ -41,11 +41,11 @@ class ObIdManagerAllocator : public common::ObIAllocator { } void reset(); - private: +private: void* alloc_(int64_t sz); void free_(void* ptr); - private: +private: const static int64_t ALLOC_MAGIC = 0x1A4420844B; const static int64_t SMALL_ALLOC_SYMBOL = 0x38; const static int64_t M_ALLOC_SYMBOL = 0x7; @@ -58,7 +58,7 @@ class ObIdManagerAllocator : public common::ObIAllocator { int64_t object_size_; bool inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIdManagerAllocator); }; diff --git a/src/sql/plan_cache/ob_pc_ref_handle.h b/src/sql/plan_cache/ob_pc_ref_handle.h index 12eac1877..f1e1453be 100644 --- a/src/sql/plan_cache/ob_pc_ref_handle.h +++ b/src/sql/plan_cache/ob_pc_ref_handle.h @@ -31,7 +31,7 @@ class ObPreCalcExprFrameInfo; class ObSqlExpression; // pre-calculable expression list reference handler class PreCalcExprHandler { - public: +public: // allocator which allocate memory to this object common::ObIAllocator* pc_alloc_; // allocator for expressions @@ -62,7 +62,7 @@ class PreCalcExprHandler { pc_alloc_ = pc_alloc; } - public: +public: int64_t get_ref_count() const { return ATOMIC_LOAD64(&ref_cnt_); @@ -117,7 +117,7 @@ enum CacheRefHandleID { class ObCacheRefHandleMgr { friend class ObAllPlanCacheStat; - public: +public: ObCacheRefHandleMgr() : tenant_id_(common::OB_INVALID_ID) { clear_ref_handles(); @@ -168,10 +168,10 @@ class ObCacheRefHandleMgr { return ATOMIC_LOAD(&CACHE_REF_HANDLES[ref_handle]); } - private: +private: static const char* handle_name(const CacheRefHandleID handle); - private: +private: volatile int64_t CACHE_REF_HANDLES[MAX_HANDLE]; uint64_t tenant_id_; }; diff --git a/src/sql/plan_cache/ob_pcv_set.h b/src/sql/plan_cache/ob_pcv_set.h index e20fc999e..2c102c820 100644 --- a/src/sql/plan_cache/ob_pcv_set.h +++ b/src/sql/plan_cache/ob_pcv_set.h @@ -52,7 +52,7 @@ class ObPCVSet { TO_STRING_KV(K_(param_idxs), K_(is_last)) }; - public: +public: ObPCVSet(ObPlanCache* plan_cache) : is_inited_(false), plan_cache_(plan_cache), @@ -132,7 +132,7 @@ class ObPCVSet { TO_STRING_KV(K_(is_inited), K_(ref_count), K_(min_merged_version)); - private: +private: static const int64_t MAX_PCV_SET_PLAN_NUM = 200; int create_pcv_and_add_plan(ObCacheObject* cache_obj, ObPlanCacheCtx& pc_ctx, const common::ObIArray& schema_array, ObPlanCacheValue*& value); @@ -158,7 +158,7 @@ class ObPCVSet { int set_raw_param_info_if_needed(ObCacheObject* cache_obj); int check_raw_param_for_dup_col(ObPlanCacheCtx& pc_ctx, bool& contain_dup_col); - private: +private: bool is_inited_; ObPlanCache* plan_cache_; common::ObIAllocator* pc_alloc_; diff --git a/src/sql/plan_cache/ob_plan_cache.h b/src/sql/plan_cache/ob_plan_cache.h index 1b801726c..733bdf969 100644 --- a/src/sql/plan_cache/ob_plan_cache.h +++ b/src/sql/plan_cache/ob_plan_cache.h @@ -46,7 +46,7 @@ struct ObGetAllDeletedCacheObjIdsOp { {} int operator()(common::hash::HashMapPair& entry); - private: +private: bool should_dump(ObCacheObjType obj_type) const { bool ret_bool = false; @@ -66,7 +66,7 @@ struct ObGetAllDeletedCacheObjIdsOp { return ret_bool; } - private: +private: common::ObIArray* key_array_; const bool dump_all_; int64_t safe_timestamp_; @@ -76,7 +76,7 @@ struct ObGetAllDeletedCacheObjIdsOp { class ObPlanCache { friend class ObCacheObjectFactory; - public: +public: static const int64_t MAX_PLAN_SIZE = 20 * 1024 * 1024; // 20M static const int64_t MAX_PLAN_CACHE_SIZE = 5 * 1024L * 1024L * 1024L; // 5G static const int64_t EVICT_KEY_NUM = 8; @@ -314,7 +314,7 @@ class ObPlanCache { return ref_handle_mgr_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlanCache); int add_cache_obj(ObCacheObject* plan, ObPlanCacheCtx& pc_ctx); int get_cache_obj(ObPlanCacheCtx& pc_ctx, ObCacheObject*& cache_obj); @@ -340,9 +340,9 @@ class ObPlanCache { int get_pl_cache(ObPlanCacheCtx& pc_ctx, ObCacheObject*& cache_obj); - private: +private: const static int64_t SLICE_SIZE = 1024; // 1k - private: +private: bool inited_; bool valid_; int64_t tenant_id_; diff --git a/src/sql/plan_cache/ob_plan_cache_callback.h b/src/sql/plan_cache/ob_plan_cache_callback.h index a6ce99bdc..4e0c86f38 100644 --- a/src/sql/plan_cache/ob_plan_cache_callback.h +++ b/src/sql/plan_cache/ob_plan_cache_callback.h @@ -19,10 +19,10 @@ namespace oceanbase { namespace sql { class ObPlanCacheAtomicOp { - protected: +protected: typedef common::hash::HashMapPair PlanCacheKV; - public: +public: ObPlanCacheAtomicOp(const CacheRefHandleID ref_handle) : pcv_set_(NULL), ref_handle_(ref_handle) {} virtual ~ObPlanCacheAtomicOp() @@ -32,23 +32,23 @@ class ObPlanCacheAtomicOp { // get pcv_set and increase reference count void operator()(PlanCacheKV& entry); - protected: +protected: // when get value, need lock virtual int lock(ObPCVSet& pcv_set) = 0; - protected: +protected: // According to the interface of ObHashTable, all returned values will be passed // back to the caller via the callback functor. // pcv_set_ - the plan cache value that is referenced. ObPCVSet* pcv_set_; CacheRefHandleID ref_handle_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlanCacheAtomicOp); }; class ObPlanCacheWlockAndRef : public ObPlanCacheAtomicOp { - public: +public: ObPlanCacheWlockAndRef(const CacheRefHandleID ref_handle) : ObPlanCacheAtomicOp(ref_handle) {} virtual ~ObPlanCacheWlockAndRef() @@ -58,12 +58,12 @@ class ObPlanCacheWlockAndRef : public ObPlanCacheAtomicOp { return pcv_set.lock(false /*wlock*/); }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlanCacheWlockAndRef); }; class ObPlanCacheRlockAndRef : public ObPlanCacheAtomicOp { - public: +public: ObPlanCacheRlockAndRef(const CacheRefHandleID ref_handle) : ObPlanCacheAtomicOp(ref_handle) {} virtual ~ObPlanCacheRlockAndRef() @@ -73,15 +73,15 @@ class ObPlanCacheRlockAndRef : public ObPlanCacheAtomicOp { return pcvs.lock(true /*rlock*/); }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlanCacheRlockAndRef); }; class ObCacheObjAtomicOp { - protected: +protected: typedef common::hash::HashMapPair ObjKV; - public: +public: ObCacheObjAtomicOp(const CacheRefHandleID ref_handle) : cache_obj_(NULL), ref_handle_(ref_handle) {} virtual ~ObCacheObjAtomicOp() @@ -94,11 +94,11 @@ class ObCacheObjAtomicOp { return cache_obj_; } - protected: +protected: ObCacheObject* cache_obj_; const CacheRefHandleID ref_handle_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCacheObjAtomicOp); }; diff --git a/src/sql/plan_cache/ob_plan_cache_manager.h b/src/sql/plan_cache/ob_plan_cache_manager.h index c747e05b5..483843ae4 100644 --- a/src/sql/plan_cache/ob_plan_cache_manager.h +++ b/src/sql/plan_cache/ob_plan_cache_manager.h @@ -26,23 +26,23 @@ namespace sql { class ObPlanCache; class ObPlanCacheManager { - public: +public: typedef common::hash::ObHashMap PlanCacheMap; typedef common::hash::ObHashMap PsPlanCacheMap; class ObPlanCacheEliminationTask : public common::ObTimerTask { - public: + public: ObPlanCacheEliminationTask() : plan_cache_manager_(NULL), run_task_counter_(0) {} // main routine void runTimerTask(void); - private: + private: void run_plan_cache_task(); void run_ps_cache_task(); void run_free_cache_obj_task(); - public: + public: ObPlanCacheManager* plan_cache_manager_; int64_t run_task_counter_; }; @@ -67,7 +67,7 @@ class ObPlanCacheManager { common::ObIArray* key_array_; }; - public: +public: ObPlanCacheManager() : partition_location_cache_(NULL), tg_id_(-1), inited_(false), destroyed_(false), plan_cache_id_(0){}; virtual ~ObPlanCacheManager() @@ -109,14 +109,14 @@ class ObPlanCacheManager { ObPlanCache* get_plan_cache(uint64_t tenant_id); ObPsCache* get_ps_cache(const uint64_t tenant_id); - private: +private: enum PlanCacheGCStrategy { INVALID = -1, OFF = 0, REPORT = 1, AUTO = 2 }; static int get_plan_cache_gc_strategy(); friend void ::test::test_plan_cache_manager(); DISALLOW_COPY_AND_ASSIGN(ObPlanCacheManager); - private: +private: share::ObIPartitionLocationCache* partition_location_cache_; common::ObAddr self_addr_; PlanCacheMap pcm_; @@ -129,10 +129,10 @@ class ObPlanCacheManager { }; // end of class ObPlanCaeManager class ObPlanCacheManagerAtomic { - public: +public: typedef common::hash::HashMapPair MapKV; - public: +public: ObPlanCacheManagerAtomic() : plan_cache_(NULL){}; virtual ~ObPlanCacheManagerAtomic(){}; @@ -154,15 +154,15 @@ class ObPlanCacheManagerAtomic { return plan_cache_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPlanCacheManagerAtomic); - private: +private: ObPlanCache* plan_cache_; }; // end of class ObPlanCacheManagerAtomic class ObPsCacheManagerAtomic { - public: +public: typedef common::hash::HashMapPair MapKV; ObPsCacheManagerAtomic() : ps_cache_(NULL){}; virtual ~ObPsCacheManagerAtomic() @@ -185,7 +185,7 @@ class ObPsCacheManagerAtomic { return ps_cache_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPsCacheManagerAtomic); ObPsCache* ps_cache_; }; diff --git a/src/sql/plan_cache/ob_plan_cache_util.h b/src/sql/plan_cache/ob_plan_cache_util.h index bdf6e3f99..d73461827 100644 --- a/src/sql/plan_cache/ob_plan_cache_util.h +++ b/src/sql/plan_cache/ob_plan_cache_util.h @@ -1065,12 +1065,12 @@ struct ObGetAllPlanIdOp { int set_key_array(common::ObIArray* key_array); int operator()(common::hash::HashMapPair& entry); - public: +public: common::ObIArray* key_array_; }; struct ObPhyLocationGetter { - public: +public: // used for getting plan static int get_phy_locations(const ObIArray& table_locations, const ObPlanCacheCtx& pc_ctx, share::ObIPartitionLocationCache& location_cache, ObIArray& phy_location_infos, diff --git a/src/sql/plan_cache/ob_plan_cache_value.h b/src/sql/plan_cache/ob_plan_cache_value.h index 440f5e69c..7802c664e 100644 --- a/src/sql/plan_cache/ob_plan_cache_value.h +++ b/src/sql/plan_cache/ob_plan_cache_value.h @@ -117,12 +117,12 @@ struct PCVSchemaObj { }; class ObPlanCacheValue : public common::ObDLinkBase { - public: +public: static const int64_t MAX_SQL_LENGTH = 2048; static const int32_t MAX_PLAN_PER_SQL = 8; const static int64_t OB_INFLUENCE_PLAN_SYS_VAR_LEN = 512; - public: +public: ObPlanCacheValue(); ~ObPlanCacheValue() { @@ -247,7 +247,7 @@ class ObPlanCacheValue : public common::ObDLinkBase { int lift_tenant_schema_version(int64_t new_schema_version); - private: +private: // used for add plan // check table version, view table version, merged version int check_value_version_for_add( @@ -310,7 +310,7 @@ class ObPlanCacheValue : public common::ObDLinkBase { friend class ::test::TestPlanSet_basic_Test; friend class ::test::TestPlanCacheValue_basic_Test; - private: +private: //*********** for match ************** common::ObSEArray not_param_info_; common::ObBitSet<> not_param_index_; diff --git a/src/sql/plan_cache/ob_plan_set.h b/src/sql/plan_cache/ob_plan_set.h index e195341de..2d8c0317e 100644 --- a/src/sql/plan_cache/ob_plan_set.h +++ b/src/sql/plan_cache/ob_plan_set.h @@ -88,7 +88,7 @@ typedef common::hash::ObHashSet Uniq class ObPlanSet : public common::ObDLinkBase { friend class ObPhyLocationGetter; - public: +public: explicit ObPlanSet(ObPlanSetType type) : alloc_(common::ObNewModIds::OB_SQL_PLAN_CACHE), plan_cache_value_(NULL), @@ -108,7 +108,7 @@ class ObPlanSet : public common::ObDLinkBase { {} virtual ~ObPlanSet(); - public: +public: int match_params_info(const ParamStore* params, ObPlanCacheCtx& pc_ctx, int64_t outline_param_idx, bool& is_same); int match_params_info( const common::Ob2DArray& infos, @@ -160,7 +160,7 @@ class ObPlanSet : public common::ObDLinkBase { return !multi_stmt_rowkey_pos_.empty(); } - private: +private: bool is_match_outline_param(int64_t param_idx) { return outline_param_idx_ == param_idx; @@ -196,7 +196,7 @@ class ObPlanSet : public common::ObDLinkBase { DISALLOW_COPY_AND_ASSIGN(ObPlanSet); friend class ::test::TestPlanSet_basic_Test; - protected: +protected: common::ObArenaAllocator alloc_; ObPlanCacheValue* plan_cache_value_; ObPlanSetType type_; @@ -236,7 +236,7 @@ struct TablePart { }; class ObSqlPlanSet : public ObPlanSet { - public: +public: ObSqlPlanSet() : ObPlanSet(PST_SQL_CRSR), is_all_non_partition_(true), @@ -256,7 +256,7 @@ class ObSqlPlanSet : public ObPlanSet { virtual ~ObSqlPlanSet() {} - public: +public: virtual int add_cache_obj(ObCacheObject& cache_object, ObPlanCacheCtx& pc_ctx, int64_t ol_param_idx) override; virtual int select_plan( share::ObIPartitionLocationCache* location_cache, ObPlanCacheCtx& pc_ctx, ObCacheObject*& cache_obj) override; @@ -287,7 +287,7 @@ class ObSqlPlanSet : public ObPlanSet { const ObSQLSessionInfo* session, const ParamStore& param_store, share::schema::ObSchemaGetterGuard* schema_guard, ObExecContext& exec_ctx, ObIArray& partition_ids); - private: +private: enum { TRY_PLAN_LATE_MAT = 1, TRY_PLAN_OR_EXPAND = 1 << 1, @@ -358,7 +358,7 @@ class ObSqlPlanSet : public ObPlanSet { bool is_local_plan_opt_allowed(int last_retry_err); int check_partition_status(const ObPartitionKey& pkey, bool& is_leader); - private: +private: bool is_all_non_partition_; // if plan is with non-part tables common::ObSEArray table_locations_; common::ObString params_info_str_; @@ -387,13 +387,13 @@ class ObSqlPlanSet : public ObPlanSet { }; class ObPLPlanSet : public ObPlanSet { - public: +public: ObPLPlanSet() : ObPlanSet(PST_PRCD), pl_obj_(NULL) {} virtual ~ObPLPlanSet() {} - public: +public: virtual int add_cache_obj(ObCacheObject& cache_object, ObPlanCacheCtx& pc_ctx, int64_t ol_param_idx) override; virtual int select_plan( share::ObIPartitionLocationCache* location_cache, ObPlanCacheCtx& pc_ctx, ObCacheObject*& cache_obj) override; @@ -402,7 +402,7 @@ class ObPLPlanSet : public ObPlanSet { virtual int64_t get_mem_size() override; virtual void reset() override; - private: +private: sql::ObCacheObject* pl_obj_; }; diff --git a/src/sql/plan_cache/ob_prepare_stmt_struct.h b/src/sql/plan_cache/ob_prepare_stmt_struct.h index 1810d302a..89af0417c 100644 --- a/src/sql/plan_cache/ob_prepare_stmt_struct.h +++ b/src/sql/plan_cache/ob_prepare_stmt_struct.h @@ -24,7 +24,7 @@ namespace sql { // ps stmt key class ObPsSqlKey { - public: +public: ObPsSqlKey() : db_id_(OB_INVALID_ID), ps_sql_(), allocator_(NULL) {} ObPsSqlKey(uint64_t db_id, const common::ObString& ps_sql) : db_id_(db_id), ps_sql_(ps_sql), allocator_(NULL) @@ -65,7 +65,7 @@ class ObPsSqlKey { } // not deep copy TO_STRING_KV(K_(db_id), K_(ps_sql)); - private: +private: uint64_t db_id_; // tenant id encoded in database id common::ObString ps_sql_; common::ObIAllocator* allocator_; @@ -73,7 +73,7 @@ class ObPsSqlKey { // ps stmt item class ObPsStmtItem { - public: +public: ObPsStmtItem(); explicit ObPsStmtItem(const ObPsStmtId stmt_id); explicit ObPsStmtItem(common::ObIAllocator* inner_allocator, common::ObIAllocator* external_allocator); @@ -124,7 +124,7 @@ class ObPsStmtItem { TO_STRING_KV(K_(ref_count), K_(db_id), K_(ps_sql), K_(stmt_id)); - private: +private: volatile int64_t ref_count_; uint64_t db_id_; common::ObString ps_sql_; @@ -137,7 +137,7 @@ class ObPsStmtItem { }; struct ObPsSqlMeta { - public: +public: explicit ObPsSqlMeta(common::ObIAllocator* allocator) : allocator_(allocator), param_fields_(allocator), column_fields_(allocator) {} @@ -165,14 +165,14 @@ struct ObPsSqlMeta { return column_fields_; }; - private: +private: common::ObIAllocator* allocator_; ObFixedArray param_fields_; ObFixedArray column_fields_; }; class ObPsStmtInfo { - public: +public: explicit ObPsStmtInfo(common::ObIAllocator* inner_allocator); ObPsStmtInfo(common::ObIAllocator* inner_allocator, common::ObIAllocator* external_allocator); virtual ~ObPsStmtInfo() @@ -332,7 +332,7 @@ class ObPsStmtInfo { DECLARE_VIRTUAL_TO_STRING; - private: +private: stmt::StmtType stmt_type_; uint64_t ps_stmt_checksum_; uint64_t db_id_; @@ -406,7 +406,7 @@ typedef common::ObSEArray ParamCastArray; // the ps item and ps info references in the ps cache will be subtracted. // When the ps item/info reference count is 0, it will be released from the ps cache class ObPsSessionInfo { - public: +public: ObPsSessionInfo(const int64_t num_of_params) : stmt_id_(common::OB_INVALID_STMT_ID), stmt_type_(stmt::T_NONE), @@ -497,7 +497,7 @@ class ObPsSessionInfo { TO_STRING_KV(K_(stmt_id), K_(stmt_type), K_(num_of_params), K_(ref_cnt), K_(ps_stmt_checksum), K_(inner_stmt_id)); - private: +private: ObPsStmtId stmt_id_; stmt::StmtType stmt_type_; int64_t num_of_params_; @@ -507,12 +507,12 @@ class ObPsSessionInfo { int64_t ref_cnt_; ObPsStmtId inner_stmt_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPsSessionInfo); }; class ObPsStmtInfoGuard { - public: +public: ObPsStmtInfoGuard() : ps_cache_(NULL), stmt_info_(NULL), stmt_id_(common::OB_INVALID_STMT_ID) {} virtual ~ObPsStmtInfoGuard(); @@ -536,12 +536,12 @@ class ObPsStmtInfoGuard { int get_ps_sql(common::ObString& ps_sql); - private: +private: ObPsCache* ps_cache_; ObPsStmtInfo* stmt_info_; ObPsStmtId stmt_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPsStmtInfoGuard); }; diff --git a/src/sql/plan_cache/ob_ps_cache.cpp b/src/sql/plan_cache/ob_ps_cache.cpp index fd3d70126..fa8df35bb 100644 --- a/src/sql/plan_cache/ob_ps_cache.cpp +++ b/src/sql/plan_cache/ob_ps_cache.cpp @@ -698,7 +698,7 @@ struct ObDumpPsInfo { }; class PsTimeCmp { - public: +public: bool operator()(std::pair left, std::pair right) { return left.second < right.second; diff --git a/src/sql/plan_cache/ob_ps_cache.h b/src/sql/plan_cache/ob_ps_cache.h index 84a8a0fc3..5da8ee209 100644 --- a/src/sql/plan_cache/ob_ps_cache.h +++ b/src/sql/plan_cache/ob_ps_cache.h @@ -29,7 +29,7 @@ using common::ObPsStmtId; namespace sql { class ObPsCache { - public: +public: // sql -> stmt_id typedef common::hash::ObHashMap PsStmtIdMap; // stmt_id -> plan @@ -61,7 +61,7 @@ class ObPsCache { } int set_mem_conf(const ObPCMemPctConf& conf); - public: +public: // always make sure stmt_id is inner_stmt_id!!! int get_stmt_info_guard(const ObPsStmtId ps_stmt_id, ObPsStmtInfoGuard& guard); int ref_stmt_item(const uint64_t db_id, const common::ObString& ps_sql, ObPsStmtItem*& stmt_item); @@ -113,7 +113,7 @@ class ObPsCache { int check_schema_version(ObSchemaGetterGuard& schema_guard, ObPsStmtInfo& stmt_info, bool& is_expired); int erase_stmt_item(ObPsSqlKey& ps_key); - private: +private: int inner_cache_evict(bool is_evict_all); int fill_ps_stmt_info(const ObResultSet& result, int64_t param_cnt, ObPsStmtInfo& ps_stmt_info) const; int add_stmt_info(const ObPsStmtItem& ps_item, const ObPsStmtInfo& ps_info, ObPsStmtInfo*& ref_ps_info); @@ -167,7 +167,7 @@ class ObPsCache { ATOMIC_STORE(&mem_low_pct_, pct); } - private: +private: static const int64_t SLICE_SIZE = 1024; ObPsStmtId next_ps_stmt_id_; diff --git a/src/sql/plan_cache/ob_ps_cache_callback.h b/src/sql/plan_cache/ob_ps_cache_callback.h index defee495d..b46103861 100644 --- a/src/sql/plan_cache/ob_ps_cache_callback.h +++ b/src/sql/plan_cache/ob_ps_cache_callback.h @@ -23,7 +23,7 @@ namespace sql { class ObPCVSet; class ObGetClosedStmtIdOp { - public: +public: ObGetClosedStmtIdOp(common::ObIArray >* expired_ps, common::ObIArray >* closed_ps) : closed_ps_(closed_ps), expired_ps_(expired_ps), used_size_(0), callback_ret_(OB_SUCCESS) @@ -65,7 +65,7 @@ class ObGetClosedStmtIdOp { return used_size_; } - private: +private: common::ObIArray >* closed_ps_; common::ObIArray >* expired_ps_; int64_t used_size_; @@ -74,7 +74,7 @@ class ObGetClosedStmtIdOp { }; class ObGetAllStmtIdOp { - public: +public: explicit ObGetAllStmtIdOp(common::ObIArray* key_array) : key_array_(key_array), callback_ret_(OB_SUCCESS) {} @@ -94,7 +94,7 @@ class ObGetAllStmtIdOp { return callback_ret_; } - private: +private: common::ObIArray* key_array_; int callback_ret_; DISALLOW_COPY_AND_ASSIGN(ObGetAllStmtIdOp); @@ -103,7 +103,7 @@ class ObGetAllStmtIdOp { class ObPsStmtItemRefAtomicOp { typedef common::hash::HashMapPair PsStmtIdKV; - public: +public: ObPsStmtItemRefAtomicOp() : stmt_item_(NULL), callback_ret_(common::OB_SUCCESS) {} virtual ~ObPsStmtItemRefAtomicOp() @@ -116,7 +116,7 @@ class ObPsStmtItemRefAtomicOp { return callback_ret_; } - private: +private: ObPsStmtItem* stmt_item_; int callback_ret_; DISALLOW_COPY_AND_ASSIGN(ObPsStmtItemRefAtomicOp); @@ -125,7 +125,7 @@ class ObPsStmtItemRefAtomicOp { class ObPsStmtItemDerefAtomicOp { typedef common::hash::HashMapPair PsStmtIdKV; - public: +public: ObPsStmtItemDerefAtomicOp() : ret_(common::OB_SUCCESS), is_erase_(false) {} virtual ~ObPsStmtItemDerefAtomicOp() @@ -140,7 +140,7 @@ class ObPsStmtItemDerefAtomicOp { return is_erase_; } - private: +private: int ret_; bool is_erase_; DISALLOW_COPY_AND_ASSIGN(ObPsStmtItemDerefAtomicOp); @@ -149,7 +149,7 @@ class ObPsStmtItemDerefAtomicOp { class ObPsStmtInfoRefAtomicOp { typedef common::hash::HashMapPair PsStmtInfoKV; - public: +public: ObPsStmtInfoRefAtomicOp() : stmt_info_(NULL), callback_ret_(common::OB_SUCCESS) {} virtual ~ObPsStmtInfoRefAtomicOp() @@ -162,7 +162,7 @@ class ObPsStmtInfoRefAtomicOp { } void operator()(const PsStmtInfoKV& entry); - private: +private: ObPsStmtInfo* stmt_info_; int callback_ret_; DISALLOW_COPY_AND_ASSIGN(ObPsStmtInfoRefAtomicOp); @@ -171,7 +171,7 @@ class ObPsStmtInfoRefAtomicOp { class ObPsStmtInfoDerefAtomicOp { typedef common::hash::HashMapPair PsStmtInfoKV; - public: +public: ObPsStmtInfoDerefAtomicOp() : ret_(common::OB_SUCCESS), is_erase_(false) {} virtual ~ObPsStmtInfoDerefAtomicOp() @@ -186,17 +186,17 @@ class ObPsStmtInfoDerefAtomicOp { return is_erase_; } - private: +private: int ret_; bool is_erase_; DISALLOW_COPY_AND_ASSIGN(ObPsStmtInfoDerefAtomicOp); }; class ObPsPCVSetAtomicOp { - protected: +protected: typedef common::hash::HashMapPair PsPlanCacheKV; - public: +public: ObPsPCVSetAtomicOp(const CacheRefHandleID ref_handle) : pcv_set_(NULL), ref_handle_(ref_handle) {} virtual ~ObPsPCVSetAtomicOp() @@ -206,23 +206,23 @@ class ObPsPCVSetAtomicOp { // get pcv_set and increase reference count void operator()(PsPlanCacheKV& entry); - protected: +protected: // when get value, need lock virtual int lock(ObPCVSet& pcv_set) = 0; - protected: +protected: // According to the interface of ObHashTable, all returned values will be passed // back to the caller via the callback functor. // pcv_set_ - the plan cache value that is referenced. ObPCVSet* pcv_set_; const CacheRefHandleID ref_handle_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPsPCVSetAtomicOp); }; class ObPsPCVSetWlockAndRef : public ObPsPCVSetAtomicOp { - public: +public: ObPsPCVSetWlockAndRef(const CacheRefHandleID ref_handle) : ObPsPCVSetAtomicOp(ref_handle) {} virtual ~ObPsPCVSetWlockAndRef() @@ -232,12 +232,12 @@ class ObPsPCVSetWlockAndRef : public ObPsPCVSetAtomicOp { return pcv_set.lock(false /*wlock*/); }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPsPCVSetWlockAndRef); }; class ObPsPCVSetRlockAndRef : public ObPsPCVSetAtomicOp { - public: +public: ObPsPCVSetRlockAndRef(const CacheRefHandleID ref_handle) : ObPsPCVSetAtomicOp(ref_handle) {} virtual ~ObPsPCVSetRlockAndRef() @@ -247,7 +247,7 @@ class ObPsPCVSetRlockAndRef : public ObPsPCVSetAtomicOp { return pcvs.lock(true /*rlock*/); }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPsPCVSetRlockAndRef); }; diff --git a/src/sql/plan_cache/ob_ps_sql_utils.h b/src/sql/plan_cache/ob_ps_sql_utils.h index d0eb9becf..e186e4195 100644 --- a/src/sql/plan_cache/ob_ps_sql_utils.h +++ b/src/sql/plan_cache/ob_ps_sql_utils.h @@ -28,7 +28,7 @@ class ObString; } // namespace common namespace sql { class ObPsSqlUtils { - public: +public: template static int alloc_new_var(common::ObIAllocator& allocator, const T& t, T*& new_t); @@ -79,7 +79,7 @@ int ObPsSqlUtils::get_var_mem_total(const T& t, int64_t& size) } class ObPsSqlParamHelper { - public: +public: struct TraverseContext { TraverseContext() : node_(NULL), is_child_not_param_(false), question_marks_(), question_mark_count_(0), insert_vector_level_(0) @@ -101,12 +101,12 @@ class ObPsSqlParamHelper { int find_special_paramalize(const ParseNode& parse_node, int64_t& question_mark_count, common::ObIArray& no_check_type_offsets, common::ObIArray& not_param_offsets); - private: +private: static const int64_t INSERT_VALUE_VECTOR_CHILD_LEVEL = 1; int traverse(TraverseContext& ctx, common::ObIArray& no_check_type_offsets, common::ObIArray& not_param_offsets); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPsSqlParamHelper); }; diff --git a/src/sql/plan_cache/ob_sql_parameterization.h b/src/sql/plan_cache/ob_sql_parameterization.h index d3744e364..a5d31a48b 100644 --- a/src/sql/plan_cache/ob_sql_parameterization.h +++ b/src/sql/plan_cache/ob_sql_parameterization.h @@ -72,7 +72,7 @@ class TransformTreeCtx; struct SelectItemTraverseCtx; class ObSqlParameterization { - public: +public: static const int64_t SQL_PARAMETERIZATION_BUCKET_NUM = 1L << 20; static const int64_t NO_VALUES = -1; static const int64_t VALUE_LIST_LEVEL = 0; @@ -103,7 +103,7 @@ class ObSqlParameterization { static int insert_neg_sign(common::ObIAllocator& alloc_buf, ParseNode* node); static bool is_tree_not_param(const ParseNode* tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSqlParameterization); static int is_fast_parse_const(TransformTreeCtx& ctx); diff --git a/src/sql/privilege_check/ob_ora_priv_check.h b/src/sql/privilege_check/ob_ora_priv_check.h index 5ad493ae3..8eb636dc7 100644 --- a/src/sql/privilege_check/ob_ora_priv_check.h +++ b/src/sql/privilege_check/ob_ora_priv_check.h @@ -20,7 +20,7 @@ namespace sql { class ObOraSysChecker { - private: +private: static int map_obj_priv_array_to_sys_priv_array(const ObIArray& raw_obj_priv_array, const uint64_t obj_id, const uint64_t obj_type, ObIArray& sys_priv_array); @@ -171,7 +171,7 @@ class ObOraSysChecker { static int build_related_plist(uint64_t obj_type, share::ObRawPriv& sys_priv, share::ObRawPrivArray& plist); - public: +public: static bool is_super_user(const uint64_t user_id); static bool is_owner_user(const uint64_t user_id, const uint64_t owner_user_id); diff --git a/src/sql/privilege_check/ob_privilege_check.h b/src/sql/privilege_check/ob_privilege_check.h index 2cbe80a05..a4ea68737 100644 --- a/src/sql/privilege_check/ob_privilege_check.h +++ b/src/sql/privilege_check/ob_privilege_check.h @@ -27,7 +27,7 @@ typedef int (*ObGetStmtOraNeedPrivsFunc)(const share::schema::ObSessionPrivInfo& common::ObIArray& need_privs); class ObPrivilegeCheck { - public: +public: /// Check privilege ///@param ctx[in] sql ctx ///@param basic_stmt[in] stmt @@ -60,7 +60,7 @@ class ObPrivilegeCheck { static int check_password_expired_on_connection( uint64_t user_id, share::schema::ObSchemaGetterGuard& schema_guard, sql::ObSQLSessionInfo& session); - private: +private: /// Get all privilege info needed by a stmt, including sub-queries. /// called by generate_physical_plan ///@param ctx[in] sql ctx diff --git a/src/sql/resolver/cmd/ob_alter_system_resolver.h b/src/sql/resolver/cmd/ob_alter_system_resolver.h index 373fbd8dc..d2597c87c 100644 --- a/src/sql/resolver/cmd/ob_alter_system_resolver.h +++ b/src/sql/resolver/cmd/ob_alter_system_resolver.h @@ -23,7 +23,7 @@ class ObPartitionKey; namespace sql { class ObSystemCmdStmt; class ObAlterSystemResolverUtil { - public: +public: static int sanity_check(const ParseNode* parse_tree, ObItemType item_type); // resolve opt_ip_port @@ -54,7 +54,7 @@ class ObAlterSystemResolverUtil { #define DEF_SIMPLE_CMD_RESOLVER(name) \ class name : public ObSystemCmdResolver { \ - public: \ + public: \ name(ObResolverParams& params) : ObSystemCmdResolver(params) \ {} \ virtual ~name() \ @@ -148,38 +148,38 @@ DEF_SIMPLE_CMD_RESOLVER(ObBackupSetEncryptionResolver); DEF_SIMPLE_CMD_RESOLVER(ObBackupSetDecryptionResolver); class ObPhysicalRestoreTenantResolver : public ObSystemCmdResolver { - public: +public: ObPhysicalRestoreTenantResolver(ObResolverParams& params) : ObSystemCmdResolver(params) {} virtual ~ObPhysicalRestoreTenantResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: int resolve_decryption_passwd(obrpc::ObPhysicalRestoreTenantArg& arg); }; class ObAlterSystemSetResolver : public ObSystemCmdResolver { - public: +public: ObAlterSystemSetResolver(ObResolverParams& params) : ObSystemCmdResolver(params) {} virtual ~ObAlterSystemSetResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: int check_param_valid(int64_t tenant_id, const common::ObString& name_node, const common::ObString& value_node); }; class ObSetConfigResolver : public ObSystemCmdResolver { - public: +public: ObSetConfigResolver(ObResolverParams& params) : ObSystemCmdResolver(params) {} virtual ~ObSetConfigResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: int check_param_valid(int64_t tenant_id, const common::ObString& name_node, const common::ObString& value_node); }; diff --git a/src/sql/resolver/cmd/ob_alter_system_stmt.h b/src/sql/resolver/cmd/ob_alter_system_stmt.h index 52def8d6a..724033a84 100644 --- a/src/sql/resolver/cmd/ob_alter_system_stmt.h +++ b/src/sql/resolver/cmd/ob_alter_system_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObFreezeStmt : public ObSystemCmdStmt { - public: +public: ObFreezeStmt() : ObSystemCmdStmt(stmt::T_FREEZE), major_freeze_(false), @@ -74,7 +74,7 @@ class ObFreezeStmt : public ObSystemCmdStmt { TO_STRING_KV( N_STMT_TYPE, ((int)stmt_type_), K_(major_freeze), K(opt_server_list_), K(opt_tenant_ids_), K(opt_partition_key_)); - private: +private: bool major_freeze_; // for major_freeze, it is ignore server list // for minor_freeze, it is candidate server list @@ -88,7 +88,7 @@ class ObFreezeStmt : public ObSystemCmdStmt { }; class ObFlushCacheStmt : public ObSystemCmdStmt { - public: +public: ObFlushCacheStmt() : ObSystemCmdStmt(stmt::T_FLUSH_CACHE), flush_cache_arg_(), is_global_(false) {} virtual ~ObFlushCacheStmt() @@ -100,7 +100,7 @@ class ObFlushCacheStmt : public ObSystemCmdStmt { }; class ObLoadBaselineStmt : public ObSystemCmdStmt { - public: +public: ObLoadBaselineStmt() : ObSystemCmdStmt(stmt::T_LOAD_BASELINE), load_baseline_arg_() {} virtual ~ObLoadBaselineStmt() @@ -111,7 +111,7 @@ class ObLoadBaselineStmt : public ObSystemCmdStmt { }; class ObFlushKVCacheStmt : public ObSystemCmdStmt { - public: +public: ObFlushKVCacheStmt() : ObSystemCmdStmt(stmt::T_FLUSH_KVCACHE) {} virtual ~ObFlushKVCacheStmt() @@ -123,7 +123,7 @@ class ObFlushKVCacheStmt : public ObSystemCmdStmt { }; class ObFlushIlogCacheStmt : public ObSystemCmdStmt { - public: +public: ObFlushIlogCacheStmt() : ObSystemCmdStmt(stmt::T_FLUSH_ILOGCACHE), file_id_(0) {} virtual ~ObFlushIlogCacheStmt() @@ -134,7 +134,7 @@ class ObFlushIlogCacheStmt : public ObSystemCmdStmt { }; class ObFlushDagWarningsStmt : public ObSystemCmdStmt { - public: +public: ObFlushDagWarningsStmt() : ObSystemCmdStmt(stmt::T_FLUSH_DAG_WARNINGS) {} virtual ~ObFlushDagWarningsStmt() @@ -143,7 +143,7 @@ class ObFlushDagWarningsStmt : public ObSystemCmdStmt { }; class ObAdminServerStmt : public ObSystemCmdStmt { - public: +public: ObAdminServerStmt() : ObSystemCmdStmt(stmt::T_ADMIN_SERVER), op_(obrpc::ObAdminServerArg::ADD) {} @@ -174,14 +174,14 @@ class ObAdminServerStmt : public ObSystemCmdStmt { op_ = op; } - private: +private: obrpc::ObAdminServerArg::AdminServerOp op_; obrpc::ObServerList server_list_; common::ObZone zone_; }; class ObAdminZoneStmt : public ObSystemCmdStmt { - public: +public: ObAdminZoneStmt() : ObSystemCmdStmt(stmt::T_ADMIN_ZONE), arg_() {} @@ -271,12 +271,12 @@ class ObAdminZoneStmt : public ObSystemCmdStmt { return arg_; } - private: +private: obrpc::ObAdminZoneArg arg_; }; class ObSwitchReplicaRoleStmt : public ObSystemCmdStmt { - public: +public: ObSwitchReplicaRoleStmt() : ObSystemCmdStmt(stmt::T_SWITCH_REPLICA_ROLE) {} virtual ~ObSwitchReplicaRoleStmt() @@ -289,12 +289,12 @@ class ObSwitchReplicaRoleStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminSwitchReplicaRoleArg rpc_arg_; }; class ObSwitchRSRoleStmt : public ObSystemCmdStmt { - public: +public: ObSwitchRSRoleStmt() : ObSystemCmdStmt(stmt::T_SWITCH_RS_ROLE) {} virtual ~ObSwitchRSRoleStmt() @@ -307,12 +307,12 @@ class ObSwitchRSRoleStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminSwitchRSRoleArg rpc_arg_; }; class ObChangeReplicaStmt : public ObSystemCmdStmt { - public: +public: ObChangeReplicaStmt() : ObSystemCmdStmt(stmt::T_CHANGE_REPLICA) {} virtual ~ObChangeReplicaStmt() @@ -325,12 +325,12 @@ class ObChangeReplicaStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminChangeReplicaArg rpc_arg_; }; class ObDropReplicaStmt : public ObSystemCmdStmt { - public: +public: ObDropReplicaStmt() : ObSystemCmdStmt(stmt::T_DROP_REPLICA) {} virtual ~ObDropReplicaStmt() @@ -343,12 +343,12 @@ class ObDropReplicaStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminDropReplicaArg rpc_arg_; }; class ObMigrateReplicaStmt : public ObSystemCmdStmt { - public: +public: ObMigrateReplicaStmt() : ObSystemCmdStmt(stmt::T_MIGRATE_REPLICA) {} virtual ~ObMigrateReplicaStmt() @@ -361,12 +361,12 @@ class ObMigrateReplicaStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminMigrateReplicaArg rpc_arg_; }; class ObReportReplicaStmt : public ObSystemCmdStmt { - public: +public: ObReportReplicaStmt() : ObSystemCmdStmt(stmt::T_REPORT_REPLICA) {} virtual ~ObReportReplicaStmt() @@ -379,12 +379,12 @@ class ObReportReplicaStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminReportReplicaArg rpc_arg_; }; class ObRecycleReplicaStmt : public ObSystemCmdStmt { - public: +public: ObRecycleReplicaStmt() : ObSystemCmdStmt(stmt::T_RECYCLE_REPLICA) {} virtual ~ObRecycleReplicaStmt() @@ -397,12 +397,12 @@ class ObRecycleReplicaStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminRecycleReplicaArg rpc_arg_; }; class ObAdminMergeStmt : public ObSystemCmdStmt { - public: +public: ObAdminMergeStmt() : ObSystemCmdStmt(stmt::T_ADMIN_MERGE) {} virtual ~ObAdminMergeStmt() @@ -415,12 +415,12 @@ class ObAdminMergeStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminMergeArg rpc_arg_; }; class ObClearRoottableStmt : public ObSystemCmdStmt { - public: +public: ObClearRoottableStmt() : ObSystemCmdStmt(stmt::T_CLEAR_ROOT_TABLE) {} virtual ~ObClearRoottableStmt() @@ -433,12 +433,12 @@ class ObClearRoottableStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminClearRoottableArg rpc_arg_; }; class ObRefreshSchemaStmt : public ObSystemCmdStmt { - public: +public: ObRefreshSchemaStmt() : ObSystemCmdStmt(stmt::T_REFRESH_SCHEMA) {} virtual ~ObRefreshSchemaStmt() @@ -451,12 +451,12 @@ class ObRefreshSchemaStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminRefreshSchemaArg rpc_arg_; }; class ObRefreshMemStatStmt : public ObSystemCmdStmt { - public: +public: ObRefreshMemStatStmt() : ObSystemCmdStmt(stmt::T_REFRESH_MEMORY_STAT) {} virtual ~ObRefreshMemStatStmt() @@ -469,12 +469,12 @@ class ObRefreshMemStatStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminRefreshMemStatArg rpc_arg_; }; class ObSetConfigStmt : public ObSystemCmdStmt { - public: +public: ObSetConfigStmt() : ObSystemCmdStmt(stmt::T_ALTER_SYSTEM_SET_PARAMETER) {} virtual ~ObSetConfigStmt() @@ -487,12 +487,12 @@ class ObSetConfigStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminSetConfigArg rpc_arg_; }; class ObSetTPStmt : public ObSystemCmdStmt { - public: +public: ObSetTPStmt() : ObSystemCmdStmt(stmt::T_ALTER_SYSTEM_SETTP) {} virtual ~ObSetTPStmt() @@ -505,12 +505,12 @@ class ObSetTPStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminSetTPArg rpc_arg_; }; class ObMigrateUnitStmt : public ObSystemCmdStmt { - public: +public: ObMigrateUnitStmt() : ObSystemCmdStmt(stmt::T_MIGRATE_UNIT) {} virtual ~ObMigrateUnitStmt() @@ -523,12 +523,12 @@ class ObMigrateUnitStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(rpc_arg)); - private: +private: obrpc::ObAdminMigrateUnitArg rpc_arg_; }; class ObClearLocationCacheStmt : public ObSystemCmdStmt { - public: +public: ObClearLocationCacheStmt() : ObSystemCmdStmt(stmt::T_CLEAR_LOCATION_CACHE) {} virtual ~ObClearLocationCacheStmt() @@ -539,12 +539,12 @@ class ObClearLocationCacheStmt : public ObSystemCmdStmt { return rpc_arg_; } - private: +private: obrpc::ObAdminClearLocationCacheArg rpc_arg_; }; class ObReloadGtsStmt : public ObSystemCmdStmt { - public: +public: ObReloadGtsStmt() : ObSystemCmdStmt(stmt::T_RELOAD_GTS) {} virtual ~ObReloadGtsStmt() @@ -552,7 +552,7 @@ class ObReloadGtsStmt : public ObSystemCmdStmt { }; class ObReloadUnitStmt : public ObSystemCmdStmt { - public: +public: ObReloadUnitStmt() : ObSystemCmdStmt(stmt::T_RELOAD_UNIT) {} virtual ~ObReloadUnitStmt() @@ -560,7 +560,7 @@ class ObReloadUnitStmt : public ObSystemCmdStmt { }; class ObReloadServerStmt : public ObSystemCmdStmt { - public: +public: ObReloadServerStmt() : ObSystemCmdStmt(stmt::T_RELOAD_SERVER) {} virtual ~ObReloadServerStmt() @@ -568,7 +568,7 @@ class ObReloadServerStmt : public ObSystemCmdStmt { }; class ObReloadZoneStmt : public ObSystemCmdStmt { - public: +public: ObReloadZoneStmt() : ObSystemCmdStmt(stmt::T_RELOAD_ZONE) {} virtual ~ObReloadZoneStmt() @@ -576,7 +576,7 @@ class ObReloadZoneStmt : public ObSystemCmdStmt { }; class ObClearMergeErrorStmt : public ObSystemCmdStmt { - public: +public: ObClearMergeErrorStmt() : ObSystemCmdStmt(stmt::T_CLEAR_MERGE_ERROR) {} virtual ~ObClearMergeErrorStmt() @@ -584,7 +584,7 @@ class ObClearMergeErrorStmt : public ObSystemCmdStmt { }; class ObUpgradeVirtualSchemaStmt : public ObSystemCmdStmt { - public: +public: ObUpgradeVirtualSchemaStmt() : ObSystemCmdStmt(stmt::T_UPGRADE_VIRTUAL_SCHEMA) {} virtual ~ObUpgradeVirtualSchemaStmt() @@ -592,7 +592,7 @@ class ObUpgradeVirtualSchemaStmt : public ObSystemCmdStmt { }; class ObAdminUpgradeCmdStmt : public ObSystemCmdStmt { - public: +public: enum AdminUpgradeOp { BEGIN = 1, END = 2, @@ -611,12 +611,12 @@ class ObAdminUpgradeCmdStmt : public ObSystemCmdStmt { op_ = op; } - private: +private: AdminUpgradeOp op_; }; class ObAdminRollingUpgradeCmdStmt : public ObSystemCmdStmt { - public: +public: enum AdminUpgradeOp { BEGIN = 1, END = 2, @@ -635,12 +635,12 @@ class ObAdminRollingUpgradeCmdStmt : public ObSystemCmdStmt { op_ = op; } - private: +private: AdminUpgradeOp op_; }; class ObRestoreTenantStmt : public ObSystemCmdStmt { - public: +public: ObRestoreTenantStmt() : ObSystemCmdStmt(stmt::T_RESTORE_TENANT), rpc_arg_() {} virtual ~ObRestoreTenantStmt() @@ -651,12 +651,12 @@ class ObRestoreTenantStmt : public ObSystemCmdStmt { return rpc_arg_; } - private: +private: obrpc::ObRestoreTenantArg rpc_arg_; }; class ObPhysicalRestoreTenantStmt : public ObSystemCmdStmt { - public: +public: ObPhysicalRestoreTenantStmt() : ObSystemCmdStmt(stmt::T_PHYSICAL_RESTORE_TENANT), rpc_arg_() {} virtual ~ObPhysicalRestoreTenantStmt() @@ -667,12 +667,12 @@ class ObPhysicalRestoreTenantStmt : public ObSystemCmdStmt { return rpc_arg_; } - private: +private: obrpc::ObPhysicalRestoreTenantArg rpc_arg_; }; class ObRunJobStmt : public ObSystemCmdStmt { - public: +public: ObRunJobStmt() : ObSystemCmdStmt(stmt::T_RUN_JOB) {} virtual ~ObRunJobStmt() @@ -683,12 +683,12 @@ class ObRunJobStmt : public ObSystemCmdStmt { return rpc_arg_; } - private: +private: obrpc::ObRunJobArg rpc_arg_; }; class ObRunUpgradeJobStmt : public ObSystemCmdStmt { - public: +public: ObRunUpgradeJobStmt() : ObSystemCmdStmt(stmt::T_ADMIN_RUN_UPGRADE_JOB) {} virtual ~ObRunUpgradeJobStmt() @@ -699,12 +699,12 @@ class ObRunUpgradeJobStmt : public ObSystemCmdStmt { return rpc_arg_; } - private: +private: obrpc::ObUpgradeJobArg rpc_arg_; }; class ObStopUpgradeJobStmt : public ObSystemCmdStmt { - public: +public: ObStopUpgradeJobStmt() : ObSystemCmdStmt(stmt::T_ADMIN_STOP_UPGRADE_JOB) {} virtual ~ObStopUpgradeJobStmt() @@ -715,12 +715,12 @@ class ObStopUpgradeJobStmt : public ObSystemCmdStmt { return rpc_arg_; } - private: +private: obrpc::ObUpgradeJobArg rpc_arg_; }; class ObRefreshTimeZoneInfoStmt : public ObSystemCmdStmt { - public: +public: ObRefreshTimeZoneInfoStmt() : ObSystemCmdStmt(stmt::T_REFRESH_TIME_ZONE_INFO), tenant_id_(OB_INVALID_TENANT_ID) {} virtual ~ObRefreshTimeZoneInfoStmt() @@ -739,7 +739,7 @@ class ObRefreshTimeZoneInfoStmt : public ObSystemCmdStmt { }; class ObCancelTaskStmt : public ObSystemCmdStmt { - public: +public: ObCancelTaskStmt() : ObSystemCmdStmt(stmt::T_CANCEL_TASK), task_type_(share::MAX_SYS_TASK_TYPE), task_id_() {} virtual ~ObCancelTaskStmt() @@ -766,13 +766,13 @@ class ObCancelTaskStmt : public ObSystemCmdStmt { return ret; } - private: +private: share::ObSysTaskType task_type_; common::ObString task_id_; }; class ObSetDiskValidStmt : public ObSystemCmdStmt { - public: +public: ObSetDiskValidStmt() : ObSystemCmdStmt(stmt::T_SET_DISK_VALID), server_() {} virtual ~ObSetDiskValidStmt() @@ -783,7 +783,7 @@ class ObSetDiskValidStmt : public ObSystemCmdStmt { }; class ObAddDiskStmt : public ObSystemCmdStmt { - public: +public: ObAddDiskStmt() : ObSystemCmdStmt(stmt::T_ALTER_DISKGROUP_ADD_DISK) {} virtual ~ObAddDiskStmt() @@ -794,7 +794,7 @@ class ObAddDiskStmt : public ObSystemCmdStmt { }; class ObDropDiskStmt : public ObSystemCmdStmt { - public: +public: ObDropDiskStmt() : ObSystemCmdStmt(stmt::T_ALTER_DISKGROUP_DROP_DISK) {} virtual ~ObDropDiskStmt() @@ -805,7 +805,7 @@ class ObDropDiskStmt : public ObSystemCmdStmt { }; class ObEnableSqlThrottleStmt : public ObSystemCmdStmt { - public: +public: ObEnableSqlThrottleStmt() : ObSystemCmdStmt(stmt::T_ENABLE_SQL_THROTTLE), priority_(99), @@ -877,7 +877,7 @@ class ObEnableSqlThrottleStmt : public ObSystemCmdStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(priority), K_(rt), K_(io), K_(network), K_(cpu), K_(logical_reads), K_(queue_time)); - private: +private: int64_t priority_; double rt_; int64_t io_; @@ -888,13 +888,13 @@ class ObEnableSqlThrottleStmt : public ObSystemCmdStmt { }; class ObDisableSqlThrottleStmt : public ObSystemCmdStmt { - public: +public: ObDisableSqlThrottleStmt() : ObSystemCmdStmt(stmt::T_DISABLE_SQL_THROTTLE) {} }; class ObChangeTenantStmt : public ObSystemCmdStmt { - public: +public: ObChangeTenantStmt() : ObSystemCmdStmt(stmt::T_CHANGE_TENANT), tenant_id_(OB_INVALID_TENANT_ID) {} virtual ~ObChangeTenantStmt() @@ -913,7 +913,7 @@ class ObChangeTenantStmt : public ObSystemCmdStmt { }; class ObArchiveLogStmt : public ObSystemCmdStmt { - public: +public: ObArchiveLogStmt() : ObSystemCmdStmt(stmt::T_ARCHIVE_LOG), enable_(true) {} virtual ~ObArchiveLogStmt() @@ -928,12 +928,12 @@ class ObArchiveLogStmt : public ObSystemCmdStmt { } TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(enable)); - private: +private: bool enable_; }; class ObBackupDatabaseStmt : public ObSystemCmdStmt { - public: +public: ObBackupDatabaseStmt() : ObSystemCmdStmt(stmt::T_BACKUP_DATABASE), tenant_id_(OB_INVALID_ID), incremental_(false) {} virtual ~ObBackupDatabaseStmt() @@ -962,13 +962,13 @@ class ObBackupDatabaseStmt : public ObSystemCmdStmt { } TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(tenant_id), K_(incremental)); - private: +private: uint64_t tenant_id_; bool incremental_; }; class ObBackupManageStmt : public ObSystemCmdStmt { - public: +public: ObBackupManageStmt() : ObSystemCmdStmt(stmt::T_BACKUP_MANAGE), tenant_id_(OB_INVALID_ID), @@ -1006,14 +1006,14 @@ class ObBackupManageStmt : public ObSystemCmdStmt { } TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(tenant_id), K_(type), K_(value)); - private: +private: uint64_t tenant_id_; obrpc::ObBackupManageArg::Type type_; int64_t value_; }; class ObBackupSetEncryptionStmt : public ObSystemCmdStmt { - public: +public: ObBackupSetEncryptionStmt(); virtual ~ObBackupSetEncryptionStmt() {} @@ -1029,14 +1029,14 @@ class ObBackupSetEncryptionStmt : public ObSystemCmdStmt { TO_STRING_KV( N_STMT_TYPE, ((int)stmt_type_), "mode", share::ObBackupEncryptionMode::to_str(mode_), K_(encrypted_passwd)); - private: +private: share::ObBackupEncryptionMode::EncryptionMode mode_; char passwd_buf_[OB_MAX_PASSWORD_LENGTH]; ObString encrypted_passwd_; }; class ObBackupSetDecryptionStmt : public ObSystemCmdStmt { - public: +public: ObBackupSetDecryptionStmt(); virtual ~ObBackupSetDecryptionStmt() {} @@ -1047,7 +1047,7 @@ class ObBackupSetDecryptionStmt : public ObSystemCmdStmt { int add_passwd(const ObString& passwd); TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(pos), K_(passwd_array)); - private: +private: char passwd_array_[OB_MAX_PASSWORD_ARRAY_LENGTH]; int64_t pos_; }; diff --git a/src/sql/resolver/cmd/ob_bootstrap_resolver.h b/src/sql/resolver/cmd/ob_bootstrap_resolver.h index 86a5aabab..0c33efc5a 100644 --- a/src/sql/resolver/cmd/ob_bootstrap_resolver.h +++ b/src/sql/resolver/cmd/ob_bootstrap_resolver.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { class ObBootstrapResolver : public ObSystemCmdResolver { - public: +public: explicit ObBootstrapResolver(ObResolverParams& params); virtual ~ObBootstrapResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBootstrapResolver); }; } // namespace sql diff --git a/src/sql/resolver/cmd/ob_bootstrap_stmt.h b/src/sql/resolver/cmd/ob_bootstrap_stmt.h index d4ea61179..8d663634d 100644 --- a/src/sql/resolver/cmd/ob_bootstrap_stmt.h +++ b/src/sql/resolver/cmd/ob_bootstrap_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObBootstrapStmt : public ObSystemCmdStmt { - public: +public: ObBootstrapStmt() : ObSystemCmdStmt(stmt::T_BOOTSTRAP), bootstrap_arg_() {} explicit ObBootstrapStmt(common::ObIAllocator* name_pool) : ObSystemCmdStmt(name_pool, stmt::T_BOOTSTRAP) @@ -49,7 +49,7 @@ class ObBootstrapStmt : public ObSystemCmdStmt { } TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(bootstrap_arg)); - public: +public: obrpc::ObBootstrapArg bootstrap_arg_; DISALLOW_COPY_AND_ASSIGN(ObBootstrapStmt); }; diff --git a/src/sql/resolver/cmd/ob_clear_balance_task_stmt.h b/src/sql/resolver/cmd/ob_clear_balance_task_stmt.h index e4de7d39e..7d65d11ac 100644 --- a/src/sql/resolver/cmd/ob_clear_balance_task_stmt.h +++ b/src/sql/resolver/cmd/ob_clear_balance_task_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObClearBalanceTaskStmt : public ObSystemCmdStmt { - public: +public: ObClearBalanceTaskStmt() : ObSystemCmdStmt(stmt::T_CLEAR_BALANCE_TASK), arg_() {} explicit ObClearBalanceTaskStmt(common::ObIAllocator* name_pool) @@ -44,7 +44,7 @@ class ObClearBalanceTaskStmt : public ObSystemCmdStmt { return arg_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObClearBalanceTaskStmt); obrpc::ObAdminClearBalanceTaskArg arg_; }; diff --git a/src/sql/resolver/cmd/ob_cmd_resolver.h b/src/sql/resolver/cmd/ob_cmd_resolver.h index 49bc0087b..bdc1ae162 100644 --- a/src/sql/resolver/cmd/ob_cmd_resolver.h +++ b/src/sql/resolver/cmd/ob_cmd_resolver.h @@ -19,13 +19,13 @@ namespace oceanbase { namespace sql { class ObCMDResolver : public ObStmtResolver { - public: +public: explicit ObCMDResolver(ObResolverParams& params) : ObStmtResolver(params) {} virtual ~ObCMDResolver() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCMDResolver); }; } // namespace sql diff --git a/src/sql/resolver/cmd/ob_cmd_stmt.h b/src/sql/resolver/cmd/ob_cmd_stmt.h index 05abc1570..e818825c3 100644 --- a/src/sql/resolver/cmd/ob_cmd_stmt.h +++ b/src/sql/resolver/cmd/ob_cmd_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObCMDStmt : public ObStmt, public ObICmd { - public: +public: ObCMDStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObStmt(name_pool, type) {} explicit ObCMDStmt(stmt::StmtType type) : ObStmt(type) @@ -31,7 +31,7 @@ class ObCMDStmt : public ObStmt, public ObICmd { return get_stmt_type(); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCMDStmt); }; } // namespace sql diff --git a/src/sql/resolver/cmd/ob_create_restore_point_resolver.h b/src/sql/resolver/cmd/ob_create_restore_point_resolver.h index 0f4bb999e..b1fe1285c 100644 --- a/src/sql/resolver/cmd/ob_create_restore_point_resolver.h +++ b/src/sql/resolver/cmd/ob_create_restore_point_resolver.h @@ -18,20 +18,20 @@ namespace oceanbase { namespace sql { class ObCreateRestorePointResolver : public ObSystemCmdResolver { - public: +public: explicit ObCreateRestorePointResolver(ObResolverParams& params); virtual ~ObCreateRestorePointResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateRestorePointResolver); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/cmd/ob_create_restore_point_stmt.h b/src/sql/resolver/cmd/ob_create_restore_point_stmt.h index 08494791f..6bf28d558 100644 --- a/src/sql/resolver/cmd/ob_create_restore_point_stmt.h +++ b/src/sql/resolver/cmd/ob_create_restore_point_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObCreateRestorePointStmt : public ObSystemCmdStmt { - public: +public: explicit ObCreateRestorePointStmt(common::ObIAllocator* name_pool) : ObSystemCmdStmt(name_pool, stmt::T_CREATE_RESTORE_POINT), create_restore_point_arg_(), restore_point_name_() {} @@ -49,7 +49,7 @@ class ObCreateRestorePointStmt : public ObSystemCmdStmt { return restore_point_name_; } - private: +private: obrpc::ObCreateRestorePointArg create_restore_point_arg_; ObString restore_point_name_; DISALLOW_COPY_AND_ASSIGN(ObCreateRestorePointStmt); diff --git a/src/sql/resolver/cmd/ob_drop_restore_point_resolver.h b/src/sql/resolver/cmd/ob_drop_restore_point_resolver.h index e9d75f692..0891bedea 100644 --- a/src/sql/resolver/cmd/ob_drop_restore_point_resolver.h +++ b/src/sql/resolver/cmd/ob_drop_restore_point_resolver.h @@ -18,20 +18,20 @@ namespace oceanbase { namespace sql { class ObDropRestorePointResolver : public ObSystemCmdResolver { - public: +public: explicit ObDropRestorePointResolver(ObResolverParams& params); virtual ~ObDropRestorePointResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropRestorePointResolver); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/cmd/ob_drop_restore_point_stmt.h b/src/sql/resolver/cmd/ob_drop_restore_point_stmt.h index 5d6fc9b5e..43fd7e06e 100644 --- a/src/sql/resolver/cmd/ob_drop_restore_point_stmt.h +++ b/src/sql/resolver/cmd/ob_drop_restore_point_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObDropRestorePointStmt : public ObSystemCmdStmt { - public: +public: explicit ObDropRestorePointStmt(common::ObIAllocator* name_pool) : ObSystemCmdStmt(name_pool, stmt::T_DROP_RESTORE_POINT), drop_restore_point_arg_(), restore_point_name_() {} @@ -48,7 +48,7 @@ class ObDropRestorePointStmt : public ObSystemCmdStmt { return restore_point_name_; } - private: +private: obrpc::ObDropRestorePointArg drop_restore_point_arg_; ObString restore_point_name_; DISALLOW_COPY_AND_ASSIGN(ObDropRestorePointStmt); diff --git a/src/sql/resolver/cmd/ob_empty_query_resolver.h b/src/sql/resolver/cmd/ob_empty_query_resolver.h index 58f2a75af..4a98db2ed 100644 --- a/src/sql/resolver/cmd/ob_empty_query_resolver.h +++ b/src/sql/resolver/cmd/ob_empty_query_resolver.h @@ -16,14 +16,14 @@ namespace oceanbase { namespace sql { class ObEmptyQueryResolver : public ObCMDResolver { - public: +public: explicit ObEmptyQueryResolver(ObResolverParams& params) : ObCMDResolver(params) {} virtual ~ObEmptyQueryResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObEmptyQueryResolver); }; } // namespace sql diff --git a/src/sql/resolver/cmd/ob_empty_query_stmt.h b/src/sql/resolver/cmd/ob_empty_query_stmt.h index 9342d5ed2..01fec197d 100644 --- a/src/sql/resolver/cmd/ob_empty_query_stmt.h +++ b/src/sql/resolver/cmd/ob_empty_query_stmt.h @@ -18,14 +18,14 @@ namespace oceanbase { namespace sql { class ObEmptyQueryStmt : public ObCMDStmt { - public: +public: ObEmptyQueryStmt() : ObCMDStmt(stmt::T_EMPTY_QUERY) {} virtual ~ObEmptyQueryStmt() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObEmptyQueryStmt); }; diff --git a/src/sql/resolver/cmd/ob_kill_resolver.h b/src/sql/resolver/cmd/ob_kill_resolver.h index e48d307b6..d3ea13187 100644 --- a/src/sql/resolver/cmd/ob_kill_resolver.h +++ b/src/sql/resolver/cmd/ob_kill_resolver.h @@ -16,14 +16,14 @@ namespace oceanbase { namespace sql { class ObKillResolver : public ObCMDResolver { - public: +public: explicit ObKillResolver(ObResolverParams& params) : ObCMDResolver(params) {} virtual ~ObKillResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObKillResolver); }; } // namespace sql diff --git a/src/sql/resolver/cmd/ob_kill_stmt.h b/src/sql/resolver/cmd/ob_kill_stmt.h index be358f052..19e57db7f 100644 --- a/src/sql/resolver/cmd/ob_kill_stmt.h +++ b/src/sql/resolver/cmd/ob_kill_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObKillStmt : public ObCMDStmt { - public: +public: ObKillStmt() : ObCMDStmt(stmt::T_KILL), is_query_(false), value_expr_(NULL) {} virtual ~ObKillStmt() @@ -40,7 +40,7 @@ class ObKillStmt : public ObCMDStmt { return is_query_; } - private: +private: bool is_query_; ObRawExpr* value_expr_; DISALLOW_COPY_AND_ASSIGN(ObKillStmt); diff --git a/src/sql/resolver/cmd/ob_load_data_resolver.h b/src/sql/resolver/cmd/ob_load_data_resolver.h index 4dae6d189..efe9b36a0 100644 --- a/src/sql/resolver/cmd/ob_load_data_resolver.h +++ b/src/sql/resolver/cmd/ob_load_data_resolver.h @@ -21,7 +21,7 @@ class ObLoadDataStmt; struct ObDataInFileStruct; class ObLoadDataResolver : public ObCMDResolver { - public: +public: explicit ObLoadDataResolver(ObResolverParams& params) : ObCMDResolver(params), current_scope_(T_LOAD_DATA_SCOPE) {} virtual ~ObLoadDataResolver() @@ -49,7 +49,7 @@ class ObLoadDataResolver : public ObCMDResolver { int validate_stmt(ObLoadDataStmt* stmt); int resolve_hints(const ParseNode& node); - private: +private: enum ParameterEnum { ENUM_OPT_LOCAL = 0, ENUM_FILE_NAME, diff --git a/src/sql/resolver/cmd/ob_load_data_stmt.h b/src/sql/resolver/cmd/ob_load_data_stmt.h index df5bdd9c4..874f6529e 100644 --- a/src/sql/resolver/cmd/ob_load_data_stmt.h +++ b/src/sql/resolver/cmd/ob_load_data_stmt.h @@ -129,7 +129,7 @@ struct ObDataInFileStruct { }; class ObLoadDataHint { - public: +public: ObLoadDataHint() { reset(); @@ -155,13 +155,13 @@ class ObLoadDataHint { TO_STRING_KV("Int Hint Item", common::ObArrayWrap(integer_values_, TOTAL_INT_ITEM), "String Hint Item", common::ObArrayWrap(string_values_, TOTAL_STRING_ITEM)); - private: +private: int64_t integer_values_[TOTAL_INT_ITEM]; ObString string_values_[TOTAL_STRING_ITEM]; }; class ObLoadDataStmt : public ObCMDStmt { - public: +public: struct FieldOrVarStruct { FieldOrVarStruct() : field_or_var_name_(), column_id_(OB_INVALID_ID), column_type_(common::ObMaxType), is_table_column_(true) @@ -232,7 +232,7 @@ class ObLoadDataStmt : public ObCMDStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(load_args), K_(data_struct_in_file), K_(field_or_var_list), K_(assignments), K_(hints), K_(is_default_table_columns)); - private: +private: ObLoadArgument load_args_; ObDataInFileStruct data_struct_in_file_; common::ObSEArray field_or_var_list_; diff --git a/src/sql/resolver/cmd/ob_resource_resolver.h b/src/sql/resolver/cmd/ob_resource_resolver.h index e35ff7ecd..f3fdd7952 100644 --- a/src/sql/resolver/cmd/ob_resource_resolver.h +++ b/src/sql/resolver/cmd/ob_resource_resolver.h @@ -26,17 +26,17 @@ namespace sql { template class ObResourcePoolOptionResolver { - public: +public: ObResourcePoolOptionResolver(){}; ~ObResourcePoolOptionResolver(){}; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObResourcePoolOptionResolver); - public: +public: int resolve_options(T* stmt, ParseNode* node) const; - private: +private: int resolve_option(T* stmt, ParseNode* node) const; int resolve_zone_list(T* stmt, ParseNode* node) const; int resolve_unit_num_option(T* stmt, ParseNode* node) const; @@ -208,17 +208,17 @@ int ObResourcePoolOptionResolver::resolve_zone_list(T* stmt, ParseNode* node) // use template to reuse for alter unit. template class ObResourceUnitOptionResolver { - public: +public: ObResourceUnitOptionResolver(){}; ~ObResourceUnitOptionResolver(){}; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObResourceUnitOptionResolver); - public: +public: int resolve_options(T* stmt, ParseNode* node) const; - private: +private: int resolve_option(T* stmt, ParseNode* node) const; }; @@ -371,96 +371,96 @@ int ObResourceUnitOptionResolver::resolve_option(T* stmt, ParseNode* option_n * Resource Pool Resolver **************************************************/ class ObCreateResourcePoolResolver : public ObCMDResolver { - public: +public: explicit ObCreateResourcePoolResolver(ObResolverParams& params); virtual ~ObCreateResourcePoolResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateResourcePoolResolver); // function members - private: +private: // data members }; class ObSplitResourcePoolResolver : public ObCMDResolver { - public: +public: explicit ObSplitResourcePoolResolver(ObResolverParams& params); virtual ~ObSplitResourcePoolResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: int resolve_split_pool_list(ObSplitResourcePoolStmt* stmt, const ParseNode& parse_node); int resolve_corresponding_zone_list(ObSplitResourcePoolStmt* stmt, const ParseNode& parse_node); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSplitResourcePoolResolver); // function members - private: +private: // data members }; class ObMergeResourcePoolResolver : public ObCMDResolver { - public: +public: explicit ObMergeResourcePoolResolver(ObResolverParams& params); virtual ~ObMergeResourcePoolResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: int resolve_old_merge_pool_list(ObMergeResourcePoolStmt* stmt, const ParseNode& parse_node); int resolve_new_merge_pool_list(ObMergeResourcePoolStmt* stmt, const ParseNode& parse_node); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObMergeResourcePoolResolver); // function members - private: +private: // data members }; class ObAlterResourcePoolResolver : public ObCMDResolver { - public: +public: explicit ObAlterResourcePoolResolver(ObResolverParams& params); virtual ~ObAlterResourcePoolResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAlterResourcePoolResolver); // function members - private: +private: // data members }; class ObDropResourcePoolResolver : public ObCMDResolver { - public: +public: explicit ObDropResourcePoolResolver(ObResolverParams& params); virtual ~ObDropResourcePoolResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropResourcePoolResolver); // function members - private: +private: // data members }; @@ -468,53 +468,53 @@ class ObDropResourcePoolResolver : public ObCMDResolver { * Resource Unit Resolver **************************************************/ class ObCreateResourceUnitResolver : public ObCMDResolver { - public: +public: explicit ObCreateResourceUnitResolver(ObResolverParams& params); virtual ~ObCreateResourceUnitResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateResourceUnitResolver); // function members - private: +private: // data members }; class ObAlterResourceUnitResolver : public ObCMDResolver { - public: +public: explicit ObAlterResourceUnitResolver(ObResolverParams& params); virtual ~ObAlterResourceUnitResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAlterResourceUnitResolver); // function members }; class ObDropResourceUnitResolver : public ObCMDResolver { - public: +public: explicit ObDropResourceUnitResolver(ObResolverParams& params); virtual ~ObDropResourceUnitResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropResourceUnitResolver); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/cmd/ob_resource_stmt.h b/src/sql/resolver/cmd/ob_resource_stmt.h index d78512cd1..9767bbe12 100644 --- a/src/sql/resolver/cmd/ob_resource_stmt.h +++ b/src/sql/resolver/cmd/ob_resource_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObCreateResourcePoolStmt : public ObDDLStmt { - public: +public: ObCreateResourcePoolStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_CREATE_RESOURCE_POOL), arg_(){}; ObCreateResourcePoolStmt() : ObDDLStmt(stmt::T_CREATE_RESOURCE_POOL), arg_(){}; @@ -67,7 +67,7 @@ class ObCreateResourcePoolStmt : public ObDDLStmt { return arg_; } - private: +private: obrpc::ObCreateResourcePoolArg arg_; /* functions */ /* variables */ @@ -75,7 +75,7 @@ class ObCreateResourcePoolStmt : public ObDDLStmt { }; class ObSplitResourcePoolStmt : public ObDDLStmt { - public: +public: ObSplitResourcePoolStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_SPLIT_RESOURCE_POOL), arg_() {} ObSplitResourcePoolStmt() : ObDDLStmt(stmt::T_SPLIT_RESOURCE_POOL), arg_() @@ -107,13 +107,13 @@ class ObSplitResourcePoolStmt : public ObDDLStmt { return arg_; } - private: +private: obrpc::ObSplitResourcePoolArg arg_; DISALLOW_COPY_AND_ASSIGN(ObSplitResourcePoolStmt); }; class ObMergeResourcePoolStmt : public ObDDLStmt { - public: +public: ObMergeResourcePoolStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_MERGE_RESOURCE_POOL), arg_() {} ObMergeResourcePoolStmt() : ObDDLStmt(stmt::T_MERGE_RESOURCE_POOL), arg_() @@ -141,13 +141,13 @@ class ObMergeResourcePoolStmt : public ObDDLStmt { return arg_; } - private: +private: obrpc::ObMergeResourcePoolArg arg_; DISALLOW_COPY_AND_ASSIGN(ObMergeResourcePoolStmt); }; class ObAlterResourcePoolStmt : public ObDDLStmt { - public: +public: ObAlterResourcePoolStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_ALTER_RESOURCE_POOL), arg_(){}; ObAlterResourcePoolStmt() : ObDDLStmt(stmt::T_ALTER_RESOURCE_POOL), arg_(){}; @@ -189,7 +189,7 @@ class ObAlterResourcePoolStmt : public ObDDLStmt { return arg_; } - private: +private: /* functions */ /* variables */ obrpc::ObAlterResourcePoolArg arg_; @@ -197,7 +197,7 @@ class ObAlterResourcePoolStmt : public ObDDLStmt { }; class ObDropResourcePoolStmt : public ObDDLStmt { - public: +public: ObDropResourcePoolStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_DROP_RESOURCE_POOL), arg_(){}; ObDropResourcePoolStmt() : ObDDLStmt(stmt::T_DROP_RESOURCE_POOL), arg_(){}; virtual ~ObDropResourcePoolStmt(){}; @@ -222,7 +222,7 @@ class ObDropResourcePoolStmt : public ObDDLStmt { return arg_; } - private: +private: /* functions */ /* variables */ obrpc::ObDropResourcePoolArg arg_; @@ -230,7 +230,7 @@ class ObDropResourcePoolStmt : public ObDDLStmt { }; class ObCreateResourceUnitStmt : public ObDDLStmt { - public: +public: ObCreateResourceUnitStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_CREATE_RESOURCE_UNIT), arg_(){}; ObCreateResourceUnitStmt() : ObDDLStmt(stmt::T_CREATE_RESOURCE_UNIT), arg_(){}; @@ -288,7 +288,7 @@ class ObCreateResourceUnitStmt : public ObDDLStmt { return arg_; } - private: +private: /* functions */ /* variables */ obrpc::ObCreateResourceUnitArg arg_; @@ -296,7 +296,7 @@ class ObCreateResourceUnitStmt : public ObDDLStmt { }; class ObAlterResourceUnitStmt : public ObDDLStmt { - public: +public: ObAlterResourceUnitStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_ALTER_RESOURCE_UNIT), arg_(){}; ObAlterResourceUnitStmt() : ObDDLStmt(stmt::T_ALTER_RESOURCE_UNIT), arg_(){}; @@ -350,7 +350,7 @@ class ObAlterResourceUnitStmt : public ObDDLStmt { return arg_; } - private: +private: /* functions */ /* variables */ obrpc::ObAlterResourceUnitArg arg_; @@ -358,7 +358,7 @@ class ObAlterResourceUnitStmt : public ObDDLStmt { }; class ObDropResourceUnitStmt : public ObDDLStmt { - public: +public: ObDropResourceUnitStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_DROP_RESOURCE_UNIT), arg_() {} ObDropResourceUnitStmt() : ObDDLStmt(stmt::T_DROP_RESOURCE_UNIT), arg_() @@ -385,7 +385,7 @@ class ObDropResourceUnitStmt : public ObDDLStmt { return arg_; } - private: +private: /* functions */ /* variables */ obrpc::ObDropResourceUnitArg arg_; diff --git a/src/sql/resolver/cmd/ob_set_names_resolver.h b/src/sql/resolver/cmd/ob_set_names_resolver.h index fb552fd48..1bc5bcb90 100644 --- a/src/sql/resolver/cmd/ob_set_names_resolver.h +++ b/src/sql/resolver/cmd/ob_set_names_resolver.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { // resolver for both SET NAMES and SET CHARSET class ObSetNamesResolver : public ObCMDResolver { - public: +public: explicit ObSetNamesResolver(ObResolverParams& params); virtual ~ObSetNamesResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetNamesResolver); }; diff --git a/src/sql/resolver/cmd/ob_set_names_stmt.h b/src/sql/resolver/cmd/ob_set_names_stmt.h index fbdad2a86..faa51fb71 100644 --- a/src/sql/resolver/cmd/ob_set_names_stmt.h +++ b/src/sql/resolver/cmd/ob_set_names_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { // statement for both SET NAMES and SET CHARSET class ObSetNamesStmt : public ObCMDStmt { - public: +public: ObSetNamesStmt() : ObCMDStmt(stmt::T_SET_NAMES), is_set_names_(true), is_default_charset_(false), is_default_collation_(false) {} @@ -72,11 +72,11 @@ class ObSetNamesStmt : public ObCMDStmt { TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(is_set_names), K_(is_default_charset), K_(is_default_collation), K_(charset), K_(collation)); - private: +private: // types and constants - private: +private: // function members - private: +private: // data members bool is_set_names_; // SET NAMES or SET CHARSET? bool is_default_charset_; diff --git a/src/sql/resolver/cmd/ob_set_transaction_resolver.h b/src/sql/resolver/cmd/ob_set_transaction_resolver.h index 97dd92e79..562bd8744 100644 --- a/src/sql/resolver/cmd/ob_set_transaction_resolver.h +++ b/src/sql/resolver/cmd/ob_set_transaction_resolver.h @@ -17,13 +17,13 @@ namespace oceanbase { namespace sql { class ObSetTransactionResolver : public ObCMDResolver { - public: +public: explicit ObSetTransactionResolver(ObResolverParams& params); virtual ~ObSetTransactionResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: int build_isolation_expr(ObRawExpr*& expr, int32_t level); int build_access_expr(ObRawExpr*& expr, const bool is_read_only); int scope_resolve(const ParseNode& parse_tree, share::ObSetVar::SetScopeType& scope); diff --git a/src/sql/resolver/cmd/ob_show_resolver.h b/src/sql/resolver/cmd/ob_show_resolver.h index b065e46c2..24344857f 100644 --- a/src/sql/resolver/cmd/ob_show_resolver.h +++ b/src/sql/resolver/cmd/ob_show_resolver.h @@ -16,15 +16,15 @@ namespace oceanbase { namespace sql { class ObShowResolver : public ObSelectResolver { - public: +public: class ObShowResolverContext; class ShowColumnInfo; explicit ObShowResolver(ObResolverParams& params); virtual ~ObShowResolver(); virtual int resolve(const ParseNode& parse_tree); - protected: - private: +protected: +private: class ObSqlStrGenerator; struct ObShowSqlSet; int get_database_info(const ParseNode* databse_node, const common::ObString& database_name, uint64_t real_tenant_id, @@ -42,7 +42,7 @@ class ObShowResolver : public ObSelectResolver { int process_select_type(ObSelectStmt* select_stmt, stmt::StmtType stmt_type, const ParseNode& parse_tree); virtual int resolve_column_ref_expr(const ObQualifiedName& q_name, ObRawExpr*& real_ref_expr); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObShowResolver); }; // ObShowresolver @@ -107,7 +107,7 @@ struct ObShowResolver::ObShowSqlSet { }; // ObShowSqlSet class ObShowResolver::ObSqlStrGenerator { - public: +public: ObSqlStrGenerator() : sql_buf_(NULL), sql_buf_pos_(0) {} virtual ~ObSqlStrGenerator() @@ -118,14 +118,14 @@ class ObShowResolver::ObSqlStrGenerator { virtual int gen_limit_str(int64_t offset, int64_t row_cnt); void assign_sql_str(common::ObString& sql_str); - private: +private: char* sql_buf_; int64_t sql_buf_pos_; DISALLOW_COPY_AND_ASSIGN(ObSqlStrGenerator); }; // ObSqlstrgenerator class ObShowResolver::ObShowResolverContext { - public: +public: ObShowResolverContext() : cur_tenant_id_(common::OB_INVALID_ID), actual_tenant_id_(common::OB_INVALID_ID), @@ -168,12 +168,12 @@ class ObShowResolver::ObShowResolverContext { K_(show_database_id), K_(show_table_id), K_(stmt_type), K_(global_scope), K_(like_pattern), K_(like_escape), K_(column_name)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObShowResolverContext); }; // ObShowResolvercontext class ObShowResolver::ShowColumnInfo { - public: +public: ShowColumnInfo() : display_name_(), qualified_name_() {} ~ShowColumnInfo() @@ -182,7 +182,7 @@ class ObShowResolver::ShowColumnInfo { ObQualifiedName qualified_name_; TO_STRING_KV(K_(display_name), K_(qualified_name)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ShowColumnInfo); }; // ShowColumninfo diff --git a/src/sql/resolver/cmd/ob_system_cmd_resolver.h b/src/sql/resolver/cmd/ob_system_cmd_resolver.h index 2229bc633..4fc350bf6 100644 --- a/src/sql/resolver/cmd/ob_system_cmd_resolver.h +++ b/src/sql/resolver/cmd/ob_system_cmd_resolver.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { class ObSystemCmdResolver : public ObStmtResolver { - public: +public: explicit ObSystemCmdResolver(ObResolverParams& params) : ObStmtResolver(params) {} virtual ~ObSystemCmdResolver() {} - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObSystemCmdResolver); diff --git a/src/sql/resolver/cmd/ob_system_cmd_stmt.h b/src/sql/resolver/cmd/ob_system_cmd_stmt.h index 293998fb9..de8971965 100644 --- a/src/sql/resolver/cmd/ob_system_cmd_stmt.h +++ b/src/sql/resolver/cmd/ob_system_cmd_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObSystemCmdStmt : public ObStmt, public ObICmd { - public: +public: ObSystemCmdStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObStmt(name_pool, type) {} explicit ObSystemCmdStmt(stmt::StmtType type) : ObStmt(type) @@ -30,7 +30,7 @@ class ObSystemCmdStmt : public ObStmt, public ObICmd { return get_stmt_type(); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSystemCmdStmt); }; } // namespace sql diff --git a/src/sql/resolver/cmd/ob_variable_set_resolver.h b/src/sql/resolver/cmd/ob_variable_set_resolver.h index 89e3aa73d..d29e7ad0b 100644 --- a/src/sql/resolver/cmd/ob_variable_set_resolver.h +++ b/src/sql/resolver/cmd/ob_variable_set_resolver.h @@ -18,24 +18,24 @@ namespace oceanbase { namespace sql { class ObVariableSetResolver : public ObStmtResolver { - public: +public: explicit ObVariableSetResolver(ObResolverParams& params); virtual ~ObVariableSetResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObVariableSetResolver); }; class ObAlterSessionSetResolver : public ObStmtResolver { - public: +public: explicit ObAlterSessionSetResolver(ObResolverParams& params); virtual ~ObAlterSessionSetResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterSessionSetResolver); }; diff --git a/src/sql/resolver/cmd/ob_variable_set_stmt.h b/src/sql/resolver/cmd/ob_variable_set_stmt.h index be1406bc1..ff97f8622 100644 --- a/src/sql/resolver/cmd/ob_variable_set_stmt.h +++ b/src/sql/resolver/cmd/ob_variable_set_stmt.h @@ -21,9 +21,9 @@ namespace oceanbase { namespace sql { class ObVariableSetStmt : public ObDDLStmt { - public: +public: class VariableSetNode { - public: + public: VariableSetNode() : variable_name_(), is_system_variable_(false), @@ -96,7 +96,7 @@ class ObVariableSetStmt : public ObDDLStmt { } TO_STRING_KV(K_(actual_tenant_id), K_(variable_nodes)); - private: +private: uint64_t actual_tenant_id_; common::ObArray variable_nodes_; bool has_global_variable_; diff --git a/src/sql/resolver/dcl/ob_alter_user_primary_zone_resolver.h b/src/sql/resolver/dcl/ob_alter_user_primary_zone_resolver.h index d741d44fb..8c6c43c00 100644 --- a/src/sql/resolver/dcl/ob_alter_user_primary_zone_resolver.h +++ b/src/sql/resolver/dcl/ob_alter_user_primary_zone_resolver.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObAlterUserPrimaryZoneResolver : public ObDCLResolver { - public: +public: explicit ObAlterUserPrimaryZoneResolver(ObResolverParams& params); virtual ~ObAlterUserPrimaryZoneResolver(); virtual int resolve(const ParseNode& parse_tree); diff --git a/src/sql/resolver/dcl/ob_alter_user_primary_zone_stmt.h b/src/sql/resolver/dcl/ob_alter_user_primary_zone_stmt.h index b99dc0764..477506673 100644 --- a/src/sql/resolver/dcl/ob_alter_user_primary_zone_stmt.h +++ b/src/sql/resolver/dcl/ob_alter_user_primary_zone_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObAlterUserPrimaryZoneStmt : public ObDDLStmt { - public: +public: ObAlterUserPrimaryZoneStmt(); explicit ObAlterUserPrimaryZoneStmt(common::ObIAllocator* name_pool); virtual ~ObAlterUserPrimaryZoneStmt(); @@ -44,11 +44,11 @@ class ObAlterUserPrimaryZoneStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(arg)); - public: +public: // data members obrpc::ObAlterDatabaseArg arg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterUserPrimaryZoneStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_alter_user_profile_resolver.h b/src/sql/resolver/dcl/ob_alter_user_profile_resolver.h index 87662de98..e190a0813 100644 --- a/src/sql/resolver/dcl/ob_alter_user_profile_resolver.h +++ b/src/sql/resolver/dcl/ob_alter_user_profile_resolver.h @@ -20,12 +20,12 @@ namespace oceanbase { namespace sql { class ObAlterUserProfileResolver : public ObDCLResolver { - public: +public: explicit ObAlterUserProfileResolver(ObResolverParams& params); virtual ~ObAlterUserProfileResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: int resolve_set_role(const ParseNode& parse_tree); int resolve_default_role(const ParseNode& parse_tree); int resolve_default_role_clause(const ParseNode* parse_tree, obrpc::ObAlterUserProfileArg& arg, diff --git a/src/sql/resolver/dcl/ob_alter_user_profile_stmt.h b/src/sql/resolver/dcl/ob_alter_user_profile_stmt.h index f24fab29e..37229e3e4 100644 --- a/src/sql/resolver/dcl/ob_alter_user_profile_stmt.h +++ b/src/sql/resolver/dcl/ob_alter_user_profile_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObAlterUserProfileStmt : public ObDDLStmt { - public: +public: ObAlterUserProfileStmt(); explicit ObAlterUserProfileStmt(common::ObIAllocator* name_pool); virtual ~ObAlterUserProfileStmt(); @@ -37,12 +37,12 @@ class ObAlterUserProfileStmt : public ObDDLStmt { return set_role_flag_; } - private: +private: // data members obrpc::ObAlterUserProfileArg arg_; int set_role_flag_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterUserProfileStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_create_role_resolver.h b/src/sql/resolver/dcl/ob_create_role_resolver.h index 80972efa8..6b0087ef7 100644 --- a/src/sql/resolver/dcl/ob_create_role_resolver.h +++ b/src/sql/resolver/dcl/ob_create_role_resolver.h @@ -17,13 +17,13 @@ namespace oceanbase { namespace sql { class ObCreateRoleResolver : public ObDCLResolver { - public: +public: explicit ObCreateRoleResolver(ObResolverParams& params); virtual ~ObCreateRoleResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateRoleResolver); }; diff --git a/src/sql/resolver/dcl/ob_create_role_stmt.h b/src/sql/resolver/dcl/ob_create_role_stmt.h index 7c7ab28cb..6f3875183 100644 --- a/src/sql/resolver/dcl/ob_create_role_stmt.h +++ b/src/sql/resolver/dcl/ob_create_role_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObCreateRoleStmt : public ObDDLStmt { - public: +public: explicit ObCreateRoleStmt(common::ObIAllocator* name_pool); ObCreateRoleStmt(); virtual ~ObCreateRoleStmt(); @@ -59,14 +59,14 @@ class ObCreateRoleStmt : public ObDDLStmt { } DECLARE_VIRTUAL_TO_STRING; - private: +private: // data members uint64_t tenant_id_; common::ObString role_name_; common::ObString password_; obrpc::ObCreateRoleArg create_role_arg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateRoleStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_create_user_resolver.h b/src/sql/resolver/dcl/ob_create_user_resolver.h index 1eb623676..c54cb44c0 100644 --- a/src/sql/resolver/dcl/ob_create_user_resolver.h +++ b/src/sql/resolver/dcl/ob_create_user_resolver.h @@ -17,13 +17,13 @@ namespace oceanbase { namespace sql { class ObCreateUserResolver : public ObDCLResolver { - public: +public: explicit ObCreateUserResolver(ObResolverParams& params); virtual ~ObCreateUserResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateUserResolver); }; diff --git a/src/sql/resolver/dcl/ob_create_user_stmt.h b/src/sql/resolver/dcl/ob_create_user_stmt.h index 8ce7c8966..0981403af 100644 --- a/src/sql/resolver/dcl/ob_create_user_stmt.h +++ b/src/sql/resolver/dcl/ob_create_user_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObCreateUserStmt : public ObDDLStmt { - public: +public: explicit ObCreateUserStmt(common::ObIAllocator* name_pool); ObCreateUserStmt(); virtual ~ObCreateUserStmt(); @@ -76,7 +76,7 @@ class ObCreateUserStmt : public ObDDLStmt { } DECLARE_VIRTUAL_TO_STRING; - private: +private: // data members uint64_t tenant_id_; common::ObStrings users_; // (user1, host1, pass1, need_enc1; @@ -87,7 +87,7 @@ class ObCreateUserStmt : public ObDDLStmt { uint64_t profile_id_; // only used in oracle mode obrpc::ObCreateUserArg create_user_arg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateUserStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_dcl_resolver.h b/src/sql/resolver/dcl/ob_dcl_resolver.h index 2a044dfd0..40612f908 100644 --- a/src/sql/resolver/dcl/ob_dcl_resolver.h +++ b/src/sql/resolver/dcl/ob_dcl_resolver.h @@ -17,13 +17,13 @@ namespace oceanbase { namespace sql { class ObDCLResolver : public ObStmtResolver { - public: +public: explicit ObDCLResolver(ObResolverParams& params) : ObStmtResolver(params) {} virtual ~ObDCLResolver() {} - protected: +protected: int check_and_convert_name(common::ObString& db, common::ObString& table); int check_password_strength(common::ObString& password, common::ObString& user_name); int check_number_count(common::ObString& password, const int64_t& number_count); @@ -36,7 +36,7 @@ class ObDCLResolver : public ObStmtResolver { enum ObPasswordPolicy { LOW = 0, MEDIUM }; static const char password_mask_ = '*'; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDCLResolver); }; } // namespace sql diff --git a/src/sql/resolver/dcl/ob_dcl_stmt.h b/src/sql/resolver/dcl/ob_dcl_stmt.h index c1ac7cb93..2c8c82021 100644 --- a/src/sql/resolver/dcl/ob_dcl_stmt.h +++ b/src/sql/resolver/dcl/ob_dcl_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObDCLStmt : public ObStmt, public ObICmd { - public: +public: ObDCLStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObStmt(name_pool, type) {} explicit ObDCLStmt(stmt::StmtType type) : ObStmt(type) @@ -34,7 +34,7 @@ class ObDCLStmt : public ObStmt, public ObICmd { return true; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDCLStmt); }; } // namespace sql diff --git a/src/sql/resolver/dcl/ob_drop_role_resolver.h b/src/sql/resolver/dcl/ob_drop_role_resolver.h index ac926a1b1..eafa6d4ce 100644 --- a/src/sql/resolver/dcl/ob_drop_role_resolver.h +++ b/src/sql/resolver/dcl/ob_drop_role_resolver.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { class ObDropRoleResolver : public ObDCLResolver { - public: +public: explicit ObDropRoleResolver(ObResolverParams& params); virtual ~ObDropRoleResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropRoleResolver); }; diff --git a/src/sql/resolver/dcl/ob_drop_role_stmt.h b/src/sql/resolver/dcl/ob_drop_role_stmt.h index 0bf9d8968..adea8a1ae 100644 --- a/src/sql/resolver/dcl/ob_drop_role_stmt.h +++ b/src/sql/resolver/dcl/ob_drop_role_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObDropRoleStmt : public ObDDLStmt { - public: +public: explicit ObDropRoleStmt(common::ObIAllocator* name_pool); ObDropRoleStmt(); virtual ~ObDropRoleStmt(); @@ -51,13 +51,13 @@ class ObDropRoleStmt : public ObDDLStmt { } DECLARE_VIRTUAL_TO_STRING; - private: +private: // data members uint64_t tenant_id_; common::ObString role_name_; obrpc::ObDropUserArg drop_role_arg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropRoleStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_drop_user_resolver.h b/src/sql/resolver/dcl/ob_drop_user_resolver.h index 98f8cf565..b4ebbf53d 100644 --- a/src/sql/resolver/dcl/ob_drop_user_resolver.h +++ b/src/sql/resolver/dcl/ob_drop_user_resolver.h @@ -17,13 +17,13 @@ namespace oceanbase { namespace sql { class ObDropUserResolver : public ObDCLResolver { - public: +public: explicit ObDropUserResolver(ObResolverParams& params); virtual ~ObDropUserResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropUserResolver); }; diff --git a/src/sql/resolver/dcl/ob_drop_user_stmt.h b/src/sql/resolver/dcl/ob_drop_user_stmt.h index 841c53e87..0a0550215 100644 --- a/src/sql/resolver/dcl/ob_drop_user_stmt.h +++ b/src/sql/resolver/dcl/ob_drop_user_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObDropUserStmt : public ObDDLStmt { - public: +public: explicit ObDropUserStmt(common::ObIAllocator* name_pool); ObDropUserStmt(); virtual ~ObDropUserStmt(); @@ -46,12 +46,12 @@ class ObDropUserStmt : public ObDDLStmt { } DECLARE_VIRTUAL_TO_STRING; - private: +private: // data members common::ObStrings users_; // user1,host1; usr2,host2;... uint64_t tenant_id_; obrpc::ObDropUserArg drop_user_arg_; // for returning exec_tenant_id_ - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropUserStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_grant_resolver.h b/src/sql/resolver/dcl/ob_grant_resolver.h index f633f1027..da1b4818f 100644 --- a/src/sql/resolver/dcl/ob_grant_resolver.h +++ b/src/sql/resolver/dcl/ob_grant_resolver.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObGrantResolver : public ObDCLResolver { - public: +public: explicit ObGrantResolver(ObResolverParams& params); virtual ~ObGrantResolver(); @@ -60,7 +60,7 @@ class ObGrantResolver : public ObDCLResolver { ObIArray& user_name_array, const ObGrantStmt* grant_stmt, const ObString& user_name, const ObString& host_name); - private: +private: int build_table_priv_arary_for_all( ObGrantStmt* grant_stmt, share::ObRawObjPrivArray& table_priv_array, bool is_owner); int check_obj_priv_valid(ObGrantStmt* grant_stmt, share::ObRawObjPriv ora_obj_priv); @@ -74,7 +74,7 @@ class ObGrantResolver : public ObDCLResolver { int check_duplicated_privs_with_info_ora(const ParseNode* privs_node, bool& duplicated_privs, bool& priv_has_execute); static int trans_ora_sys_priv_to_obj(ParseNode* priv_type_node); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObGrantResolver); }; diff --git a/src/sql/resolver/dcl/ob_grant_stmt.h b/src/sql/resolver/dcl/ob_grant_stmt.h index f19ca42c6..1f821b485 100644 --- a/src/sql/resolver/dcl/ob_grant_stmt.h +++ b/src/sql/resolver/dcl/ob_grant_stmt.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace sql { class ObGrantStmt : public ObDDLStmt { - public: +public: explicit ObGrantStmt(common::ObIAllocator* name_pool); ObGrantStmt(); virtual ~ObGrantStmt(); @@ -176,7 +176,7 @@ class ObGrantStmt : public ObDDLStmt { } DECLARE_VIRTUAL_TO_STRING; - private: +private: // data members ObPrivSet priv_set_; share::schema::ObPrivLevel grant_level_; @@ -201,7 +201,7 @@ class ObGrantStmt : public ObDDLStmt { ObSEArray ref_col_ids_; ObSelectStmt* ref_query_; // when grant, check table,view privs. - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGrantStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_lock_user_resolver.h b/src/sql/resolver/dcl/ob_lock_user_resolver.h index 01adba573..4d461e977 100644 --- a/src/sql/resolver/dcl/ob_lock_user_resolver.h +++ b/src/sql/resolver/dcl/ob_lock_user_resolver.h @@ -17,12 +17,12 @@ namespace oceanbase { namespace sql { class ObLockUserResolver : public ObDCLResolver { - public: +public: explicit ObLockUserResolver(ObResolverParams& params); virtual ~ObLockUserResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObLockUserResolver); }; diff --git a/src/sql/resolver/dcl/ob_lock_user_stmt.h b/src/sql/resolver/dcl/ob_lock_user_stmt.h index d50d7ecda..75cfca54e 100644 --- a/src/sql/resolver/dcl/ob_lock_user_stmt.h +++ b/src/sql/resolver/dcl/ob_lock_user_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObLockUserStmt : public ObDDLStmt { - public: +public: ObLockUserStmt(); explicit ObLockUserStmt(common::ObIAllocator* name_pool); virtual ~ObLockUserStmt(); @@ -53,13 +53,13 @@ class ObLockUserStmt : public ObDDLStmt { return true; } - private: +private: // data members uint64_t tenant_id_; common::ObStrings user_; // user1,host1; usr2,host2;... bool locked_; obrpc::ObLockUserArg lock_user_arg_; // for returning exec_tenant_id_ - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLockUserStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_rename_user_resolver.h b/src/sql/resolver/dcl/ob_rename_user_resolver.h index 6f28fa029..fcd325488 100644 --- a/src/sql/resolver/dcl/ob_rename_user_resolver.h +++ b/src/sql/resolver/dcl/ob_rename_user_resolver.h @@ -17,13 +17,13 @@ namespace oceanbase { namespace sql { class ObRenameUserResolver : public ObDCLResolver { - public: +public: explicit ObRenameUserResolver(ObResolverParams& params); virtual ~ObRenameUserResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRenameUserResolver); }; diff --git a/src/sql/resolver/dcl/ob_rename_user_stmt.h b/src/sql/resolver/dcl/ob_rename_user_stmt.h index 65f353301..961420bde 100644 --- a/src/sql/resolver/dcl/ob_rename_user_stmt.h +++ b/src/sql/resolver/dcl/ob_rename_user_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObRenameUserStmt : public ObDDLStmt { - public: +public: explicit ObRenameUserStmt(common::ObIAllocator* name_pool); ObRenameUserStmt(); virtual ~ObRenameUserStmt(); @@ -42,14 +42,14 @@ class ObRenameUserStmt : public ObDDLStmt { } DECLARE_VIRTUAL_TO_STRING; - private: +private: // data members common::ObStrings rename_infos_; // (from1_user, from1_host, to1_user, to1_host), (from2_user, from2_host, to2_user, // to2_host) uint64_t tenant_id_; obrpc::ObRenameUserArg rename_user_arg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRenameUserStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_revoke_resolver.h b/src/sql/resolver/dcl/ob_revoke_resolver.h index 316c634cb..49b8ac896 100644 --- a/src/sql/resolver/dcl/ob_revoke_resolver.h +++ b/src/sql/resolver/dcl/ob_revoke_resolver.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObRevokeResolver : public ObDCLResolver { - private: +private: int resolve_revoke_role_inner(const ParseNode* revoke_role, ObRevokeStmt* revoke_stmt); int resolve_revoke_sysprivs_inner(const ParseNode* revoke_role, ObRevokeStmt* revoke_stmt); int resolve_mysql(const ParseNode& parse_tree); @@ -27,13 +27,13 @@ class ObRevokeResolver : public ObDCLResolver { share::ObRawObjPrivArray& obj_priv_array, bool& revoke_all_ora); static int trans_ora_sys_priv_to_obj(ParseNode* priv_type_node); - public: +public: explicit ObRevokeResolver(ObResolverParams& params); virtual ~ObRevokeResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRevokeResolver); }; diff --git a/src/sql/resolver/dcl/ob_revoke_stmt.h b/src/sql/resolver/dcl/ob_revoke_stmt.h index 4040c2256..466b6400f 100644 --- a/src/sql/resolver/dcl/ob_revoke_stmt.h +++ b/src/sql/resolver/dcl/ob_revoke_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObRevokeStmt : public ObDDLStmt { - public: +public: explicit ObRevokeStmt(common::ObIAllocator* name_pool); ObRevokeStmt(); virtual ~ObRevokeStmt(); @@ -123,7 +123,7 @@ class ObRevokeStmt : public ObDDLStmt { } DECLARE_VIRTUAL_TO_STRING; - private: +private: // data members ObPrivSet priv_set_; share::schema::ObPrivLevel grant_level_; @@ -146,7 +146,7 @@ class ObRevokeStmt : public ObDDLStmt { uint64_t grantor_id_; bool revoke_all_ora_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRevokeStmt); }; } // end namespace sql diff --git a/src/sql/resolver/dcl/ob_set_password_resolver.h b/src/sql/resolver/dcl/ob_set_password_resolver.h index 86ff94dc3..8058e773f 100644 --- a/src/sql/resolver/dcl/ob_set_password_resolver.h +++ b/src/sql/resolver/dcl/ob_set_password_resolver.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObSetPasswordResolver : public ObDCLResolver { - public: +public: explicit ObSetPasswordResolver(ObResolverParams& params); virtual ~ObSetPasswordResolver(); @@ -27,11 +27,11 @@ class ObSetPasswordResolver : public ObDCLResolver { static bool is_valid_mysql41_passwd(const common::ObString& str); - private: +private: int resolve_oracle_password_strength( common::ObString& user_name, common::ObString& hostname, common::ObString& password); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSetPasswordResolver); }; diff --git a/src/sql/resolver/dcl/ob_set_password_stmt.h b/src/sql/resolver/dcl/ob_set_password_stmt.h index df5fc3e7f..ef36b72cb 100644 --- a/src/sql/resolver/dcl/ob_set_password_stmt.h +++ b/src/sql/resolver/dcl/ob_set_password_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObSetPasswordStmt : public ObDDLStmt { - public: +public: explicit ObSetPasswordStmt(common::ObIAllocator* name_pool); ObSetPasswordStmt(); virtual ~ObSetPasswordStmt(); @@ -63,7 +63,7 @@ class ObSetPasswordStmt : public ObDDLStmt { } DECLARE_VIRTUAL_TO_STRING; - private: +private: // data members common::ObStrings user_pwd_; // username1, hostname1, passwd1; // username2, hostname2, passwd2... @@ -73,7 +73,7 @@ class ObSetPasswordStmt : public ObDDLStmt { bool for_current_user_; obrpc::ObSetPasswdArg set_password_arg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetPasswordStmt); }; } // end namespace sql diff --git a/src/sql/resolver/ddl/ob_alter_baseline_resolver.h b/src/sql/resolver/ddl/ob_alter_baseline_resolver.h index 651bcf0f5..94b3f1bd1 100644 --- a/src/sql/resolver/ddl/ob_alter_baseline_resolver.h +++ b/src/sql/resolver/ddl/ob_alter_baseline_resolver.h @@ -19,14 +19,14 @@ namespace oceanbase { namespace sql { class ObAlterBaselineResolver : public ObDDLResolver { - public: +public: ObAlterBaselineResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObAlterBaselineResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterBaselineResolver); }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_alter_baseline_stmt.h b/src/sql/resolver/ddl/ob_alter_baseline_stmt.h index b964a7878..d85eb6fd3 100644 --- a/src/sql/resolver/ddl/ob_alter_baseline_stmt.h +++ b/src/sql/resolver/ddl/ob_alter_baseline_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObAlterBaselineStmt : public ObDDLStmt { - public: +public: ObAlterBaselineStmt() : ObDDLStmt(stmt::T_ALTER_BASELINE), alter_baseline_arg_() {} @@ -28,10 +28,10 @@ class ObAlterBaselineStmt : public ObDDLStmt { } TO_STRING_KV(K_(alter_baseline_arg)); - public: +public: obrpc::ObAlterPlanBaselineArg alter_baseline_arg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAlterBaselineStmt); }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_alter_database_resolver.h b/src/sql/resolver/ddl/ob_alter_database_resolver.h index 1110ac2a8..85a604812 100644 --- a/src/sql/resolver/ddl/ob_alter_database_resolver.h +++ b/src/sql/resolver/ddl/ob_alter_database_resolver.h @@ -21,12 +21,12 @@ class ObAlterDatabaseResolver : public ObDDLResolver { static const int64_t DATABASE_OPTION = 1; static const int64_t DATABASE_NODE_COUNT = 2; - public: +public: explicit ObAlterDatabaseResolver(ObResolverParams& params); virtual ~ObAlterDatabaseResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAlterDatabaseResolver); }; diff --git a/src/sql/resolver/ddl/ob_alter_database_stmt.h b/src/sql/resolver/ddl/ob_alter_database_stmt.h index 012115b24..d646173cd 100644 --- a/src/sql/resolver/ddl/ob_alter_database_stmt.h +++ b/src/sql/resolver/ddl/ob_alter_database_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObAlterDatabaseStmt : public ObDDLStmt { - public: +public: ObAlterDatabaseStmt(); explicit ObAlterDatabaseStmt(common::ObIAllocator* name_pool); virtual ~ObAlterDatabaseStmt(); @@ -59,7 +59,7 @@ class ObAlterDatabaseStmt : public ObDDLStmt { TO_STRING_KV(K_(alter_database_arg)); - private: +private: obrpc::ObAlterDatabaseArg alter_database_arg_; }; diff --git a/src/sql/resolver/ddl/ob_alter_outline_resolver.h b/src/sql/resolver/ddl/ob_alter_outline_resolver.h index ec95d805a..31df3eb5e 100644 --- a/src/sql/resolver/ddl/ob_alter_outline_resolver.h +++ b/src/sql/resolver/ddl/ob_alter_outline_resolver.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObAlterOutlineResolver : public ObOutlineResolver { - public: +public: explicit ObAlterOutlineResolver(ObResolverParams& params) : ObOutlineResolver(params) {} virtual ~ObAlterOutlineResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: static const int64_t OUTLINE_CHILD_COUNT = 3; DISALLOW_COPY_AND_ASSIGN(ObAlterOutlineResolver); }; diff --git a/src/sql/resolver/ddl/ob_alter_outline_stmt.h b/src/sql/resolver/ddl/ob_alter_outline_stmt.h index 28f0b366c..ea1cf68ea 100644 --- a/src/sql/resolver/ddl/ob_alter_outline_stmt.h +++ b/src/sql/resolver/ddl/ob_alter_outline_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObAlterOutlineStmt : public ObDDLStmt { - public: +public: ObAlterOutlineStmt() : ObDDLStmt(stmt::T_ALTER_OUTLINE), alter_outline_arg_(), outline_stmt_(NULL) {} virtual ~ObAlterOutlineStmt() @@ -70,7 +70,7 @@ class ObAlterOutlineStmt : public ObDDLStmt { } TO_STRING_KV(K_(alter_outline_arg), K_(outline_stmt)); - private: +private: obrpc::ObAlterOutlineArg alter_outline_arg_; ObStmt* outline_stmt_; // the stmt for outline DISALLOW_COPY_AND_ASSIGN(ObAlterOutlineStmt); diff --git a/src/sql/resolver/ddl/ob_alter_sequence_resolver.h b/src/sql/resolver/ddl/ob_alter_sequence_resolver.h index b168017a0..a72210ccf 100644 --- a/src/sql/resolver/ddl/ob_alter_sequence_resolver.h +++ b/src/sql/resolver/ddl/ob_alter_sequence_resolver.h @@ -17,20 +17,20 @@ namespace oceanbase { namespace sql { class ObAlterSequenceResolver : public ObStmtResolver { - public: +public: explicit ObAlterSequenceResolver(ObResolverParams& params); virtual ~ObAlterSequenceResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObAlterSequenceResolver); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_alter_table_resolver.h b/src/sql/resolver/ddl/ob_alter_table_resolver.h index f1dcac81c..72e9195a1 100644 --- a/src/sql/resolver/ddl/ob_alter_table_resolver.h +++ b/src/sql/resolver/ddl/ob_alter_table_resolver.h @@ -26,7 +26,7 @@ class ObAlterTableResolver : public ObDDLResolver { static const int64_t ALTER_TABLE_NODE_COUNT = 2; static const int64_t TABLE = 0; // 0. table_node static const int64_t ACTION_LIST = 1; // 1. alter table action list - public: +public: explicit ObAlterTableResolver(ObResolverParams& params); virtual ~ObAlterTableResolver(); virtual int resolve(const ParseNode& parse_tree); @@ -57,7 +57,7 @@ class ObAlterTableResolver : public ObDDLResolver { }; int resolve_column_index(const common::ObString& column_name); - private: +private: int check_dup_foreign_keys_exist( share::schema::ObSchemaGetterGuard* schema_guard, const obrpc::ObCreateForeignKeyArg& foreign_key_arg); int resolve_alter_table_option_list(const ParseNode& node); diff --git a/src/sql/resolver/ddl/ob_alter_table_stmt.h b/src/sql/resolver/ddl/ob_alter_table_stmt.h index 3d7a1a286..a4d53f0d7 100644 --- a/src/sql/resolver/ddl/ob_alter_table_stmt.h +++ b/src/sql/resolver/ddl/ob_alter_table_stmt.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace sql { class ObAlterTableStmt : public ObTableStmt { - public: +public: explicit ObAlterTableStmt(common::ObIAllocator* name_pool); ObAlterTableStmt(); virtual ~ObAlterTableStmt(); @@ -129,7 +129,7 @@ class ObAlterTableStmt : public ObTableStmt { } INHERIT_TO_STRING_KV("ObTableStmt", ObTableStmt, K_(stmt_type), K_(alter_table_arg), K_(index_arg_list)); - private: +private: obrpc::ObAlterTableArg alter_table_arg_; bool is_comment_table_; bool is_alter_system_; diff --git a/src/sql/resolver/ddl/ob_alter_tablegroup_resolver.h b/src/sql/resolver/ddl/ob_alter_tablegroup_resolver.h index b1ed6676a..c0575dcba 100644 --- a/src/sql/resolver/ddl/ob_alter_tablegroup_resolver.h +++ b/src/sql/resolver/ddl/ob_alter_tablegroup_resolver.h @@ -22,7 +22,7 @@ class ObAlterTablegroupResolver : public ObTableGroupResolver { static const int TG_NAME = 0; static const int TABLE_LIST = 1; - public: +public: explicit ObAlterTablegroupResolver(ObResolverParams& params); virtual ~ObAlterTablegroupResolver(); virtual int resolve(const ParseNode& parse_tree); @@ -31,7 +31,7 @@ class ObAlterTablegroupResolver : public ObTableGroupResolver { return static_cast(stmt_); }; - private: +private: int resolve_partition_options(const ParseNode& node); int resolve_add_partition(const ParseNode& node); int resolve_drop_partition(const ParseNode& node); diff --git a/src/sql/resolver/ddl/ob_alter_tablegroup_stmt.h b/src/sql/resolver/ddl/ob_alter_tablegroup_stmt.h index 87c158ee1..67d68cd75 100644 --- a/src/sql/resolver/ddl/ob_alter_tablegroup_stmt.h +++ b/src/sql/resolver/ddl/ob_alter_tablegroup_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObAlterTablegroupStmt : public ObTablegroupStmt { - public: +public: explicit ObAlterTablegroupStmt(common::ObIAllocator* name_pool); ObAlterTablegroupStmt(); virtual ~ObAlterTablegroupStmt(); @@ -49,7 +49,7 @@ class ObAlterTablegroupStmt : public ObTablegroupStmt { TO_STRING_KV(K_(alter_tablegroup_arg)); - private: +private: obrpc::ObAlterTablegroupArg alter_tablegroup_arg_; DISALLOW_COPY_AND_ASSIGN(ObAlterTablegroupStmt); }; diff --git a/src/sql/resolver/ddl/ob_create_database_resolver.h b/src/sql/resolver/ddl/ob_create_database_resolver.h index f29da6e9a..5a8001376 100644 --- a/src/sql/resolver/ddl/ob_create_database_resolver.h +++ b/src/sql/resolver/ddl/ob_create_database_resolver.h @@ -22,12 +22,12 @@ class ObCreateDatabaseResolver : public ObDDLResolver { static const int64_t DATABASE_OPTION = 2; static const int64_t DATABASE_NODE_COUNT = 3; - public: +public: explicit ObCreateDatabaseResolver(ObResolverParams& params); virtual ~ObCreateDatabaseResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateDatabaseResolver); }; diff --git a/src/sql/resolver/ddl/ob_create_database_stmt.h b/src/sql/resolver/ddl/ob_create_database_stmt.h index 46e752679..a3849edca 100644 --- a/src/sql/resolver/ddl/ob_create_database_stmt.h +++ b/src/sql/resolver/ddl/ob_create_database_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObCreateDatabaseStmt : public ObDDLStmt { - public: +public: ObCreateDatabaseStmt(); explicit ObCreateDatabaseStmt(common::ObIAllocator* name_pool); virtual ~ObCreateDatabaseStmt(); @@ -48,7 +48,7 @@ class ObCreateDatabaseStmt : public ObDDLStmt { TO_STRING_KV(K_(create_database_arg)); - private: +private: bool is_charset_specify_; bool is_collation_specify_; obrpc::ObCreateDatabaseArg create_database_arg_; diff --git a/src/sql/resolver/ddl/ob_create_dblink_resolver.h b/src/sql/resolver/ddl/ob_create_dblink_resolver.h index 0b32b760a..34b87fcb6 100644 --- a/src/sql/resolver/ddl/ob_create_dblink_resolver.h +++ b/src/sql/resolver/ddl/ob_create_dblink_resolver.h @@ -25,12 +25,12 @@ class ObCreateDbLinkResolver : public ObDDLResolver { static const int64_t OPT_CLUSTER = 5; static const int64_t DBLINK_NODE_COUNT = 6; - public: +public: explicit ObCreateDbLinkResolver(ObResolverParams& params); virtual ~ObCreateDbLinkResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateDbLinkResolver); }; diff --git a/src/sql/resolver/ddl/ob_create_dblink_stmt.h b/src/sql/resolver/ddl/ob_create_dblink_stmt.h index 9ed03b37a..eabbe9dfb 100644 --- a/src/sql/resolver/ddl/ob_create_dblink_stmt.h +++ b/src/sql/resolver/ddl/ob_create_dblink_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObCreateDbLinkStmt : public ObDDLStmt { - public: +public: ObCreateDbLinkStmt(); explicit ObCreateDbLinkStmt(common::ObIAllocator* name_pool); virtual ~ObCreateDbLinkStmt(); @@ -72,7 +72,7 @@ class ObCreateDbLinkStmt : public ObDDLStmt { TO_STRING_KV(K_(create_dblink_arg)); - private: +private: obrpc::ObCreateDbLinkArg create_dblink_arg_; }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_create_func_resolver.h b/src/sql/resolver/ddl/ob_create_func_resolver.h index 2d835ebdb..6e9ed80bd 100644 --- a/src/sql/resolver/ddl/ob_create_func_resolver.h +++ b/src/sql/resolver/ddl/ob_create_func_resolver.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace sql { class ObCreateFuncResolver : public ObDDLResolver { - public: +public: explicit ObCreateFuncResolver(ObResolverParams& params); virtual ~ObCreateFuncResolver(); diff --git a/src/sql/resolver/ddl/ob_create_func_stmt.h b/src/sql/resolver/ddl/ob_create_func_stmt.h index 75314b7e6..0f52c7687 100644 --- a/src/sql/resolver/ddl/ob_create_func_stmt.h +++ b/src/sql/resolver/ddl/ob_create_func_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObCreateFuncStmt : public ObDDLStmt { - public: +public: ObCreateFuncStmt() : ObDDLStmt(stmt::T_CREATE_FUNC) {} ~ObCreateFuncStmt() @@ -36,7 +36,7 @@ class ObCreateFuncStmt : public ObDDLStmt { return create_func_arg_; } - private: +private: obrpc::ObCreateUserDefinedFunctionArg create_func_arg_; DISALLOW_COPY_AND_ASSIGN(ObCreateFuncStmt); }; diff --git a/src/sql/resolver/ddl/ob_create_index_resolver.h b/src/sql/resolver/ddl/ob_create_index_resolver.h index 80cbc9e8a..d8a3a9f52 100644 --- a/src/sql/resolver/ddl/ob_create_index_resolver.h +++ b/src/sql/resolver/ddl/ob_create_index_resolver.h @@ -21,14 +21,14 @@ class ObCreateIndexArg; namespace sql { class ObCreateIndexStmt; class ObCreateIndexResolver : public ObDDLResolver { - public: +public: static const int64_t CREATE_INDEX_CHILD_NUM = 7; explicit ObCreateIndexResolver(ObResolverParams& params); virtual ~ObCreateIndexResolver(); virtual int resolve(const ParseNode& parse_tree); - protected: +protected: int resolve_index_name_node(ParseNode* index_name_node, ObCreateIndexStmt* crt_idx_stmt); int resolve_index_table_name_node(ParseNode* index_table_name_node, ObCreateIndexStmt* crt_idx_stmt); int resolve_index_column_node(ParseNode* index_column_node, const bool is_fulltext_index, @@ -41,7 +41,7 @@ class ObCreateIndexResolver : public ObDDLResolver { int set_table_option_to_stmt(); int add_new_indexkey_for_oracle_temp_table(); - private: +private: bool is_oracle_temp_table_; bool is_spec_block_size; DISALLOW_COPY_AND_ASSIGN(ObCreateIndexResolver); diff --git a/src/sql/resolver/ddl/ob_create_index_stmt.h b/src/sql/resolver/ddl/ob_create_index_stmt.h index 127ae050d..dbdbcee42 100644 --- a/src/sql/resolver/ddl/ob_create_index_stmt.h +++ b/src/sql/resolver/ddl/ob_create_index_stmt.h @@ -25,7 +25,7 @@ namespace sql { class ObCreateIndexStmt : public ObPartitionedStmt { const static int OB_DEFAULT_ARRAY_SIZE = 16; - public: +public: explicit ObCreateIndexStmt(common::ObIAllocator* name_pool); ObCreateIndexStmt(); virtual ~ObCreateIndexStmt(); @@ -103,7 +103,7 @@ class ObCreateIndexStmt : public ObPartitionedStmt { } TO_STRING_KV(K_(stmt_type), K_(create_index_arg)); - private: +private: obrpc::ObCreateIndexArg create_index_arg_; uint64_t table_id_; DISALLOW_COPY_AND_ASSIGN(ObCreateIndexStmt); diff --git a/src/sql/resolver/ddl/ob_create_outline_resolver.h b/src/sql/resolver/ddl/ob_create_outline_resolver.h index be4f00227..2f1b15d7a 100644 --- a/src/sql/resolver/ddl/ob_create_outline_resolver.h +++ b/src/sql/resolver/ddl/ob_create_outline_resolver.h @@ -18,14 +18,14 @@ namespace oceanbase { namespace sql { class ObCreateOutlineStmt; class ObCreateOutlineResolver : public ObOutlineResolver { - public: +public: explicit ObCreateOutlineResolver(ObResolverParams& params) : ObOutlineResolver(params) {} virtual ~ObCreateOutlineResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: int resolve_sql_id(const ParseNode* node, ObCreateOutlineStmt& create_outline_stmt); int resolve_hint(const ParseNode* node, ObCreateOutlineStmt& create_outline_stmt); static const int64_t OUTLINE_CHILD_COUNT = 5; diff --git a/src/sql/resolver/ddl/ob_create_outline_stmt.h b/src/sql/resolver/ddl/ob_create_outline_stmt.h index 477fa19eb..37cb7ef00 100644 --- a/src/sql/resolver/ddl/ob_create_outline_stmt.h +++ b/src/sql/resolver/ddl/ob_create_outline_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObCreateOutlineStmt : public ObDDLStmt { - public: +public: ObCreateOutlineStmt() : ObDDLStmt(stmt::T_CREATE_OUTLINE), create_outline_arg_(), max_concurrent_(-1), outline_stmt_(NULL) {} @@ -106,7 +106,7 @@ class ObCreateOutlineStmt : public ObDDLStmt { } TO_STRING_KV(K_(create_outline_arg), K_(outline_stmt)); - private: +private: obrpc::ObCreateOutlineArg create_outline_arg_; common::ObString sql_id_; common::ObString hint_; diff --git a/src/sql/resolver/ddl/ob_create_profile_resolver.h b/src/sql/resolver/ddl/ob_create_profile_resolver.h index e8a5ac46e..717681e30 100644 --- a/src/sql/resolver/ddl/ob_create_profile_resolver.h +++ b/src/sql/resolver/ddl/ob_create_profile_resolver.h @@ -19,13 +19,13 @@ namespace oceanbase { namespace sql { class ObUserProfileResolver : public ObDDLResolver { - public: +public: explicit ObUserProfileResolver(ObResolverParams& params); virtual ~ObUserProfileResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: int fill_arg(int64_t type, ObObj& value, obrpc::ObProfileDDLArg& arg); int resolver_password_verify_function(const ParseNode* node, obrpc::ObProfileDDLArg& arg); // disallow copy diff --git a/src/sql/resolver/ddl/ob_create_profile_stmt.h b/src/sql/resolver/ddl/ob_create_profile_stmt.h index cbc5e22ae..2396f2e73 100644 --- a/src/sql/resolver/ddl/ob_create_profile_stmt.h +++ b/src/sql/resolver/ddl/ob_create_profile_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObUserProfileStmt : public ObDDLStmt { - public: +public: explicit ObUserProfileStmt(common::ObIAllocator* name_pool); ObUserProfileStmt(); virtual ~ObUserProfileStmt(); @@ -35,11 +35,11 @@ class ObUserProfileStmt : public ObDDLStmt { } TO_STRING_KV(K_(create_profile_arg)); - private: +private: // data members obrpc::ObProfileDDLArg create_profile_arg_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUserProfileStmt); }; } // end namespace sql diff --git a/src/sql/resolver/ddl/ob_create_sequence_resolver.h b/src/sql/resolver/ddl/ob_create_sequence_resolver.h index 832204eb9..aef280da2 100644 --- a/src/sql/resolver/ddl/ob_create_sequence_resolver.h +++ b/src/sql/resolver/ddl/ob_create_sequence_resolver.h @@ -18,20 +18,20 @@ namespace oceanbase { namespace sql { class ObCreateSequenceResolver : public ObStmtResolver { - public: +public: explicit ObCreateSequenceResolver(ObResolverParams& params); virtual ~ObCreateSequenceResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateSequenceResolver); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_create_synonym_resolver.h b/src/sql/resolver/ddl/ob_create_synonym_resolver.h index 5907049aa..abd08715d 100644 --- a/src/sql/resolver/ddl/ob_create_synonym_resolver.h +++ b/src/sql/resolver/ddl/ob_create_synonym_resolver.h @@ -22,12 +22,12 @@ namespace oceanbase { namespace sql { class ObCreateSynonymStmt; class ObCreateSynonymResolver : public ObDDLResolver { - public: +public: explicit ObCreateSynonymResolver(ObResolverParams& params); virtual ~ObCreateSynonymResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: int check_valid(const ObCreateSynonymStmt* synonym_stmt); DISALLOW_COPY_AND_ASSIGN(ObCreateSynonymResolver); }; diff --git a/src/sql/resolver/ddl/ob_create_synonym_stmt.h b/src/sql/resolver/ddl/ob_create_synonym_stmt.h index c1bc6224e..917c4f366 100644 --- a/src/sql/resolver/ddl/ob_create_synonym_stmt.h +++ b/src/sql/resolver/ddl/ob_create_synonym_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObCreateSynonymStmt : public ObDDLStmt { - public: +public: const static int OB_DEFAULT_ARRAY_SIZE = 16; explicit ObCreateSynonymStmt(common::ObIAllocator* name_pool); ObCreateSynonymStmt(); @@ -88,9 +88,9 @@ class ObCreateSynonymStmt : public ObDDLStmt { } TO_STRING_KV(K_(create_synonym_arg)); - private: +private: // int set_table_id(ObStmtResolver &ctx, const uint64_t table_id); - private: +private: obrpc::ObCreateSynonymArg create_synonym_arg_; }; diff --git a/src/sql/resolver/ddl/ob_create_table_like_resolver.h b/src/sql/resolver/ddl/ob_create_table_like_resolver.h index 3140b4d81..7da0e66b1 100644 --- a/src/sql/resolver/ddl/ob_create_table_like_resolver.h +++ b/src/sql/resolver/ddl/ob_create_table_like_resolver.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObCreateTableLikeResolver : public ObDDLResolver { - public: +public: explicit ObCreateTableLikeResolver(ObResolverParams& params); virtual ~ObCreateTableLikeResolver(); virtual int resolve(const ParseNode& parse_tree); @@ -29,7 +29,7 @@ class ObCreateTableLikeResolver : public ObDDLResolver { return static_cast(stmt_); }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateTableLikeResolver); }; diff --git a/src/sql/resolver/ddl/ob_create_table_like_stmt.h b/src/sql/resolver/ddl/ob_create_table_like_stmt.h index 26834b4a2..b6b0d178a 100644 --- a/src/sql/resolver/ddl/ob_create_table_like_stmt.h +++ b/src/sql/resolver/ddl/ob_create_table_like_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObCreateTableLikeStmt : public ObDDLStmt { - public: +public: explicit ObCreateTableLikeStmt(common::ObIAllocator* name_pool); ObCreateTableLikeStmt(); virtual ~ObCreateTableLikeStmt(); @@ -90,7 +90,7 @@ class ObCreateTableLikeStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(create_table_like_arg)); - private: +private: obrpc::ObCreateTableLikeArg create_table_like_arg_; }; diff --git a/src/sql/resolver/ddl/ob_create_table_resolver.h b/src/sql/resolver/ddl/ob_create_table_resolver.h index 8125dc24e..c19b791d5 100644 --- a/src/sql/resolver/ddl/ob_create_table_resolver.h +++ b/src/sql/resolver/ddl/ob_create_table_resolver.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace sql { class ObCreateTableResolver : public ObDDLResolver { - public: +public: // store generated column and its' dependent expr. struct GenColExpr { GenColExpr(uint64_t col_id, ObRawExpr* gen_col_expr) : col_id_(col_id), gen_col_expr_(gen_col_expr) @@ -43,10 +43,10 @@ class ObCreateTableResolver : public ObDDLResolver { virtual int resolve(const ParseNode& parse_tree); - private: +private: enum ResolveRule { RESOLVE_ALL = 0, RESOLVE_COL_ONLY, RESOLVE_NON_COL }; // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateTableResolver); // function members @@ -106,7 +106,7 @@ class ObCreateTableResolver : public ObDDLResolver { bool is_uk_uk_duplicate(const ObIArray& uk_idx, const ObIArray& index_arg_list); int resolve_auto_partition(const ParseNode* partition_node); - private: +private: // data members uint64_t cur_column_id_; common::ObSEArray primary_keys_; diff --git a/src/sql/resolver/ddl/ob_create_table_stmt.h b/src/sql/resolver/ddl/ob_create_table_stmt.h index 9ec1845ab..e0ca67c45 100644 --- a/src/sql/resolver/ddl/ob_create_table_stmt.h +++ b/src/sql/resolver/ddl/ob_create_table_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObCreateTableStmt : public ObTableStmt { - public: +public: explicit ObCreateTableStmt(common::ObIAllocator* name_pool); ObCreateTableStmt(); virtual ~ObCreateTableStmt(); @@ -116,10 +116,10 @@ class ObCreateTableStmt : public ObTableStmt { } INHERIT_TO_STRING_KV("ObTableStmt", ObTableStmt, K_(stmt_type), K_(create_table_arg), K_(index_arg_list)); - private: +private: int set_table_id(ObStmtResolver& ctx, const uint64_t table_id); - private: +private: obrpc::ObCreateTableArg create_table_arg_; bool is_view_stmt_; share::schema::ObStmtNeedPrivs::NeedPrivs view_need_privs_; @@ -134,7 +134,7 @@ class ObCreateTableStmt : public ObTableStmt { // } // // create table xxx as already_exist_table, pay attention to whether data are need - protected: +protected: ObSelectStmt* sub_select_stmt_; // create table ... as select... ObSelectStmt* view_define_; }; diff --git a/src/sql/resolver/ddl/ob_create_tablegroup_resolver.h b/src/sql/resolver/ddl/ob_create_tablegroup_resolver.h index 40c6c1109..629d9841d 100644 --- a/src/sql/resolver/ddl/ob_create_tablegroup_resolver.h +++ b/src/sql/resolver/ddl/ob_create_tablegroup_resolver.h @@ -24,12 +24,12 @@ class ObCreateTablegroupResolver : public ObTableGroupResolver { static const int64_t TABLEGROUP_OPTION = 2; static const int64_t PARTITION_OPTION = 3; - public: +public: explicit ObCreateTablegroupResolver(ObResolverParams& params); virtual ~ObCreateTablegroupResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateTablegroupResolver); }; diff --git a/src/sql/resolver/ddl/ob_create_tablegroup_stmt.h b/src/sql/resolver/ddl/ob_create_tablegroup_stmt.h index 2230de801..6153cb100 100644 --- a/src/sql/resolver/ddl/ob_create_tablegroup_stmt.h +++ b/src/sql/resolver/ddl/ob_create_tablegroup_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObCreateTablegroupStmt : public ObTablegroupStmt { - public: +public: ObCreateTablegroupStmt(); explicit ObCreateTablegroupStmt(common::ObIAllocator* name_pool); virtual ~ObCreateTablegroupStmt(); @@ -51,7 +51,7 @@ class ObCreateTablegroupStmt : public ObTablegroupStmt { } TO_STRING_KV(K_(create_tablegroup_arg)); - private: +private: obrpc::ObCreateTablegroupArg create_tablegroup_arg_; DISALLOW_COPY_AND_ASSIGN(ObCreateTablegroupStmt); }; diff --git a/src/sql/resolver/ddl/ob_create_tenant_resolver.h b/src/sql/resolver/ddl/ob_create_tenant_resolver.h index d7ad48c5a..57bac950d 100644 --- a/src/sql/resolver/ddl/ob_create_tenant_resolver.h +++ b/src/sql/resolver/ddl/ob_create_tenant_resolver.h @@ -19,20 +19,20 @@ namespace oceanbase { namespace sql { class ObCreateTenantResolver : public ObDDLResolver { - public: +public: explicit ObCreateTenantResolver(ObResolverParams& params); virtual ~ObCreateTenantResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObCreateTenantResolver); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_create_tenant_stmt.h b/src/sql/resolver/ddl/ob_create_tenant_stmt.h index fb6a65b33..83b7737ca 100644 --- a/src/sql/resolver/ddl/ob_create_tenant_stmt.h +++ b/src/sql/resolver/ddl/ob_create_tenant_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObCreateTenantStmt : public ObDDLStmt { - public: +public: explicit ObCreateTenantStmt(common::ObIAllocator* name_pool); ObCreateTenantStmt(); virtual ~ObCreateTenantStmt(); @@ -74,7 +74,7 @@ class ObCreateTenantStmt : public ObDDLStmt { return create_tenant_arg_; } - private: +private: obrpc::ObCreateTenantArg create_tenant_arg_; common::ObArray sys_var_nodes_; DISALLOW_COPY_AND_ASSIGN(ObCreateTenantStmt); diff --git a/src/sql/resolver/ddl/ob_create_view_resolver.h b/src/sql/resolver/ddl/ob_create_view_resolver.h index e1c83d066..ba1e83bf0 100644 --- a/src/sql/resolver/ddl/ob_create_view_resolver.h +++ b/src/sql/resolver/ddl/ob_create_view_resolver.h @@ -35,13 +35,13 @@ class ObCreateViewResolver : public ObDDLResolver { static const int64_t WITH_OPT_NODE = 6; static const int64_t ROOT_NUM_CHILD = 7; - public: +public: explicit ObCreateViewResolver(ObResolverParams& params); virtual ~ObCreateViewResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: int resolve_column_list(ParseNode* view_columns_node, common::ObIArray& column_list); int check_select_stmt_col_name(SelectItem& select_item, ObArray& index_array, int64_t pos, common::hash::ObHashSet& view_col_names); @@ -54,7 +54,7 @@ class ObCreateViewResolver : public ObDDLResolver { int stmt_print( const ObSelectStmt* stmt, common::ObIArray* column_list, common::ObString& expanded_view); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateViewResolver); }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_create_view_stmt.h b/src/sql/resolver/ddl/ob_create_view_stmt.h index bdae3bf6c..8c95496f8 100644 --- a/src/sql/resolver/ddl/ob_create_view_stmt.h +++ b/src/sql/resolver/ddl/ob_create_view_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObCreateViewStmt : public ObStmt { - public: +public: explicit ObCreateViewStmt(common::ObIAllocator* name_pool); ObCreateViewStmt(); virtual ~ObCreateViewStmt(); @@ -38,10 +38,10 @@ class ObCreateViewStmt : public ObStmt { return true; } - protected: +protected: common::ObIAllocator* name_pool_; - private: +private: ObSelectStmt* definition_stmt_; common::ObString view_name_; common::ObString view_definition_; diff --git a/src/sql/resolver/ddl/ob_database_resolver.h b/src/sql/resolver/ddl/ob_database_resolver.h index aac7ad08d..2466f6808 100644 --- a/src/sql/resolver/ddl/ob_database_resolver.h +++ b/src/sql/resolver/ddl/ob_database_resolver.h @@ -23,15 +23,15 @@ namespace oceanbase { namespace sql { template class ObDatabaseResolver { - public: +public: ObDatabaseResolver() : alter_option_bitset_(), collation_already_set_(false) {} ~ObDatabaseResolver(){}; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDatabaseResolver); - public: +public: static int resolve_primary_zone(T* stmt, ParseNode* node); int resolve_database_options(T* stmt, ParseNode* node); const common::ObBitSet<>& get_alter_option_bitset() const @@ -39,11 +39,11 @@ class ObDatabaseResolver { return alter_option_bitset_; }; - private: +private: int resolve_database_option(T* stmt, ParseNode* node); int resolve_zone_list(T* stmt, ParseNode* node) const; - private: +private: common::ObBitSet<> alter_option_bitset_; bool collation_already_set_; }; diff --git a/src/sql/resolver/ddl/ob_ddl_resolver.h b/src/sql/resolver/ddl/ob_ddl_resolver.h index c2759a91a..a6e408f47 100644 --- a/src/sql/resolver/ddl/ob_ddl_resolver.h +++ b/src/sql/resolver/ddl/ob_ddl_resolver.h @@ -96,7 +96,7 @@ struct ObColumnResolveStat { }; class ObDDLResolver : public ObStmtResolver { - public: +public: enum INDEX_TYPE { NOT_SPECIFIED = 0, LOCAL_INDEX = 1, GLOBAL_INDEX = 2 }; enum INDEX_KEYNAME { NORMAL_KEY = 0, UNIQUE_KEY = 1, DOMAIN_KEY = 2 }; enum COLUMN_NODE { @@ -240,7 +240,7 @@ class ObDDLResolver : public ObStmtResolver { int resolve_subpartition_option( ObPartitionedStmt* stmt, ParseNode* subpart_node, share::schema::ObTableSchema& table_schema); - protected: +protected: static int check_same_substr_expr(ObRawExpr& left, ObRawExpr& right, bool& same); static int check_uniq_allow(ObResolverParams& params, share::schema::ObTableSchema& table_schema, obrpc::ObCreateIndexArg& index_arg, ObRawExpr* part_func_expr, common::ObIArray& constraint_exprs, @@ -505,7 +505,7 @@ class ObDDLResolver : public ObStmtResolver { int64_t table_dop_; // default value is 1 int64_t hash_subpart_num_; - private: +private: template DISALLOW_COPY_AND_ASSIGN(ObDDLResolver); }; diff --git a/src/sql/resolver/ddl/ob_ddl_stmt.h b/src/sql/resolver/ddl/ob_ddl_stmt.h index 0ca3fa073..e624df09a 100644 --- a/src/sql/resolver/ddl/ob_ddl_stmt.h +++ b/src/sql/resolver/ddl/ob_ddl_stmt.h @@ -20,7 +20,7 @@ namespace sql { class ObDDLStmt : public ObStmt, public ObICmd { const static int OB_DEFAULT_ARRAY_SIZE = 16; - public: +public: ObDDLStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObStmt(name_pool, type) {} explicit ObDDLStmt(stmt::StmtType type) : ObStmt(type) @@ -40,7 +40,7 @@ class ObDDLStmt : public ObStmt, public ObICmd { } virtual int get_first_stmt(common::ObString& first_stmt); - private: +private: ObArenaAllocator allocator_; DISALLOW_COPY_AND_ASSIGN(ObDDLStmt); }; diff --git a/src/sql/resolver/ddl/ob_drop_database_resolver.h b/src/sql/resolver/ddl/ob_drop_database_resolver.h index cb3be629b..1ca42fcb8 100644 --- a/src/sql/resolver/ddl/ob_drop_database_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_database_resolver.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObDropDatabaseResolver : public ObDDLResolver { - public: +public: const static int64_t IF_EXIST = 0; const static int64_t DBNAME = 1; const static int64_t DB_NODE_COUNT = 2; @@ -26,11 +26,11 @@ class ObDropDatabaseResolver : public ObDDLResolver { virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropDatabaseResolver); - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_drop_database_stmt.h b/src/sql/resolver/ddl/ob_drop_database_stmt.h index 43fefdd58..b648bafad 100644 --- a/src/sql/resolver/ddl/ob_drop_database_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_database_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObDropDatabaseStmt : public ObDDLStmt { - public: +public: ObDropDatabaseStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_DROP_DATABASE), drop_database_arg_(), server_charset_(), server_collation_() {} @@ -75,7 +75,7 @@ class ObDropDatabaseStmt : public ObDDLStmt { drop_database_arg_.to_recyclebin_ = to_recyclebin; } - private: +private: obrpc::ObDropDatabaseArg drop_database_arg_; common::ObString server_charset_; common::ObString server_collation_; diff --git a/src/sql/resolver/ddl/ob_drop_dblink_resolver.h b/src/sql/resolver/ddl/ob_drop_dblink_resolver.h index 0a4454748..a170306da 100644 --- a/src/sql/resolver/ddl/ob_drop_dblink_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_dblink_resolver.h @@ -20,12 +20,12 @@ class ObDropDbLinkResolver : public ObDDLResolver { static const int64_t DBLINK_NAME = 0; static const int64_t DBLINK_NODE_COUNT = 1; - public: +public: explicit ObDropDbLinkResolver(ObResolverParams& params); virtual ~ObDropDbLinkResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropDbLinkResolver); }; diff --git a/src/sql/resolver/ddl/ob_drop_dblink_stmt.h b/src/sql/resolver/ddl/ob_drop_dblink_stmt.h index 36f6dd361..2b232cac1 100644 --- a/src/sql/resolver/ddl/ob_drop_dblink_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_dblink_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObDropDbLinkStmt : public ObDDLStmt { - public: +public: ObDropDbLinkStmt(); explicit ObDropDbLinkStmt(common::ObIAllocator* name_pool); virtual ~ObDropDbLinkStmt(); @@ -47,7 +47,7 @@ class ObDropDbLinkStmt : public ObDDLStmt { TO_STRING_KV(K_(drop_dblink_arg)); - private: +private: obrpc::ObDropDbLinkArg drop_dblink_arg_; }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_drop_func_resolver.h b/src/sql/resolver/ddl/ob_drop_func_resolver.h index 4ae0c53ed..99b8b50a1 100644 --- a/src/sql/resolver/ddl/ob_drop_func_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_func_resolver.h @@ -20,13 +20,13 @@ namespace oceanbase { namespace sql { class ObDropFuncResolver : public ObDDLResolver { - public: +public: explicit ObDropFuncResolver(ObResolverParams& params); virtual ~ObDropFuncResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropFuncResolver); }; diff --git a/src/sql/resolver/ddl/ob_drop_func_stmt.h b/src/sql/resolver/ddl/ob_drop_func_stmt.h index ca1870c7b..384987d93 100644 --- a/src/sql/resolver/ddl/ob_drop_func_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_func_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObDropFuncStmt : public ObDDLStmt { - public: +public: ObDropFuncStmt() : ObDDLStmt(stmt::T_DROP_FUNC), drop_func_arg_() {} ~ObDropFuncStmt() @@ -40,7 +40,7 @@ class ObDropFuncStmt : public ObDDLStmt { } TO_STRING_KV(K_(drop_func_arg)); - private: +private: obrpc::ObDropUserDefinedFunctionArg drop_func_arg_; DISALLOW_COPY_AND_ASSIGN(ObDropFuncStmt); }; diff --git a/src/sql/resolver/ddl/ob_drop_index_resolver.h b/src/sql/resolver/ddl/ob_drop_index_resolver.h index 1ef3b3b5f..646329e39 100644 --- a/src/sql/resolver/ddl/ob_drop_index_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_index_resolver.h @@ -20,13 +20,13 @@ namespace oceanbase { namespace sql { class ObDropIndexResolver : public ObDDLResolver { - public: +public: explicit ObDropIndexResolver(ObResolverParams& params); virtual ~ObDropIndexResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropIndexResolver); }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_drop_index_stmt.h b/src/sql/resolver/ddl/ob_drop_index_stmt.h index 1b67704a3..673e885b4 100644 --- a/src/sql/resolver/ddl/ob_drop_index_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_index_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObDropIndexStmt : public ObDDLStmt { - public: +public: explicit ObDropIndexStmt(common::ObIAllocator* name_pool); ObDropIndexStmt(); virtual ~ObDropIndexStmt(); @@ -56,10 +56,10 @@ class ObDropIndexStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(drop_index_arg)); - protected: +protected: common::ObIAllocator* name_pool_; - private: +private: obrpc::ObDropIndexArg drop_index_arg_; uint64_t table_id_; DISALLOW_COPY_AND_ASSIGN(ObDropIndexStmt); diff --git a/src/sql/resolver/ddl/ob_drop_outline_resolver.h b/src/sql/resolver/ddl/ob_drop_outline_resolver.h index f6f378adf..f5f1934a8 100644 --- a/src/sql/resolver/ddl/ob_drop_outline_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_outline_resolver.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObDropOutlineResolver : public ObOutlineResolver { - public: +public: explicit ObDropOutlineResolver(ObResolverParams& params) : ObOutlineResolver(params) {} virtual ~ObDropOutlineResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: static const int64_t OUTLINE_CHILD_COUNT = 1; DISALLOW_COPY_AND_ASSIGN(ObDropOutlineResolver); }; diff --git a/src/sql/resolver/ddl/ob_drop_outline_stmt.h b/src/sql/resolver/ddl/ob_drop_outline_stmt.h index cf7410c26..bcdf25bf7 100644 --- a/src/sql/resolver/ddl/ob_drop_outline_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_outline_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObDropOutlineStmt : public ObDDLStmt { - public: +public: ObDropOutlineStmt() : ObDDLStmt(stmt::T_DROP_OUTLINE), drop_outline_arg_() {} ~ObDropOutlineStmt() @@ -45,7 +45,7 @@ class ObDropOutlineStmt : public ObDDLStmt { } TO_STRING_KV(K_(drop_outline_arg)); - private: +private: obrpc::ObDropOutlineArg drop_outline_arg_; DISALLOW_COPY_AND_ASSIGN(ObDropOutlineStmt); }; diff --git a/src/sql/resolver/ddl/ob_drop_sequence_resolver.h b/src/sql/resolver/ddl/ob_drop_sequence_resolver.h index f9d267340..3a5bc8ce8 100644 --- a/src/sql/resolver/ddl/ob_drop_sequence_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_sequence_resolver.h @@ -18,20 +18,20 @@ namespace oceanbase { namespace sql { class ObDropSequenceResolver : public ObStmtResolver { - public: +public: explicit ObDropSequenceResolver(ObResolverParams& params); virtual ~ObDropSequenceResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropSequenceResolver); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_drop_synonym_resolver.h b/src/sql/resolver/ddl/ob_drop_synonym_resolver.h index 31e19e98d..28b717a57 100644 --- a/src/sql/resolver/ddl/ob_drop_synonym_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_synonym_resolver.h @@ -17,14 +17,14 @@ namespace oceanbase { namespace sql { class ObDropSynonymResolver : public ObDDLResolver { - public: +public: explicit ObDropSynonymResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObDropSynonymResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: static const int64_t SYNONYM_CHILD_COUNT = 4; DISALLOW_COPY_AND_ASSIGN(ObDropSynonymResolver); }; diff --git a/src/sql/resolver/ddl/ob_drop_synonym_stmt.h b/src/sql/resolver/ddl/ob_drop_synonym_stmt.h index 3fb18ebc5..ede347857 100644 --- a/src/sql/resolver/ddl/ob_drop_synonym_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_synonym_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObDropSynonymStmt : public ObDDLStmt { - public: +public: ObDropSynonymStmt() : ObDDLStmt(stmt::T_DROP_SYNONYM), drop_synonym_arg_() {} ~ObDropSynonymStmt() @@ -53,7 +53,7 @@ class ObDropSynonymStmt : public ObDDLStmt { } TO_STRING_KV(K_(drop_synonym_arg)); - private: +private: obrpc::ObDropSynonymArg drop_synonym_arg_; DISALLOW_COPY_AND_ASSIGN(ObDropSynonymStmt); }; diff --git a/src/sql/resolver/ddl/ob_drop_table_resolver.h b/src/sql/resolver/ddl/ob_drop_table_resolver.h index 5e2890668..ee8af2a5e 100644 --- a/src/sql/resolver/ddl/ob_drop_table_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_table_resolver.h @@ -17,16 +17,16 @@ namespace oceanbase { namespace sql { class ObDropTableResolver : public ObDDLResolver { - public: +public: enum node_type { MATERIALIZED_NODE = 0, IF_EXIST_NODE, TABLE_LIST_NODE, MAX_NODE }; - public: +public: explicit ObDropTableResolver(ObResolverParams& params); virtual ~ObDropTableResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDropTableResolver); }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_drop_table_stmt.h b/src/sql/resolver/ddl/ob_drop_table_stmt.h index 869b5bf94..de5244c89 100644 --- a/src/sql/resolver/ddl/ob_drop_table_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_table_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObDropTableStmt : public ObDDLStmt { - public: +public: explicit ObDropTableStmt(common::ObIAllocator* name_pool); ObDropTableStmt(); virtual ~ObDropTableStmt(); @@ -52,7 +52,7 @@ class ObDropTableStmt : public ObDDLStmt { TO_STRING_KV(K_(stmt_type), K_(drop_table_arg)); - private: +private: obrpc::ObDropTableArg drop_table_arg_; bool is_view_stmt_; DISALLOW_COPY_AND_ASSIGN(ObDropTableStmt); diff --git a/src/sql/resolver/ddl/ob_drop_tablegroup_resolver.h b/src/sql/resolver/ddl/ob_drop_tablegroup_resolver.h index d7e3eb4e8..9f27ad2d5 100644 --- a/src/sql/resolver/ddl/ob_drop_tablegroup_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_tablegroup_resolver.h @@ -22,19 +22,19 @@ class ObDropTablegroupResolver : public ObDDLResolver { static const int64_t TG_NAME = 1; static const int64_t TG_NODE_COUNT = 2; - public: +public: explicit ObDropTablegroupResolver(ObResolverParams& params); virtual ~ObDropTablegroupResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropTablegroupResolver); - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_drop_tablegroup_stmt.h b/src/sql/resolver/ddl/ob_drop_tablegroup_stmt.h index 4b7d17245..281898851 100644 --- a/src/sql/resolver/ddl/ob_drop_tablegroup_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_tablegroup_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObDropTablegroupStmt : public ObDDLStmt { - public: +public: explicit ObDropTablegroupStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_DROP_TABLEGROUP) {} ObDropTablegroupStmt() : ObDDLStmt(stmt::T_DROP_TABLEGROUP) @@ -50,7 +50,7 @@ class ObDropTablegroupStmt : public ObDDLStmt { return drop_tablegroup_arg_.tablegroup_name_; } - private: +private: obrpc::ObDropTablegroupArg drop_tablegroup_arg_; DISALLOW_COPY_AND_ASSIGN(ObDropTablegroupStmt); }; diff --git a/src/sql/resolver/ddl/ob_drop_tenant_resolver.h b/src/sql/resolver/ddl/ob_drop_tenant_resolver.h index d6231ac2a..aa386eb8a 100644 --- a/src/sql/resolver/ddl/ob_drop_tenant_resolver.h +++ b/src/sql/resolver/ddl/ob_drop_tenant_resolver.h @@ -18,19 +18,19 @@ namespace oceanbase { namespace sql { class ObDropTenantResolver : public ObDDLResolver { - public: +public: explicit ObDropTenantResolver(ObResolverParams& params); virtual ~ObDropTenantResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObDropTenantResolver); - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_drop_tenant_stmt.h b/src/sql/resolver/ddl/ob_drop_tenant_stmt.h index e5c4177f7..7e7b0c406 100644 --- a/src/sql/resolver/ddl/ob_drop_tenant_stmt.h +++ b/src/sql/resolver/ddl/ob_drop_tenant_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObDropTenantStmt : public ObDDLStmt { - public: +public: explicit ObDropTenantStmt(common::ObIAllocator* name_pool); ObDropTenantStmt(); virtual ~ObDropTenantStmt(); @@ -48,7 +48,7 @@ class ObDropTenantStmt : public ObDDLStmt { return drop_tenant_arg_; } - private: +private: obrpc::ObDropTenantArg drop_tenant_arg_; DISALLOW_COPY_AND_ASSIGN(ObDropTenantStmt); }; diff --git a/src/sql/resolver/ddl/ob_explain_resolver.h b/src/sql/resolver/ddl/ob_explain_resolver.h index c27660563..765c0f1cb 100644 --- a/src/sql/resolver/ddl/ob_explain_resolver.h +++ b/src/sql/resolver/ddl/ob_explain_resolver.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExplainResolver : public ObDMLResolver { - public: +public: ObExplainResolver(ObResolverParams& params) : ObDMLResolver(params) {} virtual ~ObExplainResolver() diff --git a/src/sql/resolver/ddl/ob_explain_stmt.h b/src/sql/resolver/ddl/ob_explain_stmt.h index 99f2eebef..acacf5f95 100644 --- a/src/sql/resolver/ddl/ob_explain_stmt.h +++ b/src/sql/resolver/ddl/ob_explain_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExplainStmt : public ObDMLStmt { - public: +public: ObExplainStmt(); virtual ~ObExplainStmt(); void set_explain_format(ExplainType format) @@ -49,7 +49,7 @@ class ObExplainStmt : public ObDMLStmt { DECLARE_VIRTUAL_TO_STRING; - private: +private: // bool verbose_; ExplainType format_; ObDMLStmt* explain_query_stmt_; diff --git a/src/sql/resolver/ddl/ob_lock_tenant_resolver.h b/src/sql/resolver/ddl/ob_lock_tenant_resolver.h index 70ae5015e..06eca41fa 100644 --- a/src/sql/resolver/ddl/ob_lock_tenant_resolver.h +++ b/src/sql/resolver/ddl/ob_lock_tenant_resolver.h @@ -18,19 +18,19 @@ namespace oceanbase { namespace sql { class ObLockTenantResolver : public ObDDLResolver { - public: +public: explicit ObLockTenantResolver(ObResolverParams& params); virtual ~ObLockTenantResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObLockTenantResolver); - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_lock_tenant_stmt.h b/src/sql/resolver/ddl/ob_lock_tenant_stmt.h index db20efc44..87c685260 100644 --- a/src/sql/resolver/ddl/ob_lock_tenant_stmt.h +++ b/src/sql/resolver/ddl/ob_lock_tenant_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObLockTenantStmt : public ObDDLStmt { - public: +public: explicit ObLockTenantStmt(common::ObIAllocator* name_pool); ObLockTenantStmt(); virtual ~ObLockTenantStmt(); @@ -39,7 +39,7 @@ class ObLockTenantStmt : public ObDDLStmt { return lock_tenant_arg_; } - private: +private: obrpc::ObLockTenantArg lock_tenant_arg_; DISALLOW_COPY_AND_ASSIGN(ObLockTenantStmt); }; diff --git a/src/sql/resolver/ddl/ob_modify_tenant_resolver.h b/src/sql/resolver/ddl/ob_modify_tenant_resolver.h index 364bf5a59..21e52eac1 100644 --- a/src/sql/resolver/ddl/ob_modify_tenant_resolver.h +++ b/src/sql/resolver/ddl/ob_modify_tenant_resolver.h @@ -18,19 +18,19 @@ namespace oceanbase { namespace sql { class ObModifyTenantResolver : public ObDDLResolver { - public: +public: explicit ObModifyTenantResolver(ObResolverParams& params); virtual ~ObModifyTenantResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObModifyTenantResolver); - private: +private: // data members }; diff --git a/src/sql/resolver/ddl/ob_modify_tenant_stmt.h b/src/sql/resolver/ddl/ob_modify_tenant_stmt.h index 3c3aba00d..185a533af 100644 --- a/src/sql/resolver/ddl/ob_modify_tenant_stmt.h +++ b/src/sql/resolver/ddl/ob_modify_tenant_stmt.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace sql { class ObModifyTenantSpecialOption final { - public: +public: ObModifyTenantSpecialOption(); ~ObModifyTenantSpecialOption() = default; void set_progressive_merge_num(const int64_t progressive_merge_num) @@ -34,12 +34,12 @@ class ObModifyTenantSpecialOption final { return progressive_merge_num_; } - private: +private: int64_t progressive_merge_num_; }; class ObModifyTenantStmt : public ObDDLStmt { - public: +public: explicit ObModifyTenantStmt(common::ObIAllocator* name_pool); ObModifyTenantStmt(); virtual ~ObModifyTenantStmt(); @@ -116,7 +116,7 @@ class ObModifyTenantStmt : public ObDDLStmt { } TO_STRING_KV(K_(modify_tenant_arg)); - private: +private: bool for_current_tenant_; obrpc::ObModifyTenantArg modify_tenant_arg_; common::ObArray sys_var_nodes_; diff --git a/src/sql/resolver/ddl/ob_optimize_resolver.h b/src/sql/resolver/ddl/ob_optimize_resolver.h index a861d478f..82463fdc4 100644 --- a/src/sql/resolver/ddl/ob_optimize_resolver.h +++ b/src/sql/resolver/ddl/ob_optimize_resolver.h @@ -21,37 +21,37 @@ namespace oceanbase { namespace sql { class ObOptimizeTableResolver : public ObDDLResolver { - public: +public: explicit ObOptimizeTableResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObOptimizeTableResolver() = default; virtual int resolve(const ParseNode& parse_tree); - private: +private: static const int64_t TABLE_LIST_NODE = 0; DISALLOW_COPY_AND_ASSIGN(ObOptimizeTableResolver); }; class ObOptimizeTenantResolver : public ObDDLResolver { - public: +public: explicit ObOptimizeTenantResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObOptimizeTenantResolver() = default; virtual int resolve(const ParseNode& parser_tree); - private: +private: static const int64_t TABLE_LIST_NODE = 0; DISALLOW_COPY_AND_ASSIGN(ObOptimizeTenantResolver); }; class ObOptimizeAllResolver : public ObDDLResolver { - public: +public: explicit ObOptimizeAllResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObOptimizeAllResolver() = default; virtual int resolve(const ParseNode& parser_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOptimizeAllResolver); }; diff --git a/src/sql/resolver/ddl/ob_optimize_stmt.h b/src/sql/resolver/ddl/ob_optimize_stmt.h index 69365e001..5723c5afb 100644 --- a/src/sql/resolver/ddl/ob_optimize_stmt.h +++ b/src/sql/resolver/ddl/ob_optimize_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObOptimizeTableStmt : public ObDDLStmt { - public: +public: explicit ObOptimizeTableStmt(common::ObIAllocator* name_pool); ObOptimizeTableStmt(); virtual ~ObOptimizeTableStmt() = default; @@ -51,13 +51,13 @@ class ObOptimizeTableStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(optimize_table_arg)); - private: +private: obrpc::ObOptimizeTableArg optimize_table_arg_; DISALLOW_COPY_AND_ASSIGN(ObOptimizeTableStmt); }; class ObOptimizeTenantStmt : public ObDDLStmt { - public: +public: explicit ObOptimizeTenantStmt(common::ObIAllocator* name_pool); ObOptimizeTenantStmt(); virtual ~ObOptimizeTenantStmt() = default; @@ -79,13 +79,13 @@ class ObOptimizeTenantStmt : public ObDDLStmt { return optimize_tenant_arg_; } - private: +private: obrpc::ObOptimizeTenantArg optimize_tenant_arg_; DISALLOW_COPY_AND_ASSIGN(ObOptimizeTenantStmt); }; class ObOptimizeAllStmt : public ObDDLStmt { - public: +public: explicit ObOptimizeAllStmt(common::ObIAllocator* name_pool); ObOptimizeAllStmt(); virtual ~ObOptimizeAllStmt() = default; @@ -106,7 +106,7 @@ class ObOptimizeAllStmt : public ObDDLStmt { return optimize_all_arg_; } - private: +private: obrpc::ObOptimizeAllArg optimize_all_arg_; DISALLOW_COPY_AND_ASSIGN(ObOptimizeAllStmt); }; diff --git a/src/sql/resolver/ddl/ob_outline_resolver.h b/src/sql/resolver/ddl/ob_outline_resolver.h index bd1cb9a16..3a3ca2a6b 100644 --- a/src/sql/resolver/ddl/ob_outline_resolver.h +++ b/src/sql/resolver/ddl/ob_outline_resolver.h @@ -17,19 +17,19 @@ namespace oceanbase { namespace sql { class ObOutlineResolver : public ObDDLResolver { - public: +public: explicit ObOutlineResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObOutlineResolver() {} - protected: +protected: int resolve_outline_name(const ParseNode* node, common::ObString& db_name, common::ObString& outline_name); int resolve_outline_stmt(const ParseNode* node, ObStmt*& out_stmt, common::ObString& outline_sql); int resolve_outline_target(const ParseNode* target_node, common::ObString& outline_target); static const int64_t RELATION_FACTOR_CHILD_COUNT = 2; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOutlineResolver); }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_partitioned_stmt.h b/src/sql/resolver/ddl/ob_partitioned_stmt.h index 4b620155a..13ad8f144 100644 --- a/src/sql/resolver/ddl/ob_partitioned_stmt.h +++ b/src/sql/resolver/ddl/ob_partitioned_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObPartitionedStmt : public ObDDLStmt { - public: +public: ObPartitionedStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObDDLStmt(name_pool, type) {} explicit ObPartitionedStmt(stmt::StmtType type) : ObDDLStmt(type) @@ -49,7 +49,7 @@ class ObPartitionedStmt : public ObDDLStmt { TO_STRING_KV(K_(part_fun_exprs), K_(part_values_exprs), K_(subpart_fun_exprs), K_(template_subpart_values_exprs), K_(individual_subpart_values_exprs)); - private: +private: /** * part_values_exprs demo: * range: array of single value, e.g. @@ -66,7 +66,7 @@ class ObPartitionedStmt : public ObDDLStmt { array_t subpart_fun_exprs_; // for subpart fun expr array_t template_subpart_values_exprs_; // for template subpart fun expr array_array_t individual_subpart_values_exprs_; // for individual subpart values expr - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionedStmt); }; diff --git a/src/sql/resolver/ddl/ob_purge_resolver.h b/src/sql/resolver/ddl/ob_purge_resolver.h index 0db907bfd..9204301da 100644 --- a/src/sql/resolver/ddl/ob_purge_resolver.h +++ b/src/sql/resolver/ddl/ob_purge_resolver.h @@ -23,14 +23,14 @@ namespace sql { class ObPurgeTableResolver : public ObDDLResolver { static const int TABLE_NODE = 0; - public: +public: explicit ObPurgeTableResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObPurgeTableResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: static const int OLD_NAME_NODE = 0; static const int NEW_NAME_NODE = 1; DISALLOW_COPY_AND_ASSIGN(ObPurgeTableResolver); @@ -39,14 +39,14 @@ class ObPurgeTableResolver : public ObDDLResolver { class ObPurgeIndexResolver : public ObDDLResolver { static const int TABLE_NODE = 0; - public: +public: explicit ObPurgeIndexResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObPurgeIndexResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: static const int OLD_NAME_NODE = 0; static const int NEW_NAME_NODE = 1; DISALLOW_COPY_AND_ASSIGN(ObPurgeIndexResolver); @@ -55,40 +55,40 @@ class ObPurgeIndexResolver : public ObDDLResolver { class ObPurgeDatabaseResolver : public ObDDLResolver { static const int DATABASE_NODE = 0; - public: +public: explicit ObPurgeDatabaseResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObPurgeDatabaseResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPurgeDatabaseResolver); }; class ObPurgeTenantResolver : public ObDDLResolver { static const int TENANT_NODE = 0; - public: +public: explicit ObPurgeTenantResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObPurgeTenantResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPurgeTenantResolver); }; class ObPurgeRecycleBinResolver : public ObDDLResolver { - public: +public: explicit ObPurgeRecycleBinResolver(ObResolverParams& params) : ObDDLResolver(params) {} virtual ~ObPurgeRecycleBinResolver() {} virtual int resolve(const ParseNode& parse_tree); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPurgeRecycleBinResolver); }; diff --git a/src/sql/resolver/ddl/ob_purge_stmt.h b/src/sql/resolver/ddl/ob_purge_stmt.h index df5e56195..7d95980de 100644 --- a/src/sql/resolver/ddl/ob_purge_stmt.h +++ b/src/sql/resolver/ddl/ob_purge_stmt.h @@ -24,7 +24,7 @@ namespace sql { */ class ObPurgeTableStmt : public ObDDLStmt { - public: +public: ObPurgeTableStmt() : ObDDLStmt(stmt::T_PURGE_TABLE) {} explicit ObPurgeTableStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_PURGE_TABLE) @@ -48,7 +48,7 @@ class ObPurgeTableStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(purge_table_arg)); - private: +private: obrpc::ObPurgeTableArg purge_table_arg_; DISALLOW_COPY_AND_ASSIGN(ObPurgeTableStmt); }; @@ -68,7 +68,7 @@ inline void ObPurgeTableStmt::set_table_name(const common::ObString& table_name) */ class ObPurgeIndexStmt : public ObDDLStmt { - public: +public: ObPurgeIndexStmt() : ObDDLStmt(stmt::T_PURGE_INDEX) {} explicit ObPurgeIndexStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_PURGE_INDEX) @@ -97,7 +97,7 @@ class ObPurgeIndexStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(purge_index_arg)); - private: +private: obrpc::ObPurgeIndexArg purge_index_arg_; DISALLOW_COPY_AND_ASSIGN(ObPurgeIndexStmt); }; @@ -122,7 +122,7 @@ inline void ObPurgeIndexStmt::set_table_name(const common::ObString& table_name) */ class ObPurgeDatabaseStmt : public ObDDLStmt { - public: +public: ObPurgeDatabaseStmt() : ObDDLStmt(stmt::T_PURGE_DATABASE) {} explicit ObPurgeDatabaseStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_PURGE_DATABASE) @@ -145,7 +145,7 @@ class ObPurgeDatabaseStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(purge_db_arg)); - private: +private: obrpc::ObPurgeDatabaseArg purge_db_arg_; DISALLOW_COPY_AND_ASSIGN(ObPurgeDatabaseStmt); }; @@ -165,7 +165,7 @@ inline void ObPurgeDatabaseStmt::set_db_name(const common::ObString& db_name) */ class ObPurgeTenantStmt : public ObDDLStmt { - public: +public: ObPurgeTenantStmt() : ObDDLStmt(stmt::T_PURGE_TENANT) {} explicit ObPurgeTenantStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_PURGE_TENANT) @@ -188,7 +188,7 @@ class ObPurgeTenantStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(purge_tenant_arg)); - private: +private: obrpc::ObPurgeTenantArg purge_tenant_arg_; DISALLOW_COPY_AND_ASSIGN(ObPurgeTenantStmt); }; @@ -207,7 +207,7 @@ inline void ObPurgeTenantStmt::set_tenant_name(const common::ObString& tenant_na * purge recyclebin */ class ObPurgeRecycleBinStmt : public ObDDLStmt { - public: +public: ObPurgeRecycleBinStmt() : ObDDLStmt(stmt::T_PURGE_RECYCLEBIN) {} explicit ObPurgeRecycleBinStmt(common::ObIAllocator* name_pool) : ObDDLStmt(name_pool, stmt::T_PURGE_RECYCLEBIN) @@ -240,7 +240,7 @@ class ObPurgeRecycleBinStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(purge_recyclebin_arg)); - private: +private: obrpc::ObPurgeRecycleBinArg purge_recyclebin_arg_; DISALLOW_COPY_AND_ASSIGN(ObPurgeRecycleBinStmt); }; diff --git a/src/sql/resolver/ddl/ob_rename_table_resolver.h b/src/sql/resolver/ddl/ob_rename_table_resolver.h index 6b03c68bc..63cba04c0 100644 --- a/src/sql/resolver/ddl/ob_rename_table_resolver.h +++ b/src/sql/resolver/ddl/ob_rename_table_resolver.h @@ -24,7 +24,7 @@ class ObRenameTableResolver : public ObDDLResolver { static const int64_t NEW_NAME_NODE = 1; static const int64_t NAME_NODE_COUNT = 2; - public: +public: explicit ObRenameTableResolver(ObResolverParams& params); virtual ~ObRenameTableResolver(); virtual int resolve(const ParseNode& parse_tree); @@ -33,7 +33,7 @@ class ObRenameTableResolver : public ObDDLResolver { return static_cast(stmt_); }; - private: +private: int resolve_rename_action(const ParseNode& rename_action_node); DISALLOW_COPY_AND_ASSIGN(ObRenameTableResolver); }; diff --git a/src/sql/resolver/ddl/ob_rename_table_stmt.h b/src/sql/resolver/ddl/ob_rename_table_stmt.h index 24f7a043e..8a291d156 100644 --- a/src/sql/resolver/ddl/ob_rename_table_stmt.h +++ b/src/sql/resolver/ddl/ob_rename_table_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObRenameTableStmt : public ObDDLStmt { - public: +public: explicit ObRenameTableStmt(common::ObIAllocator* name_pool); ObRenameTableStmt(); virtual ~ObRenameTableStmt(); @@ -45,7 +45,7 @@ class ObRenameTableStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(rename_table_arg)); - private: +private: obrpc::ObRenameTableArg rename_table_arg_; DISALLOW_COPY_AND_ASSIGN(ObRenameTableStmt); }; diff --git a/src/sql/resolver/ddl/ob_sequence_resolver.h b/src/sql/resolver/ddl/ob_sequence_resolver.h index 876e97caf..e39287d4b 100644 --- a/src/sql/resolver/ddl/ob_sequence_resolver.h +++ b/src/sql/resolver/ddl/ob_sequence_resolver.h @@ -25,19 +25,19 @@ namespace sql { template class ObSequenceResolver { - public: +public: ObSequenceResolver() {} ~ObSequenceResolver() = default; - public: +public: int resolve_sequence_options(T* stmt, ParseNode* node); - private: +private: int resolve_sequence_option(T* stmt, ParseNode* node); int get_normalized_number(ParseNode& node, common::ObIAllocator& allocator, common::number::ObNumber& num); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSequenceResolver); }; diff --git a/src/sql/resolver/ddl/ob_sequence_stmt.h b/src/sql/resolver/ddl/ob_sequence_stmt.h index 2f9a31681..cd06a06c2 100644 --- a/src/sql/resolver/ddl/ob_sequence_stmt.h +++ b/src/sql/resolver/ddl/ob_sequence_stmt.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace sql { class ObSequenceDDLStmt : public ObDDLStmt { - public: +public: explicit ObSequenceDDLStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObDDLStmt(name_pool, type), arg_() { arg_.set_stmt_type(type); @@ -68,13 +68,13 @@ class ObSequenceDDLStmt : public ObDDLStmt { return arg_; } - private: +private: obrpc::ObSequenceDDLArg arg_; DISALLOW_COPY_AND_ASSIGN(ObSequenceDDLStmt); }; class ObCreateSequenceStmt : public ObSequenceDDLStmt { - public: +public: explicit ObCreateSequenceStmt(common::ObIAllocator* name_pool) : ObSequenceDDLStmt(name_pool, stmt::T_CREATE_SEQUENCE) {} ObCreateSequenceStmt() : ObSequenceDDLStmt(stmt::T_CREATE_SEQUENCE) @@ -83,7 +83,7 @@ class ObCreateSequenceStmt : public ObSequenceDDLStmt { }; class ObAlterSequenceStmt : public ObSequenceDDLStmt { - public: +public: explicit ObAlterSequenceStmt(common::ObIAllocator* name_pool) : ObSequenceDDLStmt(name_pool, stmt::T_ALTER_SEQUENCE) {} ObAlterSequenceStmt() : ObSequenceDDLStmt(stmt::T_ALTER_SEQUENCE) @@ -92,7 +92,7 @@ class ObAlterSequenceStmt : public ObSequenceDDLStmt { }; class ObDropSequenceStmt : public ObSequenceDDLStmt { - public: +public: explicit ObDropSequenceStmt(common::ObIAllocator* name_pool) : ObSequenceDDLStmt(name_pool, stmt::T_DROP_SEQUENCE) {} ObDropSequenceStmt() : ObSequenceDDLStmt(stmt::T_DROP_SEQUENCE) diff --git a/src/sql/resolver/ddl/ob_set_comment_resolver.h b/src/sql/resolver/ddl/ob_set_comment_resolver.h index 064e6ff7e..4f64e54d0 100644 --- a/src/sql/resolver/ddl/ob_set_comment_resolver.h +++ b/src/sql/resolver/ddl/ob_set_comment_resolver.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObSetCommentResolver : public ObDDLResolver { - public: +public: explicit ObSetCommentResolver(ObResolverParams& params); virtual ~ObSetCommentResolver(); virtual int resolve(const ParseNode& parse_tree); @@ -28,7 +28,7 @@ class ObSetCommentResolver : public ObDDLResolver { return static_cast(stmt_); }; - private: +private: share::schema::ObTableSchema table_schema_; common::ObCollationType collation_type_; common::ObCharsetType charset_type_; diff --git a/src/sql/resolver/ddl/ob_table_stmt.h b/src/sql/resolver/ddl/ob_table_stmt.h index 00855ec42..931bcb487 100644 --- a/src/sql/resolver/ddl/ob_table_stmt.h +++ b/src/sql/resolver/ddl/ob_table_stmt.h @@ -22,7 +22,7 @@ class ObPartitionResolveResult { typedef common::ObSEArray array_t; typedef common::ObSEArray array_array_t; - public: +public: ObPartitionResolveResult() {} ~ObPartitionResolveResult() @@ -50,7 +50,7 @@ class ObPartitionResolveResult { TO_STRING_KV(K_(part_fun_exprs), K_(part_values_exprs), K_(subpart_fun_exprs), K_(template_subpart_values_exprs), K_(individual_subpart_values_exprs)); - private: +private: array_t part_fun_exprs_; // for part fun expr array_t part_values_exprs_; // for part values expr array_t subpart_fun_exprs_; // for subpart fun expr @@ -61,7 +61,7 @@ class ObPartitionResolveResult { class ObTableStmt : public ObPartitionedStmt { const static int OB_DEFAULT_ARRAY_SIZE = 16; - public: +public: ObTableStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObPartitionedStmt(name_pool, type), part_type_(share::schema::PARTITION_FUNC_TYPE_MAX) {} @@ -81,11 +81,11 @@ class ObTableStmt : public ObPartitionedStmt { } TO_STRING_KV(K_(part_type)); - private: +private: common::ObSArray index_partition_resolve_results_; share::schema::ObPartitionFuncType part_type_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableStmt); }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_tablegroup_resolver.h b/src/sql/resolver/ddl/ob_tablegroup_resolver.h index dde2da97d..20f5a9a26 100644 --- a/src/sql/resolver/ddl/ob_tablegroup_resolver.h +++ b/src/sql/resolver/ddl/ob_tablegroup_resolver.h @@ -37,7 +37,7 @@ class ObTableGroupResolver : public ObDDLResolver { enum RangeElementsNode { PARTITION_NAME_NODE = 0, PARTITION_ELEMENT_NODE = 1, PART_ID_NODE = 2 }; enum HashOrKeyNode { HASH_FUN_EXPR_NODE = 0, HASH_PARTITION_NUM_NODE = 1, HASH_SUBPARTITIOPPN_NODE = 2 }; - public: +public: ObTableGroupResolver(ObResolverParams& params) : ObDDLResolver(params), alter_option_bitset_() {} ~ObTableGroupResolver() @@ -51,7 +51,7 @@ class ObTableGroupResolver : public ObDDLResolver { return alter_option_bitset_; } - private: +private: int resolve_partition_hash_or_key(ObTablegroupStmt* stmt, ParseNode* node, const bool is_subpartition, share::schema::ObTablegroupSchema& tablegroup_schema); int resolve_partition_range(ObTablegroupStmt* tablegroup_stmt, ParseNode* node, const bool is_subpartition, @@ -63,7 +63,7 @@ class ObTableGroupResolver : public ObDDLResolver { int resolve_partition_list(ObTablegroupStmt* tablegroup_stmt, ParseNode* node, const bool is_subpartition, share::schema::ObTablegroupSchema& tablegroup_schema, PartitionInfo& part_info); - private: +private: common::ObBitSet<> alter_option_bitset_; }; diff --git a/src/sql/resolver/ddl/ob_tablegroup_stmt.h b/src/sql/resolver/ddl/ob_tablegroup_stmt.h index 680be510a..ba7328704 100644 --- a/src/sql/resolver/ddl/ob_tablegroup_stmt.h +++ b/src/sql/resolver/ddl/ob_tablegroup_stmt.h @@ -19,7 +19,7 @@ namespace sql { class ObTablegroupStmt : public ObPartitionedStmt { const static int OB_DEFAULT_ARRAY_SIZE = 16; - public: +public: ObTablegroupStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObPartitionedStmt(name_pool, type), part_func_expr_num_(OB_INVALID_INDEX), @@ -56,11 +56,11 @@ class ObTablegroupStmt : public ObPartitionedStmt { sub_part_func_expr_num_ = expr_num; } - private: +private: int64_t part_func_expr_num_; int64_t sub_part_func_expr_num_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTablegroupStmt); }; } // namespace sql diff --git a/src/sql/resolver/ddl/ob_tenant_resolver.h b/src/sql/resolver/ddl/ob_tenant_resolver.h index a8ed603c9..a315480be 100644 --- a/src/sql/resolver/ddl/ob_tenant_resolver.h +++ b/src/sql/resolver/ddl/ob_tenant_resolver.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace sql { template class ObTenantResolver { - public: +public: ObTenantResolver() : charset_type_(common::CHARSET_INVALID), collation_type_(common::CS_TYPE_INVALID), @@ -35,7 +35,7 @@ class ObTenantResolver { ~ObTenantResolver() {} - public: +public: int resolve_tenant_options(T* stmt, ParseNode* node, ObSQLSessionInfo* session_info, common::ObIAllocator& allocator); const common::ObBitSet<>& get_alter_option_bitset() const { @@ -46,12 +46,12 @@ class ObTenantResolver { return modify_read_only_; } - private: +private: int resolve_tenant_option(T* stmt, ParseNode* node, ObSQLSessionInfo* session_info, common::ObIAllocator& allocator); int resolve_zone_list(T* stmt, ParseNode* node) const; int resolve_resource_pool_list(T* stmt, ParseNode* node) const; - private: +private: common::ObCharsetType charset_type_; common::ObCollationType collation_type_; common::ObBitSet<> alter_option_bitset_; diff --git a/src/sql/resolver/ddl/ob_truncate_table_resolver.h b/src/sql/resolver/ddl/ob_truncate_table_resolver.h index 8f0eb721c..a1961d345 100644 --- a/src/sql/resolver/ddl/ob_truncate_table_resolver.h +++ b/src/sql/resolver/ddl/ob_truncate_table_resolver.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObTruncateTableResolver : public ObDDLResolver { - public: +public: explicit ObTruncateTableResolver(ObResolverParams& params); virtual ~ObTruncateTableResolver(); virtual int resolve(const ParseNode& parse_tree); @@ -29,7 +29,7 @@ class ObTruncateTableResolver : public ObDDLResolver { return static_cast(stmt_); }; - private: +private: static const int64_t TABLE_NODE = 0; /* 0. table_node */ DISALLOW_COPY_AND_ASSIGN(ObTruncateTableResolver); }; diff --git a/src/sql/resolver/ddl/ob_truncate_table_stmt.h b/src/sql/resolver/ddl/ob_truncate_table_stmt.h index 3425c3f15..709d21f01 100644 --- a/src/sql/resolver/ddl/ob_truncate_table_stmt.h +++ b/src/sql/resolver/ddl/ob_truncate_table_stmt.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObTruncateTableStmt : public ObDDLStmt { - public: +public: explicit ObTruncateTableStmt(common::ObIAllocator* name_pool); ObTruncateTableStmt(); virtual ~ObTruncateTableStmt(); @@ -56,7 +56,7 @@ class ObTruncateTableStmt : public ObDDLStmt { } TO_STRING_KV(K_(stmt_type), K_(truncate_table_arg)); - private: +private: obrpc::ObTruncateTableArg truncate_table_arg_; DISALLOW_COPY_AND_ASSIGN(ObTruncateTableStmt); }; diff --git a/src/sql/resolver/ddl/ob_use_database_resolver.h b/src/sql/resolver/ddl/ob_use_database_resolver.h index cdac94874..ae348c812 100644 --- a/src/sql/resolver/ddl/ob_use_database_resolver.h +++ b/src/sql/resolver/ddl/ob_use_database_resolver.h @@ -17,12 +17,12 @@ namespace oceanbase { namespace sql { class ObUseDatabaseResolver : public ObDDLResolver { - public: +public: explicit ObUseDatabaseResolver(ObResolverParams& params); virtual ~ObUseDatabaseResolver(); virtual int resolve(const ParseNode& parse_tree); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObUseDatabaseResolver); }; diff --git a/src/sql/resolver/ddl/ob_use_database_stmt.h b/src/sql/resolver/ddl/ob_use_database_stmt.h index db3f96790..9041a0896 100644 --- a/src/sql/resolver/ddl/ob_use_database_stmt.h +++ b/src/sql/resolver/ddl/ob_use_database_stmt.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObUseDatabaseStmt : public ObDDLStmt { - public: +public: ObUseDatabaseStmt() : ObDDLStmt(stmt::T_USE_DATABASE), db_id_(common::OB_INVALID), @@ -87,7 +87,7 @@ class ObUseDatabaseStmt : public ObDDLStmt { return use_database_arg_; } - private: +private: int64_t db_id_; common::ObString db_name_; common::ObString db_charset_; diff --git a/src/sql/resolver/dml/ob_aggr_expr_push_up_analyzer.h b/src/sql/resolver/dml/ob_aggr_expr_push_up_analyzer.h index 5264c9f5b..cdf4981e1 100644 --- a/src/sql/resolver/dml/ob_aggr_expr_push_up_analyzer.h +++ b/src/sql/resolver/dml/ob_aggr_expr_push_up_analyzer.h @@ -23,7 +23,7 @@ class ObAggFunRawExpr; class ObSelectResolver; class ObSelectStmt; class ObAggrExprPushUpAnalyzer { - public: +public: ObAggrExprPushUpAnalyzer(ObSelectResolver& cur_resolver) : aggr_columns_checker_(aggr_columns_), level_exprs_checker_(level_exprs_), cur_resolver_(cur_resolver) {} @@ -32,7 +32,7 @@ class ObAggrExprPushUpAnalyzer { int analyze_and_push_up_aggr_expr(ObAggFunRawExpr* aggr_expr, ObAggFunRawExpr*& final_aggr); - private: +private: int analyze_aggr_param_exprs(common::ObIArray& param_exprs, ObExprLevels& aggr_expr_levels); int analyze_aggr_param_expr(ObRawExpr*& param_expr, ObExprLevels& aggr_expr_levels); int analyze_child_stmt(ObSelectStmt* child_stmt, ObExprLevels& aggr_expr_levels); @@ -43,10 +43,10 @@ class ObAggrExprPushUpAnalyzer { int adjust_query_level(int32_t final_aggr_level); int push_up_subquery_in_aggr(ObSelectResolver& final_resolver); - private: +private: static const int64_t AGGR_HASH_BUCKET_SIZE = 64; - private: +private: // table column or alias column in aggregate function common::ObArray aggr_columns_; RelExprChecker aggr_columns_checker_; diff --git a/src/sql/resolver/dml/ob_column_namespace_checker.h b/src/sql/resolver/dml/ob_column_namespace_checker.h index 0576cab66..be5129691 100644 --- a/src/sql/resolver/dml/ob_column_namespace_checker.h +++ b/src/sql/resolver/dml/ob_column_namespace_checker.h @@ -24,19 +24,19 @@ struct ObQualifiedName; struct JoinedTable; class ObColumnNamespaceChecker { class ObTableItemIterator { - public: + public: explicit ObTableItemIterator(const ObColumnNamespaceChecker& table_container) : next_table_item_idx_(0), table_container_(table_container) {} const TableItem* get_next_table_item(); - private: + private: int64_t next_table_item_idx_; const ObColumnNamespaceChecker& table_container_; }; - public: +public: explicit ObColumnNamespaceChecker(ObResolverParams& resolver_params) : params_(resolver_params), equal_columns_(), cur_joined_table_(NULL), check_unique_(true) {} @@ -85,7 +85,7 @@ class ObColumnNamespaceChecker { int set_equal_columns(const common::ObIArray& columns); void clear_equal_columns(); - private: +private: int find_column_in_single_table(const TableItem& table_item, const ObQualifiedName& q_name, bool& need_check_unique); int find_column_in_joined_table(const JoinedTable& joined_table, const ObQualifiedName& q_name, const TableItem*& found_table, bool& need_check_unique); @@ -95,7 +95,7 @@ class ObColumnNamespaceChecker { int check_column_existence_in_using_clause( const uint64_t table_id, const common::ObString& column_name, const TableItem& table_item, bool& exist); - private: +private: ObResolverParams& params_; // record the table root reference by query // single(contain basic table, alias table or generated table) table is itself diff --git a/src/sql/resolver/dml/ob_default_value_utils.h b/src/sql/resolver/dml/ob_default_value_utils.h index 1083384af..dbefb8821 100644 --- a/src/sql/resolver/dml/ob_default_value_utils.h +++ b/src/sql/resolver/dml/ob_default_value_utils.h @@ -28,7 +28,7 @@ enum ObDMLDefaultOp { }; class ObDMLResolver; class ObDefaultValueUtils { - public: +public: ObDefaultValueUtils(ObDMLStmt* stmt, ObResolverParams* params, ObDMLResolver* resolver) : stmt_(stmt), params_(params), resolver_(resolver) {} @@ -44,7 +44,7 @@ class ObDefaultValueUtils { int build_expr_default_expr(const ColumnItem* column, ObRawExpr*& input_expr, ObRawExpr*& const_expr); int resolve_column_ref_in_insert(const ColumnItem* column, ObRawExpr*& expr); - private: +private: int get_default_type_for_insert(const ColumnItem* column, ObDMLDefaultOp& op); int get_default_type_for_default_function(const ColumnItem* column, ObDMLDefaultOp& op, ObStmtScope scope); @@ -62,7 +62,7 @@ class ObDefaultValueUtils { int build_nullable_expr(const ColumnItem* column, ObRawExpr*& expr); int build_default_expr_for_generated_column(const ColumnItem& column, ObRawExpr*& expr); - private: +private: ObDMLStmt* stmt_; ObResolverParams* params_; ObDMLResolver* resolver_; diff --git a/src/sql/resolver/dml/ob_del_upd_stmt.h b/src/sql/resolver/dml/ob_del_upd_stmt.h index 5c90455b5..e11e6b907 100644 --- a/src/sql/resolver/dml/ob_del_upd_stmt.h +++ b/src/sql/resolver/dml/ob_del_upd_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { struct IndexDMLInfo { - public: +public: IndexDMLInfo() { reset(); @@ -82,10 +82,10 @@ struct IndexDMLInfo { return seed; } - private: +private: int init_column_convert_expr(const ObAssignments& assignments); - public: +public: // // table_id_: the table_id_ of table TableItem. // loc_table_id_: the table_id_ used for table location lookup. @@ -128,7 +128,7 @@ struct IndexDMLInfo { * and for each one we need to provide a series of columns as required in the access layer */ class TableColumns { - public: +public: TableColumns() : table_name_() {} virtual ~TableColumns() @@ -145,7 +145,7 @@ class TableColumns { }; class ObDelUpdStmt : public ObDMLStmt { - public: +public: explicit ObDelUpdStmt(stmt::StmtType type) : ObDMLStmt(type), all_table_columns_(), @@ -266,7 +266,7 @@ class ObDelUpdStmt : public ObDMLStmt { uint64_t get_insert_base_tid(uint64_t table_offset = 0) const; uint64_t get_ref_table_id() const; - protected: +protected: int inner_get_relation_exprs(RelExprCheckerBase& expr_checker); virtual int inner_get_relation_exprs_for_wrapper(RelExprChecker& expr_checker) { @@ -276,7 +276,7 @@ class ObDelUpdStmt : public ObDMLStmt { int replace_table_assign_exprs(const common::ObIArray& other_exprs, const common::ObIArray& new_exprs, ObAssignments& assignments); - protected: +protected: common::ObArray all_table_columns_; common::ObSEArray returning_exprs_; common::ObSEArray returning_into_exprs_; diff --git a/src/sql/resolver/dml/ob_delete_resolver.h b/src/sql/resolver/dml/ob_delete_resolver.h index 908d7bd6d..496f804fd 100644 --- a/src/sql/resolver/dml/ob_delete_resolver.h +++ b/src/sql/resolver/dml/ob_delete_resolver.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObDeleteResolver : public ObDMLResolver { - public: +public: // delete static const int64_t TABLE = 0; /* table_node */ static const int64_t WHERE = 1; /* where */ @@ -27,7 +27,7 @@ class ObDeleteResolver : public ObDMLResolver { static const int64_t HINT = 5; /* hint */ static const int64_t RETURNING = 6; /* returning */ - public: +public: explicit ObDeleteResolver(ObResolverParams& params); virtual ~ObDeleteResolver(); @@ -45,7 +45,7 @@ class ObDeleteResolver : public ObDMLResolver { return static_cast(stmt_); } - private: +private: int add_related_columns_to_stmt(const TableItem& table_item); int add_index_related_column_to_stmt( const TableItem& table_item, common::ObIArray& column_exprs); diff --git a/src/sql/resolver/dml/ob_delete_stmt.h b/src/sql/resolver/dml/ob_delete_stmt.h index 7da553e1d..a01be0eeb 100644 --- a/src/sql/resolver/dml/ob_delete_stmt.h +++ b/src/sql/resolver/dml/ob_delete_stmt.h @@ -40,7 +40,7 @@ namespace sql { * [WHERE where_condition] */ class ObDeleteStmt : public ObDelUpdStmt { - public: +public: ObDeleteStmt(); virtual ~ObDeleteStmt(); int deep_copy_stmt_struct( @@ -48,7 +48,7 @@ class ObDeleteStmt : public ObDelUpdStmt { int assign(const ObDeleteStmt& other); DECLARE_VIRTUAL_TO_STRING; - private: +private: /** * @note These fields are added for the compatiblity of MySQL syntax and are not * supported at the moment. diff --git a/src/sql/resolver/dml/ob_dml_resolver.h b/src/sql/resolver/dml/ob_dml_resolver.h index 76d69292a..0aa252f68 100644 --- a/src/sql/resolver/dml/ob_dml_resolver.h +++ b/src/sql/resolver/dml/ob_dml_resolver.h @@ -47,7 +47,7 @@ struct IndexDMLInfo; class ObDelUpdStmt; class ObDMLResolver : public ObStmtResolver { - public: +public: explicit ObDMLResolver(ObResolverParams& params); virtual ~ObDMLResolver(); friend class ObDefaultValueUtils; @@ -135,7 +135,7 @@ class ObDMLResolver : public ObStmtResolver { virtual int resolve_column_ref_expr(const ObQualifiedName& q_name, ObRawExpr*& real_ref_expr); int resolve_sql_expr(const ParseNode& node, ObRawExpr*& expr, ObArray* input_columns = NULL); - protected: +protected: ObDMLStmt* get_stmt(); int resolve_into_variables(const ParseNode* node, ObIArray& user_vars, ObIArray& pl_vars); int resolve_sequence_object(const ObQualifiedName& q_name, ObRawExpr*& expr); @@ -483,7 +483,7 @@ class ObDMLResolver : public ObStmtResolver { return ObString(); } - private: +private: int add_column_ref_to_set(ObRawExpr*& expr, ObIArray* table_list); int check_table_exist_or_not( uint64_t tenant_id, uint64_t& database_id, common::ObString& table_name, common::ObString& db_name); @@ -531,7 +531,7 @@ class ObDMLResolver : public ObStmtResolver { int resolve_dblink_with_synonym( uint64_t tenant_id, ObString& table_name, ObString& dblink_name, ObString& db_name, uint64_t& dblink_id); - protected: +protected: typedef std::pair GenColumnNamePair; typedef std::pair GenColumnExprPair; ObStmtScope current_scope_; @@ -562,7 +562,7 @@ class ObDMLResolver : public ObStmtResolver { * */ bool with_clause_without_record_; - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObDMLResolver); }; diff --git a/src/sql/resolver/dml/ob_dml_stmt.h b/src/sql/resolver/dml/ob_dml_stmt.h index 03837644f..b04a24876 100644 --- a/src/sql/resolver/dml/ob_dml_stmt.h +++ b/src/sql/resolver/dml/ob_dml_stmt.h @@ -131,10 +131,10 @@ struct TransposeItem { }; struct ObUnpivotInfo { - public: +public: OB_UNIS_VERSION(1); - public: +public: ObUnpivotInfo() : is_include_null_(false), old_column_count_(0), for_column_count_(0), unpivot_column_count_(0) {} ObUnpivotInfo(const bool is_include_null, const int64_t old_column_count, const int64_t for_column_count, @@ -482,7 +482,7 @@ struct JoinedTable : public TableItem { }; class SemiInfo { - public: +public: SemiInfo(ObJoinType join_type = LEFT_SEMI_JOIN) : join_type_(join_type), semi_id_(common::OB_INVALID_ID), @@ -595,7 +595,7 @@ enum EQUAL_SET_SCOPE { SCOPE_WHERE = 1 << 0, SCOPE_HAVING = 1 << 1, SCOPE_MAX = /// In fact, ObStmt is ObDMLStmt. class ObDMLStmt : public ObStmt { - public: +public: struct PartExprArray { PartExprArray() : table_id_(common::OB_INVALID_ID), index_tid_(common::OB_INVALID_ID) {} @@ -634,7 +634,7 @@ class ObDMLStmt : public ObStmt { }; typedef common::ObSEArray ObViewTableIds; - public: +public: explicit ObDMLStmt(stmt::StmtType type); virtual ~ObDMLStmt(); int assign(const ObDMLStmt& other); @@ -1391,7 +1391,7 @@ class ObDMLStmt : public ObStmt { } int reset_statement_id(const ObDMLStmt& other); - protected: +protected: int check_and_convert_hint(const ObSQLSessionInfo& session_info, ObStmtHint& hint); int check_and_convert_index_hint(const ObSQLSessionInfo& session_info, ObStmtHint& hint); int check_and_convert_leading_hint(const ObSQLSessionInfo& session_info, ObStmtHint& hint); @@ -1403,7 +1403,7 @@ class ObDMLStmt : public ObStmt { int check_and_convert_pq_map_hint(const ObSQLSessionInfo& session_info, ObStmtHint& hint); //////////end of functions for sql hint///////////// - protected: +protected: int replace_expr_in_joined_table(JoinedTable& joined_table, ObRawExpr* from, ObRawExpr* to); int create_table_item(TableItem*& table_item); @@ -1413,7 +1413,7 @@ class ObDMLStmt : public ObStmt { return inner_get_relation_exprs(expr_checker); } - protected: +protected: int construct_join_tables(const ObDMLStmt& other); int construct_join_table(const ObDMLStmt& other, const JoinedTable& other_joined_table, JoinedTable& joined_table); int extract_column_expr( @@ -1426,7 +1426,7 @@ class ObDMLStmt : public ObStmt { int replace_expr_for_joined_table(const common::ObIArray& other_exprs, const common::ObIArray& new_exprs, JoinedTable& joined_tables); - protected: +protected: /** * @note * Per MySQL 5.7, the following clauses are common in 'select', 'delete' and 'update' statement: @@ -1493,7 +1493,7 @@ class ObDMLStmt : public ObStmt { common::ObSEArray check_constraint_exprs_; common::ObSEArray user_var_exprs_; - private: +private: bool has_is_table_; bool eliminated_; bool has_temp_table_; diff --git a/src/sql/resolver/dml/ob_group_by_checker.h b/src/sql/resolver/dml/ob_group_by_checker.h index 277328494..a26e93bbb 100644 --- a/src/sql/resolver/dml/ob_group_by_checker.h +++ b/src/sql/resolver/dml/ob_group_by_checker.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObGroupByChecker : public ObRawExprVisitor { - public: +public: ObGroupByChecker(ObIArray* group_by_exprs, ObIArray* rollup_exprs = nullptr, ObIArray* groupby_exprs = nullptr) : ObRawExprVisitor(), @@ -57,7 +57,7 @@ class ObGroupByChecker : public ObRawExprVisitor { return skip_expr_ == &expr; } - private: +private: int64_t level_; ObIArray* group_by_exprs_; ObIArray* rollup_exprs_; @@ -68,7 +68,7 @@ class ObGroupByChecker : public ObRawExprVisitor { ObQueryCtx* query_ctx_; bool has_nested_aggr_; - private: +private: bool is_top_select_stmt() { return 0 == level_; @@ -99,7 +99,7 @@ class ObGroupByChecker : public ObRawExprVisitor { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObGroupByChecker); - public: +public: void set_level(int64_t level) { level_ = level; diff --git a/src/sql/resolver/dml/ob_insert_resolver.h b/src/sql/resolver/dml/ob_insert_resolver.h index cd7e31a29..8431016ad 100644 --- a/src/sql/resolver/dml/ob_insert_resolver.h +++ b/src/sql/resolver/dml/ob_insert_resolver.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObSelectResolver; class ObInsertResolver : public ObDMLResolver { - public: +public: static const int64_t target_relation = 0; /* target relation */ static const int64_t column_list = 1; /* column list */ static const int64_t value_list = 2; /* value list */ @@ -30,7 +30,7 @@ class ObInsertResolver : public ObDMLResolver { static const int64_t insert_ignore = 7; /* opt_ignore */ static const int64_t insert_hint = 8; /* hint */ static const int64_t insert_returning = 9; /* returning */ - public: +public: explicit ObInsertResolver(ObResolverParams& params); virtual ~ObInsertResolver(); @@ -44,7 +44,7 @@ class ObInsertResolver : public ObDMLResolver { return static_cast(stmt_); } - protected: +protected: int add_rowkey_columns_for_insert_up(); int add_relation_columns(); int process_values_function(ObRawExpr*& expr); @@ -128,10 +128,10 @@ class ObInsertResolver : public ObDMLResolver { return is_oracle_tmp_table_array_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObInsertResolver); - private: +private: common::hash::ObPlacementHashSet insert_column_ids_; int64_t row_count_; ObSelectResolver* sub_select_resolver_; diff --git a/src/sql/resolver/dml/ob_insert_stmt.h b/src/sql/resolver/dml/ob_insert_stmt.h index 9704ef93d..938131fc8 100644 --- a/src/sql/resolver/dml/ob_insert_stmt.h +++ b/src/sql/resolver/dml/ob_insert_stmt.h @@ -100,7 +100,7 @@ struct ObInsertTableInfo { }; class ObInsertStmt : public ObDelUpdStmt { - public: +public: ObInsertStmt(); virtual ~ObInsertStmt(); int deep_copy_stmt_struct( @@ -290,7 +290,7 @@ class ObInsertStmt : public ObDelUpdStmt { } DECLARE_VIRTUAL_TO_STRING; - protected: +protected: // Get the root expr of all query-related expressions in // stmt (expression generated by the attributes specified in the query statement) virtual int inner_get_relation_exprs(RelExprCheckerBase& expr_checker); @@ -299,7 +299,7 @@ class ObInsertStmt : public ObDelUpdStmt { int replace_dupkey_exprs(const common::ObIArray& other_exprs, const common::ObIArray& new_exprs, ObDupKeyScanInfo& scan_info); - protected: +protected: bool is_replace_; // replace semantic common::ObSEArray values_desc_; common::ObSEArray value_vectors_; diff --git a/src/sql/resolver/dml/ob_merge_resolver.h b/src/sql/resolver/dml/ob_merge_resolver.h index f193e692e..606a3c058 100644 --- a/src/sql/resolver/dml/ob_merge_resolver.h +++ b/src/sql/resolver/dml/ob_merge_resolver.h @@ -22,7 +22,7 @@ class ObColumnSchemaV2; } // namespace share namespace sql { class ObMergeResolver : public ObInsertResolver { - public: +public: enum MergeNodeField { TARGET_NODE = 0, SOURCE_NODE, @@ -34,16 +34,16 @@ class ObMergeResolver : public ObInsertResolver { }; enum MergeResolveClause { NONE_CLAUSE, MATCH_CLAUSE, INSERT_COLUMN_CLAUSE, INSERT_VALUE_CLAUSE, INSERT_WHEN_CLAUSE }; - public: +public: explicit ObMergeResolver(ObResolverParams& params); virtual ~ObMergeResolver(); virtual int resolve(const ParseNode& parse_tree); - protected: +protected: virtual int add_assignment( ObTablesAssignments& assigns, const TableItem* table_item, const ColumnItem* col_item, ObAssignment& assign); - private: +private: int resolve_target_relation(const ParseNode* target_node); int resolve_source_relation(const ParseNode* source_node); int resolve_match_condition(const ParseNode* condition_node); @@ -76,7 +76,7 @@ class ObMergeResolver : public ObInsertResolver { int check_stmt_validity(); int get_equal_columns(ObIArray& equal_cols); - private: +private: // merge into x using y on (...) update set x.c1 = upd_val insert x.c1 values(ins_val) // update clause and insert clause, each has its own check constraint expression, // The difference is that the column ref expr in the check constraint expression is a different new value diff --git a/src/sql/resolver/dml/ob_merge_stmt.h b/src/sql/resolver/dml/ob_merge_stmt.h index b2f2b3b1c..f9d299804 100644 --- a/src/sql/resolver/dml/ob_merge_stmt.h +++ b/src/sql/resolver/dml/ob_merge_stmt.h @@ -21,7 +21,7 @@ namespace sql { class ObMergeStmt : public ObInsertStmt { typedef common::ObSEArray RawExprArray; - public: +public: ObMergeStmt(); int deep_copy_stmt_struct( ObStmtFactory& stmt_factory, ObRawExprFactory& expr_factory, const ObDMLStmt& other) override; @@ -104,10 +104,10 @@ class ObMergeStmt : public ObInsertStmt { const common::ObIArray& other_exprs, const common::ObIArray& new_exprs) override; DECLARE_VIRTUAL_TO_STRING; - protected: +protected: virtual int inner_get_relation_exprs(RelExprCheckerBase& expr_checker); - private: +private: uint64_t source_table_id_; uint64_t target_table_id_; RawExprArray match_condition_exprs_; diff --git a/src/sql/resolver/dml/ob_multi_table_insert_resolver.h b/src/sql/resolver/dml/ob_multi_table_insert_resolver.h index ebdfa84e8..1d5dc1afd 100644 --- a/src/sql/resolver/dml/ob_multi_table_insert_resolver.h +++ b/src/sql/resolver/dml/ob_multi_table_insert_resolver.h @@ -35,7 +35,7 @@ namespace sql { * subquery */ class InsertValueNode { - public: +public: InsertValueNode() : table_idx_(-1), insert_value_node_(NULL) {} ~InsertValueNode() @@ -46,7 +46,7 @@ class InsertValueNode { }; class InsertConditionNode { - public: +public: InsertConditionNode() : table_cnt_(0), insert_cond_node_(NULL) {} ~InsertConditionNode() @@ -57,16 +57,16 @@ class InsertConditionNode { }; class ObMultiTableInsertResolver : public ObInsertResolver { - public: +public: explicit ObMultiTableInsertResolver(ObResolverParams& params); virtual ~ObMultiTableInsertResolver(); virtual int resolve(const ParseNode& parse_tree); - protected: +protected: virtual int mock_values_column_ref(const ObColumnRefRawExpr* column_ref); virtual int find_value_desc(uint64_t column_id, ObRawExpr*& column_ref, uint64_t index = 0); - private: +private: int resolve_multi_table_insert(const ParseNode& node); int resolve_multi_insert_subquey(const ParseNode& subquery_node); int resolve_multi_insert_clause(const ParseNode& insert_list_node, diff --git a/src/sql/resolver/dml/ob_raw_expr_sets.h b/src/sql/resolver/dml/ob_raw_expr_sets.h index b107531e4..fc1ee9f0d 100644 --- a/src/sql/resolver/dml/ob_raw_expr_sets.h +++ b/src/sql/resolver/dml/ob_raw_expr_sets.h @@ -28,7 +28,7 @@ typedef common::ObFixedArray ObRawExprSet; typedef common::ObSEArray ObRawExprSets; class ObRawExprSetUtils { - public: +public: static int to_expr_set( common::ObIAllocator* allocator, const common::ObIArray& exprs, ObRawExprSet& expr_set); diff --git a/src/sql/resolver/dml/ob_select_resolver.h b/src/sql/resolver/dml/ob_select_resolver.h index 7b6314429..e081548c6 100644 --- a/src/sql/resolver/dml/ob_select_resolver.h +++ b/src/sql/resolver/dml/ob_select_resolver.h @@ -26,7 +26,7 @@ namespace sql { // dml resolver structure to the subquery parsing function // Avoid seeing too many attributes during the call, reducing coupling class ObChildStmtResolver { - public: +public: ObChildStmtResolver() : parent_aggr_level_(-1) {} virtual int resolve_child_stmt(const ParseNode& parse_tree) = 0; @@ -37,7 +37,7 @@ class ObChildStmtResolver { parent_aggr_level_ = parent_aggr_level; } - protected: +protected: // When this level is not -1, it means that the child stmt is a subquery in the aggregate function // Note that at this time, the aggregate function has not been pushed up, this level is not the // final level of the aggregate function @@ -48,7 +48,7 @@ class ObSelectResolver : public ObDMLResolver, public ObChildStmtResolver { class ObCteResolverCtx { friend class ObSelectResolver; - public: + public: ObCteResolverCtx() : left_select_stmt_(NULL), left_select_stmt_parse_node_(NULL), @@ -151,7 +151,7 @@ class ObSelectResolver : public ObDMLResolver, public ObChildStmtResolver { TO_STRING_KV(K_(is_with_clause_resolver), K_(current_cte_table_name), K_(is_recursive_cte), K_(is_cte_subquery), K_(cte_resolve_level), K_(cte_col_names)); - private: + private: ObSelectStmt* left_select_stmt_; const ParseNode* left_select_stmt_parse_node_; const ParseNode* opt_col_alias_parse_node_; @@ -166,7 +166,7 @@ class ObSelectResolver : public ObDMLResolver, public ObChildStmtResolver { bool is_set_all_; }; - public: +public: explicit ObSelectResolver(ObResolverParams& params); virtual ~ObSelectResolver(); @@ -230,7 +230,7 @@ class ObSelectResolver : public ObDMLResolver, public ObChildStmtResolver { // function members TO_STRING_KV(K_(has_calc_found_rows), K_(has_top_limit), K_(in_set_query), K_(in_subquery)); - protected: +protected: int resolve_set_query(const ParseNode& parse_node); int do_resolve_set_query_in_cte(const ParseNode& parse_tree); int do_resolve_set_query(const ParseNode& parse_tree); @@ -383,7 +383,7 @@ class ObSelectResolver : public ObDMLResolver, public ObChildStmtResolver { ObSelectResolver& identify_anchor_resolver, bool& need_swap_child, const ParseNode& parse_tree); int resolve_fetch_clause(const ParseNode* node); - private: +private: int parameterize_fields_name(const ParseNode* project_node, const ObString& org_alias_name, ObString& paramed_name, common::ObIArray& questions_pos, common::ObIArray& params_idx, common::ObBitSet<>& neg_param_idx, bool& is_cp_str_value); @@ -414,7 +414,7 @@ class ObSelectResolver : public ObDMLResolver, public ObChildStmtResolver { int recursive_check_grouping_columns(ObSelectStmt* stmt, ObRawExpr* expr); - protected: +protected: // data members /*these member is only for with clause*/ ObCteResolverCtx cte_ctx_; @@ -435,7 +435,7 @@ class ObSelectResolver : public ObDMLResolver, public ObChildStmtResolver { ObStandardGroupChecker standard_group_checker_; const TransposeItem* transpose_item_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObSelectResolver); }; diff --git a/src/sql/resolver/dml/ob_select_stmt.h b/src/sql/resolver/dml/ob_select_stmt.h index 958dffc00..d5a4f2456 100644 --- a/src/sql/resolver/dml/ob_select_stmt.h +++ b/src/sql/resolver/dml/ob_select_stmt.h @@ -201,7 +201,7 @@ struct ob_vector_traits { namespace sql { class ObSelectStmt : public ObDMLStmt { - public: +public: enum SetOperator { NONE = 0, UNION, @@ -233,7 +233,7 @@ class ObSelectStmt : public ObDMLStmt { } class ObShowStmtCtx { - public: + public: ObShowStmtCtx() : is_from_show_stmt_(false), global_scope_(false), @@ -1007,7 +1007,7 @@ class ObSelectStmt : public ObDMLStmt { return const_cast(static_cast(*this).get_real_stmt()); } - private: +private: int replace_multi_rollup_items_expr(const ObIArray& other_exprs, const ObIArray& new_exprs, ObIArray& multi_rollup_items); int get_relation_exprs_from_multi_rollup_items( @@ -1017,14 +1017,14 @@ class ObSelectStmt : public ObDMLStmt { int has_special_expr_in_multi_rollup_items( const ObIArray& multi_rollup_items, const ObExprInfoFlag flag, bool& has) const; - protected: +protected: virtual int inner_get_relation_exprs(RelExprCheckerBase& expr_checker); virtual int inner_get_relation_exprs_for_wrapper(RelExprChecker& expr_checker) { return inner_get_relation_exprs(expr_checker); } - private: +private: SetOperator set_op_; /* these var is only used for recursive union */ bool is_recursive_cte_; diff --git a/src/sql/resolver/dml/ob_sequence_namespace_checker.h b/src/sql/resolver/dml/ob_sequence_namespace_checker.h index eb34d302d..6157e92db 100644 --- a/src/sql/resolver/dml/ob_sequence_namespace_checker.h +++ b/src/sql/resolver/dml/ob_sequence_namespace_checker.h @@ -24,7 +24,7 @@ class ObSQLSessionInfo; class ObSchemaChecker; struct ObQualifiedName; class ObSequenceNamespaceChecker { - public: +public: explicit ObSequenceNamespaceChecker(ObResolverParams& resolver_params) : params_(resolver_params) {} ~ObSequenceNamespaceChecker(){}; @@ -36,7 +36,7 @@ class ObSequenceNamespaceChecker { return 0 == s.case_compare("nextval") || 0 == s.case_compare("currval"); } - private: +private: int check_sequence_with_synonym_recursively(const uint64_t tenant_id, const uint64_t database_id, const common::ObString& sequence_name, ObSynonymChecker& syn_checker, ObSchemaChecker* schema_checker, bool& exists, uint64_t& sequence_id); diff --git a/src/sql/resolver/dml/ob_sql_hint.h b/src/sql/resolver/dml/ob_sql_hint.h index 64d5a1daa..cf1d627e3 100644 --- a/src/sql/resolver/dml/ob_sql_hint.h +++ b/src/sql/resolver/dml/ob_sql_hint.h @@ -122,7 +122,7 @@ const char* get_plan_cache_policy_str(ObPlanCachePolicy policy); struct ObQueryHint { OB_UNIS_VERSION(1); - public: +public: ObQueryHint() : read_consistency_(common::INVALID_CONSISTENCY), dummy_(), @@ -737,7 +737,7 @@ struct ObStmtHint { common::ObSEArray valid_no_px_join_filter_idxs_; ObRelIds valid_pq_maps_idxs_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStmtHint); }; diff --git a/src/sql/resolver/dml/ob_standard_group_checker.h b/src/sql/resolver/dml/ob_standard_group_checker.h index 64cdcd6e3..4b4fa6ef2 100644 --- a/src/sql/resolver/dml/ob_standard_group_checker.h +++ b/src/sql/resolver/dml/ob_standard_group_checker.h @@ -29,7 +29,7 @@ class ObStandardGroupChecker { int64_t dependent_column_cnt_; }; - public: +public: ObStandardGroupChecker() : has_group_(false) {} ~ObStandardGroupChecker() @@ -48,11 +48,11 @@ class ObStandardGroupChecker { int add_unsettled_expr(const ObRawExpr* expr); int check_only_full_group_by(); - private: +private: int check_unsettled_expr(const ObRawExpr* unsettled_expr, const ObColumnRefRawExpr& undefined_column); int check_unsettled_column(const ObRawExpr* unsettled_column, const ObColumnRefRawExpr*& undefined_column); - private: +private: static const int64_t SETTLED_COLUMN_BUCKETS = 64; bool has_group_; // all unsettled exprs that needed be check whether meet the only full group by semantic constraints in current stmt diff --git a/src/sql/resolver/dml/ob_update_resolver.h b/src/sql/resolver/dml/ob_update_resolver.h index 42765da3f..b760303e6 100644 --- a/src/sql/resolver/dml/ob_update_resolver.h +++ b/src/sql/resolver/dml/ob_update_resolver.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObUpdateResolver : public ObDMLResolver { - public: +public: static const int64_t TABLE = 0; /* 0. table node */ static const int64_t UPDATE_LIST = 1; /* 1. update list */ static const int64_t WHERE = 2; /* 2. where node */ @@ -30,7 +30,7 @@ class ObUpdateResolver : public ObDMLResolver { static const int64_t HINT = 6; /* 6. hint node */ static const int64_t IGNORE = 7; /*7. ignore node */ static const int64_t RETURNING = 8; /*8. returning node */ - public: +public: explicit ObUpdateResolver(ObResolverParams& params); virtual ~ObUpdateResolver(); @@ -40,7 +40,7 @@ class ObUpdateResolver : public ObDMLResolver { return static_cast(stmt_); } - protected: +protected: /** * For update stmt, we need to add the table to the from_item in order to reuse * the same cost model to generate the access path like in the 'select' stmt case. @@ -48,7 +48,7 @@ class ObUpdateResolver : public ObDMLResolver { */ virtual int resolve_table_list(const ParseNode& parse_tree); - private: +private: int add_related_columns_to_stmt(); int resolve_cascade_updated_global_index( const ObTableAssignment& ta, common::ObIArray& cascade_global_index); @@ -68,7 +68,7 @@ class ObUpdateResolver : public ObDMLResolver { int is_multi_table_update(const ObDMLStmt* stmt, bool& is_multi_table); int check_safe_update_mode(ObUpdateStmt* update_stmt); - private: +private: bool has_add_all_rowkey_; bool has_add_all_columns_; common::hash::ObPlacementHashSet update_column_ids_; diff --git a/src/sql/resolver/dml/ob_update_stmt.h b/src/sql/resolver/dml/ob_update_stmt.h index e773ef7ca..38658156e 100644 --- a/src/sql/resolver/dml/ob_update_stmt.h +++ b/src/sql/resolver/dml/ob_update_stmt.h @@ -34,7 +34,7 @@ namespace sql { * [WHERE where_condition] */ class ObUpdateStmt : public ObDelUpdStmt { - public: +public: ObUpdateStmt(); virtual ~ObUpdateStmt(); int deep_copy_stmt_struct( @@ -84,7 +84,7 @@ class ObUpdateStmt : public ObDelUpdStmt { condition_exprs_, N_ORDER_BY, order_items_, N_LIMIT, limit_count_expr_, N_OFFSET, limit_offset_expr_, N_QUERY_HINT, stmt_hint_, N_QUERY_CTX, query_ctx_); - protected: +protected: // Get the root expr of all query-related expressions in stmt //(expression generated by the attributes specified in the query statement) virtual int inner_get_relation_exprs(RelExprCheckerBase& expr_checker); @@ -94,7 +94,7 @@ class ObUpdateStmt : public ObDelUpdStmt { return inner_get_relation_exprs(expr_checker); } - private: +private: ObTablesAssignments tables_assignments_; /** * @note These fields are added for the compatiblity of MySQL syntax and are not diff --git a/src/sql/resolver/dml/ob_view_table_resolver.h b/src/sql/resolver/dml/ob_view_table_resolver.h index 56745fec1..4c9f6d4b6 100644 --- a/src/sql/resolver/dml/ob_view_table_resolver.h +++ b/src/sql/resolver/dml/ob_view_table_resolver.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObViewTableResolver : public ObSelectResolver { - public: +public: ObViewTableResolver(ObResolverParams& params, const ObString& view_db_name, const ObString& view_name) : ObSelectResolver(params), parent_view_resolver_(NULL), @@ -62,7 +62,7 @@ class ObViewTableResolver : public ObSelectResolver { return auto_name_id_; } - protected: +protected: virtual int do_resolve_set_query( const ParseNode& parse_tree, ObSelectStmt*& child_stmt, const bool is_left_child = false); virtual int expand_view(TableItem& view_item); @@ -79,7 +79,7 @@ class ObViewTableResolver : public ObSelectResolver { return view_name_; } - protected: +protected: // current_view_item: current namespace expanded from which user created view TableItem current_view_item; ObViewTableResolver* parent_view_resolver_; diff --git a/src/sql/resolver/expr/ob_case_op_expr.h b/src/sql/resolver/expr/ob_case_op_expr.h index 103ec5361..3c3cda444 100644 --- a/src/sql/resolver/expr/ob_case_op_expr.h +++ b/src/sql/resolver/expr/ob_case_op_expr.h @@ -20,7 +20,7 @@ namespace jit { namespace expr { class ObCaseOpExpr : virtual public ObExpr { - public: +public: ObCaseOpExpr() { set_expr_class(EXPR_CASE_OPERATOR); diff --git a/src/sql/resolver/expr/ob_column_index_provider.h b/src/sql/resolver/expr/ob_column_index_provider.h index 70f6c6ec1..2c548c62d 100644 --- a/src/sql/resolver/expr/ob_column_index_provider.h +++ b/src/sql/resolver/expr/ob_column_index_provider.h @@ -20,7 +20,7 @@ namespace jit { namespace expr { class ObColumnIndexProvider { - public: +public: ObColumnIndexProvider() {} /** @@ -33,7 +33,7 @@ class ObColumnIndexProvider { */ virtual int get_idx(const ObExpr* raw_expr, int64_t& index) const = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObColumnIndexProvider); }; diff --git a/src/sql/resolver/expr/ob_column_ref_expr.h b/src/sql/resolver/expr/ob_column_ref_expr.h index b081fcb38..2ac34bb42 100644 --- a/src/sql/resolver/expr/ob_column_ref_expr.h +++ b/src/sql/resolver/expr/ob_column_ref_expr.h @@ -20,7 +20,7 @@ namespace jit { namespace expr { class ObColumnRefExpr : virtual public ObExpr { - public: +public: ObColumnRefExpr(ObItemType expr_type = T_INVALID) : ObExpr(expr_type) { set_expr_class(EXPR_COLUMN_REF); diff --git a/src/sql/resolver/expr/ob_const_expr.h b/src/sql/resolver/expr/ob_const_expr.h index a7ae840e2..12e921922 100644 --- a/src/sql/resolver/expr/ob_const_expr.h +++ b/src/sql/resolver/expr/ob_const_expr.h @@ -23,7 +23,7 @@ namespace expr { // OceanBase constant expression. class ObConstExpr : virtual public ObExpr { - public: +public: ObConstExpr() { set_expr_class(EXPR_CONST); @@ -34,7 +34,7 @@ class ObConstExpr : virtual public ObExpr { common::ObObj& get_value(); const common::ObObj& get_value() const; - protected: +protected: common::ObObj value_; }; diff --git a/src/sql/resolver/expr/ob_expr.h b/src/sql/resolver/expr/ob_expr.h index 785850cb8..67dc6a29c 100644 --- a/src/sql/resolver/expr/ob_expr.h +++ b/src/sql/resolver/expr/ob_expr.h @@ -27,7 +27,7 @@ class ObExpr; typedef ::oceanbase::common::ObSEArray ExprArray; // The interface of OceanBase raw expression structure. class ObExpr { - public: +public: enum ExprClass { EXPR_INVALID_CLASS = 0, EXPR_CONST, @@ -167,7 +167,7 @@ class ObExpr { TO_STRING_KV(K_(type), K_(expr_class)); - protected: +protected: ObItemType type_; ExprClass expr_class_; sql::ObExprResType result_type_; diff --git a/src/sql/resolver/expr/ob_expr_relation_analyzer.h b/src/sql/resolver/expr/ob_expr_relation_analyzer.h index 4a128b3b8..396e9c29b 100644 --- a/src/sql/resolver/expr/ob_expr_relation_analyzer.h +++ b/src/sql/resolver/expr/ob_expr_relation_analyzer.h @@ -20,16 +20,16 @@ class ObRawExpr; class ObDMLStmt; class ObQueryRefRawExpr; class ObExprRelationAnalyzer { - public: +public: explicit ObExprRelationAnalyzer(); int pull_expr_relation_id_and_levels(ObRawExpr* expr, int32_t cur_stmt_level); - private: +private: int init_expr_info(ObRawExpr& expr); int visit_expr(ObRawExpr& expr, int32_t stmt_level); int visit_stmt(ObDMLStmt* stmt); - private: +private: // auto_free = false, only used in function stack common::ObSEArray query_exprs_; }; diff --git a/src/sql/resolver/expr/ob_expr_visitor.h b/src/sql/resolver/expr/ob_expr_visitor.h index 323672d96..a0c015b6b 100644 --- a/src/sql/resolver/expr/ob_expr_visitor.h +++ b/src/sql/resolver/expr/ob_expr_visitor.h @@ -25,7 +25,7 @@ class ObCaseOpExpr; class ObColumnRefExpr; class ObExprVisitor { - public: +public: virtual int visit(const ObExpr& expr) = 0; virtual int visit(const ObConstExpr& expr) = 0; virtual int visit(const ObVarExpr& expr) = 0; @@ -33,7 +33,7 @@ class ObExprVisitor { virtual int visit(const ObColumnRefExpr& expr) = 0; virtual int visit(const ObCaseOpExpr& expr) = 0; - protected: +protected: bool skip_; }; diff --git a/src/sql/resolver/expr/ob_op_expr.h b/src/sql/resolver/expr/ob_op_expr.h index 65f1f7fb2..049380ce8 100644 --- a/src/sql/resolver/expr/ob_op_expr.h +++ b/src/sql/resolver/expr/ob_op_expr.h @@ -20,7 +20,7 @@ namespace jit { namespace expr { class ObOpExpr : virtual public ObExpr { - public: +public: ObOpExpr() { set_expr_class(EXPR_OPERATOR); @@ -40,7 +40,7 @@ class ObOpExpr : virtual public ObExpr { return common::OB_NOT_SUPPORTED; }; - private: +private: }; } // namespace expr diff --git a/src/sql/resolver/expr/ob_raw_expr.h b/src/sql/resolver/expr/ob_raw_expr.h index 30bb776f8..b6f915652 100644 --- a/src/sql/resolver/expr/ob_raw_expr.h +++ b/src/sql/resolver/expr/ob_raw_expr.h @@ -57,7 +57,7 @@ extern ObRawExpr* USELESS_POINTER; const static int64_t DEFAULT_SQL_BITSET_SIZE = 32; template class ObSqlBitSet { - public: +public: typedef uint32_t BitSetWord; ObSqlBitSet() : block_allocator_(NULL), bit_set_word_array_(NULL), desc_() @@ -663,7 +663,7 @@ class ObSqlBitSet { return *this; } - private: +private: int alloc_new_buf(int64_t word_cnt) { int ret = OB_SUCCESS; @@ -720,7 +720,7 @@ class ObSqlBitSet { return ret; } - private: +private: static const int64_t PER_BITSETWORD_BITS = 32; static const int64_t PER_BITSETWORD_MOD_BITS = 5; static const int64_t PER_BITSETWORD_MASK = PER_BITSETWORD_BITS - 1; @@ -735,7 +735,7 @@ class ObSqlBitSet { {} }; - private: +private: ObIAllocator* block_allocator_; BitSetWord* bit_set_word_array_; SqlBitSetDesc desc_; @@ -762,7 +762,7 @@ enum AccessNameType { class ObRawExpr; class ObSysFunRawExpr; class ObObjAccessIdent { - public: +public: ObObjAccessIdent() : type_(UNKNOWN), access_name_(), access_index_(common::OB_INVALID_INDEX), sys_func_expr_(NULL), params_() {} @@ -786,7 +786,7 @@ class ObObjAccessIdent { return *this; } - public: +public: inline void set_type(AccessNameType type) { type_ = type; @@ -863,7 +863,7 @@ class ObObjAccessIdent { class ObColumnRefRawExpr; class ObQualifiedName { - public: +public: ObQualifiedName() : database_name_(), tbl_name_(), @@ -915,7 +915,7 @@ class ObQualifiedName { TO_STRING_KV(N_DATABASE_NAME, database_name_, N_TABLE_NAME, tbl_name_, N_COLUMN, col_name_, K_(is_star), K_(ref_expr), K_(parents_expr_info), K_(parent_aggr_level), K_(access_idents), K_(is_access_root)); - public: +public: common::ObString database_name_; common::ObString tbl_name_; // used for package name for UDF common::ObString col_name_; // used for function name for UDF @@ -959,7 +959,7 @@ struct OrderItem { OrderItem(ObRawExpr* expr, ObOrderDirection order_type) : expr_(expr), order_type_(order_type) {} - public: +public: virtual ~OrderItem() {} void reset() @@ -1107,7 +1107,7 @@ enum ObVarType { struct ObVarInfo final { OB_UNIS_VERSION(1); - public: +public: ObVarInfo() : type_(INVALID_VAR), name_() {} int deep_copy(common::ObIAllocator& allocator, ObVarInfo& var_info) const; @@ -1209,7 +1209,7 @@ class ObRawExprVisitor; struct ObHiddenColumnItem; class ObRawExpr : virtual public jit::expr::ObExpr { - public: +public: friend sql::ObExpr* ObStaticEngineExprCG::get_rt_expr(const ObRawExpr& raw_expr); friend sql::ObExpr* ObExprOperator::get_rt_expr(const ObRawExpr& raw_expr) const; @@ -1487,14 +1487,14 @@ class ObRawExpr : virtual public jit::expr::ObExpr { K_(expr_level), K_(expr_levels), K_(enum_set_values), K_(is_explicited_reference), K_(ref_count), K_(is_for_generated_column), K_(extra), K_(is_calculated)); - public: +public: uint32_t magic_num_; - protected: +protected: static const int64_t COMMON_MULTI_NUM = 16; static const int64_t COMMON_ENUM_SET_VALUE_NUM = 4; - protected: +protected: ObExprInfo info_; // flags ObRelIds rel_ids_; // related table idx // means the raw expr contain which level variables(column, aggregate expr, set expr or subquery expr) @@ -1515,7 +1515,7 @@ class ObRawExpr : virtual public jit::expr::ObExpr { ObRawExpr* orig_expr_; // orig raw expr before pre cast of pre calc. bool is_calculated_; // for code gerenation in static engine. bool is_deterministic_; // expr is deterministic, given the same inputs, returns the same result - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRawExpr); }; @@ -1619,7 +1619,7 @@ inline const ObRelIds& ObRawExpr::get_relation_ids() const //////////////////////////////////////////////////////////////// class ObTerminalRawExpr : public ObRawExpr { - public: +public: explicit ObTerminalRawExpr(ObItemType expr_type = T_INVALID) : ObRawExpr(expr_type) {} explicit ObTerminalRawExpr(common::ObIAllocator& alloc, ObItemType expr_type = T_INVALID) @@ -1645,14 +1645,14 @@ class ObTerminalRawExpr : public ObRawExpr { return seed; } - protected: - private: +protected: +private: DISALLOW_COPY_AND_ASSIGN(ObTerminalRawExpr); }; //////////////////////////////////////////////////////////////// class ObConstRawExpr : public ObTerminalRawExpr, public jit::expr::ObConstExpr { - public: +public: ObConstRawExpr() : is_date_unit_(false) /*: precalc_expr_(NULL)*/ { ObExpr::set_expr_class(ObExpr::EXPR_CONST); @@ -1705,18 +1705,18 @@ class ObConstRawExpr : public ObTerminalRawExpr, public jit::expr::ObConstExpr { int get_name_internal(char* buf, const int64_t buf_len, int64_t& pos, ExplainType type) const; DECLARE_VIRTUAL_TO_STRING; - private: +private: common::ObString literal_prefix_; // used in compile phase. common::ObObjMeta obj_meta_; bool is_date_unit_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObConstRawExpr); }; //////////////////////////////////////////////////////////////// class ObVarRawExpr : public ObTerminalRawExpr, public jit::expr::ObVarExpr { - public: +public: ObVarRawExpr() { ObExpr::set_expr_class(ObExpr::EXPR_VAR); @@ -1754,14 +1754,14 @@ class ObVarRawExpr : public ObTerminalRawExpr, public jit::expr::ObVarExpr { return result_type_assigned_; } - private: +private: bool result_type_assigned_; DISALLOW_COPY_AND_ASSIGN(ObVarRawExpr); }; //////////////////////////////////////////////////////////////// class ObUserVarIdentRawExpr : public ObConstRawExpr { - public: +public: ObUserVarIdentRawExpr() : is_contain_assign_(false), query_has_udf_(false) {} ObUserVarIdentRawExpr(common::ObIAllocator& alloc) @@ -1804,18 +1804,18 @@ class ObUserVarIdentRawExpr : public ObConstRawExpr { bool is_same_variable(const ObObj& obj) const; DECLARE_VIRTUAL_TO_STRING; - private: +private: bool is_contain_assign_; bool query_has_udf_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUserVarIdentRawExpr); }; //////////////////////////////////////////////////////////////// class ObLogicalOperator; class ObQueryRefRawExpr : public ObTerminalRawExpr { - public: +public: ObQueryRefRawExpr() : ObTerminalRawExpr(), ref_id_(common::OB_INVALID_ID), @@ -1934,7 +1934,7 @@ class ObQueryRefRawExpr : public ObTerminalRawExpr { ref_id_, K_(expr_level), K_(expr_levels), K_(output_column), K_(is_set), K_(is_cursor), K_(column_types), K_(enum_set_values)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObQueryRefRawExpr); int64_t ref_id_; union { @@ -1970,7 +1970,7 @@ inline int64_t ObQueryRefRawExpr::get_output_column() const //////////////////////////////////////////////////////////////// class ObColumnRefRawExpr : public ObTerminalRawExpr, public jit::expr::ObColumnRefExpr { - public: +public: ObColumnRefRawExpr() : ObExpr(), ObTerminalRawExpr(), @@ -2210,7 +2210,7 @@ class ObColumnRefRawExpr : public ObTerminalRawExpr, public jit::expr::ObColumnR K_(column_name), K_(expr_level), K_(expr_levels), K_(column_flags), K_(enum_set_values), K_(is_lob_column), K_(is_unpivot_mocked_column), K_(is_hidden)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObColumnRefRawExpr); uint64_t table_id_; uint64_t column_id_; @@ -2260,7 +2260,7 @@ inline uint64_t& ObColumnRefRawExpr::get_column_id() //////////////////////////////////////////////////////////////// class ObSetOpRawExpr : public ObTerminalRawExpr { - public: +public: ObSetOpRawExpr() : ObTerminalRawExpr(), idx_(-1) { set_expr_class(ObExpr::EXPR_SET_OP); @@ -2293,14 +2293,14 @@ class ObSetOpRawExpr : public ObTerminalRawExpr { VIRTUAL_TO_STRING_KV(N_ITEM_TYPE, type_, N_RESULT_TYPE, result_type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_, K_(expr_level), K_(expr_levels), K_(idx)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetOpRawExpr); int64_t idx_; }; //////////////////////////////////////////////////////////////// class ObAliasRefRawExpr : public ObRawExpr { - public: +public: ObAliasRefRawExpr() : ObRawExpr(), ref_expr_(NULL) { set_expr_class(ObExpr::EXPR_ALIAS_REF); @@ -2354,7 +2354,7 @@ class ObAliasRefRawExpr : public ObRawExpr { VIRTUAL_TO_STRING_KV(N_ITEM_TYPE, type_, N_RESULT_TYPE, result_type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_, N_VALUE, ref_expr_, K_(enum_set_values)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAliasRefRawExpr); ObRawExpr* ref_expr_; int64_t project_index_; // project index of the subquery @@ -2362,7 +2362,7 @@ class ObAliasRefRawExpr : public ObRawExpr { //////////////////////////////////////////////////////////////// class ObNonTerminalRawExpr : public ObRawExpr { - public: +public: ObNonTerminalRawExpr() : ObRawExpr(), op_(NULL), input_types_() {} ObNonTerminalRawExpr(common::ObIAllocator& alloc) : ObRawExpr(alloc), op_(NULL), input_types_() @@ -2404,7 +2404,7 @@ class ObNonTerminalRawExpr : public ObRawExpr { return seed; } - protected: +protected: // data members ObExprOperator* op_; ObExprResTypes input_types_; @@ -2413,7 +2413,7 @@ class ObNonTerminalRawExpr : public ObRawExpr { //////////////////////////////////////////////////////////////// class ObOpRawExpr : public ObNonTerminalRawExpr, public jit::expr::ObOpExpr { - public: +public: ObOpRawExpr() : ObExpr(), ObNonTerminalRawExpr(), @@ -2510,13 +2510,13 @@ class ObOpRawExpr : public ObNonTerminalRawExpr, public jit::expr::ObOpExpr { VIRTUAL_TO_STRING_KV(N_ITEM_TYPE, type_, N_RESULT_TYPE, result_type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_, K_(expr_levels), N_CHILDREN, exprs_); - protected: +protected: common::ObSEArray exprs_; ObSubQueryKey subquery_key_; bool deduce_type_adding_implicit_cast_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOpRawExpr); }; @@ -2588,7 +2588,7 @@ inline uint64_t ObOpRawExpr::hash_internal(uint64_t seed) const //////////////////////////////////////////////////////////////// class ObCaseOpRawExpr : public ObNonTerminalRawExpr, public jit::expr::ObCaseOpExpr { - public: +public: ObCaseOpRawExpr() : ObExpr(), ObNonTerminalRawExpr(), @@ -2679,7 +2679,7 @@ class ObCaseOpRawExpr : public ObNonTerminalRawExpr, public jit::expr::ObCaseOpE K_(expr_levels), N_ARG_CASE, arg_expr_, N_DEFAULT, default_expr_, N_WHEN, when_exprs_, N_THEN, then_exprs_, N_DECODE, is_decode_func_); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCaseOpRawExpr); ObRawExpr* arg_expr_; common::ObSEArray when_exprs_; @@ -2823,7 +2823,7 @@ inline uint64_t ObCaseOpRawExpr::hash_internal(uint64_t seed) const //////////////////////////////////////////////////////////////// class ObAggFunRawExpr : public ObRawExpr { - public: +public: ObAggFunRawExpr() : ObRawExpr(), real_param_exprs_(), @@ -2976,7 +2976,7 @@ class ObAggFunRawExpr : public ObRawExpr { K_(expr_level), K_(expr_levels), N_CHILDREN, real_param_exprs_, N_DISTINCT, distinct_, N_ORDER_BY, order_items_, N_SEPARATOR_PARAM_EXPR, separator_param_expr_, K_(udf_meta), N_LINEAR_INTER_EXPR, linear_inter_expr_); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAggFunRawExpr); // real_param_exprs_.count() == 0 means '*' common::ObSEArray real_param_exprs_; @@ -3089,7 +3089,7 @@ inline int ObAggFunRawExpr::add_order_item(const OrderItem& order_item) // for normal system function, func_name_ is used to distinguish them. // for special system function, ObRawExpr::type_ can be reset. Such function may not need name class ObSysFunRawExpr : public ObOpRawExpr { - public: +public: ObSysFunRawExpr(common::ObIAllocator& alloc) : ObOpRawExpr(alloc), func_name_(), operator_id_(common::OB_INVALID_ID) { set_expr_class(ObExpr::EXPR_SYS_FUNC); @@ -3134,7 +3134,7 @@ class ObSysFunRawExpr : public ObOpRawExpr { VIRTUAL_TO_STRING_KV(N_ITEM_TYPE, type_, N_RESULT_TYPE, result_type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_, K_(expr_levels), N_FUNC, func_name_, N_CHILDREN, exprs_, K_(enum_set_values)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSysFunRawExpr); common::ObString func_name_; uint64_t operator_id_; @@ -3150,7 +3150,7 @@ inline const common::ObString& ObSysFunRawExpr::get_func_name() const } class ObSequenceRawExpr : public ObSysFunRawExpr { - public: +public: ObSequenceRawExpr(common::ObIAllocator& alloc) : ObSysFunRawExpr(alloc), name_(), action_(), sequence_id_(0) {} ObSequenceRawExpr() : ObSysFunRawExpr(), name_(), action_(), sequence_id_(0) @@ -3175,14 +3175,14 @@ class ObSequenceRawExpr : public ObSysFunRawExpr { virtual bool same_as(const ObRawExpr& expr, ObExprEqualCheckContext* check_context = NULL) const override; virtual int get_name_internal(char* buf, const int64_t buf_len, int64_t& pos, ExplainType type) const override; - private: +private: common::ObString name_; // sequence object name common::ObString action_; // NEXTVAL or CURRVAL uint64_t sequence_id_; }; class ObNormalDllUdfRawExpr : public ObSysFunRawExpr { - public: +public: ObNormalDllUdfRawExpr(common::ObIAllocator& alloc) : ObSysFunRawExpr(alloc), udf_meta_(), udf_attributes_() {} ObNormalDllUdfRawExpr() : ObSysFunRawExpr(), udf_meta_(), udf_attributes_() @@ -3201,14 +3201,14 @@ class ObNormalDllUdfRawExpr : public ObSysFunRawExpr { } virtual bool same_as(const ObRawExpr& expr, ObExprEqualCheckContext* check_context = NULL) const override; - private: +private: // for udf function info share::schema::ObUDFMeta udf_meta_; common::ObSEArray udf_attributes_; // name of input expr }; class ObPLSQLCodeSQLErrmRawExpr : public ObSysFunRawExpr { - public: +public: ObPLSQLCodeSQLErrmRawExpr(common::ObIAllocator& alloc) : ObSysFunRawExpr(alloc), is_sqlcode_(true) {} ObPLSQLCodeSQLErrmRawExpr() : ObSysFunRawExpr(), is_sqlcode_(true) @@ -3230,15 +3230,15 @@ class ObPLSQLCodeSQLErrmRawExpr : public ObSysFunRawExpr { VIRTUAL_TO_STRING_KV(N_ITEM_TYPE, type_, N_RESULT_TYPE, result_type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_, K_(expr_level), K_(expr_levels), K_(is_sqlcode), N_CHILDREN, exprs_); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPLSQLCodeSQLErrmRawExpr); - private: +private: bool is_sqlcode_; }; class ObObjAccessRawExpr : public ObOpRawExpr { - public: +public: ObObjAccessRawExpr(common::ObIAllocator& alloc) : ObOpRawExpr(alloc), get_attr_func_(0), func_name_(), var_indexs_(), for_write_(false) {} @@ -3280,7 +3280,7 @@ class ObObjAccessRawExpr : public ObOpRawExpr { for_write_ = for_write; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObObjAccessRawExpr); uint64_t get_attr_func_; common::ObString func_name_; @@ -3307,7 +3307,7 @@ enum ObMultiSetModifier { }; class ObMultiSetRawExpr : public ObOpRawExpr { - public: +public: ObMultiSetRawExpr(common::ObIAllocator& alloc) : ObOpRawExpr(alloc), ms_modifier_(ObMultiSetModifier::MULTISET_MODIFIER_INVALID), @@ -3345,14 +3345,14 @@ class ObMultiSetRawExpr : public ObOpRawExpr { ms_type_ = type; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultiSetRawExpr); ObMultiSetModifier ms_modifier_; ObMultiSetType ms_type_; }; class ObCollPredRawExpr : public ObMultiSetRawExpr { - public: +public: ObCollPredRawExpr(common::ObIAllocator& alloc) : ObMultiSetRawExpr(alloc) {} virtual ~ObCollPredRawExpr() @@ -3363,12 +3363,12 @@ class ObCollPredRawExpr : public ObMultiSetRawExpr { bool use_new_allocator = false); virtual bool same_as(const ObRawExpr& expr, ObExprEqualCheckContext* check_context = NULL) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCollPredRawExpr); }; class ObFunMatchAgainst : public ObNonTerminalRawExpr { - public: +public: ObFunMatchAgainst() : ObNonTerminalRawExpr(), mode_flag_(NATURAL_LANGUAGE_MODE), @@ -3464,7 +3464,7 @@ class ObFunMatchAgainst : public ObNonTerminalRawExpr { VIRTUAL_TO_STRING_KV( N_ITEM_TYPE, type_, N_RESULT_TYPE, result_type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_, K_(mode_flag)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFunMatchAgainst); ObMatchAgainstMode mode_flag_; ObRawExpr* match_columns_; @@ -3474,7 +3474,7 @@ class ObFunMatchAgainst : public ObNonTerminalRawExpr { }; class ObSetIterRawExpr : public ObNonTerminalRawExpr { - public: +public: ObSetIterRawExpr() : ObNonTerminalRawExpr(), left_iter_(NULL), right_iter_(NULL) { set_expr_class(ObExpr::EXPR_DOMAIN_INDEX); @@ -3515,14 +3515,14 @@ class ObSetIterRawExpr : public ObNonTerminalRawExpr { } VIRTUAL_TO_STRING_KV(N_ITEM_TYPE, type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetIterRawExpr); ObRawExpr* left_iter_; ObRawExpr* right_iter_; }; class ObRowIterRawExpr : public ObTerminalRawExpr { - public: +public: ObRowIterRawExpr() : ObTerminalRawExpr(), iter_idx_(common::OB_INVALID_INDEX) { set_expr_class(ObExpr::EXPR_DOMAIN_INDEX); @@ -3552,7 +3552,7 @@ class ObRowIterRawExpr : public ObTerminalRawExpr { } VIRTUAL_TO_STRING_KV(N_ITEM_TYPE, type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_, K_(iter_idx)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRowIterRawExpr); int64_t iter_idx_; }; @@ -3578,7 +3578,7 @@ enum BoundExprIdx { BOUND_EXPR_ADD = 0, BOUND_EXPR_SUB, BOUND_EXPR_MAX }; struct Bound { OB_UNIS_VERSION_V(1); - public: +public: Bound() : type_(BOUND_UNBOUNDED), is_preceding_(false), @@ -3607,7 +3607,7 @@ struct Bound { //////////////////////////////////////////////////////////////// struct ObFrame { - public: +public: ObFrame() : win_type_(WINDOW_MAX), is_between_(false) {} inline void set_window_type(WindowType win_type) @@ -3652,7 +3652,7 @@ struct ObFrame { }; struct ObWindow : public ObFrame { - public: +public: ObWindow() : has_frame_orig_(false) { partition_exprs_.set_label(common::ObModIds::OB_SQL_WINDOW_FUNC); @@ -3713,7 +3713,7 @@ struct ObWindow : public ObFrame { }; class ObWinFunRawExpr : public ObRawExpr, public ObWindow { - public: +public: ObWinFunRawExpr() : ObRawExpr(), ObWindow(), @@ -3831,10 +3831,10 @@ class ObWinFunRawExpr : public ObRawExpr, public ObWindow { K_(expr_level), K_(expr_levels), K_(func_type), K_(is_distinct), K_(func_params), K_(partition_exprs), K_(order_items), K_(win_type), K_(is_between), K_(upper), K_(lower), KPC_(agg_expr)); - public: +public: common::ObString sort_str_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObWinFunRawExpr); ObItemType func_type_; bool is_distinct_; @@ -3846,7 +3846,7 @@ class ObWinFunRawExpr : public ObRawExpr, public ObWindow { //////////////////////////////////////////////////////////////// class ObPseudoColumnRawExpr : public ObTerminalRawExpr { - public: +public: ObPseudoColumnRawExpr() : ObTerminalRawExpr(), table_id_(common::OB_INVALID_ID) { set_expr_class(ObExpr::EXPR_PSEUDO_COLUMN); @@ -3896,7 +3896,7 @@ class ObPseudoColumnRawExpr : public ObTerminalRawExpr { VIRTUAL_TO_STRING_KV( N_ITEM_TYPE, type_, N_RESULT_TYPE, result_type_, N_EXPR_INFO, info_, N_REL_ID, rel_ids_, N_TABLE_ID, table_id_); - private: +private: ObRawExpr* cte_cycle_value_; ObRawExpr* cte_cycle_default_value_; int64_t table_id_; @@ -3904,7 +3904,7 @@ class ObPseudoColumnRawExpr : public ObTerminalRawExpr { }; /// visitor interface class ObRawExprVisitor { - public: +public: ObRawExprVisitor() {} virtual ~ObRawExprVisitor() @@ -3966,13 +3966,13 @@ class ObRawExprVisitor { return false; } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprVisitor); }; class ObRawExprFactory { - public: +public: explicit ObRawExprFactory(common::ObIAllocator& alloc) : allocator_(alloc), expr_store_(alloc) {} ~ObRawExprFactory() @@ -4025,16 +4025,16 @@ class ObRawExprFactory { } TO_STRING_KV("", ""); - private: +private: common::ObIAllocator& allocator_; common::ObObjStore expr_store_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRawExprFactory); }; class ObRawExprPointer { - public: +public: ObRawExprPointer(); virtual ~ObRawExprPointer(); @@ -4043,7 +4043,7 @@ class ObRawExprPointer { int add_ref(ObRawExpr** expr); TO_STRING_KV("", ""); - private: +private: common::ObSEArray expr_group_; }; diff --git a/src/sql/resolver/expr/ob_raw_expr_canonicalizer.h b/src/sql/resolver/expr/ob_raw_expr_canonicalizer.h index 9a5e1df5d..26cbfe3d2 100644 --- a/src/sql/resolver/expr/ob_raw_expr_canonicalizer.h +++ b/src/sql/resolver/expr/ob_raw_expr_canonicalizer.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObRawExprCanonicalizer { - public: +public: ObRawExprCanonicalizer() {} virtual ~ObRawExprCanonicalizer() @@ -30,13 +30,13 @@ class ObRawExprCanonicalizer { */ virtual int canonicalize(ObRawExpr*& expr) = 0; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprCanonicalizer); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/expr/ob_raw_expr_canonicalizer_impl.h b/src/sql/resolver/expr/ob_raw_expr_canonicalizer_impl.h index 649d0e052..ea179624b 100644 --- a/src/sql/resolver/expr/ob_raw_expr_canonicalizer_impl.h +++ b/src/sql/resolver/expr/ob_raw_expr_canonicalizer_impl.h @@ -16,16 +16,16 @@ namespace oceanbase { namespace sql { class ObRawExprCanonicalizerImpl : public ObRawExprCanonicalizer { - public: +public: explicit ObRawExprCanonicalizerImpl(ObExprResolveContext& ctx); virtual ~ObRawExprCanonicalizerImpl() {} virtual int canonicalize(ObRawExpr*& expr); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprCanonicalizerImpl); // function members @@ -38,7 +38,7 @@ class ObRawExprCanonicalizerImpl : public ObRawExprCanonicalizer { int pull_similar_expr(ObRawExpr*& expr); int cluster_and_or(ObRawExpr*& expr); - private: +private: struct ObOppositeOpPair { ObItemType original_; ObItemType opposite_; @@ -46,7 +46,7 @@ class ObRawExprCanonicalizerImpl : public ObRawExprCanonicalizer { static ObItemType get_opposite_op(ObItemType type); static ObOppositeOpPair OPPOSITE_PAIRS[]; - private: +private: // data members ObExprResolveContext& ctx_; // ObIAllocator &allocator_; diff --git a/src/sql/resolver/expr/ob_raw_expr_ctxcat_analyzer.h b/src/sql/resolver/expr/ob_raw_expr_ctxcat_analyzer.h index 342c3d603..fcc439214 100644 --- a/src/sql/resolver/expr/ob_raw_expr_ctxcat_analyzer.h +++ b/src/sql/resolver/expr/ob_raw_expr_ctxcat_analyzer.h @@ -20,14 +20,14 @@ namespace oceanbase { namespace sql { class ObSQLSessionInfo; class ObRawExprCtxCatAnalyzer { - public: +public: ObRawExprCtxCatAnalyzer(ObRawExprFactory& expr_factory, ObSQLSessionInfo* session_info) : expr_factory_(expr_factory), session_info_(session_info) {} // int splite_search_keywords(ObFunMatchAgainst &expr); int create_fulltext_filter(ObFunMatchAgainst& expr); - private: +private: ObRawExprFactory& expr_factory_; ObSQLSessionInfo* session_info_; }; diff --git a/src/sql/resolver/expr/ob_raw_expr_deduce_type.h b/src/sql/resolver/expr/ob_raw_expr_deduce_type.h index 902721647..04cf8ff27 100644 --- a/src/sql/resolver/expr/ob_raw_expr_deduce_type.h +++ b/src/sql/resolver/expr/ob_raw_expr_deduce_type.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObRawExprDeduceType : public ObRawExprVisitor { - public: +public: ObRawExprDeduceType(const ObSQLSessionInfo* my_session) : ObRawExprVisitor(), my_session_(my_session), alloc_(), expr_factory_(NULL) {} @@ -54,9 +54,9 @@ class ObRawExprDeduceType : public ObRawExprVisitor { int check_type_for_case_expr(ObCaseOpRawExpr& case_expr, common::ObIAllocator& alloc); static bool skip_cast_expr(const ObRawExpr& parent, const int64_t child_idx); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprDeduceType); // function members @@ -101,7 +101,7 @@ class ObRawExprDeduceType : public ObRawExprVisitor { int add_group_aggr_implicit_cast(ObAggFunRawExpr& expr, const ObCastMode& cast_mode); int adjust_cast_as_signed_unsigned(ObSysFunRawExpr& expr); - private: +private: const sql::ObSQLSessionInfo* my_session_; common::ObArenaAllocator alloc_; ObRawExprFactory* expr_factory_; diff --git a/src/sql/resolver/expr/ob_raw_expr_info_extractor.h b/src/sql/resolver/expr/ob_raw_expr_info_extractor.h index a1a68e0f8..3660d4da2 100644 --- a/src/sql/resolver/expr/ob_raw_expr_info_extractor.h +++ b/src/sql/resolver/expr/ob_raw_expr_info_extractor.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObRawExprInfoExtractor : public ObRawExprVisitor { - public: +public: ObRawExprInfoExtractor() : ObRawExprVisitor() {} virtual ~ObRawExprInfoExtractor() @@ -39,9 +39,9 @@ class ObRawExprInfoExtractor : public ObRawExprVisitor { virtual int visit(ObWinFunRawExpr& expr); virtual int visit(ObPseudoColumnRawExpr& expr); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprInfoExtractor); // function members diff --git a/src/sql/resolver/expr/ob_raw_expr_modify_column_name.h b/src/sql/resolver/expr/ob_raw_expr_modify_column_name.h index 6d89aca6c..6ad252a3c 100644 --- a/src/sql/resolver/expr/ob_raw_expr_modify_column_name.h +++ b/src/sql/resolver/expr/ob_raw_expr_modify_column_name.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObRawExprModifyColumnName : public ObRawExprVisitor { - public: +public: ObRawExprModifyColumnName(common::ObString new_column_name, common::ObString orig_column_name) : ObRawExprVisitor() { orig_column_name_ = orig_column_name; @@ -45,7 +45,7 @@ class ObRawExprModifyColumnName : public ObRawExprVisitor { virtual int visit(ObWinFunRawExpr& expr); virtual int visit(ObPseudoColumnRawExpr& expr); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRawExprModifyColumnName); common::ObString orig_column_name_; common::ObString new_column_name_; diff --git a/src/sql/resolver/expr/ob_raw_expr_part_expr_checker.h b/src/sql/resolver/expr/ob_raw_expr_part_expr_checker.h index 85bbf9926..f7de0dd2c 100644 --- a/src/sql/resolver/expr/ob_raw_expr_part_expr_checker.h +++ b/src/sql/resolver/expr/ob_raw_expr_part_expr_checker.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObRawExprPartExprChecker : public ObRawExprVisitor { - public: +public: ObRawExprPartExprChecker() : ObRawExprVisitor() {} virtual ~ObRawExprPartExprChecker() @@ -36,9 +36,9 @@ class ObRawExprPartExprChecker : public ObRawExprVisitor { virtual int visit(ObSetOpRawExpr& expr); virtual int visit(ObAliasRefRawExpr& expr); - private: +private: // types and constants - private: +private: inline static bool is_time_expr(const ObRawExpr& expr); inline static bool is_date_expr(const ObRawExpr& expr); inline static bool is_timestamp_expr(const ObRawExpr& expr); diff --git a/src/sql/resolver/expr/ob_raw_expr_part_func_checker.h b/src/sql/resolver/expr/ob_raw_expr_part_func_checker.h index 75ef24508..4c311da7b 100644 --- a/src/sql/resolver/expr/ob_raw_expr_part_func_checker.h +++ b/src/sql/resolver/expr/ob_raw_expr_part_func_checker.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObRawExprPartFuncChecker : public ObRawExprVisitor { - public: +public: explicit ObRawExprPartFuncChecker(bool gen_col_check = false, bool accept_charset_function = false) : ObRawExprVisitor(), gen_col_check_(gen_col_check), accept_charset_function_(accept_charset_function) {} @@ -37,12 +37,12 @@ class ObRawExprPartFuncChecker : public ObRawExprVisitor { virtual int visit(ObSetOpRawExpr& expr); virtual int visit(ObAliasRefRawExpr& expr); - private: +private: // types and constants bool gen_col_check_; bool accept_charset_function_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprPartFuncChecker); }; diff --git a/src/sql/resolver/expr/ob_raw_expr_precalc_analyzer.h b/src/sql/resolver/expr/ob_raw_expr_precalc_analyzer.h index 3040eddbe..1103768d2 100644 --- a/src/sql/resolver/expr/ob_raw_expr_precalc_analyzer.h +++ b/src/sql/resolver/expr/ob_raw_expr_precalc_analyzer.h @@ -21,7 +21,7 @@ class ObDMLStmt; class ObRawExprFactory; class ObSQLSessionInfo; class ObRawExprPrecalcAnalyzer { - public: +public: ObRawExprPrecalcAnalyzer(ObRawExprFactory& expr_factory, ObSQLSessionInfo* my_session) : expr_factory_(expr_factory), my_session_(my_session) {} @@ -29,7 +29,7 @@ class ObRawExprPrecalcAnalyzer { int analyze_all_expr(ObDMLStmt& stmt); int analyze_expr_tree(ObRawExpr* expr, ObDMLStmt& stmt, const bool filter_expr = false); - private: +private: int pre_cast_const_expr(ObRawExpr* expr); int pre_cast_recursively(ObRawExpr* expr); int extract_calculable_expr(ObRawExpr*& expr, ObDMLStmt& stmt, const bool filter_expr = false); @@ -38,7 +38,7 @@ class ObRawExprPrecalcAnalyzer { bool calculation_need_cast(common::ObObjType param_type, common::ObObjType calc_type) const; bool is_filtered(ObRawExpr& expr); - private: +private: const static ObItemType EXPR_FILTER_LIST[]; ObRawExprFactory& expr_factory_; ObSQLSessionInfo* my_session_; diff --git a/src/sql/resolver/expr/ob_raw_expr_print_visitor.h b/src/sql/resolver/expr/ob_raw_expr_print_visitor.h index 79fb82cef..15def47a6 100644 --- a/src/sql/resolver/expr/ob_raw_expr_print_visitor.h +++ b/src/sql/resolver/expr/ob_raw_expr_print_visitor.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObRawExprPrintVisitor : public ObRawExprVisitor { - public: +public: explicit ObRawExprPrintVisitor(ObRawExpr& expr_root); virtual ~ObRawExprPrintVisitor(); @@ -32,13 +32,13 @@ class ObRawExprPrintVisitor : public ObRawExprVisitor { virtual int visit(ObSetOpRawExpr& expr); int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprPrintVisitor); // function members - private: +private: // data members ObRawExpr& expr_root_; mutable char* buf_; diff --git a/src/sql/resolver/expr/ob_raw_expr_printer.h b/src/sql/resolver/expr/ob_raw_expr_printer.h index 1d732ca52..de2acb38e 100644 --- a/src/sql/resolver/expr/ob_raw_expr_printer.h +++ b/src/sql/resolver/expr/ob_raw_expr_printer.h @@ -71,7 +71,7 @@ class ObRawExprPrinter { #define BINARY_COLLATION 63 #define INVALID_COLLATION 0 - public: +public: ObRawExprPrinter(); ObRawExprPrinter( char* buf, int64_t buf_len, int64_t* pos, common::ObObjPrintParams print_params = common::ObObjPrintParams()); @@ -81,7 +81,7 @@ class ObRawExprPrinter { void init(char* buf, int64_t buf_len, int64_t* pos, ObObjPrintParams print_params); int do_print(ObRawExpr* expr, ObStmtScope scope, bool only_column_namespace = false); - private: +private: int print(ObRawExpr* expr); int print(ObConstRawExpr* expr); @@ -106,7 +106,7 @@ class ObRawExprPrinter { // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprPrinter); - private: +private: // data members char* buf_; int64_t buf_len_; diff --git a/src/sql/resolver/expr/ob_raw_expr_replacer.h b/src/sql/resolver/expr/ob_raw_expr_replacer.h index 235907519..f0336314b 100644 --- a/src/sql/resolver/expr/ob_raw_expr_replacer.h +++ b/src/sql/resolver/expr/ob_raw_expr_replacer.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObRawExprReplacer : public ObRawExprVisitor { - public: +public: ObRawExprReplacer(ObRawExpr* old_expr, ObRawExpr* new_expr); virtual ~ObRawExprReplacer(); @@ -33,13 +33,13 @@ class ObRawExprReplacer : public ObRawExprVisitor { virtual int visit(ObSetOpRawExpr& expr); virtual int visit(ObWinFunRawExpr& expr); - private: +private: // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprReplacer); // function members - private: +private: ObRawExpr* old_expr_; ObRawExpr* new_expr_; }; diff --git a/src/sql/resolver/expr/ob_raw_expr_resolver.h b/src/sql/resolver/expr/ob_raw_expr_resolver.h index e8d50be7a..a18ca7034 100644 --- a/src/sql/resolver/expr/ob_raw_expr_resolver.h +++ b/src/sql/resolver/expr/ob_raw_expr_resolver.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObRawExprResolver { - public: +public: ObRawExprResolver() {} @@ -32,11 +32,11 @@ class ObRawExprResolver { common::ObIArray& aggr_exprs, common::ObIArray& win_exprs, common::ObIArray& op_exprs, common::ObIArray& user_var_exprs) = 0; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprResolver); // function members - private: +private: // data members }; diff --git a/src/sql/resolver/expr/ob_raw_expr_resolver_impl.h b/src/sql/resolver/expr/ob_raw_expr_resolver_impl.h index c1ce3ee70..78742fe82 100644 --- a/src/sql/resolver/expr/ob_raw_expr_resolver_impl.h +++ b/src/sql/resolver/expr/ob_raw_expr_resolver_impl.h @@ -34,7 +34,7 @@ class ObRawExprResolverImpl : public ObRawExprResolver { int ret_; }; - public: +public: explicit ObRawExprResolverImpl(ObExprResolveContext& ctx); virtual ~ObRawExprResolverImpl() {} @@ -56,7 +56,7 @@ class ObRawExprResolverImpl : public ObRawExprResolver { static int check_sys_func(ObQualifiedName& q_name, bool& is_sys_func); // types and constants - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRawExprResolverImpl); // function members @@ -141,7 +141,7 @@ class ObRawExprResolverImpl : public ObRawExprResolver { static int not_row_check(const ObRawExpr* expr); static int param_not_row_check(const ObRawExpr* expr); - private: +private: int transform_ratio_afun_to_arg_div_sum(const ParseNode* ratio_to_report, ParseNode*& div); int convert_any_or_all_expr(ObRawExpr*& expr, bool& happened); int get_opposite_string( diff --git a/src/sql/resolver/expr/ob_raw_expr_util.h b/src/sql/resolver/expr/ob_raw_expr_util.h index 9b16c6258..b9e021dc4 100644 --- a/src/sql/resolver/expr/ob_raw_expr_util.h +++ b/src/sql/resolver/expr/ob_raw_expr_util.h @@ -36,7 +36,7 @@ class ObSelectIntoItem; template class UniqueSetWrapAllocer { - public: +public: UniqueSetWrapAllocer() : allocator_(NULL) {} UniqueSetWrapAllocer(ObIAllocator& alloc) : allocator_(&alloc) @@ -65,12 +65,12 @@ class UniqueSetWrapAllocer { void dec_ref() {} - private: +private: ObIAllocator* allocator_; }; class ObRawExprUniqueSet { - public: +public: typedef UniqueSetWrapAllocer::AllocType> NodeAllocator; typedef common::hash::ObHashSet, common::hash::equal_to, NodeAllocator, common::hash::NormalPointer, common::ObWrapperAllocator, @@ -99,10 +99,10 @@ class ObRawExprUniqueSet { return expr_array_; }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRawExprUniqueSet); - private: +private: NodeAllocator node_allocator_; common::ObWrapperAllocator bucket_allocator_; ExprPtrSet expr_set_; @@ -143,7 +143,7 @@ int ObRawExprUniqueSet::append(const ObIArray& exprs) } class ObRawExprUtils { - public: +public: /** * make expression from string * @@ -425,7 +425,7 @@ class ObRawExprUtils { static int build_to_outfile_expr(ObRawExprFactory& expr_factory, const ObSQLSessionInfo* session_info, const ObSelectIntoItem* into_item, const ObIArray& exprs, ObRawExpr*& to_outfile_expr); - private: +private: static int create_real_cast_expr(ObRawExprFactory& expr_factory, ObRawExpr* src_expr, const ObExprResType& dst_type, ObSysFunRawExpr*& func_expr, const ObSQLSessionInfo* session_info); ObRawExprUtils(); diff --git a/src/sql/resolver/expr/ob_raw_expr_wrap_enum_set.h b/src/sql/resolver/expr/ob_raw_expr_wrap_enum_set.h index a1962661b..8f60bb0b2 100644 --- a/src/sql/resolver/expr/ob_raw_expr_wrap_enum_set.h +++ b/src/sql/resolver/expr/ob_raw_expr_wrap_enum_set.h @@ -23,7 +23,7 @@ class ObInsertStmt; class ObSQLSessionInfo; class ObRawExprWrapEnumSet : public ObRawExprVisitor { - public: +public: ObRawExprWrapEnumSet(ObRawExprFactory& expr_factory, ObSQLSessionInfo* my_session) : ObRawExprVisitor(), current_level_(-1), expr_factory_(expr_factory), my_session_(my_session) {} @@ -45,7 +45,7 @@ class ObRawExprWrapEnumSet : public ObRawExprVisitor { int visit(ObFunMatchAgainst& expr); bool skip_child(); - private: +private: int32_t get_current_level() const { return current_level_; @@ -61,7 +61,7 @@ class ObRawExprWrapEnumSet : public ObRawExprVisitor { int wrap_value_vector(ObInsertStmt& stmt); int wrap_nullif_expr(ObSysFunRawExpr& expr); - private: +private: int32_t current_level_; ObRawExprFactory& expr_factory_; ObSQLSessionInfo* my_session_; diff --git a/src/sql/resolver/expr/ob_var_expr.h b/src/sql/resolver/expr/ob_var_expr.h index a4b27eb0a..7134eb04c 100644 --- a/src/sql/resolver/expr/ob_var_expr.h +++ b/src/sql/resolver/expr/ob_var_expr.h @@ -23,7 +23,7 @@ namespace expr { // OceanBase constant expression. class ObVarExpr : virtual public ObExpr { - public: +public: ObVarExpr() { set_expr_class(EXPR_VAR); diff --git a/src/sql/resolver/ob_cmd.h b/src/sql/resolver/ob_cmd.h index c85abf523..8e3d337b9 100644 --- a/src/sql/resolver/ob_cmd.h +++ b/src/sql/resolver/ob_cmd.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace sql { class ObICmd { - public: +public: virtual int get_cmd_type() const = 0; virtual bool cause_implicit_commit() const { diff --git a/src/sql/resolver/ob_column_ref.h b/src/sql/resolver/ob_column_ref.h index 350858828..20475b3e2 100644 --- a/src/sql/resolver/ob_column_ref.h +++ b/src/sql/resolver/ob_column_ref.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObColumnRef { - public: +public: ObColumnRef() : database_name_(), table_name_(), column_name_(), is_star_(false), collation_type_(common::CS_TYPE_INVALID) {} @@ -92,7 +92,7 @@ class ObColumnRef { TO_STRING_KV(K(database_name_), K(table_name_), K(column_name_), K(is_star_), N_COLLATION, common::ObCharset::collation_name(collation_type_)); - private: +private: common::ObString database_name_; common::ObString table_name_; common::ObString column_name_; diff --git a/src/sql/resolver/ob_resolver.h b/src/sql/resolver/ob_resolver.h index 30b3fd4da..4b06ef63c 100644 --- a/src/sql/resolver/ob_resolver.h +++ b/src/sql/resolver/ob_resolver.h @@ -21,7 +21,7 @@ class ObSQLSessionInfo; /// the interface of this module class ObResolver { - public: +public: enum IsPrepared { IS_PREPARED_STMT, IS_NOT_PREPARED_STMT }; explicit ObResolver(ObResolverParams& params); @@ -34,18 +34,18 @@ class ObResolver { return params_; } - private: +private: template int stmt_resolver_func(ObResolverParams& params, const ParseNode& parse_tree, ObStmt*& stmt); template int select_stmt_resolver_func(ObResolverParams& params, const ParseNode& parse_tree, ObStmt*& stmt); - private: +private: // data members ObResolverParams params_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObResolver); }; diff --git a/src/sql/resolver/ob_resolver_define.h b/src/sql/resolver/ob_resolver_define.h index 612fcb962..3e07e9a96 100644 --- a/src/sql/resolver/ob_resolver_define.h +++ b/src/sql/resolver/ob_resolver_define.h @@ -292,7 +292,7 @@ struct ObResolverParams { return force_trace_log_; } - public: +public: common::ObIAllocator* allocator_; ObSchemaChecker* schema_checker_; ObSQLSessionInfo* session_info_; @@ -326,7 +326,7 @@ struct ObResolverParams { bool have_same_table_name_; bool is_default_param_; - private: +private: uint64_t new_gen_did_; uint64_t new_gen_cid_; uint64_t new_gen_qid_; @@ -334,7 +334,7 @@ struct ObResolverParams { int64_t new_gen_wid_; // when number friend class ObStmtResolver; - public: +public: bool is_multi_table_insert_; // used to mark is multi table insert bool is_resolve_table_function_expr_; // used to mark resolve table function expr. }; diff --git a/src/sql/resolver/ob_resolver_utils.h b/src/sql/resolver/ob_resolver_utils.h index 25f746b19..b90c8a447 100644 --- a/src/sql/resolver/ob_resolver_utils.h +++ b/src/sql/resolver/ob_resolver_utils.h @@ -33,7 +33,7 @@ namespace oceanbase { namespace sql { class ObRoutineMatchInfo { - public: +public: struct MatchInfo { MatchInfo() : need_cast_(false), src_type_(ObMaxType), dest_type_(ObMaxType) {} @@ -80,7 +80,7 @@ class ObRoutineMatchInfo { return match_info_.at(i).dest_type_; } - public: +public: common::ObSEArray match_info_; TO_STRING_KV(K_(match_info)); @@ -90,7 +90,7 @@ struct ObResolverUtils { static const int NAMENODE = 1; static ObItemType item_type_; - public: +public: static int get_all_function_table_column_names( const TableItem& table_item, ObResolverParams& params, ObIArray& column_names); static int check_function_table_column_exist( @@ -323,7 +323,7 @@ struct ObResolverUtils { static int check_duplicated_column(ObSelectStmt& select_stmt, bool can_skip = false); static void escape_char_for_oracle_mode(ObString& str); - private: +private: static int check_and_generate_column_name(const ObMaterializedViewContext& ctx, char* buf, const int64_t buf_len, const uint64_t table_id, const uint64_t column_id, const ObString& col_name, ObString& new_col_name); @@ -349,7 +349,7 @@ struct ObResolverUtils { return ret; } - private: +private: static int log_err_msg_for_partition_value(const ObQualifiedName& name); static int check_partition_range_value_result_type(const share::schema::ObPartitionFuncType part_type, const ObColumnRefRawExpr& part_column_expr, ObRawExpr& part_value_expr); diff --git a/src/sql/resolver/ob_schema_checker.h b/src/sql/resolver/ob_schema_checker.h index 38707af07..0a49bfdcf 100644 --- a/src/sql/resolver/ob_schema_checker.h +++ b/src/sql/resolver/ob_schema_checker.h @@ -51,7 +51,7 @@ namespace sql { class ObSqlSchemaGuard; class ObSchemaChecker { - public: +public: ObSchemaChecker(); virtual ~ObSchemaChecker(); int init(share::schema::ObSchemaGetterGuard& schema_mgr, uint64_t session_id = common::OB_INVALID_ID); @@ -220,14 +220,14 @@ class ObSchemaChecker { int get_dblink_user(const uint64_t tenant_id, const common::ObString& dblink_name, common::ObString& dblink_user, common::ObIAllocator& allocator); - private: +private: int get_table_schema_inner(uint64_t table_id, const share::schema::ObTableSchema*& table_schema) const; int get_column_schema_inner(uint64_t table_id, const common::ObString& column_name, const share::schema::ObColumnSchemaV2*& column_schema) const; int get_column_schema_inner( uint64_t table_id, const uint64_t column_id, const share::schema::ObColumnSchemaV2*& column_schema) const; - private: +private: bool is_inited_; share::schema::ObSchemaGetterGuard* schema_mgr_; ObSqlSchemaGuard* sql_schema_mgr_; diff --git a/src/sql/resolver/ob_stmt.h b/src/sql/resolver/ob_stmt.h index 1ce15a09c..72eb704d1 100644 --- a/src/sql/resolver/ob_stmt.h +++ b/src/sql/resolver/ob_stmt.h @@ -65,10 +65,10 @@ struct expr_equal_to { /// the base class of all statements class ObStmt { - public: +public: typedef common::ObSEArray ObSynonymIds; - public: +public: ObStmt() : stmt_type_(stmt::T_NONE), literal_stmt_type_(stmt::T_NONE), @@ -501,16 +501,16 @@ class ObStmt { return sql_stmt_coll_type_; } - protected: +protected: void print_indentation(FILE* fp, int32_t level) const; - public: +public: static const int64_t MAX_PRINTABLE_SIZE = 2 * 1024 * 1024; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStmt); // protected: - public: +public: stmt::StmtType stmt_type_; stmt::StmtType literal_stmt_type_; common::ObString sql_stmt_; @@ -564,7 +564,7 @@ inline bool ObStmt::is_px_dml_supported_stmt() const } class ObStmtFactory { - public: +public: explicit ObStmtFactory(common::ObIAllocator& alloc) : allocator_(alloc), stmt_store_(alloc), free_list_(alloc), query_ctx_(NULL) {} @@ -618,13 +618,13 @@ class ObStmtFactory { return allocator_; } - private: +private: common::ObIAllocator& allocator_; common::ObObjStore stmt_store_; common::ObObjStore free_list_; ObQueryCtx* query_ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStmtFactory); }; } // namespace sql diff --git a/src/sql/resolver/ob_stmt_resolver.h b/src/sql/resolver/ob_stmt_resolver.h index 13cf692e9..e5da14d9e 100644 --- a/src/sql/resolver/ob_stmt_resolver.h +++ b/src/sql/resolver/ob_stmt_resolver.h @@ -30,7 +30,7 @@ namespace sql { class ObSynonymChecker; /// base class of all statement resolver class ObStmtResolver { - public: +public: explicit ObStmtResolver(ObResolverParams& params) : allocator_(params.allocator_), schema_checker_(params.schema_checker_), @@ -142,30 +142,30 @@ class ObStmtResolver { int get_column_schema(const uint64_t table_id, const uint64_t column_id, const share::schema::ObColumnSchemaV2*& column_schema, const bool get_hidden = false); - protected: +protected: int normalize_table_or_database_names(common::ObString& name); virtual int init_stmt() { return common::OB_SUCCESS; } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObStmtResolver); - public: +public: // data members common::ObIAllocator* allocator_; ObSchemaChecker* schema_checker_; ObSQLSessionInfo* session_info_; ObResolverParams& params_; - protected: +protected: ObStmt* stmt_; }; class ObSynonymChecker { - public: +public: ObSynonymChecker() : has_synonym_(false), synonym_ids_() {} ~ObSynonymChecker() @@ -184,7 +184,7 @@ class ObSynonymChecker { return has_synonym_; } - private: +private: bool has_synonym_; common::ObSEArray synonym_ids_; DISALLOW_COPY_AND_ASSIGN(ObSynonymChecker); diff --git a/src/sql/resolver/ob_stmt_type.h b/src/sql/resolver/ob_stmt_type.h index 5530e5618..f7281b45d 100644 --- a/src/sql/resolver/ob_stmt_type.h +++ b/src/sql/resolver/ob_stmt_type.h @@ -265,7 +265,7 @@ enum StmtType : int32_t { }; struct StmtTypeIndex { - public: +public: StmtTypeIndex() : stmt_type_idx_() { int i = 0; diff --git a/src/sql/resolver/prepare/ob_deallocate_resolver.h b/src/sql/resolver/prepare/ob_deallocate_resolver.h index f9a72aafb..65e58ead6 100644 --- a/src/sql/resolver/prepare/ob_deallocate_resolver.h +++ b/src/sql/resolver/prepare/ob_deallocate_resolver.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObDeallocateResolver : public ObStmtResolver { - public: +public: explicit ObDeallocateResolver(ObResolverParams& params) : ObStmtResolver(params) {} virtual ~ObDeallocateResolver() @@ -30,7 +30,7 @@ class ObDeallocateResolver : public ObStmtResolver { return static_cast(stmt_); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDeallocateResolver); }; diff --git a/src/sql/resolver/prepare/ob_deallocate_stmt.h b/src/sql/resolver/prepare/ob_deallocate_stmt.h index 129c0768d..e616939b5 100644 --- a/src/sql/resolver/prepare/ob_deallocate_stmt.h +++ b/src/sql/resolver/prepare/ob_deallocate_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObDeallocateStmt : public ObCMDStmt { - public: +public: ObDeallocateStmt() : ObCMDStmt(stmt::T_DEALLOCATE), prepare_name_(), prepare_id_(OB_INVALID_ID) {} virtual ~ObDeallocateStmt() @@ -44,7 +44,7 @@ class ObDeallocateStmt : public ObCMDStmt { TO_STRING_KV(N_STMT_NAME, prepare_name_, N_SQL_ID, prepare_id_); - private: +private: common::ObString prepare_name_; ObPsStmtId prepare_id_; DISALLOW_COPY_AND_ASSIGN(ObDeallocateStmt); diff --git a/src/sql/resolver/prepare/ob_execute_resolver.h b/src/sql/resolver/prepare/ob_execute_resolver.h index 4fd7adc49..b5135c8a9 100644 --- a/src/sql/resolver/prepare/ob_execute_resolver.h +++ b/src/sql/resolver/prepare/ob_execute_resolver.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObExecuteResolver : public ObStmtResolver { - public: +public: explicit ObExecuteResolver(ObResolverParams& params) : ObStmtResolver(params) {} virtual ~ObExecuteResolver() @@ -31,7 +31,7 @@ class ObExecuteResolver : public ObStmtResolver { return static_cast(stmt_); } - private: +private: }; } // namespace sql diff --git a/src/sql/resolver/prepare/ob_execute_stmt.h b/src/sql/resolver/prepare/ob_execute_stmt.h index 9bc59d72b..add52997e 100644 --- a/src/sql/resolver/prepare/ob_execute_stmt.h +++ b/src/sql/resolver/prepare/ob_execute_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObExecuteStmt : public ObCMDStmt { - public: +public: ObExecuteStmt() : ObCMDStmt(stmt::T_EXECUTE), prepare_id_(common::OB_INVALID_ID), prepare_type_(stmt::T_NONE), params_() {} @@ -58,7 +58,7 @@ class ObExecuteStmt : public ObCMDStmt { TO_STRING_KV(N_SQL_ID, prepare_id_, N_STMT_TYPE, prepare_type_, N_PARAM, params_); - private: +private: ObPsStmtId prepare_id_; stmt::StmtType prepare_type_; common::ObArray params_; diff --git a/src/sql/resolver/prepare/ob_prepare_resolver.h b/src/sql/resolver/prepare/ob_prepare_resolver.h index 927da90e4..56fa267e5 100644 --- a/src/sql/resolver/prepare/ob_prepare_resolver.h +++ b/src/sql/resolver/prepare/ob_prepare_resolver.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObPrepareResolver : public ObStmtResolver { - public: +public: explicit ObPrepareResolver(ObResolverParams& params) : ObStmtResolver(params) {} virtual ~ObPrepareResolver() @@ -30,7 +30,7 @@ class ObPrepareResolver : public ObStmtResolver { return static_cast(stmt_); } - private: +private: }; } // namespace sql diff --git a/src/sql/resolver/prepare/ob_prepare_stmt.h b/src/sql/resolver/prepare/ob_prepare_stmt.h index 62063de94..5a669144d 100644 --- a/src/sql/resolver/prepare/ob_prepare_stmt.h +++ b/src/sql/resolver/prepare/ob_prepare_stmt.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObPrepareStmt : public ObCMDStmt { - public: +public: ObPrepareStmt() : ObCMDStmt(stmt::T_PREPARE), prepare_name_(), prepare_sql_(NULL) {} virtual ~ObPrepareStmt() @@ -45,7 +45,7 @@ class ObPrepareStmt : public ObCMDStmt { TO_STRING_KV(N_STMT_NAME, prepare_name_, N_PREPARE_SQL, prepare_sql_); - private: +private: common::ObString prepare_name_; ObRawExpr* prepare_sql_; DISALLOW_COPY_AND_ASSIGN(ObPrepareStmt); diff --git a/src/sql/resolver/tcl/ob_end_trans_resolver.h b/src/sql/resolver/tcl/ob_end_trans_resolver.h index 0cc089dea..dcb553d11 100644 --- a/src/sql/resolver/tcl/ob_end_trans_resolver.h +++ b/src/sql/resolver/tcl/ob_end_trans_resolver.h @@ -20,13 +20,13 @@ namespace oceanbase { namespace sql { class ObEndTransResolver : public ObTCLResolver { - public: +public: explicit ObEndTransResolver(ObResolverParams& params); virtual ~ObEndTransResolver(); virtual int resolve(const ParseNode& parse_node); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObEndTransResolver); diff --git a/src/sql/resolver/tcl/ob_end_trans_stmt.h b/src/sql/resolver/tcl/ob_end_trans_stmt.h index 72e2459ba..61a402645 100644 --- a/src/sql/resolver/tcl/ob_end_trans_stmt.h +++ b/src/sql/resolver/tcl/ob_end_trans_stmt.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObEndTransStmt : public ObTCLStmt { - public: +public: ObEndTransStmt() : ObTCLStmt(stmt::T_END_TRANS), is_rollback_(false) {} virtual ~ObEndTransStmt() @@ -32,14 +32,14 @@ class ObEndTransStmt : public ObTCLStmt { return is_rollback_; } - private: +private: // types and constants // function members - private: +private: // data members bool is_rollback_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObEndTransStmt); }; diff --git a/src/sql/resolver/tcl/ob_savepoint_resolver.h b/src/sql/resolver/tcl/ob_savepoint_resolver.h index 46a23c517..0e2b0ce24 100644 --- a/src/sql/resolver/tcl/ob_savepoint_resolver.h +++ b/src/sql/resolver/tcl/ob_savepoint_resolver.h @@ -20,7 +20,7 @@ namespace sql { class ObSavePointStmt; class ObSavePointResolver : public ObStmtResolver { - public: +public: explicit ObSavePointResolver(ObResolverParams& params) : ObStmtResolver(params) {} virtual ~ObSavePointResolver() @@ -28,7 +28,7 @@ class ObSavePointResolver : public ObStmtResolver { virtual int resolve(const ParseNode& parse_tree); int create_savepoint_stmt(ObItemType stmt_type, ObSavePointStmt*& stmt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSavePointResolver); }; diff --git a/src/sql/resolver/tcl/ob_savepoint_stmt.h b/src/sql/resolver/tcl/ob_savepoint_stmt.h index 83551a158..cda80ea81 100644 --- a/src/sql/resolver/tcl/ob_savepoint_stmt.h +++ b/src/sql/resolver/tcl/ob_savepoint_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObSavePointStmt : public ObTCLStmt { - public: +public: explicit ObSavePointStmt(stmt::StmtType type) : ObTCLStmt(type), sp_name_() {} virtual ~ObSavePointStmt() @@ -30,41 +30,41 @@ class ObSavePointStmt : public ObTCLStmt { return sp_name_; } - private: +private: common::ObString sp_name_; DISALLOW_COPY_AND_ASSIGN(ObSavePointStmt); }; class ObCreateSavePointStmt : public ObSavePointStmt { - public: +public: explicit ObCreateSavePointStmt() : ObSavePointStmt(stmt::T_CREATE_SAVEPOINT) {} virtual ~ObCreateSavePointStmt() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCreateSavePointStmt); }; class ObRollbackSavePointStmt : public ObSavePointStmt { - public: +public: explicit ObRollbackSavePointStmt() : ObSavePointStmt(stmt::T_ROLLBACK_SAVEPOINT) {} virtual ~ObRollbackSavePointStmt() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRollbackSavePointStmt); }; class ObReleaseSavePointStmt : public ObSavePointStmt { - public: +public: explicit ObReleaseSavePointStmt() : ObSavePointStmt(stmt::T_RELEASE_SAVEPOINT) {} virtual ~ObReleaseSavePointStmt() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObReleaseSavePointStmt); }; diff --git a/src/sql/resolver/tcl/ob_start_trans_resolver.h b/src/sql/resolver/tcl/ob_start_trans_resolver.h index 310fd4ed4..034cb5f7b 100644 --- a/src/sql/resolver/tcl/ob_start_trans_resolver.h +++ b/src/sql/resolver/tcl/ob_start_trans_resolver.h @@ -20,13 +20,13 @@ namespace oceanbase { namespace sql { class ObStartTransResolver : public ObTCLResolver { - public: +public: explicit ObStartTransResolver(ObResolverParams& params); virtual ~ObStartTransResolver(); virtual int resolve(const ParseNode& parse_node); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObStartTransResolver); diff --git a/src/sql/resolver/tcl/ob_start_trans_stmt.h b/src/sql/resolver/tcl/ob_start_trans_stmt.h index c7942c24a..6e0a23523 100644 --- a/src/sql/resolver/tcl/ob_start_trans_stmt.h +++ b/src/sql/resolver/tcl/ob_start_trans_stmt.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace sql { class ObStartTransStmt : public ObTCLStmt { - public: +public: ObStartTransStmt(); virtual ~ObStartTransStmt(); virtual void print(FILE* fp, int32_t level, int32_t index); @@ -30,14 +30,14 @@ class ObStartTransStmt : public ObTCLStmt { } TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(read_only), K_(with_consistent_snapshot)); - private: +private: // types and constants - private: +private: // disallow copy ObStartTransStmt(const ObStartTransStmt& other); ObStartTransStmt& operator=(const ObStartTransStmt& other); // function members - private: +private: // data members bool with_consistent_snapshot_; bool read_only_; diff --git a/src/sql/resolver/tcl/ob_tcl_resolver.h b/src/sql/resolver/tcl/ob_tcl_resolver.h index e73ea921f..c058b3e4c 100644 --- a/src/sql/resolver/tcl/ob_tcl_resolver.h +++ b/src/sql/resolver/tcl/ob_tcl_resolver.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObTCLResolver : public ObStmtResolver { - public: +public: explicit ObTCLResolver(ObResolverParams& params); virtual ~ObTCLResolver(); @@ -28,7 +28,7 @@ class ObTCLResolver : public ObStmtResolver { const common::ObIArray& subquery_info, const ObStmtScope upper_scope); virtual int resolve_columns(ObRawExpr*& expr, common::ObArray& columns); - private: +private: /* functions */ /* variables */ DISALLOW_COPY_AND_ASSIGN(ObTCLResolver); diff --git a/src/sql/resolver/tcl/ob_tcl_stmt.h b/src/sql/resolver/tcl/ob_tcl_stmt.h index c8a64eca0..6115dea14 100644 --- a/src/sql/resolver/tcl/ob_tcl_stmt.h +++ b/src/sql/resolver/tcl/ob_tcl_stmt.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace sql { class ObTCLStmt : public ObStmt, public ObICmd { - public: +public: ObTCLStmt(common::ObIAllocator* name_pool, stmt::StmtType type) : ObStmt(name_pool, type) {} explicit ObTCLStmt(stmt::StmtType type) : ObStmt(type) @@ -30,7 +30,7 @@ class ObTCLStmt : public ObStmt, public ObICmd { return get_stmt_type(); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTCLStmt); }; } // namespace sql diff --git a/src/sql/resolver/xa/ob_xa_commit_resolver.h b/src/sql/resolver/xa/ob_xa_commit_resolver.h index af2321ccb..5f65d531a 100644 --- a/src/sql/resolver/xa/ob_xa_commit_resolver.h +++ b/src/sql/resolver/xa/ob_xa_commit_resolver.h @@ -19,12 +19,12 @@ namespace oceanbase { namespace sql { class ObXaCommitResolver : public ObStmtResolver { - public: +public: explicit ObXaCommitResolver(ObResolverParams& params); virtual ~ObXaCommitResolver(); virtual int resolve(const ParseNode& parse_node); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaCommitResolver); }; diff --git a/src/sql/resolver/xa/ob_xa_end_resolver.h b/src/sql/resolver/xa/ob_xa_end_resolver.h index 4c07517f1..8ebe50b10 100644 --- a/src/sql/resolver/xa/ob_xa_end_resolver.h +++ b/src/sql/resolver/xa/ob_xa_end_resolver.h @@ -19,12 +19,12 @@ namespace oceanbase { namespace sql { class ObXaEndResolver : public ObStmtResolver { - public: +public: explicit ObXaEndResolver(ObResolverParams& params); virtual ~ObXaEndResolver(); virtual int resolve(const ParseNode& parse_node); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaEndResolver); }; diff --git a/src/sql/resolver/xa/ob_xa_prepare_resolver.h b/src/sql/resolver/xa/ob_xa_prepare_resolver.h index b2d5bea7c..92667184b 100644 --- a/src/sql/resolver/xa/ob_xa_prepare_resolver.h +++ b/src/sql/resolver/xa/ob_xa_prepare_resolver.h @@ -19,12 +19,12 @@ namespace oceanbase { namespace sql { class ObXaPrepareResolver : public ObStmtResolver { - public: +public: explicit ObXaPrepareResolver(ObResolverParams& params); virtual ~ObXaPrepareResolver(); virtual int resolve(const ParseNode& parse_node); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaPrepareResolver); }; diff --git a/src/sql/resolver/xa/ob_xa_rollback_resolver.h b/src/sql/resolver/xa/ob_xa_rollback_resolver.h index f082d51dd..67244fde5 100644 --- a/src/sql/resolver/xa/ob_xa_rollback_resolver.h +++ b/src/sql/resolver/xa/ob_xa_rollback_resolver.h @@ -19,12 +19,12 @@ namespace oceanbase { namespace sql { class ObXaRollBackResolver : public ObStmtResolver { - public: +public: explicit ObXaRollBackResolver(ObResolverParams& params); virtual ~ObXaRollBackResolver(); virtual int resolve(const ParseNode& parse_node); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaRollBackResolver); }; diff --git a/src/sql/resolver/xa/ob_xa_start_resolver.h b/src/sql/resolver/xa/ob_xa_start_resolver.h index cd6e3ed76..e99d57efa 100644 --- a/src/sql/resolver/xa/ob_xa_start_resolver.h +++ b/src/sql/resolver/xa/ob_xa_start_resolver.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace sql { class ObXaStartResolver : public ObStmtResolver { - public: +public: explicit ObXaStartResolver(ObResolverParams& params); virtual ~ObXaStartResolver(); virtual int resolve(const ParseNode& parse_node); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaStartResolver); }; diff --git a/src/sql/resolver/xa/ob_xa_stmt.h b/src/sql/resolver/xa/ob_xa_stmt.h index baef5c8e4..b85921fd3 100644 --- a/src/sql/resolver/xa/ob_xa_stmt.h +++ b/src/sql/resolver/xa/ob_xa_stmt.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObXaStmt : public ObStmt, public ObICmd { - public: +public: explicit ObXaStmt(const stmt::StmtType stmt_type) : ObStmt(stmt_type), xid_string_(), gtrid_string_(), bqual_string_(), format_id_(1), flags_(0) {} @@ -91,13 +91,13 @@ class ObXaStmt : public ObStmt, public ObICmd { TO_STRING_KV( N_STMT_TYPE, ((int)stmt_type_), K_(xid_string), K_(gtrid_string), K_(bqual_string), K_(format_id), K_(flags)); - public: +public: static const int32_t MAX_XID_LENGTH = 128; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXaStmt); - private: +private: char xid_buffer_[MAX_XID_LENGTH]; common::ObString xid_string_; common::ObString gtrid_string_; @@ -107,31 +107,31 @@ class ObXaStmt : public ObStmt, public ObICmd { }; class ObXaStartStmt : public ObXaStmt { - public: +public: explicit ObXaStartStmt() : ObXaStmt(stmt::T_XA_START) {} }; class ObXaEndStmt : public ObXaStmt { - public: +public: explicit ObXaEndStmt() : ObXaStmt(stmt::T_XA_END) {} }; class ObXaPrepareStmt : public ObXaStmt { - public: +public: explicit ObXaPrepareStmt() : ObXaStmt(stmt::T_XA_PREPARE) {} }; class ObXaCommitStmt : public ObXaStmt { - public: +public: explicit ObXaCommitStmt() : ObXaStmt(stmt::T_XA_COMMIT) {} }; class ObXaRollBackStmt : public ObXaStmt { - public: +public: explicit ObXaRollBackStmt() : ObXaStmt(stmt::T_XA_ROLLBACK) {} }; diff --git a/src/sql/rewrite/ob_constraint_process.h b/src/sql/rewrite/ob_constraint_process.h index 771b32e0e..a16c287ec 100644 --- a/src/sql/rewrite/ob_constraint_process.h +++ b/src/sql/rewrite/ob_constraint_process.h @@ -34,14 +34,14 @@ class ObRawExprFactory; class ObSQLSessionInfo; class ObConstraintProcess { - public: +public: ObConstraintProcess(common::ObIAllocator& allocator, ObRawExprFactory* expr_factory, ObSQLSessionInfo* session_info) : allocator_(allocator), expr_factory_(expr_factory), session_info_(session_info) {} int after_transform(ObDMLStmt*& stmt, share::schema::ObSchemaGetterGuard& schema_guard); - private: +private: int resolve_related_part_exprs(const ObRawExpr* expr, ObDMLStmt*& stmt, const share::schema::ObTableSchema& table_schema, common::ObIArray& related_part_exprs); int resolve_constraint_column_expr(ObResolverParams& params, uint64_t table_id, ObDMLStmt*& stmt, @@ -49,7 +49,7 @@ class ObConstraintProcess { int resolve_constraint_column_expr(ObResolverParams& params, uint64_t table_id, ObDMLStmt*& stmt, const common::ObString& expr_str, ObRawExpr*& expr, bool& is_success); - private: +private: common::ObIAllocator& allocator_; ObRawExprFactory* expr_factory_; ObSQLSessionInfo* session_info_; diff --git a/src/sql/rewrite/ob_equal_analysis.h b/src/sql/rewrite/ob_equal_analysis.h index 0cf9da61e..45c7e7f40 100644 --- a/src/sql/rewrite/ob_equal_analysis.h +++ b/src/sql/rewrite/ob_equal_analysis.h @@ -41,7 +41,7 @@ struct EqualSetKey { TO_STRING_KV(K_(expr)); }; class ObEqualAnalysis { - public: +public: explicit ObEqualAnalysis(); virtual ~ObEqualAnalysis(); @@ -64,11 +64,11 @@ class ObEqualAnalysis { static int compute_equal_set(ObIAllocator* allocator, const ObIArray& eset_conditions, const EqualSets& input_equal_sets, EqualSets& output_equal_sets); - protected: +protected: // types and constants typedef common::hash::ObHashMap ColumnSet; - protected: +protected: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObEqualAnalysis); // function members @@ -81,7 +81,7 @@ class ObEqualAnalysis { int check_whether_can_be_merged( const ObExprEqualSet& equal_set, const ObExprEqualSet& another_set, bool& can_be) const; - protected: +protected: // data members common::ObArenaAllocator equal_set_alloc_; ColumnSet column_set_; diff --git a/src/sql/rewrite/ob_equal_set.h b/src/sql/rewrite/ob_equal_set.h index 3040cbf02..c56e8a48f 100644 --- a/src/sql/rewrite/ob_equal_set.h +++ b/src/sql/rewrite/ob_equal_set.h @@ -24,9 +24,9 @@ template class ObEqualSet : public common::ObDLinkBase > { typedef typename common::hash::ObIteratableHashMap::const_iterator_t ColIter; - public: +public: struct ColumnIterator { - public: + public: ColumnIterator(); ColumnIterator(const ObEqualSet* equal_set, const ColIter& col_iter); ~ColumnIterator(); @@ -41,12 +41,12 @@ class ObEqualSet : public common::ObDLinkBase Constants; typedef common::hash::ObIteratableHashMap Expressions; - private: +private: // disallow copy ObEqualSet(const ObEqualSet& other); ObEqualSet& operator=(const ObEqualSet& other); // function members - private: +private: // data members Expressions exprs_; common::ObBitSet flags_; // column flag diff --git a/src/sql/rewrite/ob_expand_aggregate_utils.h b/src/sql/rewrite/ob_expand_aggregate_utils.h index 5fa33b1b5..41fc32253 100644 --- a/src/sql/rewrite/ob_expand_aggregate_utils.h +++ b/src/sql/rewrite/ob_expand_aggregate_utils.h @@ -22,14 +22,14 @@ namespace oceanbase { namespace sql { class ObExpandAggregateUtils { - public: +public: static int expand_aggr_expr(ObDMLStmt* stmt, ObTransformerCtx* ctx, bool& trans_happened); static int expand_window_aggr_expr(ObDMLStmt* stmt, ObTransformerCtx* ctx, bool& trans_happened); static int add_linear_inter_expr(ObDMLStmt* stmt, ObTransformerCtx* ctx, bool& trans_happened); - private: +private: static int add_linear_inter_expr(ObTransformerCtx* ctx, ObAggFunRawExpr* aggr_expr); static bool is_medain_percentile_aggr_type(const ObItemType aggr_type) { diff --git a/src/sql/rewrite/ob_key_part.h b/src/sql/rewrite/ob_key_part.h index e9aceb515..472d9328c 100644 --- a/src/sql/rewrite/ob_key_part.h +++ b/src/sql/rewrite/ob_key_part.h @@ -29,7 +29,7 @@ enum ObKeyPartType { T_NORMAL_KEY = 0, T_LIKE_KEY }; class ObKeyPartId { OB_UNIS_VERSION(1); - public: +public: ObKeyPartId(uint64_t data_table_id = common::OB_INVALID_ID, uint64_t column_id = common::OB_INVALID_ID) : table_id_(data_table_id), column_id_(column_id) {} @@ -60,7 +60,7 @@ class ObKeyPartId { class ObKeyPartPos { OB_UNIS_VERSION(1); - public: +public: ObKeyPartPos(common::ObIAllocator& alloc, int64_t offset = -1) : offset_(offset), column_type_(alloc), enum_set_values_() {} @@ -122,7 +122,7 @@ struct ObLikeKeyPart { class ObKeyPart : public common::ObDLinkBase { OB_UNIS_VERSION_V(1); - public: +public: ObKeyPart(common::ObIAllocator& allocator, uint64_t data_table_id = common::OB_INVALID_ID, uint64_t column_id = common::OB_INVALID_ID, int32_t offset = -1) : allocator_(allocator), @@ -300,10 +300,10 @@ class ObKeyPart : public common::ObDLinkBase { ObKeyPart* cut_general_or_next(); DECLARE_TO_STRING; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObKeyPart); - public: +public: common::ObIAllocator& allocator_; ObKeyPartId id_; ObKeyPartPos pos_; diff --git a/src/sql/rewrite/ob_predicate_deduce.h b/src/sql/rewrite/ob_predicate_deduce.h index 313ed84b0..1adea7e77 100644 --- a/src/sql/rewrite/ob_predicate_deduce.h +++ b/src/sql/rewrite/ob_predicate_deduce.h @@ -21,7 +21,7 @@ class ObPredicateDeduce { enum Type { GT = 1 << 0, GE = 1 << 1, EQ = 1 << 2 }; - public: +public: ObPredicateDeduce(ObDMLStmt& stmt) : stmt_(stmt) {} @@ -53,7 +53,7 @@ class ObPredicateDeduce { expr.has_flag(CNT_SEQ_EXPR) || expr.has_flag(CNT_STATE_FUNC) || expr.has_flag(CNT_USER_VARIABLE); } - private: +private: int init(); int deduce(ObIArray& graph); @@ -187,7 +187,7 @@ class ObPredicateDeduce { int check_index_part_cond(ObTransformerCtx& ctx, ObRawExpr* left_expr, ObRawExpr* right_expr, bool& is_valid); - private: +private: /// the compare meta used by all exprs in the graph ObObjMeta cmp_type_; diff --git a/src/sql/rewrite/ob_query_range.h b/src/sql/rewrite/ob_query_range.h index 3d76aa686..289269888 100644 --- a/src/sql/rewrite/ob_query_range.h +++ b/src/sql/rewrite/ob_query_range.h @@ -40,7 +40,7 @@ typedef common::ObIArray ColumnIArray; class ObQueryRange : public ObQueryRangeProvider { OB_UNIS_VERSION(4); - private: +private: struct ObRangeExprItem { const ObRawExpr* cur_expr_; common::ObSEArray cur_pos_; @@ -73,7 +73,7 @@ class ObQueryRange : public ObQueryRangeProvider { const ParamsIArray* params_; }; - public: +public: enum ObQueryRangeState { NEED_INIT = 0, NEED_TARGET_CND, @@ -138,7 +138,7 @@ class ObQueryRange : public ObQueryRangeProvider { } }; - private: +private: struct ObSearchState { ObSearchState(common::ObIAllocator& allocator) : start_(NULL), @@ -223,7 +223,7 @@ class ObQueryRange : public ObQueryRangeProvider { bool is_precise_get_; }; - public: +public: ObQueryRange(); explicit ObQueryRange(common::ObIAllocator& alloc); virtual ~ObQueryRange(); @@ -327,7 +327,7 @@ class ObQueryRange : public ObQueryRangeProvider { int get_param_value(common::ObObj& val, const ParamsIArray& params) const; DECLARE_TO_STRING; - private: +private: // @brief this function to initialize query range context // @param range_columns[in], columns group with the range order // @return if success, return OB_SUCCESS @@ -449,12 +449,12 @@ class ObQueryRange : public ObQueryRangeProvider { int cast_like_obj_if_needed(const ObObj& string_obj, ObObj& buf_obj, const ObObj*& obj_ptr, ObKeyPart& out_key_part, const ObDataTypeCastParams& dtc_params); - private: +private: static const int64_t COMMON_KEY_PART_NUM = 256; static const int64_t RANGE_BUCKET_SIZE = 1000; typedef common::ObObjStore KeyPartStore; - private: +private: ObRangeGraph table_graph_; ObQueryRangeState state_; int64_t column_count_; diff --git a/src/sql/rewrite/ob_query_range_provider.h b/src/sql/rewrite/ob_query_range_provider.h index 853fa16b6..2431b276f 100644 --- a/src/sql/rewrite/ob_query_range_provider.h +++ b/src/sql/rewrite/ob_query_range_provider.h @@ -29,7 +29,7 @@ typedef common::ObSEArray ObGetMetho typedef common::ObSEArray ColumnArray; class ObQueryRangeProvider { - public: +public: virtual int get_tablet_ranges( ObQueryRangeArray& ranges, ObGetMethodArray& get_methods, const common::ObDataTypeCastParams& dtc_params) = 0; diff --git a/src/sql/rewrite/ob_stmt_comparer.h b/src/sql/rewrite/ob_stmt_comparer.h index 2c2906268..062c60522 100644 --- a/src/sql/rewrite/ob_stmt_comparer.h +++ b/src/sql/rewrite/ob_stmt_comparer.h @@ -81,7 +81,7 @@ struct ObStmtCompareContext : ObExprEqualCheckContext { }; class ObStmtComparer { - public: +public: static int compute_stmt_overlap(ObDMLStmt* first, ObDMLStmt* second, ObStmtMapInfo& map_info); static int check_stmt_containment( diff --git a/src/sql/rewrite/ob_transform_aggr_subquery.h b/src/sql/rewrite/ob_transform_aggr_subquery.h index 26c3f3f72..a1ec5b499 100644 --- a/src/sql/rewrite/ob_transform_aggr_subquery.h +++ b/src/sql/rewrite/ob_transform_aggr_subquery.h @@ -21,7 +21,7 @@ namespace sql { class ObUpdateStmt; class ObTransformAggrSubquery : public ObTransformRule { - public: +public: ObTransformAggrSubquery(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} virtual ~ObTransformAggrSubquery() @@ -29,7 +29,7 @@ class ObTransformAggrSubquery : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: enum PullupFlag { USE_OUTER_JOIN = 1, ADD_CASE_WHEN_EXPR = 2, JOIN_FIRST = 4, AGGR_FIRST = 8 }; /** @@ -160,7 +160,7 @@ class ObTransformAggrSubquery : public ObTransformRule { int extract_no_rewrite_select_exprs(ObDMLStmt*& stmt); int extract_no_rewrite_expr(ObRawExpr* expr); - private: +private: common::ObSEArray no_rewrite_exprs_; }; diff --git a/src/sql/rewrite/ob_transform_aggregate.h b/src/sql/rewrite/ob_transform_aggregate.h index 67b6e79af..a2e69b0ad 100644 --- a/src/sql/rewrite/ob_transform_aggregate.h +++ b/src/sql/rewrite/ob_transform_aggregate.h @@ -40,13 +40,13 @@ class ObAggFunRawExpr; class SelectItem; class ObTransformAggregate : public ObTransformRule { - public: +public: explicit ObTransformAggregate(ObTransformerCtx* ctx); virtual ~ObTransformAggregate(); virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: const static char* SUBQUERY_COL_ALIAS; int is_valid_column_aggregate(ObSelectStmt* stmt, ObAggFunRawExpr*& aggr_expr, bool& is_valid); @@ -92,7 +92,7 @@ class ObTransformAggregate : public ObTransformRule { int is_min_max_const(ObSelectStmt* stmt, ObRawExpr* expr, bool& is_with_const); int is_not_const(ObSelectStmt* stmt, ObRawExpr* expr, bool& is_current_level); - private: +private: int is_valid_select_list(const ObSelectStmt& stmt, const ObRawExpr*& aggr_expr, bool& is_valid); int64_t idx_aggr_column_; bool is_column_aggregate_; diff --git a/src/sql/rewrite/ob_transform_any_all.h b/src/sql/rewrite/ob_transform_any_all.h index 8c4a9f598..f233c23ac 100644 --- a/src/sql/rewrite/ob_transform_any_all.h +++ b/src/sql/rewrite/ob_transform_any_all.h @@ -22,13 +22,13 @@ class ObQueryRefRawExpr; class ObSelectStmt; class ObTransformAnyAll : public ObTransformRule { - public: +public: explicit ObTransformAnyAll(ObTransformerCtx* ctx); virtual ~ObTransformAnyAll(); virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int transform_any_all(ObDMLStmt* stmt, bool& trans_happened); int try_transform_any_all(ObDMLStmt* stmt, ObRawExpr*& expr, bool& trans_happened); diff --git a/src/sql/rewrite/ob_transform_eliminate_outer_join.h b/src/sql/rewrite/ob_transform_eliminate_outer_join.h index 5c488bc57..8dc1795e4 100644 --- a/src/sql/rewrite/ob_transform_eliminate_outer_join.h +++ b/src/sql/rewrite/ob_transform_eliminate_outer_join.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObTransformEliminateOuterJoin : public ObTransformRule { - public: +public: explicit ObTransformEliminateOuterJoin(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} @@ -30,7 +30,7 @@ class ObTransformEliminateOuterJoin : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int eliminate_outer_join(common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened); int recursive_eliminate_outer_join_in_table_item(ObDMLStmt* stmt, TableItem* cur_table_item, diff --git a/src/sql/rewrite/ob_transform_full_outer_join.h b/src/sql/rewrite/ob_transform_full_outer_join.h index 5e7171ada..bdf6a886f 100644 --- a/src/sql/rewrite/ob_transform_full_outer_join.h +++ b/src/sql/rewrite/ob_transform_full_outer_join.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObTransformFullOuterJoin : public ObTransformRule { - public: +public: explicit ObTransformFullOuterJoin(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} virtual ~ObTransformFullOuterJoin() @@ -30,7 +30,7 @@ class ObTransformFullOuterJoin : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: virtual bool need_rewrite(const common::ObIArray& parent_stmts, const ObDMLStmt& stmt) override; int transform_full_outer_join(ObDMLStmt*& stmt, bool& trans_happened); diff --git a/src/sql/rewrite/ob_transform_groupby_placement.h b/src/sql/rewrite/ob_transform_groupby_placement.h index b3f77d7b7..551a092e0 100644 --- a/src/sql/rewrite/ob_transform_groupby_placement.h +++ b/src/sql/rewrite/ob_transform_groupby_placement.h @@ -25,7 +25,7 @@ namespace sql { * [2] Eager Aggregation and Lazy Aggregation */ class ObTransformGroupByPlacement : public ObTransformRule { - public: +public: ObTransformGroupByPlacement(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} @@ -35,10 +35,10 @@ class ObTransformGroupByPlacement : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - protected: +protected: virtual int adjust_transform_types(uint64_t& transform_types) override; - private: +private: struct PullupHelper { PullupHelper() : parent_table_(NULL), @@ -188,7 +188,7 @@ class ObTransformGroupByPlacement : public ObTransformRule { int wrap_case_when(ObSelectStmt& child_stmt, ObRawExpr* not_null_column, ObRawExpr*& expr); - private: +private: // help functions int64_t get_count_sum_num(const ObIArray& exprs) { diff --git a/src/sql/rewrite/ob_transform_join_elimination.h b/src/sql/rewrite/ob_transform_join_elimination.h index a4574e6f9..928eb174f 100644 --- a/src/sql/rewrite/ob_transform_join_elimination.h +++ b/src/sql/rewrite/ob_transform_join_elimination.h @@ -44,7 +44,7 @@ class ObTransformJoinElimination : public ObTransformRule { ObSEArray bitmap_; }; - public: +public: explicit ObTransformJoinElimination(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} @@ -54,7 +54,7 @@ class ObTransformJoinElimination : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int eliminate_join_self_foreign_key(ObDMLStmt* stmt, bool& trans_happened); int eliminate_join_in_from_base_table(ObDMLStmt* stmt, bool& trans_happened); diff --git a/src/sql/rewrite/ob_transform_materialized_view.h b/src/sql/rewrite/ob_transform_materialized_view.h index d46ea1bb3..05fd3dbcb 100644 --- a/src/sql/rewrite/ob_transform_materialized_view.h +++ b/src/sql/rewrite/ob_transform_materialized_view.h @@ -34,7 +34,7 @@ struct MVDesc { }; class ObTransformMaterializedView : public ObTransformRule { - public: +public: explicit ObTransformMaterializedView(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} virtual ~ObTransformMaterializedView() @@ -42,7 +42,7 @@ class ObTransformMaterializedView : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: uint64_t get_real_tid(uint64_t tid, ObSelectStmt& stmt); int is_col_in_mv(uint64_t tid, uint64_t cid, MVDesc mv_desc, bool& result); int is_all_column_covered(ObSelectStmt& stmt, MVDesc mv_desc, const JoinTableIdPair& idp, bool& result); @@ -67,7 +67,7 @@ class ObTransformMaterializedView : public ObTransformRule { int get_join_tid_cid( uint64_t tid, uint64_t cid, uint64_t& out_tid, uint64_t& out_cid, const share::schema::ObTableSchema& mv_schema); - private: +private: }; } // namespace sql diff --git a/src/sql/rewrite/ob_transform_or_expansion.h b/src/sql/rewrite/ob_transform_or_expansion.h index aac8b3348..0e5f47606 100644 --- a/src/sql/rewrite/ob_transform_or_expansion.h +++ b/src/sql/rewrite/ob_transform_or_expansion.h @@ -25,7 +25,7 @@ class ObTransformOrExpansion : public ObTransformRule { static const int64_t MAX_TIMES_FOR_OR_EXPANSION; typedef ObBitSet<8> ColumnBitSet; - public: +public: ObTransformOrExpansion(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::PRE_ORDER), try_times_(0) {} virtual ~ObTransformOrExpansion() @@ -33,10 +33,10 @@ class ObTransformOrExpansion : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - protected: +protected: virtual int adjust_transform_types(uint64_t& transform_types) override; - private: +private: int check_stmt_validity(ObDMLStmt& stmt, bool& is_valid); int check_select_expr_validity(ObSelectStmt& stmt, bool& is_valid); @@ -84,7 +84,7 @@ class ObTransformOrExpansion : public ObTransformRule { DISALLOW_COPY_AND_ASSIGN(ObTransformOrExpansion); - private: +private: int64_t try_times_; }; diff --git a/src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.h b/src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.h index 9f8f2ee4e..08fc6bf9e 100644 --- a/src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.h +++ b/src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.h @@ -26,7 +26,7 @@ class ObIAllocator; namespace sql { class ObRawExpr; class ObTransformOuterJoinLimitPushDown : public ObTransformRule { - private: +private: struct OjLimitPushDownHelper { OjLimitPushDownHelper() : select_stmt_(NULL), @@ -51,7 +51,7 @@ class ObTransformOuterJoinLimitPushDown : public ObTransformRule { K_(is_limit_only), K_(need_create_view)); }; - public: +public: explicit ObTransformOuterJoinLimitPushDown(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::PRE_ORDER) {} @@ -61,7 +61,7 @@ class ObTransformOuterJoinLimitPushDown : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int check_stmt_validity(ObDMLStmt* stmt, OjLimitPushDownHelper& helper, bool& is_valid); int do_transform(OjLimitPushDownHelper& helper); diff --git a/src/sql/rewrite/ob_transform_post_process.h b/src/sql/rewrite/ob_transform_post_process.h index 2635d4672..3d726a858 100644 --- a/src/sql/rewrite/ob_transform_post_process.h +++ b/src/sql/rewrite/ob_transform_post_process.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObTransformPostProcess : public ObTransformRule { - public: +public: ObTransformPostProcess(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} @@ -29,7 +29,7 @@ class ObTransformPostProcess : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int extract_calculable_expr(ObDMLStmt*& stmt, bool& trans_happened); int transform_for_hierarchical_query(ObDMLStmt* stmt, bool& trans_happened); diff --git a/src/sql/rewrite/ob_transform_pre_process.h b/src/sql/rewrite/ob_transform_pre_process.h index 5f4d81d93..426d43149 100644 --- a/src/sql/rewrite/ob_transform_pre_process.h +++ b/src/sql/rewrite/ob_transform_pre_process.h @@ -37,7 +37,7 @@ struct MVDesc { }; class ObTransformPreProcess : public ObTransformRule { - public: +public: explicit ObTransformPreProcess(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER), mock_table_set_(), origin_table_set_() {} @@ -50,7 +50,7 @@ class ObTransformPreProcess : public ObTransformRule { static int transform_expr( ObRawExprFactory& expr_factory, const ObSQLSessionInfo& session, ObRawExpr*& expr, bool& trans_happened); - private: +private: // used for transform in expr to or exprs struct DistinctObjMeta { ObObjType obj_type_; @@ -237,7 +237,7 @@ class ObTransformPreProcess : public ObTransformRule { int extract_replace_expr_from_select_expr( ObRawExpr* expr, ObSelectStmt* select_stmt, ObIArray& old_exprs); - private: +private: ObRelIds mock_table_set_; ObRelIds origin_table_set_; DISALLOW_COPY_AND_ASSIGN(ObTransformPreProcess); diff --git a/src/sql/rewrite/ob_transform_predicate_move_around.h b/src/sql/rewrite/ob_transform_predicate_move_around.h index bad0af7ad..156984472 100644 --- a/src/sql/rewrite/ob_transform_predicate_move_around.h +++ b/src/sql/rewrite/ob_transform_predicate_move_around.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace sql { class ObInsertStmt; class ObTransformPredicateMoveAround : public ObTransformRule { - public: +public: ObTransformPredicateMoveAround(ObTransformerCtx* ctx); virtual ~ObTransformPredicateMoveAround(); @@ -27,7 +27,7 @@ class ObTransformPredicateMoveAround : public ObTransformRule { virtual int transform_one_stmt( ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: virtual bool need_rewrite(const common::ObIArray& parent_stmts, const ObDMLStmt& stmt); int pullup_predicates(ObDMLStmt* stmt, ObIArray& select_list, ObIArray& properties); @@ -127,7 +127,7 @@ class ObTransformPredicateMoveAround : public ObTransformRule { int print_debug_info(const char* str, ObDMLStmt* stmt, ObIArray& preds); - private: +private: typedef ObSEArray PullupPreds; ObArenaAllocator allocator_; hash::ObHashMap stmt_map_; diff --git a/src/sql/rewrite/ob_transform_project_pruning.h b/src/sql/rewrite/ob_transform_project_pruning.h index 4b1f014b7..0aae8c89a 100644 --- a/src/sql/rewrite/ob_transform_project_pruning.h +++ b/src/sql/rewrite/ob_transform_project_pruning.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObTransformProjectPruning : public ObTransformRule { - public: +public: explicit ObTransformProjectPruning(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::PRE_ORDER) {} virtual ~ObTransformProjectPruning() @@ -28,7 +28,7 @@ class ObTransformProjectPruning : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int project_pruning(const uint64_t table_id, ObSelectStmt& child_stmt, ObDMLStmt& upper_stmt, bool& trans_happened); int is_const_expr(ObRawExpr* expr, bool& is_const); @@ -36,7 +36,7 @@ class ObTransformProjectPruning : public ObTransformRule { int check_transform_validity(const ObSelectStmt& stmt, bool& is_valid); int check_need_remove(ObSelectStmt* stmt, const int64_t idx, bool& need_remove); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransformProjectPruning); }; diff --git a/src/sql/rewrite/ob_transform_query_push_down.h b/src/sql/rewrite/ob_transform_query_push_down.h index b1407a170..525b56ef3 100644 --- a/src/sql/rewrite/ob_transform_query_push_down.h +++ b/src/sql/rewrite/ob_transform_query_push_down.h @@ -25,7 +25,7 @@ class ObIAllocator; namespace sql { class ObRawExpr; class ObTransformQueryPushDown : public ObTransformRule { - public: +public: explicit ObTransformQueryPushDown(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} virtual ~ObTransformQueryPushDown() @@ -34,7 +34,7 @@ class ObTransformQueryPushDown : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int check_transform_validity(ObSelectStmt* select_stmt, ObSelectStmt* view_stmt, bool& can_transform, bool& need_distinct, bool& transform_having, common::ObIArray& select_offset, common::ObIArray& const_select_items); diff --git a/src/sql/rewrite/ob_transform_rule.h b/src/sql/rewrite/ob_transform_rule.h index af2813c28..96c5ffd7f 100644 --- a/src/sql/rewrite/ob_transform_rule.h +++ b/src/sql/rewrite/ob_transform_rule.h @@ -128,7 +128,7 @@ struct ObParentDMLStmt { }; class ObTransformRule { - public: +public: static constexpr const double COST_BASE_TRANSFORM_THRESHOLD = 0.999; static const int64_t TRANSFORMER_DEFAULT_MAX_RECURSIVE_LEVEL = 150; static const uint64_t ALL_TRANSFORM_RULES = TRANSFORM_TYPE_COUNT_PLUS_ONE - 1; @@ -173,7 +173,7 @@ class ObTransformRule { return transformer_type_; } - protected: +protected: /* * This function tries to recursively transform all statements including its child statements * By default, there are two options, pre-order transformation and post-order transformation @@ -203,7 +203,7 @@ class ObTransformRule { */ virtual int adjust_transform_types(uint64_t& transform_types); - private: +private: // pre-order transformation int transform_pre_order( common::ObIArray& parent_stmts, const int64_t current_level, ObDMLStmt*& stmt); @@ -228,14 +228,14 @@ class ObTransformRule { DISALLOW_COPY_AND_ASSIGN(ObTransformRule); - protected: +protected: ObTransformerCtx* ctx_; TransMethod transform_method_; uint64_t transformer_type_; bool trans_happened_; bool cost_based_trans_tried_; - private: +private: double stmt_cost_; }; diff --git a/src/sql/rewrite/ob_transform_semi_to_inner.h b/src/sql/rewrite/ob_transform_semi_to_inner.h index 3a58e225c..acd7090ea 100644 --- a/src/sql/rewrite/ob_transform_semi_to_inner.h +++ b/src/sql/rewrite/ob_transform_semi_to_inner.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObTransformSemiToInner : public ObTransformRule { - public: +public: ObTransformSemiToInner(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} virtual ~ObTransformSemiToInner() @@ -28,7 +28,7 @@ class ObTransformSemiToInner : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int transform_semi_to_inner(ObDMLStmt* root_stmt, ObDMLStmt* stmt, const SemiInfo* pre_semi_info, ObDMLStmt*& trans_stmt, bool& need_check_cost, bool& trans_happened); @@ -71,7 +71,7 @@ class ObTransformSemiToInner : public ObTransformRule { int check_stmt_limit_validity(const ObSelectStmt* select_stmt, bool& is_valid, bool& need_add_const_constraint); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransformSemiToInner); }; diff --git a/src/sql/rewrite/ob_transform_set_op.h b/src/sql/rewrite/ob_transform_set_op.h index 3b1e9f8d5..0b045db7d 100644 --- a/src/sql/rewrite/ob_transform_set_op.h +++ b/src/sql/rewrite/ob_transform_set_op.h @@ -24,7 +24,7 @@ class ObExprCtx; namespace sql { class ObTransformSetOp : public ObTransformRule { - public: +public: explicit ObTransformSetOp(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::PRE_ORDER) {} virtual ~ObTransformSetOp() @@ -32,7 +32,7 @@ class ObTransformSetOp : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int add_limit_order_distinct_for_union( const common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened); int remove_order_by_for_set(ObDMLStmt*& stmt, bool& trans_happened); @@ -49,7 +49,7 @@ class ObTransformSetOp : public ObTransformRule { int add_limit_order_for_union(const common::ObIArray& parent_stmts, ObSelectStmt*& stmt); int check_can_pre_push(ObSelectStmt* stmt, ObSelectStmt* upper_stmt, bool& can_push); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransformSetOp); }; diff --git a/src/sql/rewrite/ob_transform_simplify.h b/src/sql/rewrite/ob_transform_simplify.h index 2a68b8262..52383b009 100644 --- a/src/sql/rewrite/ob_transform_simplify.h +++ b/src/sql/rewrite/ob_transform_simplify.h @@ -26,7 +26,7 @@ class JoinedTable; namespace sql { class ObPhysicalPlan; class ObTransformSimplify : public ObTransformRule { - public: +public: explicit ObTransformSimplify(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} virtual ~ObTransformSimplify() @@ -34,7 +34,7 @@ class ObTransformSimplify : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int having_filter_can_be_pushed_down( const ObRawExpr* having_filter, const ObSelectStmt& select_stmt, const bool has_rownum, bool& can_be); int replace_is_null_condition(ObDMLStmt* stmt, bool& trans_happened); @@ -164,7 +164,7 @@ class ObTransformSimplify : public ObTransformRule { int create_view_with_left_table(ObDMLStmt* stmt, JoinedTable* joined_table); int push_down_on_condition(ObDMLStmt* stmt, JoinedTable* join_table, ObIArray& conds); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransformSimplify); }; diff --git a/src/sql/rewrite/ob_transform_subquery_coalesce.h b/src/sql/rewrite/ob_transform_subquery_coalesce.h index 45cb37da0..945e3c266 100644 --- a/src/sql/rewrite/ob_transform_subquery_coalesce.h +++ b/src/sql/rewrite/ob_transform_subquery_coalesce.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObTransformSubqueryCoalesce : public ObTransformRule { - public: +public: ObTransformSubqueryCoalesce(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} virtual ~ObTransformSubqueryCoalesce() @@ -29,10 +29,10 @@ class ObTransformSubqueryCoalesce : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - protected: +protected: int adjust_transform_types(uint64_t& transform_types); - private: +private: enum TransformFlag { DEFAULT, EXISTS_NOT_EXISTS, ANY_ALL }; struct TransformParam { ObRawExpr* exists_expr_; @@ -83,7 +83,7 @@ class ObTransformSubqueryCoalesce : public ObTransformRule { int get_same_classify_exprs(ObIArray& validity_exprs, ObIArray& same_classify_exprs, ObItemType ctype, ObExprInfoFlag flag); - private: +private: ObQueryRefRawExpr* get_exists_query_expr(ObRawExpr* expr); ObQueryRefRawExpr* get_any_all_query_expr(ObRawExpr* expr); diff --git a/src/sql/rewrite/ob_transform_utils.h b/src/sql/rewrite/ob_transform_utils.h index e2a2bcccd..e1644c8c9 100644 --- a/src/sql/rewrite/ob_transform_utils.h +++ b/src/sql/rewrite/ob_transform_utils.h @@ -43,7 +43,7 @@ enum CheckStmtUniqueFlags { }; class ObTransformUtils { - private: +private: struct UniqueCheckInfo { UniqueCheckInfo() {} @@ -60,7 +60,7 @@ class ObTransformUtils { int assign(const UniqueCheckInfo& other); void reset(); - private: + private: DISALLOW_COPY_AND_ASSIGN(UniqueCheckInfo); }; struct UniqueCheckHelper { @@ -76,11 +76,11 @@ class ObTransformUtils { ObSchemaChecker* schema_checker_; ObSQLSessionInfo* session_info_; - private: + private: DISALLOW_COPY_AND_ASSIGN(UniqueCheckHelper); }; - public: +public: static int is_correlated_expr(const ObRawExpr* expr, int32_t correlated_level, bool& is_correlated); static int is_direct_correlated_expr(const ObRawExpr* expr, int32_t correlated_level, bool& is_direct_correlated); @@ -734,7 +734,7 @@ class ObTransformUtils { static int replace_with_groupby_exprs(ObSelectStmt* select_stmt, ObRawExpr*& expr); - private: +private: static int create_select_item_for_subquery( ObSelectStmt& stmt, ObSelectStmt*& child_stmt, ObIAllocator& alloc, ObIArray& query_ref_exprs); diff --git a/src/sql/rewrite/ob_transform_view_merge.h b/src/sql/rewrite/ob_transform_view_merge.h index 3b8f971de..8bb3e69c9 100644 --- a/src/sql/rewrite/ob_transform_view_merge.h +++ b/src/sql/rewrite/ob_transform_view_merge.h @@ -28,7 +28,7 @@ namespace sql { class ObDelUpdStmt; class ObTransformViewMerge : public ObTransformRule { - public: +public: ObTransformViewMerge(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER), for_post_process_(false) {} virtual ~ObTransformViewMerge() @@ -42,7 +42,7 @@ class ObTransformViewMerge : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: struct ViewMergeHelper { ViewMergeHelper() : parent_table(NULL), diff --git a/src/sql/rewrite/ob_transform_where_subquery_pullup.h b/src/sql/rewrite/ob_transform_where_subquery_pullup.h index 2ff0441ff..3f29fe5d8 100644 --- a/src/sql/rewrite/ob_transform_where_subquery_pullup.h +++ b/src/sql/rewrite/ob_transform_where_subquery_pullup.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObWhereSubQueryPullup : public ObTransformRule { - public: +public: ObWhereSubQueryPullup(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} virtual ~ObWhereSubQueryPullup() @@ -37,7 +37,7 @@ class ObWhereSubQueryPullup : public ObTransformRule { return allocator; } - private: +private: struct TransformParam { TransformParam() : op_(NULL), @@ -219,7 +219,7 @@ class ObWhereSubQueryPullup : public ObTransformRule { int add_limit_for_exists_subquery(ObDMLStmt* stmt, bool& trans_happened); int recursive_add_limit_for_exists_expr(ObRawExpr* expr, bool& trans_happened); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObWhereSubQueryPullup); }; diff --git a/src/sql/rewrite/ob_transform_win_groupby.h b/src/sql/rewrite/ob_transform_win_groupby.h index 22b83f74b..5fe53944b 100644 --- a/src/sql/rewrite/ob_transform_win_groupby.h +++ b/src/sql/rewrite/ob_transform_win_groupby.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class ObTransformWinGroupBy : public ObTransformRule { - private: +private: struct WinGroupByHelper { WinGroupByHelper() : transformed_stmt_(NULL), @@ -66,7 +66,7 @@ class ObTransformWinGroupBy : public ObTransformRule { K_(outer_old_exprs), K_(outer_new_exprs)); }; - public: +public: explicit ObTransformWinGroupBy(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} @@ -76,7 +76,7 @@ class ObTransformWinGroupBy : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - private: +private: int do_win_groupby_transform(WinGroupByHelper& helper); int adjust_inner_stmt(WinGroupByHelper& helper); int adjust_outer_stmt(WinGroupByHelper& helper); diff --git a/src/sql/rewrite/ob_transform_win_magic.h b/src/sql/rewrite/ob_transform_win_magic.h index 004b61e8d..5f8e65317 100644 --- a/src/sql/rewrite/ob_transform_win_magic.h +++ b/src/sql/rewrite/ob_transform_win_magic.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { struct ObStmtMapInfo; class ObTransformWinMagic : public ObTransformRule { - public: +public: ObTransformWinMagic(ObTransformerCtx* ctx) : ObTransformRule(ctx, TransMethod::POST_ORDER) {} @@ -31,10 +31,10 @@ class ObTransformWinMagic : public ObTransformRule { virtual int transform_one_stmt( common::ObIArray& parent_stmts, ObDMLStmt*& stmt, bool& trans_happened) override; - protected: +protected: virtual int adjust_transform_types(uint64_t& transform_types) override; - private: +private: int check_subquery_validity(ObDMLStmt* stmt, ObQueryRefRawExpr* query_ref, ObStmtMapInfo& map_info, bool& is_valid); int check_aggr_expr_validity(ObSelectStmt& subquery, bool& is_valid); diff --git a/src/sql/rewrite/ob_transformer_impl.h b/src/sql/rewrite/ob_transformer_impl.h index 8bb2b9623..99a34e382 100644 --- a/src/sql/rewrite/ob_transformer_impl.h +++ b/src/sql/rewrite/ob_transformer_impl.h @@ -46,7 +46,7 @@ class ObTransformerImpl { static const int64_t DEFAULT_ITERATION_COUNT = 10; static const int64_t MAX_RULE_COUNT = 64; - public: +public: ObTransformerImpl(ObTransformerCtx* ctx) : ctx_(ctx), needed_transform_types_(0), max_iteration_count_(ObTransformerImpl::DEFAULT_ITERATION_COUNT) { @@ -132,12 +132,12 @@ class ObTransformerImpl { return ctx_; } - private: +private: int collect_trans_stat(const ObTransformRule& rule); void print_trans_stat(); - private: +private: ObTransformerCtx* ctx_; uint64_t needed_transform_types_; int64_t max_iteration_count_; diff --git a/src/sql/session/ob_basic_session_info.h b/src/sql/session/ob_basic_session_info.h index 641494cf2..a24efe8fe 100644 --- a/src/sql/session/ob_basic_session_info.h +++ b/src/sql/session/ob_basic_session_info.h @@ -46,7 +46,7 @@ namespace oceanbase { namespace sql { class ObPCMemPctConf; class ObPartitionHitInfo { - public: +public: ObPartitionHitInfo() : value_(true), freeze_(false) {} ~ObPartitionHitInfo() @@ -70,7 +70,7 @@ class ObPartitionHitInfo { freeze_ = false; } - private: +private: bool value_; bool freeze_; }; @@ -128,7 +128,7 @@ enum ObSessionRetryStatus { class ObBasicSessionInfo { OB_UNIS_VERSION_V(1); - public: +public: // 256KB ~= 4 * OB_COMMON_MEM_BLOCK_SIZE static const int64_t APPROX_MEM_USAGE_PER_SESSION = 256 * 1024L; static const uint64_t VALID_PROXY_SESSID = 0; @@ -152,7 +152,7 @@ class ObBasicSessionInfo { class TableStmtType { OB_UNIS_VERSION_V(1); - public: + public: TableStmtType() : table_id_(common::OB_INVALID_ID), stmt_type_(stmt::T_NONE) {} virtual ~TableStmtType() @@ -167,7 +167,7 @@ class ObBasicSessionInfo { } TO_STRING_KV(K(table_id_), K(stmt_type_)); - public: + public: uint64_t table_id_; stmt::StmtType stmt_type_; }; @@ -175,7 +175,7 @@ class ObBasicSessionInfo { static const int64_t MIN_CUR_QUERY_LEN = 512; static const int64_t MAX_CUR_QUERY_LEN = 16 * 1024; class TransFlags { - public: + public: TransFlags() : flags_(0) {} virtual ~TransFlags() @@ -261,7 +261,7 @@ class ObBasicSessionInfo { return flags_; } - private: + private: inline void set_flag(bool value, uint64_t flag) { if (value) { @@ -272,7 +272,7 @@ class ObBasicSessionInfo { return; } - private: + private: static const uint64_t IS_IN_TRANSACTION = 1ULL << 0; static const uint64_t HAS_EXEC_WRITE_STMT = 1ULL << 1; static const uint64_t HAS_SET_TRANS_VAR = 1ULL << 2; // has executed set transaction stmt. @@ -293,7 +293,7 @@ class ObBasicSessionInfo { // common members with different operations in TransSavedValue or StmtSavedValue. // you need follow this principle when adding new members in future. class BaseSavedValue { - public: + public: BaseSavedValue() { reset(); @@ -313,7 +313,7 @@ class ObBasicSessionInfo { need_serial_exec_ = false; } - public: + public: ObPhysicalPlan* cur_phy_plan_; char cur_query_[MAX_CUR_QUERY_LEN]; volatile int64_t cur_query_len_; @@ -327,11 +327,11 @@ class ObBasicSessionInfo { bool is_foreign_key_check_exist_; bool need_serial_exec_; - public: + public: }; // for switch stmt. class StmtSavedValue : public BaseSavedValue { - public: + public: StmtSavedValue() { reset(); @@ -345,7 +345,7 @@ class ObBasicSessionInfo { in_transaction_ = false; } - public: + public: transaction::ObTransDesc trans_desc_; TransResult trans_result_; int64_t cur_query_start_time_; @@ -353,7 +353,7 @@ class ObBasicSessionInfo { }; // for switch trans. class TransSavedValue : public BaseSavedValue { - public: + public: TransSavedValue() { reset(); @@ -367,14 +367,14 @@ class ObBasicSessionInfo { nested_count_ = -1; } - public: + public: transaction::ObTransDesc trans_desc_; TransFlags trans_flags_; TransResult trans_result_; int64_t nested_count_; }; - public: +public: ObBasicSessionInfo(); virtual ~ObBasicSessionInfo(); @@ -989,7 +989,7 @@ class ObBasicSessionInfo { class SysVarIncInfo { OB_UNIS_VERSION_V(1); - public: + public: SysVarIncInfo(); virtual ~SysVarIncInfo(); int add_sys_var_id(share::ObSysVarClassType sys_var_id); @@ -1001,7 +1001,7 @@ class ObBasicSessionInfo { int reset(); TO_STRING_KV(K(all_sys_var_ids_)); - private: + private: SysVarIds all_sys_var_ids_; }; int load_all_sys_vars_default(); @@ -1544,7 +1544,7 @@ class ObBasicSessionInfo { } int load_default_sys_variable(int64_t var_idx); - protected: +protected: int process_session_variable( share::ObSysVarClassType var, const common::ObObj& value, bool is_inc, const bool check_timezone_valid = true); int process_session_variable_fast(); @@ -1566,14 +1566,14 @@ class ObBasicSessionInfo { int trans_restore_session(TransSavedValue& saved_value); // ^^^^^^ - protected: +protected: // because the OB_MALLOC_NORMAL_BLOCK_SIZE block in ObPool has a BlockHeader(8 Bytes), // so the total mem avail is (OB_MALLOC_NORMAL_BLOCK_SIZE - 8), if we divide it by (4 * 1204), // the last (4 * 1024 - 8) is wasted. // and if we divide it by (4 * 1024 - 8), almost all mem can be used. static const int64_t SMALL_BLOCK_SIZE = 4 * 1024LL - 8; - private: +private: // these reset_xxx() functions below should be called inner only, you should // call reset_tx_variable() when you need reset a session object. void reset_tx_read_only(); @@ -1616,7 +1616,7 @@ class ObBasicSessionInfo { inline int store_query_string_(const ObString& stmt); inline int set_session_state_(ObSQLSessionState state); - protected: +protected: // the following members need concurrency control struct MultiThreadData { const static int64_t DEFAULT_MAX_PACKET_SIZE = 1048576; @@ -1706,12 +1706,12 @@ class ObBasicSessionInfo { ObSessionRetryStatus is_in_retry_; }; - private: +private: // cache some system variables for performance. class SysVarsCacheData { OB_UNIS_VERSION_V(1); - public: + public: SysVarsCacheData() : auto_increment_increment_(0), sql_throttle_current_priority_(100), @@ -1852,7 +1852,7 @@ class ObBasicSessionInfo { K_(sql_select_limit), K_(optimizer_use_sql_plan_baselines), K_(optimizer_capture_sql_plan_baselines), K_(is_result_accurate), K_(_ob_use_parallel_execution), K_(character_set_results), K_(ob_pl_block_timeout)); - public: + public: static const int64_t MAX_NLS_FORMAT_STR_LEN = 256; // need NOT serialization. @@ -1896,7 +1896,7 @@ class ObBasicSessionInfo { ObString ob_trace_info_; char trace_info_buf_[OB_TRACE_BUFFER_SIZE]; - private: + private: char nls_formats_buf_[ObNLSFormatEnum::NLS_MAX][MAX_NLS_FORMAT_STR_LEN]; }; @@ -1945,13 +1945,13 @@ class ObBasicSessionInfo { } class SysVarsCache { - public: + public: SysVarsCache() : inc_flags_(0) {} ~SysVarsCache() {} - public: + public: void reset() { base_data_.reset(); @@ -2019,7 +2019,7 @@ class ObBasicSessionInfo { is_inc = inc_autocommit_; } - public: + public: SysVarsCacheData base_data_; SysVarsCacheData inc_data_; union { @@ -2065,7 +2065,7 @@ class ObBasicSessionInfo { }; }; - private: +private: int64_t get_ser_version(uint64_t tenant_id, uint64_t eff_tenant_id) const; static const int64_t PRE_SER_VERSION = 0; static const int64_t CUR_SER_VERSION = 1; @@ -2106,14 +2106,14 @@ class ObBasicSessionInfo { common::ObSEArray cur_stmt_tables_; char ssl_cipher_buff_[64]; - protected: +protected: common::ObSmallBlockAllocator<> block_allocator_; common::ObSmallBlockAllocator<> ps_session_info_allocator_; common::ObStringBuf name_pool_; // for variables names and statement names common::ObStringBuf base_sys_var_alloc_; // for variables names and statement names TransFlags trans_flags_; - private: +private: common::ObWrapperAllocator bucket_allocator_wrapper_; ObSessionValMap user_var_val_map_; // user variables share::ObBasicSysVar* sys_vars_[share::ObSysVarFactory::ALL_SYS_VARS_COUNT]; // system variables @@ -2165,18 +2165,18 @@ class ObBasicSessionInfo { // used to determine whether it is a retry query. common::ObCurTraceId::TraceId last_query_trace_id_; - protected: +protected: // this should be used by subclass, so need be protected MultiThreadData thread_data_; // nested session and sql execute for foreign key, trigger, pl udf, and so on. // inited to -1, set to 0 for main query, inc / dec for nested query. int64_t nested_count_; - private: +private: // local cache of system variables for performance. SysVarsCache sys_vars_cache_; - private: +private: int64_t safe_weak_read_snapshot_; int64_t weak_read_snapshot_source_; @@ -2201,7 +2201,7 @@ class ObBasicSessionInfo { uint64_t exec_min_cluster_version_; stmt::StmtType stmt_type_; - private: +private: // used for all_virtual_processlist. int64_t thread_id_; // indicate whether user password is expired, is set when session is established. @@ -2350,7 +2350,7 @@ inline int ObBasicSessionInfo::set_partition_location_feedback(const share::ObFB // object execute environment. class ObExecEnv { - public: +public: enum ExecEnvType { SQL_MODE = 0, CHARSET_CLIENT, @@ -2404,10 +2404,10 @@ class ObExecEnv { return collation_database_; } - private: +private: static int get_exec_env(const ObString& exec_env, ExecEnvType type, ObString& value); - private: +private: ObSQLMode sql_mode_; ObCollationType charset_client_; ObCollationType collation_connection_; diff --git a/src/sql/session/ob_erase_session_callback.h b/src/sql/session/ob_erase_session_callback.h index 5d07c0408..973a7a1f8 100644 --- a/src/sql/session/ob_erase_session_callback.h +++ b/src/sql/session/ob_erase_session_callback.h @@ -18,7 +18,7 @@ class ObEndTransReq; } namespace sql { class ObIEraseSessionCallback { - public: +public: ObIEraseSessionCallback(); virtual ~ObIEraseSessionCallback(); virtual int callback(common::ObEndTransReq& req) = 0; diff --git a/src/sql/session/ob_prepared_sql_store.h b/src/sql/session/ob_prepared_sql_store.h index ad34c2b03..b64a56de9 100644 --- a/src/sql/session/ob_prepared_sql_store.h +++ b/src/sql/session/ob_prepared_sql_store.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObPreparedSqlValue { - public: +public: ObPreparedSqlValue() : ref_count_(0) {} @@ -49,7 +49,7 @@ class ObPreparedSqlValue { }; class ObPreparedSqlStoreAtomic { - public: +public: ObPreparedSqlStoreAtomic() : rc_(common::OB_SUCCESS), value_(NULL) {} @@ -76,14 +76,14 @@ class ObPreparedSqlStoreAtomic { return value_; } - protected: +protected: int rc_; ObPreparedSqlValue* value_; common::ObString sql_; }; class ObPreparedSqlStoreAddRef : public ObPreparedSqlStoreAtomic { - public: +public: ObPreparedSqlStoreAddRef() {} @@ -109,7 +109,7 @@ class ObPreparedSqlStoreAddRef : public ObPreparedSqlStoreAtomic { }; class ObPreparedSqlStoreDecRef : public ObPreparedSqlStoreAtomic { - public: +public: ObPreparedSqlStoreDecRef() {} @@ -135,7 +135,7 @@ class ObPreparedSqlStoreDecRef : public ObPreparedSqlStoreAtomic { }; class ObPreparedSqlStore { - public: +public: ObPreparedSqlStore() : allocator_(common::get_global_tc_allocator()) {} @@ -144,7 +144,7 @@ class ObPreparedSqlStore { int init(); - public: +public: int store_sql(const common::ObString& sql, common::ObString& osql); int free_sql(const common::ObString& sql); // typedef common::ObPooledAllocator PreparedSqlMap; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPreparedSqlStore); - private: +private: PreparedSqlMap psmap_; // common::ObBuddyAllocator allocator_; }; diff --git a/src/sql/session/ob_ps_session_info.h b/src/sql/session/ob_ps_session_info.h index 6776304b0..4b6064ad9 100644 --- a/src/sql/session/ob_ps_session_info.h +++ b/src/sql/session/ob_ps_session_info.h @@ -24,12 +24,12 @@ static const int64_t OB_SESSION_SMALL_BLOCK_SIZE = 4 * 1024LL; // Each prepared statements has one object of this type in the session. // The object is immutable during the life of the prepared statement. class ObPsSessionInfo { - public: +public: typedef common::ObSegmentArray > ParamsType; - public: +public: ObPsSessionInfo() : sql_id_(0), params_count_(0), stmt_type_(stmt::T_NONE), params_type_(), prepare_sql_(), is_dml_(false) {} @@ -84,10 +84,10 @@ class ObPsSessionInfo { return is_dml_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPsSessionInfo); - private: +private: uint64_t sql_id_; // key of plan cache int64_t params_count_; stmt::StmtType stmt_type_; // used by query result cache before got the plan diff --git a/src/sql/session/ob_session_val_map.h b/src/sql/session/ob_session_val_map.h index 5a3d9fc61..241dda3d1 100644 --- a/src/sql/session/ob_session_val_map.h +++ b/src/sql/session/ob_session_val_map.h @@ -34,13 +34,13 @@ class ObSessionValMap { common::ObWrapperAllocator> VarNameValMapAllocer; - public: +public: typedef common::hash::ObHashMap, common::hash::equal_to, VarNameValMapAllocer, common::hash::NormalPointer, common::ObWrapperAllocator> VarNameValMap; - public: +public: ObSessionValMap(); ObSessionValMap(const int64_t block_size, const common::ObWrapperAllocator& block_allocator); virtual ~ObSessionValMap(); @@ -68,10 +68,10 @@ class ObSessionValMap { } NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: int free_mem(); - private: +private: static const int64_t SMALL_BLOCK_SIZE = 4 * 1024LL; common::ObSmallBlockAllocator<> block_allocator_; VarNameValMapAllocer var_name_val_map_allocer_; diff --git a/src/sql/session/ob_sql_session_info.h b/src/sql/session/ob_sql_session_info.h index 7fa7b6ca1..a5cfb9660 100644 --- a/src/sql/session/ob_sql_session_info.h +++ b/src/sql/session/ob_sql_session_info.h @@ -57,7 +57,7 @@ class ObStmt; class ObSQLSessionInfo; class SessionInfoKey { - public: +public: SessionInfoKey() : version_(0), sessid_(0), proxy_sessid_(0) {} SessionInfoKey(uint32_t version, uint32_t sessid, uint64_t proxy_sessid = 0) @@ -89,7 +89,7 @@ class SessionInfoKey { return cmp; } - public: +public: uint32_t version_; uint32_t sessid_; uint64_t proxy_sessid_; @@ -123,7 +123,7 @@ struct ObSessionStat final { }; class ObTenantCachedSchemaGuardInfo { - public: +public: ObTenantCachedSchemaGuardInfo() { reset(); @@ -142,7 +142,7 @@ class ObTenantCachedSchemaGuardInfo { void try_revert_schema_guard(); - private: +private: share::schema::ObSchemaGetterGuard schema_guard_; int64_t ref_ts_; uint64_t tenant_id_; @@ -150,7 +150,7 @@ class ObTenantCachedSchemaGuardInfo { }; class ObIExtraStatusCheck : public common::ObDLinkBase { - public: +public: virtual ~ObIExtraStatusCheck() {} @@ -158,11 +158,11 @@ class ObIExtraStatusCheck : public common::ObDLinkBase { virtual int check() const = 0; class Guard { - public: + public: Guard(ObSQLSessionInfo& session, ObIExtraStatusCheck& checker); ~Guard(); - private: + private: ObSQLSessionInfo& session_; ObIExtraStatusCheck& checker_; }; @@ -175,11 +175,11 @@ typedef common::LinkHashValue SessionInfoHashValue; class ObSQLSessionInfo : public common::ObVersionProvider, public ObBasicSessionInfo, public SessionInfoHashValue { OB_UNIS_VERSION(1); - public: +public: enum SessionType { INVALID_TYPE, USER_SESSION, INNER_SESSION }; // for switch stmt. class StmtSavedValue : public ObBasicSessionInfo::StmtSavedValue { - public: + public: StmtSavedValue() : ObBasicSessionInfo::StmtSavedValue() { reset(); @@ -194,7 +194,7 @@ class ObSQLSessionInfo : public common::ObVersionProvider, public ObBasicSession is_ignore_stmt_ = false; } - public: + public: ObAuditRecordData audit_record_; SessionType session_type_; bool inner_flag_; @@ -202,7 +202,7 @@ class ObSQLSessionInfo : public common::ObVersionProvider, public ObBasicSession bool is_ignore_stmt_; }; - public: +public: ObSQLSessionInfo(); virtual ~ObSQLSessionInfo(); @@ -639,13 +639,13 @@ class ObSQLSessionInfo : public common::ObVersionProvider, public ObBasicSession return is_ignore_stmt_; } - private: +private: int close_all_ps_stmt(); static const int64_t MAX_STORED_PLANS_COUNT = 10240; static const int64_t MAX_IPADDR_LENGTH = 64; - private: +private: bool is_inited_; // store the warning message from the most recent statement in the current session common::ObWarningBuffer warnings_buf_; diff --git a/src/sql/session/ob_sql_session_mgr.h b/src/sql/session/ob_sql_session_mgr.h index d5585db94..280914f66 100644 --- a/src/sql/session/ob_sql_session_mgr.h +++ b/src/sql/session/ob_sql_session_mgr.h @@ -27,7 +27,7 @@ class ObSMConnection; namespace sql { class ObFreeSessionCtx { - public: +public: ObFreeSessionCtx() : has_inc_active_num_(false), tenant_id_(common::OB_INVALID_ID), version_(0), sessid_(0), proxy_sessid_(0) {} @@ -42,7 +42,7 @@ class ObFreeSessionCtx { }; class ObSQLSessionMgr : public common::ObTimerTask { - public: +public: static const int64_t SCHEDULE_PERIOD = 1000 * 1000 * 5; // 5s static const uint32_t NON_DURABLE_VALUE = 0; static const uint32_t MAX_VERSION = UINT8_MAX; // 255 @@ -125,24 +125,24 @@ class ObSQLSessionMgr : public common::ObTimerTask { int mark_sessid_used(uint32_t sess_id); int mark_sessid_unused(uint32_t sess_id); // inline ObNullEndTransCallback &get_null_callback() { return null_callback_; } - private: +private: int create_session_by_version( uint64_t tenant_id, uint32_t sessid, uint64_t proxy_sessid, ObSQLSessionInfo*& sess_info, uint32_t& out_version); int get_avaiable_local_seq(uint32_t& local_seq); int set_first_seq(int64_t first_seq); class SessionPool { - public: + public: SessionPool(); - public: + public: int init(); int pop_session(uint64_t tenant_id, ObSQLSessionInfo*& session); int push_session(uint64_t tenant_id, ObSQLSessionInfo*& session); int64_t count() const; TO_STRING_KV(K(session_pool_.capacity()), K(session_pool_.get_total()), K(session_pool_.get_free())); - private: + private: static const int64_t POOL_CAPACIPY = 512; static const uint64_t POOL_INITED = 0; common::ObFixedQueue session_pool_; @@ -150,32 +150,32 @@ class ObSQLSessionMgr : public common::ObTimerTask { }; class SessionPoolMap { - public: + public: SessionPoolMap(ObIAllocator& alloc) : pool_blocks_(ObWrapperAllocator(alloc)), alloc_(alloc), lock_() {} int get_session_pool(uint64_t tenant_id, SessionPool*& session_pool); - private: + private: static const uint64_t BLOCK_ID_SHIFT = 10; static const uint64_t SLOT_ID_MASK = 0x3FF; static const uint64_t SLOT_PER_BLOCK = 1ULL << BLOCK_ID_SHIFT; typedef SessionPool* SessionPoolBlock[SLOT_PER_BLOCK]; typedef Ob2DArray SessionPoolBlocks; - private: + private: int create_pool_block(uint64_t block_id, SessionPoolBlock*& pool_block); int create_session_pool(SessionPoolBlock& pool_block, uint64_t slot_id, SessionPool*& session_pool); uint64_t get_block_id(uint64_t tenant_id) const; uint64_t get_slot_id(uint64_t tenant_id) const; - private: + private: SessionPoolBlocks pool_blocks_; ObIAllocator& alloc_; ObSpinLock lock_; }; class ValueAlloc { - public: + public: ValueAlloc() : session_pool_map_(allocator_), alloc_total_count_(0), @@ -201,10 +201,10 @@ class ObSQLSessionMgr : public common::ObTimerTask { } } - private: + private: bool is_valid_tenant_id(uint64_t tenant_id) const; - private: + private: SessionPoolMap session_pool_map_; ObArenaAllocator allocator_; common::ObSpinLock lock_; @@ -219,7 +219,7 @@ class ObSQLSessionMgr : public common::ObTimerTask { typedef common::ObTenantLinkHashMap HashMap; class CheckSessionFunctor { - public: + public: CheckSessionFunctor() : sess_mgr_(NULL) {} explicit CheckSessionFunctor(ObSQLSessionMgr* sess_mgr) : sess_mgr_(sess_mgr) @@ -228,22 +228,22 @@ class ObSQLSessionMgr : public common::ObTimerTask { {} bool operator()(sql::ObSQLSessionMgr::Key key, ObSQLSessionInfo* sess_info); - private: + private: ObSQLSessionMgr* sess_mgr_; }; class KillTenant { - public: + public: KillTenant(ObSQLSessionMgr* mgr, const uint64_t tenant_id) : mgr_(mgr), tenant_id_(tenant_id) {} bool operator()(sql::ObSQLSessionMgr::Key key, ObSQLSessionInfo* sess_info); - private: + private: ObSQLSessionMgr* mgr_; const uint64_t tenant_id_; }; - private: +private: // ObNullEndTransCallback null_callback_; // used for manage ObSQLSessionInfo HashMap sessinfo_map_; diff --git a/src/sql/session/ob_sys_params_mgr.h b/src/sql/session/ob_sys_params_mgr.h index 6fb8e12bd..3f018fac0 100644 --- a/src/sql/session/ob_sys_params_mgr.h +++ b/src/sql/session/ob_sys_params_mgr.h @@ -29,7 +29,7 @@ static const int64_t MIN_GROUP_MEM_SIZE_LIMIT = 10000; // 10M // 2. MAX value, -1 means no limit class ObSysParamsMgr { - public: +public: ObSysParamsMgr(); virtual ~ObSysParamsMgr(); @@ -41,7 +41,7 @@ class ObSysParamsMgr { int64_t get_sort_mem_size_limit() const; int64_t get_group_mem_size_limit() const; - private: +private: int64_t sort_mem_size_limit_; int64_t group_mem_size_limit_; DISALLOW_COPY_AND_ASSIGN(ObSysParamsMgr); diff --git a/src/storage/backup/ob_partition_backup_struct.h b/src/storage/backup/ob_partition_backup_struct.h index 9b41a5575..b1c09cee5 100644 --- a/src/storage/backup/ob_partition_backup_struct.h +++ b/src/storage/backup/ob_partition_backup_struct.h @@ -24,7 +24,7 @@ namespace storage { struct ObBackupSSTableMetaInfo { OB_UNIS_VERSION(1); - public: +public: ObBackupSSTableMetaInfo(); virtual ~ObBackupSSTableMetaInfo() = default; int assign(const ObBackupSSTableMetaInfo& sstable_meta_info); @@ -44,7 +44,7 @@ struct ObBackupSSTableMetaInfo { struct ObBackupPartitionStoreMetaInfo { OB_UNIS_VERSION(1); - public: +public: ObBackupPartitionStoreMetaInfo(); virtual ~ObBackupPartitionStoreMetaInfo() = default; int assign(const ObBackupPartitionStoreMetaInfo& partition_store_meta_info); @@ -58,7 +58,7 @@ struct ObBackupPartitionStoreMetaInfo { struct ObBackupPGMetaInfo { OB_UNIS_VERSION(1); - public: +public: ObBackupPGMetaInfo(); virtual ~ObBackupPGMetaInfo() = default; int assign(const ObBackupPGMetaInfo& pg_meta_info); @@ -75,7 +75,7 @@ struct ObBackupTableMacroIndex { static const int64_t TABLE_MACRO_INDEX_VERSION = 1; OB_UNIS_VERSION(TABLE_MACRO_INDEX_VERSION); - public: +public: ObBackupTableMacroIndex(); virtual ~ObBackupTableMacroIndex() = default; void reset(); @@ -99,7 +99,7 @@ struct ObBackupTableKeyInfo { static const int64_t BACKUP_TABLE_KEY_META_VERSION = 1; OB_UNIS_VERSION(BACKUP_TABLE_KEY_META_VERSION); - public: +public: ObBackupTableKeyInfo(); virtual ~ObBackupTableKeyInfo() = default; void reset(); diff --git a/src/storage/backup/ob_partition_base_data_physical_restore_v2.h b/src/storage/backup/ob_partition_base_data_physical_restore_v2.h index 8e864638b..7f7b02143 100644 --- a/src/storage/backup/ob_partition_base_data_physical_restore_v2.h +++ b/src/storage/backup/ob_partition_base_data_physical_restore_v2.h @@ -26,7 +26,7 @@ namespace oceanbase { using namespace share; namespace storage { class ObPhyRestoreMacroIndexStoreV2 : public ObIPhyRestoreMacroIndexStore { - public: +public: ObPhyRestoreMacroIndexStoreV2(); virtual ~ObPhyRestoreMacroIndexStoreV2(); void reset(); @@ -54,7 +54,7 @@ class ObPhyRestoreMacroIndexStoreV2 : public ObIPhyRestoreMacroIndexStore { TO_STRING_KV(K_(is_inited)); - private: +private: int init_major_macro_index(const common::ObPartitionKey& backup_pg_key, const ObBackupBaseDataPathInfo& path_info, const ObReplicaRestoreStatus& restore_status); int init_minor_macro_index(const int64_t backup_task_id, const common::ObPartitionKey& backup_pg_key, @@ -64,7 +64,7 @@ class ObPhyRestoreMacroIndexStoreV2 : public ObIPhyRestoreMacroIndexStore { int init_one_file(const ObString& path, const ObString& storage_info); int get_table_key_ptr(const ObITable::TableKey& table_key, const ObITable::TableKey*& table_key_ptr); - private: +private: static const int64_t BUCKET_SIZE = 100000; // 10w typedef common::hash::ObHashMap*> MacroIndexMap; bool is_inited_; @@ -76,7 +76,7 @@ class ObPhyRestoreMacroIndexStoreV2 : public ObIPhyRestoreMacroIndexStore { }; class ObPartitionBaseDataMetaRestoreReaderV2 { - public: +public: ObPartitionBaseDataMetaRestoreReaderV2(); virtual ~ObPartitionBaseDataMetaRestoreReaderV2(); void reset(); @@ -92,7 +92,7 @@ class ObPartitionBaseDataMetaRestoreReaderV2 { TO_STRING_KV( K_(pkey), K_(restore_info), K_(last_read_size), K_(partition_store_meta), K_(data_version), K_(schema_version)); - private: +private: int prepare(const common::ObPartitionKey& pkey); int trans_table_key(const ObITable::TableKey& table_Key, ObITable::TableKey& backup_table_key); int get_backup_sstable_meta_info( @@ -100,7 +100,7 @@ class ObPartitionBaseDataMetaRestoreReaderV2 { int get_backup_table_keys(const uint64_t backup_index_id, common::ObIArray& table_keys); int do_filter_tables(common::ObIArray& table_ids); - private: +private: bool is_inited_; common::ObPartitionKey pkey_; const ObPhysicalRestoreArg* restore_info_; @@ -115,7 +115,7 @@ class ObPartitionBaseDataMetaRestoreReaderV2 { class ObPartitionGroupMetaRestoreReaderV2; class ObPhysicalBaseMetaRestoreReaderV2 : public ObIPhysicalBaseMetaReader { - public: +public: ObPhysicalBaseMetaRestoreReaderV2(); virtual ~ObPhysicalBaseMetaRestoreReaderV2() {} @@ -128,7 +128,7 @@ class ObPhysicalBaseMetaRestoreReaderV2 : public ObIPhysicalBaseMetaReader { return BASE_DATA_META_RESTORE_READER_V1; } - private: +private: bool is_inited_; const ObPhysicalRestoreArg* restore_info_; ObIPartitionGroupMetaRestoreReader* reader_; @@ -139,7 +139,7 @@ class ObPhysicalBaseMetaRestoreReaderV2 : public ObIPhysicalBaseMetaReader { }; class ObPartitionMacroBlockRestoreReaderV2 : public ObIPartitionMacroBlockReader { - public: +public: ObPartitionMacroBlockRestoreReaderV2(); virtual ~ObPartitionMacroBlockRestoreReaderV2(); void reset(); @@ -157,12 +157,12 @@ class ObPartitionMacroBlockRestoreReaderV2 : public ObIPartitionMacroBlockReader return read_size_; } - private: +private: int trans_macro_block( const uint64_t table_id, blocksstable::ObMacroBlockMetaV2& meta, blocksstable::ObBufferReader& data); int get_macro_block_path(const ObBackupTableMacroIndex& macro_index, share::ObBackupPath& path); - private: +private: bool is_inited_; common::ObArray macro_list_; int64_t macro_idx_; @@ -178,7 +178,7 @@ class ObPartitionMacroBlockRestoreReaderV2 : public ObIPartitionMacroBlockReader }; class ObPartitionGroupMetaRestoreReaderV2 : public ObIPartitionGroupMetaRestoreReader { - public: +public: ObPartitionGroupMetaRestoreReaderV2(); virtual ~ObPartitionGroupMetaRestoreReaderV2(); void reset(); @@ -201,7 +201,7 @@ class ObPartitionGroupMetaRestoreReaderV2 : public ObIPartitionGroupMetaRestoreR int get_restore_tenant_id(uint64_t& tenant_id); int get_restore_schema_version(int64_t& schema_version); - private: +private: int prepare(const ObPhysicalRestoreArg& restore_info, const ObPhyRestoreMacroIndexStoreV2& macro_indexs); int prepare_pg_meta(const ObPhysicalRestoreArg& restore_info); int create_pg_partition_if_need(const ObPhysicalRestoreArg& restore_info, const ObPartitionGroupMeta& backup_pg_meta); @@ -217,7 +217,7 @@ class ObPartitionGroupMetaRestoreReaderV2 : public ObIPartitionGroupMetaRestoreR const common::ObPartitionArray& current_partitions, common::ObPartitionArray& backup_partitions); int do_filter_pg_partitions(const ObPGKey& pg_key, ObPartitionArray& partitions); - private: +private: typedef hash::ObHashMap MetaReaderMap; bool is_inited_; const ObPhysicalRestoreArg* restore_info_; @@ -235,7 +235,7 @@ class ObPartitionGroupMetaRestoreReaderV2 : public ObIPartitionGroupMetaRestoreR // 3.1 and later version use this class class ObPGPartitionBaseDataMetaRestoreReaderV2 : public ObIPGPartitionBaseDataMetaObReader { - public: +public: ObPGPartitionBaseDataMetaRestoreReaderV2(); virtual ~ObPGPartitionBaseDataMetaRestoreReaderV2(); void reset(); @@ -246,12 +246,12 @@ class ObPGPartitionBaseDataMetaRestoreReaderV2 : public ObIPGPartitionBaseDataMe return BASE_DATA_META_OB_RESTORE_READER_V2; } - private: +private: int check_sstable_table_ids_in_table(const ObPartitionKey& pkey, const common::ObIArray& table_ids); int check_sstable_ids_contain_schema_table_id(const hash::ObHashSet& table_id_set, const uint64_t schema_table_id, schema::ObSchemaGetterGuard& schema_guard); - private: +private: bool is_inited_; int64_t reader_index_; common::ObArray partition_reader_array_; diff --git a/src/storage/blocksstable/ob_block_cache_working_set.h b/src/storage/blocksstable/ob_block_cache_working_set.h index f17f84cd6..e7346a5c4 100644 --- a/src/storage/blocksstable/ob_block_cache_working_set.h +++ b/src/storage/blocksstable/ob_block_cache_working_set.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace blocksstable { class ObBlockCacheWorkingSet : public common::ObIKVCache, public ObIMicroBlockCache { - public: +public: typedef ObMicroBlockCacheKey Key; typedef ObMicroBlockCacheValue Value; @@ -35,16 +35,17 @@ class ObBlockCacheWorkingSet : public common::ObIKVCache OutColsProject; static const int64_t MAX_REUSE_MEMORY_LIMIT = 100; - public: +public: ObBlockMarkDeletionMaker(); virtual ~ObBlockMarkDeletionMaker(); int init(const share::schema::ObTableSchema& table_schema, const common::ObPartitionKey& pkey, @@ -33,13 +33,13 @@ class ObBlockMarkDeletionMaker { void reset(); int can_mark_delete(bool& can_mark_deletion, common::ObExtStoreRange& range); - private: +private: int prepare_tables_(const common::ObPartitionKey& pkey, const uint64_t index_id, const int64_t snapshot_version, const uint64_t end_log_id); int init_(const share::schema::ObTableSchema& table_schema, const common::ObPartitionKey& pkey, const uint64_t index_id, const int64_t snapshot_version, memtable::ObIMemtableCtxFactory* ctx_factory); - private: +private: bool is_inited_; storage::ObTableAccessParam access_param_; storage::ObTableAccessContext access_context_; diff --git a/src/storage/blocksstable/ob_block_sstable_struct.h b/src/storage/blocksstable/ob_block_sstable_struct.h index 6b6e419d9..42237e0c6 100644 --- a/src/storage/blocksstable/ob_block_sstable_struct.h +++ b/src/storage/blocksstable/ob_block_sstable_struct.h @@ -287,7 +287,7 @@ struct ObSuperBlockHeader { }; struct ObSuperBlockHeaderV2 final { - public: +public: ObSuperBlockHeaderV2(); ~ObSuperBlockHeaderV2() = default; bool is_valid() const; @@ -296,7 +296,7 @@ struct ObSuperBlockHeaderV2 final { NEED_SERIALIZE_AND_DESERIALIZE; static const int32_t HEADER_VERSION = 3; - public: +public: int32_t version_; int32_t magic_; // magic number }; @@ -515,7 +515,7 @@ struct ObLinkedMacroBlockHeader { }; struct ObLinkedMacroBlockHeaderV2 final { - public: +public: ObLinkedMacroBlockHeaderV2() { reset(); @@ -544,7 +544,7 @@ struct ObLinkedMacroBlockHeaderV2 final { K_(previous_block_first_id), K_(previous_block_second_id), K_(previous_block_third_id), K_(previous_block_fourth_id)); - public: +public: int32_t header_size_; int32_t version_; int32_t magic_; @@ -646,7 +646,7 @@ class ObBufferReader; class ObBufferWriter; struct ObMacroBlockSchemaInfo final { - public: +public: static const int64_t MACRO_BLOCK_SCHEMA_INFO_HEADER_VERSION = 1; ObMacroBlockSchemaInfo(); ~ObMacroBlockSchemaInfo() = default; @@ -785,7 +785,7 @@ struct ObMacroBlockMeta { return encrypt_id_ > static_cast(share::ObAesOpMode::ob_invalid_mode); } - private: +private: int64_t get_meta_content_serialize_size() const; }; @@ -1081,7 +1081,7 @@ struct ObPartitionMeta { }; class ObRowHeader { - public: +public: ObRowHeader() { memset(this, 0, sizeof(*this)); @@ -1171,7 +1171,7 @@ class ObRowHeader { TO_STRING_KV(K_(row_flag), K_(column_index_bytes), K_(row_dml), K_(version), K_(row_type_flag), K_(reserved8), K_(column_count)); - private: +private: int8_t row_flag_; int8_t column_index_bytes_; int8_t row_dml_; @@ -1219,7 +1219,7 @@ struct ObSSTablePair { }; struct ObLogicBlockIndex { - public: +public: static const int64_t INVALID_LOGIC_BLOCK_INDEX = -1; ObLogicBlockIndex() : logic_block_index_(INVALID_LOGIC_BLOCK_INDEX) @@ -1254,12 +1254,12 @@ struct ObLogicBlockIndex { TO_STRING_KV(K_(logic_block_index)); OB_UNIS_VERSION(1); - public: +public: int64_t logic_block_index_; }; struct ObMacroBlockItem { - public: +public: ObMacroBlockItem() : macro_block_id_(), logic_block_index_() {} ~ObMacroBlockItem() @@ -1300,7 +1300,7 @@ struct ObMacroBlockItem { return macro_block_id_.is_valid() && logic_block_index_.is_valid(); } - public: +public: MacroBlockId macro_block_id_; ObLogicBlockIndex logic_block_index_; }; @@ -1400,7 +1400,7 @@ struct ObMacroBlockMarkerStatus { }; class ObMacroBlockMarkerBitMap { - public: +public: ObMacroBlockMarkerBitMap(); virtual ~ObMacroBlockMarkerBitMap(); int init(const int64_t macro_block_count); @@ -1409,7 +1409,7 @@ class ObMacroBlockMarkerBitMap { int set_block(const int64_t block_index); int test_block(const int64_t block_index, bool& bool_ret) const; - private: +private: typedef uint64_t size_type; static const size_type BYTES_PER_BLOCK = sizeof(size_type); static const size_type BITS_PER_BLOCK = BYTES_PER_BLOCK * 8; @@ -1427,7 +1427,7 @@ class ObMacroBlockMarkerBitMap { return (1ULL << bit_index(pos)); } - private: +private: bool is_inited_; char* block_bitmap_; int64_t byte_size_; @@ -1435,7 +1435,7 @@ class ObMacroBlockMarkerBitMap { }; class ObMacroBlockMarkerHelper { - public: +public: ObMacroBlockMarkerHelper(); virtual ~ObMacroBlockMarkerHelper(); int init(const int64_t macro_block_count); @@ -1451,7 +1451,7 @@ class ObMacroBlockMarkerHelper { const ObMacroBlockCommonHeader::MacroBlockType& type, const common::ObIArray& block_array); int test_block(const int64_t block_index, bool& bool_ret) const; - private: +private: bool is_inited_; ObMacroBlockMarkerStatus status_; ObMacroBlockMarkerBitMap bit_map_; @@ -1505,7 +1505,7 @@ OB_INLINE const blocksstable::MacroBlockId& ObMacroBlockCtx::get_macro_block_id( enum ObRecordHeaderVersion { RECORD_HEADER_VERSION_V2 = 2, RECORD_HEADER_VERSION_V3 = 3 }; struct ObRecordHeaderV3 { - public: +public: ObRecordHeaderV3(); ~ObRecordHeaderV3() = default; static int deserialize_and_check_record( @@ -1529,12 +1529,12 @@ struct ObRecordHeaderV3 { } NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: int check_payload_checksum(const char* buf, const int64_t len) const; - public: +public: struct ObRecordCommonHeader { - public: + public: ObRecordCommonHeader() = default; ~ObRecordCommonHeader() = default; inline bool is_compressed() const @@ -1571,7 +1571,7 @@ struct ObRecordHeaderV3 { // ObStorageFile's superblock should inherit from this basic one class ObISuperBlock { - public: +public: ObISuperBlock() = default; virtual ~ObISuperBlock() = default; virtual void reset() = 0; @@ -1583,7 +1583,7 @@ class ObISuperBlock { }; struct ObSuperBlockMetaEntry { - public: +public: static const int64_t META_ENTRY_VERSION = 1; ObSuperBlockMetaEntry() : macro_block_id_(-1) {} @@ -1599,7 +1599,7 @@ struct ObSuperBlockMetaEntry { TO_STRING_KV(K_(macro_block_id)); OB_UNIS_VERSION(META_ENTRY_VERSION); - public: +public: blocksstable::MacroBlockId macro_block_id_; // first entry meta macro block id }; @@ -1628,7 +1628,10 @@ struct ObServerSuperBlock : public blocksstable::ObISuperBlock { ObServerSuperBlock(); - virtual int64_t get_timestamp() const override { return content_.modify_timestamp_; } + virtual int64_t get_timestamp() const override + { + return content_.modify_timestamp_; + } virtual bool is_valid() const override; virtual void reset() override; VIRTUAL_NEED_SERIALIZE_AND_DESERIALIZE; @@ -1653,7 +1656,7 @@ struct ObServerSuperBlock : public blocksstable::ObISuperBlock { }; struct ObMacroBlockMetaV2 final { - public: +public: static const int64_t MACRO_BLOCK_META_VERSION_V1 = 1; static const int64_t MACRO_BLOCK_META_VERSION_V2 = 2; // upgrade in version 3.1, new meta format ObMacroBlockMetaV2(); @@ -1716,10 +1719,10 @@ struct ObMacroBlockMetaV2 final { return encrypt_id_ > static_cast(share::ObAesOpMode::ob_invalid_mode); } - private: +private: int64_t get_meta_content_serialize_size() const; - public: +public: // For compatibility, the variables in this struct MUST NOT be deleted or moved. // You should ONLY add variables at the end. // Note that if you use complex structure as variables, the complex structure should also keep compatibility. @@ -1775,7 +1778,7 @@ struct ObMacroBlockMetaV2 final { }; struct ObFullMacroBlockMeta final { - public: +public: ObFullMacroBlockMeta(); ObFullMacroBlockMeta(const ObMacroBlockSchemaInfo* schema, const ObMacroBlockMetaV2* meta); ~ObFullMacroBlockMeta() = default; @@ -1795,7 +1798,7 @@ struct ObFullMacroBlockMeta final { }; struct ObMacroBlockInfoPair final { - public: +public: ObMacroBlockInfoPair() : block_id_(), meta_() {} ObMacroBlockInfoPair(const blocksstable::MacroBlockId& block_id, const ObFullMacroBlockMeta& meta) @@ -1817,7 +1820,7 @@ struct ObMacroBlockInfoPair final { }; struct ObFullMacroBlockMetaEntry final { - public: +public: ObFullMacroBlockMetaEntry(ObMacroBlockMetaV2& meta_, ObMacroBlockSchemaInfo& schema); ~ObFullMacroBlockMetaEntry() = default; NEED_SERIALIZE_AND_DESERIALIZE; @@ -1826,7 +1829,7 @@ struct ObFullMacroBlockMetaEntry final { }; class ObIMacroIdIterator { - public: +public: ObIMacroIdIterator() {} virtual ~ObIMacroIdIterator() diff --git a/src/storage/blocksstable/ob_bloom_filter_cache.h b/src/storage/blocksstable/ob_bloom_filter_cache.h index ba03234cf..f6b46cae1 100644 --- a/src/storage/blocksstable/ob_bloom_filter_cache.h +++ b/src/storage/blocksstable/ob_bloom_filter_cache.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace blocksstable { class ObStoreRowkeyHashFunc { - public: +public: uint64_t operator()(const common::ObStoreRowkey& rowkey, const uint64_t hash) { return rowkey.murmurhash(hash); @@ -30,7 +30,7 @@ class ObStoreRowkeyHashFunc { }; class ObBloomFilterCacheKey : public common::ObIKVCacheKey { - public: +public: ObBloomFilterCacheKey( const uint64_t table_id, const MacroBlockId& block_id, const int64_t file_id, const int8_t prefix_rowkey_len); virtual ~ObBloomFilterCacheKey(); @@ -46,18 +46,18 @@ class ObBloomFilterCacheKey : public common::ObIKVCacheKey { } TO_STRING_KV(K_(table_id), K_(macro_block_id), K_(file_id), K_(prefix_rowkey_len)); - private: +private: uint64_t table_id_; MacroBlockId macro_block_id_; int64_t file_id_; int8_t prefix_rowkey_len_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBloomFilterCacheKey); }; class ObBloomFilterCacheValue : public common::ObIKVCacheValue { - public: +public: static const int64_t BLOOM_FILTER_CACHE_VALUE_VERSION = 1; ObBloomFilterCacheValue(); virtual ~ObBloomFilterCacheValue(); @@ -104,7 +104,7 @@ class ObBloomFilterCacheValue : public common::ObIKVCacheValue { TO_STRING_KV(K_(version), K_(rowkey_column_cnt), K_(row_count), K_(bloom_filter), K_(is_inited)); OB_UNIS_VERSION(BLOOM_FILTER_CACHE_VALUE_VERSION); - private: +private: typedef common::ObBloomFilter BloomFilter; int16_t version_; int16_t rowkey_column_cnt_; @@ -112,7 +112,7 @@ class ObBloomFilterCacheValue : public common::ObIKVCacheValue { BloomFilter bloom_filter_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBloomFilterCacheValue); }; @@ -181,12 +181,12 @@ struct ObEmptyReadCell { volatile uint64_t hashcode_; volatile int64_t build_time_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObEmptyReadCell); }; class ObBFCacheKeyHashFunc { - public: +public: uint64_t operator()(const ObBloomFilterCacheKey& cacheKey, const uint64_t hash) { UNUSED(hash); @@ -195,7 +195,7 @@ class ObBFCacheKeyHashFunc { }; class ObBloomFilterCache : public common::ObKVCache { - public: +public: ObBloomFilterCache(); virtual ~ObBloomFilterCache(); int init(const char* cache_name, const int64_t priority, const int64_t size = DEFAULT_BUCKET_SIZE); @@ -257,7 +257,7 @@ class ObBloomFilterCache : public common::ObKVCache { }; class ObBufferWriter : public ObBufferHolder { - public: +public: template int rollback(const T& value) { @@ -301,7 +301,7 @@ class ObBufferWriter : public ObBufferHolder { return common::OB_BUF_NOT_ENOUGH; } - public: +public: virtual ~ObBufferWriter() {} ObBufferWriter(char* buf, const int64_t data_len, int64_t pos = 0) @@ -315,7 +315,7 @@ class ObBufferWriter : public ObBufferHolder { pos_ = pos; } - protected: +protected: // write with no check; // caller ensure memory not out of bounds. template @@ -339,7 +339,7 @@ class ObBufferWriter : public ObBufferHolder { class ObSelfBufferWriter : public ObBufferWriter { static const int64_t BUFFER_ALIGN_SIZE = DIO_ALIGN_SIZE; - public: +public: virtual int expand(const int64_t size) { int64_t new_size = std::max(capacity_ * 2, static_cast(size + capacity_)); @@ -350,7 +350,7 @@ class ObSelfBufferWriter : public ObBufferWriter { return ensure_space(new_size); } - public: +public: explicit ObSelfBufferWriter(const int64_t size = 0, const char* label = 0, const bool need_align = false); virtual ~ObSelfBufferWriter(); int ensure_space(const int64_t size); @@ -370,18 +370,18 @@ class ObSelfBufferWriter : public ObBufferWriter { is_aligned_ = need_align; } - private: +private: char* alloc(const int64_t size); void free(); - private: +private: const char* label_; bool is_aligned_; common::ObMacroBlockSizeMemoryContext macro_block_mem_ctx_; }; class ObBufferReader : public ObBufferHolder { - public: +public: template int read_pod(T& value) { @@ -456,7 +456,7 @@ class ObBufferReader : public ObBufferHolder { return ret; } - public: +public: ObBufferReader() { assign(NULL, 0, 0); diff --git a/src/storage/blocksstable/ob_fuse_row_cache.h b/src/storage/blocksstable/ob_fuse_row_cache.h index dafbe949c..f98e044ca 100644 --- a/src/storage/blocksstable/ob_fuse_row_cache.h +++ b/src/storage/blocksstable/ob_fuse_row_cache.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace blocksstable { class ObFuseRowCacheKey : public common::ObIKVCacheKey { - public: +public: ObFuseRowCacheKey(); ObFuseRowCacheKey(const uint64_t table_id, const ObStoreRowkey& rowkey); virtual ~ObFuseRowCacheKey() = default; @@ -32,7 +32,7 @@ class ObFuseRowCacheKey : public common::ObIKVCacheKey { bool is_valid() const; TO_STRING_KV(K_(table_id), K_(rowkey_size), K_(rowkey)); - private: +private: uint64_t table_id_; int64_t rowkey_size_; common::ObStoreRowkey rowkey_; @@ -40,7 +40,7 @@ class ObFuseRowCacheKey : public common::ObIKVCacheKey { }; class ObFuseRowCacheValue : public common::ObIKVCacheValue { - public: +public: ObFuseRowCacheValue(); virtual ~ObFuseRowCacheValue() = default; int init(const storage::ObStoreRow& row, const int64_t schema_version, const int64_t snapshot_version, @@ -87,7 +87,7 @@ class ObFuseRowCacheValue : public common::ObIKVCacheValue { TO_STRING_KV(KP_(obj_array), K_(size), K_(column_cnt), K_(schema_version), K_(flag), K_(snapshot_version), K_(partition_id), K_(sstable_end_log_ts), K(fq_ctx_)); - private: +private: common::ObObj* obj_array_; int64_t size_; int32_t column_cnt_; @@ -118,13 +118,13 @@ struct ObFuseRowValueHandle { }; class ObFuseRowCache : public common::ObKVCache { - public: +public: ObFuseRowCache() = default; virtual ~ObFuseRowCache() = default; int get_row(const ObFuseRowCacheKey& key, const int64_t partition_id, ObFuseRowValueHandle& handle); int put_row(const ObFuseRowCacheKey& key, const ObFuseRowCacheValue& value); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFuseRowCache); }; diff --git a/src/storage/blocksstable/ob_imicro_block_reader.h b/src/storage/blocksstable/ob_imicro_block_reader.h index 9e30f4021..46e0c0be3 100644 --- a/src/storage/blocksstable/ob_imicro_block_reader.h +++ b/src/storage/blocksstable/ob_imicro_block_reader.h @@ -39,7 +39,7 @@ class ObRowCacheValue; class ObIRowReader; struct ObRowIndexIterator { - public: +public: typedef ObRowIndexIterator self_t; typedef std::random_access_iterator_tag iterator_category; typedef int64_t value_type; @@ -133,7 +133,7 @@ struct ObRowIndexIterator { }; struct ObMicroBlockData { - public: +public: ObMicroBlockData() : buf_(NULL), size_(0), extra_buf_(0), extra_size_(0) {} ObMicroBlockData(const char* buf, const int64_t size, const char* extra_buf = NULL, const int64_t extra_size = 0) @@ -196,7 +196,7 @@ struct ObMicroBlockData { }; class ObIMicroBlockGetReader { - public: +public: ObIMicroBlockGetReader(){}; virtual ~ObIMicroBlockGetReader(){}; virtual int get_row(const uint64_t tenant_id, const ObMicroBlockData& block_data, const common::ObStoreRowkey& rowkey, @@ -227,7 +227,7 @@ class ObIMicroBlockGetReader { }; class ObIMicroBlockReader { - public: +public: typedef const common::ObIArray Projector; static const int64_t OB_MAX_BATCH_ROW_COUNT = 64; static const int64_t INVALID_ROW_INDEX = -1; @@ -271,11 +271,11 @@ class ObIMicroBlockReader { return end_; } - protected: +protected: virtual int find_bound(const common::ObStoreRowkey& key, const bool lower_bound, const int64_t begin_idx, const int64_t end_idx, int64_t& row_idx, bool& equal) = 0; - protected: +protected: bool is_inited_; int64_t begin_; // begin of row index, inclusive int64_t end_; // end of row index, not inclusive @@ -285,7 +285,7 @@ class ObIMicroBlockReader { }; class ObMicroBlock { - public: +public: ObMicroBlock() : range_(), data_(), diff --git a/src/storage/blocksstable/ob_imicro_block_writer.h b/src/storage/blocksstable/ob_imicro_block_writer.h index 62d3e8c67..2807d5578 100644 --- a/src/storage/blocksstable/ob_imicro_block_writer.h +++ b/src/storage/blocksstable/ob_imicro_block_writer.h @@ -28,7 +28,7 @@ enum MICRO_BLOCK_MERGE_VERIFY_LEVEL { // Some common interface of ObMicroBlockWriter and ObMicroBlockEncoder, not all features. class ObIMicroBlockWriter { - public: +public: ObIMicroBlockWriter() : row_count_delta_(0), micro_block_checksum_(0), @@ -102,7 +102,7 @@ class ObIMicroBlockWriter { VIRTUAL_TO_STRING_KV( K_(row_count_delta), K_(micro_block_checksum), K_(contain_uncommitted_row), K_(max_merged_trans_version)); - protected: +protected: OB_INLINE void cal_delta(const storage::ObStoreRow& row) { if (row.row_type_flag_.is_first_multi_version_row()) { @@ -122,7 +122,7 @@ class ObIMicroBlockWriter { micro_block_merge_verify_level_ = GCONF.micro_block_merge_verify_level; } - protected: +protected: // row count delta of the current micro block int32_t row_count_delta_; int64_t micro_block_checksum_; diff --git a/src/storage/blocksstable/ob_lob_data_reader.h b/src/storage/blocksstable/ob_lob_data_reader.h index 155396e96..389f29d81 100644 --- a/src/storage/blocksstable/ob_lob_data_reader.h +++ b/src/storage/blocksstable/ob_lob_data_reader.h @@ -28,17 +28,17 @@ class ObSSTable; } namespace blocksstable { class ObLobMicroBlockReader { - public: +public: ObLobMicroBlockReader(); virtual ~ObLobMicroBlockReader() = default; int read(const char* buf, const int64_t buf_len, const char*& out_buf, int64_t& out_buf_len); - private: +private: int check_micro_header(const ObLobMicroBlockHeader* header); }; class ObLobMacroBlockReader { - public: +public: ObLobMacroBlockReader(); virtual ~ObLobMacroBlockReader() = default; int init(); @@ -48,12 +48,12 @@ class ObLobMacroBlockReader { int read_next_micro_block(const char*& out_buf, int64_t& out_buf_len); void reset(); - private: +private: int open(const MacroBlockId& block_id, const bool is_sys_read, const ObFullMacroBlockMeta& meta, const common::ObPartitionKey& pkey, ObStorageFileHandle& file_handle); int check_macro_meta(const common::ObStoreRowkey& rowkey, const uint16_t column_id); - private: +private: bool is_inited_; MacroBlockId curr_block_id_; ObLobMicroBlockIndexReader micro_index_reader_; @@ -65,7 +65,7 @@ class ObLobMacroBlockReader { }; class ObLobDataReader { - public: +public: ObLobDataReader(); virtual ~ObLobDataReader(); int init(const bool is_sys_read, const storage::ObSSTable& sstable); @@ -80,7 +80,7 @@ class ObLobDataReader { return is_sys_read_; } - private: +private: void inner_reuse(); int read_lob_data_impl(const common::ObStoreRowkey& rowkey, const uint16_t column_id, const common::ObObj& src_obj, common::ObObj& dst_obj); @@ -89,7 +89,7 @@ class ObLobDataReader { int parse_lob_index(const char* buf, const int64_t buf_len, common::ObIArray& lob_indexes); int read_all_direct_index(const common::ObLobIndex& index, common::ObIArray& lob_indexes); - private: +private: bool is_inited_; ObLobMacroBlockReader reader_; const common::hash::ObCuckooHashMap* logic2phy_map_; diff --git a/src/storage/blocksstable/ob_lob_data_writer.h b/src/storage/blocksstable/ob_lob_data_writer.h index 75ca591a1..779e0f1b7 100644 --- a/src/storage/blocksstable/ob_lob_data_writer.h +++ b/src/storage/blocksstable/ob_lob_data_writer.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace blocksstable { class ObLobDataWriter; class ObLobMicroBlockWriter { - public: +public: ObLobMicroBlockWriter(); virtual ~ObLobMicroBlockWriter() = default; int init(const int64_t macro_block_size); @@ -34,10 +34,10 @@ class ObLobMicroBlockWriter { void reset(); void reuse(); - private: +private: int reserve_header(); - private: +private: bool is_inited_; ObLobMicroBlockHeader* header_; ObSelfBufferWriter data_buffer_; @@ -55,7 +55,7 @@ struct ObLobMicroBlockDesc { }; class ObLobMacroBlockWriter { - public: +public: ObLobMacroBlockWriter(); virtual ~ObLobMacroBlockWriter() = default; int init(const ObDataStoreDesc& store_desc, const int64_t start_seq, ObLobDataWriter* writer); @@ -65,7 +65,7 @@ class ObLobMacroBlockWriter { int close(); void reset(); - private: +private: void reuse(); int flush(); int init_header( @@ -83,7 +83,7 @@ class ObLobMacroBlockWriter { } int build_macro_meta(ObFullMacroBlockMeta& meta); - private: +private: bool is_inited_; ObSelfBufferWriter data_; ObLobMicroBlockIndexWriter index_; @@ -112,7 +112,7 @@ class ObLobMacroBlockWriter { }; class ObLobDataWriter { - public: +public: ObLobDataWriter(); virtual ~ObLobDataWriter(); int init(const ObDataStoreDesc& desc, const int64_t start_seq); @@ -122,7 +122,7 @@ class ObLobDataWriter { void reset(); void reuse(); - private: +private: void clear_macro_block_ref(); int compress_micro_block(const char*& buf, int64_t& size); int write_lob_index(common::ObLobData& lob_data); @@ -133,7 +133,7 @@ class ObLobDataWriter { ObLobMicroBlockDesc& block_desc); int check_rowkey(const common::ObStoreRowkey& rowkey, bool& check_ret) const; - private: +private: static const int64_t DEFAULT_RESERVE_PERCENT = 90; bool is_inited_; common::ObArray macro_blocks_; diff --git a/src/storage/blocksstable/ob_lob_merge_writer.h b/src/storage/blocksstable/ob_lob_merge_writer.h index 7bc29c5b2..ea16bdf54 100644 --- a/src/storage/blocksstable/ob_lob_merge_writer.h +++ b/src/storage/blocksstable/ob_lob_merge_writer.h @@ -25,7 +25,7 @@ class ObSSTable; namespace blocksstable { class ObLobMergeWriter { - public: +public: ObLobMergeWriter(); virtual ~ObLobMergeWriter(); void reset(); @@ -40,7 +40,7 @@ class ObLobMergeWriter { } TO_STRING_KV(K_(orig_lob_macro_blocks), K_(block_write_ctx), K_(macro_start_seq), K_(use_old_macro_block_count)); - private: +private: static const int64_t DEFAULT_MACRO_BLOCK_NUM = 256; typedef common::ObSEArray MacroBlockArray; typedef common::ObSEArray MacroBlockMetaArray; @@ -57,7 +57,7 @@ class ObLobMergeWriter { const storage::ObStoreRow& row_; }; - private: +private: bool is_valid() const; int find_cand_lob_cols(const storage::ObStoreRow& row, ObIArray& lob_col_idxs, int64_t& row_size); int write_lob_obj(const common::ObStoreRowkey& rowkey, const int64_t column_id, const ObObj& src_obj, ObObj& dst_obj); @@ -66,7 +66,7 @@ class ObLobMergeWriter { const common::ObStoreRowkey& rowkey, const int64_t column_id, bool& check_ret); int copy_row_(const storage::ObStoreRow& row); - private: +private: MacroBlockInfoArray orig_lob_macro_blocks_; ObMacroBlocksWriteCtx block_write_ctx_; // TODO(): fix lob for ofs ObLobDataWriter lob_writer_; diff --git a/src/storage/blocksstable/ob_lob_micro_block_index_reader.h b/src/storage/blocksstable/ob_lob_micro_block_index_reader.h index 3f7cbc265..28f1cb4df 100644 --- a/src/storage/blocksstable/ob_lob_micro_block_index_reader.h +++ b/src/storage/blocksstable/ob_lob_micro_block_index_reader.h @@ -34,13 +34,13 @@ struct ObLobMicroIndexItem { }; class ObLobMicroBlockIndexReader { - public: +public: ObLobMicroBlockIndexReader(); virtual ~ObLobMicroBlockIndexReader() = default; int transform(const char* index_buf, const int32_t size_array_offset, const int64_t micro_block_cnt); int get_next_index_item(ObLobMicroIndexItem& next_item); - private: +private: const int32_t* offset_array_; const ObLobMicroIndexSizeItem* size_array_; int64_t micro_block_cnt_; diff --git a/src/storage/blocksstable/ob_local_file_system.h b/src/storage/blocksstable/ob_local_file_system.h index 1bb1c82ef..79fc1447a 100644 --- a/src/storage/blocksstable/ob_local_file_system.h +++ b/src/storage/blocksstable/ob_local_file_system.h @@ -22,7 +22,7 @@ class ObStoreFile; class ObLocalFileSystem; class ObLocalStorageFile : public ObStorageFile { - public: +public: virtual ~ObLocalStorageFile() = default; virtual int init(const common::ObAddr& svr_addr, const FileType file_type) override; @@ -49,7 +49,7 @@ class ObLocalStorageFile : public ObStorageFile { VIRTUAL_TO_STRING_KV(K(file_type_), K(tenant_id_), K(file_id_)); - private: +private: ObStoreFileSystem* file_system_; friend class ObLocalFileSystem; @@ -60,7 +60,7 @@ class ObLocalStorageFile : public ObStorageFile { }; class ObLocalFileSystem : public ObStoreFileSystem { - public: +public: // The SUPER BLOCK OFFSET MUST NOT be modified static const int64_t MASTER_SUPER_BLOCK_OFFSET = 0; static const int64_t BACKUP_SUPER_BLOCK_OFFSET = common::OB_DEFAULT_MACRO_BLOCK_SIZE; @@ -115,7 +115,7 @@ class ObLocalFileSystem : public ObStoreFileSystem { TO_STRING_KV("type", "LOCAL"); - private: +private: int open(bool& exist); // read/write super block to/from buffer holder template @@ -123,7 +123,7 @@ class ObLocalFileSystem : public ObStoreFileSystem { int inner_write_super_block(); int inner_get_super_block_version(const int64_t offset, int64_t& super_block_version); - private: +private: bool is_opened_; common::ObDiskFd fd_; int64_t macro_block_size_; diff --git a/src/storage/blocksstable/ob_macro_block.h b/src/storage/blocksstable/ob_macro_block.h index a7b214290..4fcf503b6 100644 --- a/src/storage/blocksstable/ob_macro_block.h +++ b/src/storage/blocksstable/ob_macro_block.h @@ -102,16 +102,16 @@ struct ObDataStoreDesc { common::ObArrayWrap(column_types_, row_column_count_), K_(pg_key), K_(file_handle), K_(need_check_order), K_(need_index_tree), K_(major_working_cluster_version)); - private: +private: int cal_row_store_type(const share::schema::ObTableSchema& table_schema, const storage::ObMergeType merge_type); int get_major_working_cluster_version(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDataStoreDesc); }; class ObMicroBlockCompressor { - public: +public: ObMicroBlockCompressor(); virtual ~ObMicroBlockCompressor(); void reset(); @@ -119,7 +119,7 @@ class ObMicroBlockCompressor { int compress(const char* in, const int64_t in_size, const char*& out, int64_t& out_size); int decompress(const char* in, const int64_t in_size, const int64_t uncomp_size, const char*& out, int64_t& out_size); - private: +private: bool is_none_; int64_t micro_block_size_; common::ObCompressor* compressor_; @@ -154,7 +154,7 @@ struct ObMicroBlockDesc { }; class ObMacroBlock { - public: +public: ObMacroBlock(); virtual ~ObMacroBlock(); int init(ObDataStoreDesc& spec); @@ -202,7 +202,7 @@ class ObMacroBlock { return header_->micro_block_index_offset_; } - private: +private: int write_micro_record_header(const ObMicroBlockDesc& micro_block_desc); int reserve_header(const ObDataStoreDesc& spec); int build_header(const int64_t cur_macro_seq); @@ -212,7 +212,7 @@ class ObMacroBlock { int add_column_checksum(const int64_t* to_add_checksum, const int64_t column_cnt, int64_t* column_checksum); int init_row_reader(const ObRowStoreType row_store_type); - private: +private: OB_INLINE int64_t get_remain_size() const { return data_.remain() - index_.get_block_size(); @@ -230,7 +230,7 @@ class ObMacroBlock { return get_micro_block_data_size() + index_.get_block_size() - ObMicroBlockIndexWriter::INDEX_ENTRY_SIZE; } - private: +private: ObDataStoreDesc* spec_; ObIRowReader* row_reader_; ObFlatRowReader flat_row_reader_; diff --git a/src/storage/blocksstable/ob_macro_block_checker.h b/src/storage/blocksstable/ob_macro_block_checker.h index 8d8b1b05e..56acc4056 100644 --- a/src/storage/blocksstable/ob_macro_block_checker.h +++ b/src/storage/blocksstable/ob_macro_block_checker.h @@ -31,7 +31,7 @@ enum ObMacroBlockCheckLevel { // note: this class is NOT thread safe class ObSSTableMacroBlockChecker { - public: +public: ObSSTableMacroBlockChecker() : flat_reader_(), allocator_(common::ObModIds::OB_MACRO_BLOCK_CHECKER), macro_reader_() {} virtual ~ObSSTableMacroBlockChecker() @@ -40,7 +40,7 @@ class ObSSTableMacroBlockChecker { ObMacroBlockCheckLevel check_level = CHECK_LEVEL_AUTO); void destroy(); - private: +private: int check_macro_buf( const ObMacroBlockCommonHeader& common_header, const char* macro_block_buf, const int64_t macro_block_buf_size); int check_data_header(const ObMacroBlockCommonHeader& common_header, const char* macro_block_buf, @@ -60,7 +60,7 @@ class ObSSTableMacroBlockChecker { const ObMacroBlockCommonHeader& common_header, const char* macro_block_buf, const ObFullMacroBlockMeta& meta); DISALLOW_COPY_AND_ASSIGN(ObSSTableMacroBlockChecker); - private: +private: ObMicroBlockReader flat_reader_; ObSparseMicroBlockReader sparse_reader_; common::ObArenaAllocator allocator_; diff --git a/src/storage/blocksstable/ob_macro_block_common_header.h b/src/storage/blocksstable/ob_macro_block_common_header.h index 544a713ed..c661864ab 100644 --- a/src/storage/blocksstable/ob_macro_block_common_header.h +++ b/src/storage/blocksstable/ob_macro_block_common_header.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace blocksstable { struct ObMacroBlockCommonHeader { - public: +public: static const int32_t MACRO_BLOCK_COMMON_HEADER_VERSION = 1; static const int32_t MACRO_BLOCK_COMMON_HEADER_MAGIC = 1001; @@ -132,7 +132,7 @@ struct ObMacroBlockCommonHeader { TO_STRING_KV( K_(header_size), K_(version), K_(magic), K_(attr), K_(data_version), K_(payload_size), K_(payload_checksum)); - private: +private: // NOTE: data members should be 64 bits aligned!!! int32_t header_size_; // struct size int32_t version_; // header version diff --git a/src/storage/blocksstable/ob_macro_block_id.h b/src/storage/blocksstable/ob_macro_block_id.h index a89fe6f7f..dfc047e6e 100644 --- a/src/storage/blocksstable/ob_macro_block_id.h +++ b/src/storage/blocksstable/ob_macro_block_id.h @@ -26,7 +26,7 @@ enum class ObMacroBlockIdMode : uint8_t { }; class MacroBlockId final { - public: +public: MacroBlockId(); explicit MacroBlockId(const int64_t block_id); MacroBlockId(const MacroBlockId& id); @@ -103,14 +103,14 @@ class MacroBlockId final { NEED_SERIALIZE_AND_DESERIALIZE; - public: +public: static ObMacroBlockIdMode DEFAULT_MODE; - private: +private: // for unit test int serialize_old(char* buf, const int64_t buf_len, int64_t& pos) const; - private: +private: // serialization static const uint64_t SF_BIT_RAW_ID = 56; static const uint64_t SF_BIT_ID_MODE = 4; @@ -149,7 +149,7 @@ class MacroBlockId final { static const uint64_t SF_MASK_RESTART_SEQ = (0x1UL << SF_BIT_RESTART_SEQ) - 1; static const uint64_t SF_MASK_REWRITE_SEQ = (0x1UL << SF_BIT_REWRITE_SEQ) - 1; - private: +private: union { int64_t first_id_; struct // serialization diff --git a/src/storage/blocksstable/ob_macro_block_meta_mgr.h b/src/storage/blocksstable/ob_macro_block_meta_mgr.h index 479d5f3b8..664a9b18c 100644 --- a/src/storage/blocksstable/ob_macro_block_meta_mgr.h +++ b/src/storage/blocksstable/ob_macro_block_meta_mgr.h @@ -74,7 +74,7 @@ struct ObMajorMacroBlockKey { class ObMacroBlockMetaMgr; class ObMacroBlockMetaHandle { - public: +public: ObMacroBlockMetaHandle(); virtual ~ObMacroBlockMetaHandle(); ObMacroBlockMetaHandle(const ObMacroBlockMetaHandle& other); @@ -86,7 +86,7 @@ class ObMacroBlockMetaHandle { } TO_STRING_KV(KP_(meta_ctrl)); - private: +private: friend class ObMacroBlockMetaMgr; ObMacroBlockMetaCtrl* meta_ctrl_; }; @@ -106,14 +106,14 @@ struct ObMacroBlockMetaLogEntry : public ObIBaseStorageLogEntry { }; class ObMacroBlockMetaMgrGCTask : public common::ObTimerTask { - public: +public: ObMacroBlockMetaMgrGCTask(); virtual ~ObMacroBlockMetaMgrGCTask(); virtual void runTimerTask(); }; class ObMacroBlockMetaMgr : public ObIRedoModule { - public: +public: typedef common::hash::ObHashMap MajorKeyMap; static ObMacroBlockMetaMgr& get_instance(); int init(const int64_t max_block_cnt); @@ -125,7 +125,7 @@ class ObMacroBlockMetaMgr : public ObIRedoModule { virtual int parse(const int64_t subcmd, const char* buf, const int64_t len, FILE* stream) override; virtual int enable_write_log() override; - private: +private: friend class ObMacroBlockMetaHandle; friend class ObMacroBlockMetaMgrGCTask; friend class ObMacroMetaBlockReader; diff --git a/src/storage/blocksstable/ob_macro_block_reader.h b/src/storage/blocksstable/ob_macro_block_reader.h index bdd5577a2..17c7a0680 100644 --- a/src/storage/blocksstable/ob_macro_block_reader.h +++ b/src/storage/blocksstable/ob_macro_block_reader.h @@ -31,7 +31,7 @@ struct ObColDesc; namespace blocksstable { class ObFullMacroBlockMeta; class ObMacroBlockReader { - public: +public: ObMacroBlockReader(); virtual ~ObMacroBlockReader(); int decompress_data(const ObFullMacroBlockMeta& meta, const char* buf, const int64_t size, const char*& uncomp_buf, @@ -41,19 +41,19 @@ class ObMacroBlockReader { int decompress_data_with_prealloc_buf(const char* compressor_name, const char* buf, const int64_t size, char* uncomp_buf, const int64_t uncomp_buf_size); - private: +private: int alloc_buf(const int64_t buf_size); common::ObCompressor* compressor_; char* uncomp_buf_; int64_t uncomp_buf_size_; common::ObArenaAllocator allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMacroBlockReader); }; class ObSSTableDataBlockReader { - public: +public: ObSSTableDataBlockReader(); virtual ~ObSSTableDataBlockReader(); @@ -61,7 +61,7 @@ class ObSSTableDataBlockReader { void reset(); int dump(); - private: +private: int dump_macro_block_header(); int dump_sstable_data_block(); int dump_lob_data_block(); @@ -71,7 +71,7 @@ class ObSSTableDataBlockReader { int decompressed_micro_block(const char* micro_block_buf, const int64_t micro_block_size, const int16_t micro_header_magic, ObMicroBlockData& micro_data); - private: +private: // raw data const char* data_; int64_t size_; @@ -90,7 +90,7 @@ class ObSSTableDataBlockReader { bool is_trans_sstable_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSSTableDataBlockReader); }; } /* namespace blocksstable */ diff --git a/src/storage/blocksstable/ob_macro_block_writer.h b/src/storage/blocksstable/ob_macro_block_writer.h index 98df576e9..5559fe1d4 100644 --- a/src/storage/blocksstable/ob_macro_block_writer.h +++ b/src/storage/blocksstable/ob_macro_block_writer.h @@ -48,7 +48,7 @@ namespace blocksstable { // |- MicroBlock index // |- index endkey char stream class ObMacroBlockWriter { - public: +public: ObMacroBlockWriter(); virtual ~ObMacroBlockWriter(); void reset(); @@ -73,7 +73,7 @@ class ObMacroBlockWriter { TO_STRING_KV(K_(block_write_ctx)); struct IndexMicroBlockBuilder { - public: + public: IndexMicroBlockBuilder() {} virtual ~IndexMicroBlockBuilder() = default; @@ -82,7 +82,7 @@ class ObMacroBlockWriter { ObBlockIntermediateBuilder row_builder_; }; struct IndexMicroBlockDesc { - public: + public: IndexMicroBlockDesc() {} virtual ~IndexMicroBlockDesc() = default; @@ -92,7 +92,7 @@ class ObMacroBlockWriter { common::ObStoreRowkey last_key_; }; struct IndexMicroBlockDescCompare final { - public: + public: IndexMicroBlockDescCompare() {} ~IndexMicroBlockDescCompare() = default; @@ -103,7 +103,7 @@ class ObMacroBlockWriter { } }; - private: +private: int append_row(const storage::ObStoreRow& row, const int64_t split_size, const bool ignore_lob = false); int check_order(const storage::ObStoreRow& row); int build_micro_block(const bool force_split = false); @@ -137,7 +137,7 @@ class ObMacroBlockWriter { int open_bf_cache_writer(const ObDataStoreDesc& desc); int flush_bf_to_cache(ObMacroBloomFilterCacheWriter& bf_cache_writer, const int32_t row_count); - private: +private: int build_index_micro_block(const int32_t height, const storage::ObStoreRow*& mid_row); int build_intermediate_row(const ObString& rowkey, const ObBlockIntermediateHeader& header, ObBlockIntermediateBuilder& builder, const storage::ObStoreRow*& row); @@ -161,7 +161,7 @@ class ObMacroBlockWriter { int print_micro_block_row(ObIMicroBlockReader* micro_reader); int dump_micro_block_writer_buffer(); - private: +private: static const int64_t DEFAULT_MACRO_BLOCK_COUNT = 128; static const int64_t DEFAULT_MICRO_BLOCK_TREE_HIGH = 4; static const int64_t DEFAULT_MICRO_BLOCK_WRITER_COUNT = 64; @@ -170,7 +170,7 @@ class ObMacroBlockWriter { typedef common::ObSEArray IndexMicroBlockBuildList; typedef common::ObSEArray IndexMicroBlockDescList; - private: +private: ObDataStoreDesc* data_store_desc_; ObDataStoreDesc* index_store_desc_; ObMicroBlockCompressor compressor_; diff --git a/src/storage/blocksstable/ob_macro_meta_block_reader.h b/src/storage/blocksstable/ob_macro_meta_block_reader.h index caf5297f6..1b42a6dba 100644 --- a/src/storage/blocksstable/ob_macro_meta_block_reader.h +++ b/src/storage/blocksstable/ob_macro_meta_block_reader.h @@ -19,11 +19,11 @@ namespace oceanbase { namespace blocksstable { class ObMacroMetaBlockReader : public ObMetaBlockReader { - public: +public: ObMacroMetaBlockReader(); virtual ~ObMacroMetaBlockReader(); - protected: +protected: virtual int parse(const ObMacroBlockCommonHeader& common_header, const ObLinkedMacroBlockHeader& linked_header, const char* buf, const int64_t buf_len); }; diff --git a/src/storage/blocksstable/ob_meta_block_reader.h b/src/storage/blocksstable/ob_meta_block_reader.h index 92a58941d..363294d46 100644 --- a/src/storage/blocksstable/ob_meta_block_reader.h +++ b/src/storage/blocksstable/ob_meta_block_reader.h @@ -21,7 +21,7 @@ namespace blocksstable { // used for STORE_FILE_SYSTEM_LOCAL or STORE_FILE_SYSTEM_RAID class ObMetaBlockReader { - public: +public: ObMetaBlockReader(); virtual ~ObMetaBlockReader(); int read(const ObSuperBlockV2::MetaEntry& meta_entry); @@ -34,15 +34,15 @@ class ObMetaBlockReader { return macro_blocks_; } - protected: +protected: virtual int parse(const ObMacroBlockCommonHeader& common_header, const ObLinkedMacroBlockHeader& linked_header, const char* buf, const int64_t buf_len) = 0; - private: +private: int get_meta_blocks(const int64_t entry_block); int init(const int64_t file_id, const int64_t file_size); - private: +private: common::ObArenaAllocator allocator_; common::ObIODesc io_desc_; const char* buf_; diff --git a/src/storage/blocksstable/ob_micro_block_cache.h b/src/storage/blocksstable/ob_micro_block_cache.h index 38922315e..2c15f07f6 100644 --- a/src/storage/blocksstable/ob_micro_block_cache.h +++ b/src/storage/blocksstable/ob_micro_block_cache.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace blocksstable { class ObMicroBlockCacheKey : public common::ObIKVCacheKey { - public: +public: ObMicroBlockCacheKey(const uint64_t table_id, const MacroBlockId& block_id, const int64_t file_id, const int64_t offset, const int64_t size); ObMicroBlockCacheKey(); @@ -39,7 +39,7 @@ class ObMicroBlockCacheKey : public common::ObIKVCacheKey { const int64_t size); TO_STRING_KV(K_(table_id), K_(block_id), K_(file_id), K_(offset), K_(size)); - private: +private: uint64_t table_id_; MacroBlockId block_id_; int64_t file_id_; @@ -48,7 +48,7 @@ class ObMicroBlockCacheKey : public common::ObIKVCacheKey { }; class ObMicroBlockCacheValue : public common::ObIKVCacheValue { - public: +public: ObMicroBlockCacheValue( const char* buf, const int64_t size, const char* extra_buf = NULL, const int64_t extra_size = 0); virtual ~ObMicroBlockCacheValue(); @@ -64,17 +64,17 @@ class ObMicroBlockCacheValue : public common::ObIKVCacheValue { } TO_STRING_KV(K_(block_data)); - private: +private: ObMicroBlockData block_data_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMicroBlockCacheValue); }; class ObIMicroBlockCache; class ObMicroBlockBufferHandle { - public: +public: ObMicroBlockBufferHandle() : micro_block_(NULL) {} ~ObMicroBlockBufferHandle() @@ -94,7 +94,7 @@ class ObMicroBlockBufferHandle { } TO_STRING_KV(K_(handle), KP_(micro_block)); - private: +private: friend class ObIMicroBlockCache; common::ObKVCacheHandle handle_; const ObMicroBlockCacheValue* micro_block_; @@ -150,12 +150,12 @@ struct ObMultiBlockIOResult { }; class ObIPutSizeStat { - public: +public: virtual int add_put_size(const int64_t put_size) = 0; }; class ObIMicroBlockCache : public ObIPutSizeStat { - public: +public: typedef common::ObIKVCache BaseBlockCache; virtual int prefetch(const uint64_t table_id, const ObMacroBlockCtx& block_ctx, const int64_t offset, const int64_t size, const common::ObQueryFlag& flag, ObStorageFile* pg_file, ObMacroBlockHandle& handle); @@ -170,20 +170,20 @@ class ObIMicroBlockCache : public ObIPutSizeStat { virtual int get_cache(BaseBlockCache*& cache) = 0; virtual int get_allocator(common::ObIAllocator*& allocator) = 0; - public: +public: class ObIMicroBlockIOCallback : public common::ObIOCallback { - public: + public: ObIMicroBlockIOCallback(); virtual ~ObIMicroBlockIOCallback(); virtual int alloc_io_buf(char*& io_buf, int64_t& io_buf_size, int64_t& aligned_offset); - protected: + protected: friend class ObIMicroBlockCache; virtual int process_block(ObMacroBlockReader* reader, char* buffer, const int64_t offset, // offset means offset in macro_block const int64_t size, const ObMicroBlockCacheValue*& micro_block, common::ObKVCacheHandle& handle); - private: + private: int put_cache_and_fetch(const ObFullMacroBlockMeta& meta, ObMacroBlockReader& reader, const char* buffer, const int64_t offset, // offset means offset in macro_block const int64_t size, const char* payload_buf, const int64_t payload_size, @@ -191,10 +191,10 @@ class ObIMicroBlockCache : public ObIPutSizeStat { static const int64_t ALLOC_BUF_RETRY_INTERVAL = 100 * 1000; static const int64_t ALLOC_BUF_RETRY_TIMES = 3; - protected: + protected: int assign(const ObIMicroBlockIOCallback& other); - protected: + protected: BaseBlockCache* cache_; ObIPutSizeStat* put_size_stat_; common::ObIAllocator* allocator_; @@ -209,7 +209,7 @@ class ObIMicroBlockCache : public ObIPutSizeStat { storage::ObTableHandle table_handle_; }; class ObMicroBlockIOCallback : public ObIMicroBlockIOCallback { - public: + public: ObMicroBlockIOCallback(); virtual ~ObMicroBlockIOCallback(); virtual int64_t size() const; @@ -218,14 +218,14 @@ class ObIMicroBlockCache : public ObIPutSizeStat { virtual const char* get_data(); TO_STRING_KV(KP_(micro_block)); - private: + private: friend class ObIMicroBlockCache; const ObMicroBlockCacheValue* micro_block_; common::ObKVCacheHandle handle_; }; class ObMultiBlockIOCallback : public ObIMicroBlockIOCallback { - public: + public: ObMultiBlockIOCallback(); virtual ~ObMultiBlockIOCallback(); virtual int64_t size() const; @@ -234,7 +234,7 @@ class ObIMicroBlockCache : public ObIPutSizeStat { virtual const char* get_data(); TO_STRING_KV(KP_(&io_result)); - private: + private: friend class ObIMicroBlockCache; int set_io_ctx(const ObMultiBlockIOParam& io_param); void reset_io_ctx() @@ -251,7 +251,7 @@ class ObIMicroBlockCache : public ObIPutSizeStat { class ObMicroBlockCache : public common::ObKVCache, public ObIMicroBlockCache { - public: +public: typedef ObIKVCache BaseBlockCache; ObMicroBlockCache() @@ -265,7 +265,7 @@ class ObMicroBlockCache : public common::ObKVCache { - public: +public: ObMicroBlockIndexCache(); virtual ~ObMicroBlockIndexCache(); int init(const char* cache_name, const int64_t priority = 1); @@ -104,9 +104,9 @@ class ObMicroBlockIndexCache : public common::ObKVCache* cmp_funcs, int64_t* first_column_node_offset = nullptr) const; - private: +private: MemMicroIndexItem* index_array_; ObMicroIndexNode* node_array_; char* extra_space_base_; // reserved space for deep copy string and number @@ -218,7 +218,7 @@ class ObMicroBlockIndexMgr : public common::ObIKVCacheValue { bool is_inited_; int32_t row_count_; // macro block row count int32_t row_count_delta_; // row_count_delta of this macro block - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMicroBlockIndexMgr); }; } // end namespace blocksstable diff --git a/src/storage/blocksstable/ob_micro_block_index_reader.h b/src/storage/blocksstable/ob_micro_block_index_reader.h index 83af01f3b..fe34ef6f8 100644 --- a/src/storage/blocksstable/ob_micro_block_index_reader.h +++ b/src/storage/blocksstable/ob_micro_block_index_reader.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace blocksstable { struct ObBlockIndexIterator { - public: +public: typedef ObBlockIndexIterator self_t; typedef std::random_access_iterator_tag iterator_category; typedef uint64_t value_type; @@ -114,10 +114,10 @@ struct ObBlockIndexIterator { }; class ObMicroBlockIndexReader { - public: +public: typedef ObBlockIndexIterator Iterator; - public: +public: ObMicroBlockIndexReader(); ~ObMicroBlockIndexReader(); void reset(); @@ -152,13 +152,13 @@ class ObMicroBlockIndexReader { return nullptr == delta_array_ ? 0 : sizeof(int32_t) * block_count_; } - private: +private: int init(const char* index_buf, const common::ObObjMeta* column_type_array, const int32_t row_key_column_cnt, const int32_t micro_block_cnt, const int32_t index_buf_size, const int32_t endkey_buf_size, const int32_t mark_deletion_buf_size, const int32_t delta_buf_size, const int32_t data_base_offset, const common::ObRowStoreType row_store_type); class ObBlockIndexCompare { - public: + public: ObBlockIndexCompare(ObMicroBlockIndexReader& index_reader, common::ObObj* objs, const int64_t row_key_column_number) : index_reader_(index_reader), objs_(objs), @@ -185,14 +185,14 @@ class ObMicroBlockIndexReader { return ret_; } - private: + private: ObMicroBlockIndexReader& index_reader_; common::ObObj* objs_; const int64_t row_key_column_number_; int ret_; }; - private: +private: int get_end_keys(const Iterator& begin, const Iterator& end, common::ObIAllocator& allocator, common::ObIArray& end_keys); int get_micro_block_infos( @@ -202,7 +202,7 @@ class ObMicroBlockIndexReader { int lower_bound(const common::ObStoreRowkey& key, common::ObObj* objs, Iterator& index); int init_row_reader(const ObRowStoreType row_store_type); - private: +private: ObIRowReader* row_reader_; ObFlatRowReader flat_row_reader_; ObSparseRowReader sparse_row_reader_; diff --git a/src/storage/blocksstable/ob_micro_block_index_transformer.h b/src/storage/blocksstable/ob_micro_block_index_transformer.h index 85bfc0c71..a138cd221 100644 --- a/src/storage/blocksstable/ob_micro_block_index_transformer.h +++ b/src/storage/blocksstable/ob_micro_block_index_transformer.h @@ -50,7 +50,7 @@ struct MediumNode { }; class ObMicroBlockIndexTransformer { - public: +public: ObMicroBlockIndexTransformer(); ~ObMicroBlockIndexTransformer() {} @@ -61,10 +61,10 @@ class ObMicroBlockIndexTransformer { const ObFullMacroBlockMeta& meta, char* buffer, const int64_t size, const ObMicroBlockIndexMgr*& idx_mgr); int64_t get_transformer_size() const; - private: +private: struct NodeArray; - private: +private: void reset(); int block_index_to_node_vector(); int node_vector_to_node_array(); @@ -76,7 +76,7 @@ class ObMicroBlockIndexTransformer { int fill_block_index_mgr(char* buffer, int64_t size); - private: +private: struct NodeArray { ObMicroIndexNode* base_; int64_t total_count_; @@ -103,11 +103,11 @@ class ObMicroBlockIndexTransformer { return base_[index]; } - private: + private: DISALLOW_COPY_AND_ASSIGN(NodeArray); }; - private: +private: ObMicroBlockIndexReader index_reader_; int64_t block_count_; // count of micro blocks int64_t rowkey_column_count_; @@ -120,7 +120,7 @@ class ObMicroBlockIndexTransformer { ObMicroBlockIndexMgr* micro_index_mgr_; common::ObArenaAllocator allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMicroBlockIndexTransformer); }; } // end namespace blocksstable diff --git a/src/storage/blocksstable/ob_micro_block_index_writer.h b/src/storage/blocksstable/ob_micro_block_index_writer.h index 099ecb0ad..6e5b61b8b 100644 --- a/src/storage/blocksstable/ob_micro_block_index_writer.h +++ b/src/storage/blocksstable/ob_micro_block_index_writer.h @@ -25,7 +25,7 @@ namespace blocksstable { template class ObCommonMicroBlockIndexWriter { - public: +public: ObCommonMicroBlockIndexWriter(); virtual ~ObCommonMicroBlockIndexWriter(); virtual int init(const int64_t max_buffer_size); @@ -35,7 +35,7 @@ class ObCommonMicroBlockIndexWriter { int write(const int64_t buffer_idx, const T& value); int write(const int64_t buffer_idx, const char* buf, const int64_t buf_len); - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObCommonMicroBlockIndexWriter); bool is_inited_; ObSelfBufferWriter buffer_[BUFFER_COUNT]; @@ -128,7 +128,7 @@ int ObCommonMicroBlockIndexWriter::write(const int64_t buffer_idx, } class ObMicroBlockIndexWriter : public ObCommonMicroBlockIndexWriter<4L> { - public: +public: static const int64_t INDEX_ENTRY_SIZE = sizeof(int32_t) * 2; static const int64_t MARK_DELETION_ENRTRY_SIZE = sizeof(uint8_t); static const int64_t DELTA_ENTRY_SIZE = sizeof(int32_t); @@ -170,10 +170,10 @@ class ObMicroBlockIndexWriter : public ObCommonMicroBlockIndexWriter<4L> { inline int64_t get_block_size() const; static int64_t get_entry_size(bool is_multi_version_minor_merge); - protected: +protected: bool is_multi_version_minor_merge_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMicroBlockIndexWriter); typedef ObCommonMicroBlockIndexWriter<4L> BaseWriter; static const int64_t ENDKEY_BUFFER_IDX = 0; @@ -197,7 +197,7 @@ inline int64_t ObMicroBlockIndexWriter::get_entry_size(bool is_multi_version_min } class ObLobMicroBlockIndexWriter : public ObCommonMicroBlockIndexWriter<2L> { - public: +public: static const int64_t INDEX_ENTRY_SIZE = 3 * sizeof(int32_t) + sizeof(int64_t) * 2; ObLobMicroBlockIndexWriter(); virtual ~ObLobMicroBlockIndexWriter() = default; @@ -214,7 +214,7 @@ class ObLobMicroBlockIndexWriter : public ObCommonMicroBlockIndexWriter<2L> { } int64_t get_block_size() const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObLobMicroBlockIndexWriter); typedef ObCommonMicroBlockIndexWriter<2L> BaseWriter; static const int64_t INDEX_BUFFER_IDX = 0; diff --git a/src/storage/blocksstable/ob_micro_block_reader.cpp b/src/storage/blocksstable/ob_micro_block_reader.cpp index aa53cb5e9..90c661082 100644 --- a/src/storage/blocksstable/ob_micro_block_reader.cpp +++ b/src/storage/blocksstable/ob_micro_block_reader.cpp @@ -644,7 +644,7 @@ int ObMicroBlockReader::base_init(const ObMicroBlockData& block_data) template class PreciseCompare { - public: +public: PreciseCompare(int& ret, bool& equal, ReaderType* reader, const char* data_begin, const int32_t* index_data, const ObColumnMap* column_map, const int64_t compare_column_count) : ret_(ret), @@ -666,7 +666,7 @@ class PreciseCompare { return compare(row_idx, rowkey, false); } - private: +private: inline bool compare(const int64_t row_idx, const ObStoreRowkey& rowkey, const bool lower_bound) { bool bret = false; @@ -693,7 +693,7 @@ class PreciseCompare { return bret; } - private: +private: int& ret_; bool& equal_; ReaderType* reader_; diff --git a/src/storage/blocksstable/ob_micro_block_reader.h b/src/storage/blocksstable/ob_micro_block_reader.h index 0fc1db503..845de506c 100644 --- a/src/storage/blocksstable/ob_micro_block_reader.h +++ b/src/storage/blocksstable/ob_micro_block_reader.h @@ -34,59 +34,32 @@ struct ObStoreRowLockState; namespace blocksstable { class ObMicroBlockGetReader : public ObIMicroBlockGetReader { - public: +public: ObMicroBlockGetReader(); virtual ~ObMicroBlockGetReader(); - virtual int get_row( - const uint64_t tenant_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObColumnMap &column_map, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - storage::ObStoreRow &row) override; - virtual int get_row( - const uint64_t tenant_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - storage::ObStoreRow &row) override; - virtual int exist_row( - const uint64_t tenant_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - bool &exist, - bool &found) override; - virtual int check_row_locked( - memtable::ObIMvccCtx &ctx, - const transaction::ObTransStateTableGuard &trans_table_guard, - const transaction::ObTransID &read_trans_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - storage::ObStoreRowLockState &lock_state) override; + virtual int get_row(const uint64_t tenant_id, const ObMicroBlockData& block_data, const common::ObStoreRowkey& rowkey, + const ObColumnMap& column_map, const ObFullMacroBlockMeta& macro_meta, + const storage::ObSSTableRowkeyHelper* rowkey_helper, storage::ObStoreRow& row) override; + virtual int get_row(const uint64_t tenant_id, const ObMicroBlockData& block_data, const common::ObStoreRowkey& rowkey, + const ObFullMacroBlockMeta& macro_meta, const storage::ObSSTableRowkeyHelper* rowkey_helper, + storage::ObStoreRow& row) override; + virtual int exist_row(const uint64_t tenant_id, const ObMicroBlockData& block_data, + const common::ObStoreRowkey& rowkey, const ObFullMacroBlockMeta& macro_meta, + const storage::ObSSTableRowkeyHelper* rowkey_helper, bool& exist, bool& found) override; + virtual int check_row_locked(memtable::ObIMvccCtx& ctx, const transaction::ObTransStateTableGuard& trans_table_guard, + const transaction::ObTransID& read_trans_id, const ObMicroBlockData& block_data, + const common::ObStoreRowkey& rowkey, const ObFullMacroBlockMeta& macro_meta, + const storage::ObSSTableRowkeyHelper* rowkey_helper, storage::ObStoreRowLockState& lock_state) override; + protected: - int inner_init(const ObMicroBlockData &block_data); - virtual int check_row_locked_( - ObIRowReader *row_reader_ptr, - memtable::ObIMvccCtx &ctx, - const transaction::ObTransStateTableGuard &trans_table_guard, - const transaction::ObTransID &read_trans_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - storage::ObStoreRowLockState &lock_state); - virtual int locate_row( - const common::ObStoreRowkey &rowkey, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - const common::ObObjMeta *cols_type, - const char *&row_buf, - int64_t &row_len); + int inner_init(const ObMicroBlockData& block_data); + virtual int check_row_locked_(ObIRowReader* row_reader_ptr, memtable::ObIMvccCtx& ctx, + const transaction::ObTransStateTableGuard& trans_table_guard, const transaction::ObTransID& read_trans_id, + const ObMicroBlockData& block_data, const common::ObStoreRowkey& rowkey, const ObFullMacroBlockMeta& macro_meta, + const storage::ObSSTableRowkeyHelper* rowkey_helper, storage::ObStoreRowLockState& lock_state); + virtual int locate_row(const common::ObStoreRowkey& rowkey, const storage::ObSSTableRowkeyHelper* rowkey_helper, + const common::ObObjMeta* cols_type, const char*& row_buf, int64_t& row_len); + protected: common::ObArenaAllocator allocator_; const ObMicroBlockHeader* header_; @@ -97,103 +70,65 @@ protected: }; class ObMultiVersionBlockGetReader : public ObMicroBlockGetReader { - public: +public: ObMultiVersionBlockGetReader(); virtual ~ObMultiVersionBlockGetReader(); - virtual int get_row( - const uint64_t tenant_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObColumnMap &column_map, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - storage::ObStoreRow &row) override; - virtual int get_row( - const uint64_t tenant_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - storage::ObStoreRow &row) override; - virtual int exist_row( - const uint64_t tenant_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - bool &exist, - bool &found) override; - virtual int check_row_locked( - memtable::ObIMvccCtx &ctx, - const transaction::ObTransStateTableGuard &trans_table_guard, - const transaction::ObTransID &read_trans_id, - const ObMicroBlockData &block_data, - const common::ObStoreRowkey &rowkey, - const ObFullMacroBlockMeta ¯o_meta, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - storage::ObStoreRowLockState &lock_state) override; + virtual int get_row(const uint64_t tenant_id, const ObMicroBlockData& block_data, const common::ObStoreRowkey& rowkey, + const ObColumnMap& column_map, const ObFullMacroBlockMeta& macro_meta, + const storage::ObSSTableRowkeyHelper* rowkey_helper, storage::ObStoreRow& row) override; + virtual int get_row(const uint64_t tenant_id, const ObMicroBlockData& block_data, const common::ObStoreRowkey& rowkey, + const ObFullMacroBlockMeta& macro_meta, const storage::ObSSTableRowkeyHelper* rowkey_helper, + storage::ObStoreRow& row) override; + virtual int exist_row(const uint64_t tenant_id, const ObMicroBlockData& block_data, + const common::ObStoreRowkey& rowkey, const ObFullMacroBlockMeta& macro_meta, + const storage::ObSSTableRowkeyHelper* rowkey_helper, bool& exist, bool& found) override; + virtual int check_row_locked(memtable::ObIMvccCtx& ctx, const transaction::ObTransStateTableGuard& trans_table_guard, + const transaction::ObTransID& read_trans_id, const ObMicroBlockData& block_data, + const common::ObStoreRowkey& rowkey, const ObFullMacroBlockMeta& macro_meta, + const storage::ObSSTableRowkeyHelper* rowkey_helper, storage::ObStoreRowLockState& lock_state) override; + protected: - virtual int locate_row( - const common::ObStoreRowkey &rowkey, - const storage::ObSSTableRowkeyHelper *rowkey_helper, - const common::ObObjMeta *cols_type, - const char *&row_buf, - int64_t &row_len) override; + virtual int locate_row(const common::ObStoreRowkey& rowkey, const storage::ObSSTableRowkeyHelper* rowkey_helper, + const common::ObObjMeta* cols_type, const char*& row_buf, int64_t& row_len) override; + private: - int get_trans_version( - const common::ObStoreRowkey &rowkey, - const common::ObObjMeta *cols_type, - const int64_t target, - int64_t &trans_version); + int get_trans_version(const common::ObStoreRowkey& rowkey, const common::ObObjMeta* cols_type, const int64_t target, + int64_t& trans_version); }; class ObMicroBlockReader : public ObIMicroBlockReader { - public: +public: static const int32_t BLOCK_HEADER_SIZE = static_cast(sizeof(ObMicroBlockHeader)); static const int32_t ROW_INDEX_ITEM_SIZE = static_cast(sizeof(int32_t)); - public: +public: ObMicroBlockReader(); virtual ~ObMicroBlockReader(); virtual int init(const ObMicroBlockData& block_data, const ObColumnMap* column_map, const common::ObRowStoreType out_type = common::FLAT_ROW_STORE) override; virtual void reset() override; - virtual int get_row( - const int64_t index, - storage::ObStoreRow &row) override; - virtual int get_rows( - const int64_t begin_index, - const int64_t end_index, - const int64_t row_capacity, - storage::ObStoreRow *rows, - int64_t &row_count) override; - virtual int get_row_count(int64_t &row_count) override; - virtual int get_row_header(const int64_t row_idx, const ObRowHeader *&row_header) override; - virtual int get_multi_version_info( - const int64_t row_idx, - const int64_t version_column_idx, - const int64_t sql_sequence_idx, - storage::ObMultiVersionRowFlag &flag, - transaction::ObTransID &trans_id, - int64_t &version, - int64_t &sql_sequence) override; + virtual int get_row(const int64_t index, storage::ObStoreRow& row) override; + virtual int get_rows(const int64_t begin_index, const int64_t end_index, const int64_t row_capacity, + storage::ObStoreRow* rows, int64_t& row_count) override; + virtual int get_row_count(int64_t& row_count) override; + virtual int get_row_header(const int64_t row_idx, const ObRowHeader*& row_header) override; + virtual int get_multi_version_info(const int64_t row_idx, const int64_t version_column_idx, + const int64_t sql_sequence_idx, storage::ObMultiVersionRowFlag& flag, transaction::ObTransID& trans_id, + int64_t& version, int64_t& sql_sequence) override; + protected: - int base_init(const ObMicroBlockData &block_data); - virtual int find_bound(const common::ObStoreRowkey &key, - const bool lower_bound, - const int64_t begin_idx, - const int64_t end_idx, - int64_t &row_idx, - bool &equal) override; + int base_init(const ObMicroBlockData& block_data); + virtual int find_bound(const common::ObStoreRowkey& key, const bool lower_bound, const int64_t begin_idx, + const int64_t end_idx, int64_t& row_idx, bool& equal) override; + private: - int get_row_impl( - const int64_t index, - storage::ObStoreRow &row); + int get_row_impl(const int64_t index, storage::ObStoreRow& row); + protected: - const ObMicroBlockHeader *header_; - const char *data_begin_; - const char *data_end_; - const int32_t *index_data_; + const ObMicroBlockHeader* header_; + const char* data_begin_; + const char* data_end_; + const int32_t* index_data_; common::ObArenaAllocator allocator_; ObFlatRowReader flat_row_reader_; }; diff --git a/src/storage/blocksstable/ob_micro_block_row_exister.h b/src/storage/blocksstable/ob_micro_block_row_exister.h index a0a4d4088..8c397ed94 100644 --- a/src/storage/blocksstable/ob_micro_block_row_exister.h +++ b/src/storage/blocksstable/ob_micro_block_row_exister.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace blocksstable { class ObMicroBlockRowExister : public ObIMicroBlockRowFetcher { - public: +public: ObMicroBlockRowExister(); virtual ~ObMicroBlockRowExister(); int is_exist(const common::ObStoreRowkey& rowkey, const ObFullMacroBlockMeta& macro_meta, diff --git a/src/storage/blocksstable/ob_micro_block_row_getter.h b/src/storage/blocksstable/ob_micro_block_row_getter.h index b8cdab89b..10e30a70b 100644 --- a/src/storage/blocksstable/ob_micro_block_row_getter.h +++ b/src/storage/blocksstable/ob_micro_block_row_getter.h @@ -21,13 +21,13 @@ namespace oceanbase { namespace blocksstable { class ObIMicroBlockRowFetcher { - public: +public: ObIMicroBlockRowFetcher(); virtual ~ObIMicroBlockRowFetcher(); virtual int init(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, const storage::ObSSTable* sstable); - protected: +protected: int prepare_reader(const ObFullMacroBlockMeta& macro_meta); const storage::ObTableIterParam* param_; storage::ObTableAccessContext* context_; @@ -41,7 +41,7 @@ class ObIMicroBlockRowFetcher { }; class ObMicroBlockRowGetter : public ObIMicroBlockRowFetcher { - public: +public: ObMicroBlockRowGetter(); virtual ~ObMicroBlockRowGetter(); virtual int init(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, @@ -53,7 +53,7 @@ class ObMicroBlockRowGetter : public ObIMicroBlockRowFetcher { const ObRowCacheValue& value, const storage::ObStoreRow*& row); int get_not_exist_row(const common::ObStoreRowkey& rowkey, const storage::ObStoreRow*& row); - private: +private: int project_row(const ObStoreRowkey& rowkey, const ObRowCacheValue& value, const ObColumnMap& column_map, const storage::ObStoreRow*& row); int project_cache_row(const ObStoreRowkey& rowkey, const ObRowCacheValue& value, const ObColumnMap& column_map, @@ -61,7 +61,7 @@ class ObMicroBlockRowGetter : public ObIMicroBlockRowFetcher { int project_cache_sparse_row(const ObStoreRowkey& rowkey, const ObRowCacheValue& value, const ObColumnMap& column_map, const storage::ObStoreRow*& row); - private: +private: common::ObArenaAllocator allocator_; ObColumnMap column_map_; storage::ObStoreRow row_; diff --git a/src/storage/blocksstable/ob_micro_block_row_lock_checker.h b/src/storage/blocksstable/ob_micro_block_row_lock_checker.h index fb4bbc444..f6e96d8de 100644 --- a/src/storage/blocksstable/ob_micro_block_row_lock_checker.h +++ b/src/storage/blocksstable/ob_micro_block_row_lock_checker.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace blocksstable { class ObMicroBlockRowLockChecker : public ObIMicroBlockRowFetcher { - public: +public: ObMicroBlockRowLockChecker(); virtual ~ObMicroBlockRowLockChecker(); int check_row_locked(const transaction::ObTransStateTableGuard& trans_table_guard, diff --git a/src/storage/blocksstable/ob_micro_block_row_scanner.h b/src/storage/blocksstable/ob_micro_block_row_scanner.h index 8ae9e0887..8a3d12aec 100644 --- a/src/storage/blocksstable/ob_micro_block_row_scanner.h +++ b/src/storage/blocksstable/ob_micro_block_row_scanner.h @@ -34,7 +34,7 @@ namespace blocksstable { class ObColumnMap; class ObIMicroBlockRowScanner { - public: +public: ObIMicroBlockRowScanner() : param_(NULL), context_(NULL), @@ -67,7 +67,7 @@ class ObIMicroBlockRowScanner { int alloc_row(ObIAllocator& allocator, const int64_t cell_cnt, storage::ObStoreRow& row); virtual int get_cur_micro_row_count(int64_t& row_count) const; - protected: +protected: virtual int inner_get_next_row(const storage::ObStoreRow*& row) = 0; virtual int inner_get_next_rows(const storage::ObStoreRow*& rows, int64_t& count) = 0; int set_reader(const ObRowStoreType store_type); @@ -90,7 +90,7 @@ class ObIMicroBlockRowScanner { return common::ObActionFlag::OP_ROW_DOES_NOT_EXIST == row.flag_; } - protected: +protected: // assigned in init func const storage::ObTableIterParam* param_; storage::ObTableAccessContext* context_; @@ -117,7 +117,7 @@ class ObIMicroBlockRowScanner { // major sstable micro block scanner for query and merge class ObMicroBlockRowScanner : public ObIMicroBlockRowScanner { - public: +public: ObMicroBlockRowScanner() {} virtual ~ObMicroBlockRowScanner() @@ -128,11 +128,11 @@ class ObMicroBlockRowScanner : public ObIMicroBlockRowScanner { const ObMicroBlockData& block_data, const bool is_left_border, const bool is_right_border) override; void reset(); - protected: +protected: virtual int inner_get_next_row(const storage::ObStoreRow*& row) override; virtual int inner_get_next_rows(const storage::ObStoreRow*& rows, int64_t& count) override; - protected: +protected: storage::ObStoreRow rows_[ObIMicroBlockReader::OB_MAX_BATCH_ROW_COUNT]; char obj_buf_[common::OB_ROW_MAX_COLUMNS_COUNT * sizeof(ObObj) * ObIMicroBlockReader::OB_MAX_BATCH_ROW_COUNT]; }; @@ -178,7 +178,7 @@ index | rowkey | version | flag | c1 | c2 | c3 // multi version sstable micro block scanner for query and major merge class ObMultiVersionMicroBlockRowScanner : public ObIMicroBlockRowScanner { - public: +public: ObMultiVersionMicroBlockRowScanner() : cell_allocator_(common::ObModIds::OB_SSTABLE_READER), reserved_pos_(ObIMicroBlockReader::INVALID_ROW_INDEX), @@ -198,11 +198,11 @@ class ObMultiVersionMicroBlockRowScanner : public ObIMicroBlockRowScanner { void reset(); void rescan() override; - protected: +protected: virtual int inner_get_next_row(const storage::ObStoreRow*& row) override; virtual int inner_get_next_rows(const storage::ObStoreRow*& rows, int64_t& count) override; - private: +private: OB_INLINE void inner_reset(); OB_INLINE int inner_get_next_row_impl(const storage::ObStoreRow*& ret_row); void reuse_cur_micro_row(); @@ -215,7 +215,7 @@ class ObMultiVersionMicroBlockRowScanner : public ObIMicroBlockRowScanner { int lock_for_read(const transaction::ObLockForReadArg& lock_for_read_arg, bool& can_read, int64_t& trans_version, bool& is_determined_state); - private: +private: storage::ObStoreRow prev_micro_row_; storage::ObStoreRow cur_micro_row_; storage::ObNopPos nop_pos_; @@ -240,7 +240,7 @@ class ObMultiVersionMicroBlockRowScanner : public ObIMicroBlockRowScanner { // multi version sstable micro block scanner for minor merge class ObMultiVersionMicroBlockMinorMergeRowScanner : public ObIMicroBlockRowScanner { - public: +public: ObMultiVersionMicroBlockMinorMergeRowScanner(); virtual ~ObMultiVersionMicroBlockMinorMergeRowScanner(); @@ -256,11 +256,11 @@ class ObMultiVersionMicroBlockMinorMergeRowScanner : public ObIMicroBlockRowScan TO_STRING_KV(K_(macro_id), K_(is_last_multi_version_row), K_(is_row_queue_ready), "row_queue_count", row_queue_.count(), K_(start), K_(current), K_(last)); - protected: +protected: virtual int inner_get_next_row(const storage::ObStoreRow*& row) override; virtual int inner_get_next_rows(const storage::ObStoreRow*& rows, int64_t& count) override; - private: +private: enum ScanState { SCAN_START = 0, GET_RUNNING_TRANS_ROW = 1, @@ -271,7 +271,7 @@ class ObMultiVersionMicroBlockMinorMergeRowScanner : public ObIMicroBlockRowScan LOCATE_LAST_COMMITTED_ROW = 6, }; - private: +private: int init_row_queue(const int64_t row_col_cnt); void init_multi_version_rowkey_info(const int multi_version_rowkey_type, int64_t& expect_multi_version_col_cnt); int locate_last_committed_row(); @@ -302,7 +302,7 @@ class ObMultiVersionMicroBlockMinorMergeRowScanner : public ObIMicroBlockRowScan void complete_row_queue(); int filter_unneeded_row(bool& add_row_queue_flag, bool& is_magic_row_flag); - private: +private: enum RowCompactInfoIndex { RNPI_FIRST_ROW = 0, RNPI_TRANS_COMPACT_ROW = 1, diff --git a/src/storage/blocksstable/ob_micro_block_scanner.h b/src/storage/blocksstable/ob_micro_block_scanner.h index 14b7c63e9..e91a3457f 100644 --- a/src/storage/blocksstable/ob_micro_block_scanner.h +++ b/src/storage/blocksstable/ob_micro_block_scanner.h @@ -26,7 +26,7 @@ class ObStoreRow; } namespace blocksstable { class ObMicroBlockScanner { - public: +public: ObMicroBlockScanner(); ~ObMicroBlockScanner(); void reset(); @@ -120,12 +120,12 @@ class ObMicroBlockScanner { return ret; } - private: +private: int locate_range_pos(const common::ObStoreRange& range, const bool is_left_bound_block, const bool is_right_bound_block, int64_t& begin, int64_t& end); int set_reader(const common::ObRowStoreType sotre_type); - private: +private: int set_base_scan_param(const common::ObStoreRange& range, const bool is_bound_block, const bool is_reverse_scan); inline int end_of_block() const { @@ -148,7 +148,7 @@ class ObMicroBlockScanner { return ret; } - private: +private: ObIMicroBlockReader* reader_; ObMicroBlockReader flat_reader_; ObSparseMicroBlockReader sparse_reader_; // for dumpsstable diff --git a/src/storage/blocksstable/ob_micro_block_writer.h b/src/storage/blocksstable/ob_micro_block_writer.h index efa26a2e6..48c3aae84 100644 --- a/src/storage/blocksstable/ob_micro_block_writer.h +++ b/src/storage/blocksstable/ob_micro_block_writer.h @@ -42,13 +42,13 @@ class ObMicroBlockWriter : public ObIMicroBlockWriter { static const int64_t DEFAULT_DATA_BUFFER_SIZE = common::OB_DEFAULT_MACRO_BLOCK_SIZE; static const int64_t DEFAULT_INDEX_BUFFER_SIZE = 2 * 1024; static const int64_t MIN_RESERVED_SIZE = 1024; // 1KB; - public: +public: ObMicroBlockWriter(); virtual ~ObMicroBlockWriter(); int init(const int64_t micro_block_size_limit, const int64_t rowkey_column_count, const int64_t column_count = 0, const common::ObRowStoreType row_store_type = common::FLAT_ROW_STORE); - virtual int append_row(const storage::ObStoreRow &row) override; - virtual int build_block(char *&buf, int64_t &size) override; + virtual int append_row(const storage::ObStoreRow& row) override; + virtual int build_block(char*& buf, int64_t& size) override; virtual void reuse() override; virtual int64_t get_block_size() const override; @@ -58,7 +58,7 @@ class ObMicroBlockWriter : public ObIMicroBlockWriter { virtual common::ObString get_last_rowkey() const override; void reset(); - private: +private: inline int64_t get_index_size() const; int check_input_param(const int64_t macro_block_size, const int64_t column_count, const int64_t rowkey_column_count, const ObRowStoreType row_store_type); @@ -66,7 +66,7 @@ class ObMicroBlockWriter : public ObIMicroBlockWriter { int reserve_header(const int64_t column_count); bool is_exceed_limit(const int64_t row_length, const int64_t rowkey_length); - private: +private: int64_t micro_block_size_limit_; int64_t column_count_; ObRowWriter row_writer_; diff --git a/src/storage/blocksstable/ob_raid_file_system.h b/src/storage/blocksstable/ob_raid_file_system.h index 675b9ea1d..9cf08f0fb 100644 --- a/src/storage/blocksstable/ob_raid_file_system.h +++ b/src/storage/blocksstable/ob_raid_file_system.h @@ -186,7 +186,7 @@ struct ObRaidFileStatus { }; class ObRaidStripLocation { - public: +public: ObRaidStripLocation(); int init( @@ -197,7 +197,7 @@ class ObRaidStripLocation { K_(blocksstable_size), K_(include_header), K_(is_inited), K_(strip_skewing_step), K_(cur_idx), K_(has_next), K_(strip_infos)); - private: +private: struct StripInfo final { StripInfo(); int64_t disk_idx_; @@ -234,7 +234,7 @@ struct ObRaidDiskUtil { }; class ObRaidIOErrorHandler final : public ObIIOErrorHandler { - public: +public: ObRaidIOErrorHandler(); virtual ~ObRaidIOErrorHandler() {} @@ -248,7 +248,7 @@ class ObRaidIOErrorHandler final : public ObIIOErrorHandler { TO_STRING_KV(K_(is_inited), K_(macro_block_ctx), K_(offset), K_(size), K_(io_desc), KP_(out_io_buf), K_(out_io_buf_size), K_(aligned_offset)); - private: +private: bool is_inited_; ObMacroBlockCtx macro_block_ctx_; int64_t offset_; // offset of read_info @@ -262,7 +262,7 @@ class ObRaidIOErrorHandler final : public ObIIOErrorHandler { }; class ObRaidRecoverIOCallback : public ObIOCallback { - public: +public: struct RecoverParam { common::ObSEArray input_index_; common::ObSEArray recover_index_; @@ -289,7 +289,7 @@ class ObRaidRecoverIOCallback : public ObIOCallback { TO_STRING_KV(K_(is_inited), KP_(allocator), KP_(buf), KP_(io_buf_size), K_(io_buf_size), K_(recover_param), K_(out_offset), KP_(out_io_buf), K_(out_io_buf_size)); - private: +private: bool is_inited_; common::ObIAllocator* allocator_; // TODO(): replace it char* buf_; // whole buf @@ -304,7 +304,7 @@ class ObRaidRecoverIOCallback : public ObIOCallback { }; class ObRaidFileWriteMgr final : public common::ObIOWriteFinishCallback { - public: +public: ObRaidFileWriteMgr(); ~ObRaidFileWriteMgr(); int init(); @@ -312,7 +312,7 @@ class ObRaidFileWriteMgr final : public common::ObIOWriteFinishCallback { int record_start(const int64_t block_index); // if old request to same block not finish, will wait int notice_finish(const int64_t block_index); - private: +private: bool is_inited_; ObThreadCond cond_; hash::ObHashSet block_set_; @@ -320,18 +320,18 @@ class ObRaidFileWriteMgr final : public common::ObIOWriteFinishCallback { }; class ObRaidRebuildTask final : public common::ObTimerTask { - public: +public: ObRaidRebuildTask(ObRaidFileSystem& file_system); virtual ~ObRaidRebuildTask(); void runTimerTask(); - private: +private: ObRaidFileSystem& file_system_; DISALLOW_COPY_AND_ASSIGN(ObRaidRebuildTask); }; class ObRaidFileSystem : public ObStoreFileSystem { - public: +public: ObRaidFileSystem(); virtual ~ObRaidFileSystem(); @@ -376,7 +376,7 @@ class ObRaidFileSystem : public ObStoreFileSystem { TO_STRING_KV("type", "RAID"); - private: +private: int open(bool& is_formated); int init_raid( const int64_t min_total_space, const int64_t min_free_disk_space, common::ObIArray& disk_status); @@ -406,7 +406,7 @@ class ObRaidFileSystem : public ObStoreFileSystem { int write_strip_data(const ObDiskID& disk_id, const int64_t offset, const char* strip_buf, const int64_t strip_size); int finish_rebuild_disk(const ObDiskID& disk_id, const int64_t rebuild_macro_count); - private: +private: bool is_opened_; mutable lib::ObMutex mutex_; // TODO(): add latch id later mutable common::SpinRWLock lock_; // TODO(): add latch id later diff --git a/src/storage/blocksstable/ob_row_cache.h b/src/storage/blocksstable/ob_row_cache.h index 1c7fffe7b..462a2af42 100644 --- a/src/storage/blocksstable/ob_row_cache.h +++ b/src/storage/blocksstable/ob_row_cache.h @@ -25,7 +25,7 @@ class ObSSTable; } namespace blocksstable { class ObRowCacheKey : public common::ObIKVCacheKey { - public: +public: ObRowCacheKey(); ObRowCacheKey(const uint64_t table_id, const int64_t file_id, const common::ObStoreRowkey& row_key, const int64_t data_version, const storage::ObITable::TableType table_type); @@ -46,7 +46,7 @@ class ObRowCacheKey : public common::ObIKVCacheKey { bool is_valid() const; TO_STRING_KV(K_(table_id), K_(file_id), K_(rowkey_size), K_(data_version), K_(table_type), K_(rowkey)); - private: +private: uint64_t table_id_; int64_t file_id_; int64_t rowkey_size_; @@ -54,12 +54,12 @@ class ObRowCacheKey : public common::ObIKVCacheKey { storage::ObITable::TableType table_type_; common::ObStoreRowkey rowkey_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRowCacheKey); }; class ObRowCacheValue : public common::ObIKVCacheValue { - public: +public: ObRowCacheValue(); virtual ~ObRowCacheValue(); int init(const ObFullMacroBlockMeta& macro_meta, const storage::ObStoreRow* row, const MacroBlockId& block_id); @@ -120,7 +120,7 @@ class ObRowCacheValue : public common::ObIKVCacheValue { } TO_STRING_KV(KP_(obj_array), K_(size), K_(block_id), KP_(column_ids)); - private: +private: common::ObObj* obj_array_; uint16_t* column_ids_; int64_t size_; @@ -151,7 +151,7 @@ struct ObRowValueHandle { }; class ObRowCache : public common::ObKVCache { - public: +public: ObRowCache(); virtual ~ObRowCache(); int get_row(const ObRowCacheKey& key, ObRowValueHandle& handle); diff --git a/src/storage/blocksstable/ob_row_queue.h b/src/storage/blocksstable/ob_row_queue.h index d30cc6426..427575218 100644 --- a/src/storage/blocksstable/ob_row_queue.h +++ b/src/storage/blocksstable/ob_row_queue.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace blocksstable { class ObRowQueue { - public: +public: ObRowQueue() : cell_cnt_(0), cur_pos_(0), row_type_(MAX_ROW_STORE), is_inited_(false) {} int init(const ObRowStoreType row_type, const int64_t cell_cnt); @@ -71,10 +71,10 @@ class ObRowQueue { } TO_STRING_KV(K_(cell_cnt), K_(cur_pos), "count", rows_.count(), K_(row_type)); - private: +private: int alloc_row(storage::ObStoreRow*& row, common::ObIAllocator& allocator); - private: +private: static const int64_t DEFAULT_MULTIVERSION_ROW_COUNT = 64; int64_t cell_cnt_; int64_t cur_pos_; diff --git a/src/storage/blocksstable/ob_row_reader.h b/src/storage/blocksstable/ob_row_reader.h index 9b671e0b5..01fdf8d6c 100644 --- a/src/storage/blocksstable/ob_row_reader.h +++ b/src/storage/blocksstable/ob_row_reader.h @@ -29,7 +29,7 @@ namespace blocksstable { class ObColumnMap; class ObColumnIndexItem; class ObIRowReader { - public: +public: ObIRowReader(); virtual ~ObIRowReader(); // read rowkey with no meta(just column object array) @@ -78,12 +78,12 @@ class ObIRowReader { void reset(); bool judge_need_setup(const char* buf, const int64_t row_end_pos, const int64_t pos); - protected: +protected: int read_text_store(const storage::ObStoreMeta& store_meta, common::ObIAllocator& allocator, common::ObObj& obj); template static const T* read(const char* row_buf, int64_t& pos); - protected: +protected: const char* buf_; int64_t row_end_pos_; int64_t start_pos_; @@ -105,7 +105,7 @@ inline const T* ObIRowReader::read(const char* row_buf, int64_t& pos) } class ObFlatRowReader : public ObIRowReader { - public: +public: ObFlatRowReader(); virtual ~ObFlatRowReader() {} @@ -130,10 +130,10 @@ class ObFlatRowReader : public ObIRowReader { int read_obj(const common::ObObjMeta& src_meta, common::ObIAllocator& allocator, common::ObObj& obj); int read_obj_no_meta(const common::ObObjMeta& src_meta, common::ObIAllocator& allocator, common::ObObj& obj); - protected: +protected: OB_INLINE int analyze_row_header(const int64_t column_cnt, transaction::ObTransID* trans_id_ptr); - private: +private: int read_flat_row_from_flat_storage( const ObColumnMap& column_map, common::ObIAllocator& allocator, storage::ObStoreRow& row); int read_sparse_row_from_flat_storage( @@ -143,7 +143,7 @@ class ObFlatRowReader : public ObIRowReader { }; class ObSparseRowReader : public ObIRowReader { - public: +public: ObSparseRowReader(); virtual ~ObSparseRowReader() {} @@ -164,10 +164,10 @@ class ObSparseRowReader : public ObIRowReader { int read_compact_rowkey(const common::ObObjMeta* column_types, const int64_t column_count, const char* buf, const int64_t row_end_pos, int64_t& pos, common::ObNewRow& row) override; - protected: +protected: OB_INLINE int analyze_row_header(transaction::ObTransID* trans_id_ptr); - private: +private: int read_flat_row_from_sparse_storage( const ObColumnMap& column_map, common::ObIAllocator& allocator, storage::ObStoreRow& row); int read_sparse_row_from_sparse_storage( diff --git a/src/storage/blocksstable/ob_row_writer.h b/src/storage/blocksstable/ob_row_writer.h index ce4cfa4e6..2de0a8dd8 100644 --- a/src/storage/blocksstable/ob_row_writer.h +++ b/src/storage/blocksstable/ob_row_writer.h @@ -29,7 +29,7 @@ namespace blocksstable { class ObRowHeader; class ObRowWriter { - public: +public: ObRowWriter(); virtual ~ObRowWriter(); int write(const common::ObNewRow& row, char* buf, const int64_t buf_size, const common::ObRowStoreType row_store_type, @@ -43,7 +43,7 @@ class ObRowWriter { const int64_t buf_size, int64_t& pos, int64_t& rowkey_start_pos, int64_t& rowkey_end_pos, const bool only_row_key = false); - private: +private: struct NumberAllocator { char* buf_; int64_t buf_size_; @@ -65,7 +65,7 @@ class ObRowWriter { } }; - private: +private: inline int write_oracle_timestamp( const common::ObOTimestampData& ot_data, const common::ObOTimestampMetaAttrType otmat); int write_text_store(const common::ObObj& obj); @@ -89,7 +89,7 @@ class ObRowWriter { OB_INLINE int write_char(const common::ObObj& obj, const storage::ObDataStoreType& meta_type, const common::ObString& char_value, const int64_t max_length); - private: +private: char* buf_; int64_t buf_size_; int64_t start_pos_; diff --git a/src/storage/blocksstable/ob_sparse_cell_reader.h b/src/storage/blocksstable/ob_sparse_cell_reader.h index deec99209..f0870d2bd 100644 --- a/src/storage/blocksstable/ob_sparse_cell_reader.h +++ b/src/storage/blocksstable/ob_sparse_cell_reader.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace blocksstable { class ObSparseCellReader { - public: +public: ObSparseCellReader(); virtual ~ObSparseCellReader() { @@ -36,7 +36,7 @@ class ObSparseCellReader { } int read_cell(common::ObObj& obj); - private: +private: inline int read_oracle_timestamp(const common::ObObjType obj_type, const uint8_t meta_attr, const common::ObOTimestampMetaAttrType otmat, common::ObObj& obj); int read_interval_ds(common::ObObj& obj); @@ -47,7 +47,7 @@ class ObSparseCellReader { template static const T* read(const char* row_buf, int64_t& pos); - private: +private: const char* buf_; int64_t buf_size_; int64_t pos_; diff --git a/src/storage/blocksstable/ob_sparse_cell_writer.h b/src/storage/blocksstable/ob_sparse_cell_writer.h index 33409a177..eee73f309 100644 --- a/src/storage/blocksstable/ob_sparse_cell_writer.h +++ b/src/storage/blocksstable/ob_sparse_cell_writer.h @@ -24,7 +24,7 @@ class ObCellWriter; namespace blocksstable { class ObSparseCellWriter { - public: +public: ObSparseCellWriter(); virtual ~ObSparseCellWriter() {} @@ -36,7 +36,7 @@ class ObSparseCellWriter { return pos_; } - private: +private: template int append(const T& value); inline int write_int(const enum common::ObObjType meta_type, const int64_t value); @@ -50,7 +50,7 @@ class ObSparseCellWriter { inline int get_int_byte(int64_t int_value); int write_text_store(const common::ObObj& obj); - private: +private: char* buf_; int64_t buf_size_; int64_t pos_; diff --git a/src/storage/blocksstable/ob_sparse_micro_block_reader.cpp b/src/storage/blocksstable/ob_sparse_micro_block_reader.cpp index ae08b00e4..0a2f17261 100644 --- a/src/storage/blocksstable/ob_sparse_micro_block_reader.cpp +++ b/src/storage/blocksstable/ob_sparse_micro_block_reader.cpp @@ -380,7 +380,7 @@ int ObSparseMicroBlockReader::base_init(const ObMicroBlockData& block_data) template class PreciseCompareSparse { - public: +public: PreciseCompareSparse(int& ret, bool& equal, ReaderType* reader, const char* data_begin, const int32_t* index_data, const ObColumnMap* column_map, const int64_t compare_column_count) : ret_(ret), @@ -402,7 +402,7 @@ class PreciseCompareSparse { return compare(row_idx, rowkey, false); } - private: +private: inline bool compare(const int64_t row_idx, const ObStoreRowkey& rowkey, const bool lower_bound) { bool bret = false; @@ -438,7 +438,7 @@ class PreciseCompareSparse { return bret; } - private: +private: int& ret_; bool& equal_; ReaderType* reader_; diff --git a/src/storage/blocksstable/ob_sparse_micro_block_reader.h b/src/storage/blocksstable/ob_sparse_micro_block_reader.h index 651005f4c..ce2e56b39 100644 --- a/src/storage/blocksstable/ob_sparse_micro_block_reader.h +++ b/src/storage/blocksstable/ob_sparse_micro_block_reader.h @@ -26,7 +26,7 @@ class ObStoreRowkey; namespace blocksstable { class ObSparseMicroBlockGetReader : public ObMicroBlockGetReader { - public: +public: ObSparseMicroBlockGetReader(); virtual ~ObSparseMicroBlockGetReader(); virtual int get_row(const uint64_t tenant_id, const ObMicroBlockData& block_data, const common::ObStoreRowkey& rowkey, @@ -43,54 +43,40 @@ class ObSparseMicroBlockGetReader : public ObMicroBlockGetReader { const common::ObStoreRowkey& rowkey, const ObFullMacroBlockMeta& macro_meta, const storage::ObSSTableRowkeyHelper* rowkey_helper, storage::ObStoreRowLockState& lock_state) override; - protected: +protected: virtual int locate_row(const common::ObStoreRowkey& rowkey, const storage::ObSSTableRowkeyHelper* rowkey_helper, const common::ObObjMeta* cols_type, const char*& row_buf, int64_t& row_len) override; }; class ObSparseMicroBlockReader : public ObIMicroBlockReader { - public: +public: ObSparseMicroBlockReader(); virtual ~ObSparseMicroBlockReader(); virtual int init(const ObMicroBlockData& block_data, const ObColumnMap* column_map, const common::ObRowStoreType out_type = common::FLAT_ROW_STORE) override; virtual void reset() override; - virtual int get_row( - const int64_t index, - storage::ObStoreRow &row) override; - virtual int get_rows( - const int64_t begin_index, - const int64_t end_index, - const int64_t row_capacity, - storage::ObStoreRow *rows, - int64_t &row_count) override; - virtual int get_row_count(int64_t &row_count) override; - virtual int get_row_header(const int64_t row_idx, const ObRowHeader *&row_header) override; - virtual int get_multi_version_info( - const int64_t row_idx, - const int64_t version_column_idx, - const int64_t sql_sequence_idx, - storage::ObMultiVersionRowFlag &flag, - transaction::ObTransID &trans_id, - int64_t &version, - int64_t &sql_sequence) override; + virtual int get_row(const int64_t index, storage::ObStoreRow& row) override; + virtual int get_rows(const int64_t begin_index, const int64_t end_index, const int64_t row_capacity, + storage::ObStoreRow* rows, int64_t& row_count) override; + virtual int get_row_count(int64_t& row_count) override; + virtual int get_row_header(const int64_t row_idx, const ObRowHeader*& row_header) override; + virtual int get_multi_version_info(const int64_t row_idx, const int64_t version_column_idx, + const int64_t sql_sequence_idx, storage::ObMultiVersionRowFlag& flag, transaction::ObTransID& trans_id, + int64_t& version, int64_t& sql_sequence) override; + protected: - int base_init(const ObMicroBlockData &block_data); - virtual int find_bound(const common::ObStoreRowkey &key, - const bool lower_bound, - const int64_t begin_idx, - const int64_t end_idx, - int64_t &row_idx, - bool &equal) override; + int base_init(const ObMicroBlockData& block_data); + virtual int find_bound(const common::ObStoreRowkey& key, const bool lower_bound, const int64_t begin_idx, + const int64_t end_idx, int64_t& row_idx, bool& equal) override; + private: - int get_row_impl( - const int64_t index, - storage::ObStoreRow &row); + int get_row_impl(const int64_t index, storage::ObStoreRow& row); + protected: - const ObMicroBlockHeader *header_; - const char *data_begin_; // start position of micro block data - const char *data_end_; // end position of micro block data - const int32_t *index_data_; + const ObMicroBlockHeader* header_; + const char* data_begin_; // start position of micro block data + const char* data_end_; // end position of micro block data + const int32_t* index_data_; common::ObArenaAllocator allocator_; ObSparseRowReader sparse_row_reader_; }; diff --git a/src/storage/blocksstable/ob_sstable_printer.h b/src/storage/blocksstable/ob_sstable_printer.h index f24b2ebe9..73b4d08e1 100644 --- a/src/storage/blocksstable/ob_sstable_printer.h +++ b/src/storage/blocksstable/ob_sstable_printer.h @@ -39,7 +39,7 @@ namespace oceanbase { namespace blocksstable { class ObSSTablePrinter { - public: +public: static void print_title(const char* name, const int64_t value, const int64_t level = 1); static void print_title(const char* name, const int64_t level = 1); static void print_line(const char* name, const int32_t value, const int64_t level = 1); diff --git a/src/storage/blocksstable/ob_storage_cache_suite.h b/src/storage/blocksstable/ob_storage_cache_suite.h index 2bed83881..7deafd1b1 100644 --- a/src/storage/blocksstable/ob_storage_cache_suite.h +++ b/src/storage/blocksstable/ob_storage_cache_suite.h @@ -28,7 +28,7 @@ namespace blocksstable { struct ObStorageCacheContext; class ObStorageCacheSuite { - public: +public: static ObStorageCacheSuite& get_instance(); int init(const int64_t index_cache_priority, const int64_t user_block_cache_priority, const int64_t user_row_cache_priority, const int64_t fuse_row_cache_priority, const int64_t bf_cache_priority, @@ -63,7 +63,7 @@ class ObStorageCacheSuite { } TO_STRING_KV(K(is_inited_)); - private: +private: ObStorageCacheSuite(); virtual ~ObStorageCacheSuite(); friend class ObStorageCacheContext; @@ -74,7 +74,7 @@ class ObStorageCacheSuite { ObFuseRowCache fuse_row_cache_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStorageCacheSuite); }; diff --git a/src/storage/blocksstable/ob_store_file.cpp b/src/storage/blocksstable/ob_store_file.cpp index e4aaa0197..31fbd6ec9 100644 --- a/src/storage/blocksstable/ob_store_file.cpp +++ b/src/storage/blocksstable/ob_store_file.cpp @@ -1273,7 +1273,7 @@ int ObStoreFile::resize_file(const int64_t new_data_file_size, const int64_t new LOG_WARN("fail to resize file", K(ret)); } else { const int64_t new_total_file_size = - lower_align(store_file_system_->get_total_data_size(), store_file_system_->get_macro_block_size()); + lower_align(store_file_system_->get_total_data_size(), store_file_system_->get_macro_block_size()); const int64_t new_macro_block_cnt = new_total_file_size / store_file_system_->get_macro_block_size(); const int64_t origin_macro_block_cnt = store_file_system_->get_total_macro_block_count(); if (new_macro_block_cnt > origin_macro_block_cnt) { @@ -1288,7 +1288,7 @@ int ObStoreFile::resize_file(const int64_t new_data_file_size, const int64_t new ret = OB_ERR_UNEXPECTED; LOG_WARN("error unexpected, file must not be null", K(ret)); } else if (OB_FAIL(alloc_memory( - new_macro_block_cnt, new_free_block_array, new_macro_block_bitmap, macro_block_info_))) { + new_macro_block_cnt, new_free_block_array, new_macro_block_bitmap, macro_block_info_))) { LOG_WARN("fail to alloc memory", K(ret), K(new_macro_block_cnt)); } else if (OB_FAIL(file->write_super_block(super_block))) { LOG_WARN("fail to write super block", K(ret)); diff --git a/src/storage/blocksstable/ob_store_file.h b/src/storage/blocksstable/ob_store_file.h index 7c138b84f..a23128b1f 100644 --- a/src/storage/blocksstable/ob_store_file.h +++ b/src/storage/blocksstable/ob_store_file.h @@ -78,7 +78,7 @@ struct ObMacroBlockReadInfo { }; class ObMacroBlocksHandle { - public: +public: ObMacroBlocksHandle(); virtual ~ObMacroBlocksHandle(); int add(const MacroBlockId& macro_id); @@ -112,14 +112,14 @@ class ObMacroBlocksHandle { TO_STRING_KV(K_(macro_id_list), "tenant_id", nullptr == file_ ? 0 : file_->get_tenant_id(), "file_id", nullptr == file_ ? 0 : file_->get_file_id()); - private: +private: common::ObArray macro_id_list_; DISALLOW_COPY_AND_ASSIGN(ObMacroBlocksHandle); ObStorageFile* file_; }; class ObMacroBlockHandle { - public: +public: ObMacroBlockHandle() : block_write_ctx_(NULL), file_(NULL) {} virtual ~ObMacroBlockHandle(); @@ -163,7 +163,7 @@ class ObMacroBlockHandle { } TO_STRING_KV(K_(macro_id), K_(io_handle), KP_(block_write_ctx)); - private: +private: MacroBlockId macro_id_; common::ObIOHandle io_handle_; ObMacroBlocksWriteCtx* block_write_ctx_; @@ -171,7 +171,7 @@ class ObMacroBlockHandle { }; class ObMacroBlockHandleV1 { - public: +public: ObMacroBlockHandleV1(); virtual ~ObMacroBlockHandleV1(); ObMacroBlockHandleV1(const ObMacroBlockHandleV1& other); @@ -205,20 +205,20 @@ class ObMacroBlockHandleV1 { } TO_STRING_KV(K_(macro_id), K_(io_handle)); - private: +private: MacroBlockId macro_id_; common::ObIOHandle io_handle_; }; class ObStoreFileGCTask : public common::ObTimerTask { - public: +public: ObStoreFileGCTask(); virtual ~ObStoreFileGCTask(); virtual void runTimerTask(); }; struct ObBadBlockInfo { - public: +public: ObBadBlockInfo() { reset(); @@ -231,7 +231,7 @@ struct ObBadBlockInfo { } TO_STRING_KV(K(disk_id_), K(macro_block_id_), K(error_type_), K(store_file_path_), K(error_msg_), K(check_time_)); - public: +public: int64_t disk_id_; MacroBlockId macro_block_id_; int64_t error_type_; @@ -241,18 +241,18 @@ struct ObBadBlockInfo { }; class ObAllMacroIdIterator : public ObIMacroIdIterator { - public: +public: ObAllMacroIdIterator(); virtual ~ObAllMacroIdIterator(); virtual int get_next_macro_id(MacroBlockId& block_id); - private: +private: uint32_t cur_pos_; }; template class ObSegmentArray final { - public: +public: ObSegmentArray(); ~ObSegmentArray(); int reserve(const int64_t size); @@ -260,7 +260,7 @@ class ObSegmentArray final { T& operator[](const int64_t index); void reset(); - private: +private: static const int64_t ELEMENTS_PER_SEGMENT = 1638400; static const int64_t MAX_SEGMENT_CNT = 1024; // max supported file 1600T common::ObArray segments_[MAX_SEGMENT_CNT]; @@ -325,7 +325,7 @@ const T& ObSegmentArray::operator[](const int64_t index) const } class ObStoreFile { - public: +public: static ObStoreFile& get_instance(); int init(const ObStorageEnv& storage_env, ObStoreFileSystem* store_file_system); int open(const bool is_physical_flashback = false); @@ -363,7 +363,7 @@ class ObStoreFile { int is_free_block(const int64_t block_index, bool& is_free); int resize_file(const int64_t new_data_file_size, const int64_t new_data_file_disk_percentage); - private: +private: friend class ObStoreFileGCTask; friend class ObFileSystemInspectBadBlockTask; friend class ObAllMacroIdIterator; @@ -400,7 +400,7 @@ class ObStoreFile { return macro_block_cnt / 64 + 1; } - private: +private: static const int64_t RECYCLE_DELAY_US = 5 * 1000 * 1000; // 5s static const int64_t INSPECT_DELAY_US = 1 * 1000 * 1000; // 1s bool is_inited_; diff --git a/src/storage/blocksstable/ob_store_file_system.h b/src/storage/blocksstable/ob_store_file_system.h index ba2f3f757..24f0fe471 100644 --- a/src/storage/blocksstable/ob_store_file_system.h +++ b/src/storage/blocksstable/ob_store_file_system.h @@ -39,7 +39,7 @@ class ObStoreFileSystemWrapper; class ObStorageFileHandle; struct ObServerWorkingDir { - public: +public: enum class DirStatus { NORMAL = 0, RECOVERING = 1, RECOVERED = 2, TEMPORARY = 3, DELETING = 4, MAX }; ObServerWorkingDir(); @@ -65,7 +65,7 @@ struct ObServerWorkingDir { TO_STRING_KV(K(svr_addr_), K(start_ts_), K(status_)); - public: +public: common::ObAddr svr_addr_; int64_t start_ts_; DirStatus status_; @@ -74,20 +74,20 @@ struct ObServerWorkingDir { }; class ObFileSystemInspectBadBlockTask : public common::ObTimerTask { - public: +public: ObFileSystemInspectBadBlockTask(); virtual ~ObFileSystemInspectBadBlockTask(); virtual void runTimerTask(); void destroy(); - private: +private: int check_macro_block(const ObMacroBlockInfoPair& pair, const storage::ObTenantFileKey& file_key); int check_data_block(const MacroBlockId& macro_id, const blocksstable::ObFullMacroBlockMeta& full_meta, const storage::ObTenantFileKey& file_key); void inspect_bad_block(); bool has_inited(); - private: +private: static const int64_t ACCESS_TIME_INTERVAL; static const int64_t MIN_OPEN_BLOCKS_PER_ROUND; static const int64_t MAX_SEARCH_COUNT_PER_ROUND; @@ -96,12 +96,12 @@ class ObFileSystemInspectBadBlockTask : public common::ObTimerTask { int64_t last_macro_idx_; ObSSTableMacroBlockChecker macro_checker_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFileSystemInspectBadBlockTask); }; struct ObStorageFileWithRef final { - public: +public: ObStorageFileWithRef() : ref_cnt_(0), file_(nullptr) {} ~ObStorageFileWithRef() = default; @@ -114,7 +114,7 @@ struct ObStorageFileWithRef final { }; struct ObStorageFileHandle final { - public: +public: ObStorageFileHandle(); ~ObStorageFileHandle(); void reset(); @@ -133,7 +133,7 @@ struct ObStorageFileHandle final { }; struct ObStorageFilesHandle final { - public: +public: static const int64_t DEFAULT_FILE_CNT = 100; typedef common::ObSEArray FileArray; ObStorageFilesHandle(); @@ -147,12 +147,12 @@ struct ObStorageFilesHandle final { } TO_STRING_KV(K_(file_array)); - private: +private: FileArray file_array_; }; class ObStorageFile { - public: +public: enum class FileType { SERVER_ROOT = 0, TMP_FILE, @@ -215,7 +215,7 @@ class ObStorageFile { VIRTUAL_TO_STRING_KV(K(file_type_), K(fd_), K(tenant_id_), K(file_id_), K(is_inited_)); - protected: +protected: ObStorageFile(); int init_base(const FileType file_type, const uint64_t tenant_id); @@ -234,7 +234,7 @@ class ObStorageFile { typedef common::ObLinearHashMap MacroBlockInfo; - protected: +protected: static const int64_t LOCK_BUCKET_CNT = 1000; uint64_t tenant_id_; int64_t file_id_; @@ -246,7 +246,7 @@ class ObStorageFile { common::ObBucketLock lock_; storage::ObMacroMetaReplayMap replay_map_; // used when replay slog - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStorageFile); }; @@ -320,9 +320,9 @@ struct ObDiskStats final { }; class ObStoreFileSystem { - public: +public: static const int64_t RESERVED_MACRO_BLOCK_INDEX = 2; // used for super block macro blocks - public: +public: ObStoreFileSystem(); virtual ~ObStoreFileSystem() {} @@ -403,14 +403,14 @@ class ObStoreFileSystem { VIRTUAL_TO_STRING_KV("ObStoreFileSystem", "empty"); - protected: +protected: // file system can only be inited and destroy through ObStoreFileSystemWrapper friend class ObStoreFileSystemWrapper; friend class ObFileSystemInspectBadBlockTask; virtual int init(const ObStorageEnv& storage_env, storage::ObPartitionService& partition_service); virtual void destroy(); - protected: +protected: storage::ObPartitionService* partition_service_; ObServerSuperBlock super_block_; // read only memory cache ObStorageFileWithRef svr_root_file_with_ref_; @@ -419,18 +419,18 @@ class ObStoreFileSystem { }; class ObStoreFileSystemWrapper final { - public: +public: static ObStoreFileSystem& get_instance(); static int init(const ObStorageEnv& storage_env, storage::ObPartitionService& partition_service); static void destroy(); - private: +private: static ObStoreFileSystem* fs_instance_; }; template class ObStorageFileAllocator final { - public: +public: ObStorageFileAllocator(); virtual ~ObStorageFileAllocator(); void destroy(); @@ -440,7 +440,7 @@ class ObStorageFileAllocator final { TO_STRING_KV(K(free_file_cnt_), K(used_file_cnt_)); - private: +private: static const int64_t MAX_FILE_CNT = 30000; STORAGE_FILE* free_files_[MAX_FILE_CNT]; int64_t free_file_cnt_; diff --git a/src/storage/blocksstable/ob_super_block_buffer_holder.h b/src/storage/blocksstable/ob_super_block_buffer_holder.h index 193e03109..d8ff963bd 100644 --- a/src/storage/blocksstable/ob_super_block_buffer_holder.h +++ b/src/storage/blocksstable/ob_super_block_buffer_holder.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace blocksstable { class ObSuperBlockBufferHolder { - public: +public: ObSuperBlockBufferHolder(); virtual ~ObSuperBlockBufferHolder(); @@ -42,7 +42,7 @@ class ObSuperBlockBufferHolder { TO_STRING_KV(KP_(buf), K_(len)); - private: +private: bool is_inited_; char* buf_; int64_t len_; diff --git a/src/storage/blocksstable/ob_tmp_file.h b/src/storage/blocksstable/ob_tmp_file.h index 37d105d22..78158d7b0 100644 --- a/src/storage/blocksstable/ob_tmp_file.h +++ b/src/storage/blocksstable/ob_tmp_file.h @@ -26,7 +26,7 @@ class ObTmpFile; class ObTmpFileExtent; struct ObTmpFileIOInfo { - public: +public: ObTmpFileIOInfo(); virtual ~ObTmpFileIOInfo(); void reset(); @@ -41,7 +41,7 @@ struct ObTmpFileIOInfo { }; class ObTmpFileIOHandle { - public: +public: struct ObIOReadHandle { ObIOReadHandle(); ObIOReadHandle(const ObMacroBlockHandle& macro_handle, char* buf, const int64_t offset, const int64_t size); @@ -118,7 +118,7 @@ class ObTmpFileIOHandle { } TO_STRING_KV(KP_(buf), K_(size), K_(is_read)); - private: +private: ObTmpFile* tmp_file_; common::ObSEArray io_handles_; common::ObSEArray page_cache_handles_; @@ -130,7 +130,7 @@ class ObTmpFileIOHandle { }; class ObTmpFileExtent { - public: +public: explicit ObTmpFileExtent(ObTmpFile* file); virtual ~ObTmpFileExtent(); virtual int read( @@ -202,7 +202,7 @@ class ObTmpFileExtent { TO_STRING_KV(K_(is_alloced), K_(fd), K_(g_offset_start), K_(g_offset_end), KP_(owner), K_(start_page_id), K_(page_nums), K_(block_id), K_(offset), K_(is_closed)); - private: +private: bool is_alloced_; int64_t fd_; int64_t g_offset_start_; @@ -218,7 +218,7 @@ class ObTmpFileExtent { }; class ObTmpFileMeta { - public: +public: explicit ObTmpFileMeta() : fd_(-1), dir_id_(-1), allocator_(NULL), extents_() {} virtual ~ObTmpFileMeta(); @@ -252,7 +252,7 @@ class ObTmpFileMeta { } TO_STRING_KV(K_(fd), K_(dir_id), K_(extents)); - private: +private: int64_t fd_; int64_t dir_id_; common::ObIAllocator* allocator_; @@ -261,7 +261,7 @@ class ObTmpFileMeta { }; class ObTmpFile { - public: +public: enum FileWhence { SET_SEEK = 0, CUR_SEEK, @@ -285,13 +285,13 @@ class ObTmpFile { inline int64_t get_deep_copy_size() const; TO_STRING_KV(K_(file_meta), K_(is_big), K_(tenant_id), K_(is_inited)); - private: +private: int write_file_extent(const ObTmpFileIOInfo& io_info, ObTmpFileExtent* file_extent, int64_t& size, char*& buf); int aio_pread_without_lock(const ObTmpFileIOInfo& io_info, int64_t& offset, ObTmpFileIOHandle& handle); int64_t small_file_prealloc_size(); int64_t big_file_prealloc_size(); - private: +private: // NOTE: // 1.The pre-allocated macro should satisfy the following inequality: // SMALL_FILE_MAX_THRESHOLD < BIG_FILE_PREALLOC_EXTENT_SIZE < block size @@ -310,18 +310,18 @@ class ObTmpFile { }; class ObTmpFileHandle : public storage::ObResourceHandle { - public: +public: ObTmpFileHandle(); virtual ~ObTmpFileHandle(); virtual void reset() override; - private: +private: friend class ObTmpFileManager; DISALLOW_COPY_AND_ASSIGN(ObTmpFileHandle); }; class ObTmpFileManager { - public: +public: static ObTmpFileManager& get_instance(); int init(); int start(); @@ -360,9 +360,9 @@ class ObTmpFileManager { return storage_file_.file_; } - private: +private: class RmTenantTmpFileOp { - public: + public: RmTenantTmpFileOp(const uint64_t tenant_id, common::ObIArray* fd_list) : tenant_id_(tenant_id), fd_list_(fd_list) {} @@ -382,12 +382,12 @@ class ObTmpFileManager { return OB_SUCCESS == ret; } - private: + private: const uint64_t tenant_id_; common::ObIArray* fd_list_; }; - private: +private: ObTmpFileManager(); virtual ~ObTmpFileManager(); int clear(const int64_t fd); @@ -395,7 +395,7 @@ class ObTmpFileManager { int get_next_fd(int64_t& next_fd); void next_value(int64_t& current_val, int64_t& next_val); - private: +private: static const int64_t DEFAULT_BUCKET_NUM = 10243L; static const int64_t TOTAL_LIMIT = 15 * 1024L * 1024L * 1024L; static const int64_t HOLD_LIMIT = 8 * 1024L * 1024L; diff --git a/src/storage/blocksstable/ob_tmp_file_cache.h b/src/storage/blocksstable/ob_tmp_file_cache.h index bb84806b4..3cb548a70 100644 --- a/src/storage/blocksstable/ob_tmp_file_cache.h +++ b/src/storage/blocksstable/ob_tmp_file_cache.h @@ -29,7 +29,7 @@ class ObTmpMacroBlock; class ObTmpFileExtent; class ObTmpPageCacheKey : public common::ObIKVCacheKey { - public: +public: ObTmpPageCacheKey(); ObTmpPageCacheKey(const int64_t block_id, const int64_t page_id, const uint64_t tenant_id); virtual ~ObTmpPageCacheKey(); @@ -45,14 +45,14 @@ class ObTmpPageCacheKey : public common::ObIKVCacheKey { } TO_STRING_KV(K_(block_id), K_(page_id), K_(tenant_id)); - private: +private: int64_t block_id_; int64_t page_id_; uint64_t tenant_id_; }; class ObTmpPageCacheValue : public common::ObIKVCacheValue { - public: +public: explicit ObTmpPageCacheValue(char* buf); virtual ~ObTmpPageCacheValue(); virtual int64_t size() const override; @@ -71,14 +71,14 @@ class ObTmpPageCacheValue : public common::ObIKVCacheValue { } TO_STRING_KV(K_(size)); - private: +private: char* buf_; int64_t size_; DISALLOW_COPY_AND_ASSIGN(ObTmpPageCacheValue); }; struct ObTmpPageValueHandle { - public: +public: ObTmpPageValueHandle() : value_(NULL), handle_() {} virtual ~ObTmpPageValueHandle() = default; @@ -93,7 +93,7 @@ struct ObTmpPageValueHandle { }; struct ObTmpPageIOInfo { - public: +public: ObTmpPageIOInfo() : key_(), offset_(0), size_(0) {} virtual ~ObTmpPageIOInfo() @@ -106,7 +106,7 @@ struct ObTmpPageIOInfo { }; class ObTmpPageCache : public common::ObKVCache { - public: +public: typedef common::ObKVCache BasePageCache; static ObTmpPageCache& get_instance(); int init(const char* cache_name, const int64_t priority, const ObStorageFileHandle& file_handle); @@ -120,18 +120,18 @@ class ObTmpPageCache : public common::ObKVCache* page_io_infos_; }; - private: +private: ObTmpPageCache(); virtual ~ObTmpPageCache(); int read_io(const ObTmpBlockIOInfo& io_info, ObITmpPageIOCallback& callback, ObMacroBlockHandle& handle); - private: +private: common::ObConcurrentFIFOAllocator allocator_; ObStorageFileHandle file_handle_; DISALLOW_COPY_AND_ASSIGN(ObTmpPageCache); }; class ObTmpBlockCacheKey : public common::ObIKVCacheKey { - public: +public: ObTmpBlockCacheKey(const int64_t block_id, const uint64_t tenant_id); virtual ~ObTmpBlockCacheKey() {} @@ -200,7 +200,7 @@ class ObTmpBlockCacheKey : public common::ObIKVCacheKey { } TO_STRING_KV(K_(block_id), K_(tenant_id)); - private: +private: int64_t block_id_; uint64_t tenant_id_; friend class ObTmpBlockCache; @@ -208,7 +208,7 @@ class ObTmpBlockCacheKey : public common::ObIKVCacheKey { }; class ObTmpBlockCacheValue : public common::ObIKVCacheValue { - public: +public: explicit ObTmpBlockCacheValue(char* buf); virtual ~ObTmpBlockCacheValue() {} @@ -224,14 +224,14 @@ class ObTmpBlockCacheValue : public common::ObIKVCacheValue { } TO_STRING_KV(K_(size)); - private: +private: char* buf_; int64_t size_; DISALLOW_COPY_AND_ASSIGN(ObTmpBlockCacheValue); }; struct ObTmpBlockValueHandle { - public: +public: ObTmpBlockValueHandle() : value_(NULL), inst_handle_(), kvpair_(NULL), handle_() {} virtual ~ObTmpBlockValueHandle() = default; @@ -250,7 +250,7 @@ struct ObTmpBlockValueHandle { }; class ObTmpBlockCache : public common::ObKVCache { - public: +public: static ObTmpBlockCache& get_instance(); int init(const char* cache_name, const int64_t priority); int get_block(const ObTmpBlockCacheKey& key, ObTmpBlockValueHandle& handle); @@ -258,7 +258,7 @@ class ObTmpBlockCache : public common::ObKVCache& free_blocks); int wash(const uint64_t tenant_id, int64_t block_nums, common::ObIArray& free_blocks); @@ -299,7 +299,7 @@ class ObTmpTenantMemBlockManager { int build_macro_meta(const uint64_t tenant_id, ObFullMacroBlockMeta& meta); int64_t get_tenant_mem_block_num(); - private: +private: // 1/256, only one free block each 256 block. static constexpr double DEFAULT_MIN_FREE_BLOCK_RATIO = 0.00390625; static const uint64_t DEFAULT_BUCKET_NUM = 1543L; diff --git a/src/storage/blocksstable/ob_tmp_file_store.h b/src/storage/blocksstable/ob_tmp_file_store.h index 382125b51..2aa148a6f 100644 --- a/src/storage/blocksstable/ob_tmp_file_store.h +++ b/src/storage/blocksstable/ob_tmp_file_store.h @@ -31,7 +31,7 @@ class ObTmpPageCache; typedef common::ObSEArray ExtentArray; struct ObTmpFileArea { - public: +public: ObTmpFileArea(const int64_t start_page_id, const int64_t page_nums) : start_page_id_(start_page_id), page_nums_(page_nums), next_(NULL) {} @@ -48,7 +48,7 @@ struct ObTmpFileArea { }; class ObTmpFilePageBuddy { - public: +public: ObTmpFilePageBuddy(); virtual ~ObTmpFilePageBuddy(); int init(common::ObIAllocator& allocator); @@ -67,7 +67,7 @@ class ObTmpFilePageBuddy { bool is_empty() const; int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: void free_align(const int32_t start_page_id, const int32_t page_nums, ObTmpFileArea*& area); ObTmpFileArea* find_buddy(const int32_t page_nums, const int32_t start_page_id); static int get_max_page_nums() @@ -84,7 +84,7 @@ class ObTmpFilePageBuddy { }; struct ObTmpBlockIOInfo { - public: +public: ObTmpBlockIOInfo() : block_id_(0), offset_(0), size_(0), tenant_id_(0), macro_block_id_(0), buf_(NULL), io_desc_() {} ObTmpBlockIOInfo(const int64_t block_id, const int64_t offset, const int64_t size, const uint64_t tenant_id, @@ -108,7 +108,7 @@ struct ObTmpBlockIOInfo { }; class ObTmpMacroBlock { - public: +public: ObTmpMacroBlock(); virtual ~ObTmpMacroBlock(); int init(const int64_t block_id, const int64_t dir_id, const uint64_t tenant_id, common::ObIAllocator& allocator); @@ -205,7 +205,7 @@ class ObTmpMacroBlock { TO_STRING_KV(K_(block_id), K_(dir_id), K_(tenant_id), K_(free_page_nums), K_(macro_block_handle), KP_(buffer), K_(page_buddy), K_(io_desc), K_(is_disked), K_(is_inited)); - private: +private: static const int64_t DEFAULT_PAGE_SIZE; int64_t block_id_; int64_t dir_id_; @@ -225,7 +225,7 @@ class ObTmpMacroBlock { }; class ObTmpTenantMacroBlockManager { - public: +public: ObTmpTenantMacroBlockManager(); virtual ~ObTmpTenantMacroBlockManager(); int init(common::ObIAllocator& allocator); @@ -244,10 +244,10 @@ class ObTmpTenantMacroBlockManager { int get_disk_macro_block_list(common::ObIArray& macro_id_list); void print_block_usage(); - private: +private: int64_t get_next_blk_id(); - private: +private: static const uint64_t MBLK_HASH_BUCKET_NUM = 10243L; typedef common::hash::ObHashMap TmpMacroBlockMap; int64_t mblk_page_nums_; @@ -260,7 +260,7 @@ class ObTmpTenantMacroBlockManager { }; class ObTmpTenantFileStore { - public: +public: ObTmpTenantFileStore(); virtual ~ObTmpTenantFileStore(); int init(const uint64_t tenant_id, const ObStorageFileHandle& file_handle); @@ -280,7 +280,7 @@ class ObTmpTenantFileStore { return tmp_block_manager_.get_block_size(); } - private: +private: int read_page(ObTmpMacroBlock* block, ObTmpBlockIOInfo& io_info, ObTmpFileIOHandle& handle); int free_extent(ObTmpFileExtent* extent); int free_extent(const int64_t block_id, const int32_t start_page_id, const int32_t page_nums); @@ -288,7 +288,7 @@ class ObTmpTenantFileStore { int alloc_macro_block(const int64_t dir_id, const uint64_t tenant_id, ObTmpMacroBlock*& t_mblk); int wait_write_io_finish_if_need(); - private: +private: static const uint64_t TOTAL_LIMIT = 15 * 1024L * 1024L * 1024L; static const uint64_t HOLD_LIMIT = 8 * 1024L * 1024L; static const uint64_t BLOCK_SIZE = common::OB_MALLOC_MIDDLE_BLOCK_SIZE; @@ -306,7 +306,7 @@ class ObTmpTenantFileStore { }; class ObTmpFileStore { - public: +public: typedef common::hash::HashMapPair TenantTmpBlockCntPair; static ObTmpFileStore& get_instance(); @@ -331,12 +331,12 @@ class ObTmpFileStore { return OB_FILE_SYSTEM.get_macro_block_size() - ObTmpMacroBlock::get_default_page_size(); } - private: +private: ObTmpFileStore(); virtual ~ObTmpFileStore(); int get_store(const uint64_t tenant_id, ObTmpTenantFileStore*& store); - private: +private: static const uint64_t STORE_HASH_BUCKET_NUM = 1543L; static const int64_t TOTAL_LIMIT = 512L * 1024L * 1024L; static const int64_t HOLD_LIMIT = 8 * 1024L * 1024L; diff --git a/src/storage/blocksstable/slog/ob_base_storage_logger.h b/src/storage/blocksstable/slog/ob_base_storage_logger.h index 53adc3a1e..4ca521458 100644 --- a/src/storage/blocksstable/slog/ob_base_storage_logger.h +++ b/src/storage/blocksstable/slog/ob_base_storage_logger.h @@ -25,21 +25,17 @@ #include "ob_storage_log_replayer.h" #define SLOGGER (oceanbase::blocksstable::ObBaseStorageLogger::get_instance()) -namespace oceanbase -{ -namespace blocksstable -{ -//The redo log module of base storage. It is responsible for the write and recovery of all redo logs -//of block sstable. -class ObBaseStorageLogger : public ObStorageLogReplayer -{ +namespace oceanbase { +namespace blocksstable { +// The redo log module of base storage. It is responsible for the write and recovery of all redo logs +// of block sstable. +class ObBaseStorageLogger : public ObStorageLogReplayer { public: - static ObBaseStorageLogger &get_instance(); - //NOT thread safe. - //Init the redo log and do recovery if there is redo logs in log_dir. - virtual int init(const char *log_dir, const int64_t max_log_file_size, - ObISLogFilter *filter_before_parse = nullptr, - ObISLogFilter *filter_after_parse = nullptr); + static ObBaseStorageLogger& get_instance(); + // NOT thread safe. + // Init the redo log and do recovery if there is redo logs in log_dir. + virtual int init(const char* log_dir, const int64_t max_log_file_size, ObISLogFilter* filter_before_parse = nullptr, + ObISLogFilter* filter_after_parse = nullptr); virtual void destroy() override; // Thread safe. @@ -70,10 +66,10 @@ public: int parse_log(const char* log_dir, const int64_t log_file_id, FILE* stream); int get_using_disk_space(int64_t& using_space) const; - protected: +protected: virtual int replay_over() override; - private: +private: struct FindMinLogCursor { inline void operator()(common::hash::HashMapPair& entry); common::ObLogCursor log_cursor_; @@ -86,7 +82,7 @@ public: static const int64_t TRANS_ENTRY_BUF_SIZE = NORMAL_LOG_ITEM_SIZE - ObStorageLogWriter::LOG_BUF_RESERVED_SIZE - ObStorageLogWriter::LOG_FILE_ALIGN_SIZE; - private: +private: ObBaseStorageLogger(); virtual ~ObBaseStorageLogger(); int write_log(ObStorageLogActiveTrans& trans_entry, const int64_t subcmd, const ObStorageLogAttribute& log_attr, @@ -94,14 +90,14 @@ public: int flush_log(ObStorageLogActiveTrans& trans_entry, int64_t* log_seq_num = NULL); int erase_trans(const int64_t trans_id); - private: +private: ObStorageLogWriter log_writer_; common::hash::ObHashMap active_trans_; common::ObFixedQueue trans_entries_; common::DRWLock log_sync_lock_; static RLOCAL(int64_t, thread_trans_id_); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBaseStorageLogger); }; diff --git a/src/storage/blocksstable/slog/ob_storage_log_reader.cpp b/src/storage/blocksstable/slog/ob_storage_log_reader.cpp index 5030eab69..6989e65c6 100644 --- a/src/storage/blocksstable/slog/ob_storage_log_reader.cpp +++ b/src/storage/blocksstable/slog/ob_storage_log_reader.cpp @@ -54,7 +54,8 @@ int ObStorageLogReader::init(const char* log_dir, const uint64_t log_file_id_sta if (OB_SUCC(ret)) { if (NULL == log_buffer_.get_data()) { ObMemAttr attr(OB_SERVER_TENANT_ID, ObModIds::OB_LOG_READER); - char *buf = static_cast(ob_malloc_align(DIO_READ_ALIGN_SIZE, ObStorageLogWriter::LOG_ITEM_MAX_LENGTH, attr)); + char* buf = + static_cast(ob_malloc_align(DIO_READ_ALIGN_SIZE, ObStorageLogWriter::LOG_ITEM_MAX_LENGTH, attr)); if (OB_ISNULL(buf)) { ret = OB_ERROR; STORAGE_REDO_LOG(WARN, "ob_malloc for log_buffer_ failed", K(ret)); @@ -390,9 +391,8 @@ int ObStorageLogReader::get_next_cursor(common::ObLogCursor& cursor) const int ObStorageLogReader::load_buf() { int ret = OB_SUCCESS; - if ((0 != log_buffer_.get_capacity() % DIO_READ_ALIGN_SIZE) - || (log_buffer_.get_remain_data_len() < 0) - || (log_buffer_.get_remain_data_len() > pread_pos_)) { // Defense code + if ((0 != log_buffer_.get_capacity() % DIO_READ_ALIGN_SIZE) || (log_buffer_.get_remain_data_len() < 0) || + (log_buffer_.get_remain_data_len() > pread_pos_)) { // Defense code ret = OB_LOG_NOT_ALIGN; STORAGE_REDO_LOG(WARN, "buf or read pos are not aligned", K(ret), K_(log_buffer), K_(pread_pos)); } else if (0 != pread_pos_ % DIO_READ_ALIGN_SIZE) { @@ -400,8 +400,8 @@ int ObStorageLogReader::load_buf() // if pread_pos_ is not aligned, it means file reaches end and file size is not 4k aligned, // then we have no need to load buf again ret = OB_READ_NOTHING; - STORAGE_REDO_LOG(INFO, "pread_pos_ reaches the end of file, and file size is not 4k aligned", - K(ret), K_(pread_pos)); + STORAGE_REDO_LOG( + INFO, "pread_pos_ reaches the end of file, and file size is not 4k aligned", K(ret), K_(pread_pos)); } else if (log_buffer_.get_remain_data_len() == log_buffer_.get_capacity()) { // do nothing if buf hasn't been consumed STORAGE_REDO_LOG(WARN, "buf remains same", K(ret), K_(log_buffer), K_(pread_pos)); @@ -413,8 +413,7 @@ int ObStorageLogReader::load_buf() // back to align the DIO read. pread_pos_ = lower_align(pread_pos_ - remain_size, DIO_READ_ALIGN_SIZE); log_buffer_.get_limit() = 0; - log_buffer_.get_position() = (0 == remain_size) ? 0 - : upper_align(remain_size, DIO_READ_ALIGN_SIZE) - remain_size; + log_buffer_.get_position() = (0 == remain_size) ? 0 : upper_align(remain_size, DIO_READ_ALIGN_SIZE) - remain_size; if (OB_FAIL(file_store_->read(log_buffer_.get_data(), log_buffer_.get_capacity(), pread_pos_, read_size))) { STORAGE_REDO_LOG(ERROR, diff --git a/src/storage/blocksstable/slog/ob_storage_log_reader.h b/src/storage/blocksstable/slog/ob_storage_log_reader.h index 2e1545c42..0ef691207 100644 --- a/src/storage/blocksstable/slog/ob_storage_log_reader.h +++ b/src/storage/blocksstable/slog/ob_storage_log_reader.h @@ -23,7 +23,7 @@ class ObILogFileStore; } namespace blocksstable { class ObStorageLogReader { - public: +public: ObStorageLogReader(); virtual ~ObStorageLogReader(); @@ -52,7 +52,7 @@ class ObStorageLogReader { int get_cursor(common::ObLogCursor& cursor) const; int get_next_cursor(common::ObLogCursor& cursor) const; - private: +private: int open(); int close(); int seek(uint64_t log_seq); @@ -64,7 +64,7 @@ class ObStorageLogReader { int tackle_less_header_len(const common::ObLogEntry& entry); int tackle_less_data_len(const common::ObLogEntry& entry); - private: +private: static const int64_t LOG_FILE_MAX_SIZE = 256 << 20; bool is_inited_; diff --git a/src/storage/blocksstable/slog/ob_storage_log_replayer.h b/src/storage/blocksstable/slog/ob_storage_log_replayer.h index f3a3440dc..68ac80d9d 100644 --- a/src/storage/blocksstable/slog/ob_storage_log_replayer.h +++ b/src/storage/blocksstable/slog/ob_storage_log_replayer.h @@ -29,9 +29,9 @@ namespace oceanbase { namespace blocksstable { class ObISLogFilter { - public: +public: struct Param final { - public: + public: Param() : entry_(nullptr), subcmd_(0), attr_() {} ~Param() = default; @@ -45,21 +45,21 @@ class ObISLogFilter { }; class ObReplayServerSLogFilter : public ObISLogFilter { - public: +public: ObReplayServerSLogFilter() = default; virtual ~ObReplayServerSLogFilter() = default; virtual int filter(const ObISLogFilter::Param& param, bool& is_filtered) const override; }; class ObNotReplaySuperBlockAndConfigMetaSLogFilter : public ObISLogFilter { - public: +public: ObNotReplaySuperBlockAndConfigMetaSLogFilter() = default; virtual ~ObNotReplaySuperBlockAndConfigMetaSLogFilter() = default; virtual int filter(const ObISLogFilter::Param& param, bool& is_filtered) const override; }; struct ObStorageLogCommittedTrans final { - public: +public: ObStorageLogCommittedTrans() : commit_lsn_(0), valid_record_(NULL) {} int64_t commit_lsn_; @@ -67,7 +67,7 @@ struct ObStorageLogCommittedTrans final { }; struct ObRedoModuleReplayParam final { - public: +public: ObRedoModuleReplayParam(); ~ObRedoModuleReplayParam() = default; bool is_valid() const @@ -84,7 +84,7 @@ struct ObRedoModuleReplayParam final { // The interface of some modules need to write redo log. class ObIRedoModule { - public: +public: ObIRedoModule() : enable_write_log_(false), filter_(nullptr){}; virtual ~ObIRedoModule() = default; @@ -112,13 +112,13 @@ class ObIRedoModule { inline static int64_t gen_subcmd(const enum ObRedoLogMainType subcmd_prefix, const int32_t subcmd_suffix); inline static void parse_subcmd(const int64_t subcmd, enum ObRedoLogMainType& subcmd_prefix, int32_t& subcmd_suffix); - protected: +protected: bool enable_write_log_; const ObISLogFilter* filter_; }; class ObStorageLogCommittedTransGetter final { - public: +public: ObStorageLogCommittedTransGetter(); ~ObStorageLogCommittedTransGetter(); int init(const char* log_dir, const common::ObLogCursor& replay_start_cursor); @@ -133,11 +133,11 @@ class ObStorageLogCommittedTransGetter final { } void destroy(); - private: +private: int load_committed_trans(const char* log_dir, const common::ObLogCursor& replay_start_cursor); int revise_log(const char* log_dir); - private: +private: static const int64_t RECOVERY_TRANS_CNT = 10000; common::ObArenaAllocator allocator_; common::hash::ObHashMap committed_trans_map_; @@ -147,7 +147,7 @@ class ObStorageLogCommittedTransGetter final { }; class ObStorageLogReplayer { - public: +public: ObStorageLogReplayer(); virtual ~ObStorageLogReplayer(); @@ -176,20 +176,20 @@ class ObStorageLogReplayer { return log_dir_; } - protected: +protected: virtual int replay_over() { return common::OB_SUCCESS; }; - private: +private: int replay_( const common::ObLogCursor& replay_start_cursor, const ObStorageLogCommittedTransGetter& committed_trans_getter); int replay_after_ckpt( const common::ObLogCursor& replay_start_cursor, const ObStorageLogCommittedTransGetter& committed_trans_getter); int filter_single_log(const ObBaseStorageLogHeader& log_header, bool& is_filtered); - protected: +protected: bool is_inited_; int64_t trans_id_; uint64_t min_log_file_id_; @@ -200,7 +200,7 @@ class ObStorageLogReplayer { ObISLogFilter* filter_before_parse_; ObISLogFilter* filter_after_parse_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStorageLogReplayer); }; diff --git a/src/storage/blocksstable/slog/ob_storage_log_struct.h b/src/storage/blocksstable/slog/ob_storage_log_struct.h index 1a7cf54ac..8a9801f99 100644 --- a/src/storage/blocksstable/slog/ob_storage_log_struct.h +++ b/src/storage/blocksstable/slog/ob_storage_log_struct.h @@ -33,7 +33,7 @@ enum ObRedoLogMainType { enum ObRedoLogSysType { OB_REDO_LOG_BEGIN = 0, OB_REDO_LOG_COMMIT = 1 }; class ObIBaseStorageLogEntry { - public: +public: ObIBaseStorageLogEntry() {} virtual ~ObIBaseStorageLogEntry() @@ -62,7 +62,7 @@ struct ObBaseStorageLogHeader { }; struct ObStorageLogAttribute { - public: +public: ObStorageLogAttribute() : tenant_id_(common::OB_INVALID_TENANT_ID), data_file_id_(common::OB_INVALID_DATA_FILE_ID) {} ObStorageLogAttribute(const uint64_t tenant_id, const int64_t data_file_id) @@ -80,7 +80,7 @@ struct ObStorageLogAttribute { }; class ObBaseStorageLogBuffer : public ObBufferHolder { - public: +public: ObBaseStorageLogBuffer(); virtual ~ObBaseStorageLogBuffer(); int assign(char* buf, const int64_t buf_len); @@ -91,11 +91,11 @@ class ObBaseStorageLogBuffer : public ObBufferHolder { void reuse(); bool is_empty() const; - public: +public: NEED_SERIALIZE_AND_DESERIALIZE; TO_STRING_KV(KP_(data), K_(capacity), K_(pos)); - private: +private: int append_log_head(const int64_t trans_id, const int64_t log_seq, const int64_t subcmd, const int64_t log_len, const ObStorageLogAttribute& log_attr); }; diff --git a/src/storage/blocksstable/slog/ob_storage_log_writer.h b/src/storage/blocksstable/slog/ob_storage_log_writer.h index 6bcada8ac..fa48889b8 100644 --- a/src/storage/blocksstable/slog/ob_storage_log_writer.h +++ b/src/storage/blocksstable/slog/ob_storage_log_writer.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace blocksstable { class ObStorageLogItem : public common::ObIBaseLogItem { - public: +public: ObStorageLogItem(); virtual ~ObStorageLogItem(); int init(char* buf, const int64_t buf_size); @@ -60,7 +60,7 @@ class ObStorageLogItem : public common::ObIBaseLogItem { common::ObLogCursor start_cursor_; common::ObLogCursor end_cursor_; - private: +private: bool is_inited_; bool is_local_; // indicate whether buf_ is allocated locally or not int64_t buf_size_; @@ -74,18 +74,17 @@ class ObStorageLogItem : public common::ObIBaseLogItem { }; class ObStorageLogWriter : public common::ObBaseLogWriter { - public: - static const int64_t LOG_FILE_ALIGN_SIZE = 4 * 1024; // 4KB +public: + static const int64_t LOG_FILE_ALIGN_SIZE = 4 * 1024; // 4KB static const int64_t LOG_BUF_RESERVED_SIZE = 3 * LOG_FILE_ALIGN_SIZE; // NOP + switch_log - static const int64_t LOG_ITEM_MAX_LENGTH = 32 << 20; // 32MB + static const int64_t LOG_ITEM_MAX_LENGTH = 32 << 20; // 32MB ObStorageLogWriter(); virtual ~ObStorageLogWriter(); - int init(const char *log_dir, const int64_t log_file_size, - const int64_t max_log_size, const int64_t max_trans_cnt); + int init(const char* log_dir, const int64_t log_file_size, const int64_t max_log_size, const int64_t max_trans_cnt); void destroy() override; - int start_log(const common::ObLogCursor &cursor); + int start_log(const common::ObLogCursor& cursor); // attention: not thread safe int flush_log( const common::LogCommand cmd, const ObBaseStorageLogBuffer& log_buffer, common::ObLogCursor& start_cursor); @@ -106,7 +105,7 @@ class ObStorageLogWriter : public common::ObBaseLogWriter { ATOMIC_STORE(&is_ok_, ok); } - private: +private: static const int64_t FLUSH_THREAD_IDLE_INTERVAL_US = 10 * 1000; // 10ms static const int64_t MAX_FLUSH_WAIT_TIME_MS = 60 * 1000; // 60s @@ -167,7 +166,7 @@ class ObStorageLogWriter : public common::ObBaseLogWriter { int64_t len_; }; - private: +private: int prepare_log_buffers(const int64_t count, const int64_t log_buf_size); void destroy_log_buffers(); int prepare_log_items(const int64_t count); @@ -200,7 +199,7 @@ class ObStorageLogWriter : public common::ObBaseLogWriter { int advance_single_item(const int64_t cur_file_id, ObStorageLogItem& log_item); int sync_log(common::ObIBaseLogItem** items, int64_t& sync_index, const int64_t write_index); - private: +private: bool is_inited_; common::ObFixedQueue log_buffers_; int64_t log_buffer_size_; diff --git a/src/storage/compaction/ob_column_checksum_calculator.h b/src/storage/compaction/ob_column_checksum_calculator.h index 427af1f7d..37209d3fc 100644 --- a/src/storage/compaction/ob_column_checksum_calculator.h +++ b/src/storage/compaction/ob_column_checksum_calculator.h @@ -22,7 +22,7 @@ class ObSSTableMeta; namespace compaction { class ObColumnChecksumCalculator { - public: +public: ObColumnChecksumCalculator(); virtual ~ObColumnChecksumCalculator(); int init(const int64_t column_cnt); @@ -38,11 +38,11 @@ class ObColumnChecksumCalculator { } TO_STRING_KV(KP_(column_checksum), K_(column_cnt)); - private: +private: int calc_column_checksum(const int64_t checksum_method, const common::ObNewRow& row, const bool new_row, const bool* column_changed, int64_t* column_checksum); - private: +private: bool is_inited_; common::ObArenaAllocator allocator_; int64_t* column_checksum_; @@ -50,7 +50,7 @@ class ObColumnChecksumCalculator { }; class ObColumnChecksumAccumulator { - public: +public: ObColumnChecksumAccumulator(); virtual ~ObColumnChecksumAccumulator(); int init(const int64_t column_cnt); @@ -64,7 +64,7 @@ class ObColumnChecksumAccumulator { return column_cnt_; } - private: +private: bool is_inited_; int64_t* column_checksum_; common::ObArenaAllocator allocator_; @@ -73,7 +73,7 @@ class ObColumnChecksumAccumulator { }; class ObSSTableColumnChecksum { - public: +public: ObSSTableColumnChecksum(); virtual ~ObSSTableColumnChecksum(); int init(const int64_t concurrent_cnt, const share::schema::ObTableSchema& table_schema, const bool need_org_checksum, @@ -89,13 +89,13 @@ class ObSSTableColumnChecksum { return accumulator_.get_column_count(); } - private: +private: int init_checksum_calculators(const int64_t concurrent_cnt, const share::schema::ObTableSchema& table_schema); int init_column_checksum(const share::schema::ObTableSchema& table_schema, const bool need_org_checksum, const int64_t checksum_method, const common::ObIArray& org_sstable_metas); void destroy(); - private: +private: bool is_inited_; common::ObSEArray checksums_; ObColumnChecksumAccumulator accumulator_; diff --git a/src/storage/compaction/ob_micro_block_iterator.h b/src/storage/compaction/ob_micro_block_iterator.h index a245abd2a..674a0a80e 100644 --- a/src/storage/compaction/ob_micro_block_iterator.h +++ b/src/storage/compaction/ob_micro_block_iterator.h @@ -32,7 +32,7 @@ class ObMicroBlockIndexTransformer; namespace compaction { // Load macro block buf from disk and offer interfaces of raw data. class ObMacroBlockLoader { - public: +public: ObMacroBlockLoader(); virtual ~ObMacroBlockLoader(); int init(const char* macro_block_buf, const int64_t macro_block_buf_size, @@ -62,11 +62,11 @@ class ObMacroBlockLoader { return cur_micro_cursor_; } - private: +private: int transform_block_header( const blocksstable::ObSSTableMacroBlockHeader*& block_header, const common::ObObjMeta*& column_types); - private: +private: bool is_inited_; const char* macro_buf_; int64_t macro_buf_size_; @@ -78,7 +78,7 @@ class ObMacroBlockLoader { }; class ObMicroBlockIterator { - public: +public: ObMicroBlockIterator(); virtual ~ObMicroBlockIterator(); @@ -106,7 +106,7 @@ class ObMicroBlockIterator { return loader_.is_right_border(); } - private: +private: bool inited_; uint64_t table_id_; const common::ObIArray* columns_; diff --git a/src/storage/compaction/ob_partition_merge.h b/src/storage/compaction/ob_partition_merge.h index 6246c17d4..4d59d588a 100644 --- a/src/storage/compaction/ob_partition_merge.h +++ b/src/storage/compaction/ob_partition_merge.h @@ -30,7 +30,7 @@ namespace compaction { class ObMacroRowIterator; class ObIPartitionMergeFuser { - public: +public: static const int64_t DEFAULT_ITER_COUNT = 16; typedef common::ObRawSEArray MERGE_ITER_ARRAY; ObIPartitionMergeFuser() @@ -81,7 +81,7 @@ class ObIPartitionMergeFuser { VIRTUAL_TO_STRING_KV(K_(schema_rowkey_column_cnt), K_(column_cnt), K_(checksum_method), K_(has_lob_column), KP_(result_row), K_(compact_type), K_(schema_column_ids), K_(is_inited)); - protected: +protected: int check_merge_param(const storage::ObMergeParameter& merge_param); int base_init(const storage::ObMergeParameter& merge_param); virtual int inner_check_merge_param(const storage::ObMergeParameter& merge_param) = 0; @@ -95,8 +95,8 @@ class ObIPartitionMergeFuser { ObMacroRowIterator* row_iter, storage::ObStoreRow* row, const int64_t rowkey_column_cnt) = 0; virtual int malloc_row(int64_t column_count, storage::ObStoreRow*& row) = 0; - private: - protected: +private: +protected: int64_t schema_rowkey_column_cnt_; int64_t column_cnt_; int64_t checksum_method_; @@ -111,7 +111,7 @@ class ObIPartitionMergeFuser { }; class ObMajorPartitionMergeFuser : public ObIPartitionMergeFuser { - public: +public: ObMajorPartitionMergeFuser() : ObIPartitionMergeFuser(), default_row_(NULL), @@ -135,7 +135,7 @@ class ObMajorPartitionMergeFuser : public ObIPartitionMergeFuser { INHERIT_TO_STRING_KV("ObIPartitionMergeFuser", ObIPartitionMergeFuser, KP_(default_row), KP_(column_changed), KP_(table_schema), K_(need_fuse_generate)); - protected: +protected: virtual int inner_check_merge_param(const storage::ObMergeParameter& merge_param); virtual int inner_init(const storage::ObMergeParameter& merge_param) override; virtual int fuse_generate_exprs(); @@ -145,7 +145,7 @@ class ObMajorPartitionMergeFuser : public ObIPartitionMergeFuser { ObMacroRowIterator* row_iter, storage::ObStoreRow* row, const int64_t rowkey_column_cnt) override; virtual int malloc_row(int64_t column_count, storage::ObStoreRow*& row) override; - protected: +protected: storage::ObStoreRow* default_row_; bool* column_changed_; // only used in incre major fuser const share::schema::ObTableSchema* table_schema_; @@ -155,12 +155,12 @@ class ObMajorPartitionMergeFuser : public ObIPartitionMergeFuser { bool need_fuse_generate_; bool is_full_merge_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMajorPartitionMergeFuser); }; class ObIncrementMajorPartitionMergeFuser : public ObMajorPartitionMergeFuser { - public: +public: ObIncrementMajorPartitionMergeFuser() : ObMajorPartitionMergeFuser(), row_changed_(false), old_row_(NULL), checksum_calculator_(NULL) {} @@ -176,22 +176,22 @@ class ObIncrementMajorPartitionMergeFuser : public ObMajorPartitionMergeFuser { INHERIT_TO_STRING_KV( "ObMajorPartitionMergeFuser", ObMajorPartitionMergeFuser, K_(row_changed), KP_(old_row), K_(checksum_method)); - protected: +protected: virtual int inner_check_merge_param(const storage::ObMergeParameter& merge_param) override; virtual int inner_init(const storage::ObMergeParameter& merge_param) override; virtual int prepare_old_row(const MERGE_ITER_ARRAY& macro_row_iters); - protected: +protected: bool row_changed_; storage::ObStoreRow* old_row_; ObColumnChecksumCalculator* checksum_calculator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIncrementMajorPartitionMergeFuser); }; class ObMinorPartitionMergeFuser : public ObIPartitionMergeFuser { - public: +public: ObMinorPartitionMergeFuser() : ObIPartitionMergeFuser(), col_id_set_(), @@ -222,7 +222,7 @@ class ObMinorPartitionMergeFuser : public ObIPartitionMergeFuser { INHERIT_TO_STRING_KV("ObIPartitionMergeFuser", ObIPartitionMergeFuser, KP_(out_cols_project), KP_(multi_version_row_info), K_(column_ids)); - protected: +protected: virtual int inner_check_merge_param(const storage::ObMergeParameter& merge_param) override; virtual int inner_init(const storage::ObMergeParameter& merge_param) override; virtual int compare_row_iters(ObMacroRowIterator* base_iter, ObMacroRowIterator* macro_row_iter, int64_t& cmp_ret, @@ -234,7 +234,7 @@ class ObMinorPartitionMergeFuser : public ObIPartitionMergeFuser { virtual int malloc_row(int64_t column_count, storage::ObStoreRow*& row) = 0; bool is_committed_row_(const storage::ObStoreRow& row) const; - protected: +protected: common::ObBitSet<> col_id_set_; const common::ObIArray* out_cols_project_; storage::ObMultiVersionColDescGenerate multi_version_col_desc_gen_; @@ -246,7 +246,7 @@ class ObMinorPartitionMergeFuser : public ObIPartitionMergeFuser { }; class ObFlatMinorPartitionMergeFuser : public ObMinorPartitionMergeFuser { - public: +public: ObFlatMinorPartitionMergeFuser() {} virtual ~ObFlatMinorPartitionMergeFuser() @@ -264,7 +264,7 @@ class ObFlatMinorPartitionMergeFuser : public ObMinorPartitionMergeFuser { }; class ObSparseMinorPartitionMergeFuser : public ObMinorPartitionMergeFuser { - public: +public: ObSparseMinorPartitionMergeFuser() {} virtual ~ObSparseMinorPartitionMergeFuser() diff --git a/src/storage/compaction/ob_partition_merge_builder.h b/src/storage/compaction/ob_partition_merge_builder.h index 4e062e4d0..3dc443dc0 100644 --- a/src/storage/compaction/ob_partition_merge_builder.h +++ b/src/storage/compaction/ob_partition_merge_builder.h @@ -49,7 +49,7 @@ struct ObCompactRowType { }; class ObIStoreRowProcessor { - public: +public: ObIStoreRowProcessor() {} virtual ~ObIStoreRowProcessor() @@ -68,7 +68,7 @@ class ObIStoreRowProcessor { }; class ObMacroBlockBuilder : public ObIStoreRowProcessor { - public: +public: ObMacroBlockBuilder(); virtual ~ObMacroBlockBuilder(); virtual int open(storage::ObSSTableMergeCtx& ctx, const int64_t idx, const bool iter_complement, @@ -87,7 +87,7 @@ class ObMacroBlockBuilder : public ObIStoreRowProcessor { virtual void set_purged_count(const int64_t count); TO_STRING_KV(K_(desc), K_(sstable_merge_info), K_(writer)); - protected: +protected: void est_row(const ObCompactRowType::ObCompactRowTypeEnum& type, const bool is_output); int check_row_columns(const storage::ObStoreRow& row); int check_sparse_row_columns(const storage::ObStoreRow& row); @@ -96,7 +96,7 @@ class ObMacroBlockBuilder : public ObIStoreRowProcessor { OB_INLINE int check_sparse_row_column(const common::ObObj& obj, const int64_t idx); int append_bloom_filter(const storage::ObStoreRow& row); - private: +private: storage::ObMergeType merge_type_; blocksstable::ObMacroBlockWriter* writer_; blocksstable::ObDataStoreDesc desc_; @@ -112,7 +112,7 @@ class ObMacroBlockBuilder : public ObIStoreRowProcessor { }; class ObMacroBlockEstimator : public ObIStoreRowProcessor { - public: +public: ObMacroBlockEstimator(); virtual ~ObMacroBlockEstimator(); virtual int open(storage::ObSSTableMergeCtx& ctx, const int64_t idx, const bool iter_complement, @@ -134,7 +134,7 @@ class ObMacroBlockEstimator : public ObIStoreRowProcessor { virtual void set_purged_count(const int64_t count); TO_STRING_KV(KP(component_)); - private: +private: int update_estimator(const storage::ObStoreRow& row); ObIStoreRowProcessor* component_; bool is_opened_; diff --git a/src/storage/compaction/ob_partition_merge_util.h b/src/storage/compaction/ob_partition_merge_util.h index 8381a6d96..a44d0f99d 100644 --- a/src/storage/compaction/ob_partition_merge_util.h +++ b/src/storage/compaction/ob_partition_merge_util.h @@ -52,7 +52,7 @@ class ObColDesc; namespace compaction { struct ObMergeIndexInfo { - public: +public: ObMergeIndexInfo() : index_id_(OB_INVALID_ID), table_exist_(false) {} ObMergeIndexInfo(const uint64_t index_id, const bool table_exist) : index_id_(index_id), table_exist_(table_exist) @@ -63,7 +63,7 @@ struct ObMergeIndexInfo { }; struct ObBuildIndexParam { - public: +public: static const int64_t DEFAULT_INDEX_SORT_MEMORY_LIMIT = 128L * 1024L * 1024L; ObBuildIndexParam() : table_schema_(NULL), @@ -104,7 +104,7 @@ struct ObBuildIndexParam { TO_STRING_KV(KP_(table_schema), KP_(index_schema), KP_(dep_table_schema), K_(schema_version), K_(schema_cnt), K_(version), K_(concurrent_cnt), K_(row_store_type), K_(snapshot_version), KP_(report), K_(checksum_method)); - public: +public: const share::schema::ObTableSchema* table_schema_; const share::schema::ObTableSchema* index_schema_; const share::schema::ObTableSchema* dep_table_schema_; @@ -121,7 +121,7 @@ struct ObBuildIndexParam { }; struct ObBuildIndexContext { - public: +public: typedef storage::ObExternalSort ExternalSort; ObBuildIndexContext() : is_report_succ_(false), @@ -168,7 +168,7 @@ struct ObBuildIndexContext { }; class ObMacroRowIterator { - public: +public: struct Param { Param(); bool is_valid() const; @@ -332,18 +332,18 @@ class ObMacroRowIterator { K_(merge_range), K_(advice_merge_level), K_(curr_merge_level), K_(micro_block_count), K_(reuse_micro_block_count), K_(iter_row_count), K_(magic_row_count), K_(purged_count), K_(need_rewrite_dirty_macro_block)); - public: +public: // represent cannot compare with other ObMacroRowIterator and this ObMacroRowIterator is a range iterator static const int64_t CANNOT_COMPARE_LEFT_IS_RANGE = -2; // represent cannot compare with other ObMacroRowIterator and other ObMacroRowIterator is a range iterator static const int64_t CANNOT_COMPARE_RIGHT_IS_RANGE = 2; static const int64_t CANNOT_COMPARE_BOTH_ARE_RANGE = 3; - protected: +protected: int64_t compare(const common::ObStoreRowkey& rowkey, const common::ObStoreRange& range); void get_border_key(const common::ObStoreRowkey& border_key, const bool is_start_key, common::ObStoreRowkey& rowkey); - protected: +protected: int next_range(); void choose_merge_level(); int init_macro_iter(const Param& param, const ObPartitionKey& pg_key); @@ -406,7 +406,7 @@ class ObMacroRowIterator { }; class ObMinorMergeMacroRowIterator : public ObMacroRowIterator { - public: +public: ObMinorMergeMacroRowIterator(); virtual ~ObMinorMergeMacroRowIterator(); virtual int next() override; @@ -414,27 +414,27 @@ class ObMinorMergeMacroRowIterator : public ObMacroRowIterator { virtual int multi_version_compare(const ObMacroRowIterator& other, int64_t& cmp_ret) override; void reset(); - protected: +protected: int compact_row(const storage::ObStoreRow& former, const int64_t row_compact_info_index, storage::ObStoreRow& dest); int next_row_with_open_macro_block(); virtual int inner_init() override; - private: +private: int make_first_row_compacted(); int compact_last_row(); - private: +private: enum RowCompactInfoIndex { RNPI_FIRST_ROW = 0, RNPI_LAST_ROW = 1, RNPI_MAX, }; - protected: +protected: common::ObArenaAllocator obj_copy_allocator_; storage::ObObjDeepCopy obj_copy_; - private: +private: storage::ObNopPos* nop_pos_[RNPI_MAX]; ObFixedBitSet* bit_set_[RNPI_MAX]; @@ -472,7 +472,7 @@ struct ObRowFuseInfo { // filter rows with from_base_ flag template class ObDeltaSSStoreRowIterator : public T { - public: +public: virtual int get_next_row(storage::ObStoreRow*& row) override { int ret = common::OB_SUCCESS; @@ -485,7 +485,7 @@ class ObDeltaSSStoreRowIterator : public T { // TODO(): remove static class ObPartitionMergeUtil { - public: +public: ObPartitionMergeUtil(); virtual ~ObPartitionMergeUtil(); @@ -498,7 +498,7 @@ class ObPartitionMergeUtil { static bool could_merge_start(); - private: +private: static bool need_open(int64_t cmp_ret); static bool need_open_left(int64_t cmp_ret); static bool need_open_right(int64_t cmp_ret); @@ -549,7 +549,7 @@ class ObPartitionMergeUtil { }; class ObTableDumper { - public: +public: static void print_error_info( int err_no, storage::ObSSTableMergeCtx& ctx, ObIPartitionMergeFuser::MERGE_ITER_ARRAY& macro_row_iters); static int generate_dump_table_name(const char* dir_name, const storage::ObITable* table, char* file_name); @@ -562,7 +562,7 @@ class ObTableDumper { static int64_t free_space; static lib::ObMutex lock; - private: +private: static bool need_dump_table(int err_no); }; diff --git a/src/storage/gts/ob_ha_gts.cpp b/src/storage/gts/ob_ha_gts.cpp index 5dffa3798..434fd2e7b 100644 --- a/src/storage/gts/ob_ha_gts.cpp +++ b/src/storage/gts/ob_ha_gts.cpp @@ -22,13 +22,13 @@ namespace oceanbase { using namespace common; namespace gts { class ObGtsPingCB : public obrpc::ObSrvRpcProxy::AsyncCB { - public: +public: ObGtsPingCB() : gts_mgr_(NULL) {} virtual ~ObGtsPingCB() {} - public: +public: int init(ObHaGtsManager* gts_mgr); void on_timeout() final; int process(); @@ -47,10 +47,10 @@ class ObGtsPingCB : public obrpc::ObSrvRpcProxy::AsyncCB HaGtsHashNode; typedef common::LinkHashValue HaGtsHashValue; class ObHaGts : public HaGtsHashValue { - public: +public: ObHaGts(); ~ObHaGts(); - public: +public: int init(const uint64_t gts_id, const int64_t epoch_id, const common::ObMemberList& member_list, const int64_t min_start_timestamp, obrpc::ObSrvRpcProxy* rpc_proxy, ObHaGtsManager* gts_mgr, const common::ObAddr& self_addr); @@ -79,7 +79,7 @@ class ObHaGts : public HaGtsHashValue { void reset(); void destroy(); - public: +public: int handle_ping_request(const obrpc::ObHaGtsPingRequest& request, obrpc::ObHaGtsPingResponse& response); int handle_ping_response(const obrpc::ObHaGtsPingResponse& response); int handle_get_request(const obrpc::ObHaGtsGetRequest& request); @@ -102,25 +102,25 @@ class ObHaGts : public HaGtsHashValue { int inc_update_local_ts(const int64_t local_ts); const static int64_t HA_GTS_RPC_TIMEOUT = 1 * 1000 * 1000; // 1s const static int64_t STALE_REQ_INTERVAL = 1 * 1000 * 1000; // 1s - private: +private: int ping_request_(const common::ObAddr& server, const obrpc::ObHaGtsPingRequest& request); int send_gts_response_(const common::ObAddr& server, const obrpc::ObHaGtsGetResponse& response); int send_heartbeat_(const common::ObAddr& server, const obrpc::ObHaGtsHeartbeat& heartbeat); int get_miss_replica_(const common::ObMemberList& member_list1, const common::ObMemberList& member_list2, common::ObAddr& miss_replica) const; - private: +private: typedef common::RWLock RWLock; typedef RWLock::WLockGuard WLockGuard; class EraseIfFunctor { - public: + public: EraseIfFunctor() : req_() {} ~EraseIfFunctor() {} - public: + public: bool operator()(const ObGtsReqID& req_id, ObGtsReq& req) { UNUSED(req_id); @@ -132,36 +132,36 @@ class ObHaGts : public HaGtsHashValue { return req_; } - private: + private: ObGtsReq req_; }; class RemoveIfFunctor { - public: + public: RemoveIfFunctor(const transaction::MonotonicTs cur_ts) : cur_ts_(cur_ts) {} ~RemoveIfFunctor() {} - public: + public: bool operator()(const ObGtsReqID& req_id, ObGtsReq& req) { UNUSED(req_id); return cur_ts_ - req.get_srr() >= transaction::MonotonicTs(STALE_REQ_INTERVAL); } - private: + private: transaction::MonotonicTs cur_ts_; }; class HeartbeatFunctor { - public: + public: HeartbeatFunctor() {} ~HeartbeatFunctor() {} - public: + public: bool operator()(const ObAddr& addr, int64_t& heartbeat_ts) { UNUSED(addr); @@ -171,14 +171,14 @@ class ObHaGts : public HaGtsHashValue { }; class CheckHeartbeatFunctor { - public: + public: CheckHeartbeatFunctor(const common::ObMemberList& member_list) : member_list_(member_list), heartbeat_member_list_(), offline_replica_() {} ~CheckHeartbeatFunctor() {} - public: + public: bool operator()(const ObAddr& addr, int64_t& heartbeat_ts) { int ret = OB_SUCCESS; @@ -204,13 +204,13 @@ class ObHaGts : public HaGtsHashValue { return heartbeat_member_list_; } - private: + private: const common::ObMemberList& member_list_; common::ObMemberList heartbeat_member_list_; common::ObAddr offline_replica_; }; - private: +private: bool is_inited_; int64_t created_ts_; mutable RWLock lock_; @@ -231,12 +231,12 @@ class ObHaGts : public HaGtsHashValue { // Single replica mode, need to be modified under lock protection bool is_single_mode_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHaGts); }; class ObHaGtsFactory { - public: +public: static ObHaGts* alloc() { ATOMIC_INC(&alloc_cnt_); @@ -254,13 +254,13 @@ class ObHaGtsFactory { } } - private: +private: static int64_t alloc_cnt_; static int64_t free_cnt_; }; class ObHaGtsAlloc { - public: +public: ObHaGts* alloc_value() { return NULL; diff --git a/src/storage/gts/ob_ha_gts_mgr.cpp b/src/storage/gts/ob_ha_gts_mgr.cpp index 97f7f2004..4b3cbef09 100644 --- a/src/storage/gts/ob_ha_gts_mgr.cpp +++ b/src/storage/gts/ob_ha_gts_mgr.cpp @@ -105,13 +105,13 @@ void ObHaGtsManager::CheckMemberStatusTask::runTimerTask() } class ObHaGtsManager::GCFunctor { - public: +public: GCFunctor(const ObGtsInfoArray& gts_info_array) : gts_info_array_(gts_info_array) {} ~GCFunctor() {} - public: +public: bool operator()(const ObGtsID& gts_id, ObHaGts*& ha_gts) { UNUSED(ha_gts); @@ -119,7 +119,7 @@ class ObHaGtsManager::GCFunctor { return !is_gts_exist_(gts); } - private: +private: bool is_gts_exist_(const uint64_t gts_id) const { bool bool_ret = false; @@ -132,13 +132,13 @@ class ObHaGtsManager::GCFunctor { }; class ObHaGtsManager::HeartbeatFunctor { - public: +public: HeartbeatFunctor() {} ~HeartbeatFunctor() {} - public: +public: bool operator()(const ObGtsID& gts_id, ObHaGts*& ha_gts) { UNUSED(gts_id); @@ -148,13 +148,13 @@ class ObHaGtsManager::HeartbeatFunctor { }; class ObHaGtsManager::CheckMemberStatusFunctor { - public: +public: CheckMemberStatusFunctor(ObHaGtsManager* ha_gts_mgr) : host_(ha_gts_mgr) {} ~CheckMemberStatusFunctor() {} - public: +public: bool operator()(const ObGtsID& gts_id, ObHaGts*& ha_gts) { int ret = OB_SUCCESS; @@ -180,7 +180,7 @@ class ObHaGtsManager::CheckMemberStatusFunctor { return true; } - private: +private: ObHaGtsManager* host_; }; diff --git a/src/storage/gts/ob_ha_gts_mgr.h b/src/storage/gts/ob_ha_gts_mgr.h index 1bfb0123c..8a64c7658 100644 --- a/src/storage/gts/ob_ha_gts_mgr.h +++ b/src/storage/gts/ob_ha_gts_mgr.h @@ -29,11 +29,11 @@ class ObMySQLProxy; } namespace gts { class ObHaGtsManager { - public: +public: ObHaGtsManager(); ~ObHaGtsManager(); - public: +public: int init(obrpc::ObSrvRpcProxy* rpc_proxy, common::ObMySQLProxy* sql_proxy, const common::ObAddr& self_addr); void reset(); void destroy(); @@ -41,7 +41,7 @@ class ObHaGtsManager { void stop(); void wait(); - public: +public: int handle_ping_request(const obrpc::ObHaGtsPingRequest& request, obrpc::ObHaGtsPingResponse& response); int handle_ping_response(const obrpc::ObHaGtsPingResponse& response); int handle_get_request(const obrpc::ObHaGtsGetRequest& request); @@ -56,75 +56,75 @@ class ObHaGtsManager { int execute_auto_change_member(const uint64_t gts_id, const bool miss_replica, const common::ObAddr& offline_replica, const int64_t epoch_id, const common::ObMemberList& member_list); - private: +private: class RemoveStaleReqTask : public common::ObTimerTask { - public: + public: RemoveStaleReqTask() : ha_gts_mgr_(NULL) {} ~RemoveStaleReqTask() {} - public: + public: int init(ObHaGtsManager* ha_gts_mgr); virtual void runTimerTask(); - private: + private: ObHaGtsManager* ha_gts_mgr_; }; class LoadAllGtsTask : public common::ObTimerTask { - public: + public: LoadAllGtsTask() : ha_gts_mgr_(NULL) {} ~LoadAllGtsTask() {} - public: + public: int init(ObHaGtsManager* ha_gts_mgr); virtual void runTimerTask(); - private: + private: ObHaGtsManager* ha_gts_mgr_; }; class HeartbeatTask : public common::ObTimerTask { - public: + public: HeartbeatTask() : ha_gts_mgr_(NULL) {} ~HeartbeatTask() {} - public: + public: int init(ObHaGtsManager* ha_gts_mgr); virtual void runTimerTask(); - private: + private: ObHaGtsManager* ha_gts_mgr_; }; class CheckMemberStatusTask : public common::ObTimerTask { - public: + public: CheckMemberStatusTask() : ha_gts_mgr_(NULL) {} ~CheckMemberStatusTask() {} - public: + public: int init(ObHaGtsManager* ha_gts_mgr); virtual void runTimerTask(); - private: + private: ObHaGtsManager* ha_gts_mgr_; }; class RemoveStaleReqFunctor { - public: + public: RemoveStaleReqFunctor() {} ~RemoveStaleReqFunctor() {} - public: + public: bool operator()(const ObGtsID& gts_id, ObHaGts*& ha_gts) { UNUSED(gts_id); @@ -141,7 +141,7 @@ class ObHaGtsManager { const static int64_t LOAD_ALL_GTS_TASK_INTERVAL = 1 * 1000 * 1000; // 1s const static int64_t HEARTBEAT_INTERVAL = 10 * 1000; // 10ms const static int64_t CHECK_MEMBER_STATUS_INTERVAL = 100 * 1000; // 100ms - private: +private: int create_gts_(const uint64_t gts_id, const int64_t epoch_id, const common::ObMemberList& member_list, const int64_t min_start_timestamp); int remove_gts_(const uint64_t gts_id); @@ -161,7 +161,7 @@ class ObHaGtsManager { int send_update_meta_msg_(const uint64_t gts_id, const int64_t epoch_id, const common::ObMemberList& member_list, const int64_t local_ts, const common::ObAddr& server, int64_t& replica_local_ts); - private: +private: bool is_inited_; obrpc::ObSrvRpcProxy* rpc_proxy_; share::ObGtsTableOperator gts_table_operator_; @@ -172,7 +172,7 @@ class ObHaGtsManager { CheckMemberStatusTask check_member_status_task_; HeartbeatTask heartbeat_task_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHaGtsManager); }; } // namespace gts diff --git a/src/storage/gts/ob_ha_gts_source.cpp b/src/storage/gts/ob_ha_gts_source.cpp index ba948c3c5..3a5212d39 100644 --- a/src/storage/gts/ob_ha_gts_source.cpp +++ b/src/storage/gts/ob_ha_gts_source.cpp @@ -45,7 +45,7 @@ void ObHaGtsSource::ObHaGtsSourceTask::runTimerTask() } class ObHaGtsSource::GetTenantArrayFunctor { - public: +public: GetTenantArrayFunctor(const transaction::MonotonicTs srr) : srr_(srr) { tenant_array_.reset(); @@ -53,7 +53,7 @@ class ObHaGtsSource::GetTenantArrayFunctor { ~GetTenantArrayFunctor() {} - public: +public: bool operator()(const ObGtsID& gts_id, ObGtsMeta& gts_meta) { UNUSED(gts_id); @@ -76,19 +76,19 @@ class ObHaGtsSource::GetTenantArrayFunctor { return tenant_array_; } - private: +private: transaction::MonotonicTs srr_; ObTenantArray tenant_array_; }; class ObHaGtsSource::ModifyTenantCacheFunctor { - public: +public: ModifyTenantCacheFunctor(const transaction::MonotonicTs srr, const int64_t gts) : srr_(srr), gts_(gts) {} ~ModifyTenantCacheFunctor() {} - public: +public: bool operator()(const ObTenantID& tenant_id, ObTenantCache& tenant_cache) { UNUSED(tenant_id); @@ -98,19 +98,19 @@ class ObHaGtsSource::ModifyTenantCacheFunctor { return true; } - private: +private: transaction::MonotonicTs srr_; int64_t gts_; }; class ObHaGtsSource::RefreshGtsFunctor { - public: +public: RefreshGtsFunctor(ObHaGtsSource* source) : host_(source) {} ~RefreshGtsFunctor() {} - public: +public: bool operator()(const ObGtsID& gts_id, ObGtsMeta& gts_meta) { const uint64_t gts = gts_id.get_value(); @@ -125,7 +125,7 @@ class ObHaGtsSource::RefreshGtsFunctor { return true; } - private: +private: const common::ObAddr choose_gts_server_(const common::ObMemberList& member_list) const { int tmp_ret = OB_SUCCESS; @@ -140,14 +140,14 @@ class ObHaGtsSource::RefreshGtsFunctor { }; class ObHaGtsSource::ModifyGtsMetaFunctor { - public: +public: ModifyGtsMetaFunctor(const ObGtsIDArray& gts_id_array, const ObGtsMetaArray& gts_meta_array) : gts_id_array_(gts_id_array), gts_meta_array_(gts_meta_array) {} ~ModifyGtsMetaFunctor() {} - public: +public: bool operator()(const ObGtsID& gts_id, ObGtsMeta& gts_meta) { bool bool_ret = false; @@ -163,7 +163,7 @@ class ObHaGtsSource::ModifyGtsMetaFunctor { return bool_ret; } - private: +private: bool is_gts_exist_(const uint64_t gts_id, int64_t& index) const { bool bool_ret = false; @@ -216,7 +216,7 @@ class ObHaGtsSource::ModifyGtsMetaFunctor { } } - private: +private: const ObGtsIDArray& gts_id_array_; const ObGtsMetaArray& gts_meta_array_; }; diff --git a/src/storage/gts/ob_ha_gts_source.h b/src/storage/gts/ob_ha_gts_source.h index 8cc2fb687..8dcbf93bc 100644 --- a/src/storage/gts/ob_ha_gts_source.h +++ b/src/storage/gts/ob_ha_gts_source.h @@ -33,11 +33,11 @@ class ObMySQLProxy; } namespace gts { class ObHaGtsSource : public share::ObThreadPool { - public: +public: ObHaGtsSource(); ~ObHaGtsSource(); - public: +public: int init(obrpc::ObSrvRpcProxy* rpc_proxy, common::ObMySQLProxy* sql_proxy, const common::ObAddr& self_addr); void reset(); void destroy(); @@ -45,7 +45,7 @@ class ObHaGtsSource : public share::ObThreadPool { void stop(); void wait(); - public: +public: // if gts does not support this tenant, return OB_NOT_SUPPORTED; // if stc <= tenant_cache.srr_, return tenant_cache.gts_; // others, return OB_EAGAIN; @@ -58,9 +58,9 @@ class ObHaGtsSource : public share::ObThreadPool { void runTimerTask(); void refresh_gts(const uint64_t gts_id, const common::ObAddr& gts_server); - private: +private: class ObTenantCache { - public: + public: ObTenantCache() { reset(); @@ -70,7 +70,7 @@ class ObHaGtsSource : public share::ObThreadPool { reset(); } - public: + public: void reset() { srr_.reset(); @@ -90,7 +90,7 @@ class ObHaGtsSource : public share::ObThreadPool { return gts_; } - private: + private: transaction::MonotonicTs srr_; int64_t gts_; }; @@ -104,7 +104,7 @@ class ObHaGtsSource : public share::ObThreadPool { typedef common::ObSEArray ObTenantLeaseArray; class ObGtsMeta { - public: + public: ObGtsMeta() { reset(); @@ -114,7 +114,7 @@ class ObHaGtsSource : public share::ObThreadPool { destroy(); } - public: + public: void reset() { tenant_lease_array_.reset(); @@ -150,23 +150,23 @@ class ObHaGtsSource : public share::ObThreadPool { } TO_STRING_KV(K(tenant_lease_array_), K(member_list_)); - private: + private: ObTenantLeaseArray tenant_lease_array_; common::ObMemberList member_list_; }; class ObHaGtsSourceTask : public common::ObTimerTask { - public: + public: ObHaGtsSourceTask() : gts_source_(NULL) {} ~ObHaGtsSourceTask() {} - public: + public: int init(ObHaGtsSource* gts_source); virtual void runTimerTask(); - private: + private: ObHaGtsSource* gts_source_; }; @@ -184,7 +184,7 @@ class ObHaGtsSource : public share::ObThreadPool { const static uint64_t REFRESHING_FLAG = (1ULL << 63); const static int64_t RETRY_TRIGGER_INTERVAL = 10 * 1000; - private: +private: void refresh_gts_(); void load_gts_meta_map_(); int get_gts_meta_array_(ObGtsIDArray& gts_id_array, ObGtsMetaArray& gts_meta_array); @@ -194,7 +194,7 @@ class ObHaGtsSource : public share::ObThreadPool { static int64_t set_refreshing_(const int64_t refresh_ts); static int64_t reset_refreshing_(const int64_t refresh_ts); - private: +private: bool is_inited_; ObGtsMetaMap gts_meta_map_; ObTenantCacheMap tenant_cache_map_; @@ -206,7 +206,7 @@ class ObHaGtsSource : public share::ObThreadPool { int64_t latest_refresh_ts_; int64_t latest_trigger_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObHaGtsSource); }; } // namespace gts diff --git a/src/storage/memtable/mvcc/ob_crtp_util.h b/src/storage/memtable/mvcc/ob_crtp_util.h index b4d449a4d..fc7cae5e2 100644 --- a/src/storage/memtable/mvcc/ob_crtp_util.h +++ b/src/storage/memtable/mvcc/ob_crtp_util.h @@ -22,7 +22,7 @@ namespace memtable { template class ObWithArenaT { - public: +public: ObWithArenaT(common::ObIAllocator& allocator, const int64_t page_size) : page_allocator_(allocator), arena_(page_size, page_allocator_) {} @@ -59,7 +59,7 @@ class ObWithArenaT { arena_.set_tenant_id(tenant_id); } - private: +private: common::ModulePageAllocator page_allocator_; common::ModuleArena arena_; }; @@ -67,7 +67,7 @@ typedef ObWithArenaT<> ObWithArena; template class ObWithDataBuffer { - public: +public: ObWithDataBuffer() : data_buffer_(memory_, sizeof(memory_)) {} common::ObDataBuffer& get_buf() @@ -75,7 +75,7 @@ class ObWithDataBuffer { return data_buffer_; } - private: +private: char memory_[BUF_SIZE]; common::ObDataBuffer data_buffer_; }; diff --git a/src/storage/memtable/mvcc/ob_keybtree.h b/src/storage/memtable/mvcc/ob_keybtree.h index afb5ee39c..83c2ecf5e 100644 --- a/src/storage/memtable/mvcc/ob_keybtree.h +++ b/src/storage/memtable/mvcc/ob_keybtree.h @@ -53,10 +53,10 @@ struct BtreeNodeList { }; class BtreeNodeAllocator { - private: +private: enum { MAX_LIST_COUNT = common::MAX_CPU_NUM }; - public: +public: BtreeNodeAllocator(common::ObIAllocator& allocator) : allocator_(allocator), alloc_memory_(0) {} virtual ~BtreeNodeAllocator() @@ -73,7 +73,7 @@ class BtreeNodeAllocator { } } - private: +private: int64_t push_idx(); int64_t pop_idx(); void push(BtreeNode* p) @@ -82,7 +82,7 @@ class BtreeNodeAllocator { } int pop(BtreeNode*& p); - private: +private: common::ObIAllocator& allocator_; int64_t alloc_memory_; BtreeNodeList free_list_array_[MAX_LIST_COUNT] CACHE_ALIGNED; @@ -131,7 +131,7 @@ struct TScanRawHandle { }; class ObKeyBtree { - public: +public: ObKeyBtree(BtreeNodeAllocator& node_allocator) : node_allocator_(node_allocator), root_(nullptr) {} ~ObKeyBtree() @@ -168,10 +168,10 @@ class ObKeyBtree { common::QClock& get_qclock(); common::ObQSync& get_qsync(); - private: +private: void destroy(BtreeNode* root); - private: +private: common::ObSimpleCounter size_; BtreeNodeAllocator& node_allocator_; BtreeNode* root_; diff --git a/src/storage/memtable/mvcc/ob_keybtree_deps.h b/src/storage/memtable/mvcc/ob_keybtree_deps.h index 7e4e04783..eb643096c 100644 --- a/src/storage/memtable/mvcc/ob_keybtree_deps.h +++ b/src/storage/memtable/mvcc/ob_keybtree_deps.h @@ -43,7 +43,7 @@ struct CompHelper { }; class RWLock { - public: +public: RWLock() : lock_(0) {} ~RWLock() @@ -67,7 +67,7 @@ class RWLock { ATOMIC_STORE(&lock_, 0); } - private: +private: union { struct { int16_t read_ref_; @@ -80,7 +80,7 @@ class RWLock { class KVQueue { enum { capacity = 64 }; - public: +public: KVQueue() : push_(0), pop_(0) {} ~KVQueue() @@ -93,13 +93,13 @@ class KVQueue { return push_ - pop_; } - private: +private: int64_t idx(const int64_t x) { return x % capacity; } - private: +private: int64_t push_; int64_t pop_; BtreeKV items_[capacity]; @@ -108,7 +108,7 @@ class KVQueue { class MultibitSet { enum { LEN_OF_COUNTER = 4, LEN_OF_PER_INDEX = 4, LEN_OF_TOTAL_INDEX = 64 }; - public: +public: MultibitSet() : data_(0) {} MultibitSet(RawType d) : data_(d) @@ -156,7 +156,7 @@ class MultibitSet { return ATOMIC_LOAD(&data_); } - private: +private: OB_INLINE RawType cal_index_(MultibitSet& old, int index, uint8_t value) { uint8_t offset = LEN_OF_COUNTER + index * LEN_OF_PER_INDEX; @@ -173,11 +173,11 @@ class MultibitSet { }; }; - public: +public: }; class WeightEstimate { - public: +public: enum { MAX_LEVEL = 64 }; WeightEstimate(int64_t node_cnt); int64_t get_weight(int64_t level) @@ -185,19 +185,19 @@ class WeightEstimate { return weight_[level]; } - private: +private: int64_t weight_[MAX_LEVEL]; }; struct BtreeNode : public common::ObLink { friend class ScanHandle; - private: +private: enum { MAGIC_NUM = 0xb7ee // 47086 }; - public: +public: BtreeNode() : host_(nullptr), max_del_version_(0), level_(0), magic_num_(MAGIC_NUM), index_() {} ~BtreeNode() @@ -332,7 +332,7 @@ struct BtreeNode : public common::ObLink { set_key_value(pos, key, val); } - protected: +protected: OB_INLINE int binary_search_upper_bound( CompHelper& nh, BtreeKey key, bool& is_equal, int& pos, MultibitSet* index = nullptr) { @@ -371,7 +371,7 @@ struct BtreeNode : public common::ObLink { void copy_and_insert(BtreeNode& dest_node, const int start, const int end, int pos, BtreeKey key_1, BtreeVal val_1, BtreeKey key_2, BtreeVal val_2); - public: +public: uint64_t get_tag(int pos, MultibitSet* index = nullptr) const; uint64_t check_tag(MultibitSet* index = nullptr) const; void replace_child(BtreeNode* new_node, const int pos, BtreeNode* child, int64_t del_version); @@ -381,7 +381,7 @@ struct BtreeNode : public common::ObLink { void split_child_cause_recursive_split(BtreeNode* new_node_1, BtreeNode* new_node_2, const int pos, BtreeKey key_1, BtreeVal val_1, BtreeKey key_2, BtreeVal val_2, int64_t del_version); - private: +private: void* host_; int64_t max_del_version_; RWLock lock_; @@ -403,7 +403,7 @@ struct Item { class Path { enum { MAX_DEPTH = 32 }; - public: +public: Path() : depth_(0), is_found_(false) {} ~Path() @@ -460,14 +460,14 @@ class Path { return is_found_; } - private: +private: int64_t depth_; Item path_[MAX_DEPTH]; bool is_found_; }; class OptimisticScanCompHelper { - public: +public: explicit OptimisticScanCompHelper(CompHelper& comp) : enable_optimistic_comp_(true), comp_(comp), @@ -483,7 +483,7 @@ class OptimisticScanCompHelper { // cmp < 0: iter end int comp(BtreeKey& cur_key, BtreeKey* jump_key, int& cmp); - private: +private: bool enable_optimistic_comp_; CompHelper& comp_; bool is_backward_; @@ -493,7 +493,7 @@ class OptimisticScanCompHelper { }; class BaseHandle { - public: +public: BaseHandle(QClock& qclock) : index_(), qclock_(qclock), qc_slot_(UINT64_MAX), comp_() {} ~BaseHandle() @@ -510,18 +510,18 @@ class BaseHandle { return comp_; } - protected: +protected: // record leaf index MultibitSet index_; - private: +private: QClock& qclock_; uint64_t qc_slot_; CompHelper comp_; }; class GetHandle : public BaseHandle { - public: +public: GetHandle(ObKeyBtree& tree) : BaseHandle(tree.get_qclock()) { UNUSED(tree); @@ -532,11 +532,11 @@ class GetHandle : public BaseHandle { }; class ScanHandle : public BaseHandle { - private: +private: Path path_; int64_t version_; - public: +public: explicit ScanHandle(ObKeyBtree& tree) : BaseHandle(tree.get_qclock()), version_(INT64_MAX) { UNUSED(tree); @@ -565,13 +565,13 @@ class ScanHandle : public BaseHandle { }; class WriteHandle : public BaseHandle { - private: +private: ObKeyBtree& base_; Path path_; HazardList retire_list_; HazardList alloc_list_; - public: +public: explicit WriteHandle(ObKeyBtree& tree) : BaseHandle(tree.get_qclock()), base_(tree) {} ~WriteHandle() @@ -635,12 +635,12 @@ class WriteHandle : public BaseHandle { return ret; } - public: +public: int insert_and_split_upward(BtreeKey key, BtreeVal val, BtreeNode*& new_root); int tag_delete(BtreeKey key, BtreeVal& val, int64_t version, BtreeNode*& new_root); int tag_insert(BtreeKey key, BtreeNode*& new_root); - private: +private: uint64_t check_tag(BtreeNode* node) { return OB_ISNULL(node) ? 0 : node->check_tag(); @@ -673,7 +673,7 @@ class WriteHandle : public BaseHandle { }; class Iterator { - public: +public: explicit Iterator(ObKeyBtree& btree) : btree_(btree), scan_handle_(btree), @@ -715,13 +715,13 @@ class Iterator { // while element_count is the count of btree node int estimate_element_count(int64_t& physical_row_count, int64_t& element_count, const double ratio); - private: +private: int iter_next(BtreeKey& key, BtreeVal& value); // for estimate row count in range int iter_next_batch_level_node(int64_t& element_count, const int64_t batch_count, const int64_t level, int64_t& gap_size, const int64_t gap_limit, int64_t& phy_element_count, const double ratio); - private: +private: ObKeyBtree& btree_; ScanHandle scan_handle_; OptimisticScanCompHelper optimistic_comp_helper_; @@ -736,7 +736,7 @@ class Iterator { }; class HazardLessIterator { - public: +public: explicit HazardLessIterator(ObKeyBtree& btree) : iter_(btree), root_(NULL), @@ -761,10 +761,10 @@ class HazardLessIterator { } int get_next(BtreeKey& key, BtreeVal& value); - private: +private: int scan_batch(); - private: +private: Iterator iter_; BtreeNode** root_; bool scan_backward_; diff --git a/src/storage/memtable/mvcc/ob_multi_version_iterator.h b/src/storage/memtable/mvcc/ob_multi_version_iterator.h index 667f29951..e78fed93e 100644 --- a/src/storage/memtable/mvcc/ob_multi_version_iterator.h +++ b/src/storage/memtable/mvcc/ob_multi_version_iterator.h @@ -29,11 +29,11 @@ namespace memtable { class ObIMvccCtx; class ObMultiVersionValueIterator : public ObIMvccValueIterator { - public: +public: ObMultiVersionValueIterator(); virtual ~ObMultiVersionValueIterator(); // for iterating multi version row or uncommitted transaction row - public: +public: int init(const ObIMvccCtx& ctx, const transaction::ObTransSnapInfo& snapshot_info, const ObMemtableKey* key, ObMvccRow* value, transaction::ObTransStateTableGuard& trans_table_guard); virtual int get_next_node(const void*& tnode); @@ -84,7 +84,7 @@ class ObMultiVersionValueIterator : public ObIMvccValueIterator { TO_STRING_KV(K_(value), KPC_(version_iter), KPC_(multi_version_iter), K_(max_committed_trans_version), K_(cur_trans_version), K_(is_node_compacted), K_(merge_log_ts), K_(iter_mode)); - private: +private: int get_trans_status_with_log_ts(const int64_t log_ts, ObMvccTransNode* trans_node, transaction::ObTransTableStatusType& status, int64_t& trans_version_at_merge_log_ts); int get_status_of_curr_trans_node( @@ -96,7 +96,7 @@ class ObMultiVersionValueIterator : public ObIMvccValueIterator { int should_ignore_cur_node(const ObMvccTransNode& node, bool& ignore_flag); DISALLOW_COPY_AND_ASSIGN(ObMultiVersionValueIterator); - private: +private: bool is_inited_; ObMvccRow* value_; ObMvccTransNode* version_iter_; @@ -115,20 +115,20 @@ class ObMultiVersionValueIterator : public ObIMvccValueIterator { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObMultiVersionRowIterator { - public: +public: ObMultiVersionRowIterator(); ~ObMultiVersionRowIterator(); - public: +public: int init(ObQueryEngine& query_engine, const ObIMvccCtx& ctx, const transaction::ObTransSnapInfo& snapshot_info, const ObMvccScanRange& range, transaction::ObTransStateTableGuard& trans_table_guard); int get_next_row(const ObMemtableKey*& key, ObMultiVersionValueIterator*& value_iter); void reset(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultiVersionRowIterator); - private: +private: bool is_inited_; const ObIMvccCtx* ctx_; transaction::ObTransSnapInfo snapshot_info_; diff --git a/src/storage/memtable/mvcc/ob_mvcc_ctx.h b/src/storage/memtable/mvcc/ob_mvcc_ctx.h index c85c7ed4f..302b34607 100644 --- a/src/storage/memtable/mvcc/ob_mvcc_ctx.h +++ b/src/storage/memtable/mvcc/ob_mvcc_ctx.h @@ -29,7 +29,7 @@ class ObMemtableKey; class ObMvccRow; class ObIMvccCtx { - public: +public: ObIMvccCtx() : alloc_type_(0), ctx_descriptor_(0), @@ -59,7 +59,7 @@ class ObIMvccCtx { virtual ~ObIMvccCtx() {} - public: // for mvcc engine invoke +public: // for mvcc engine invoke // for write virtual int write_auth() = 0; virtual int write_done() = 0; @@ -111,7 +111,7 @@ class ObIMvccCtx { virtual void set_contain_hotspot_row() = 0; virtual void update_max_durable_sql_no(const int64_t sql_no) = 0; - public: +public: inline int get_alloc_type() const { return alloc_type_; @@ -330,7 +330,7 @@ class ObIMvccCtx { return 0 != abs_lock_wait_timeout_; } - public: +public: virtual void reset() { ctx_descriptor_ = 0; @@ -399,7 +399,7 @@ class ObIMvccCtx { return pos; } - public: +public: ObMvccRowCallback* alloc_row_callback( ObIMvccCtx& ctx, ObMvccRow& value, ObMemtable* memtable, const bool is_savepoint); ObMvccRowCallback* alloc_row_callback(ObMvccRowCallback& cb, ObMemtable* memtable, const bool is_savepoint); @@ -408,7 +408,7 @@ class ObIMvccCtx { ObMvccTransNode* alloc_trans_node(); int append_callback(ObITransCallback* cb); - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObIMvccCtx); int alloc_type_; uint32_t ctx_descriptor_; @@ -433,7 +433,7 @@ class ObIMvccCtx { }; class ObMvccWriteGuard { - public: +public: ObMvccWriteGuard() : ctx_(NULL) {} ~ObMvccWriteGuard() @@ -457,7 +457,7 @@ class ObMvccWriteGuard { return ret; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMvccWriteGuard); ObIMvccCtx* ctx_; }; diff --git a/src/storage/memtable/mvcc/ob_mvcc_engine.h b/src/storage/memtable/mvcc/ob_mvcc_engine.h index 5d7f00e5f..4d5cdf066 100644 --- a/src/storage/memtable/mvcc/ob_mvcc_engine.h +++ b/src/storage/memtable/mvcc/ob_mvcc_engine.h @@ -38,16 +38,16 @@ class ObMemtable; class ObMTKVBuilder; class ObMvccEngine { - public: +public: ObMvccEngine(); virtual ~ObMvccEngine(); - public: +public: virtual int init( common::ObIAllocator* allocator, ObMTKVBuilder* kv_builder, ObQueryEngine* query_engine, ObMemtable* memtable); virtual void destroy(); - public: +public: int get_max_trans_version(const ObMemtableKey* key, bool& locked, int64_t& max_trans_version); int create_kv(const ObMemtableKey* key, ObMemtableKey* stored_key, ObMvccRow*& value); int store_data(ObMvccRow& value, const ObMemtableData* data, const int64_t version, const int64_t timestamp); @@ -85,7 +85,7 @@ class ObMvccEngine { const bool is_replay, const bool need_fill_redo, const ObRowData* old_row, const int64_t version, const bool is_stmt_committed, const int32_t sql_no, const int64_t log_ts, const bool is_sequential_relocate); - private: +private: int m_prepare_kv(ObIMvccCtx& ctx, const ObMemtableKey* key, ObMemtableKey* stored_key, ObMvccRow*& value, const bool is_replay, const int32_t sql_no, bool& is_new_add); int m_store_data(ObIMvccCtx& ctx, const ObMemtableKey* key, ObMvccRow& value, const ObMemtableData* data, @@ -93,7 +93,7 @@ class ObMvccEngine { const int64_t version, const int32_t sql_no, const int64_t log_timestamp); int try_compact_row(ObIMvccCtx& ctx, const transaction::ObTransSnapInfo& snapshot_info, ObMvccRow& row); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMvccEngine); bool is_inited_; ObMTKVBuilder* kv_builder_; diff --git a/src/storage/memtable/mvcc/ob_mvcc_iterator.h b/src/storage/memtable/mvcc/ob_mvcc_iterator.h index 9c2b8e301..fcc4de30e 100644 --- a/src/storage/memtable/mvcc/ob_mvcc_iterator.h +++ b/src/storage/memtable/mvcc/ob_mvcc_iterator.h @@ -84,7 +84,7 @@ struct ObMvccScanRange { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObIMvccValueIterator { - public: +public: ObIMvccValueIterator() {} virtual ~ObIMvccValueIterator() @@ -96,11 +96,11 @@ class ObIMvccValueIterator { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObMvccValueIterator : public ObIMvccValueIterator { - public: +public: ObMvccValueIterator(); virtual ~ObMvccValueIterator(); - public: +public: int init(const ObIMvccCtx& ctx, const transaction::ObTransSnapInfo& snapshot_info, const ObMemtableKey* key, const ObMvccRow* value, const ObQueryFlag& query_flag, const bool skip_compact); bool is_exist(); @@ -118,7 +118,7 @@ class ObMvccValueIterator : public ObIMvccValueIterator { bool read_by_sql_no(const ObIMvccCtx& ctx, const transaction::ObTransSnapInfo& snapshot_info, ObMvccRow* value, const ObQueryFlag& query_flag); - private: +private: int find_start_pos(const int64_t read_snapshot); int find_trans_node_below_version(const int64_t read_snapshot, const bool is_safe_read); int check_trans_node_readable(const int64_t read_snapshot); @@ -127,13 +127,13 @@ class ObMvccValueIterator : public ObIMvccValueIterator { void move_to_next_node(); - private: +private: static const int64_t WAIT_COMMIT_US = 20 * 1000; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMvccValueIterator); - private: +private: bool is_inited_; const ObIMvccCtx* ctx_; const ObMvccRow* value_; @@ -145,11 +145,11 @@ class ObMvccValueIterator : public ObIMvccValueIterator { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObMvccRowIterator { - public: +public: ObMvccRowIterator(); virtual ~ObMvccRowIterator(); - public: +public: int init(ObQueryEngine& query_engine, const ObIMvccCtx& ctx, const transaction::ObTransSnapInfo& snapshot_info, const ObMvccScanRange& range, const ObQueryFlag& query_flag); int get_next_row( @@ -163,13 +163,13 @@ class ObMvccRowIterator { return query_engine_iter_ ? query_engine_iter_->get_iter_flag() : 0; } - private: +private: int check_and_purge_row_(const ObMemtableKey* key, ObMvccRow* row, bool& purged); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMvccRowIterator); - private: +private: bool is_inited_; const ObIMvccCtx* ctx_; transaction::ObTransSnapInfo snapshot_info_; diff --git a/src/storage/memtable/mvcc/ob_mvcc_row.h b/src/storage/memtable/mvcc/ob_mvcc_row.h index d619a8d94..3c3a96658 100644 --- a/src/storage/memtable/mvcc/ob_mvcc_row.h +++ b/src/storage/memtable/mvcc/ob_mvcc_row.h @@ -31,7 +31,7 @@ class ObMemtableKey; class ObMvccRowCallback; struct ObMvccTransNode { - public: +public: ObMvccTransNode() : trans_version_(0), log_timestamp_(INT64_MAX), @@ -138,7 +138,7 @@ struct ObMvccTransNode { int try_cleanout(const ObMvccRow* value); int is_running(bool& is_running); - private: +private: static const uint8_t F_INIT = 0x0; static const uint8_t F_WEAK_CONSISTENT_READ_BARRIER = 0x1; static const uint8_t F_STRONG_CONSISTENT_READ_BARRIER = 0x2; @@ -150,12 +150,12 @@ struct ObMvccTransNode { static const uint8_t F_DELAYED_CLEANOUT = 0x40; static const uint8_t F_RELOCATED = 0x80; - private: +private: void lock(); void unlock(); class TransNodeMutexGuard { - public: + public: TransNodeMutexGuard(ObMvccTransNode& node) : node_(node) { node_.lock(); @@ -166,7 +166,7 @@ struct ObMvccTransNode { } DISABLE_COPY_ASSIGN(TransNodeMutexGuard); - private: + private: ObMvccTransNode& node_; }; @@ -179,7 +179,7 @@ struct ObMvccTransNode { struct ObMvccRow { struct ObMvccRowIndex { - public: + public: ObMvccRowIndex() : is_empty_(true) { MEMSET(&replay_locations_, 0, sizeof(replay_locations_)); @@ -193,7 +193,7 @@ struct ObMvccRow { ObMvccTransNode* get_index_node(const int64_t index) const; void set_index_node(const int64_t index, ObMvccTransNode* node); - public: + public: bool is_empty_; ObMvccTransNode* replay_locations_[common::REPLAY_TASK_QUEUE_SIZE]; }; @@ -383,7 +383,7 @@ struct ObMvccRow { int64_t to_string(char* buf, const int64_t buf_len) const; int64_t to_string(char* buf, const int64_t buf_len, const bool verbose) const; - private: +private: int try_wait_row_lock_for_read(ObIMvccCtx& ctx, const ObMemtableKey* key) const; uint32_t get_writer_uid(); diff --git a/src/storage/memtable/mvcc/ob_mvcc_trans_ctx.h b/src/storage/memtable/mvcc/ob_mvcc_trans_ctx.h index 96a8673d4..7189b7c9b 100644 --- a/src/storage/memtable/mvcc/ob_mvcc_trans_ctx.h +++ b/src/storage/memtable/mvcc/ob_mvcc_trans_ctx.h @@ -93,7 +93,7 @@ struct RedoDataNode { class ObMemtableCtx; class ObMemtable; class ObITransCallback { - public: +public: ObITransCallback() : prev_(NULL), next_(NULL) {} virtual ~ObITransCallback() @@ -215,7 +215,7 @@ class ObITransCallback { VIRTUAL_TO_STRING_KV(KP(this), KP_(prev), KP_(next)); - private: +private: int insert(ObITransCallback* prev, ObITransCallback* next) { int ret = common::OB_SUCCESS; @@ -230,14 +230,14 @@ class ObITransCallback { return ret; } - private: +private: ObITransCallback* prev_; ObITransCallback* next_; }; class ObTransCallbackMgr; class ObTransCallbackList { - public: +public: ObTransCallbackList(ObTransCallbackMgr& callback_mgr) : callback_mgr_(callback_mgr) { reset(); @@ -324,10 +324,10 @@ class ObTransCallbackList { int calc_checksum_before_log_ts(const ObITransCallback* start, const ObITransCallback* end, const int64_t log_ts); int fetch_rollback_data_size(const ObITransCallback* start, const ObITransCallback* end, int64_t& rollback_size); - private: +private: const ObMemtable* get_first_memtable(); - private: +private: ObITransCallback head_; uint64_t length_; ObTransCallbackMgr& callback_mgr_; @@ -335,7 +335,7 @@ class ObTransCallbackList { }; class ObTransCallbackMgr { - public: +public: ObTransCallbackMgr(ObIMvccCtx& host) : host_(host), callback_list_(*this), @@ -501,10 +501,10 @@ class ObTransCallbackMgr { const ObMemtable* const frozen_memtable, const ObMemtable* const active_memtable, bool& marked, int64_t& cb_cnt); int get_cur_max_sql_no(int64_t& sql_no); - private: +private: void release_rowlocks(); - public: +public: bool is_rowlocks_released() const; int calc_checksum_before_log_ts(const int64_t log_ts); int fetch_rollback_data_size(const ObITransCallback* point, int64_t& rollback_size); @@ -531,7 +531,7 @@ class ObTransCallbackMgr { int rollback_pending_log_size_(const bool need_write_log, const ObITransCallback* const end); void truncate_to_(ObITransCallback* end, const bool change_sub_trans_end); - private: +private: ObITransCallback* guard() { return callback_list_.get_guard(); @@ -545,7 +545,7 @@ class ObTransCallbackMgr { return callback_list_.lifo_callback(callback_list_.get_guard(), end, type, for_replay_); } - private: +private: ObIMvccCtx& host_; ObTransCallbackList callback_list_; ObITransCallback* sub_trans_begin_; @@ -562,7 +562,7 @@ class ObTransCallbackMgr { // class ObIMvccCtx; class ObMvccRowCallback : public ObITransCallback { - public: +public: ObMvccRowCallback(ObIMvccCtx& ctx, ObMvccRow& value, ObMemtable* memtable) : ctx_(ctx), value_(value), @@ -639,34 +639,91 @@ class ObMvccRowCallback : public ObITransCallback { } } - int callback(const int type, const bool for_replay, const bool need_lock_for_write, ObMemtable *memtable = NULL) override; - int callback(transaction::ObMemtableKeyArray &memtable_key_arr, ObMemtable *memtable) override; - bool on_memtable(const ObMemtable * const memtable) override { return memtable == memtable_; } - ObMemtable *get_memtable() const override { return memtable_; }; - int get_redo(RedoDataNode &node); - ObIMvccCtx &get_ctx() const { return ctx_; } - const ObRowData &get_old_row() const { return old_row_; } - const ObMvccRow &get_mvcc_row() const { return value_; } - ObMvccTransNode *get_trans_node() { return tnode_; } - const ObMvccTransNode *get_trans_node() const { return tnode_; } - const ObMemtableKey *get_key() { return &key_; } - int get_memtable_key(uint64_t &table_id, common::ObStoreRowkey &rowkey) const; + int callback( + const int type, const bool for_replay, const bool need_lock_for_write, ObMemtable* memtable = NULL) override; + int callback(transaction::ObMemtableKeyArray& memtable_key_arr, ObMemtable* memtable) override; + bool on_memtable(const ObMemtable* const memtable) override + { + return memtable == memtable_; + } + ObMemtable* get_memtable() const override + { + return memtable_; + }; + int get_redo(RedoDataNode& node); + ObIMvccCtx& get_ctx() const + { + return ctx_; + } + const ObRowData& get_old_row() const + { + return old_row_; + } + const ObMvccRow& get_mvcc_row() const + { + return value_; + } + ObMvccTransNode* get_trans_node() + { + return tnode_; + } + const ObMvccTransNode* get_trans_node() const + { + return tnode_; + } + const ObMemtableKey* get_key() + { + return &key_; + } + int get_memtable_key(uint64_t& table_id, common::ObStoreRowkey& rowkey) const; uint32_t get_ctx_descriptor() const; - void set_stmt_committed(const bool stmt_committed) { stmt_committed_ = stmt_committed; } - bool is_stmt_committed() const { return stmt_committed_; } - void set_savepoint() { is_savepoint_ = true; } - bool is_savepoint() const override { return is_savepoint_; } - bool need_fill_redo() const { return need_fill_redo_; } - int32_t get_sql_no() const override { return sql_no_; } - int get_trans_id(transaction::ObTransID &trans_id) const; - transaction::ObTransCtx *get_trans_ctx() const; - int64_t to_string(char *buf, const int64_t buf_len) const override; - int64_t get_log_ts() const { return log_ts_; } - void set_log_ts(const int64_t log_ts) { if (INT64_MAX == log_ts_) { log_ts_ = log_ts; } } - bool log_synced() const override { return INT64_MAX != log_ts_; } - int64_t get_data_size() override { return data_size_; } + void set_stmt_committed(const bool stmt_committed) + { + stmt_committed_ = stmt_committed; + } + bool is_stmt_committed() const + { + return stmt_committed_; + } + void set_savepoint() + { + is_savepoint_ = true; + } + bool is_savepoint() const override + { + return is_savepoint_; + } + bool need_fill_redo() const + { + return need_fill_redo_; + } + int32_t get_sql_no() const override + { + return sql_no_; + } + int get_trans_id(transaction::ObTransID& trans_id) const; + transaction::ObTransCtx* get_trans_ctx() const; + int64_t to_string(char* buf, const int64_t buf_len) const override; + int64_t get_log_ts() const + { + return log_ts_; + } + void set_log_ts(const int64_t log_ts) + { + if (INT64_MAX == log_ts_) { + log_ts_ = log_ts; + } + } + bool log_synced() const override + { + return INT64_MAX != log_ts_; + } + int64_t get_data_size() override + { + return data_size_; + } virtual int del() override; - int check_sequential_relocate(const ObMemtable *memtable, bool &is_sequential_relocate) const; + int check_sequential_relocate(const ObMemtable* memtable, bool& is_sequential_relocate) const; virtual bool mark_for_logging() override { if (marked_for_logging_) { @@ -685,7 +742,7 @@ class ObMvccRowCallback : public ObITransCallback { virtual int fetch_rollback_data_size(int64_t& rollback_size) override; virtual int print_callback() override; - private: +private: int row_unlock(); int row_unlock_v2(); int trans_commit(const bool for_replay); @@ -711,7 +768,7 @@ class ObMvccRowCallback : public ObITransCallback { int dec_pending_cb_count(); void mark_tnode_overflow(const int64_t log_ts); - private: +private: ObIMvccCtx& ctx_; ObMemtableKey key_; ObMvccRow& value_; diff --git a/src/storage/memtable/mvcc/ob_query_engine.h b/src/storage/memtable/mvcc/ob_query_engine.h index 3bc18531c..2aa3f5497 100644 --- a/src/storage/memtable/mvcc/ob_query_engine.h +++ b/src/storage/memtable/mvcc/ob_query_engine.h @@ -28,13 +28,13 @@ namespace memtable { class ObMvccRow; class ObIQueryEngineIterator { - public: +public: ObIQueryEngineIterator() {} virtual ~ObIQueryEngineIterator() {} - public: +public: virtual int next(const bool skip_purge_memtable) = 0; virtual int next_internal(const bool skip_purge_memtable) = 0; virtual const ObMemtableKey* get_key() const = 0; @@ -46,20 +46,20 @@ class ObIQueryEngineIterator { }; class ObQueryEngine { - public: +public: enum { INIT_TABLE_INDEX_COUNT = (1 << 10), MAX_SAMPLE_ROW_COUNT = 500 }; typedef keybtree::ObKeyBtree KeyBtree; typedef ObMtHash KeyHash; template class Iterator : public ObIQueryEngineIterator { - public: + public: Iterator() : value_(NULL), iter_flag_(0), version_(0) {} ~Iterator() {} - public: + public: void set_version(int64_t version) { version_ = version; @@ -126,7 +126,7 @@ class ObQueryEngine { return iter_flag_; } - private: + private: DISALLOW_COPY_AND_ASSIGN(Iterator); BtreeScanHandle btree_iter_; ObMemtableKey key_; @@ -137,7 +137,7 @@ class ObQueryEngine { template class IteratorAlloc { - public: + public: IteratorAlloc() {} ~IteratorAlloc() @@ -151,12 +151,12 @@ class ObQueryEngine { op_reclaim_free(iter); } - private: + private: DISALLOW_COPY_AND_ASSIGN(IteratorAlloc); }; class TableIndexNode { - public: + public: explicit TableIndexNode(keybtree::BtreeNodeAllocator& btree_allocator, common::ObIAllocator& memstore_allocator, const uint64_t table_id, int64_t obj_cnt) : is_inited_(false), @@ -189,7 +189,7 @@ class ObQueryEngine { return obj_cnt_; } - private: + private: DISALLOW_COPY_AND_ASSIGN(TableIndexNode); bool is_inited_; KeyBtree keybtree_; @@ -199,7 +199,7 @@ class ObQueryEngine { }; class TableIndex { - public: + public: explicit TableIndex(keybtree::BtreeNodeAllocator& btree_allocator, common::ObIAllocator& memstore_allocator) : base_(nullptr), is_inited_(false), @@ -248,7 +248,7 @@ class ObQueryEngine { int set(const uint64_t table_id, const int64_t obj_cnt, TableIndexNode*& return_ptr); int get_active_table_ids(common::ObIArray& table_ids); - private: + private: DISALLOW_COPY_AND_ASSIGN(TableIndex); static TableIndexNode* const PLACE_HOLDER; TableIndexNode** base_; @@ -258,7 +258,7 @@ class ObQueryEngine { ObIAllocator& memstore_allocator_; }; - public: +public: enum { ESTIMATE_CHILD_COUNT_THRESHOLD = 1024, MAX_RANGE_SPLIT_COUNT = 1024 }; explicit ObQueryEngine(ObIAllocator& memstore_allocator) : is_inited_(false), @@ -326,14 +326,14 @@ class ObQueryEngine { int expand_index(TableIndex* old_index); int get_active_table_ids(common::ObIArray& table_ids); - private: +private: int sample_rows(Iterator* iter, const ObMemtableKey* start_key, const int start_exclude, const ObMemtableKey* end_key, const int end_exclude, int64_t& logical_row_count, int64_t& physical_row_count, double& ratio); int init_raw_iter_for_estimate( Iterator*& iter, const ObMemtableKey* start_key, const ObMemtableKey* end_key); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObQueryEngine); bool is_inited_; bool is_expanding_; diff --git a/src/storage/memtable/mvcc/ob_row_lock.h b/src/storage/memtable/mvcc/ob_row_lock.h index f3669b7e2..f6fa26320 100644 --- a/src/storage/memtable/mvcc/ob_row_lock.h +++ b/src/storage/memtable/mvcc/ob_row_lock.h @@ -23,10 +23,10 @@ class ObMemtableKey; class ObMvccRow; class ObRowLock { - public: +public: friend class ObMvccRow; - public: +public: explicit ObRowLock(ObMvccRow& row) : row_(row) {} ~ObRowLock() @@ -71,7 +71,7 @@ class ObRowLock { } void after_unlock(const ObMemtableKey* key); - private: +private: bool is_locked_() { return latch_.is_locked(); @@ -97,7 +97,7 @@ class ObRowLock { return latch_.wrlock(common::ObLatchIds::ROW_LOCK, abs_timeout, &uid); } - private: +private: common::ObLatch latch_; ObMvccRow& row_; }; diff --git a/src/storage/memtable/ob_lock_wait_mgr.h b/src/storage/memtable/ob_lock_wait_mgr.h index 53d43c082..a97143cfd 100644 --- a/src/storage/memtable/ob_lock_wait_mgr.h +++ b/src/storage/memtable/ob_lock_wait_mgr.h @@ -32,17 +32,17 @@ class ObAllVirtualLockWaitStat; namespace memtable { class ObLockWaitMgr : public share::ObThreadPool { - public: +public: friend class ObDeadLockChecker; friend class observer::ObAllVirtualLockWaitStat; - public: +public: enum { LOCK_BUCKET_COUNT = 65536 }; typedef ObMemtableKey Key; typedef rpc::ObLockWaitNode Node; typedef FixedHash2 Hash; - public: +public: ObLockWaitMgr(); ~ObLockWaitMgr(); @@ -85,7 +85,7 @@ class ObLockWaitMgr : public share::ObThreadPool { // wakeup the request waiting on the transaction void wakeup(const uint32_t ctx_desc); - protected: +protected: // obtain the request waiting on the row or transaction Node* fetch_waiter(uint64_t hash); // check whether there exits requests already timeout or need be @@ -96,14 +96,14 @@ class ObLockWaitMgr : public share::ObThreadPool { // wakeup the request and put into the thread worker queue virtual int repost(Node* node); - private: +private: int64_t get_wait_lock_timeout(int64_t timeout); bool wait(Node* node); Node* next(Node*& iter, Node* target); Node* get(uint64_t hash); void wakeup(uint64_t hash); - private: +private: Node*& get_thread_node() { static __thread Node* node = NULL; @@ -148,16 +148,16 @@ class ObLockWaitMgr : public share::ObThreadPool { return ATOMIC_LOAD(&sequence_[(hash >> 1) % LOCK_BUCKET_COUNT]); } - private: +private: bool is_inited_; Hash hash_; int64_t sequence_[LOCK_BUCKET_COUNT]; char hash_buf_[sizeof(SpHashNode) * LOCK_BUCKET_COUNT]; - public: +public: int fullfill_row_key(uint64_t hash, char* row_key, int64_t length); - private: +private: memtable::MemtableIDMap* mt_id_map_; }; diff --git a/src/storage/memtable/ob_memtable.cpp b/src/storage/memtable/ob_memtable.cpp index 285079e56..cc0f538aa 100644 --- a/src/storage/memtable/ob_memtable.cpp +++ b/src/storage/memtable/ob_memtable.cpp @@ -43,7 +43,7 @@ using namespace storage; using namespace transaction; namespace memtable { class ObStoreRowWrapper : public ObStoreRow, public ObWithArena { - public: +public: static const int64_t PAGE_SIZE = OB_MALLOC_NORMAL_BLOCK_SIZE; explicit ObStoreRowWrapper(ObIAllocator& allocator) : ObStoreRow(), ObWithArena(allocator, PAGE_SIZE), allocator_(allocator) @@ -58,13 +58,13 @@ class ObStoreRowWrapper : public ObStoreRow, public ObWithArena { return allocator_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStoreRowWrapper); ObIAllocator& allocator_; }; class ObGlobalMtAlloc { - public: +public: ObGlobalMtAlloc() { int ret = OB_SUCCESS; @@ -84,7 +84,7 @@ class ObGlobalMtAlloc { ptr = NULL; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGlobalMtAlloc); ObLfFIFOAllocator allocator_; }; diff --git a/src/storage/memtable/ob_memtable.h b/src/storage/memtable/ob_memtable.h index f45a0892e..583ec99b2 100644 --- a/src/storage/memtable/ob_memtable.h +++ b/src/storage/memtable/ob_memtable.h @@ -50,13 +50,13 @@ struct ObMtStat { }; class ObMTKVBuilder { - public: +public: ObMTKVBuilder() {} virtual ~ObMTKVBuilder() {} - public: +public: int dup_key(ObStoreRowkey*& new_key, common::ObIAllocator& alloc, const ObStoreRowkey* key) { int ret = OB_SUCCESS; @@ -114,12 +114,12 @@ class ObMTKVBuilder { return ret; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMTKVBuilder); }; class ObMemtableState { - public: +public: static const int64_t INVALID = -1; static const int64_t ACTIVE = 0; static const int64_t MAJOR_FROZEN = 1; @@ -127,7 +127,7 @@ class ObMemtableState { static const int64_t MAJOR_MERGING = 3; static const int64_t MINOR_MERGING = 4; - public: +public: bool is_valid(const int64_t state) { return state >= ACTIVE && state <= MINOR_MERGING; @@ -135,133 +135,79 @@ class ObMemtableState { }; class ObMemtable : public ObIMemtable { - public: +public: typedef common::ObGMemstoreAllocator::AllocHandle ObMemstoreAllocator; ObMemtable(); virtual ~ObMemtable(); + public: - virtual int init(const ObITable::TableKey &table_key); + virtual int init(const ObITable::TableKey& table_key); virtual void destroy() override; - int fake(const ObIMemtable &mt) override; + int fake(const ObIMemtable& mt) override; + public: - int dump2text(const char *fname); - virtual int set( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const int64_t rowkey_len, - const common::ObIArray &columns, - storage::ObStoreRowIterator &row_iter) override; - virtual int set( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const int64_t rowkey_len, - const common::ObIArray &columns, - const storage::ObStoreRow &row) override; - virtual int set( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const int64_t rowkey_len, - const common::ObIArray &columns, - const ObIArray &update_idx, - const storage::ObStoreRow &old_row, - const storage::ObStoreRow &new_row); - virtual int lock( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const common::ObIArray &columns, - common::ObNewRowIterator &row_iter) override; - virtual int lock( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const common::ObIArray &columns, - const common::ObNewRow &row) override; - virtual int lock( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const common::ObIArray &columns, - const common::ObStoreRowkey &rowkey) override; + int dump2text(const char* fname); + virtual int set(const storage::ObStoreCtx& ctx, const uint64_t table_id, const int64_t rowkey_len, + const common::ObIArray& columns, storage::ObStoreRowIterator& row_iter) override; + virtual int set(const storage::ObStoreCtx& ctx, const uint64_t table_id, const int64_t rowkey_len, + const common::ObIArray& columns, const storage::ObStoreRow& row) override; + virtual int set(const storage::ObStoreCtx& ctx, const uint64_t table_id, const int64_t rowkey_len, + const common::ObIArray& columns, const ObIArray& update_idx, + const storage::ObStoreRow& old_row, const storage::ObStoreRow& new_row); + virtual int lock(const storage::ObStoreCtx& ctx, const uint64_t table_id, + const common::ObIArray& columns, common::ObNewRowIterator& row_iter) override; + virtual int lock(const storage::ObStoreCtx& ctx, const uint64_t table_id, + const common::ObIArray& columns, const common::ObNewRow& row) override; + virtual int lock(const storage::ObStoreCtx& ctx, const uint64_t table_id, + const common::ObIArray& columns, const common::ObStoreRowkey& rowkey) override; virtual int64_t get_upper_trans_version() const override; - int check_row_locked_by_myself( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const common::ObIArray &columns, - const common::ObStoreRowkey &rowkey, - bool &locked); + int check_row_locked_by_myself(const storage::ObStoreCtx& ctx, const uint64_t table_id, + const common::ObIArray& columns, const common::ObStoreRowkey& rowkey, bool& locked); + public: - int estimate_phy_size(const uint64_t table_id, const common::ObStoreRowkey* start_key, const common::ObStoreRowkey* end_key, int64_t& total_bytes, int64_t& total_rows); - int get_split_ranges(const uint64_t table_id, const common::ObStoreRowkey* start_key, const common::ObStoreRowkey* end_key, const int64_t part_cnt, common::ObIArray &range_array); - virtual int exist( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const common::ObStoreRowkey &rowkey, - const common::ObIArray &column_ids, - bool &is_exist, - bool &has_found) override; - virtual int prefix_exist( - storage::ObRowsInfo &rows_info, - bool &may_exist) override; - virtual int exist( - storage::ObRowsInfo &rows_info, - bool &is_exist, - bool &all_rows_found) override; - virtual int get( - const storage::ObTableIterParam ¶m, - storage::ObTableAccessContext &context, - const common::ObExtStoreRowkey &rowkey, - storage::ObStoreRow &row) override; - virtual int get( - const storage::ObTableIterParam ¶m, - storage::ObTableAccessContext &context, - const common::ObExtStoreRowkey &rowkey, - storage::ObStoreRowIterator *&row_iter) override; - virtual int scan( - const storage::ObTableIterParam ¶m, - storage::ObTableAccessContext &context, - const common::ObExtStoreRange &range, - storage::ObStoreRowIterator *&row_iter) override; - virtual int multi_get( - const storage::ObTableIterParam ¶m, - storage::ObTableAccessContext &context, - const common::ObIArray &rowkeys, - storage::ObStoreRowIterator *&row_iter) override; - virtual int multi_scan( - const storage::ObTableIterParam ¶m, - storage::ObTableAccessContext &context, - const common::ObIArray &ranges, - storage::ObStoreRowIterator *&row_iter) override; - virtual int get_row_header( - const storage::ObStoreCtx &ctx, - const uint64_t table_id, - const common::ObStoreRowkey &rowkey, - const common::ObIArray &column_ids, - uint32_t &modify_count, - uint32_t &acc_checksum); - virtual int replay( - const storage::ObStoreCtx &ctx, - const char *data, - const int64_t data_len); - virtual int replay_schema_version_change_log( - const int64_t schema_version); + int estimate_phy_size(const uint64_t table_id, const common::ObStoreRowkey* start_key, + const common::ObStoreRowkey* end_key, int64_t& total_bytes, int64_t& total_rows); + int get_split_ranges(const uint64_t table_id, const common::ObStoreRowkey* start_key, + const common::ObStoreRowkey* end_key, const int64_t part_cnt, + common::ObIArray& range_array); + virtual int exist(const storage::ObStoreCtx& ctx, const uint64_t table_id, const common::ObStoreRowkey& rowkey, + const common::ObIArray& column_ids, bool& is_exist, bool& has_found) override; + virtual int prefix_exist(storage::ObRowsInfo& rows_info, bool& may_exist) override; + virtual int exist(storage::ObRowsInfo& rows_info, bool& is_exist, bool& all_rows_found) override; + virtual int get(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, + const common::ObExtStoreRowkey& rowkey, storage::ObStoreRow& row) override; + virtual int get(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, + const common::ObExtStoreRowkey& rowkey, storage::ObStoreRowIterator*& row_iter) override; + virtual int scan(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, + const common::ObExtStoreRange& range, storage::ObStoreRowIterator*& row_iter) override; + virtual int multi_get(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, + const common::ObIArray& rowkeys, storage::ObStoreRowIterator*& row_iter) override; + virtual int multi_scan(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, + const common::ObIArray& ranges, storage::ObStoreRowIterator*& row_iter) override; + virtual int get_row_header(const storage::ObStoreCtx& ctx, const uint64_t table_id, + const common::ObStoreRowkey& rowkey, const common::ObIArray& column_ids, + uint32_t& modify_count, uint32_t& acc_checksum); + virtual int replay(const storage::ObStoreCtx& ctx, const char* data, const int64_t data_len); + virtual int replay_schema_version_change_log(const int64_t schema_version); - ObQueryEngine &get_query_engine() { return query_engine_; } - ObMvccEngine &get_mvcc_engine() { return mvcc_engine_; } + ObQueryEngine& get_query_engine() + { + return query_engine_; + } + ObMvccEngine& get_mvcc_engine() + { + return mvcc_engine_; + } - virtual int estimate_get_row_count(const common::ObQueryFlag query_flag, - const uint64_t table_id, - const common::ObIArray &rowkeys, - storage::ObPartitionEst &part_est) override; + virtual int estimate_get_row_count(const common::ObQueryFlag query_flag, const uint64_t table_id, + const common::ObIArray& rowkeys, storage::ObPartitionEst& part_est) override; - virtual int estimate_scan_row_count(const common::ObQueryFlag query_flag, - const uint64_t table_id, - const common::ObExtStoreRange &key_range, - storage::ObPartitionEst &part_est) override; - virtual int estimate_multi_scan_row_count( - const common::ObQueryFlag query_flag, - const uint64_t table_id, - const common::ObIArray &ranges, - storage::ObPartitionEst &part_est) override; - virtual int save_base_storage_info(const storage::ObSavedStorageInfoV2 &info); - virtual int get_base_storage_info(storage::ObSavedStorageInfoV2 &info); + virtual int estimate_scan_row_count(const common::ObQueryFlag query_flag, const uint64_t table_id, + const common::ObExtStoreRange& key_range, storage::ObPartitionEst& part_est) override; + virtual int estimate_multi_scan_row_count(const common::ObQueryFlag query_flag, const uint64_t table_id, + const common::ObIArray& ranges, storage::ObPartitionEst& part_est) override; + virtual int save_base_storage_info(const storage::ObSavedStorageInfoV2& info); + virtual int get_base_storage_info(storage::ObSavedStorageInfoV2& info); int set_emergency(const bool emergency); virtual int minor_freeze(const bool emergency = false); ObMtStat& get_mt_stat() @@ -310,7 +256,10 @@ public: virtual int get_frozen_schema_version(int64_t& schema_version) const override; virtual bool is_frozen_memtable() const override; virtual bool is_active_memtable() const override; - virtual bool is_inner_table() const { return common::is_inner_table(key_.table_id_); } + virtual bool is_inner_table() const + { + return common::is_inner_table(key_.table_id_); + } int set_snapshot_version(const int64_t snapshot_version); int set_base_version(const int64_t base_version); int set_start_log_ts(const int64_t start_ts); @@ -406,7 +355,7 @@ public: } int get_active_table_ids(common::ObIArray& table_ids); - public: +public: // Print stat data in log. // For memtable debug. int print_stat() const; @@ -415,7 +364,7 @@ public: K_(frozen_log_applied), K_(mark_finish), K_(pending_cb_cnt), K_(pending_lob_cnt), K_(pending_batch_commit_cnt), K_(pending_elr_cnt)); - private: +private: static const int64_t OB_EMPTY_MEMSTORE_MAX_SIZE = 10L << 20; // 10MB int set_(const storage::ObStoreCtx& ctx, const uint64_t table_id, const int64_t rowkey_len, const common::ObIArray& columns, const storage::ObStoreRow& new_row, @@ -460,7 +409,7 @@ public: int check_standby_cluster_schema_condition_( const storage::ObStoreCtx& ctx, const int64_t table_id, const int64_t table_version); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemtable); bool is_inited_; ObMemstoreAllocator local_allocator_; @@ -504,26 +453,26 @@ typedef ObMemtable ObMemStore; * For debug use. */ class ObMemtableStat { - public: +public: ObMemtableStat(); virtual ~ObMemtableStat(); static ObMemtableStat& get_instance(); - public: +public: int register_memtable(ObMemtable* memtable); int unregister_memtable(ObMemtable* memtable); - public: +public: int print_stat(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemtableStat); ObSpinLock lock_; ObArray memtables_; }; class RowHeaderGetter { - public: +public: RowHeaderGetter() : ctx_(NULL), table_id_(common::OB_INVALID_ID), rowkey_(NULL), columns_(NULL), modify_count_(0), acc_checksum_(0) {} @@ -539,13 +488,13 @@ class RowHeaderGetter { } int get(); - private: +private: storage::ObStoreCtx* ctx_; uint64_t table_id_; common::ObStoreRowkey* rowkey_; common::ObIArray* columns_; - private: +private: uint32_t modify_count_; uint32_t acc_checksum_; }; diff --git a/src/storage/memtable/ob_memtable_array.h b/src/storage/memtable/ob_memtable_array.h index d7269149e..90e23a90c 100644 --- a/src/storage/memtable/ob_memtable_array.h +++ b/src/storage/memtable/ob_memtable_array.h @@ -20,11 +20,11 @@ namespace memtable { class ObMemtable; // wrap memtable array interface class ObMemtableArrWrap { - public: +public: ObMemtableArrWrap(); ~ObMemtableArrWrap(); - public: +public: void reset(); int inc_active_trx_count_at_active_mt(ObMemtable*& active_memtable); int dec_active_trx_count_at_active_mt(); @@ -45,7 +45,7 @@ class ObMemtableArrWrap { bool is_contain_this_memtable(ObMemtable* memtable); int check_memtable_count(int64_t& count); - private: +private: int64_t get_count_() const { return mt_end_ - mt_start_; @@ -53,7 +53,7 @@ class ObMemtableArrWrap { int update_max_trans_version_(const int64_t pos, const int64_t trans_version); int update_max_schema_version_(const int64_t pos, const int64_t schema_version); - private: +private: ObMemtable* mt_[common::MAX_MEMSTORE_CNT_IN_STORAGE]; int64_t mt_start_; int64_t mt_end_; diff --git a/src/storage/memtable/ob_memtable_compact_writer.h b/src/storage/memtable/ob_memtable_compact_writer.h index ab004c66b..281fd1a03 100644 --- a/src/storage/memtable/ob_memtable_compact_writer.h +++ b/src/storage/memtable/ob_memtable_compact_writer.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace memtable { class ObMemtableCompactWriter : public common::ObCellWriter { - public: +public: static const int64_t RP_LOCAL_NUM = 0; static const int64_t RP_TOTAL_NUM = 128; static const int64_t SMALL_BUFFER_SIZE = @@ -28,11 +28,11 @@ class ObMemtableCompactWriter : public common::ObCellWriter { static const int64_t NORMAL_BUFFER_SIZE = common::OB_MAX_LOG_BUFFER_SIZE; static const int64_t BIG_ROW_BUFFER_SIZE = common::OB_MAX_ROW_LENGTH_IN_MEMTABLE; - public: +public: ObMemtableCompactWriter(); ~ObMemtableCompactWriter(); - public: +public: int init(); void reset(); void set_dense() @@ -50,10 +50,10 @@ class ObMemtableCompactWriter : public common::ObCellWriter { return false; } - private: +private: int extend_buf(); - private: +private: char buf_[SMALL_BUFFER_SIZE]; char* buffer_; int64_t buf_size_; diff --git a/src/storage/memtable/ob_memtable_context.h b/src/storage/memtable/ob_memtable_context.h index 41d2f892c..c04a5878d 100644 --- a/src/storage/memtable/ob_memtable_context.h +++ b/src/storage/memtable/ob_memtable_context.h @@ -34,7 +34,7 @@ class ObThreadLocalTransCtx; namespace memtable { class MemtableCtxStat { - public: +public: MemtableCtxStat() : wlock_retry_(0), tsc_retry_(0) {} ~MemtableCtxStat() @@ -61,7 +61,7 @@ class MemtableCtxStat { return ATOMIC_LOAD(&tsc_retry_); } - private: +private: int32_t wlock_retry_; int32_t tsc_retry_; }; @@ -71,7 +71,7 @@ class MemtableCtxStat { // BIG_ROW_MID OR BIG_ROW_END // 2. For a normal row, the flag is NORMAL_ROW class ObTransRowFlag { - public: +public: static const uint8_t NORMAL_ROW = 0; static const uint8_t BIG_ROW_START = 1; static const uint8_t BIG_ROW_MID = 2; @@ -79,7 +79,7 @@ class ObTransRowFlag { static const uint8_t MAX = 4; static const uint8_t ENCRYPT = (1 << 3); - public: +public: static bool is_valid_row_flag(const uint8_t row_flag) { const uint8_t real_flag = row_flag & (~ENCRYPT); @@ -125,7 +125,7 @@ class ObTransRowFlag { }; class ObQueryAllocator : public common::ObIAllocator { - public: +public: explicit ObQueryAllocator() : alloc_count_(0), free_count_(0), alloc_size_(0), is_inited_(false) {} ~ObQueryAllocator() @@ -189,7 +189,7 @@ class ObQueryAllocator : public common::ObIAllocator { } } - private: +private: ObFIFOAllocator allocator_; int64_t alloc_count_; int64_t free_count_; @@ -200,7 +200,7 @@ class ObQueryAllocator : public common::ObIAllocator { // The speciaal allocator for ObMemtableCtx, used to allocate callback. // The page size is 8K, support concurrency, but at a poor performance. class ObMemtableCtxCbAllocator : public common::ObIAllocator { - public: +public: explicit ObMemtableCtxCbAllocator() : alloc_count_(0), free_count_(0), alloc_size_(0), is_inited_(false) {} ~ObMemtableCtxCbAllocator() @@ -265,7 +265,7 @@ class ObMemtableCtxCbAllocator : public common::ObIAllocator { } } - private: +private: ObFIFOAllocator allocator_; int64_t alloc_count_; int64_t free_count_; @@ -280,68 +280,57 @@ class ObMemtableCtx : public ObIMemtableCtx { static const int64_t SLOW_QUERY_THRESHOULD = 500 * 1000; static const int64_t LOG_CONFLICT_INTERVAL = 3 * 1000 * 1000; - public: +public: static uint32_t UID_FOR_PURGE; - public: +public: ObMemtableCtx(); ObMemtableCtx(MemtableIDMap& ctx_map, common::ObIAllocator& allocator); virtual ~ObMemtableCtx(); virtual void reset() override; + public: - int init(const uint64_t tenant_id, MemtableIDMap &ctx_map,common::ObIAllocator &malloc_allocator); - virtual int add_crc(const void *key, - ObMvccRow *value, - ObMvccTransNode *tnode, - const int64_t data_size) override; - virtual int add_crc2(ObMvccRow *value, - ObMvccTransNode *tnode, - int64_t data_size) override; - virtual int add_crc4(ObMvccRow *value, - ObMvccTransNode *tnode, - int64_t data_size, - const int64_t log_ts) override; - virtual void *callback_alloc(const int64_t size) override; - virtual void callback_free(void *cb) override; - virtual void *arena_alloc(const int64_t size) override; - virtual common::ObIAllocator &get_query_allocator() override; + int init(const uint64_t tenant_id, MemtableIDMap& ctx_map, common::ObIAllocator& malloc_allocator); + virtual int add_crc(const void* key, ObMvccRow* value, ObMvccTransNode* tnode, const int64_t data_size) override; + virtual int add_crc2(ObMvccRow* value, ObMvccTransNode* tnode, int64_t data_size) override; + virtual int add_crc4(ObMvccRow* value, ObMvccTransNode* tnode, int64_t data_size, const int64_t log_ts) override; + virtual void* callback_alloc(const int64_t size) override; + virtual void callback_free(void* cb) override; + virtual void* arena_alloc(const int64_t size) override; + virtual common::ObIAllocator& get_query_allocator() override; virtual int wait_trans_version(const uint32_t descriptor, const int64_t version) override; - virtual int wait_trans_version_v2(const uint32_t descriptor, const int64_t version, - const ObMemtableKey* key, const ObMvccRow &row) override; - virtual int try_elr_when_lock_for_write(const uint32_t descriptor, - const int64_t version, - const ObMemtableKey* key, - const ObMvccRow &row) override; + virtual int wait_trans_version_v2( + const uint32_t descriptor, const int64_t version, const ObMemtableKey* key, const ObMvccRow& row) override; + virtual int try_elr_when_lock_for_write( + const uint32_t descriptor, const int64_t version, const ObMemtableKey* key, const ObMvccRow& row) override; virtual void inc_lock_for_read_retry_count() override; - virtual int row_compact(ObMvccRow *value, const int64_t snapshot_version) override; - virtual const char *log_conflict_ctx(const uint32_t descriptor) override; + virtual int row_compact(ObMvccRow* value, const int64_t snapshot_version) override; + virtual const char* log_conflict_ctx(const uint32_t descriptor) override; virtual int read_lock_yield() override; virtual int write_lock_yield() override; - virtual int after_link_trans_node(const void *key, ObMvccRow *value) override; + virtual int after_link_trans_node(const void* key, ObMvccRow* value) override; virtual bool has_redo_log() const override; virtual void update_max_durable_sql_no(const int64_t sql_no) override; + public: - int set_replay_host(ObMemtable *host, const bool for_replay); - int set_leader_host(ObMemtable *host, const bool for_replay); - int check_memstore_count(int64_t &count); + int set_replay_host(ObMemtable* host, const bool for_replay); + int set_leader_host(ObMemtable* host, const bool for_replay); + int check_memstore_count(int64_t& count); virtual void set_read_only() override; virtual void inc_ref() override; virtual void dec_ref() override; virtual int write_auth() override; virtual int write_done() override; virtual int trans_begin() override; - virtual int sub_trans_begin(const int64_t snapshot, - const int64_t abs_expired_time, - const bool is_safe_snapshot=false, - const int64_t trx_lock_timeout = -1) override; + virtual int sub_trans_begin(const int64_t snapshot, const int64_t abs_expired_time, + const bool is_safe_snapshot = false, const int64_t trx_lock_timeout = -1) override; virtual int sub_trans_end(const bool commit) override; virtual int sub_stmt_begin() override; virtual int sub_stmt_end(const bool commit) override; - virtual int fast_select_trans_begin(const int64_t snapshot, - const int64_t abs_expired_time, - const int64_t trx_lock_timeout) override; + virtual int fast_select_trans_begin( + const int64_t snapshot, const int64_t abs_expired_time, const int64_t trx_lock_timeout) override; virtual uint64_t calc_checksum(const int64_t trans_version) override; virtual uint64_t calc_checksum2(const int64_t trans_version) override; virtual uint64_t calc_checksum3(); @@ -355,16 +344,15 @@ public: virtual int fake_kill(); virtual int trans_publish() override; virtual int trans_replay_begin() override; - virtual int trans_replay_end(const bool commit, const int64_t trans_version, - const uint64_t checksum = 0) override; - //method called when leader takeover + virtual int trans_replay_end(const bool commit, const int64_t trans_version, const uint64_t checksum = 0) override; + // method called when leader takeover virtual int replay_to_commit() override; - //method called when leader revoke + // method called when leader revoke virtual int commit_to_replay() override; virtual int trans_link(); virtual int get_trans_status() const override; - virtual int fill_redo_log(char *buf, const int64_t buf_len, int64_t &buf_pos) override; - virtual int undo_fill_redo_log() override; // undo the function fill_redo_log(..) + virtual int fill_redo_log(char* buf, const int64_t buf_len, int64_t& buf_pos) override; + virtual int undo_fill_redo_log() override; // undo the function fill_redo_log(..) // the function apply the side effect of dirty txn and return whether // remaining pending callbacks. // NB: the fact whether there remains pending callbacks currently is only used @@ -373,32 +361,70 @@ public: void sync_log_succ(const int64_t log_id, const int64_t log_ts, bool& has_pending_cb); bool is_slow_query() const; - void set_handle_start_time(const int64_t start_time) { handle_start_time_ = start_time; } - int64_t get_handle_start_time() { return handle_start_time_; } - virtual void set_trans_ctx(transaction::ObTransCtx *ctx) override; - virtual transaction::ObTransCtx *get_trans_ctx() override { return ctx_; } - virtual bool is_multi_version_range_valid() const override { return multi_version_range_.is_valid(); } - virtual const ObVersionRange &get_multi_version_range() const override { return multi_version_range_; } - virtual int stmt_data_relocate(const int relocate_data_type, ObMemtable *memtable, bool &relocated) override; - virtual void inc_relocate_cnt() override { relocate_cnt_++; } - virtual void inc_truncate_cnt() override { truncate_cnt_++; } - virtual int64_t get_relocate_cnt() override { return relocate_cnt_; } - virtual int audit_partition(const enum transaction::ObPartitionAuditOperator op, - const int64_t count) override; - int get_memtable_key_arr(transaction::ObMemtableKeyArray &memtable_key_arr); - uint64_t get_lock_for_read_retry_count() const { return lock_for_read_retry_count_; } + void set_handle_start_time(const int64_t start_time) + { + handle_start_time_ = start_time; + } + int64_t get_handle_start_time() + { + return handle_start_time_; + } + virtual void set_trans_ctx(transaction::ObTransCtx* ctx) override; + virtual transaction::ObTransCtx* get_trans_ctx() override + { + return ctx_; + } + virtual bool is_multi_version_range_valid() const override + { + return multi_version_range_.is_valid(); + } + virtual const ObVersionRange& get_multi_version_range() const override + { + return multi_version_range_; + } + virtual int stmt_data_relocate(const int relocate_data_type, ObMemtable* memtable, bool& relocated) override; + virtual void inc_relocate_cnt() override + { + relocate_cnt_++; + } + virtual void inc_truncate_cnt() override + { + truncate_cnt_++; + } + virtual int64_t get_relocate_cnt() override + { + return relocate_cnt_; + } + virtual int audit_partition(const enum transaction::ObPartitionAuditOperator op, const int64_t count) override; + int get_memtable_key_arr(transaction::ObMemtableKeyArray& memtable_key_arr); + uint64_t get_lock_for_read_retry_count() const + { + return lock_for_read_retry_count_; + } virtual void add_trans_mem_total_size(const int64_t size) override; virtual void set_contain_hotspot_row() override; - MemtableIDMap *get_ctx_map(){ return ctx_map_; } + MemtableIDMap* get_ctx_map() + { + return ctx_map_; + } void set_need_print_trace_log(); - int64_t get_ref() const { return ATOMIC_LOAD(&ref_); } + int64_t get_ref() const + { + return ATOMIC_LOAD(&ref_); + } uint64_t get_tenant_id() const override; bool is_can_elr() const override; bool is_elr_prepared() const override; - ObMemtableMutatorIterator *get_memtable_mutator_iter() { return mutator_iter_; } - ObMemtableMutatorIterator *alloc_memtable_mutator_iter(); - int set_memtable_for_cur_log(ObIMemtable *memtable) override; - ObIMemtable *get_memtable_for_cur_log() override { return memtable_for_cur_log_; } + ObMemtableMutatorIterator* get_memtable_mutator_iter() + { + return mutator_iter_; + } + ObMemtableMutatorIterator* alloc_memtable_mutator_iter(); + int set_memtable_for_cur_log(ObIMemtable* memtable) override; + ObIMemtable* get_memtable_for_cur_log() override + { + return memtable_for_cur_log_; + } void clear_memtable_for_cur_log() override { if (NULL != memtable_for_cur_log_) { @@ -407,18 +433,15 @@ public: lob_start_log_ts_ = 0; } } - int set_memtable_for_batch_commit(ObMemtable *memtable); - int set_memtable_for_elr(ObMemtable *memtable); - bool has_read_elr_data() const override { return read_elr_data_; } - int remove_callback_for_uncommited_txn(memtable::ObMemtable* mt, - int64_t& cnt); - int rollback_to(const int32_t sql_no, - const bool is_replay, - const bool need_write_log, - const int64_t max_durable_log_ts, - bool &has_calc_checksum, - uint64_t &checksum, - int64_t &checksum_log_ts); + int set_memtable_for_batch_commit(ObMemtable* memtable); + int set_memtable_for_elr(ObMemtable* memtable); + bool has_read_elr_data() const override + { + return read_elr_data_; + } + int remove_callback_for_uncommited_txn(memtable::ObMemtable* mt, int64_t& cnt); + int rollback_to(const int32_t sql_no, const bool is_replay, const bool need_write_log, + const int64_t max_durable_log_ts, bool& has_calc_checksum, uint64_t& checksum, int64_t& checksum_log_ts); int truncate_to(const int32_t sql_no); bool is_all_redo_submitted(); bool is_for_replay() const @@ -427,9 +450,18 @@ public: } void half_stmt_commit(); - int64_t get_trans_mem_total_size() const{ return trans_mem_total_size_; } - void add_lock_for_read_elapse(const int64_t elapse) override { lock_for_read_elapse_ += elapse; } - int64_t get_lock_for_read_elapse() const override { return lock_for_read_elapse_; } + int64_t get_trans_mem_total_size() const + { + return trans_mem_total_size_; + } + void add_lock_for_read_elapse(const int64_t elapse) override + { + lock_for_read_elapse_ += elapse; + } + int64_t get_lock_for_read_elapse() const override + { + return lock_for_read_elapse_; + } // mark the corresponding callback of the dirty data int mark_frozen_data( const ObMemtable* const frozen_memtable, const ObMemtable* const active_memtable, bool& marked, int64_t& cb_cnt); @@ -457,26 +489,45 @@ public: return trans_mgr_.count(); } void dec_pending_elr_count(); + public: void on_tsc_retry(const ObMemtableKey& key) override; - void on_wlock_retry(const ObMemtableKey& key, const char *conflict_ctx) override; + void on_wlock_retry(const ObMemtableKey& key, const char* conflict_ctx) override; int insert_prev_trans(const uint32_t ctx_id) override; - virtual int64_t to_string(char *buf, const int64_t buf_len) const override; - void set_thread_local_ctx(transaction::ObThreadLocalTransCtx *thread_local_ctx) { thread_local_ctx_ = thread_local_ctx; } - transaction::ObThreadLocalTransCtx *get_thread_local_ctx() const { return thread_local_ctx_; } - transaction::ObTransTableStatusType get_trans_table_status() const { return trans_table_status_; } + virtual int64_t to_string(char* buf, const int64_t buf_len) const override; + void set_thread_local_ctx(transaction::ObThreadLocalTransCtx* thread_local_ctx) + { + thread_local_ctx_ = thread_local_ctx; + } + transaction::ObThreadLocalTransCtx* get_thread_local_ctx() const + { + return thread_local_ctx_; + } + transaction::ObTransTableStatusType get_trans_table_status() const + { + return trans_table_status_; + } void set_trans_table_status(transaction::ObTransTableStatusType trans_table_status) { trans_table_status_ = trans_table_status; } - void set_self_alloc_ctx(const bool is_self_alloc_ctx) { is_self_alloc_ctx_ = is_self_alloc_ctx; } - bool is_self_alloc_ctx() const { return is_self_alloc_ctx_; } - transaction::ObTransStateTableGuard *get_trans_table_guard() override { return &trans_table_guard_; } + void set_self_alloc_ctx(const bool is_self_alloc_ctx) + { + is_self_alloc_ctx_ = is_self_alloc_ctx; + } + bool is_self_alloc_ctx() const + { + return is_self_alloc_ctx_; + } + transaction::ObTransStateTableGuard* get_trans_table_guard() override + { + return &trans_table_guard_; + } // mainly used by revert ref void reset_trans_table_guard(); - private: +private: int set_host_(ObMemtable* host, const bool for_replay); int do_trans_end(const bool commit, const int64_t trans_version, const int end_code); int trans_pending(); @@ -508,7 +559,7 @@ public: trans_mgr_.inc_flushed_log_size(size); } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemtableCtx); common::ObByteLock lock_; common::ObByteLock stmt_relocate_lock_; diff --git a/src/storage/memtable/ob_memtable_data.h b/src/storage/memtable/ob_memtable_data.h index 0f3d62be3..19c5ff152 100644 --- a/src/storage/memtable/ob_memtable_data.h +++ b/src/storage/memtable/ob_memtable_data.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace memtable { // The structure actually written to MvccTransNode::buf_ class ObMemtableDataHeader { - public: +public: ObMemtableDataHeader(storage::ObRowDml dml_type, int64_t buf_len) : dml_type_(dml_type), buf_len_(buf_len) {} ~ObMemtableDataHeader() @@ -69,7 +69,7 @@ class ObMemtableDataHeader { // only used for more conveniently passsing parameters class ObMemtableData { - public: +public: ObMemtableData(storage::ObRowDml dml_type, int64_t buf_len, const char* buf) : dml_type_(dml_type), buf_len_(buf_len), buf_(buf) {} diff --git a/src/storage/memtable/ob_memtable_interface.h b/src/storage/memtable/ob_memtable_interface.h index 100be668b..b02b658bf 100644 --- a/src/storage/memtable/ob_memtable_interface.h +++ b/src/storage/memtable/ob_memtable_interface.h @@ -43,13 +43,13 @@ namespace memtable { class ObIMemtable; class ObIMemtableCtx : public ObIMvccCtx { - public: +public: ObIMemtableCtx() : ObIMvccCtx(), is_standalone_(false) {} virtual ~ObIMemtableCtx() {} - public: +public: virtual void set_read_only() = 0; virtual void inc_ref() = 0; virtual void dec_ref() = 0; @@ -91,7 +91,7 @@ class ObIMemtableCtx : public ObIMvccCtx { virtual transaction::ObTransStateTableGuard* get_trans_table_guard() = 0; VIRTUAL_TO_STRING_KV("", ""); - public: +public: // return OB_AGAIN/OB_SUCCESS virtual int fill_redo_log(char* buf, const int64_t buf_len, int64_t& buf_pos) = 0; virtual int undo_fill_redo_log() = 0; @@ -149,7 +149,7 @@ struct ObMergePriorityInfo { }; class ObIMemtable : public storage::ObITable { - public: +public: ObIMemtable() {} virtual ~ObIMemtable() @@ -249,19 +249,19 @@ class ObIMemtable : public storage::ObITable { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObIMemtableCtxFactory { - public: +public: ObIMemtableCtxFactory() {} virtual ~ObIMemtableCtxFactory() {} - public: +public: virtual ObIMemtableCtx* alloc(const uint64_t tenant_id = OB_SERVER_TENANT_ID) = 0; virtual void free(ObIMemtableCtx* ctx) = 0; }; class ObMemtableCtxFactory : public ObIMemtableCtxFactory { - public: +public: enum { CTX_ALLOC_FIX = 1, CTX_ALLOC_VAR = 2, @@ -275,11 +275,11 @@ class ObMemtableCtxFactory : public ObIMemtableCtxFactory { static const int64_t MAX_CTX_HOLD_COUNT = 10000; static const int64_t MAX_CTX_COUNT = 3000000; - public: +public: ObMemtableCtxFactory(); ~ObMemtableCtxFactory(); - public: +public: ObIMemtableCtx* alloc(const uint64_t tenant_id = OB_SERVER_TENANT_ID); void free(ObIMemtableCtx* ctx); IDMap& get_id_map() @@ -295,10 +295,10 @@ class ObMemtableCtxFactory : public ObIMemtableCtxFactory { return malloc_allocator_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemtableCtxFactory); - private: +private: bool is_inited_; common::ModulePageAllocator mod_; common::ModuleArena ctx_obj_allocator_; @@ -311,18 +311,18 @@ class ObMemtableCtxFactory : public ObIMemtableCtxFactory { }; class ObMemtableFactory { - public: +public: ObMemtableFactory(); ~ObMemtableFactory(); - public: +public: static ObMemtable* alloc(const uint64_t tenant_id); static void free(ObMemtable* mt); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemtableFactory); - private: +private: static int64_t alloc_count_; static int64_t free_count_; }; diff --git a/src/storage/memtable/ob_memtable_iterator.h b/src/storage/memtable/ob_memtable_iterator.h index fd2289d47..605e70129 100644 --- a/src/storage/memtable/ob_memtable_iterator.h +++ b/src/storage/memtable/ob_memtable_iterator.h @@ -37,7 +37,7 @@ namespace oceanbase { namespace memtable { class ObIMemtableIterator : public storage::ObStoreRowIterator { - public: +public: ObIMemtableIterator() {} virtual ~ObIMemtableIterator() @@ -51,12 +51,12 @@ class ObIMemtableIterator : public storage::ObStoreRowIterator { return ret; } - protected: +protected: virtual int inner_get_next_row(const storage::ObStoreRow*& row) = 0; }; class ObIMemtableScanIterator : public ObIMemtableIterator { - public: +public: ObIMemtableScanIterator() {} virtual ~ObIMemtableScanIterator() @@ -75,7 +75,7 @@ class ObIMemtableScanIterator : public ObIMemtableIterator { return ret; } - protected: +protected: virtual int inner_get_next_row(const storage::ObStoreRow*& row) = 0; }; @@ -87,7 +87,7 @@ struct ObIteratorAllocator { }; class ObMemtableGetIterator : public ObIMemtableIterator { - public: +public: ObMemtableGetIterator(); virtual ~ObMemtableGetIterator(); int init(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, ObIMemtable& memtable); @@ -101,12 +101,12 @@ class ObMemtableGetIterator : public ObIMemtableIterator { reset(); } - private: +private: // means GETITER static const uint64_t VALID_MAGIC_NUM = 0x5245544954454700; DISALLOW_COPY_AND_ASSIGN(ObMemtableGetIterator); - private: +private: const uint64_t MAGIC_; bool is_inited_; int32_t rowkey_iter_; @@ -118,17 +118,17 @@ class ObMemtableGetIterator : public ObIMemtableIterator { }; class ObMemtableScanIterator : public ObIMemtableScanIterator { - public: +public: ObMemtableScanIterator(); virtual ~ObMemtableScanIterator(); - public: +public: int init(ObIMemtable* memtable, const storage::ObTableIterParam& param, storage::ObTableAccessContext& context); int set_range(const common::ObExtStoreRange& range); virtual int init(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, storage::ObITable* table, const void* query_range) override; - public: +public: virtual int inner_get_next_row(const storage::ObStoreRow*& row); virtual void reset(); virtual void reuse() override @@ -165,20 +165,20 @@ class ObMemtableScanIterator : public ObIMemtableScanIterator { return iter_flag_; } - protected: +protected: int get_real_range(const common::ObStoreRange& range, common::ObStoreRange& real_range); int prepare_scan(); - public: +public: static const int64_t ROW_ALLOCATOR_PAGE_SIZE = common::OB_MALLOC_NORMAL_BLOCK_SIZE; static const int64_t CELL_ALLOCATOR_PAGE_SIZE = common::OB_MALLOC_NORMAL_BLOCK_SIZE; - private: +private: // means SCANITER static const uint64_t VALID_MAGIC_NUM = 0x524554494e414353; DISALLOW_COPY_AND_ASSIGN(ObMemtableScanIterator); - protected: +protected: const uint64_t MAGIC_; common::ActiveResource active_resource_; bool is_inited_; @@ -201,15 +201,15 @@ class ObMemtableScanIterator : public ObIMemtableScanIterator { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObMemtableMGetIterator : public ObIMemtableIterator { - public: +public: ObMemtableMGetIterator(); virtual ~ObMemtableMGetIterator(); - public: +public: virtual int init(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, storage::ObITable* table, const void* query_range) override; - public: +public: virtual int inner_get_next_row(const storage::ObStoreRow*& row); virtual void reset(); virtual void reuse() override @@ -217,15 +217,15 @@ class ObMemtableMGetIterator : public ObIMemtableIterator { reset(); } - public: +public: static const int64_t ROW_ALLOCATOR_PAGE_SIZE = common::OB_MALLOC_NORMAL_BLOCK_SIZE; - private: +private: // means MGETITER static const uint64_t VALID_MAGIC_NUM = 0x524554495445474d; DISALLOW_COPY_AND_ASSIGN(ObMemtableMGetIterator); - private: +private: const uint64_t MAGIC_; bool is_inited_; const storage::ObTableIterParam* param_; @@ -239,13 +239,13 @@ class ObMemtableMGetIterator : public ObIMemtableIterator { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObMemtableMScanIterator : public ObMemtableScanIterator { - public: +public: static const int64_t ROW_ALLOCATOR_PAGE_SIZE = common::OB_MALLOC_NORMAL_BLOCK_SIZE; static const int64_t CELL_ALLOCATOR_PAGE_SIZE = common::OB_MALLOC_NORMAL_BLOCK_SIZE; ObMemtableMScanIterator(); virtual ~ObMemtableMScanIterator(); - public: +public: int init(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, storage::ObITable* table, const void* query_range) override; virtual int inner_get_next_row(const storage::ObStoreRow*& row); @@ -265,7 +265,7 @@ class ObMemtableMScanIterator : public ObMemtableScanIterator { return ret; } - private: +private: int next_range(); int is_range_scan(bool& range_scan); virtual int prepare_scan_range(); @@ -273,7 +273,7 @@ class ObMemtableMScanIterator : public ObMemtableScanIterator { virtual int get_next_row_for_scan(const storage::ObStoreRow*& row); virtual int inner_get_next_row_for_scan(const storage::ObStoreRow*& row); - private: +private: static const uint64_t VALID_MAGIC_NUM = 0x524554494e414353; static const int64_t LOCAL_ARRAY_SIZE = 16; const common::ObIArray* ranges_; @@ -284,15 +284,15 @@ class ObMemtableMScanIterator : public ObMemtableScanIterator { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObMemtableMultiVersionScanIterator : public ObIMemtableScanIterator { - public: +public: ObMemtableMultiVersionScanIterator(); virtual ~ObMemtableMultiVersionScanIterator(); - public: +public: virtual int init(const storage::ObTableIterParam& param, storage::ObTableAccessContext& context, storage::ObITable* table, const void* query_range) override; - public: +public: virtual int inner_get_next_row(const storage::ObStoreRow*& row); virtual void reset(); virtual void reuse() override @@ -305,7 +305,7 @@ class ObMemtableMultiVersionScanIterator : public ObIMemtableScanIterator { enum ObIterStage { IS_ITER_COMPLEMENT, IS_ITER_MINI }; TO_STRING_KV(KPC_(context), K_(row), KPC_(key), KPC_(value_iter), K_(scan_state), K_(iter_mode)); - protected: +protected: virtual void row_reset(); int get_compacted_multi_version_row(const storage::ObStoreRow*& row); int get_multi_version_row(const storage::ObStoreRow*& row); @@ -317,7 +317,7 @@ class ObMemtableMultiVersionScanIterator : public ObIMemtableScanIterator { virtual int init_row_cells(ObIAllocator* allocator); int get_next_row(); - protected: +protected: // iterate row virtual int iterate_compacted_row(const common::ObStoreRowkey& key, storage::ObStoreRow& row); virtual int iterate_uncommitted_row(const ObStoreRowkey& key, storage::ObStoreRow& row); @@ -329,7 +329,7 @@ class ObMemtableMultiVersionScanIterator : public ObIMemtableScanIterator { int iterate_uncommitted_row_value_(storage::ObStoreRow& row); int iterate_multi_version_row_value_(storage::ObStoreRow& row); - protected: +protected: struct ObOuputRowValidateChecker { ObOuputRowValidateChecker(); ~ObOuputRowValidateChecker(); @@ -344,7 +344,7 @@ class ObMemtableMultiVersionScanIterator : public ObIMemtableScanIterator { static const uint64_t VALID_MAGIC_NUM = 0x524554494e414353; DISALLOW_COPY_AND_ASSIGN(ObMemtableMultiVersionScanIterator); - protected: +protected: const uint64_t MAGIC_; common::ActiveResource active_resource_; bool is_inited_; @@ -372,7 +372,7 @@ class ObMemtableMultiVersionScanIterator : public ObIMemtableScanIterator { //////////////////////////////////////////////////////////////////////////////////////////////////// class ObReadRow { DEFINE_ALLOCATOR_WRAPPER - public: +public: static int iterate_row(const share::schema::ColumnMap& column_index, const storage::ObColDescIArray& columns, const common::ObStoreRowkey& key, ObIMvccValueIterator* value_iter, storage::ObStoreRow& row, ObNopBitMap& bitmap, bool& has_null, bool& key_has_null, int64_t& row_scn); @@ -380,15 +380,15 @@ class ObReadRow { static int get_row_header(ObMvccValueIterator& value_iter, uint32_t& modify_count, uint32_t& acc_checksum); static int iterate_row_key(bool& key_has_null, const common::ObStoreRowkey& rowkey, storage::ObStoreRow& row); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObReadRow); - private: +private: static int iterate_row_value_(const share::schema::ColumnMap& column_index, const storage::ObColDescIArray& columns, ObIMvccValueIterator* value_iter, storage::ObStoreRow& row, ObNopBitMap& bitmap, bool& has_null, int64_t& row_scn); - private: +private: /*static int iterate_trans_node_( bool& row_empty, const common::ObIArray &columns, diff --git a/src/storage/memtable/ob_memtable_key.h b/src/storage/memtable/ob_memtable_key.h index 19dcfb1f5..a02365eae 100644 --- a/src/storage/memtable/ob_memtable_key.h +++ b/src/storage/memtable/ob_memtable_key.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace memtable { class ObMemtableKey { - public: +public: ObMemtableKey(uint64_t table_id, const common::ObStoreRowkey* rowkey) : table_id_(table_id), rowkey_(const_cast(rowkey)), hash_val_(0) { @@ -87,7 +87,7 @@ class ObMemtableKey { return key; } - public: +public: int compare(const ObMemtableKey& other, int& cmp) const { int ret = common::OB_SUCCESS; @@ -338,7 +338,7 @@ class ObMemtableKey { return ret; } - protected: +protected: uint64_t table_id_; common::ObStoreRowkey* rowkey_; mutable uint64_t hash_val_; // Perf optimization. @@ -346,7 +346,7 @@ class ObMemtableKey { }; class ObStoreRowkeyWrapper { - public: +public: ObStoreRowkeyWrapper() : rowkey_(nullptr) {} ObStoreRowkeyWrapper(const common::ObStoreRowkey* rowkey) : rowkey_(rowkey) @@ -405,7 +405,7 @@ class ObStoreRowkeyWrapper { return key_wrapper; } - public: +public: const common::ObStoreRowkey* rowkey_; }; diff --git a/src/storage/memtable/ob_memtable_mutator.h b/src/storage/memtable/ob_memtable_mutator.h index b96b0072f..5008b7a54 100644 --- a/src/storage/memtable/ob_memtable_mutator.h +++ b/src/storage/memtable/ob_memtable_mutator.h @@ -31,11 +31,11 @@ class RedoDataNode; class ObMemtableMutatorMeta { static const uint64_t MMB_MAGIC = 0x6174756d; // #muta static const int64_t MIN_META_SIZE = 24; // sizeof(MutatorMetaV1) - public: +public: ObMemtableMutatorMeta(); ~ObMemtableMutatorMeta(); - public: +public: int inc_row_count(); int64_t get_row_count() const; int fill_header(const char* buf, const int64_t data_len); @@ -60,19 +60,19 @@ class ObMemtableMutatorMeta { } bool is_row_start() const; - public: +public: int64_t get_serialize_size() const; int serialize(char* buf, const int64_t buf_len, int64_t& pos); int deserialize(const char* buf, const int64_t data_len, int64_t& pos); - public: +public: int64_t to_string(char* buffer, const int64_t length) const; - private: +private: bool check_magic(); uint32_t calc_meta_crc(const char* buf); - private: +private: uint32_t magic_; uint32_t meta_crc_; int16_t meta_size_; @@ -86,7 +86,7 @@ class ObMemtableMutatorMeta { }; class ObMemtableMutatorRow { - public: +public: ObMemtableMutatorRow(); ObMemtableMutatorRow(const uint64_t table_id, const common::ObStoreRowkey& rowkey, const int64_t table_version, const ObRowData& new_row, const ObRowData& old_row, const storage::ObRowDml dml_type, const uint32_t modify_count, @@ -110,7 +110,7 @@ class ObMemtableMutatorRow { TO_STRING_KV(K_(row_size), K_(table_id), K_(rowkey), K_(table_version), K_(dml_type), K_(update_seq), K_(new_row), K_(old_row), K_(acc_checksum), K_(version), K_(sql_no), K_(flag)); - public: +public: char obj_array_[sizeof(common::ObObj) * common::OB_MAX_ROWKEY_COLUMN_NUMBER]; uint32_t row_size_; uint64_t table_id_; @@ -127,11 +127,11 @@ class ObMemtableMutatorRow { }; class ObMemtableMutatorWriter { - public: +public: ObMemtableMutatorWriter(); ~ObMemtableMutatorWriter(); - public: +public: int set_buffer(char* buf, const int64_t buf_len); int append_kv(const uint64_t table_id, const common::ObStoreRowkey& rowkey, const int64_t table_version, const RedoDataNode& redo); @@ -145,7 +145,7 @@ class ObMemtableMutatorWriter { static int handle_big_row_data(const char* in_buf, const int64_t in_buf_len, int64_t& in_buf_pos, char* out_buf, const int64_t out_buf_len, int64_t& out_buf_pos); - private: +private: ObMemtableMutatorMeta meta_; common::ObDataBuffer buf_; @@ -153,12 +153,12 @@ class ObMemtableMutatorWriter { }; class ObMemtableMutatorIterator { - public: +public: ObMemtableMutatorIterator(); ~ObMemtableMutatorIterator(); void reset(); - public: +public: int set_tenant_id(const uint64_t tenant_id); int deserialize(const char* buf, const int64_t data_len, int64_t& pos); // for replay @@ -191,10 +191,10 @@ class ObMemtableMutatorIterator { } TO_STRING_KV(K_(meta), K_(big_row), K_(big_row_pos)); - private: +private: void reset_big_row_args_(); - private: +private: ObMemtableMutatorMeta meta_; common::ObDataBuffer buf_; ObMemtableMutatorRow row_; diff --git a/src/storage/memtable/ob_memtable_row_reader.h b/src/storage/memtable/ob_memtable_row_reader.h index 705d20604..ff9281507 100644 --- a/src/storage/memtable/ob_memtable_row_reader.h +++ b/src/storage/memtable/ob_memtable_row_reader.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace memtable { class ObMemtableRowReader { - public: +public: ObMemtableRowReader(); ~ObMemtableRowReader() {} @@ -35,7 +35,7 @@ class ObMemtableRowReader { ObFixedBitSet& bit_set, storage::ObStoreRow& row, bool& loop_flag); TO_STRING_KV(K_(buf), K_(pos)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemtableRowReader); int parse_no_meta(storage::ObStoreRow& row, bool& has_null, bool& row_empty, int64_t& filled_column_count); int parse_with_meta(storage::ObStoreRow& row, bool& row_empty, bool& loop_flag); @@ -48,7 +48,7 @@ class ObMemtableRowReader { template const T* read(); - private: +private: const char* buf_; int64_t buf_size_; int64_t pos_; @@ -57,7 +57,7 @@ class ObMemtableRowReader { }; class ObMemtableIterRowReader { - public: +public: ObMemtableIterRowReader(); ~ObMemtableIterRowReader(); int init(common::ObArenaAllocator* allocator, const share::schema::ColumnMap* cols_map, ObNopBitMap* bitmap, @@ -69,7 +69,7 @@ class ObMemtableIterRowReader { bool is_iter_end(); int set_nop_pos(storage::ObStoreRow& row); - private: +private: bool is_inited_; bool loop_flag_; bool row_empty_; diff --git a/src/storage/memtable/ob_memtable_sparse_iterator.h b/src/storage/memtable/ob_memtable_sparse_iterator.h index 4f8dbfb21..842b7c2cc 100644 --- a/src/storage/memtable/ob_memtable_sparse_iterator.h +++ b/src/storage/memtable/ob_memtable_sparse_iterator.h @@ -21,22 +21,22 @@ namespace memtable { class ObMemtableMultiVersionScanIterator; class ObMemtableMultiVersionScanSparseIterator : public ObMemtableMultiVersionScanIterator { - public: +public: ObMemtableMultiVersionScanSparseIterator(); virtual ~ObMemtableMultiVersionScanSparseIterator(); - protected: +protected: virtual void row_reset() override; virtual int init_next_value_iter() override; virtual int init_row_cells(ObIAllocator* allocator) override; - protected: +protected: // iterate row virtual int iterate_compacted_row(const common::ObStoreRowkey& key, storage::ObStoreRow& row) override; virtual int iterate_uncommitted_row(const ObStoreRowkey& key, storage::ObStoreRow& row) override; virtual int iterate_multi_version_row(const ObStoreRowkey& rowkey, storage::ObStoreRow& row) override; - private: +private: // means SCANITER static const uint64_t VALID_MAGIC_NUM = 0x524554494e414353; DISALLOW_COPY_AND_ASSIGN(ObMemtableMultiVersionScanSparseIterator); @@ -44,7 +44,7 @@ class ObMemtableMultiVersionScanSparseIterator : public ObMemtableMultiVersionSc class ObReadSparseRow { DEFINE_ALLOCATOR_WRAPPER - public: +public: static int iterate_sparse_row_key(const common::ObIArray& columns, const common::ObStoreRowkey& rowkey, storage::ObStoreRow& row); static int prepare_sparse_rowkey_position(const int64_t rowkey_length, storage::ObStoreRow& row); diff --git a/src/storage/memtable/ob_memtable_util.h b/src/storage/memtable/ob_memtable_util.h index c12119498..d67cca300 100644 --- a/src/storage/memtable/ob_memtable_util.h +++ b/src/storage/memtable/ob_memtable_util.h @@ -56,7 +56,7 @@ const char* strarray(const common::ObIArray& array) } class ObFakeStoreRowKey { - public: +public: ObFakeStoreRowKey(const char* str, const int64_t size) { for (int64_t i = 0; i < OBJ_CNT; i++) { @@ -71,10 +71,10 @@ class ObFakeStoreRowKey { return rowkey_; } - private: +private: static const int64_t OBJ_CNT = 1; - private: +private: common::ObStoreRowkey rowkey_; ObObj obj_array_[OBJ_CNT]; }; diff --git a/src/storage/memtable/ob_mt_hash.h b/src/storage/memtable/ob_mt_hash.h index 038192974..836dcb143 100644 --- a/src/storage/memtable/ob_mt_hash.h +++ b/src/storage/memtable/ob_mt_hash.h @@ -147,15 +147,15 @@ OB_INLINE static int compare_node(const ObHashNode* n1, const ObHashNode* n2, in // ---------------- array implementation ---------------- template class ObMtArrayBase { - private: +private: static const int64_t DIR_SIZE = PAGE_SIZE / sizeof(ObHashNode*); static const int64_t SEG_SIZE = PAGE_SIZE / sizeof(ObHashNode); static ObHashNode* const PLACE_HOLDER; - public: +public: static const int64_t ARRAY_CAPABILITY = DIR_SIZE * SEG_SIZE; - public: +public: explicit ObMtArrayBase(common::ObIAllocator& allocator) : allocator_(allocator), dir_(nullptr), alloc_memory_(0) {} ~ObMtArrayBase() @@ -188,7 +188,7 @@ class ObMtArrayBase { return snprintf(buf, buf_len, ", dir_=%p", dir_); } - private: +private: // return values: // OB_ALLOCATE_MEMORY_FAILED : no memory // OB_ENTRY_NOT_EXIST : current node is allocating @@ -252,7 +252,7 @@ class ObMtArrayBase { return ret; } - private: +private: common::ObIAllocator& allocator_; ObHashNode** dir_; int64_t alloc_memory_; @@ -262,7 +262,7 @@ template ObHashNode* const ObMtArrayBase::PLACE_HOLDER = (ObHashNode*)0x1; class ObMtArray { - public: +public: explicit ObMtArray(common::ObIAllocator& allocator) : small_arr_(allocator), large_arr_(allocator) {} ~ObMtArray() @@ -296,17 +296,17 @@ class ObMtArray { return len; } - private: +private: // TODO memstore_allocator misc static const int64_t MY_NORMAL_BLOCK_SIZE = common::OB_MALLOC_NORMAL_BLOCK_SIZE; static const int64_t MY_BIG_BLOCK_SIZE = common::OB_MALLOC_BIG_BLOCK_SIZE - 64; - public: +public: // SMALL_CAPABILITY 520,000, TOTAL_CAPABILITY 34.3 billion static const int64_t SMALL_CAPABILITY = ObMtArrayBase::ARRAY_CAPABILITY; static const int64_t TOTAL_CAPABILITY = ObMtArrayBase::ARRAY_CAPABILITY + SMALL_CAPABILITY; - private: +private: ObMtArrayBase small_arr_; ObMtArrayBase large_arr_; }; @@ -316,7 +316,7 @@ class ObMtArray { // uses the type directly here // consider to remove generic from QueryEgnine in the future class ObMtHash { - private: +private: // bucket link of parent-child relation static const int64_t GENEALOGY_LEN = 64; struct Parent { @@ -350,7 +350,7 @@ class ObMtHash { TO_STRING_KV(K(depth_), K(list_)); }; - public: +public: explicit ObMtHash(common::ObIAllocator& allocator) : allocator_(allocator), arr_(allocator), arr_size_(INIT_HASH_SIZE) { // tail_node_ is a sentinel node, there will be no problem @@ -430,7 +430,7 @@ class ObMtHash { dump_list(fd, print_bucket, print_row_value, print_row_value_verbose); } - private: +private: OB_INLINE bool is_empty() const { return ATOMIC_LOAD(&(zero_node_.next_)) == &tail_node_; @@ -730,10 +730,10 @@ class ObMtHash { } } - private: +private: static const int64_t INIT_HASH_SIZE = 128; - private: +private: common::ObIAllocator& allocator_; ObHashNode zero_node_; // for idx=0, always available ObHashNode tail_node_; // tail node, a sentinel node, never be accessed diff --git a/src/storage/memtable/ob_mt_trace_log.h b/src/storage/memtable/ob_mt_trace_log.h index 6fbc8bff4..5d96bbb21 100644 --- a/src/storage/memtable/ob_mt_trace_log.h +++ b/src/storage/memtable/ob_mt_trace_log.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace memtable { class ObMTTraceLog { - public: +public: enum { TRACE_LOG_BUF_SIZE = 16L * 1024L }; ObMTTraceLog() : start_log_ts_(0), last_log_ts_(0), pos_(0) {} @@ -71,7 +71,7 @@ class ObMTTraceLog { return buf_; } - private: +private: void try_fill_start_ts() { if (0 == pos_) { @@ -117,7 +117,7 @@ class ObMTTraceLog { return err; } - private: +private: common::ObSpinLock lock_; int64_t start_log_ts_; int64_t last_log_ts_; diff --git a/src/storage/memtable/ob_nop_bitmap.h b/src/storage/memtable/ob_nop_bitmap.h index 8ec7e1273..827bf9160 100644 --- a/src/storage/memtable/ob_nop_bitmap.h +++ b/src/storage/memtable/ob_nop_bitmap.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace memtable { class ObNopBitMap { - public: +public: ObNopBitMap() : size_(0), cnt_(0), nop_cnt_(0), rowkey_cnt_(0) {} @@ -84,14 +84,14 @@ class ObNopBitMap { return common::OB_SUCCESS; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObNopBitMap); inline int64_t round_up(int64_t n) { return (n + mask) & ~mask; } - private: +private: static const int64_t mask = 63; static const int64_t shift_bits = 6; int64_t size_; diff --git a/src/storage/memtable/ob_redo_log_generator.h b/src/storage/memtable/ob_redo_log_generator.h index ed1df9d49..8a055be6a 100644 --- a/src/storage/memtable/ob_redo_log_generator.h +++ b/src/storage/memtable/ob_redo_log_generator.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace memtable { class ObRedoLogGenerator { - public: +public: ObRedoLogGenerator() : is_inited_(false), consume_cursor_(NULL), @@ -49,7 +49,7 @@ class ObRedoLogGenerator { return generate_data_size_; } - private: +private: bool big_row_log_fully_filled() const; int generate_and_fill_big_row_redo(const int64_t big_row_size, RedoDataNode& redo, ObMvccRowCallback* callback, char* buf, const int64_t buf_len, int64_t& buf_pos); @@ -57,7 +57,7 @@ class ObRedoLogGenerator { int fill_row_redo(ObMemtableMutatorWriter& mmw, const RedoDataNode& redo); ObMemtable* get_first_not_null_memtable_if_exit_(ObMvccRowCallback* start, ObMvccRowCallback* end); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRedoLogGenerator); bool is_inited_; ObMvccRowCallback* consume_cursor_; diff --git a/src/storage/memtable/ob_row_compactor.h b/src/storage/memtable/ob_row_compactor.h index e84f71c5f..375c30e13 100644 --- a/src/storage/memtable/ob_row_compactor.h +++ b/src/storage/memtable/ob_row_compactor.h @@ -32,7 +32,7 @@ class ObMvccRow; class ObMvccTransNode; class ICompactMap { - public: +public: ICompactMap() {} virtual ~ICompactMap() @@ -45,7 +45,7 @@ class ICompactMap { // Map with thread local array, which runs faster. class CompactMapImproved : public ICompactMap { - private: +private: struct Node { uint32_t ver_; uint32_t col_id_; @@ -53,26 +53,26 @@ class CompactMapImproved : public ICompactMap { Node* next_; }; - private: +private: static const int64_t BKT_N_BIT_SHIFT = 9; // 2^9=512. Perf opt. static const int64_t BKT_N = 1 << BKT_N_BIT_SHIFT; // 512 static const int64_t BKT_N_MOD_MASK = BKT_N - 1; static const uint32_t INVALID_COL_ID = UINT16_MAX; static const uint32_t MAX_VER = UINT32_MAX; - private: +private: class StaticMemoryHelper { - public: + public: StaticMemoryHelper(); ~StaticMemoryHelper(); - public: + public: Node* get_tl_arr(); uint32_t& get_tl_arr_ver(); Node* get_node(); void revert_node(Node* n); - private: + private: static RLOCAL(Node*, bkts_); // Thread local array. static RLOCAL(uint32_t, ver_); // Thread local array version. common::PageArena<> arr_arena_; @@ -80,7 +80,7 @@ class CompactMapImproved : public ICompactMap { common::ObSmallAllocator node_alloc_; }; - public: +public: CompactMapImproved() : bkts_(NULL), ver_(0), scan_cur_bkt_(NULL), scan_cur_node_(NULL) {} virtual ~CompactMapImproved() @@ -90,10 +90,10 @@ class CompactMapImproved : public ICompactMap { int set(const uint64_t col_id, const common::ObObj& cell); int get_next(uint64_t& col_id, common::ObObj& cell); - private: +private: DISALLOW_COPY_AND_ASSIGN(CompactMapImproved); - private: +private: Node* bkts_; uint32_t ver_; Node* scan_cur_bkt_; @@ -103,26 +103,26 @@ class CompactMapImproved : public ICompactMap { // Memtable Row Compactor. class ObMemtableRowCompactor { - public: +public: ObMemtableRowCompactor(); virtual ~ObMemtableRowCompactor(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMemtableRowCompactor); - public: +public: int init(ObMvccRow* row, common::ObIAllocator* node_alloc); // compact and refresh the update counter by snapshot version int compact(const int64_t snapshot_version); - private: +private: void find_start_pos_( const int64_t snapshot_version, ObMvccTransNode**& start, ObMvccTransNode*& save, ObMvccTransNode*& next_node); ObMvccTransNode* construct_compact_node_(const int64_t snapshot_version, ObMvccTransNode* save); int insert_compact_node_( ObMvccTransNode* trans_node, ObMvccTransNode** start, ObMvccTransNode* save, ObMvccTransNode* next_node); - private: +private: bool is_inited_; ObMvccRow* row_; common::ObIAllocator* node_alloc_; diff --git a/src/storage/ob_all_micro_block_range_iterator.h b/src/storage/ob_all_micro_block_range_iterator.h index 5b4d51ef8..cbbf2d861 100644 --- a/src/storage/ob_all_micro_block_range_iterator.h +++ b/src/storage/ob_all_micro_block_range_iterator.h @@ -22,7 +22,7 @@ namespace storage { class ObAllMicroBlockRangeIterator { typedef blocksstable::ObBlockIndexIterator IndexCursor; - public: +public: ObAllMicroBlockRangeIterator(); ~ObAllMicroBlockRangeIterator(); void reset(); @@ -30,7 +30,7 @@ class ObAllMicroBlockRangeIterator { const bool is_reverse_scan); int get_next_range(const common::ObStoreRange*& range); - private: +private: int open_next_macro_block(); int prefetch_block_index(); int get_end_keys(common::ObIAllocator& allocator); @@ -41,7 +41,7 @@ class ObAllMicroBlockRangeIterator { bool is_first_macro_block() const; bool is_last_macro_block() const; - private: +private: static const int64_t PREFETCH_CNT = 1; static const int64_t HANDLE_CNT = PREFETCH_CNT + 1; ObMacroBlockIterator macro_block_iterator_; diff --git a/src/storage/ob_all_server_tracer.h b/src/storage/ob_all_server_tracer.h index 2b73f2971..09edc1cd3 100644 --- a/src/storage/ob_all_server_tracer.h +++ b/src/storage/ob_all_server_tracer.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace storage { class ObServerTraceMap : public share::ObIServerTrace { - public: +public: ObServerTraceMap(); virtual ~ObServerTraceMap(); int init(); @@ -34,7 +34,7 @@ class ObServerTraceMap : public share::ObIServerTrace { virtual int is_server_stopped(const common::ObAddr& server, bool& is_stopped) const; int refresh(); - private: +private: static const int64_t DEFAULT_SERVER_COUNT = 2048; bool is_inited_; mutable common::SpinRWLock lock_; @@ -43,21 +43,21 @@ class ObServerTraceMap : public share::ObIServerTrace { }; class ObServerTraceTask : public common::ObTimerTask { - public: +public: ObServerTraceTask(); virtual ~ObServerTraceTask(); int init(ObServerTraceMap* trace_map, int tg_id); virtual void runTimerTask(); TO_STRING_KV(KP_(trace_map)); - private: +private: const static int64_t REFRESH_INTERVAL_US = 5L * 1000 * 1000; ObServerTraceMap* trace_map_; bool is_inited_; }; class ObAllServerTracer : public share::ObIServerTrace { - public: +public: static ObAllServerTracer& get_instance(); int init(int tg_id, ObServerTraceTask& trace_task); virtual int is_server_exist(const common::ObAddr& server, bool& exist) const; @@ -67,11 +67,11 @@ class ObAllServerTracer : public share::ObIServerTrace { virtual int is_server_stopped(const common::ObAddr& server, bool& is_stopped) const; virtual int check_migrate_in_blocked(const common::ObAddr& addr, bool& is_block) const; - private: +private: ObAllServerTracer(); virtual ~ObAllServerTracer(); - private: +private: bool is_inited_; ObServerTraceMap trace_map_; }; diff --git a/src/storage/ob_auto_part_scheduler.h b/src/storage/ob_auto_part_scheduler.h index 9aff14243..6ab6615b9 100644 --- a/src/storage/ob_auto_part_scheduler.h +++ b/src/storage/ob_auto_part_scheduler.h @@ -36,24 +36,24 @@ class ObPartitionService; class ObIPartitionGroup; class ObSSTable; class ObAutoPartScheduler : public share::ObThreadPool { - public: +public: ObAutoPartScheduler(); virtual ~ObAutoPartScheduler(); - public: +public: int init(storage::ObPartitionService* partition_service, share::schema::ObMultiVersionSchemaService* schema_service); int start(); void stop(); void wait(); void destroy(); - public: +public: void run1(); - private: +private: typedef common::ObSEArray RowkeyArray; - private: +private: void do_work_(); // execute partition slipt including condition check, notifying rs execute split void handle_partition_(storage::ObIPartitionGroup* partition); @@ -82,12 +82,12 @@ class ObAutoPartScheduler : public share::ObThreadPool { RowkeyArray& rowkey_array, common::ObIAllocator& allocator); const static int64_t DO_WORK_INTERVAL = 10 * 1000 * 1000; // 10s - private: +private: bool is_inited_; storage::ObPartitionService* partition_service_; share::schema::ObMultiVersionSchemaService* schema_service_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAutoPartScheduler); }; } // namespace storage diff --git a/src/storage/ob_backup_archive_log.h b/src/storage/ob_backup_archive_log.h index 6535557f0..d199cac37 100644 --- a/src/storage/ob_backup_archive_log.h +++ b/src/storage/ob_backup_archive_log.h @@ -34,7 +34,7 @@ namespace storage { class ObMigrateCtx; struct ObBackupArchiveLogPGCtx { - public: +public: ObBackupArchiveLogPGCtx(); virtual ~ObBackupArchiveLogPGCtx(); @@ -56,7 +56,7 @@ struct ObBackupArchiveLogPGCtx { ObMigrateCtx* mig_ctx_; common::ObInOutBandwidthThrottle* throttle_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupArchiveLogPGCtx); }; @@ -103,13 +103,13 @@ class ObBackupArchiveLogPGTask : public share::ObITask { char storage_info_[share::OB_MAX_BACKUP_STORAGE_INFO_LENGTH]; // under line storage for info_ }; - public: +public: ObBackupArchiveLogPGTask(); virtual ~ObBackupArchiveLogPGTask(); int init(ObMigrateCtx& mig_ctx, ObBackupArchiveLogPGCtx& pg_ctx); virtual int process() override; - private: +private: int check_nfs_mounted_if_nfs(const ObBackupArchiveLogPGCtx& pg_ctx, bool& mounted); int converge_task( const archive::LogArchiveFileType file_type, const ObBackupArchiveLogPGCtx& pg_ctx, FileRange& file_range); @@ -150,7 +150,7 @@ class ObBackupArchiveLogPGTask : public share::ObITask { char* dest_path_buf, int64_t& pos); const char* get_file_prefix_with_type(const archive::LogArchiveFileType file_type); - private: +private: int try_touch_archive_key(const ObBackupArchiveLogPGCtx& pg_ctx, const int64_t incarnation, const int64_t round); int build_archive_key_prefix( const ObBackupArchiveLogPGCtx& pg_ctx, const ObPGKey& pg_key, const int64_t incarnation, const int64_t round); @@ -159,19 +159,19 @@ class ObBackupArchiveLogPGTask : public share::ObITask { int build_archive_key_path(const ObBackupArchiveLogPGCtx& pg_ctx, const int64_t incarnation, const int64_t round, const ObPGKey& pkey, share::ObBackupPath& archive_key_path); - private: +private: bool is_inited_; common::ObPGKey pg_key_; ObMigrateCtx* mig_ctx_; ObBackupArchiveLogPGCtx* pg_ctx_; common::ObInOutBandwidthThrottle* throttle_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupArchiveLogPGTask); }; class ObBackupArchiveLogFinishTask : public share::ObITask { - public: +public: ObBackupArchiveLogFinishTask(); virtual ~ObBackupArchiveLogFinishTask(); int init(ObMigrateCtx& mig_ctx); @@ -181,12 +181,12 @@ class ObBackupArchiveLogFinishTask : public share::ObITask { return pg_ctx_; } - private: +private: bool is_inited_; ObMigrateCtx* mig_ctx_; ObBackupArchiveLogPGCtx pg_ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupArchiveLogFinishTask); }; diff --git a/src/storage/ob_base_storage_info.h b/src/storage/ob_base_storage_info.h index 556383d4e..d20c0679f 100644 --- a/src/storage/ob_base_storage_info.h +++ b/src/storage/ob_base_storage_info.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace common { class ObBaseStorageInfo { - public: +public: ObBaseStorageInfo(); virtual ~ObBaseStorageInfo(); int init(const int64_t epoch_id, const ObProposalID& proposal_id, const uint64_t last_replay_log_id, @@ -102,7 +102,7 @@ class ObBaseStorageInfo { const common::ObMemberList& mlist, const common::ObProposalID& ms_proposal_id); OB_UNIS_VERSION_V(1); - protected: +protected: static const int16_t STORAGE_INFO_VERSION = 1; int16_t version_; @@ -117,7 +117,7 @@ class ObBaseStorageInfo { common::ObMemberList curr_member_list_; ObProposalID ms_proposal_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBaseStorageInfo); }; } // namespace common diff --git a/src/storage/ob_block_sample_iterator.h b/src/storage/ob_block_sample_iterator.h index 7f820bf67..5ee7d2f85 100644 --- a/src/storage/ob_block_sample_iterator.h +++ b/src/storage/ob_block_sample_iterator.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace storage { class ObBlockSampleIterator : public ObISampleIterator { - public: +public: explicit ObBlockSampleIterator(const common::SampleInfo& sample_info); virtual ~ObBlockSampleIterator(); int open(ObMultipleScanMerge& scan_merge, ObTableAccessContext& access_ctx, const common::ObExtStoreRange& range, @@ -32,10 +32,10 @@ class ObBlockSampleIterator : public ObISampleIterator { virtual int get_next_row(ObStoreRow*& row) override; virtual void reset() override; - private: +private: int open_range(common::ObExtStoreRange& range); - private: +private: static const int64_t ROW_CNT_LIMIT_PER_BLOCK = 5000; common::ObArenaAllocator allocator_; ObAllMicroBlockRangeIterator micro_block_iterator_; diff --git a/src/storage/ob_build_index_scheduler.h b/src/storage/ob_build_index_scheduler.h index b177f0d91..56da0e58e 100644 --- a/src/storage/ob_build_index_scheduler.h +++ b/src/storage/ob_build_index_scheduler.h @@ -34,32 +34,32 @@ class ObBuildIndexDag; class ObIPartitionGroupGuard; class ObBuildIndexBaseTask : public share::ObIDDLTask { - public: +public: ObBuildIndexBaseTask(const share::ObIDDLTaskType task_type); virtual ~ObBuildIndexBaseTask(); static int report_index_status(const uint64_t index_table_id, const int64_t partition_id, const share::schema::ObIndexStatus index_status, const int build_index_ret, const ObRole role); - protected: +protected: int check_partition_need_build_index(const common::ObPartitionKey& pkey, const share::schema::ObTableSchema& index_schema, const share::schema::ObTableSchema& data_table_schema, storage::ObIPartitionGroupGuard& guard, bool& need_build); - private: +private: int check_partition_exist_in_current_server(const share::schema::ObTableSchema& index_schema, const share::schema::ObTableSchema& data_table_schema, const ObPartitionKey& pkey, ObIPartitionGroupGuard& guard, bool& exist); int check_restore_need_retry(const uint64_t tenant_id, bool& need_retry); int check_partition_split_finish(const ObPartitionKey& pkey, bool& is_split_finished); - protected: +protected: using ObIDDLTask::is_inited_; using ObIDDLTask::need_retry_; using ObIDDLTask::task_id_; }; class ObTenantDDLCheckSchemaTask : public ObBuildIndexBaseTask { - public: +public: ObTenantDDLCheckSchemaTask(); virtual ~ObTenantDDLCheckSchemaTask(); int init(const uint64_t tenant_id, const int64_t base_version, const int64_t refreshed_version); @@ -75,7 +75,7 @@ class ObTenantDDLCheckSchemaTask : public ObBuildIndexBaseTask { static int generate_schedule_index_task(const common::ObPartitionKey& pkey, const uint64_t index_id, const int64_t schema_version, const bool is_unique_index); - private: +private: int find_build_index_partitions(const share::schema::ObTableSchema* index_schema, share::schema::ObSchemaGetterGuard& guard, common::ObIArray& partition_keys); int get_candidate_tables(common::ObIArray& table_ids); @@ -85,14 +85,14 @@ class ObTenantDDLCheckSchemaTask : public ObBuildIndexBaseTask { int process_schedule_build_index_task(); int process_tenant_memory_task(); - private: +private: int64_t base_version_; int64_t refreshed_version_; uint64_t tenant_id_; }; class ObBuildIndexScheduleTask : public ObBuildIndexBaseTask { - public: +public: enum State { WAIT_TRANS_END = 0, WAIT_SNAPSHOT_READY, @@ -117,7 +117,7 @@ class ObBuildIndexScheduleTask : public ObBuildIndexBaseTask { virtual ObIDDLTask* deep_copy(char* buf, const int64_t size) const override; TO_STRING_KV(K_(pkey), K_(index_id), K_(schema_version), K_(state)); - private: +private: int check_trans_end(bool& is_trans_end, int64_t& snapshot_version); int report_trans_status(const int trans_status, const int64_t snapshot_version); int wait_trans_end(const bool is_leader); @@ -140,7 +140,7 @@ class ObBuildIndexScheduleTask : public ObBuildIndexBaseTask { int unique_index_checking(const bool is_leader); int rollback_state(const int state); - private: +private: static const int64_t COPY_BUILD_INDEX_DATA_TIMEOUT = 10 * 1000 * 1000LL; // 10s static const int64_t REFRESH_CANDIDATE_REPLICA_COUNT = 6; // 60s common::ObPartitionKey pkey_; @@ -158,14 +158,14 @@ class ObBuildIndexScheduleTask : public ObBuildIndexBaseTask { }; class ObCheckTenantSchemaTask : public common::ObTimerTask { - public: +public: ObCheckTenantSchemaTask(); virtual ~ObCheckTenantSchemaTask(); int init(); virtual void runTimerTask() override; void destroy(); - private: +private: static const int64_t DEFAULT_TENANT_BUCKET_NUM = 100; bool is_inited_; lib::ObMutex lock_; @@ -174,11 +174,11 @@ class ObCheckTenantSchemaTask : public common::ObTimerTask { }; class ObBuildIndexScheduler { - public: +public: static const int64_t DEFAULT_THREAD_CNT = 4; static const int64_t MINI_MODE_THREAD_CNT = 1; - public: +public: int init(); static ObBuildIndexScheduler& get_instance(); int push_task(ObBuildIndexScheduleTask& task); @@ -187,11 +187,11 @@ class ObBuildIndexScheduler { void stop(); void wait(); - private: +private: ObBuildIndexScheduler(); virtual ~ObBuildIndexScheduler(); - private: +private: static const int64_t DEFAULT_DDL_BUCKET_NUM = 100000; static const int64_t CHECK_TENANT_SCHEMA_INTERVAL_US = 100 * 1000L; bool is_inited_; diff --git a/src/storage/ob_build_index_task.h b/src/storage/ob_build_index_task.h index ed55845b9..485394699 100644 --- a/src/storage/ob_build_index_task.h +++ b/src/storage/ob_build_index_task.h @@ -32,7 +32,7 @@ class ObUniqueCheckingTask; class ObReportIndexStatusTask; class ObBuildIndexDag : public share::ObIDag { - public: +public: ObBuildIndexDag(); virtual ~ObBuildIndexDag(); int init(const ObPartitionKey& pkey, storage::ObPartitionService* partition_service); @@ -73,7 +73,7 @@ class ObBuildIndexDag : public share::ObIDag { return static_cast(compat_mode_); } - private: +private: bool is_inited_; ObPartitionKey pkey_; compaction::ObBuildIndexParam param_; @@ -87,13 +87,13 @@ class ObBuildIndexDag : public share::ObIDag { }; class ObIndexPrepareTask : public share::ObITask { - public: +public: ObIndexPrepareTask(); virtual ~ObIndexPrepareTask(); int init(compaction::ObBuildIndexParam& param, compaction::ObBuildIndexContext* context); virtual int process(); - private: +private: int generate_report_index_status_task(ObBuildIndexDag* dag, ObUniqueCheckingTask* checking_task); int generate_compact_task(ObBuildIndexDag* dag, ObIndexMergeTask* merge_task, ObCompactToLatestTask*& compact_task); int generate_unique_checking_task( @@ -103,7 +103,7 @@ class ObIndexPrepareTask : public share::ObITask { int generate_local_sort_tasks(ObBuildIndexDag* dag, ObIndexLocalSortTask*& local_sort_task); int add_monitor_info(ObBuildIndexDag* dag); - private: +private: bool is_inited_; compaction::ObBuildIndexParam* param_; compaction::ObBuildIndexContext* context_; @@ -111,16 +111,16 @@ class ObIndexPrepareTask : public share::ObITask { }; class ObIndexLocalSortTask : public share::ObITask { - public: +public: ObIndexLocalSortTask(); virtual ~ObIndexLocalSortTask(); int init(const int64_t task_id, compaction::ObBuildIndexParam& param, compaction::ObBuildIndexContext* context); virtual int process(); - private: +private: virtual int generate_next_task(share::ObITask*& next_task); - private: +private: static const int64_t RETRY_INTERVAL = 100 * 1000; // 100ms bool is_inited_; int64_t task_id_; @@ -131,13 +131,13 @@ class ObIndexLocalSortTask : public share::ObITask { }; class ObIndexMergeTask : public share::ObITask { - public: +public: ObIndexMergeTask(); virtual ~ObIndexMergeTask(); int init(compaction::ObBuildIndexParam& param, compaction::ObBuildIndexContext* context); virtual int process(); - private: +private: int merge_local_sort_index(const compaction::ObBuildIndexParam& param, const ObIArray*>& local_sorters, ObExternalSort& merge_sorter, compaction::ObBuildIndexContext* context, @@ -148,7 +148,7 @@ class ObIndexMergeTask : public share::ObITask { int add_new_index_sstable(const compaction::ObBuildIndexParam& param, blocksstable::ObMacroBlockWriter* writer, const int64_t* column_checksum, ObTableHandle& new_sstable); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIndexMergeTask); bool is_inited_; compaction::ObBuildIndexParam* param_; @@ -160,7 +160,7 @@ class ObIndexMergeTask : public share::ObITask { }; class ObCompactToLatestTask : public share::ObITask { - public: +public: ObCompactToLatestTask(); virtual ~ObCompactToLatestTask(); int init(const common::ObPartitionKey& pkey, const compaction::ObBuildIndexParam& param, @@ -168,7 +168,7 @@ class ObCompactToLatestTask : public share::ObITask { virtual int process(); static int wait_compact_to_latest(const ObPartitionKey& pkey, const uint64_t index_id); - private: +private: static const int64_t RETRY_INTERVAL = 100 * 1000; // 100ms DISALLOW_COPY_AND_ASSIGN(ObCompactToLatestTask); bool is_inited_; @@ -178,7 +178,7 @@ class ObCompactToLatestTask : public share::ObITask { }; class ObUniqueIndexChecker { - public: +public: ObUniqueIndexChecker(); virtual ~ObUniqueIndexChecker() = default; int init(ObPartitionService* part_service, const common::ObPartitionKey& pkey, @@ -188,9 +188,9 @@ class ObUniqueIndexChecker { int check_local_index(share::ObIDag* dag, ObPartitionStorage* storage, const int64_t snapshot_version); int check_global_index(share::ObIDag* dag, ObPartitionStorage* storage); - private: +private: struct ObScanTableParam { - public: + public: ObScanTableParam() : data_table_schema_(NULL), index_schema_(NULL), @@ -229,7 +229,7 @@ class ObUniqueIndexChecker { int try_get_read_tables( const uint64_t table_id, const int64_t snapshot_version, share::ObIDag* dag, ObTablesHandle& tables_handle); - private: +private: static const int64_t RETRY_INTERVAL = 10 * 1000L; bool is_inited_; ObPartitionService* part_service_; @@ -242,13 +242,13 @@ class ObUniqueIndexChecker { }; class ObUniqueCheckingTask : public share::ObITask { - public: +public: ObUniqueCheckingTask(); virtual ~ObUniqueCheckingTask(); int init(const compaction::ObBuildIndexParam& param, compaction::ObBuildIndexContext* context); virtual int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObUniqueCheckingTask); bool is_inited_; const compaction::ObBuildIndexParam* param_; @@ -257,7 +257,7 @@ class ObUniqueCheckingTask : public share::ObITask { }; class ObReportIndexStatusTask : public share::ObITask { - public: +public: ObReportIndexStatusTask(); virtual ~ObReportIndexStatusTask(); int init( @@ -266,7 +266,7 @@ class ObReportIndexStatusTask : public share::ObITask { static int report_index_status(const common::ObPartitionKey& pkey, const compaction::ObBuildIndexParam& param, compaction::ObBuildIndexContext* context, bool& need_retry); - private: +private: bool is_inited_; ObPartitionKey pkey_; const compaction::ObBuildIndexParam* param_; @@ -275,22 +275,22 @@ class ObReportIndexStatusTask : public share::ObITask { }; class ObIUniqueCheckingCompleteCallback { - public: +public: virtual int operator()(const int ret_code) = 0; }; class ObGlobalUniqueIndexCallback : public ObIUniqueCheckingCompleteCallback { - public: +public: ObGlobalUniqueIndexCallback(const common::ObPartitionKey& pkey, const uint64_t index_id); int operator()(const int ret_code) override; - private: +private: common::ObPartitionKey pkey_; uint64_t index_id_; }; class ObLocalUniqueIndexCallback : public ObIUniqueCheckingCompleteCallback { - public: +public: ObLocalUniqueIndexCallback(); int operator()(const int ret_code) override; }; @@ -300,7 +300,7 @@ class ObLocalUniqueIndexCallback : public ObIUniqueCheckingCompleteCallback { * ROOTSERVICE the result of the unique key checking result */ class ObUniqueCheckingDag : public share::ObIDag { - public: +public: ObUniqueCheckingDag(); virtual ~ObUniqueCheckingDag(); int init(const common::ObPartitionKey& pkey, ObPartitionService* part_service, @@ -346,7 +346,7 @@ class ObUniqueCheckingDag : public share::ObIDag { return static_cast(compat_mode_); } - private: +private: bool is_inited_; ObPartitionService* part_service_; common::ObPartitionKey pkey_; @@ -362,16 +362,16 @@ class ObUniqueCheckingDag : public share::ObIDag { }; class ObUniqueCheckingPrepareTask : public share::ObITask { - public: +public: ObUniqueCheckingPrepareTask(); virtual ~ObUniqueCheckingPrepareTask() = default; int init(ObIUniqueCheckingCompleteCallback* callback); virtual int process() override; - private: +private: int generate_unique_checking_task(ObUniqueCheckingDag* dag); - private: +private: bool is_inited_; const share::schema::ObTableSchema* index_schema_; const share::schema::ObTableSchema* data_table_schema_; @@ -379,14 +379,14 @@ class ObUniqueCheckingPrepareTask : public share::ObITask { }; class ObSimpleUniqueCheckingTask : public share::ObITask { - public: +public: ObSimpleUniqueCheckingTask(); virtual ~ObSimpleUniqueCheckingTask() = default; int init(const share::schema::ObTableSchema* data_table_schema, const share::schema::ObTableSchema* index_schema, ObIUniqueCheckingCompleteCallback* callback); virtual int process() override; - private: +private: bool is_inited_; ObUniqueIndexChecker unique_checker_; const share::schema::ObTableSchema* index_schema_; diff --git a/src/storage/ob_callback_queue_thread.h b/src/storage/ob_callback_queue_thread.h index cc3990f33..89c8bf301 100644 --- a/src/storage/ob_callback_queue_thread.h +++ b/src/storage/ob_callback_queue_thread.h @@ -33,7 +33,7 @@ enum ObCbTaskType { }; class LeaderActiveArg { - public: +public: LeaderActiveArg() : is_elected_by_changing_leader_(false) {} ~LeaderActiveArg() @@ -45,7 +45,7 @@ class LeaderActiveArg { } TO_STRING_KV(K_(is_elected_by_changing_leader)); - public: +public: bool is_elected_by_changing_leader_; }; @@ -81,13 +81,13 @@ struct ObCbTask { }; class ObCallbackQueueThread : public lib::TGTaskHandler { - public: +public: static int64_t QUEUE_THREAD_NUM; static const int64_t MINI_MODE_QUEUE_THREAD_NUM = 2; ObCallbackQueueThread(); virtual ~ObCallbackQueueThread(); - public: +public: virtual int init(ObPartitionService* partition_service, int tg_id); virtual int push(const ObCbTask* task); virtual void handle(void* task); @@ -97,18 +97,18 @@ class ObCallbackQueueThread : public lib::TGTaskHandler { return tg_id_; } - private: +private: int get_task(ObCbTask*& task); void free_task(ObCbTask* task); - private: +private: bool inited_; ObPartitionService* partition_service_; common::ObFixedQueue free_queue_; ObCbTask* tasks_; int tg_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCallbackQueueThread); }; diff --git a/src/storage/ob_clog_cb_async_worker.h b/src/storage/ob_clog_cb_async_worker.h index f4dfb6508..1ad60ffab 100644 --- a/src/storage/ob_clog_cb_async_worker.h +++ b/src/storage/ob_clog_cb_async_worker.h @@ -50,7 +50,7 @@ struct ObCLogCallbackAsyncTask { TO_STRING_KV(K(pg_key_), K(partition_key_), K(log_type_), K(log_id_), K(is_physical_drop_)); - public: +public: common::ObPGKey pg_key_; common::ObPartitionKey partition_key_; int64_t log_type_; @@ -59,7 +59,7 @@ struct ObCLogCallbackAsyncTask { }; class ObCLogCallbackAsyncWorker : public common::M2SQueueThread { - public: +public: ObCLogCallbackAsyncWorker() : is_inited_(false), ptt_svr_(nullptr), free_queue_(), tasks_(nullptr){}; ~ObCLogCallbackAsyncWorker() { @@ -71,12 +71,12 @@ class ObCLogCallbackAsyncWorker : public common::M2SQueueThread { virtual void handle(void* task, void* pdata); int push_task(const ObCLogCallbackAsyncTask& task); - private: +private: int get_task(ObCLogCallbackAsyncTask*& task); void free_task(ObCLogCallbackAsyncTask* task); DISALLOW_COPY_AND_ASSIGN(ObCLogCallbackAsyncWorker); - private: +private: static const int64_t LONG_RETRY_INTERVAL = 100 * 1000; // 100ms static const int64_t RETRY_INTERVAL = 2 * 1000; // 2ms static const int64_t MAX_TASK_NUM = common::OB_MAX_PARTITION_NUM_PER_SERVER; diff --git a/src/storage/ob_col_map.h b/src/storage/ob_col_map.h index dae831c83..7c2072843 100644 --- a/src/storage/ob_col_map.h +++ b/src/storage/ob_col_map.h @@ -18,13 +18,13 @@ namespace oceanbase { namespace storage { class ObColMap { - public: +public: static const int64_t RP_LOCAL_NUM = 3; static const uint64_t FIRST_LEVEL_MAX_COL_NUM = 1024; static const uint64_t FIRST_LEVEL_MAP_COL_NUM = 1031; static const uint64_t FINAL_LEVEL_MAX_COL_NUM = 65536; - public: +public: ObColMap() : is_inited_(false), col_map_first_(), col_map_final_(NULL) {} @@ -48,12 +48,12 @@ class ObColMap { typedef common::hash::ObPlacementHashMap ColMapFirst; typedef common::hash::ObPlacementHashMap ColMapFinal; - private: +private: bool is_inited_; ColMapFirst col_map_first_; ColMapFinal* col_map_final_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObColMap); }; diff --git a/src/storage/ob_dag_warning_history_mgr.h b/src/storage/ob_dag_warning_history_mgr.h index 3f13cd57d..fef2ab4ef 100644 --- a/src/storage/ob_dag_warning_history_mgr.h +++ b/src/storage/ob_dag_warning_history_mgr.h @@ -26,7 +26,7 @@ namespace storage { template class ObNodeArray { - public: +public: ObNodeArray(); ~ObNodeArray(); void destory(); @@ -49,7 +49,7 @@ class ObNodeArray { template class ObInfoManager { - public: +public: ObInfoManager(); virtual ~ObInfoManager(); @@ -64,15 +64,15 @@ class ObInfoManager { return map_.size(); } - private: +private: typedef common::hash::ObHashMap InfoMap; // Value of map: index in node_array_ - protected: +protected: common::SpinRWLock lock_; int64_t max_cnt_; ObNodeArray node_array_; - private: +private: bool is_inited_; InfoMap map_; }; @@ -105,7 +105,7 @@ static common::ObString ObDagModuleStr[share::ObIDag::DAG_TYPE_MAX] = {"EMPTY", "OTHER"}; struct ObDagWarningInfo { - public: +public: ObDagWarningInfo(); ~ObDagWarningInfo(); void reset(); @@ -113,9 +113,9 @@ struct ObDagWarningInfo { K_(warning_info)); ObDagWarningInfo& operator=(const ObDagWarningInfo& other); - private: +private: bool operator==(const ObDagWarningInfo& other) const; // for unittest - public: +public: int64_t tenant_id_; share::ObDagId task_id_; share::ObIDag::ObIDagType dag_type_; @@ -143,7 +143,7 @@ inline void ObDagWarningInfo::reset() * */ class ObDagWarningHistoryManager : public ObInfoManager { - public: +public: ObDagWarningHistoryManager() {} ~ObDagWarningHistoryManager() @@ -163,10 +163,10 @@ class ObDagWarningHistoryManager : public ObInfoManager& primary_zone_array); int get_table_high_primary_region_array(share::schema::ObSchemaGetterGuard& schema_guard, const share::schema::ObTableSchema& table_schema, common::ObIArray& primary_region_array); - private: +private: bool is_inited_; share::schema::ObMultiVersionSchemaService* schema_service_; storage::ObLocalityManager* locality_manager_; diff --git a/src/storage/ob_file_system_router.h b/src/storage/ob_file_system_router.h index 56bf24060..724a4fda1 100644 --- a/src/storage/ob_file_system_router.h +++ b/src/storage/ob_file_system_router.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace storage { class ObFileSystemRouter final { - public: +public: static ObFileSystemRouter& get_instance(); int init(const char* data_dir, const char* cluster_name, const int64_t cluster_id, const char* zone, const char* svr_ip_port_str); @@ -58,7 +58,7 @@ class ObFileSystemRouter final { return sstable_dir_; } - private: +private: ObFileSystemRouter(); virtual ~ObFileSystemRouter() = default; @@ -66,7 +66,7 @@ class ObFileSystemRouter final { int init_local_dirs(const char* data_dir); int init_shm_file(const char* data_dir); - private: +private: char data_dir_[common::MAX_PATH_SIZE]; char slog_dir_[common::MAX_PATH_SIZE]; char clog_dir_[common::MAX_PATH_SIZE]; diff --git a/src/storage/ob_file_system_util.h b/src/storage/ob_file_system_util.h index f27ae622a..12c64b7f2 100644 --- a/src/storage/ob_file_system_util.h +++ b/src/storage/ob_file_system_util.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class ObFileSystemUtil final { - public: +public: static int open_tenant_info_file(const common::ObAddr& svr_addr, const uint64_t tenant_id, const int64_t file_id, const int open_flag, blocksstable::ObStorageFile*& tenant_info_file); @@ -33,7 +33,7 @@ class ObFileSystemUtil final { static int close_file(blocksstable::ObStorageFile* storage_file); - public: +public: static const int CREATE_FLAGS = O_RDWR | O_APPEND | O_CREAT | O_EXCL; static const int WRITE_FLAGS = O_RDWR | O_APPEND; static const int READ_FLAGS = O_RDONLY; diff --git a/src/storage/ob_freeze_async_task.h b/src/storage/ob_freeze_async_task.h index 709570c70..a54b33fbc 100644 --- a/src/storage/ob_freeze_async_task.h +++ b/src/storage/ob_freeze_async_task.h @@ -20,7 +20,7 @@ namespace storage { class ObPartitionService; class ObFreezeAsyncWorker { - public: +public: ObFreezeAsyncWorker() : inited_(false), async_task_(), timer_() {} ~ObFreezeAsyncWorker() @@ -37,9 +37,9 @@ class ObFreezeAsyncWorker { ObFreezeAsyncWorker(const ObFreezeAsyncWorker&) = delete; ObFreezeAsyncWorker& operator=(const ObFreezeAsyncWorker&) = delete; - private: +private: class ObFreezeAsyncTask : public common::ObTimerTask { - public: + public: ObFreezeAsyncTask() : inited_(false), partition_service_(NULL), @@ -61,7 +61,7 @@ class ObFreezeAsyncWorker { void fetch_task_with_lock_(int& in_freezing, int& needed_round); virtual void runTimerTask() override; - private: + private: bool inited_; ObPartitionService* partition_service_; int in_freezing_; diff --git a/src/storage/ob_freeze_info_snapshot_mgr.h b/src/storage/ob_freeze_info_snapshot_mgr.h index 9562196e0..b8b64d933 100644 --- a/src/storage/ob_freeze_info_snapshot_mgr.h +++ b/src/storage/ob_freeze_info_snapshot_mgr.h @@ -34,7 +34,7 @@ namespace storage { struct ObFrozenStatus; class ObFreezeInfoSnapshotMgr { - public: +public: struct FreezeInfoLite { int64_t freeze_version; int64_t freeze_ts; @@ -182,7 +182,7 @@ class ObFreezeInfoSnapshotMgr { ObFreezeInfoSnapshotMgr(); virtual ~ObFreezeInfoSnapshotMgr(); - private: +private: typedef common::RWLock::RLockGuard RLockGuard; typedef common::RWLock::WLockGuard WLockGuard; @@ -213,7 +213,7 @@ class ObFreezeInfoSnapshotMgr { class SchemaCache; class SchemaQuerySet { - public: + public: explicit SchemaQuerySet(SchemaCache& schema_cache); ~SchemaQuerySet() {} @@ -222,7 +222,7 @@ class ObFreezeInfoSnapshotMgr { int submit_async_schema_query(const uint64_t tenant_id, const int64_t freeze_version); int update_schema_cache(); - private: + private: struct SchemaQuery { SchemaQuery() : tenant_id_(0), freeze_version_(0) {} @@ -258,7 +258,7 @@ class ObFreezeInfoSnapshotMgr { }; class ReloadTask : public common::ObTimerTask { - public: + public: ReloadTask(ObFreezeInfoSnapshotMgr& mgr, SchemaQuerySet& schema_query_set); virtual ~ReloadTask() {} @@ -266,7 +266,7 @@ class ObFreezeInfoSnapshotMgr { virtual void runTimerTask(); int try_update_info(); - private: + private: int get_global_info_compat_below_220(int64_t& snapshot_gc_ts, common::ObIArray& gc_schema_version); int get_global_info(int64_t& snapshot_gc_ts, common::ObIArray& gc_schema_version); int get_freeze_info(int64_t& min_major_version, common::ObIArray& freeze_info); @@ -284,7 +284,7 @@ class ObFreezeInfoSnapshotMgr { // LRU cache of schema information for different tenant major version class SchemaCache { - public: + public: typedef common::ObSpinLockGuard SpinLockGuard; explicit SchemaCache(SchemaQuerySet& schema_query_set); @@ -300,7 +300,7 @@ class ObFreezeInfoSnapshotMgr { int update_schema_version(const uint64_t tenant_id, const int64_t freeze_version); - private: + private: // dlink list struct schema_node { // key @@ -342,10 +342,10 @@ class ObFreezeInfoSnapshotMgr { virtual int fetch_freeze_schema(const uint64_t tenant_id, const int64_t freeze_version, int64_t& schema_version, common::ObIArray& freeze_schema); - public: // for ut only + public: // for ut only int update_freeze_schema(const uint64_t tenant_id, const int64_t freeze_version, const int64_t schema_version); - private: + private: int update_freeze_schema(const int64_t freeze_version, common::ObIArray& freeze_schema); common::ObSpinLock lock_; @@ -374,9 +374,9 @@ class ObFreezeInfoSnapshotMgr { int64_t snapshot_gc_ts_; common::hash::ObHashMap gc_snapshot_info_[2]; - protected: +protected: SchemaCache schema_cache_; // query schema version based on tenant id and major freeze version - private: +private: common::ObSEArray info_list_[2]; // lite one doesnot contain schema_version common::ObSEArray snapshots_[2]; // snapshots_ matains multi_version_start for index and // others @@ -388,14 +388,14 @@ class ObFreezeInfoSnapshotMgr { }; class ObFreezeInfoMgrWrapper { - public: +public: static ObFreezeInfoSnapshotMgr& get_instance(const uint64_t table_id = common::OB_INVALID_ID); static int init(common::ObISQLClient& local_proxy, common::ObISQLClient& remote_proxy); static int start(); static void wait(); static void stop(); - private: +private: static ObFreezeInfoSnapshotMgr local_mgr_; static ObFreezeInfoSnapshotMgr remote_mgr_; }; diff --git a/src/storage/ob_fuse_row_cache_fetcher.h b/src/storage/ob_fuse_row_cache_fetcher.h index 866ec8794..c97e9283c 100644 --- a/src/storage/ob_fuse_row_cache_fetcher.h +++ b/src/storage/ob_fuse_row_cache_fetcher.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class ObFuseRowCacheFetcher final { - public: +public: ObFuseRowCacheFetcher(); ~ObFuseRowCacheFetcher() = default; int init(const ObTableAccessParam& access_param, ObTableAccessContext& access_ctx); @@ -28,7 +28,7 @@ class ObFuseRowCacheFetcher final { int put_fuse_row_cache(const ObStoreRowkey& rowkey, const int64_t sstable_end_log_ts, ObStoreRow& row, blocksstable::ObFuseRowValueHandle& handle); - private: +private: static const int64_t FUSE_ROW_CACHE_PUT_INTERVAL = 10 * 1000 * 1000; // 10s bool is_inited_; const ObTableAccessParam* access_param_; diff --git a/src/storage/ob_garbage_collector.cpp b/src/storage/ob_garbage_collector.cpp index 68c36d4d0..8d53fe10f 100644 --- a/src/storage/ob_garbage_collector.cpp +++ b/src/storage/ob_garbage_collector.cpp @@ -37,13 +37,13 @@ using namespace share; using namespace share::schema; namespace storage { class ObGarbageCollector::InsertPGFunctor { - public: +public: explicit InsertPGFunctor(const common::ObPGKey& pg_key) : pg_key_(pg_key), ret_value_(common::OB_SUCCESS) {} ~InsertPGFunctor() {} - public: +public: bool operator()(const common::ObAddr& leader, common::ObPartitionArray& pg_array) { if (OB_SUCCESS != (ret_value_ = pg_array.push_back(pg_key_))) { @@ -56,16 +56,16 @@ class ObGarbageCollector::InsertPGFunctor { return ret_value_; } - private: +private: common::ObPGKey pg_key_; int ret_value_; - private: +private: DISALLOW_COPY_AND_ASSIGN(InsertPGFunctor); }; class ObGarbageCollector::QueryPGIsValidMemberFunctor { - public: +public: QueryPGIsValidMemberFunctor(obrpc::ObSrvRpcProxy* rpc_proxy, ObPartitionService* partition_service, const common::ObAddr& self_addr, const int64_t gc_seq, ObGCCandidateArray& gc_candidates) : rpc_proxy_(rpc_proxy), @@ -78,7 +78,7 @@ class ObGarbageCollector::QueryPGIsValidMemberFunctor { ~QueryPGIsValidMemberFunctor() {} - public: +public: bool operator()(const common::ObAddr& leader, common::ObPartitionArray& pg_array) { if (OB_SUCCESS != (ret_value_ = handle_pg_array_(leader, pg_array))) { @@ -91,13 +91,13 @@ class ObGarbageCollector::QueryPGIsValidMemberFunctor { return ret_value_; } - private: +private: int handle_pg_array_(const common::ObAddr& leader, const common::ObPartitionArray& pg_array); int handle_rpc_response_(const common::ObAddr& leader, const obrpc::ObQueryIsValidMemberResponse& response); bool is_normal_readonly_replica_(ObIPartitionGroup* pg) const; int try_renew_location_(const common::ObPartitionArray& pg_array); - private: +private: obrpc::ObSrvRpcProxy* rpc_proxy_; ObPartitionService* partition_service_; common::ObAddr self_addr_; @@ -105,12 +105,12 @@ class ObGarbageCollector::QueryPGIsValidMemberFunctor { ObGCCandidateArray& gc_candidates_; int ret_value_; - private: +private: DISALLOW_COPY_AND_ASSIGN(QueryPGIsValidMemberFunctor); }; class ObGarbageCollector::QueryPGFlushedIlogIDFunctor { - public: +public: QueryPGFlushedIlogIDFunctor( obrpc::ObSrvRpcProxy* rpc_proxy, PGOfflineIlogFlushedInfoMap& pg_offline_ilog_flushed_info_map) : rpc_proxy_(rpc_proxy), @@ -120,7 +120,7 @@ class ObGarbageCollector::QueryPGFlushedIlogIDFunctor { ~QueryPGFlushedIlogIDFunctor() {} - public: +public: bool operator()(const common::ObAddr& leader, common::ObPartitionArray& pg_array) { if (OB_SUCCESS != (ret_value_ = handle_pg_array_(leader, pg_array))) { @@ -133,28 +133,28 @@ class ObGarbageCollector::QueryPGFlushedIlogIDFunctor { return ret_value_; } - private: +private: int handle_pg_array_(const common::ObAddr& leader, const common::ObPartitionArray& pg_array); int handle_rpc_response_(const common::ObAddr& server, const obrpc::ObQueryMaxFlushedILogIdResponse& response); - private: +private: obrpc::ObSrvRpcProxy* rpc_proxy_; PGOfflineIlogFlushedInfoMap& pg_offline_ilog_flushed_info_map_; int ret_value_; - private: +private: DISALLOW_COPY_AND_ASSIGN(QueryPGFlushedIlogIDFunctor); }; class ObGarbageCollector::ExecuteSchemaDropFunctor { - public: +public: ExecuteSchemaDropFunctor(common::ObMySQLProxy* sql_proxy, ObPartitionService* partition_service) : sql_proxy_(sql_proxy), partition_service_(partition_service), ret_value_(common::OB_SUCCESS) {} ~ExecuteSchemaDropFunctor() {} - public: +public: bool operator()(const common::ObPGKey& pg_key, const PGOfflineIlogFlushedInfo& info) { if (OB_SUCCESS != (ret_value_ = handle_each_pg_(pg_key, info))) { @@ -167,16 +167,16 @@ class ObGarbageCollector::ExecuteSchemaDropFunctor { return ret_value_; } - private: +private: int handle_each_pg_(const common::ObPGKey& pg_key, const PGOfflineIlogFlushedInfo& info); int delete_tenant_gc_partition_info_(const common::ObPGKey& pg_key); - private: +private: common::ObMySQLProxy* sql_proxy_; ObPartitionService* partition_service_; int ret_value_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ExecuteSchemaDropFunctor); }; diff --git a/src/storage/ob_garbage_collector.h b/src/storage/ob_garbage_collector.h index a9e11af72..0bf9a26b3 100644 --- a/src/storage/ob_garbage_collector.h +++ b/src/storage/ob_garbage_collector.h @@ -40,11 +40,11 @@ namespace storage { class ObIPartitionGroup; class ObPartitionService; class ObGarbageCollector : public share::ObThreadPool { - public: +public: ObGarbageCollector(); ~ObGarbageCollector(); - public: +public: int init(ObPartitionService* partition_service, transaction::ObTransService* trans_service, share::schema::ObMultiVersionSchemaService* schema_service, obrpc::ObSrvRpcProxy* rpc_proxy, common::ObMySQLProxy* sql_proxy, const common::ObAddr& self_addr); @@ -54,7 +54,7 @@ class ObGarbageCollector : public share::ObThreadPool { void destroy(); void run1(); - private: +private: class InsertPGFunctor; class QueryPGIsValidMemberFunctor; class QueryPGFlushedIlogIDFunctor; @@ -95,17 +95,17 @@ class ObGarbageCollector : public share::ObThreadPool { static const int64_t GC_SCHEMA_DROP_DELAY = 1800 * 1000 * 1000; // 30 minutes static const int64_t LOG_ARCHIVE_DROP_DELAY = GC_SCHEMA_DROP_DELAY; - private: +private: int gc_check_member_list_(ObGCCandidateArray& gc_candidates); int construct_server_pg_map_for_member_list_(ServerPGMap& server_pg_map) const; int handle_each_pg_for_member_list_(ServerPGMap& server_pg_map, ObGCCandidateArray& gc_candidates); - private: +private: int gc_check_schema_(ObGCCandidateArray& gc_candidates, TenantSet& gc_tenant_set); int gc_check_schema_(storage::ObIPartitionGroup* pg, share::schema::ObSchemaGetterGuard& schema_guard, TenantSet& gc_tenant_set, NeedGCReason& gc_reason); - private: +private: static bool is_gc_reason_leader_schema_drop_(const NeedGCReason& gc_reason); int execute_gc_except_leader_schema_drop_(const ObGCCandidateArray& gc_candidates); int execute_gc_for_leader_schema_drop_(const ObGCCandidateArray& gc_candidates); @@ -121,7 +121,7 @@ class ObGarbageCollector : public share::ObThreadPool { int execute_gc_tenant_tmp_file_(TenantSet& gc_tenant_set); bool check_gc_condition_() const; - private: +private: int gc_check_pg_schema_( storage::ObIPartitionGroup* pg, share::schema::ObSchemaGetterGuard& schema_guard, NeedGCReason& gc_reason); int handle_schema_drop_pg_(storage::ObIPartitionGroup* pg, const bool is_physical_removed, NeedGCReason& gc_reason); @@ -130,7 +130,7 @@ class ObGarbageCollector : public share::ObThreadPool { int follower_handle_schema_drop_pg_(storage::ObIPartitionGroup* pg, NeedGCReason& gc_reason); int gc_check_log_archive_(storage::ObIPartitionGroup* pg, const bool is_physical_removed, NeedGCReason& gc_reason); - private: +private: int gc_check_partition_schema_(storage::ObIPartitionGroup* pg, share::schema::ObSchemaGetterGuard& schema_guard, const common::ObPartitionKey& partition_key); int handle_schema_drop_partition_(storage::ObIPartitionGroup* pg, const common::ObPartitionKey& partition_key); @@ -138,11 +138,11 @@ class ObGarbageCollector : public share::ObThreadPool { int follower_handle_schema_drop_partition_( storage::ObIPartitionGroup* pg, const common::ObPartitionKey& partition_key); - private: +private: int construct_server_pg_map_( ServerPGMap& server_pg_map, const common::ObAddr& server, const common::ObPGKey& pg_key) const; - private: +private: bool is_inited_; ObPartitionService* partition_service_; transaction::ObTransService* trans_service_; @@ -152,7 +152,7 @@ class ObGarbageCollector : public share::ObThreadPool { common::ObAddr self_addr_; int64_t seq_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGarbageCollector); }; } // namespace storage diff --git a/src/storage/ob_handle_cache.h b/src/storage/ob_handle_cache.h index f118086f5..f461f14c3 100644 --- a/src/storage/ob_handle_cache.h +++ b/src/storage/ob_handle_cache.h @@ -26,7 +26,7 @@ constexpr int64_t next_pow2(const int64_t x) template class ObHandleCacheNode : public common::ObDLinkBase> { - public: +public: ObHandleCacheNode() : bucket_idx_(-1) {} virtual ~ObHandleCacheNode() @@ -50,7 +50,7 @@ class ObHandleCache { typedef ObHandleCacheNode CacheNode; typedef common::ObDList LRUList; - public: +public: ObHandleCache() { STATIC_ASSERT(N <= 8192, "number of bucket is larger than 8192"); @@ -124,7 +124,7 @@ class ObHandleCache { return ret; } - private: +private: static const uint64_t BUCKET_SIZE = next_pow2(N * 2); static const uint64_t MASK = BUCKET_SIZE - 1; CacheNode nodes_[N]; diff --git a/src/storage/ob_handle_mgr.h b/src/storage/ob_handle_mgr.h index 7bafeda79..45fdfcbde 100644 --- a/src/storage/ob_handle_mgr.h +++ b/src/storage/ob_handle_mgr.h @@ -20,7 +20,7 @@ namespace storage { template class ObHandleMgr { - public: +public: ObHandleMgr() : is_inited_(false), is_multi_(false), is_ordered_(false), last_handle_(NULL), handle_cache_(NULL) {} virtual ~ObHandleMgr() @@ -78,7 +78,7 @@ class ObHandleMgr { } TO_STRING_KV(KP_(last_handle), KP_(handle_cache)); - protected: +protected: typedef ObHandleCache HandleCache; bool is_inited_; bool is_multi_; diff --git a/src/storage/ob_i_partition_base_data_reader.h b/src/storage/ob_i_partition_base_data_reader.h index afc4a286d..7e3f32d78 100644 --- a/src/storage/ob_i_partition_base_data_reader.h +++ b/src/storage/ob_i_partition_base_data_reader.h @@ -58,7 +58,7 @@ struct ObMigrateSSTableInfo { // ObPartitionMacroBlockObReader (storage/ob_partition_base_data_ob_reader.cpp): data comes from remote ob // ObPartitionMacroBlockOSSReader (not implemented): data comes from backup oss class ObIPartitionMacroBlockReader { - public: +public: enum Type { MACRO_BLOCK_OB_READER = 0, MACRO_BLOCK_RESTORE_READER = 1, @@ -79,7 +79,7 @@ class ObIPartitionMacroBlockReader { int deserialize_macro_meta(char* buf, int64_t data_len, int64_t& pos, common::ObIAllocator& allocator, blocksstable::ObFullMacroBlockMeta& full_meta); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIPartitionMacroBlockReader); }; @@ -104,7 +104,7 @@ struct ObLogicTableMeta { }; class ObILogicBaseMetaReader { - public: +public: ObILogicBaseMetaReader() {} virtual ~ObILogicBaseMetaReader() @@ -112,12 +112,12 @@ class ObILogicBaseMetaReader { virtual int fetch_end_key_list(common::ObIArray& end_key_list) = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObILogicBaseMetaReader); }; class ObIPhysicalBaseMetaReader { - public: +public: enum Type { BASE_DATA_META_OB_READER, BASE_DATA_META_RESTORE_READER, @@ -135,12 +135,12 @@ class ObIPhysicalBaseMetaReader { virtual int fetch_macro_block_list(common::ObIArray& macro_block_list) = 0; virtual Type get_type() const = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIPhysicalBaseMetaReader); }; class ObIPGPartitionBaseDataMetaObReader { - public: +public: enum Type { BASE_DATA_META_OB_READER = 0, BASE_DATA_META_OB_COMPAT_READER = 1, @@ -156,7 +156,7 @@ class ObIPGPartitionBaseDataMetaObReader { virtual int fetch_pg_partition_meta_info(obrpc::ObPGPartitionMetaInfo& partition_meta_info) = 0; virtual Type get_type() const = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIPGPartitionBaseDataMetaObReader); }; @@ -201,7 +201,7 @@ struct ObMigrateTableInfo { void reuse(); TO_STRING_KV(K_(table_id), K_(multi_version_start), K_(ready_for_read), K_(major_sstables), K_(minor_sstables)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigrateTableInfo); }; @@ -219,12 +219,12 @@ struct ObMigratePartitionInfo final { void reset(); TO_STRING_KV(K_(src), K_(meta), K_(table_id_list), K_(table_infos), K_(is_restore)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigratePartitionInfo); }; class ObIPartitionGroupMetaRestoreReader { - public: +public: enum Type { PG_META_RESTORE_READER, PG_META_RESTORE_READER_V1, @@ -244,7 +244,7 @@ class ObIPartitionGroupMetaRestoreReader { }; class ObIPhyRestoreMacroIndexStore { - public: +public: enum Type { PHY_RESTORE_MACRO_INDEX_STORE_V1 = 1, PHY_RESTORE_MACRO_INDEX_STORE_V2 = 2, diff --git a/src/storage/ob_i_partition_component_factory.h b/src/storage/ob_i_partition_component_factory.h index 673a8804c..6339d2c12 100644 --- a/src/storage/ob_i_partition_component_factory.h +++ b/src/storage/ob_i_partition_component_factory.h @@ -81,7 +81,7 @@ class ObPhyRestoreMacroIndexStore; class ObPhyRestoreMacroIndexStoreV2; class ObIPartitionComponentFactory { - public: +public: virtual ~ObIPartitionComponentFactory() {} virtual ObIPartitionGroup* get_partition(const uint64_t tenant_id) = 0; diff --git a/src/storage/ob_i_partition_group.h b/src/storage/ob_i_partition_group.h index 8607c8d9e..7da4d52e7 100644 --- a/src/storage/ob_i_partition_group.h +++ b/src/storage/ob_i_partition_group.h @@ -161,7 +161,7 @@ class ObSplitPartitionInfoLogEntry; class ObPGPartitionGuard; class ObIPartitionGroup : public common::ObLink { - public: +public: ObIPartitionGroup() : ref_cnt_(0) {} virtual ~ObIPartitionGroup() @@ -526,7 +526,7 @@ class ObIPartitionGroup : public common::ObLink { virtual int inc_pending_elr_count(memtable::ObMemtableCtx& mt_ctx, const int64_t log_ts) = 0; TO_STRING_KV(K_(ref_cnt)); - protected: +protected: // resource usage statistics int32_t ref_cnt_; }; diff --git a/src/storage/ob_i_partition_report.h b/src/storage/ob_i_partition_report.h index 5337c3233..3f1a22bea 100644 --- a/src/storage/ob_i_partition_report.h +++ b/src/storage/ob_i_partition_report.h @@ -30,7 +30,7 @@ enum ObRebuildSwitch { }; class ObIPartitionReport { - public: +public: ObIPartitionReport() {} virtual ~ObIPartitionReport() diff --git a/src/storage/ob_i_partition_storage.h b/src/storage/ob_i_partition_storage.h index e69752b53..2ae9a8618 100644 --- a/src/storage/ob_i_partition_storage.h +++ b/src/storage/ob_i_partition_storage.h @@ -121,7 +121,7 @@ struct PartitionSSStoreInfo { }; class ObIPartitionStorage { - public: +public: ObIPartitionStorage() {} virtual ~ObIPartitionStorage() diff --git a/src/storage/ob_i_sample_iterator.h b/src/storage/ob_i_sample_iterator.h index 9142d68be..c59b0cb20 100644 --- a/src/storage/ob_i_sample_iterator.h +++ b/src/storage/ob_i_sample_iterator.h @@ -19,14 +19,14 @@ namespace oceanbase { namespace storage { class ObISampleIterator : public ObQueryRowIterator { - public: +public: explicit ObISampleIterator(const common::SampleInfo& sample_info); virtual ~ObISampleIterator(); - protected: +protected: bool return_this_sample(const int64_t num) const; - protected: +protected: const common::SampleInfo* sample_info_; }; diff --git a/src/storage/ob_i_store.h b/src/storage/ob_i_store.h index b89757139..f59e3bcf7 100644 --- a/src/storage/ob_i_store.h +++ b/src/storage/ob_i_store.h @@ -234,7 +234,7 @@ struct ObTableAccessContext; struct ObTableIterParam; struct ObMultiVersionRowkeyHelpper { - public: +public: enum MultiVersionRowkeyType { MVRC_NONE = 0, MVRC_OLD_VERSION = 1, // TransVersion:Use Before Version3.0 @@ -414,7 +414,7 @@ struct ObStoreRowDml { }; class ObFastQueryContext { - public: +public: ObFastQueryContext() : timestamp_(-1), memtable_(nullptr), mvcc_row_(nullptr), row_version_(0) {} ObFastQueryContext(const int64_t timestamp, void* memtable, void* mvcc_row, const int64_t row_version) @@ -459,7 +459,7 @@ class ObFastQueryContext { } TO_STRING_KV(K_(timestamp), KP_(memtable), KP_(mvcc_row), K_(row_version)); - private: +private: int64_t timestamp_; void* memtable_; void* mvcc_row_; @@ -509,7 +509,7 @@ struct ObRowPositionFlag { }; struct ObStoreRowLockState { - public: +public: ObStoreRowLockState() : is_locked_(false), trans_version_(0), lock_trans_id_() {} void reset(); @@ -522,7 +522,7 @@ struct ObStoreRowLockState { struct ObStoreRow { OB_UNIS_VERSION(1); - public: +public: ObStoreRow() : flag_(-1), capacity_(0), @@ -666,7 +666,7 @@ struct ObStoreRow { }; struct ObMagicRowManager { - public: +public: ObMagicRowManager() = delete; ~ObMagicRowManager() = delete; static int make_magic_row( @@ -776,7 +776,7 @@ void free_store_row(AllocatorT& allocator, ObStoreRow*& row) } class ObIStoreRowIterator { - public: +public: ObIStoreRowIterator() {} virtual ~ObIStoreRowIterator() @@ -785,7 +785,7 @@ class ObIStoreRowIterator { }; class ObStoreRowIterator : public ObIStoreRowIterator { - public: +public: ObStoreRowIterator() : type_(0) {} virtual ~ObStoreRowIterator() @@ -854,10 +854,10 @@ class ObStoreRowIterator : public ObIStoreRowIterator { } VIRTUAL_TO_STRING_KV(K_(type)); - protected: +protected: int type_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStoreRowIterator); }; @@ -870,7 +870,7 @@ enum ObQRIterType { }; class ObQueryRowIterator : public ObIStoreRowIterator { - public: +public: ObQueryRowIterator() : type_(T_INVALID_ITER_TYPE) {} explicit ObQueryRowIterator(const ObQRIterType type) : type_(type) @@ -894,21 +894,21 @@ class ObQueryRowIterator : public ObIStoreRowIterator { } VIRTUAL_TO_STRING_KV(K_(type)); - public: +public: ObQRIterType get_type() const { return type_; } - protected: +protected: ObQRIterType type_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObQueryRowIterator); }; class ObQueryRowIteratorAdapter : public ObQueryRowIterator { - public: +public: ObQueryRowIteratorAdapter(const ObQRIterType type, ObIStoreRowIterator& iter); virtual ~ObQueryRowIteratorAdapter(); @@ -922,7 +922,7 @@ class ObQueryRowIteratorAdapter : public ObQueryRowIterator { virtual void reset() override; - private: +private: ObIStoreRowIterator& iter_; ObStoreRow row_; common::ObIAllocator* allocator_; @@ -933,13 +933,13 @@ class ObQueryRowIteratorAdapter : public ObQueryRowIterator { }; class ObVPCompactIter : public storage::ObIStoreRowIterator { - public: +public: ObVPCompactIter(); virtual ~ObVPCompactIter(); int init(const int64_t rowkey_cnt, ObIStoreRowIterator* scan_iter); virtual int get_next_row(const storage::ObStoreRow*& row) override; - private: +private: ObIStoreRowIterator* scan_iter_; int64_t rowkey_cnt_; bool is_inited_; @@ -1048,7 +1048,7 @@ struct ObTableAccessStat { }; struct ObGetTableParam { - public: +public: ObGetTableParam() : partition_store_(NULL), frozen_version_(-1), sample_info_(), tables_handle_(NULL) {} ~ObGetTableParam() = default; @@ -1067,7 +1067,7 @@ struct ObGetTableParam { // Parameters for row iteration like ObITable get, scan, multi_get, multi_scan // and ObStoreRowIterator::init struct ObTableIterParam { - public: +public: // only use in mini merge enum ObIterTransNodeMode { OIM_ITER_OVERFLOW_TO_COMPLEMENT = 1, @@ -1075,7 +1075,7 @@ struct ObTableIterParam { OIM_ITER_FULL = 3, }; - public: +public: ObTableIterParam(); virtual ~ObTableIterParam(); void reset(); @@ -1092,7 +1092,7 @@ struct ObTableIterParam { KP_(full_projector), KP_(out_cols_project), KP_(out_cols_param), KP_(full_out_cols_param), K_(is_multi_version_minor_merge), KP_(full_out_cols), KP_(full_cols_id_map), K_(need_scn), K_(iter_mode)); - public: +public: uint64_t table_id_; int64_t schema_version_; int64_t rowkey_cnt_; @@ -1112,7 +1112,7 @@ struct ObTableIterParam { }; class ObColDescArrayParam final { - public: +public: ObColDescArrayParam() : local_cols_(), ref_cols_(nullptr), col_cnt_(0), is_local_(false), is_inited_(false) {} ~ObColDescArrayParam() = default; @@ -1137,7 +1137,7 @@ class ObColDescArrayParam final { TO_STRING_KV(K(local_cols_), KPC_(ref_cols), K_(col_cnt), K(is_local_), K(is_inited_)); - private: +private: ObColDescArray local_cols_; const ObColDescIArray* ref_cols_; uint16_t col_cnt_; // max column == 512 @@ -1201,7 +1201,7 @@ struct ObFastAggProjectCell { }; struct ObTableAccessParam { - public: +public: ObTableAccessParam(); virtual ~ObTableAccessParam(); void reset(); @@ -1232,14 +1232,14 @@ struct ObTableAccessParam { return NULL != index_back_project_; } - public: +public: TO_STRING_KV(K_(iter_param), K_(reserve_cell_cnt), K_(out_col_desc_param), KP_(full_out_cols), KP_(out_cols_param), KP_(index_back_project), KP_(join_key_project), KP_(right_key_project), KP_(padding_cols), KP_(filters), KP_(virtual_column_exprs), KP_(index_projector), K_(projector_size), KP_(output_exprs), KP_(op), KP_(op_filters), KP_(row2exprs_projector), KP_(join_key_project), KP_(right_key_project), KP_(fast_agg_project), K_(enable_fast_skip), K_(need_fill_scale), K_(col_scale_info)); - public: +public: // 1. Basic Param for Table Iteration ObTableIterParam iter_param_; int64_t reserve_cell_cnt_; @@ -1275,7 +1275,7 @@ struct ObTableAccessParam { }; class ObLobLocatorHelper { - public: +public: ObLobLocatorHelper(); virtual ~ObLobLocatorHelper(); void reset(); @@ -1288,14 +1288,14 @@ class ObLobLocatorHelper { TO_STRING_KV( K_(table_id), K_(snapshot_version), K_(rowid_version), KPC(rowid_project_), K_(rowid_objs), K_(is_inited)); - private: +private: static const int64_t DEFAULT_LOCATOR_OBJ_ARRAY_SIZE = 8; int init_rowid_version(const share::schema::ObTableSchema& table_schema); int build_rowid_obj(common::ObNewRow& row, common::ObString& rowid_str, bool is_projected_row, const common::ObIArray& out_project); int build_lob_locator(common::ObObj& lob_obj, const uint64_t column_id, const common::ObString& rowid_str); - private: +private: uint64_t table_id_; int64_t snapshot_version_; int64_t rowid_version_; @@ -1366,10 +1366,10 @@ struct ObTableAccessContext { KP_(block_cache_ws), K_(out_cnt), K_(is_end), K_(trans_version_range), KP_(row_filter), K_(merge_log_ts), K_(read_out_type), K_(lob_locator_helper)); - private: +private: int build_lob_locator_helper(ObTableScanParam& scan_param, const common::ObVersionRange& trans_version_range); - public: +public: bool is_inited_; int64_t timeout_; common::ObPartitionKey pkey_; @@ -1405,7 +1405,7 @@ struct ObTableAccessContext { }; struct ObRowsInfo final { - public: +public: explicit ObRowsInfo(); ~ObRowsInfo(); OB_INLINE bool is_valid() const @@ -1446,7 +1446,7 @@ struct ObRowsInfo final { TO_STRING_KV(K_(ext_rowkeys), K_(min_key), K_(table_id), K_(row_count), K_(delete_count), K_(collation_free_transformed), K_(exist_helper)); - public: +public: struct ExistHelper final { ExistHelper(); ~ExistHelper(); @@ -1470,7 +1470,7 @@ struct ObRowsInfo final { bool is_inited_; }; - private: +private: struct RowsCompare { RowsCompare(common::ObIArray* cmp_funcs, common::ObStoreRowkey& dup_key, const bool check_dup, int16_t& max_prefix_length, int& ret); @@ -1498,10 +1498,10 @@ struct ObRowsInfo final { int& ret_; }; - private: +private: int ensure_space(const int64_t row_count); - public: +public: ObStoreRow* rows_; int64_t row_count_; common::ObArray ext_rowkeys_; @@ -1509,7 +1509,7 @@ struct ObRowsInfo final { common::ObExtStoreRowkey prefix_rowkey_; uint64_t table_id_; - private: +private: common::ObStoreRowkey min_key_; lib::MemoryContext* scan_mem_; // scan/rescan level memory entity, only for query int64_t delete_count_; diff --git a/src/storage/ob_i_table.h b/src/storage/ob_i_table.h index e34c3c140..02d913f4b 100644 --- a/src/storage/ob_i_table.h +++ b/src/storage/ob_i_table.h @@ -35,7 +35,7 @@ class ObTableCompater; class ObITable { OB_UNIS_VERSION(1); - public: +public: enum TableType { MEMTABLE = 0, MAJOR_SSTABLE = 1, @@ -54,7 +54,7 @@ class ObITable { struct TableKey { OB_UNIS_VERSION(1); - public: + public: TableKey(); TableKey(const ObITable::TableType& table_type, const common::ObPartitionKey& pkey, const uint64_t table_id, const common::ObVersionRange& trans_version_range, const common::ObVersion& version, @@ -396,17 +396,17 @@ class ObITable { return is_table_type_valid(table_type) ? table_type_name_[table_type] : nullptr; } - protected: +protected: TableKey key_; int64_t ref_cnt_; - private: +private: static const char* table_type_name_[TableType::MAX_TABLE_TYPE]; DISALLOW_COPY_AND_ASSIGN(ObITable); }; class ObTableHandle final { - public: +public: ObTableHandle(); ~ObTableHandle(); storage::ObITable* get_table() @@ -429,13 +429,13 @@ class ObTableHandle final { int get_sstable_schema_version(int64_t& schema_version) const; TO_STRING_KV(KP(table_), K(table_)); - private: +private: storage::ObITable* table_; DISALLOW_COPY_AND_ASSIGN(ObTableHandle); }; class ObTablesHandle final { - public: +public: typedef common::ObSEArray TableArray; ObTablesHandle(); ~ObTablesHandle(); @@ -492,7 +492,7 @@ class ObTablesHandle final { int check_continues(const common::ObLogTsRange* log_ts_range); DECLARE_TO_STRING; - private: +private: TableArray tables_; int64_t protection_cnt_; const bool* memstore_retired_; @@ -509,7 +509,7 @@ OB_INLINE bool ObTablesHandle::check_store_expire() const } class ObTableProtector { - public: +public: static void hold(ObITable& table); static void release(ObITable& table); }; diff --git a/src/storage/ob_index_merge.h b/src/storage/ob_index_merge.h index ef6d24b17..aebbfcdbd 100644 --- a/src/storage/ob_index_merge.h +++ b/src/storage/ob_index_merge.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace storage { class ObTableScanParam; class ObIndexMerge : public ObQueryRowIterator { - public: +public: ObIndexMerge(); virtual ~ObIndexMerge(); virtual int init(const ObTableAccessParam& param, const ObTableAccessParam& index_param, @@ -38,7 +38,7 @@ class ObIndexMerge : public ObQueryRowIterator { int set_tables(const common::ObIArray& tables); int switch_iterator(const int64_t range_array_idx); - private: +private: static const int64_t MAX_NUM_PER_BATCH = 1000; ObQueryRowIterator* index_iter_; ObQueryRowIterator* main_iter_; @@ -51,7 +51,7 @@ class ObIndexMerge : public ObQueryRowIterator { ObArray rowkey_range_idx_; int64_t index_range_array_cursor_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIndexMerge); }; diff --git a/src/storage/ob_interm_macro_mgr.h b/src/storage/ob_interm_macro_mgr.h index f2bbc7a14..18881be92 100644 --- a/src/storage/ob_interm_macro_mgr.h +++ b/src/storage/ob_interm_macro_mgr.h @@ -26,7 +26,7 @@ class ObIntermMacroMgr; struct ObIntermMacroKey { OB_UNIS_VERSION(1); - public: +public: ObIntermMacroKey(); virtual ~ObIntermMacroKey(); inline int64_t hash() const; @@ -37,7 +37,7 @@ struct ObIntermMacroKey { }; class ObIntermMacroValue { - public: +public: ObIntermMacroValue(); virtual ~ObIntermMacroValue(); int set_macro_block(blocksstable::ObMacroBlocksWriteCtx& macro_block_ctx); @@ -54,24 +54,24 @@ class ObIntermMacroValue { int deep_copy(char* buf, const int64_t buf_len, ObIntermMacroValue*& value); TO_STRING_KV(K_(macro_block_write_ctx)); - private: +private: blocksstable::ObMacroBlocksWriteCtx macro_block_write_ctx_; }; class ObIntermMacroHandle : public ObResourceHandle { friend class ObIntermMacroMgr; - public: +public: ObIntermMacroHandle(); virtual ~ObIntermMacroHandle(); void reset(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIntermMacroHandle); }; class ObIntermMacroMgr { - public: +public: static ObIntermMacroMgr& get_instance(); int init(); int put(const ObIntermMacroKey& key, blocksstable::ObMacroBlocksWriteCtx& macro_block_ctx); @@ -80,11 +80,11 @@ class ObIntermMacroMgr { void destroy(); int dec_handle_ref(ObIntermMacroHandle& handle); - private: +private: ObIntermMacroMgr(); virtual ~ObIntermMacroMgr(); - private: +private: static const int64_t DEFAULT_BUCKET_NUM = 1543L; static const int64_t TOTAL_LIMIT = 1 * 1024L * 1024L * 1024L; static const int64_t HOLD_LIMIT = 8 * 1024L * 1024L; diff --git a/src/storage/ob_locality_manager.h b/src/storage/ob_locality_manager.h index f1dfb1454..0cdb9bff5 100644 --- a/src/storage/ob_locality_manager.h +++ b/src/storage/ob_locality_manager.h @@ -25,7 +25,7 @@ class ObRemoteSqlProxy; } namespace storage { class ObLocalityManager : public share::ObILocalityManager, public share::ObIServerAuth { - public: +public: ObLocalityManager(); virtual ~ObLocalityManager() { @@ -60,13 +60,13 @@ class ObLocalityManager : public share::ObILocalityManager, public share::ObISer virtual int is_local_server(const common::ObAddr& server, bool& is_local); int is_same_zone(const common::ObAddr& server, bool& is_same_zone); - private: +private: int get_locality_zone(const uint64_t tenant_id, share::ObLocalityZone& locality_zone); int set_locality_info(share::ObLocalityInfo& locality_info); int check_if_locality_has_been_loaded(); int set_partition_region_priority(); - private: +private: bool is_inited_; mutable common::SpinRWLock rwlock_; common::ObAddr self_; diff --git a/src/storage/ob_long_ops_monitor.h b/src/storage/ob_long_ops_monitor.h index 9e3555f76..3a7d8f4ea 100644 --- a/src/storage/ob_long_ops_monitor.h +++ b/src/storage/ob_long_ops_monitor.h @@ -193,12 +193,12 @@ struct ObCreateIndexPartitionStat : public ObILongOpsStat { class ObILongOpsStatHandle : public ObResourceHandle { friend class ObLongOpsMonitor; - public: +public: ObILongOpsStatHandle(); virtual ~ObILongOpsStatHandle(); void reset(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObILongOpsStatHandle); }; @@ -206,7 +206,7 @@ using MAP = storage::ObResourceMap; using PAIR = common::hash::HashMapPair; class ObLongOpsMonitor { - public: +public: static ObLongOpsMonitor& get_instance(); int init(); int add_long_ops_stat(const ObILongOpsKey& key, ObILongOpsStat& stat); @@ -217,11 +217,11 @@ class ObLongOpsMonitor { int foreach (Callback& callback); int dec_handle_ref(ObILongOpsStatHandle& handle); - private: +private: ObLongOpsMonitor(); virtual ~ObLongOpsMonitor(); - private: +private: static const int64_t DEFAULT_BUCKET_NUM = 1543L; static const int64_t TOTAL_LIMIT = 10 * 1024L * 1024L * 1024L; static const int64_t HOLD_LIMIT = 8 * 1024L * 1024L; @@ -231,14 +231,14 @@ class ObLongOpsMonitor { }; class ObLongOpsMonitorIterator { - public: +public: class ObKeySnapshotCallback { - public: + public: explicit ObKeySnapshotCallback(common::ObIArray& key_snapshot); virtual ~ObKeySnapshotCallback() = default; int operator()(PAIR& pair); - private: + private: common::ObIArray& key_snapshot_; }; ObLongOpsMonitorIterator(); @@ -246,24 +246,24 @@ class ObLongOpsMonitorIterator { int init(); int get_next_stat(ObILongOpsStatHandle& part_stat); - private: +private: int make_key_snapshot(); - private: +private: bool is_inited_; common::ObArray key_snapshot_; int64_t key_cursor_; }; class ObPurgeCompletedMonitorInfoTask : public common::ObTimerTask { - public: +public: ObPurgeCompletedMonitorInfoTask(); virtual ~ObPurgeCompletedMonitorInfoTask(){}; int init(share::schema::ObMultiVersionSchemaService* schema_service, int tg_id); void destroy(); virtual void runTimerTask() override; - private: +private: static const int64_t MAX_BATCH_COUNT = 10000; static const int64_t SCHEDULE_INTERVAL = 3600 * 1000; // 1h bool is_inited_; diff --git a/src/storage/ob_macro_block_iterator.h b/src/storage/ob_macro_block_iterator.h index c563810f9..510ef4813 100644 --- a/src/storage/ob_macro_block_iterator.h +++ b/src/storage/ob_macro_block_iterator.h @@ -46,7 +46,7 @@ struct ObMacroBlockDesc { }; class ObMacroBlockRowComparor { - public: +public: ObMacroBlockRowComparor(); virtual ~ObMacroBlockRowComparor(); bool operator()(const blocksstable::MacroBlockId& block_id, const common::ObStoreRowkey& rowkey); @@ -73,10 +73,10 @@ class ObMacroBlockRowComparor { return ret_; } - private: +private: int compare_(const blocksstable::MacroBlockId& block_id, const common::ObStoreRowkey& rowkey, int32_t& cmp_ret); - private: +private: int ret_; bool use_collation_free_; bool is_prefix_check_; @@ -86,7 +86,7 @@ class ObMacroBlockRowComparor { }; class ObMacroBlockIterator { - public: +public: ObMacroBlockIterator(); virtual ~ObMacroBlockIterator(); void reset(); @@ -108,7 +108,7 @@ class ObMacroBlockIterator { return (cur_idx_ < begin_ || cur_idx_ > end_); } - private: +private: int locate_macro_block(const common::ObExtStoreRowkey& ext_rowkey, int64_t& block_idx); int locate_macro_block_without_helper(const common::ObExtStoreRowkey& ext_rowkey, int64_t& block_idx); ObSSTable* sstable_; diff --git a/src/storage/ob_macro_meta_replay_map.h b/src/storage/ob_macro_meta_replay_map.h index b10e5cbb1..6801f4778 100644 --- a/src/storage/ob_macro_meta_replay_map.h +++ b/src/storage/ob_macro_meta_replay_map.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { struct ObMacroBlockKey final { - public: +public: ObMacroBlockKey(); ObMacroBlockKey(const ObITable::TableKey& table_key, const blocksstable::MacroBlockId& macro_block_id); ~ObMacroBlockKey() = default; @@ -33,7 +33,7 @@ struct ObMacroBlockKey final { }; class ObMacroMetaReplayMap final { - public: +public: ObMacroMetaReplayMap(); ~ObMacroMetaReplayMap(); @@ -44,7 +44,7 @@ class ObMacroMetaReplayMap final { int remove(const ObITable::TableKey& table_key, const blocksstable::MacroBlockId& block_id); int remove(const ObITable::TableKey& table_key, const common::ObIArray& block_ids); - private: +private: static const int64_t REPLAY_BUCKET_CNT = 10000; typedef common::hash::ObHashMap MAP; MAP map_; diff --git a/src/storage/ob_micro_block_handle_mgr.h b/src/storage/ob_micro_block_handle_mgr.h index e208e273a..37f6d0052 100644 --- a/src/storage/ob_micro_block_handle_mgr.h +++ b/src/storage/ob_micro_block_handle_mgr.h @@ -44,7 +44,7 @@ struct ObMicroBlockDataHandle { }; class ObMicroBlockHandleMgr : public ObHandleMgr { - public: +public: ObMicroBlockHandleMgr() = default; virtual ~ObMicroBlockHandleMgr() = default; int get_micro_block_handle(const uint64_t table_id, const blocksstable::ObMacroBlockCtx& block_ctx, diff --git a/src/storage/ob_micro_block_index_handle_mgr.h b/src/storage/ob_micro_block_index_handle_mgr.h index 06d780461..2aea9dcfb 100644 --- a/src/storage/ob_micro_block_index_handle_mgr.h +++ b/src/storage/ob_micro_block_index_handle_mgr.h @@ -38,7 +38,7 @@ struct ObMicroBlockIndexHandle { }; class ObMicroBlockIndexHandleMgr : public ObHandleMgr { - public: +public: ObMicroBlockIndexHandleMgr() = default; virtual ~ObMicroBlockIndexHandleMgr() = default; int get_block_index_handle(const uint64_t table_id, const blocksstable::ObMacroBlockCtx& block_ctx, diff --git a/src/storage/ob_migrate_logic_row_writer.h b/src/storage/ob_migrate_logic_row_writer.h index afeb9ac8b..9c35cdd27 100644 --- a/src/storage/ob_migrate_logic_row_writer.h +++ b/src/storage/ob_migrate_logic_row_writer.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class ObMigrateLogicRowWriter { - public: +public: ObMigrateLogicRowWriter(); virtual ~ObMigrateLogicRowWriter() {} @@ -35,7 +35,7 @@ class ObMigrateLogicRowWriter { return data_checksum_; } - private: +private: bool is_inited_; ObILogicRowIterator* iterator_; int64_t data_checksum_; diff --git a/src/storage/ob_migrate_macro_block_writer.h b/src/storage/ob_migrate_macro_block_writer.h index 27dbe603b..c781d84a9 100644 --- a/src/storage/ob_migrate_macro_block_writer.h +++ b/src/storage/ob_migrate_macro_block_writer.h @@ -20,7 +20,7 @@ namespace storage { class ObIPartitionMacroBlockReader; class ObPartitionMacroBlockOfsReader; class ObIMigrateMacroBlockWriter { - public: +public: ObIMigrateMacroBlockWriter() {} virtual ~ObIMigrateMacroBlockWriter() @@ -29,7 +29,7 @@ class ObIMigrateMacroBlockWriter { }; class ObMigrateMacroBlockWriter : public ObIMigrateMacroBlockWriter { - public: +public: ObMigrateMacroBlockWriter(); virtual ~ObMigrateMacroBlockWriter() {} @@ -37,7 +37,7 @@ class ObMigrateMacroBlockWriter : public ObIMigrateMacroBlockWriter { virtual int process(blocksstable::ObMacroBlocksWriteCtx& copied_ctx); - private: +private: int check_macro_block(const blocksstable::ObFullMacroBlockMeta& meta, const blocksstable::ObBufferReader& data); bool is_inited_; uint64_t tenant_id_; diff --git a/src/storage/ob_migrate_retry_queue_thread.h b/src/storage/ob_migrate_retry_queue_thread.h index 5e8f0e8f5..07248e249 100644 --- a/src/storage/ob_migrate_retry_queue_thread.h +++ b/src/storage/ob_migrate_retry_queue_thread.h @@ -45,13 +45,13 @@ struct ObMigrateRetryTask { }; class ObMigrateRetryQueueThread : public lib::TGTaskHandler { - public: +public: static const int64_t QUEUE_THREAD_NUM = 4; static const int64_t MINI_MODE_QUEUE_THREAD_NUM = 2; ObMigrateRetryQueueThread(); virtual ~ObMigrateRetryQueueThread(); - public: +public: virtual int init(ObPartitionService* partition_service, int tg_id); virtual int push(const ObMigrateRetryTask* task); virtual void handle(void* task); @@ -61,18 +61,18 @@ class ObMigrateRetryQueueThread : public lib::TGTaskHandler { return tg_id_; } - private: +private: int get_task(ObMigrateRetryTask*& task); void free_task(ObMigrateRetryTask* task); - private: +private: bool inited_; ObPartitionService* partition_service_; common::ObFixedQueue free_queue_; ObMigrateRetryTask* tasks_; int tg_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigrateRetryQueueThread); }; diff --git a/src/storage/ob_ms_row_iterator.h b/src/storage/ob_ms_row_iterator.h index 2c4c32940..5bb3fb33a 100644 --- a/src/storage/ob_ms_row_iterator.h +++ b/src/storage/ob_ms_row_iterator.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class ObMSRowIterator : public ObIStoreRowIterator { - public: +public: ObMSRowIterator(); ~ObMSRowIterator(); int init(ObTablesHandle& tables_handle, const share::schema::ObTableSchema& table_schema, ObExtStoreRange& range, @@ -32,12 +32,12 @@ class ObMSRowIterator : public ObIStoreRowIterator { void reuse(); int get_next_row(const storage::ObStoreRow*& store_row); - private: +private: int init_merge_param(ObTablesHandle& tables_handle, const share::schema::ObTableSchema& table_schema, const ObVersionRange& version_range); int inner_get_next(); - private: +private: bool is_inited_; common::ObArenaAllocator allocator_; compaction::ObIPartitionMergeFuser::MERGE_ITER_ARRAY macro_row_iters_; // Store all macro_row_iter corresponding to diff --git a/src/storage/ob_multi_version_col_desc_generate.h b/src/storage/ob_multi_version_col_desc_generate.h index 2994b7ebb..a6001952c 100644 --- a/src/storage/ob_multi_version_col_desc_generate.h +++ b/src/storage/ob_multi_version_col_desc_generate.h @@ -39,10 +39,10 @@ struct ObMultiVersionRowInfo { }; class ObMultiVersionColDescGenerate { - public: +public: typedef common::ObSEArray OutColsProject; - public: +public: ObMultiVersionColDescGenerate(); ~ObMultiVersionColDescGenerate(); int init(const share::schema::ObTableSchema* schema); @@ -54,10 +54,10 @@ class ObMultiVersionColDescGenerate { } int generate_multi_version_row_info(const ObMultiVersionRowInfo*& multi_version_row_info); - private: +private: int generate_out_cols_project(const common::ObIArray& column_ids); - private: +private: bool is_inited_; const share::schema::ObTableSchema* schema_; ObMultiVersionRowInfo row_info_; diff --git a/src/storage/ob_multi_version_table_store.h b/src/storage/ob_multi_version_table_store.h index e6f3e4620..2cadc056f 100644 --- a/src/storage/ob_multi_version_table_store.h +++ b/src/storage/ob_multi_version_table_store.h @@ -21,7 +21,7 @@ namespace storage { class ObPGMemtableMgr; class ObMultiVersionTableStore { - public: +public: typedef common::hash::ObHashSet TableSet; static const int64_t MAX_KETP_VERSION_SHIFT_NUM = 4L; static const int64_t MAX_KETP_VERSION_NUM = 1LL << MAX_KETP_VERSION_SHIFT_NUM; @@ -115,7 +115,7 @@ class ObMultiVersionTableStore { DECLARE_VIRTUAL_TO_STRING; - private: +private: struct ObGCSSTableInfo final { ObSSTable* sstable_; int64_t retired_ts_; @@ -134,7 +134,7 @@ class ObMultiVersionTableStore { int add_gc_minor_sstable(const int64_t gc_ts, ObSSTable* table, const int64_t max_deferred_gc_count); int add_complement_minor_sstable_if_needed_(AddTableParam& param, ObTableStore& store); - private: +private: bool is_inited_; common::ObPartitionKey pkey_; uint64_t table_id_; diff --git a/src/storage/ob_multiple_get_merge.h b/src/storage/ob_multiple_get_merge.h index 1dbecc920..844efbc06 100644 --- a/src/storage/ob_multiple_get_merge.h +++ b/src/storage/ob_multiple_get_merge.h @@ -29,7 +29,7 @@ enum class ObMultiGetRowState { }; struct ObQueryRowInfo final { - public: +public: ObQueryRowInfo() : row_(), nop_pos_(), @@ -49,7 +49,7 @@ struct ObQueryRowInfo final { }; class ObMultipleGetMerge : public ObMultipleMerge { - public: +public: ObMultipleGetMerge(); virtual ~ObMultipleGetMerge(); int open(const common::ObIArray& rowkeys); @@ -62,7 +62,7 @@ class ObMultipleGetMerge : public ObMultipleMerge { virtual void reuse() override; virtual int is_range_valid() const override; - protected: +protected: virtual int prepare() override; virtual int calc_scan_range() override; virtual int construct_iters() override; @@ -70,7 +70,7 @@ class ObMultipleGetMerge : public ObMultipleMerge { virtual void collect_merge_stat(ObTableStoreStat& stat) const override; virtual int skip_to_range(const int64_t range_idx) override; - private: +private: int construct_iters_with_fuse_row_cache(); int construct_iters_without_fuse_row_cache(); int inner_get_next_row_with_fuse_row_cache(ObStoreRow& row); @@ -84,7 +84,7 @@ class ObMultipleGetMerge : public ObMultipleMerge { int alloc_resource(); void reset_with_fuse_row_cache(); - private: +private: static const int64_t MAX_PREFETCH_CNT = 300; static const int64_t MAX_MULTI_GET_FUSE_ROW_CACHE_GET_COUNT = 100; static const int64_t MAX_MULTI_GET_FUSE_ROW_CACHE_PUT_COUNT; diff --git a/src/storage/ob_multiple_merge.h b/src/storage/ob_multiple_merge.h index 538f33d30..7ce7499b7 100644 --- a/src/storage/ob_multiple_merge.h +++ b/src/storage/ob_multiple_merge.h @@ -24,18 +24,15 @@ namespace oceanbase { namespace storage { class ObIStoreRowFilter; class ObMultipleMerge : public ObQueryRowIterator { - public: +public: typedef common::ObSEArray MergeIterators; - public: +public: ObMultipleMerge(); virtual ~ObMultipleMerge(); virtual int init( - const ObTableAccessParam ¶m, - ObTableAccessContext &context, - const ObGetTableParam &get_table_param - ); - virtual int get_next_row(ObStoreRow *&row) override; + const ObTableAccessParam& param, ObTableAccessContext& context, const ObGetTableParam& get_table_param); + virtual int get_next_row(ObStoreRow*& row) override; virtual void reset() override; virtual void reuse(); inline const ObRowStat& get_row_stat() const @@ -65,7 +62,7 @@ class ObMultipleMerge : public ObQueryRowIterator { } virtual int switch_iterator(const int64_t range_array_idx) override; - protected: +protected: int open(); virtual int calc_scan_range() = 0; virtual int construct_iters() = 0; @@ -84,9 +81,9 @@ class ObMultipleMerge : public ObQueryRowIterator { void reuse_iter_array(); virtual int skip_to_range(const int64_t range_idx); - private: +private: class ObTableCompartor { - public: + public: ObTableCompartor(int& ret) : ret_(ret) {} ~ObTableCompartor() = default; @@ -113,11 +110,11 @@ class ObMultipleMerge : public ObQueryRowIterator { return bret; } - private: + private: int& ret_; }; - private: +private: int fuse_default(common::ObNewRow& row); int pad_columns(common::ObNewRow& row); int fill_virtual_columns(common::ObNewRow& row); @@ -139,7 +136,7 @@ class ObMultipleMerge : public ObQueryRowIterator { int check_row_in_current_range(const ObStoreRow& row); int fill_scale(common::ObNewRow& row); - protected: +protected: common::ObArenaAllocator padding_allocator_; MergeIterators iters_; const ObTableAccessParam* access_param_; @@ -170,7 +167,7 @@ class ObMultipleMerge : public ObQueryRowIterator { bool skip_refresh_table_; bool read_memtable_only_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObMultipleMerge); }; diff --git a/src/storage/ob_multiple_multi_scan_merge.h b/src/storage/ob_multiple_multi_scan_merge.h index 0ee726e33..46b4afc44 100644 --- a/src/storage/ob_multiple_multi_scan_merge.h +++ b/src/storage/ob_multiple_multi_scan_merge.h @@ -17,11 +17,11 @@ namespace oceanbase { namespace storage { class ObMultipleMultiScanMerge : public ObMultipleScanMergeImpl { - public: +public: ObMultipleMultiScanMerge(); virtual ~ObMultipleMultiScanMerge(); - public: +public: int open(const common::ObIArray& ranges); virtual void reset(); virtual void reuse() override; @@ -29,7 +29,7 @@ class ObMultipleMultiScanMerge : public ObMultipleScanMergeImpl { const common::ObIArray& ranges, const common::ObIArray& tables, ObPartitionEst& part_estimate, common::ObIArray& est_records); - protected: +protected: virtual int calc_scan_range() override; virtual int construct_iters() override; virtual int inner_get_next_row(ObStoreRow& row); @@ -38,7 +38,7 @@ class ObMultipleMultiScanMerge : public ObMultipleScanMergeImpl { virtual void collect_merge_stat(ObTableStoreStat& stat) const override; virtual int skip_to_range(const int64_t range_idx) override; - private: +private: int is_get_data_ready(bool& is_ready); int is_scan_data_ready(bool& is_ready); int inner_get_next_row_for_get(ObStoreRow& row, bool& need_retry); @@ -47,13 +47,13 @@ class ObMultipleMultiScanMerge : public ObMultipleScanMergeImpl { static int to_collation_free_range_on_demand( const common::ObIArray& ranges, common::ObIAllocator& allocator); - private: +private: const ObStoreRow* get_items_[common::MAX_TABLE_CNT_IN_STORAGE]; int64_t get_num_; const ObIArray* ranges_; ScanRangeArray cow_ranges_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObMultipleMultiScanMerge); }; diff --git a/src/storage/ob_multiple_scan_merge.h b/src/storage/ob_multiple_scan_merge.h index 625e8f065..455860ebf 100644 --- a/src/storage/ob_multiple_scan_merge.h +++ b/src/storage/ob_multiple_scan_merge.h @@ -17,11 +17,11 @@ namespace oceanbase { namespace storage { class ObMultipleScanMerge : public ObMultipleScanMergeImpl { - public: +public: ObMultipleScanMerge(); virtual ~ObMultipleScanMerge(); - public: +public: static int estimate_row_count(const common::ObQueryFlag query_flag, const uint64_t table_id, const common::ObExtStoreRange& range, const common::ObIArray& tables, ObPartitionEst& cost_estimate, common::ObIArray& est_records); @@ -33,16 +33,16 @@ class ObMultipleScanMerge : public ObMultipleScanMergeImpl { iter_del_row_ = iter_del_row; } - protected: +protected: virtual int calc_scan_range() override; virtual int construct_iters() override; - virtual int inner_get_next_row(ObStoreRow &row) override; + virtual int inner_get_next_row(ObStoreRow& row) override; virtual int is_range_valid() const override; virtual int prepare() override; virtual void collect_merge_stat(ObTableStoreStat& stat) const override; - private: +private: const common::ObExtStoreRange* range_; common::ObExtStoreRange cow_range_; diff --git a/src/storage/ob_multiple_scan_merge_impl.h b/src/storage/ob_multiple_scan_merge_impl.h index 6ed47e075..2168786ff 100644 --- a/src/storage/ob_multiple_scan_merge_impl.h +++ b/src/storage/ob_multiple_scan_merge_impl.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace storage { class ObQueryIteratorConsumer { - public: +public: ObQueryIteratorConsumer() { reset(); @@ -81,23 +81,20 @@ class ObQueryIteratorConsumer { TO_STRING_KV( "consumers", ObArrayWrap(consumer_iters_, consumer_num_), K_(consumer_num), K_(base_sstable_iter_idx)); - private: +private: int64_t consumer_iters_[common::MAX_TABLE_CNT_IN_STORAGE]; int64_t consumer_num_; int64_t base_sstable_iter_idx_; }; class ObMultipleScanMergeImpl : public ObMultipleMerge { - public: +public: ObMultipleScanMergeImpl(); virtual ~ObMultipleScanMergeImpl(); virtual int init( - const ObTableAccessParam ¶m, - ObTableAccessContext &context, - const ObGetTableParam &get_table_param - ) override; - virtual int inner_get_next_row(ObStoreRow &row) override; + const ObTableAccessParam& param, ObTableAccessContext& context, const ObGetTableParam& get_table_param) override; + virtual int inner_get_next_row(ObStoreRow& row) override; virtual void reset() override; virtual void reuse() override; inline bool is_scan_end() const @@ -105,17 +102,17 @@ class ObMultipleScanMergeImpl : public ObMultipleMerge { return loser_tree_.empty(); } - protected: +protected: int reset_range(int idx, int64_t range_idx, const ObStoreRowkey* rowkey, const bool include_gap_key); int supply_consume(); int prepare_range_skip(); int inner_get_next_row(ObStoreRow& row, bool& need_retry); int prepare_loser_tree(); - private: +private: int try_skip_range(const ObStoreRow* row, int idx, uint8_t flag, bool first_pop, bool& skipped); - protected: +protected: ObScanMergeLoserTreeCmp tree_cmp_; ObScanMergeLoserTree loser_tree_; bool iter_del_row_; @@ -124,7 +121,7 @@ class ObMultipleScanMergeImpl : public ObMultipleMerge { ObRangePurger range_purger_; ObRangeSkip range_skip_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMultipleScanMergeImpl); }; diff --git a/src/storage/ob_non_trans_log.h b/src/storage/ob_non_trans_log.h index 1467e2cbf..ddbd1b7ba 100644 --- a/src/storage/ob_non_trans_log.h +++ b/src/storage/ob_non_trans_log.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace storage { class ObNonTransLog { - public: +public: ObNonTransLog() {} virtual ~ObNonTransLog() diff --git a/src/storage/ob_old_sstable.h b/src/storage/ob_old_sstable.h index 5b39a9ce0..d8f62f48a 100644 --- a/src/storage/ob_old_sstable.h +++ b/src/storage/ob_old_sstable.h @@ -60,7 +60,7 @@ class ObSSTableScanEstimator; class ObSSTableSplitCtx; class ObOldSSTable : public ObITable { - public: +public: static const int64_t DEFAULT_MACRO_BLOCK_NUM = 4; static const int64_t DEFAULT_ALLOCATOR_BLOCK_SIZE = 1024; static const int64_t RESERVE_META_SIZE = 4 * 1024; @@ -71,9 +71,9 @@ class ObOldSSTable : public ObITable { typedef common::ObSEArray MacroBlockArray; typedef common::hash::ObCuckooHashMap LobBlockIdMap; - public: +public: class ObSSTableGroupMacroBlocks { - public: + public: ObSSTableGroupMacroBlocks(const MacroBlockArray& data_macro_blocks, const MacroBlockArray& lob_macro_blocks); ~ObSSTableGroupMacroBlocks(); OB_INLINE int64_t data_macro_block_count() const @@ -92,16 +92,16 @@ class ObOldSSTable : public ObITable { int at(const int64_t idx, blocksstable::MacroBlockId& block_id) const; virtual int64_t to_string(char* buf, int64_t buf_len) const; - private: + private: ObSSTableGroupMacroBlocks(); DISALLOW_COPY_AND_ASSIGN(ObSSTableGroupMacroBlocks); - private: + private: const MacroBlockArray& data_macro_blocks_; const MacroBlockArray& lob_macro_blocks_; }; - public: +public: ObOldSSTable(); virtual ~ObOldSSTable(); @@ -319,7 +319,7 @@ class ObOldSSTable : public ObITable { VIRTUAL_NEED_SERIALIZE_AND_DESERIALIZE; INHERIT_TO_STRING_KV("ObITable", ObITable, KP(this), K(status_), K(meta_)); - private: +private: int sort_ranges( const common::ObIArray& ranges, common::ObIArray& ordered_ranges); int remove_duplicate_ordered_block_id(const common::ObIArray& origin_blocks, @@ -344,7 +344,7 @@ class ObOldSSTable : public ObITable { const ObExtStoreRowkey& ext_rowkey, ObStoreRowIterator*& iter); int build_multi_exist_iterator(ObRowsInfo& rows_info, ObStoreRowIterator*& iter); - private: +private: void set_multi_version_rowkey_type(const ObMultiVersionRowkeyHelpper::MultiVersionRowkeyType rowkey_type) { if (is_multi_version_table()) { @@ -354,7 +354,7 @@ class ObOldSSTable : public ObITable { } } - private: +private: friend class ObMacroBlockIterator; typedef common::ObFixedArray MacroMetaArray; common::ObArenaAllocator allocator_; diff --git a/src/storage/ob_parallel_external_sort.h b/src/storage/ob_parallel_external_sort.h index fde5c10ed..941665d2f 100644 --- a/src/storage/ob_parallel_external_sort.h +++ b/src/storage/ob_parallel_external_sort.h @@ -70,7 +70,7 @@ bool ObExternalSortConstant::is_timeout(const int64_t expire_timestamp) template class ObFragmentIterator { - public: +public: ObFragmentIterator() {} virtual ~ObFragmentIterator() @@ -89,7 +89,7 @@ class ObFragmentIterator { template class ObMacroBufferWriter { - public: +public: ObMacroBufferWriter(); virtual ~ObMacroBufferWriter(); int write_item(const T& item); @@ -98,7 +98,7 @@ class ObMacroBufferWriter { bool has_item(); TO_STRING_KV(KP(buf_), K(buf_pos_), K(buf_cap_)); - private: +private: char* buf_; int64_t buf_pos_; int64_t buf_cap_; @@ -157,7 +157,7 @@ bool ObMacroBufferWriter::has_item() template class ObFragmentWriterV2 { - public: +public: ObFragmentWriterV2(); virtual ~ObFragmentWriterV2(); int open(const int64_t buf_size, const int64_t expire_timestamp, const uint64_t tenant_id, const int64_t dir_id); @@ -177,11 +177,11 @@ class ObFragmentWriterV2 { return sample_item_; } - private: +private: int flush_buffer(); int check_need_flush(bool& need_flush); - private: +private: bool is_inited_; char* buf_; int64_t buf_size_; @@ -378,7 +378,7 @@ void ObFragmentWriterV2::reset() template class ObMacroBufferReader { - public: +public: ObMacroBufferReader(); virtual ~ObMacroBufferReader(); int read_item(T& item); @@ -386,7 +386,7 @@ class ObMacroBufferReader { void assign(const int64_t buf_pos, const int64_t buf_cap, const char* buf); TO_STRING_KV(KP(buf_), K(buf_pos_), K(buf_len_), K(buf_cap_)); - private: +private: const char* buf_; int64_t buf_pos_; int64_t buf_len_; @@ -446,7 +446,7 @@ void ObMacroBufferReader::assign(const int64_t buf_pos, const int64_t buf_cap template class ObFragmentReaderV2 : public ObFragmentIterator { - public: +public: ObFragmentReaderV2(); virtual ~ObFragmentReaderV2(); int init(const int64_t fd, const int64_t dir_id, const int64_t expire_timestamp, const uint64_t tenant_id, @@ -455,13 +455,13 @@ class ObFragmentReaderV2 : public ObFragmentIterator { virtual int get_next_item(const T*& item); virtual int clean_up(); - private: +private: int prefetch(); int wait(); int pipeline(); void reset(); - private: +private: static const int64_t MAX_HANDLE_COUNT = 2; bool is_inited_; int64_t expire_timestamp_; @@ -703,7 +703,7 @@ int ObFragmentReaderV2::clean_up() template class ObFragmentMerge { - public: +public: typedef ObFragmentIterator FragmentIterator; static const int64_t DEFAULT_ITERATOR_NUM = 64; ObFragmentMerge(); @@ -717,12 +717,12 @@ class ObFragmentMerge { return is_opened_; } - private: +private: int direct_get_next_item(const T*& item); int heap_get_next_item(const T*& item); int build_heap(); - private: +private: struct HeapItem { const T* item_; int64_t idx_; @@ -736,7 +736,7 @@ class ObFragmentMerge { TO_STRING_KV(K_(item), K_(idx)); }; class HeapCompare { - public: + public: HeapCompare(int& ret); virtual ~HeapCompare(); bool operator()(const HeapItem& left_item, const HeapItem& right_item) const; @@ -749,12 +749,12 @@ class ObFragmentMerge { return ret_; } - private: + private: Compare* compare_; int& ret_; }; - private: +private: bool is_inited_; bool is_opened_; HeapCompare compare_; @@ -1008,7 +1008,7 @@ int ObFragmentMerge::get_next_item(const T*& item) template class ObExternalSortRound { - public: +public: ObExternalSortRound(); virtual ~ObExternalSortRound(); int init(const int64_t merge_count, const int64_t file_buf_size, const int64_t expire_timestamp, @@ -1029,7 +1029,7 @@ class ObExternalSortRound { int add_fragment_iter(ObFragmentIterator* iter); int transfer_final_sorted_fragment_iter(ObExternalSortRound& dest_round); - private: +private: typedef ObFragmentReaderV2 FragmentReader; typedef ObFragmentIterator FragmentIterator; typedef common::ObArray FragmentIteratorList; @@ -1368,7 +1368,7 @@ int ObExternalSortRound::clean_up() template class ObMemoryFragmentIterator : public ObFragmentIterator { - public: +public: ObMemoryFragmentIterator(); virtual ~ObMemoryFragmentIterator(); int init(common::ObVector& item_list); @@ -1378,7 +1378,7 @@ class ObMemoryFragmentIterator : public ObFragmentIterator { return common::OB_SUCCESS; } - private: +private: bool is_inited_; int64_t curr_item_index_; common::ObVector* item_list_; @@ -1424,7 +1424,7 @@ int ObMemoryFragmentIterator::get_next_item(const T*& item) template class ObMemorySortRound { - public: +public: typedef ObExternalSortRound ExternalSortRound; ObMemorySortRound(); virtual ~ObMemorySortRound(); @@ -1446,10 +1446,10 @@ class ObMemorySortRound { TO_STRING_KV(K(is_inited_), K(is_in_memory_), K(has_data_), K(buf_mem_limit_), K(expire_timestamp_), KP(next_round_), KP(compare_), KP(iter_)); - private: +private: int build_iterator(); - private: +private: bool is_inited_; bool is_in_memory_; bool has_data_; @@ -1697,7 +1697,7 @@ int ObMemorySortRound::transfer_final_sorted_fragment_iter(ExternalS template class ObExternalSort { - public: +public: typedef ObMemorySortRound MemorySortRound; typedef ObExternalSortRound ExternalSortRound; ObExternalSort(); @@ -1714,7 +1714,7 @@ class ObExternalSort { TO_STRING_KV(K(is_inited_), K(file_buf_size_), K(buf_mem_limit_), K(expire_timestamp_), K(merge_count_per_round_), KP(tenant_id_), KP(compare_)); - private: +private: static const int64_t EXTERNAL_SORT_ROUND_CNT = 2; bool is_inited_; int64_t file_buf_size_; diff --git a/src/storage/ob_partition_backup.h b/src/storage/ob_partition_backup.h index 36288bdb6..1f4620096 100644 --- a/src/storage/ob_partition_backup.h +++ b/src/storage/ob_partition_backup.h @@ -37,7 +37,7 @@ class ObBackupPhysicalPGCtx; class ObPartGroupBackupMajorTask; class ObPartGroupBackupTask : public ObPartGroupTask { - public: +public: static const int64_t PART_GROUP_TASK_IDLE_TIME_MS = 10 * 1000LL; // 10s static const int64_t PART_GROUP_BACKUP_POINT_CHECK_TIME_MS = 100; // 100ms typedef hash::ObHashMap BackupTableIndexMap; @@ -55,7 +55,7 @@ class ObPartGroupBackupTask : public ObPartGroupTask { TO_STRING_KV(K_(task_id), K_(is_inited), K_(is_finished), K_(is_batch_mode), KP_(partition_service), K_(first_error_code), K_(type), "sub_task_count", task_list_.count(), K_(task_list)); - private: +private: int check_partition_validation(); // only invoked before executing, so without concurrency invoke int do_part_group_backup_minor_task(); int do_part_group_backup_major_task(); @@ -75,12 +75,12 @@ class ObPartGroupBackupTask : public ObPartGroupTask { int check_all_pg_backup_point_created(); int check_pg_backup_point_created(const ObPartitionKey& pg_key, const int64_t backup_snapshot_version); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartGroupBackupTask); }; class ObBackupPrepareTask : public share::ObITask { - public: +public: typedef common::hash::ObHashMap MacroPairMap; ObBackupPrepareTask(); virtual ~ObBackupPrepareTask(); @@ -88,7 +88,7 @@ class ObBackupPrepareTask : public share::ObITask { ObPartitionService& partition_service); virtual int process() override; - protected: +protected: int add_backup_status(ObMigrateCtx* ctx); int add_partition_backup_status(const ObMigrateCtx& ctx); int prepare_backup(); @@ -132,7 +132,7 @@ class ObBackupPrepareTask : public share::ObITask { const ObMigrateSrcInfo& src_info, ObIPGPartitionBaseDataMetaObReader*& reader); int check_backup_data_continues(); - protected: +protected: bool is_inited_; ObMigrateCtx* ctx_; ObIPartitionComponentFactory* cp_fty_; @@ -140,7 +140,7 @@ class ObBackupPrepareTask : public share::ObITask { ObPartitionService* partition_service_; ObPartitionGroupMetaBackupReader* backup_meta_reader_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupPrepareTask); }; diff --git a/src/storage/ob_partition_base_data_backup.h b/src/storage/ob_partition_base_data_backup.h index b022645ed..0169ee0b7 100644 --- a/src/storage/ob_partition_base_data_backup.h +++ b/src/storage/ob_partition_base_data_backup.h @@ -73,7 +73,7 @@ struct ObBackupMacroBlockArg final { class ObPartitionMetaBackupReader { - public: +public: ObPartitionMetaBackupReader(); virtual ~ObPartitionMetaBackupReader() {} @@ -98,7 +98,7 @@ class ObPartitionMetaBackupReader { return is_inited_; } - private: +private: int read_partition_meta_info(const ObPartitionKey& pkey, const int64_t backup_snapshot_version); int read_table_info(const ObPartitionKey& pkey, const uint64_t table_id, const int64_t multi_version_start, @@ -109,7 +109,7 @@ class ObPartitionMetaBackupReader { const ObPGPartitionStoreMeta& partition_store_meta, const ObTablesHandle& handle); int build_backup_sstable_info(const ObSSTable* sstable, ObBackupSSTableInfo& sstable_info); - private: +private: bool is_inited_; int64_t data_size_; ObPGPartitionMetaInfo meta_info_; @@ -123,7 +123,7 @@ class ObPartitionMetaBackupReader { }; class ObMacroBlockBackupSyncReader final { - public: +public: ObMacroBlockBackupSyncReader(); virtual ~ObMacroBlockBackupSyncReader(); @@ -138,12 +138,12 @@ class ObMacroBlockBackupSyncReader final { TO_STRING_KV(K_(is_inited), K_(args), K_(data_size), K_(result_code), K_(is_data_ready), K_(macro_arg), K_(backup_index_tid), K_(full_meta), K_(data)); - private: +private: int process(); int get_macro_read_info(const obrpc::ObFetchMacroBlockArg& arg, blocksstable::ObMacroBlockCtx& macro_block_ctx, blocksstable::ObMacroBlockReadInfo& read_info); - private: +private: bool is_inited_; const share::ObPhysicalBackupArg* args_; common::ObArenaAllocator allocator_; @@ -163,7 +163,7 @@ class ObMacroBlockBackupSyncReader final { }; class ObPartitionBaseDataMetaBackupReader { - public: +public: ObPartitionBaseDataMetaBackupReader(); virtual ~ObPartitionBaseDataMetaBackupReader(); int init( @@ -180,10 +180,10 @@ class ObPartitionBaseDataMetaBackupReader { TO_STRING_KV(K_(pkey), KP(backup_arg_), K_(last_read_size), K_(partition_store_meta), K_(snapshot_version), K_(schema_version), K_(data_version)); - private: +private: int prepare(const common::ObPartitionKey& pkey, const ObDataStorageInfo& data_info); - private: +private: bool is_inited_; common::ObPartitionKey pkey_; const ObPhysicalBackupArg* backup_arg_; @@ -199,7 +199,7 @@ class ObPartitionBaseDataMetaBackupReader { class ObPartitionGroupMetaBackupReader; class ObPhysicalBaseMetaBackupReader : public ObIPhysicalBaseMetaReader { - public: +public: ObPhysicalBaseMetaBackupReader(); virtual ~ObPhysicalBaseMetaBackupReader() {} @@ -212,7 +212,7 @@ class ObPhysicalBaseMetaBackupReader : public ObIPhysicalBaseMetaReader { return BASE_DATA_META_BACKUP_READER; } - private: +private: bool is_inited_; ObRestoreInfo* restore_info_; ObPartitionGroupMetaBackupReader* reader_; @@ -223,7 +223,7 @@ class ObPhysicalBaseMetaBackupReader : public ObIPhysicalBaseMetaReader { }; class ObPartitionMacroBlockBackupReader : public ObIPartitionMacroBlockReader { - public: +public: ObPartitionMacroBlockBackupReader(); virtual ~ObPartitionMacroBlockBackupReader(); int init(const ObPhysicalBackupArg& backup_arg, const ObIArray& list); @@ -246,11 +246,11 @@ class ObPartitionMacroBlockBackupReader : public ObIPartitionMacroBlockReader { return is_inited_; } - private: +private: int schedule_macro_block_task(const ObPhysicalBackupArg& backup_arg, const obrpc::ObFetchMacroBlockArg& arg, const ObITable::TableKey& table_key, ObMacroBlockBackupSyncReader& reader); - private: +private: bool is_inited_; common::ObArray macro_list_; int64_t macro_idx_; @@ -261,7 +261,7 @@ class ObPartitionMacroBlockBackupReader : public ObIPartitionMacroBlockReader { }; class ObPartitionGroupMetaBackupReader { - public: +public: ObPartitionGroupMetaBackupReader(); virtual ~ObPartitionGroupMetaBackupReader(); int init(const ObPartitionGroupMeta& pg_meta, const ObPhysicalBackupArg& backup_arg); @@ -272,10 +272,10 @@ class ObPartitionGroupMetaBackupReader { int fetch_sstable_pair_list( const uint64_t index_id, const ObPartitionKey& pkey, common::ObIArray& pair_list); - private: +private: int prepare(const ObPartitionGroupMeta& pg_meta, const ObPhysicalBackupArg& backup_arg); - private: +private: bool is_inited_; common::ObPGKey pg_key_; const ObPhysicalBackupArg* backup_arg_; @@ -286,7 +286,7 @@ class ObPartitionGroupMetaBackupReader { }; class ObPGPartitionBaseDataMetaBackupReader : public ObIPGPartitionBaseDataMetaObReader { - public: +public: ObPGPartitionBaseDataMetaBackupReader(); virtual ~ObPGPartitionBaseDataMetaBackupReader(); @@ -297,7 +297,7 @@ class ObPGPartitionBaseDataMetaBackupReader : public ObIPGPartitionBaseDataMetaO return BASE_DATA_META_OB_BACKUP_READER; } - private: +private: bool is_inited_; int64_t reader_index_; common::ObArray partition_reader_array_; @@ -305,7 +305,7 @@ class ObPGPartitionBaseDataMetaBackupReader : public ObIPGPartitionBaseDataMetaO }; class ObBackupFileAppender final { - public: +public: ObBackupFileAppender(); virtual ~ObBackupFileAppender(); int open(common::ObInOutBandwidthThrottle& bandwidth_throttle, const share::ObPhysicalBackupArg& backup_arg, @@ -335,7 +335,7 @@ class ObBackupFileAppender final { TO_STRING_KV(K_(is_opened), K_(file_offset), K_(max_buf_size), KP(backup_arg_)); - private: +private: int get_data_version(const ObBackupFileType data_type, uint16& data_version); int is_exist(const common::ObString& uri, bool& exist); template @@ -343,7 +343,7 @@ class ObBackupFileAppender final { int write_tail(); int open(const common::ObString path); - private: +private: const static int64_t MAX_DATA_BUF_LENGTH = 1LL << 22; // 4M const static int64_t MAX_INDEX_BUF_LENGTH = 1LL << 18; // 256KB const static int64_t MAX_IDLE_TIME = 10 * 1000LL * 1000LL; // 10s @@ -361,7 +361,7 @@ class ObBackupFileAppender final { }; class ObBackupMetaWriter final { - public: +public: ObBackupMetaWriter(); virtual ~ObBackupMetaWriter(); int open(common::ObInOutBandwidthThrottle& bandwidth_throttle, ObIArray& task_list); @@ -369,7 +369,7 @@ class ObBackupMetaWriter final { int close(); TO_STRING_KV(K_(is_inited), K_(task_id), KP_(cp_fty), K_(meta_appender), K_(index_appender)); - private: +private: int prepare_appender(common::ObInOutBandwidthThrottle& bandwidth_throttle, const share::ObPhysicalBackupArg& arg); int check_task(const ObIArray& task_list) const; int get_min_snapshot_version(const common::ObIArray& table_key_array, int64_t& snapshot_version); @@ -385,7 +385,7 @@ class ObBackupMetaWriter final { ObBackupPartitionStoreMetaInfo& partition_store_meta_info); int write_backup_pg_meta_info(const ObBackupPGMetaInfo& pg_meta_info); - private: +private: bool is_inited_; int64_t task_id_; ObIArray* task_list_; @@ -407,9 +407,9 @@ struct ObBackupMacroBlockInfo final { }; class ObBackupPhysicalPGCtx { - public: +public: class SubTask final { - public: + public: SubTask(); virtual ~SubTask(); void reset(); @@ -438,7 +438,7 @@ class ObBackupPhysicalPGCtx { int64_t last_idx_; }; - public: +public: const static uint64_t DEFAULT_WAIT_TIME = 10 * 1000 * 1000; // 10s const static uint64_t MAX_MACRO_BLOCK_COUNT_PER_TASK = 512; // 1GB per backup data file ObBackupPhysicalPGCtx(); @@ -480,7 +480,7 @@ class ObBackupPhysicalPGCtx { int64_t base_task_id_; int64_t retry_cnt_; - private: +private: int fetch_available_sub_task(SubTask*& sub_task); int init_macro_index_appender(); int init_already_backup_data(); // for retry @@ -490,7 +490,7 @@ class ObBackupPhysicalPGCtx { int get_macro_block_index_path( const ObBackupBaseDataPathInfo& path_info, const int64_t retry_cnt, ObBackupPath& path); - private: +private: common::ObThreadCond cond_; volatile int64_t task_turn_; MacroIndexMergePoint index_merge_point_; @@ -507,7 +507,7 @@ class ObBackupPhysicalPGCtx { }; class ObBackupCopyPhysicalTask : public share::ObITask { - public: +public: ObBackupCopyPhysicalTask(); virtual ~ObBackupCopyPhysicalTask(); virtual int generate_next_task(ObITask*& next_task) override; @@ -515,7 +515,7 @@ class ObBackupCopyPhysicalTask : public share::ObITask { int init(const int64_t task_idx, const ObITable::TableKey& already_backup_table_key, ObMigrateCtx& ctx); virtual int process() override; - private: +private: int get_macro_block_backup_reader(const ObIArray& list, const ObPhysicalBackupArg& backup_arg, ObPartitionMacroBlockBackupReader*& reader); int fetch_backup_macro_block_arg(const share::ObPhysicalBackupArg& backup_arg, const ObITable::TableKey& table_key, @@ -534,7 +534,7 @@ class ObBackupCopyPhysicalTask : public share::ObITask { int64_t& reuse_count); int calc_migrate_data_statics(const int64_t copy_count, const int64_t reuse_count); - private: +private: static const int64_t OB_FETCH_MAJOR_BLOCK_RETRY_INTERVAL = 1 * 1000 * 1000L; // 1s bool is_inited_; ObMigrateCtx* ctx_; @@ -553,13 +553,13 @@ class ObBackupCopyPhysicalTask : public share::ObITask { }; class ObBackupFinishTask : public share::ObITask { - public: +public: ObBackupFinishTask(); virtual ~ObBackupFinishTask(); int init(ObMigrateCtx& migrate_ctx); virtual int process() override; - private: +private: bool is_inited_; ObMigrateCtx* ctx_; DISALLOW_COPY_AND_ASSIGN(ObBackupFinishTask); @@ -569,11 +569,11 @@ struct ObBackupMacroData final { static const int64_t BACKUP_MARCO_DATA_VERSION = 1; OB_UNIS_VERSION(BACKUP_MARCO_DATA_VERSION); - public: +public: ObBackupMacroData(blocksstable::ObBufferHolder& meta, blocksstable::ObBufferReader& data); TO_STRING_KV(K_(data), K_(meta)); - private: +private: blocksstable::ObBufferHolder& meta_; blocksstable::ObBufferReader& data_; DISALLOW_COPY_AND_ASSIGN(ObBackupMacroData); diff --git a/src/storage/ob_partition_base_data_ob_reader.h b/src/storage/ob_partition_base_data_ob_reader.h index d0d5aa41c..fe6814f16 100644 --- a/src/storage/ob_partition_base_data_ob_reader.h +++ b/src/storage/ob_partition_base_data_ob_reader.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace storage { template class ObStreamRpcReader { - public: +public: ObStreamRpcReader(); virtual ~ObStreamRpcReader() {} @@ -57,7 +57,7 @@ class ObStreamRpcReader { rpc_buffer_parse_pos_ = 0; } - private: +private: bool is_inited_; obrpc::ObPartitionServiceRpcProxy::SSHandle handle_; common::ObInOutBandwidthThrottle* bandwidth_throttle_; @@ -70,7 +70,7 @@ class ObStreamRpcReader { template class ObLogicStreamRpcReader { - public: +public: ObLogicStreamRpcReader(); virtual ~ObLogicStreamRpcReader() {} @@ -104,7 +104,7 @@ class ObLogicStreamRpcReader { } int decode_rpc_header(); - private: +private: bool is_inited_; obrpc::ObPartitionServiceRpcProxy::SSHandle handle_; common::ObInOutBandwidthThrottle* bandwidth_throttle_; @@ -132,7 +132,7 @@ class ObLogicStreamRpcReader { // sstbale_meta_N // ObSSTablePair list of sstable_N class ObPartitionBaseDataMetaObReader : public ObIPhysicalBaseMetaReader { - public: +public: ObPartitionBaseDataMetaObReader(); virtual ~ObPartitionBaseDataMetaObReader(); @@ -154,10 +154,10 @@ class ObPartitionBaseDataMetaObReader : public ObIPhysicalBaseMetaReader { return data_size_; } - private: +private: int fetch_next_buffer_if_need(); - private: +private: bool is_inited_; storage::ObSavedStorageInfo saved_storage_info_; obrpc::ObPartitionServiceRpcProxy::SSHandle handle_; @@ -188,7 +188,7 @@ class ObPartitionBaseDataMetaObReader : public ObIPhysicalBaseMetaReader { // macro_block_data_N class ObPartitionMacroBlockObReader : public ObIPartitionMacroBlockReader { - public: +public: ObPartitionMacroBlockObReader(); virtual ~ObPartitionMacroBlockObReader(); int init(obrpc::ObPartitionServiceRpcProxy& srv_rpc_proxy, common::ObInOutBandwidthThrottle& bandwidth_throttle, @@ -209,14 +209,14 @@ class ObPartitionMacroBlockObReader : public ObIPartitionMacroBlockReader { return data_size_; } - private: +private: int alloc_buffers(); int fetch_next_buffer_if_need(); int fetch_next_buffer(); int fetch_next_buffer_with_old_rpc(); int alloc_from_memctx_first(char*& buf); - private: +private: bool is_inited_; obrpc::ObPartitionServiceRpcProxy::SSHandle handle_; obrpc::ObPartitionServiceRpcProxy::SSHandle old_handle_; @@ -237,19 +237,19 @@ class ObPartitionMacroBlockObReader : public ObIPartitionMacroBlockReader { // possible. The logic of filling the package is completed in ObFetchMacroBlockP::process. Try to fill a package as much // as possible, and the meta is guaranteed to be in the same package (OB_MALLOC_BIG_BLOCK_SIZE). class ObPartitionMacroBlockObProducer { - public: +public: ObPartitionMacroBlockObProducer(); virtual ~ObPartitionMacroBlockObProducer(); int init(const ObITable::TableKey& table_key, const common::ObIArray& arg_list); int get_next_macro_block(blocksstable::ObFullMacroBlockMeta& meta, blocksstable::ObBufferReader& data); - private: +private: int prefetch(); int get_macro_read_info(const obrpc::ObFetchMacroBlockArg& arg, blocksstable::ObMacroBlockCtx& macro_block_ctx, blocksstable::ObMacroBlockReadInfo& read_info); - private: +private: static const int64_t MAX_PREFETCH_MACRO_BLOCK_NUM = 2; static const int64_t MACRO_META_RESERVE_TIME = 60 * 1000 * 1000LL; // 1minutes @@ -273,7 +273,7 @@ class ObPartitionMacroBlockObProducer { // ... // end_key(n) should be MAX class ObLogicBaseMetaProducer { - public: +public: ObLogicBaseMetaProducer() : is_inited_(false), partition_service_(NULL), arg_(NULL) {} ~ObLogicBaseMetaProducer() @@ -282,14 +282,14 @@ class ObLogicBaseMetaProducer { int init(storage::ObPartitionService* partition_service, obrpc::ObFetchLogicBaseMetaArg* arg); int get_logic_endkey_list(common::ObIArray& end_key_list); - private: +private: bool is_inited_; storage::ObPartitionService* partition_service_; obrpc::ObFetchLogicBaseMetaArg* arg_; }; class ObLogicBaseMetaReader : ObILogicBaseMetaReader { - public: +public: ObLogicBaseMetaReader() : is_inited_(false), rpc_reader_(), allocator_(common::ObNewModIds::OB_PARTITION_MIGRATE) {} virtual ~ObLogicBaseMetaReader() @@ -300,14 +300,14 @@ class ObLogicBaseMetaReader : ObILogicBaseMetaReader { virtual int fetch_end_key_list(common::ObIArray& end_key_list); - private: +private: bool is_inited_; ObStreamRpcReader rpc_reader_; common::ObArenaAllocator allocator_; }; class ObLogicDataChecksumCalculate { - public: +public: ObLogicDataChecksumCalculate(); virtual ~ObLogicDataChecksumCalculate() {} @@ -326,11 +326,11 @@ class ObLogicDataChecksumCalculate { return last_rowkey_; } - private: +private: int inner_append_row(const ObStoreRow& store_row); void calc_data_checksum(); - private: +private: bool is_inited_; blocksstable::ObSelfBufferWriter data_buffer_; blocksstable::ObRowWriter row_writer_; @@ -342,7 +342,7 @@ class ObLogicDataChecksumCalculate { }; class ObLogicRowProducer { - public: +public: ObLogicRowProducer(); virtual ~ObLogicRowProducer() {} @@ -359,7 +359,7 @@ class ObLogicRowProducer { } int get_schema_rowkey_count(int64_t& schema_rowkey_count); - private: +private: int init_logical_row_iter(const ObVersionRange& version_range, ObExtStoreRange& key_range); bool can_reset_logical_row_iter(); int inner_get_next_row(const ObStoreRow*& store_row); @@ -368,7 +368,7 @@ class ObLogicRowProducer { int set_new_key_range(common::ObStoreRange& new_key_range); int check_split_source_table(const ObTablesHandle& tables_handle_, bool& is_exist); - private: +private: bool is_inited_; ObLogicDataChecksumCalculate data_checksum_calc_; storage::ObTablesHandle tables_handle_; @@ -392,7 +392,7 @@ class ObLogicRowProducer { }; class ObPhysicalBaseMetaProducer { - public: +public: ObPhysicalBaseMetaProducer() : is_inited_(false), partition_service_(NULL), arg_(NULL) {} ~ObPhysicalBaseMetaProducer() @@ -401,14 +401,14 @@ class ObPhysicalBaseMetaProducer { int get_sstable_meta( blocksstable::ObSSTableBaseMeta& sstable_meta, common::ObIArray& pair_list); - private: +private: bool is_inited_; storage::ObPartitionService* partition_service_; obrpc::ObFetchPhysicalBaseMetaArg* arg_; }; class ObPhysicalBaseMetaReader : public ObIPhysicalBaseMetaReader { - public: +public: ObPhysicalBaseMetaReader() : is_inited_(false), rpc_reader_(), allocator_(common::ObNewModIds::OB_PARTITION_MIGRATE) {} virtual ~ObPhysicalBaseMetaReader() @@ -424,7 +424,7 @@ class ObPhysicalBaseMetaReader : public ObIPhysicalBaseMetaReader { return BASE_DATA_META_OB_READER; } - private: +private: bool is_inited_; ObStreamRpcReader rpc_reader_; common::ObArenaAllocator allocator_; @@ -432,7 +432,7 @@ class ObPhysicalBaseMetaReader : public ObIPhysicalBaseMetaReader { }; class ObLogicRowReader : public ObIStoreRowIterator { - public: +public: ObLogicRowReader() : is_inited_(false), rpc_reader_(), arg_(NULL), store_row_() {} virtual ~ObLogicRowReader() @@ -444,7 +444,7 @@ class ObLogicRowReader : public ObIStoreRowIterator { // the store row is valid before the next call of get_next_row virtual int get_next_row(const ObStoreRow*& row) override; - private: +private: bool is_inited_; ObStreamRpcReader rpc_reader_; const obrpc::ObFetchLogicRowArg* arg_; @@ -454,7 +454,7 @@ class ObLogicRowReader : public ObIStoreRowIterator { }; class ObLogicRowSliceReader : public ObIStoreRowIterator { - public: +public: ObLogicRowSliceReader(); virtual ~ObLogicRowSliceReader() {} @@ -465,13 +465,13 @@ class ObLogicRowSliceReader : public ObIStoreRowIterator { // the store row is valid before the next call of get_next_row virtual int get_next_row(const ObStoreRow*& row) override; - private: +private: int rescan(const ObStoreRow*& row); int copy_rowkey(); int inner_get_next_row(const ObStoreRow*& row); int fetch_logic_row(const obrpc::ObFetchLogicRowArg& rpc_arg); - private: +private: bool is_inited_; obrpc::ObPartitionServiceRpcProxy* srv_rpc_proxy_; ObAddr src_server_; @@ -488,7 +488,7 @@ class ObLogicRowSliceReader : public ObIStoreRowIterator { }; class ObILogicRowIterator { - public: +public: ObILogicRowIterator() {} virtual ~ObILogicRowIterator() @@ -498,7 +498,7 @@ class ObILogicRowIterator { }; class ObLogicRowFetcher : public ObILogicRowIterator { - public: +public: ObLogicRowFetcher(); virtual ~ObLogicRowFetcher() {} @@ -510,7 +510,7 @@ class ObLogicRowFetcher : public ObILogicRowIterator { return arg_; } - private: +private: bool is_inited_; ObLogicRowReader logic_row_reader_; ObLogicRowSliceReader slice_row_reader_; @@ -519,7 +519,7 @@ class ObLogicRowFetcher : public ObILogicRowIterator { }; class ObTailoredRowIterator : public ObILogicRowIterator { - public: +public: ObTailoredRowIterator(); virtual ~ObTailoredRowIterator() {} @@ -531,7 +531,7 @@ class ObTailoredRowIterator : public ObILogicRowIterator { return &arg_; } - private: +private: bool is_inited_; ObMSRowIterator row_iter_; ObArenaAllocator allocator_; @@ -542,7 +542,7 @@ class ObTailoredRowIterator : public ObILogicRowIterator { }; class ObLogicDataChecksumReader { - public: +public: ObLogicDataChecksumReader(); virtual ~ObLogicDataChecksumReader() {} @@ -551,7 +551,7 @@ class ObLogicDataChecksumReader { const common::ObAddr& src_server, const int64_t cluster_id, const obrpc::ObFetchLogicRowArg& arg); int get_data_checksum(int64_t& data_checksum); - private: +private: int get_data_checksum_with_slice(int64_t& data_checksum); int get_data_checksum_without_slice(int64_t& data_checksum); int fetch_logic_data_checksum(const obrpc::ObFetchLogicRowArg& arg, @@ -560,7 +560,7 @@ class ObLogicDataChecksumReader { int64_t& data_checksum, ObLogicStreamRpcReader& rpc_reader); int rescan(int64_t& data_cheksum, ObLogicStreamRpcReader& rpc_reader); - private: +private: static const int64_t TIMEOUT = 30 * 1000 * 1000; // 30s bool is_inited_; common::ObMemBuf last_key_buf_; @@ -576,14 +576,14 @@ class ObLogicDataChecksumReader { // as possible. The logic of filling the package is completed in ObFetchBaseDataMetaP::process. partition_group meta, // all partition_meta, all_table_ids must ensure in one package(OB_MALLOC_BIG_BLOCK_SIZE) class ObPGPartitionBaseDataMetaObProducer { - public: +public: ObPGPartitionBaseDataMetaObProducer(); virtual ~ObPGPartitionBaseDataMetaObProducer(); int init(const ObPGKey& pg_key, const int64_t snapshot_version, const bool is_only_major_sstable, const int64_t log_ts, storage::ObPartitionService* partition_serivce); int get_next_partition_meta_info(const obrpc::ObPGPartitionMetaInfo*& pg_partition_meta_info); - private: +private: int set_all_partition_meta_info( const int64_t snapshot_version, const bool is_only_major_sstable, const int64_t log_ts, ObPGStorage* pg_storage); int set_partition_meta_info(const ObPartitionKey& pkey, const int64_t snapshot_version, @@ -593,7 +593,7 @@ class ObPGPartitionBaseDataMetaObProducer { const bool is_only_major_sstable, const int64_t log_ts, ObPGStorage* pg_storage, obrpc::ObFetchTableInfoResult& table_info); - private: +private: bool is_inited_; common::ObArray pg_partition_meta_info_array_; int64_t meta_info_idx_; @@ -601,7 +601,7 @@ class ObPGPartitionBaseDataMetaObProducer { }; class ObPGPartitionBaseDataMetaObReader : public ObIPGPartitionBaseDataMetaObReader { - public: +public: ObPGPartitionBaseDataMetaObReader(); virtual ~ObPGPartitionBaseDataMetaObReader(); @@ -613,7 +613,7 @@ class ObPGPartitionBaseDataMetaObReader : public ObIPGPartitionBaseDataMetaObRea return BASE_DATA_META_OB_READER; } - private: +private: static const int64_t FETCH_BASE_META_TIMEOUT = 60 * 1000 * 1000; // 60s bool is_inited_; ObStreamRpcReader rpc_reader_; diff --git a/src/storage/ob_partition_base_data_oss_reader.h b/src/storage/ob_partition_base_data_oss_reader.h index 8e9cd16f6..7e61f5912 100644 --- a/src/storage/ob_partition_base_data_oss_reader.h +++ b/src/storage/ob_partition_base_data_oss_reader.h @@ -27,7 +27,7 @@ class ObTableSchema; } // namespace share namespace storage { class ObPartitionMetaStorageReader { - public: +public: ObPartitionMetaStorageReader(); virtual ~ObPartitionMetaStorageReader(); @@ -50,13 +50,13 @@ class ObPartitionMetaStorageReader { return is_inited_; } - private: +private: // int read_one_file(const common::ObStoragePath &path, const share::ObRestoreArgs &args, // ObIAllocator &allocator, char *&buf, int64_t &read_size); int read_all_sstable_meta(); int read_table_keys(); - private: +private: bool is_inited_; int64_t sstable_index_; int64_t data_size_; @@ -72,7 +72,7 @@ class ObPartitionMetaStorageReader { class ObMacroBlockStorageReader : public ObDynamicThreadTask { const static uint64_t DEFAULT_WAIT_TIME = 10 * 1000 * 1000; // 10s - public: +public: ObMacroBlockStorageReader(); virtual ~ObMacroBlockStorageReader(); @@ -93,10 +93,10 @@ class ObMacroBlockStorageReader : public ObDynamicThreadTask { TO_STRING_KV(K_(is_inited), K_(args), K_(data_size), K_(result_code), K_(is_data_ready), K_(backup_pair), K_(backup_index_tid), KP_(meta), K_(data), K_(init_ts), K_(finish_ts), "limit time", finish_ts_ - init_ts_); - private: +private: int wait_finish(); - private: +private: bool is_inited_; const share::ObRestoreArgs* args_; common::ObArenaAllocator allocator_; @@ -118,7 +118,7 @@ class ObMacroBlockStorageReader : public ObDynamicThreadTask { }; class ObPartitionGroupMetaReader { - public: +public: ObPartitionGroupMetaReader(); virtual ~ObPartitionGroupMetaReader() {} @@ -134,11 +134,11 @@ class ObPartitionGroupMetaReader { return is_inited_; } - private: +private: int read_one_file(const common::ObStoragePath& path, const share::ObRestoreArgs& args, ObIAllocator& allocator, char*& buf, int64_t& read_size); - private: +private: bool is_inited_; int64_t data_size_; const share::ObRestoreArgs* args_; @@ -147,7 +147,7 @@ class ObPartitionGroupMetaReader { }; class ObOssReaderUtil { - public: +public: static int read_one_file(const common::ObStoragePath& path, const share::ObRestoreArgs& args, ObIAllocator& allocator, char*& buf, int64_t& read_size); }; diff --git a/src/storage/ob_partition_base_data_physical_restore.h b/src/storage/ob_partition_base_data_physical_restore.h index a79413372..48a840963 100644 --- a/src/storage/ob_partition_base_data_physical_restore.h +++ b/src/storage/ob_partition_base_data_physical_restore.h @@ -26,9 +26,9 @@ using namespace share; namespace storage { class ObRestoreFileUtil { - public: +public: static const int64_t MAX_IDLE_TIME = 10 * 1000LL * 1000LL; // 10s - public: +public: static int read_one_file( const ObString& path, const ObString& storage_info, ObIAllocator& allocator, char*& buf, int64_t& read_size); static int pread_file( @@ -72,7 +72,7 @@ class ObRestoreFileUtil { }; class ObPhyRestoreMetaIndexStore final { - public: +public: ObPhyRestoreMetaIndexStore(); virtual ~ObPhyRestoreMetaIndexStore(); void reset(); @@ -81,7 +81,7 @@ class ObPhyRestoreMetaIndexStore final { int get_meta_index(const ObPartitionKey& part_key, const ObBackupMetaType& type, ObBackupMetaIndex& meta_index) const; int check_meta_index_completed(const int64_t compatible, const ObBackupBaseDataPathInfo& path_info); - public: +public: typedef common::hash::ObHashMap MetaIndexMap; const MetaIndexMap& get_meta_index_map() { @@ -89,7 +89,7 @@ class ObPhyRestoreMetaIndexStore final { } TO_STRING_KV(K_(is_inited)); - private: +private: static const int64_t BUCKET_SIZE = 1024; int init_one_file(const ObString& path, const ObString& storage_info, int64_t& file_length, int64_t& total_length); bool is_inited_; @@ -99,7 +99,7 @@ class ObPhyRestoreMetaIndexStore final { // TODO():fetch MacroIndex on demand class ObPhyRestoreMacroIndexStore : public ObIPhyRestoreMacroIndexStore { - public: +public: ObPhyRestoreMacroIndexStore(); virtual ~ObPhyRestoreMacroIndexStore(); void reset(); @@ -116,7 +116,7 @@ class ObPhyRestoreMacroIndexStore : public ObIPhyRestoreMacroIndexStore { virtual bool is_inited() const; TO_STRING_KV(K_(is_inited)); - private: +private: static const int64_t BUCKET_SIZE = 100000; // 10w typedef common::hash::ObHashMap*> MacroIndexMap; int init_one_file(const ObString& path, const ObString& storage_info, int64_t& file_length, int64_t& total_length); @@ -128,7 +128,7 @@ class ObPhyRestoreMacroIndexStore : public ObIPhyRestoreMacroIndexStore { }; class ObPartitionMetaPhysicalReader final { - public: +public: ObPartitionMetaPhysicalReader(); virtual ~ObPartitionMetaPhysicalReader(); void reset(); @@ -153,11 +153,11 @@ class ObPartitionMetaPhysicalReader final { } TO_STRING_KV(K_(is_inited), K_(sstable_index), K_(data_size), K_(pkey)); - private: +private: int read_all_sstable_meta(); int read_table_keys(); - private: +private: bool is_inited_; int64_t sstable_index_; int64_t data_size_; @@ -174,7 +174,7 @@ class ObPartitionMetaPhysicalReader final { }; class ObPGMetaPhysicalReader final { - public: +public: ObPGMetaPhysicalReader(); virtual ~ObPGMetaPhysicalReader(); void reset(); @@ -192,7 +192,7 @@ class ObPGMetaPhysicalReader final { return is_inited_; } - private: +private: bool is_inited_; int64_t data_size_; const share::ObPhysicalRestoreArg* arg_; @@ -201,7 +201,7 @@ class ObPGMetaPhysicalReader final { }; class ObPartitionBaseDataMetaRestoreReaderV1 { - public: +public: ObPartitionBaseDataMetaRestoreReaderV1(); virtual ~ObPartitionBaseDataMetaRestoreReaderV1(); void reset(); @@ -219,10 +219,10 @@ class ObPartitionBaseDataMetaRestoreReaderV1 { int fetch_table_keys(const uint64_t index_id, obrpc::ObFetchTableInfoResult& table_res); TO_STRING_KV(K_(pkey), K_(restore_info), K_(last_read_size), K_(partition_store_meta), K_(data_version)); - private: +private: int prepare(const common::ObPartitionKey& pkey); - private: +private: bool is_inited_; common::ObPartitionKey pkey_; const ObPhysicalRestoreArg* restore_info_; @@ -236,7 +236,7 @@ class ObPartitionBaseDataMetaRestoreReaderV1 { class ObPartitionGroupMetaRestoreReaderV1; class ObPhysicalBaseMetaRestoreReaderV1 : public ObIPhysicalBaseMetaReader { - public: +public: ObPhysicalBaseMetaRestoreReaderV1(); virtual ~ObPhysicalBaseMetaRestoreReaderV1() {} @@ -249,7 +249,7 @@ class ObPhysicalBaseMetaRestoreReaderV1 : public ObIPhysicalBaseMetaReader { return BASE_DATA_META_RESTORE_READER_V1; } - private: +private: bool is_inited_; const ObPhysicalRestoreArg* restore_info_; ObIPartitionGroupMetaRestoreReader* reader_; @@ -261,7 +261,7 @@ class ObPhysicalBaseMetaRestoreReaderV1 : public ObIPhysicalBaseMetaReader { // used for backup since 2.2.6 class ObPartitionMacroBlockRestoreReaderV1 : public ObIPartitionMacroBlockReader { - public: +public: ObPartitionMacroBlockRestoreReaderV1(); virtual ~ObPartitionMacroBlockRestoreReaderV1(); void reset(); @@ -279,11 +279,11 @@ class ObPartitionMacroBlockRestoreReaderV1 : public ObIPartitionMacroBlockReader return read_size_; } - private: +private: int trans_macro_block( const uint64_t table_id, blocksstable::ObMacroBlockMetaV2& meta, blocksstable::ObBufferReader& data); - private: +private: bool is_inited_; common::ObArray macro_list_; int64_t macro_idx_; @@ -299,7 +299,7 @@ class ObPartitionMacroBlockRestoreReaderV1 : public ObIPartitionMacroBlockReader }; class ObPartitionGroupMetaRestoreReaderV1 : public ObIPartitionGroupMetaRestoreReader { - public: +public: ObPartitionGroupMetaRestoreReaderV1(); virtual ~ObPartitionGroupMetaRestoreReaderV1(); void reset(); @@ -321,7 +321,7 @@ class ObPartitionGroupMetaRestoreReaderV1 : public ObIPartitionGroupMetaRestoreR } int get_restore_tenant_id(uint64_t& tenant_id); - private: +private: int prepare(common::ObInOutBandwidthThrottle& bandwidth_throttle, const ObPhysicalRestoreArg& restore_info, const ObPhyRestoreMetaIndexStore& meta_indexs, const ObPhyRestoreMacroIndexStore& macro_indexs); int prepare_pg_meta(common::ObInOutBandwidthThrottle& bandwidth_throttle, const ObPhysicalRestoreArg& restore_info); @@ -331,7 +331,7 @@ class ObPartitionGroupMetaRestoreReaderV1 : public ObIPartitionGroupMetaRestoreR int trans_backup_pgmeta(ObPartitionGroupMeta& backup_pg_meta); int check_backup_partitions_in_pg(const ObPhysicalRestoreArg& restore_info, ObPartitionGroupMeta& backup_pg_meta); - private: +private: typedef hash::ObHashMap MetaReaderMap; bool is_inited_; const ObPhysicalRestoreArg* restore_info_; @@ -347,7 +347,7 @@ class ObPartitionGroupMetaRestoreReaderV1 : public ObIPartitionGroupMetaRestoreR // used for 2.2 class ObPGPartitionBaseDataMetaRestoreReaderV1 : public ObIPGPartitionBaseDataMetaObReader { - public: +public: ObPGPartitionBaseDataMetaRestoreReaderV1(); virtual ~ObPGPartitionBaseDataMetaRestoreReaderV1(); void reset(); @@ -358,12 +358,12 @@ class ObPGPartitionBaseDataMetaRestoreReaderV1 : public ObIPGPartitionBaseDataMe return BASE_DATA_META_OB_RESTORE_READER_V1; } - private: +private: int check_sstable_table_ids_in_table(const ObPartitionKey& pkey, const common::ObIArray& table_ids); int check_sstable_ids_contain_schema_table_id(const hash::ObHashSet& table_id_set, const uint64_t schema_table_id, schema::ObSchemaGetterGuard& schema_guard); - private: +private: bool is_inited_; int64_t reader_index_; common::ObArray partition_reader_array_; diff --git a/src/storage/ob_partition_base_data_restore_reader.h b/src/storage/ob_partition_base_data_restore_reader.h index 58a10bfa3..d05507163 100644 --- a/src/storage/ob_partition_base_data_restore_reader.h +++ b/src/storage/ob_partition_base_data_restore_reader.h @@ -39,7 +39,7 @@ class ObRestoreMacroDagWrapper; /* }; */ class ObPartitionBaseDataMetaRestoreReader { - public: +public: ObPartitionBaseDataMetaRestoreReader(); virtual ~ObPartitionBaseDataMetaRestoreReader(); int init(common::ObInOutBandwidthThrottle& bandwidth_throttle, const common::ObPartitionKey& pkey, @@ -56,12 +56,12 @@ class ObPartitionBaseDataMetaRestoreReader { TO_STRING_KV(K_(pkey), K_(restore_info), K_(last_read_size), K_(partition_store_meta), K_(snapshot_version), K_(schema_version), K_(data_version)); - private: +private: int prepare(const common::ObPartitionKey& pkey, const ObDataStorageInfo& data_info); int get_smallest_base_version(ObPartitionStore* partition_store, int64_t& base_version); int get_freeze_info(const int64_t snapshot_version, const ObPartitionKey& pkey, const ObDataStorageInfo& data_info); - private: +private: bool is_inited_; common::ObPartitionKey pkey_; ObRestoreInfo* restore_info_; @@ -78,7 +78,7 @@ class ObPartitionBaseDataMetaRestoreReader { class ObPartitionGroupMetaRestoreReader; class ObPhysicalBaseMetaRestoreReader : public ObIPhysicalBaseMetaReader { - public: +public: ObPhysicalBaseMetaRestoreReader() : is_inited_(false), restore_info_(NULL), @@ -99,7 +99,7 @@ class ObPhysicalBaseMetaRestoreReader : public ObIPhysicalBaseMetaReader { return BASE_DATA_META_RESTORE_READER; } - private: +private: bool is_inited_; ObRestoreInfo* restore_info_; ObPartitionGroupMetaRestoreReader* reader_; @@ -110,7 +110,7 @@ class ObPhysicalBaseMetaRestoreReader : public ObIPhysicalBaseMetaReader { }; class ObPartitionMacroBlockRestoreReader : public ObIPartitionMacroBlockReader { - public: +public: ObPartitionMacroBlockRestoreReader(); virtual ~ObPartitionMacroBlockRestoreReader(); int init(common::ObInOutBandwidthThrottle& bandwidth_throttle, common::ObIArray& list, @@ -132,13 +132,13 @@ class ObPartitionMacroBlockRestoreReader : public ObIPartitionMacroBlockReader { return read_size_; } - private: +private: int schedule_macro_block_task(common::ObInOutBandwidthThrottle& bandwidth_throttle, const ObRestoreInfo& restore_info, const obrpc::ObFetchMacroBlockArg& arg, const ObPartitionKey& pkey, const uint64_t table_id, ObMacroBlockStorageReader& reader); int trans_macro_block(const blocksstable::ObMacroBlockMeta& meta, blocksstable::ObBufferReader& backup_data); - private: +private: bool is_inited_; common::ObArray macro_list_; int64_t macro_idx_; @@ -150,7 +150,7 @@ class ObPartitionMacroBlockRestoreReader : public ObIPartitionMacroBlockReader { }; class ObPartitionGroupMetaRestoreReader : public ObIPartitionGroupMetaRestoreReader { - public: +public: typedef hash::ObHashMap MetaReaderMap; ObPartitionGroupMetaRestoreReader(); virtual ~ObPartitionGroupMetaRestoreReader(); @@ -171,11 +171,11 @@ class ObPartitionGroupMetaRestoreReader : public ObIPartitionGroupMetaRestoreRea return PG_META_RESTORE_READER; } - private: +private: int prepare( const common::ObPGKey& pg_key, common::ObInOutBandwidthThrottle& bandwidth_throttle, ObRestoreInfo& restore_info); - private: +private: bool is_inited_; common::ObPGKey pg_key_; ObRestoreInfo* restore_info_; @@ -189,7 +189,7 @@ class ObPartitionGroupMetaRestoreReader : public ObIPartitionGroupMetaRestoreRea }; class ObPGPartitionBaseDataMetaRestorReader : public ObIPGPartitionBaseDataMetaObReader { - public: +public: ObPGPartitionBaseDataMetaRestorReader(); virtual ~ObPGPartitionBaseDataMetaRestorReader(); @@ -200,7 +200,7 @@ class ObPGPartitionBaseDataMetaRestorReader : public ObIPGPartitionBaseDataMetaO return BASE_DATA_META_OB_RESTORE_READER; } - private: +private: bool is_inited_; int64_t reader_index_; common::ObArray partition_reader_array_; @@ -208,7 +208,7 @@ class ObPGPartitionBaseDataMetaRestorReader : public ObIPGPartitionBaseDataMetaO }; class ObPartitionKeyChangeUtil { - public: +public: static int change_dst_pkey_to_src_pkey( const ObPartitionKey& dst_pkey, const ObRestoreInfo& restore_info, ObPartitionKey& src_pkey); }; diff --git a/src/storage/ob_partition_base_data_validate.h b/src/storage/ob_partition_base_data_validate.h index 8733a5ee0..311d8b0ea 100644 --- a/src/storage/ob_partition_base_data_validate.h +++ b/src/storage/ob_partition_base_data_validate.h @@ -47,7 +47,7 @@ class ObBackupChecksumChecker; // TODO : extract common interfaces class ObBackupMetaIndexStore { - public: +public: ObBackupMetaIndexStore(); virtual ~ObBackupMetaIndexStore() {} @@ -60,23 +60,23 @@ class ObBackupMetaIndexStore { int get_meta_index( const common::ObPartitionKey& pkey, const share::ObBackupMetaType& type, share::ObBackupMetaIndex& meta_index); - private: +private: int init_from_remote_file(const common::ObString& path, const common::ObString& storage_info); - private: +private: typedef common::hash::ObHashMap MetaIndexMap; bool is_inited_; MetaIndexMap meta_index_map_; common::ObArenaAllocator allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupMetaIndexStore); }; // TODO : extract common interfaces class ObBackupMacroIndexStore { - public: +public: ObBackupMacroIndexStore(); virtual ~ObBackupMacroIndexStore() {} @@ -88,12 +88,12 @@ class ObBackupMacroIndexStore { void reset(); int get_macro_block_index(const common::ObPGKey& pg_key, common::ObArray*& index_list); - private: +private: int init_from_remote_file( const common::ObPGKey& pg_key, const common::ObString& path, const common::ObString& storage_info); int add_sstable_index(const common::ObPGKey& pg_key, const common::ObIArray& index_list); - private: +private: typedef common::hash::ObHashMap*> MacroIndexMap; bool is_inited_; @@ -101,12 +101,12 @@ class ObBackupMacroIndexStore { MacroIndexMap macro_index_map_; common::ObArenaAllocator allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBackupMacroIndexStore); }; class ObValidateBackupPGCtx { - public: +public: struct SubTask final { SubTask(); virtual ~SubTask(); @@ -117,7 +117,7 @@ class ObValidateBackupPGCtx { common::ObPartitionKey pkey_; }; - public: +public: ObValidateBackupPGCtx(); virtual ~ObValidateBackupPGCtx(); int init(storage::ObMigrateCtx& migrate_ctx, common::ObInOutBandwidthThrottle& bandwidth_throttle); @@ -141,10 +141,10 @@ class ObValidateBackupPGCtx { } TO_STRING_KV(K_(result), K_(pg_key), K_(sub_task_cnt), K_(path_info)); - private: +private: int fetch_next_sub_task(SubTask*& sub_task); - public: +public: static const int64_t MAX_MACRO_BLOCK_COUNT_PER_SUB_TASK = 1 << 7; bool is_inited_; bool is_dropped_tenant_; @@ -181,35 +181,35 @@ class ObValidateBackupPGCtx { share::ObBackupBaseDataPathInfo path_info_; storage::ObMigrateCtx* migrate_ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObValidateBackupPGCtx); }; class ObValidatePrepareTask : public share::ObITask { - public: +public: ObValidatePrepareTask(); virtual ~ObValidatePrepareTask(); int init(ObMigrateCtx& migrate_ctx, ObValidateBackupPGCtx& validate_pg_ctx); virtual int process() override; - private: +private: bool is_inited_; ObMigrateCtx* migrate_ctx_; ObValidateBackupPGCtx* validate_pg_ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObValidatePrepareTask); }; class ObValidateClogDataTask : public share::ObITask { - public: +public: ObValidateClogDataTask(); virtual ~ObValidateClogDataTask(); int init(const int64_t clog_id, ObMigrateCtx& migrate_ctx, ObValidateBackupPGCtx& validate_pg_ctx); virtual int generate_next_task(share::ObITask*& next_task) override; virtual int process() override; - private: +private: const uint64_t TIMEOUT = 60 * 1000 * 1000L; bool is_inited_; int cur_clog_file_id_; @@ -218,19 +218,19 @@ class ObValidateClogDataTask : public share::ObITask { ObValidateBackupPGCtx* validate_pg_ctx_; archive::ObArchiveLogFileStore* archive_log_file_store_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObValidateClogDataTask); }; class ObValidateBaseDataTask : public share::ObITask { - public: +public: ObValidateBaseDataTask(); virtual ~ObValidateBaseDataTask(); int init(const int64_t task_idx, ObMigrateCtx& migrate_ctx, ObValidateBackupPGCtx& validate_pg_ctx); virtual int generate_next_task(share::ObITask*& next_task) override; virtual int process() override; - private: +private: int check_base_data_valid(bool& is_valid); int fetch_macro_block_with_retry( @@ -241,7 +241,7 @@ class ObValidateBaseDataTask : public share::ObITask { blocksstable::ObBufferReader& macro_data); int checksum_macro_block_data(blocksstable::ObBufferReader& buffer_reader, bool& is_valid); - private: +private: static const int64_t FETCH_MACRO_BLOCK_RETRY_INTERVAL = 1 * 1000 * 1000L; static const int64_t MAX_RETRY_TIME = 3L; @@ -254,12 +254,12 @@ class ObValidateBaseDataTask : public share::ObITask { common::ObArenaAllocator* allocator_; ObBackupMacroIndexStore* macro_index_store_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObValidateBaseDataTask); }; class ObValidateFinishTask : public share::ObITask { - public: +public: ObValidateFinishTask(); virtual ~ObValidateFinishTask(); int init(ObMigrateCtx& migrate_ctx_); @@ -269,18 +269,18 @@ class ObValidateFinishTask : public share::ObITask { return validate_pg_ctx_; } - private: +private: bool is_inited_; ObMigrateCtx* migrate_ctx_; ObValidateBackupPGCtx validate_pg_ctx_; share::ObPGValidateTaskUpdater updater_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObValidateFinishTask); }; class ObValidateBackupUtil { - public: +public: static int read_single_file(const common::ObString& path, const common::ObString& storage_info, ObIAllocator& allocator, char*& buf, int64_t& read_size); static int read_part_file(const common::ObString& path, const common::ObString& storage_info, char* buf, diff --git a/src/storage/ob_partition_checkpoint.h b/src/storage/ob_partition_checkpoint.h index e4e6a0c94..c8675c07a 100644 --- a/src/storage/ob_partition_checkpoint.h +++ b/src/storage/ob_partition_checkpoint.h @@ -20,28 +20,28 @@ namespace storage { class ObPartitionService; class ObCheckPoingLogCb : public clog::ObISubmitLogCb { - public: +public: ObCheckPoingLogCb() : ps_(NULL), checkpoint_(0) {} ~ObCheckPoingLogCb() {} int init(ObPartitionService* ps, const int64_t checkpoint); - public: +public: int on_success(const common::ObPartitionKey& partition_key, const clog::ObLogType log_type, const uint64_t log_id, const int64_t version, const bool batch_committed, const bool batch_last_succeed); int on_finished(const common::ObPartitionKey& partition_key, const uint64_t log_id); - public: +public: TO_STRING_KV(K_(checkpoint)); - private: +private: ObPartitionService* ps_; int64_t checkpoint_; }; class ObCheckPoingLogCbFactory { - public: +public: static ObCheckPoingLogCb* alloc(); static void release(ObCheckPoingLogCb* cb); }; diff --git a/src/storage/ob_partition_component_factory.h b/src/storage/ob_partition_component_factory.h index 2c5e30738..6952ae6cf 100644 --- a/src/storage/ob_partition_component_factory.h +++ b/src/storage/ob_partition_component_factory.h @@ -24,7 +24,7 @@ namespace storage { class ObSSStore; class ObPartitionComponentFactory : public ObIPartitionComponentFactory { - public: +public: ObPartitionComponentFactory() {} virtual ~ObPartitionComponentFactory() @@ -126,7 +126,7 @@ class ObPartitionComponentFactory : public ObIPartitionComponentFactory { virtual void free(ObPGPartitionBaseDataMetaRestoreReaderV2* reader); virtual void free(ObIPhyRestoreMacroIndexStore* macro_index); - protected: +protected: template void component_free(IT* component) { diff --git a/src/storage/ob_partition_freeze_record.h b/src/storage/ob_partition_freeze_record.h index 062f6db30..2bf54b452 100644 --- a/src/storage/ob_partition_freeze_record.h +++ b/src/storage/ob_partition_freeze_record.h @@ -35,7 +35,7 @@ namespace storage { class ObIPartitionGroup; class ObFreezeRecord { - public: +public: // check whether the memtable is available to execute a new minor freeze // the function is used to guarantee there is only one ongoing minor freeze bool available() const; @@ -88,7 +88,7 @@ class ObFreezeRecord { TO_STRING_KV(K(snapshot_version_), K(emergency_), K(active_protection_clock_), K(storage_info_), K(is_valid_)); - private: +private: int64_t snapshot_version_; bool emergency_; int64_t active_protection_clock_; diff --git a/src/storage/ob_partition_group.h b/src/storage/ob_partition_group.h index 2373e1844..552bdfe0c 100644 --- a/src/storage/ob_partition_group.h +++ b/src/storage/ob_partition_group.h @@ -55,7 +55,7 @@ enum ObMigrateRetryFlag { }; class ObPartitionGroup : public ObIPartitionGroup { - public: +public: ObPartitionGroup(); virtual ~ObPartitionGroup(); @@ -432,7 +432,7 @@ class ObPartitionGroup : public ObIPartitionGroup { virtual int check_physical_split(bool& finished); TO_STRING_KV(K_(pkey), K_(replay_status), K_(partition_state)); - private: +private: // this structure is introduced by major freeze refactoring // to break the circular dependency of waiting schema in the process // of leader takeover. @@ -443,23 +443,23 @@ class ObPartitionGroup : public ObIPartitionGroup { // In addition, schema version check is only limit to user tables, and // system or dummy tables will be skipped directly. class SchemaVersionContainer { - public: + public: SchemaVersionContainer() : schema_version_checked_(true), base_schema_version_(0) {} virtual ~SchemaVersionContainer() {} - public: + public: // This function is used to update schema_version. It will be called in the process // of leader_takeover int update_and_leader_takeover(int64_t base_schema_version); int check_base_schema_version( share::schema::ObMultiVersionSchemaService* schema_version, common::ObPartitionKey& pkey); - private: + private: static const int64_t INVALID_SCHEMA_RETRY_CNT = 10; - private: + private: // Used to identify whether the schema_version check has been completed. // It is set to false after leader takeover and set to true at the first // start_participants. @@ -470,7 +470,7 @@ class ObPartitionGroup : public ObIPartitionGroup { int64_t base_schema_version_; }; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObPartitionGroup); static const int64_t FREEZE_WAIT_TIME = 10L * 1000L; // 10ms @@ -485,7 +485,7 @@ class ObPartitionGroup : public ObIPartitionGroup { static const int64_t WAIT_FREEZE_LOG_ELAPSE_CNT_LIMIT = 20L; // 20 static const int64_t WAIT_FREEZE_LOG_ELAPSE_SLEEP_TS = 50L * 1000L; // 50ms - private: +private: int check_init_(void* cp, const char* cp_name) const; // for clog history info int get_clog_service_range_for_clog_history_info_( @@ -584,7 +584,7 @@ class ObPartitionGroup : public ObIPartitionGroup { ObSSTable& sstable); int get_base_storage_info_(common::ObBaseStorageInfo& base_storage_info); - protected: +protected: bool is_inited_; common::ObPartitionKey pkey_; diff --git a/src/storage/ob_partition_group_create_checker.h b/src/storage/ob_partition_group_create_checker.h index 6411ac309..94460cccb 100644 --- a/src/storage/ob_partition_group_create_checker.h +++ b/src/storage/ob_partition_group_create_checker.h @@ -21,7 +21,7 @@ using namespace oceanbase::common; namespace storage { class ObPartitionGroupCreateChecker { - public: +public: ObPartitionGroupCreateChecker() : creating_pgs_() {} ~ObPartitionGroupCreateChecker() @@ -34,11 +34,11 @@ class ObPartitionGroupCreateChecker { int mark_pg_created(const ObPartitionKey& pkey); void reset(); - private: +private: bool is_pg_creating_(const ObPartitionKey& pkey); int mark_pg_created_(const ObPartitionKey& pkey); - private: +private: common::TCRWLock lock_; ObPartitionArray creating_pgs_; }; diff --git a/src/storage/ob_partition_group_lock.h b/src/storage/ob_partition_group_lock.h index 459f47ccb..1e163abd6 100644 --- a/src/storage/ob_partition_group_lock.h +++ b/src/storage/ob_partition_group_lock.h @@ -51,7 +51,7 @@ class ObPartitionGroupLock { friend ObPartitionGroupTryLockGuard; friend ObPGLockWithPendingReplayGuard; - public: +public: typedef common::ObLatch RWLock; ObPartitionGroupLock(); @@ -60,7 +60,7 @@ class ObPartitionGroupLock { ObPartitionGroupLock(const ObPartitionGroupLock&) = delete; ObPartitionGroupLock& operator=(const ObPartitionGroupLock&) = delete; - private: +private: int64_t lock(int64_t hold, int64_t change); int64_t try_lock(int64_t hold, int64_t change); void unlock(int64_t target); @@ -69,7 +69,7 @@ class ObPartitionGroupLock { }; class ObPartitionGroupLockGuard { - public: +public: ObPartitionGroupLockGuard(ObPartitionGroupLock& lock, int64_t hold, int64_t change, const bool trylock = false); ~ObPartitionGroupLockGuard(); @@ -82,7 +82,7 @@ class ObPartitionGroupLockGuard { ObPartitionGroupLockGuard(const ObPartitionGroupLockGuard&) = delete; ObPartitionGroupLockGuard& operator=(const ObPartitionGroupLockGuard&) = delete; - private: +private: ObPartitionGroupLock& lock_; int64_t mark_; int64_t start_ts_; @@ -93,7 +93,7 @@ class ObPartitionGroupLockGuard { // engine and partition group. You need use the guard when adding replay engine // lock inside partition group class ObPGLockWithPendingReplayGuard { - public: +public: ObPGLockWithPendingReplayGuard(ObPartitionGroupLock& lock, ObReplayStatus& replay_status, const ObPartitionKey& key, int64_t hold, int64_t change); ~ObPGLockWithPendingReplayGuard(); @@ -107,11 +107,11 @@ class ObPGLockWithPendingReplayGuard { ObPGLockWithPendingReplayGuard(const ObPGLockWithPendingReplayGuard&) = delete; ObPGLockWithPendingReplayGuard& operator=(const ObPGLockWithPendingReplayGuard&) = delete; - public: +public: static const int64_t SLEEP_FOR_PENDING_REPLAY = 10L * 1000L; // 10ms static const int64_t SLEEP_FOR_PENDING_REPLAY_CNT = 5000L; static const int64_t TIMEOUT_FOR_PENDING_REPLAY = 100L * 1000L; // 100ms - private: +private: ObPartitionGroupLock& lock_; ObReplayStatus& replay_status_; ObPartitionKey pkey_; diff --git a/src/storage/ob_partition_log.h b/src/storage/ob_partition_log.h index ee22b8f01..911fc89c2 100644 --- a/src/storage/ob_partition_log.h +++ b/src/storage/ob_partition_log.h @@ -95,7 +95,7 @@ struct ObBeginTransLogEntry : public blocksstable::ObIBaseStorageLogEntry { virtual int64_t get_serialize_size() const override; virtual int64_t to_string(char* buf, const int64_t buf_len) const override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBeginTransLogEntry); }; @@ -103,7 +103,7 @@ struct ObChangePartitionLogEntry : public blocksstable::ObIBaseStorageLogEntry { // For compatibility, the variables in this struct MUST NOT be deleted or moved. // You should ONLY add variables at the end. // Note that if you use complex structure as variables, the complex structure should also keep compatibility. - public: +public: static const int64_t CHANGE_PARTITION_LOG_VERSION = 1; common::ObPartitionKey partition_key_; common::ObReplicaType replica_type_; @@ -116,7 +116,7 @@ struct ObChangePartitionLogEntry : public blocksstable::ObIBaseStorageLogEntry { virtual bool is_valid() const; OB_UNIS_VERSION_V(CHANGE_PARTITION_LOG_VERSION); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObChangePartitionLogEntry); }; @@ -124,7 +124,7 @@ struct ObChangePartitionStorageLogEntry : public blocksstable::ObIBaseStorageLog // For compatibility, the variables in this struct MUST NOT be deleted or moved. // You should ONLY add variables at the end. // Note that if you use complex structure as variables, the complex structure should also keep compatibility. - public: +public: static const int64_t CHANGE_PARTITION_STORAGE_LOG_VERSION = 1; common::ObPartitionKey partition_key_; @@ -134,7 +134,7 @@ struct ObChangePartitionStorageLogEntry : public blocksstable::ObIBaseStorageLog virtual bool is_valid() const; OB_UNIS_VERSION_V(CHANGE_PARTITION_STORAGE_LOG_VERSION); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObChangePartitionStorageLogEntry); }; @@ -166,7 +166,7 @@ struct ObDeleteSSTableLogEntry : public blocksstable::ObIBaseStorageLogEntry { }; struct ObAddSSTableLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t ADD_SSTABLE_LOG_VERSION = 1; ObAddSSTableLogEntry(const common::ObPGKey& pg_key, ObSSTable& sstable); explicit ObAddSSTableLogEntry(ObSSTable& sstable); @@ -175,13 +175,13 @@ struct ObAddSSTableLogEntry : public blocksstable::ObIBaseStorageLogEntry { TO_STRING_KV(K_(pg_key), K_(sstable)); OB_UNIS_VERSION_V(ADD_SSTABLE_LOG_VERSION); - public: +public: common::ObPGKey pg_key_; ObSSTable& sstable_; }; struct ObRemoveSSTableLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t REMOVE_SSTABLE_LOG_VERSION = 1; ObRemoveSSTableLogEntry(); ObRemoveSSTableLogEntry(const ObPGKey& pg_key, const ObITable::TableKey& table_key); @@ -190,7 +190,7 @@ struct ObRemoveSSTableLogEntry : public blocksstable::ObIBaseStorageLogEntry { TO_STRING_KV(K_(pg_key), K_(table_key)); OB_UNIS_VERSION_V(REMOVE_SSTABLE_LOG_VERSION); - public: +public: common::ObPGKey pg_key_; ObITable::TableKey table_key_; }; @@ -238,7 +238,7 @@ struct ObUpdatePartitionMetaLogEntry : public blocksstable::ObIBaseStorageLogEnt struct ObSplitPartitionStateLogEntry : public blocksstable::ObIBaseStorageLogEntry { OB_UNIS_VERSION_V(1); - public: +public: ObSplitPartitionStateLogEntry() : pkey_(), state_(UNKNOWN_SPLIT_STATE) {} ~ObSplitPartitionStateLogEntry() @@ -258,7 +258,7 @@ struct ObSplitPartitionStateLogEntry : public blocksstable::ObIBaseStorageLogEnt } TO_STRING_KV(K_(pkey), "state", to_state_str(static_cast(state_))); - private: +private: common::ObPartitionKey pkey_; int64_t state_; }; @@ -266,7 +266,7 @@ struct ObSplitPartitionStateLogEntry : public blocksstable::ObIBaseStorageLogEnt struct ObSplitPartitionInfoLogEntry : public blocksstable::ObIBaseStorageLogEntry { OB_UNIS_VERSION_V(1); - public: +public: ObSplitPartitionInfoLogEntry() : pkey_(), split_info_() {} ~ObSplitPartitionInfoLogEntry() @@ -286,7 +286,7 @@ struct ObSplitPartitionInfoLogEntry : public blocksstable::ObIBaseStorageLogEntr } TO_STRING_KV(K_(pkey), K_(split_info)); - private: +private: common::ObPartitionKey pkey_; ObPartitionSplitInfo split_info_; }; @@ -294,7 +294,7 @@ struct ObSplitPartitionInfoLogEntry : public blocksstable::ObIBaseStorageLogEntr struct ObUpdateTenantConfigLogEntry : public blocksstable::ObIBaseStorageLogEntry { OB_UNIS_VERSION_V(1); - public: +public: explicit ObUpdateTenantConfigLogEntry(share::TenantUnits& units); virtual ~ObUpdateTenantConfigLogEntry() {} @@ -304,7 +304,7 @@ struct ObUpdateTenantConfigLogEntry : public blocksstable::ObIBaseStorageLogEntr } TO_STRING_KV(K_(units)); - private: +private: share::TenantUnits& units_; }; @@ -347,7 +347,7 @@ struct ObUpdatePGPartitionMetaLogEntry : public blocksstable::ObIBaseStorageLogE }; struct ObPGMacroBlockMetaLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t PG_MACRO_BLOCK_META_VERSION = 1; ObPGMacroBlockMetaLogEntry(const common::ObPGKey& pg_key, const ObITable::TableKey& table_key, const int64_t data_file_id, const int64_t disk_no, const blocksstable::MacroBlockId& macro_block_id, @@ -361,7 +361,7 @@ struct ObPGMacroBlockMetaLogEntry : public blocksstable::ObIBaseStorageLogEntry TO_STRING_KV(K_(pg_key), K_(table_key), K_(data_file_id), K_(disk_no), K_(macro_block_id), K_(meta)); OB_UNIS_VERSION_V(PG_MACRO_BLOCK_META_VERSION); - public: +public: ObPGKey pg_key_; ObITable::TableKey table_key_; int64_t data_file_id_; @@ -372,7 +372,7 @@ struct ObPGMacroBlockMetaLogEntry : public blocksstable::ObIBaseStorageLogEntry }; struct ObSetStartLogTsAfterMajorLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t SET_START_LOG_TS_AFTER_MAJOR_VERSION = 1; explicit ObSetStartLogTsAfterMajorLogEntry( const common::ObPGKey& pg_key, const ObITable::TableKey& table_key, const int64_t start_log_ts_after_major); @@ -383,17 +383,17 @@ struct ObSetStartLogTsAfterMajorLogEntry : public blocksstable::ObIBaseStorageLo TO_STRING_KV(K_(pg_key), K_(table_key), K_(start_log_ts_after_major)); OB_UNIS_VERSION(SET_START_LOG_TS_AFTER_MAJOR_VERSION); - public: +public: ObPGKey pg_key_; ObITable::TableKey table_key_; int64_t start_log_ts_after_major_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSetStartLogTsAfterMajorLogEntry); }; struct ObAddRecoveryPointDataLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t ADD_RECOVERY_POINT_DATA_LOG_VERSION = 1; explicit ObAddRecoveryPointDataLogEntry(const ObRecoveryPointType point_type, ObRecoveryPointData& point_data); virtual ~ObAddRecoveryPointDataLogEntry() = default; @@ -401,16 +401,16 @@ struct ObAddRecoveryPointDataLogEntry : public blocksstable::ObIBaseStorageLogEn TO_STRING_KV(K_(point_type), K_(point_data)); OB_UNIS_VERSION(ADD_RECOVERY_POINT_DATA_LOG_VERSION); - public: +public: ObRecoveryPointType point_type_; ObRecoveryPointData& point_data_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAddRecoveryPointDataLogEntry); }; struct ObRemoveRecoveryPointDataLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t REMOVE_RECOVERY_POINT_DATA_LOG_VERSION = 1; ObRemoveRecoveryPointDataLogEntry(); explicit ObRemoveRecoveryPointDataLogEntry( @@ -420,12 +420,12 @@ struct ObRemoveRecoveryPointDataLogEntry : public blocksstable::ObIBaseStorageLo TO_STRING_KV(K_(point_type), K_(pg_key), K_(snapshot_version)); OB_UNIS_VERSION(REMOVE_RECOVERY_POINT_DATA_LOG_VERSION); - public: +public: ObRecoveryPointType point_type_; ObPGKey pg_key_; int64_t snapshot_version_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRemoveRecoveryPointDataLogEntry); }; diff --git a/src/storage/ob_partition_loop_worker.cpp b/src/storage/ob_partition_loop_worker.cpp index 778c03269..68ad29d01 100644 --- a/src/storage/ob_partition_loop_worker.cpp +++ b/src/storage/ob_partition_loop_worker.cpp @@ -205,9 +205,9 @@ int ObPartitionLoopWorker::generate_weak_read_timestamp(const int64_t max_stale_ } } else if (!readable_info.is_valid()) { if (is_restore) { - //ignore pg in restore + // ignore pg in restore ret = OB_STATE_NOT_MATCH; - if (REACH_TIME_INTERVAL(2 *1000 * 1000L)) { + if (REACH_TIME_INTERVAL(2 * 1000 * 1000L)) { STORAGE_LOG(WARN, "partition is in restore, just ignore", K(ret), K_(pkey), K(readable_info)); } } else { diff --git a/src/storage/ob_partition_loop_worker.h b/src/storage/ob_partition_loop_worker.h index 27f2b2c5f..5a8610bfc 100644 --- a/src/storage/ob_partition_loop_worker.h +++ b/src/storage/ob_partition_loop_worker.h @@ -26,7 +26,7 @@ class ObISubmitLogCb; namespace storage { class ObPartitionGroup; class ObPartitionLoopWorker { - public: +public: ObPartitionLoopWorker() { reset(); @@ -85,7 +85,7 @@ class ObPartitionLoopWorker { K_(last_max_trans_version), K_(next_gene_checkpoint_log_ts), K_(safe_slave_read_timestamp), K_(last_checkpoint_value)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionLoopWorker); static const int64_t COLD_PARTITION_CHECKPOINT_INTERVAL = 3600LL * 1000 * 1000; static const int64_t COLD_PARTITION_CHECKPOINT_PS_LIMIT = 1000; @@ -102,7 +102,7 @@ class ObPartitionLoopWorker { int check_dup_table_partition_(); int get_readable_info_(ObPartitionReadableInfo& readable_info); - protected: +protected: bool is_inited_; common::ObPartitionKey pkey_; clog::ObIPartitionLogService* pls_; diff --git a/src/storage/ob_partition_memstore_info_record.h b/src/storage/ob_partition_memstore_info_record.h index d54c0fbce..f3489e647 100644 --- a/src/storage/ob_partition_memstore_info_record.h +++ b/src/storage/ob_partition_memstore_info_record.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace storage { class ObMemstoreInfoRecord { - public: +public: int push(const ObDataStorageInfo& data_info, const int64_t readable_ts); int front(ObDataStorageInfo& data_info) const; void reset(); @@ -33,7 +33,7 @@ class ObMemstoreInfoRecord { ObMemstoreInfoRecord(const ObMemstoreInfoRecord&) = delete; ObMemstoreInfoRecord& operator=(const ObMemstoreInfoRecord&) = delete; - private: +private: int64_t get_next_pos() const { return 1L - head_; diff --git a/src/storage/ob_partition_merge_task.h b/src/storage/ob_partition_merge_task.h index c246726c1..ca789efd2 100644 --- a/src/storage/ob_partition_merge_task.h +++ b/src/storage/ob_partition_merge_task.h @@ -34,17 +34,17 @@ namespace storage { class ObSSTableMergeDag; class ObMacroBlockMergeTask : public share::ObITask { - public: +public: ObMacroBlockMergeTask(); virtual ~ObMacroBlockMergeTask(); int init(const int64_t idx, storage::ObSSTableMergeCtx& ctx); virtual int process(); int generate_next_task(ObITask*& next_task); - private: +private: int process_iter_to_complement(transaction::ObTransService* txs); - private: +private: int64_t idx_; storage::ObSSTableMergeCtx* ctx_; compaction::ObMacroBlockBuilder builder_; @@ -52,13 +52,13 @@ class ObMacroBlockMergeTask : public share::ObITask { compaction::ObIStoreRowProcessor* processor_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMacroBlockMergeTask); }; // used for record output macro blocks class ObSSTableMergeContext { - public: +public: ObSSTableMergeContext(); virtual ~ObSSTableMergeContext(); @@ -88,7 +88,7 @@ class ObSSTableMergeContext { int get_data_macro_block_count(int64_t& macro_block_count); TO_STRING_KV(K_(is_inited), K_(concurrent_cnt), K_(finish_count), K_(sstable_merge_info)); - private: +private: int add_lob_macro_blocks(const int64_t idx, blocksstable::ObMacroBlocksWriteCtx* blocks_ctx); int new_block_write_ctx(blocksstable::ObMacroBlocksWriteCtx*& ctx); OB_INLINE bool need_lob_macro_blocks() @@ -96,7 +96,7 @@ class ObSSTableMergeContext { return !lob_block_ctxs_.empty(); } - private: +private: bool is_inited_; common::ObSpinLock lock_; ObArray block_ctxs_; @@ -262,7 +262,7 @@ struct ObSSTableMergeCtx { K_(logical_data_version), K_(log_ts_range), K_(merge_log_ts), K_(trans_table_end_log_ts), K_(trans_table_timestamp), K_(read_base_version)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSSTableMergeCtx); }; @@ -303,56 +303,56 @@ struct ObMergeParameter { KP_(mv_dep_table_schema), K_(version_range), KP_(checksum_calculator), KP_(tables_handle), K_(is_iter_complement)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMergeParameter); }; class ObSSTableMergePrepareTask : public share::ObITask { - public: +public: ObSSTableMergePrepareTask(); virtual ~ObSSTableMergePrepareTask(); int init(); virtual int process() override; - private: +private: int generate_merge_sstable_task(); int init_estimate(storage::ObSSTableMergeCtx& ctx); int create_sstable_for_large_snapshot(storage::ObSSTableMergeCtx& ctx); - private: +private: bool is_inited_; ObSSTableMergeDag* merge_dag_; DISALLOW_COPY_AND_ASSIGN(ObSSTableMergePrepareTask); }; class ObSSTableMergeFinishTask : public share::ObITask { - public: +public: ObSSTableMergeFinishTask(); virtual ~ObSSTableMergeFinishTask(); int init(); virtual int process() override; - private: +private: int get_merged_sstable_(const ObITable::TableType& type, const uint64_t table_id, storage::ObSSTableMergeContext& merge_context, storage::ObTableHandle& table_handle, ObSSTable*& sstable); int check_data_checksum(); int check_empty_merge_valid(storage::ObSSTableMergeCtx& ctx); int check_macro_cnt_of_merge_table(const ObITable::TableType& type, storage::ObSSTableMergeContext& merge_context); - private: +private: bool is_inited_; ObSSTableMergeDag* merge_dag_; DISALLOW_COPY_AND_ASSIGN(ObSSTableMergeFinishTask); }; class ObWriteCheckpointTask : public share::ObITask { - public: +public: ObWriteCheckpointTask(); virtual ~ObWriteCheckpointTask(); int init(int64_t frozen_version); virtual int process() override; - private: +private: static const int64_t FAIL_WRITE_CHECKPOINT_ALERT_INTERVAL = 1000L * 1000L * 3600LL; // 6h static const int64_t RETRY_WRITE_CHECKPOINT_MIN_INTERVAL = 1000L * 1000L * 300L; // 5 minutes // Average replay time of 1 slog is 100us. Total replay time should less than 1 minute. @@ -365,7 +365,7 @@ class ObWriteCheckpointTask : public share::ObITask { }; class ObWriteCheckpointDag : public share::ObIDag { - public: +public: ObWriteCheckpointDag(); virtual ~ObWriteCheckpointDag(); virtual bool operator==(const ObIDag& other) const override; @@ -378,14 +378,14 @@ class ObWriteCheckpointDag : public share::ObIDag { return static_cast(share::ObWorker::CompatMode::MYSQL); } - protected: +protected: bool is_inited_; int64_t frozen_version_; DISALLOW_COPY_AND_ASSIGN(ObWriteCheckpointDag); }; class ObSSTableMergeDag : public share::ObIDag { - public: +public: ObSSTableMergeDag(const ObIDagType type, const ObIDagPriority priority); virtual ~ObSSTableMergeDag(); storage::ObSSTableMergeCtx& get_ctx() @@ -412,7 +412,7 @@ class ObSSTableMergeDag : public share::ObIDag { INHERIT_TO_STRING_KV("ObIDag", ObIDag, "param", ctx_.param_, "sstable_version_range", ctx_.sstable_version_range_, "log_ts_range", ctx_.log_ts_range_); - protected: +protected: int inner_init(const ObSSTableScheduleMergeParam& param, ObIPartitionReport* report); bool is_inited_; @@ -426,37 +426,37 @@ class ObSSTableMergeDag : public share::ObIDag { }; class ObSSTableMajorMergeDag : public ObSSTableMergeDag { - public: +public: ObSSTableMajorMergeDag(); virtual ~ObSSTableMajorMergeDag(); int init(const ObSSTableScheduleMergeParam& param, ObIPartitionReport* report) override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSSTableMajorMergeDag); }; class ObSSTableMiniMergeDag : public ObSSTableMergeDag { - public: +public: ObSSTableMiniMergeDag(); virtual ~ObSSTableMiniMergeDag(); int init(const ObSSTableScheduleMergeParam& param, ObIPartitionReport* report) override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSSTableMiniMergeDag); }; class ObSSTableMinorMergeDag : public ObSSTableMergeDag { - public: +public: ObSSTableMinorMergeDag(); virtual ~ObSSTableMinorMergeDag(); int init(const ObSSTableScheduleMergeParam& param, ObIPartitionReport* report) override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSSTableMinorMergeDag); }; class ObTransTableMergeDag : public share::ObIDag { - public: +public: ObTransTableMergeDag() : ObIDag(ObIDagType::DAG_TYPE_TRANS_TABLE_MERGE, ObIDagPriority::DAG_PRIO_TRANS_TABLE_MERGE){}; ~ObTransTableMergeDag(){}; int init(const ObPartitionKey& pg_key) @@ -491,16 +491,16 @@ class ObTransTableMergeDag : public share::ObIDag { } INHERIT_TO_STRING_KV("ObIDag", ObIDag, "pg_key", pg_key_); - private: +private: ObPartitionKey pg_key_; DISALLOW_COPY_AND_ASSIGN(ObTransTableMergeDag); }; class ObTransTableMergeTask : public share::ObITask { - private: +private: enum class SOURCE { NONE = 0, FROM_LOCAL, FROM_REMOTE, FROM_BOTH }; - public: +public: ObTransTableMergeTask(); ~ObTransTableMergeTask(){}; int init(const ObPartitionKey& pg_key, const int64_t end_log_ts, const int64_t trans_table_seq); @@ -510,14 +510,14 @@ class ObTransTableMergeTask : public share::ObITask { int merge_trans_table(blocksstable::ObMacroBlockWriter& writer); int get_merged_trans_sstable(ObTableHandle& table_handle, blocksstable::ObMacroBlockWriter& writer); - private: +private: const int64_t SCHEMA_VERSION = 1; - private: +private: int update_partition_store(ObTableHandle& table_handle); int merge_remote_with_local(blocksstable::ObMacroBlockWriter& writer); - private: +private: ObPartitionKey pg_key_; common::ObArenaAllocator allocator_; ObPartitionKey trans_table_pkey_; diff --git a/src/storage/ob_partition_meta_block_reader.h b/src/storage/ob_partition_meta_block_reader.h index f810736c9..66b7c8985 100644 --- a/src/storage/ob_partition_meta_block_reader.h +++ b/src/storage/ob_partition_meta_block_reader.h @@ -19,15 +19,15 @@ namespace oceanbase { namespace storage { class ObPartitionService; class ObPartitionMetaBlockReader : public blocksstable::ObMetaBlockReader { - public: +public: ObPartitionMetaBlockReader(ObPartitionService& partition_service); virtual ~ObPartitionMetaBlockReader(); - protected: +protected: virtual int parse(const blocksstable::ObMacroBlockCommonHeader& common_header, const blocksstable::ObLinkedMacroBlockHeader& linked_header, const char* buf, const int64_t buf_len); - private: +private: ObPartitionService& partition_service_; common::ObArenaAllocator allocator_; char* read_buf_; diff --git a/src/storage/ob_partition_meta_redo_module.h b/src/storage/ob_partition_meta_redo_module.h index f514cffcc..111686a0e 100644 --- a/src/storage/ob_partition_meta_redo_module.h +++ b/src/storage/ob_partition_meta_redo_module.h @@ -32,7 +32,7 @@ class PGKeyHashSet; // used for unit test mock #define VIRTUAL_FOR_UNITTEST virtual class ObPartitionMetaRedoModule : public blocksstable::ObIRedoModule { - public: +public: ObPartitionMetaRedoModule(); virtual ~ObPartitionMetaRedoModule(); @@ -40,7 +40,7 @@ class ObPartitionMetaRedoModule : public blocksstable::ObIRedoModule { ObBaseFileMgr* file_mgr); virtual int destroy(); - public: +public: // replay virtual int replay(const blocksstable::ObRedoModuleReplayParam& param) override; virtual int parse(const int64_t subcmd, const char* buf, const int64_t len, FILE* stream) override; @@ -74,7 +74,7 @@ class ObPartitionMetaRedoModule : public blocksstable::ObIRedoModule { return partition_map_; } - protected: +protected: virtual int inner_add_partition( ObIPartitionGroup& partition, const bool need_check_tenant, const bool is_replay, const bool allow_multi_value); virtual int inner_del_partition_for_replay(const common::ObPartitionKey& pkey, const int64_t file_id); @@ -106,7 +106,7 @@ class ObPartitionMetaRedoModule : public blocksstable::ObIRedoModule { int replay_add_recovery_point_data(const blocksstable::ObRedoModuleReplayParam& param); int replay_remove_recovery_point_data(const blocksstable::ObRedoModuleReplayParam& param); - private: +private: int get_create_pg_param(const ObCreatePartitionGroupLogEntry& log_entry, const bool write_pg_slog, blocksstable::ObStorageFileHandle* file_handle, ObBaseFileMgr* file_mgr, ObCreatePGParam& param); int get_partition(const common::ObPartitionKey& pkey, const int64_t* file_id, ObIPartitionGroupGuard& guard) const; @@ -115,7 +115,7 @@ class ObPartitionMetaRedoModule : public blocksstable::ObIRedoModule { int handle_pg_conflict(const char* buf, const int64_t buf_len, int64_t& pos, blocksstable::ObStorageFileHandle& file_handle, ObIPartitionGroup*& ptt); - protected: +protected: ObIPartitionComponentFactory* cp_fty_; transaction::ObTransService* txs_; replayengine::ObILogReplayEngine* rp_eg_; @@ -130,12 +130,12 @@ class ObPartitionMetaRedoModule : public blocksstable::ObIRedoModule { bool is_replay_old_; bool is_inited_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionMetaRedoModule); }; class ObIPartitionArrayGuard { - public: +public: ObIPartitionArrayGuard() : pg_mgr_(nullptr), partitions_() {} virtual ~ObIPartitionArrayGuard() @@ -182,7 +182,7 @@ class ObIPartitionArrayGuard { return ret; } - private: +private: const ObPGMgr* pg_mgr_; common::ObSEArray partitions_; DISALLOW_COPY_AND_ASSIGN(ObIPartitionArrayGuard); diff --git a/src/storage/ob_partition_migrate_old_rpc.h b/src/storage/ob_partition_migrate_old_rpc.h index 6250b4eff..2c1b64326 100644 --- a/src/storage/ob_partition_migrate_old_rpc.h +++ b/src/storage/ob_partition_migrate_old_rpc.h @@ -30,7 +30,7 @@ namespace oceanbase { namespace storage { class ObStoreInfo { - public: +public: ObStoreInfo(); virtual ~ObStoreInfo(); void reset() @@ -52,11 +52,11 @@ class ObStoreInfo { OB_UNIS_VERSION(1); - private: +private: ObSavedStorageInfo saved_storage_info_; int64_t sstable_count_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObStoreInfo); }; @@ -118,7 +118,7 @@ struct ObMigrateInfoFetchResult { struct ObFetchBaseDataMetaArg { OB_UNIS_VERSION(1); - public: +public: ObFetchBaseDataMetaArg() : pkey_(), version_(0), store_type_(storage::INVALID_STORE_TYPE) {} TO_STRING_KV(K_(pkey), K_(version), K_(store_type)); @@ -131,7 +131,7 @@ struct ObFetchBaseDataMetaArg { struct ObFetchMacroBlockOldArg { OB_UNIS_VERSION(1); - public: +public: ObFetchMacroBlockOldArg() : index_id_(0), macro_block_index_(0), data_version_(0), data_seq_(0) {} void reset(); @@ -148,7 +148,7 @@ struct ObFetchMacroBlockOldArg { struct ObFetchMacroBlockListOldArg { OB_UNIS_VERSION(1); - public: +public: ObFetchMacroBlockListOldArg(); TO_STRING_KV(K_(pkey), K_(data_version), K(store_type_), "arg_count", arg_list_.count()); common::ObPartitionKey pkey_; diff --git a/src/storage/ob_partition_migration_status.h b/src/storage/ob_partition_migration_status.h index 2937b1faa..7d0ea7698 100644 --- a/src/storage/ob_partition_migration_status.h +++ b/src/storage/ob_partition_migration_status.h @@ -52,7 +52,7 @@ struct ObPartitionMigrationStatus { }; class ObPartitionMigrationStatusGuard { - public: +public: explicit ObPartitionMigrationStatusGuard(); virtual ~ObPartitionMigrationStatusGuard(); @@ -67,14 +67,14 @@ class ObPartitionMigrationStatusGuard { return lock_; } - private: +private: ObPartitionMigrationStatus* status_; common::SpinRWLock* lock_; DISALLOW_COPY_AND_ASSIGN(ObPartitionMigrationStatusGuard); }; class ObPartitionMigrationStatusMgr { - public: +public: ObPartitionMigrationStatusMgr(); virtual ~ObPartitionMigrationStatusMgr(); static ObPartitionMigrationStatusMgr& get_instance(); @@ -84,10 +84,10 @@ class ObPartitionMigrationStatusMgr { int get_iter(ObPartitionMigrationStatusMgrIter& iter); int del_status(const share::ObTaskId& task_id); - private: +private: int remove_oldest_status(); - private: +private: common::SpinRWLock lock_; common::ObArray status_array_; diff --git a/src/storage/ob_partition_migrator.h b/src/storage/ob_partition_migrator.h index 66488f3e2..45c041ec6 100644 --- a/src/storage/ob_partition_migrator.h +++ b/src/storage/ob_partition_migrator.h @@ -43,7 +43,7 @@ class ObBackupPhysicalPGCtx; class ObPartGroupTask; class ObMacroBlockReuseMgr final { - public: +public: ObMacroBlockReuseMgr(); ~ObMacroBlockReuseMgr(); int build_reuse_macro_map(ObMigrateCtx& ctx, const ObITable::TableKey& table_key, @@ -52,15 +52,15 @@ class ObMacroBlockReuseMgr final { const blocksstable::ObMajorMacroBlockKey& block_key, blocksstable::ObMacroBlockInfoPair& info); void reset(); - private: +private: class RemoveFunctor { - public: + public: RemoveFunctor() = default; ~RemoveFunctor() = default; bool operator()(const blocksstable::ObMajorMacroBlockKey& block_key, blocksstable::ObMacroBlockInfoPair& info); }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMacroBlockReuseMgr); typedef common::ObLinearHashMap MacroMetaMap; MacroMetaMap full_map_; @@ -84,7 +84,7 @@ struct ObPartitionGroupInfoResult { class ObBaseMigrateDag; struct ObMigrateCtx { - public: +public: static const int64_t MIN_CHECK_REPLAY_TS = 100 * 1000; // 100ms static const int64_t MAX_CONTINUES_FAIL_COUNT = 10; // Only in the SCHEDULE_AND_COPY_BASE_DATA state, there will be multiple tasks holding migrate ctx, other times are @@ -204,19 +204,19 @@ struct ObMigrateCtx { int64_t fetch_pg_info_compat_version_; ObBackupPhysicalPGCtx physical_backup_ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigrateCtx); }; class ObMigrateCtxGuard { - public: +public: explicit ObMigrateCtxGuard(const bool is_write_lock, ObMigrateCtx& ctx); virtual ~ObMigrateCtxGuard(); - private: +private: ObMigrateCtx& ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigrateCtxGuard); }; @@ -238,7 +238,7 @@ struct ObPartitionMigrateCtx final { TO_STRING_KV(KP_(ctx), K_(copy_info), K_(is_partition_exist), K_(handle), K_(need_reuse_local_minor)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionMigrateCtx); }; @@ -294,7 +294,7 @@ struct ObReportPartMigrationTask : ObIPartMigrationTask { }; class ObPartitionMigrator { - public: +public: const static int64_t OB_MIGRATE_SCHEDULE_SLEEP_INTERVAL_S = 100 * 1000; // 100ms ObPartitionMigrator(); @@ -354,7 +354,7 @@ class ObPartitionMigrator { } static int fill_comment(const ObMigrateCtx& ctx, char* buf, const int64_t buf_len); - private: +private: bool is_inited_; bool is_stop_; common::ObInOutBandwidthThrottle* bandwidth_throttle_; @@ -370,13 +370,13 @@ class ObPartitionMigrator { }; class ObPartGroupTask { - public: +public: enum Type { PART_GROUP_MIGATION_TASK, PART_GROUP_BACKUP_TASK, }; - public: +public: ObPartGroupTask(); virtual ~ObPartGroupTask(); @@ -414,7 +414,7 @@ class ObPartGroupTask { TO_STRING_KV(K_(task_id), K_(is_inited), K_(is_finished), K_(is_batch_mode), KP_(partition_service), K_(first_error_code), K_(type), "sub_task_count", task_list_.count(), K_(task_list)); - protected: +protected: int build_migrate_ctx(const ObReplicaOpArg& arg, ObMigrateCtx& migrate_ctx); void dump_task_status(); int check_is_task_cancel(); @@ -427,7 +427,7 @@ class ObPartGroupTask { int set_report_list_result( ObIArray& report_list, const ObPartitionKey& pkey, const int32_t result); - protected: +protected: bool is_inited_; bool is_batch_mode_; // Used to be compatible with the old version of rs, when it is false, all rpc related to rs // will use the old interface @@ -448,7 +448,7 @@ class ObPartGroupTask { }; class ObPartGroupMigrationTask : public ObPartGroupTask { - public: +public: // Only need to retry if the migration exceeds 2 hours static const int64_t LARGE_MIGRATION_NEED_RETRY_COST_TIME = 2 * 3600 * 1000 * 1000LL; static const int64_t PART_GROUP_TASK_IDLE_TIME_MS = 10 * 1000LL; // 10s @@ -483,7 +483,7 @@ class ObPartGroupMigrationTask : public ObPartGroupTask { K_(start_change_member_ts), KP_(partition_service), K_(first_error_code), K_(type), "sub_task_count", task_list_.count(), K_(task_list), K_(restore_version)); - private: +private: int check_partition_validation(); // Called only before starting execution, do not consider concurrency int check_disk_space(); // Called only before starting execution, do not consider concurrency static int get_partition_required_size(const common::ObPartitionKey& pkey, int64_t& required_size); @@ -529,7 +529,7 @@ class ObPartGroupMigrationTask : public ObPartGroupTask { int set_migrate_task_flags_(const ObMigrateStatus& status, const bool is_restore, ObPartMigrationTask& task); int check_before_backup(); - private: +private: static const int64_t RETRY_JOB_MAX_WAIT_TIMEOUT = 600 * 1000 * 1000; // 10m int64_t schedule_ts_; // Only the scheduling thread will change and use int64_t start_change_member_ts_; // Only the scheduling thread will change and use @@ -541,7 +541,7 @@ class ObPartGroupMigrationTask : public ObPartGroupTask { }; class ObPartGroupMigrator { - public: +public: ObPartGroupMigrator(); virtual ~ObPartGroupMigrator(); void destroy(); @@ -561,7 +561,7 @@ class ObPartGroupMigrator { int remove_finish_task(ObPartGroupTask* group_task); void wakeup(); - private: +private: int inner_schedule(const common::ObIArray& arg_list, const bool is_batch_mode, const share::ObTaskId& task_id, const bool is_normal_migrate, ObPartGroupTask*& group_task); int check_copy_limit_(const ObIArray& arg_list); @@ -574,7 +574,7 @@ class ObPartGroupMigrator { int get_group_task(const ObIArray& arg_list, const bool is_batch_mode, const share::ObTaskId& in_task_id, ObPartGroupTask*& group_task); - private: +private: bool is_inited_; common::SpinRWLock update_task_list_lock_; // protect new_task_list_ and count of task_list_ ObArray task_list_; @@ -585,11 +585,11 @@ class ObPartGroupMigrator { }; class ObFastMigrateDag : public share::ObIDag { - public: +public: enum TaskType { INVALID = 0, SUSPEND_SRC = 1, HANDOVER_PG = 2, CLEAN_UP = 3, REPORT_META_TABLE = 4, MAX_TYPE }; static bool is_valid_task_type(TaskType type); - public: +public: ObFastMigrateDag(); virtual ~ObFastMigrateDag(); virtual bool operator==(const ObIDag& other) const override; @@ -599,13 +599,13 @@ class ObFastMigrateDag : public share::ObIDag { virtual int64_t get_compat_mode() const override; int init(ObPartGroupMigrationTask* group_task, TaskType sub_type); - public: +public: ObPartGroupMigrationTask* group_task_; TaskType sub_type_; }; class ObBaseMigrateDag : public share::ObIDag { - public: +public: ObBaseMigrateDag(const ObIDagType type, const ObIDagPriority priority); virtual ~ObBaseMigrateDag(); virtual bool operator==(const ObIDag& other) const override; @@ -627,7 +627,7 @@ class ObBaseMigrateDag : public share::ObIDag { INHERIT_TO_STRING_KV("ObIDag", ObIDag, KP(this), K(*ctx_)); - protected: +protected: bool is_inited_; ObMigrateCtx* ctx_; int64_t tenant_id_; @@ -636,23 +636,23 @@ class ObBaseMigrateDag : public share::ObIDag { }; class ObMigrateDag : public ObBaseMigrateDag { - public: +public: ObMigrateDag(); virtual ~ObMigrateDag(); int init(ObMigrateCtx& migrate_ctx); - protected: +protected: int init_for_restore_(ObMigrateCtx& ctx); int update_partition_meta_for_restore(); int online_for_rebuild(); int online_for_restore(); - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObMigrateDag); }; class ObBackupDag : public ObBaseMigrateDag { - public: +public: ObBackupDag(); virtual ~ObBackupDag(); int init(const share::ObBackupDataType& backup_type, ObMigrateCtx& migrate_ctx); @@ -661,27 +661,27 @@ class ObBackupDag : public ObBaseMigrateDag { return backup_data_type_; } - private: +private: share::ObBackupDataType backup_data_type_; - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObBackupDag); }; class ObValidateDag : public ObBaseMigrateDag { - public: +public: ObValidateDag(); virtual ~ObValidateDag(); virtual bool operator==(const ObIDag& other) const override; virtual int64_t hash() const override; int init(ObMigrateCtx& migrate_ctx); - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObValidateDag); }; class ObMigrateUtil { - public: +public: static const int64_t RETRY_TASK_SLEEP_INTERVAL_S = 1000 * 1000L; // 1s static const int64_t OB_MIGRATE_ONLINE_RETRY_COUNT = 3; static int enable_replay_with_old_partition(ObMigrateCtx& ctx); @@ -691,14 +691,14 @@ class ObMigrateUtil { static int enable_replay_with_new_partition(ObMigrateCtx& ctx); static int create_empty_trans_sstable_for_compat(ObMigrateCtx& ctx); - private: +private: static int wait_trans_table_merge_finish(ObMigrateCtx& ctx); static int add_trans_sstable_to_part_ctx( const ObPartitionKey& trans_table_pkey, ObSSTable& sstable, ObMigrateCtx& ctx); }; class ObMigratePrepareTask : public share::ObITask { - public: +public: static const int64_t MAX_LOGIC_TASK_COUNT_PER_SSTABLE = 64; static const int64_t MAX_MACRO_BLOCK_COUNT_PER_TASK = 128; static const int64_t OB_GET_SNAPSHOT_SCHEMA_VERSION_TIMEOUT = 30 * 1000 * 1000; // 30s @@ -712,7 +712,7 @@ class ObMigratePrepareTask : public share::ObITask { int init(); virtual int process() override; - protected: +protected: int add_migrate_status(ObMigrateCtx* ctx); int add_partition_migration_status(const ObMigrateCtx& ctx); @@ -901,7 +901,7 @@ class ObMigratePrepareTask : public share::ObITask { int generate_migrate_prepare_task(); int generate_restore_cut_prepare_task(); - protected: +protected: static const int64_t SRC_SET_BUCKET_NUM = 128; bool is_inited_; ObMigrateCtx* ctx_; @@ -914,7 +914,7 @@ class ObMigratePrepareTask : public share::ObITask { ObIPartitionGroupMetaRestoreReader* restore_meta_reader_; ObPartitionGroupMetaBackupReader* backup_meta_reader_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigratePrepareTask); }; @@ -946,19 +946,19 @@ struct ObMigrateLogicSSTableCtx { int get_dest_table_key(ObITable::TableKey& dest_table_key); TO_STRING_KV(K_(meta), K_(task_count)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigrateLogicSSTableCtx); }; class ObMigrateCopyLogicTask : public share::ObITask { - public: +public: ObMigrateCopyLogicTask(); virtual ~ObMigrateCopyLogicTask(); int init(const int64_t task_idx, ObMigrateLogicSSTableCtx& sstable_ctx, ObMigrateCtx& ctx); int generate_next_task(ObITask*& next_task) override; virtual int process() override; - private: +private: bool is_inited_; ObMigrateCtx* ctx_; int64_t task_idx_; @@ -968,7 +968,7 @@ class ObMigrateCopyLogicTask : public share::ObITask { }; class ObMigrateFinishLogicTask : public share::ObITask { - public: +public: ObMigrateFinishLogicTask(); virtual ~ObMigrateFinishLogicTask(); int init(ObPartitionMigrateCtx& part_migrate_ctx); @@ -978,7 +978,7 @@ class ObMigrateFinishLogicTask : public share::ObITask { return sstable_ctx_; } - private: +private: bool is_inited_; ObPartitionMigrateCtx* part_migrate_ctx_; ObMigrateLogicSSTableCtx sstable_ctx_; @@ -1012,19 +1012,19 @@ struct ObMigratePhysicalSSTableCtx { int get_dest_table_key(ObITable::TableKey& dest_table_key); DECLARE_VIRTUAL_TO_STRING; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigratePhysicalSSTableCtx); }; class ObMigrateCopyPhysicalTask : public share::ObITask { - public: +public: ObMigrateCopyPhysicalTask(); virtual ~ObMigrateCopyPhysicalTask(); int generate_next_task(ObITask*& next_task); int init(const int64_t task_idx, ObMigratePhysicalSSTableCtx& sstable_ctx, ObMigrateCtx& ctx); virtual int process() override; - private: +private: int get_macro_block_reader(obrpc::ObPartitionServiceRpcProxy* srv_rpc_proxy, common::ObInOutBandwidthThrottle* bandwidth_throttle, const ObMigrateSrcInfo& src_info, common::ObIArray& list, ObITable::TableKey& table_key, @@ -1050,7 +1050,7 @@ class ObMigrateCopyPhysicalTask : public share::ObITask { int alloc_migrate_writer(ObIPartitionMacroBlockReader* reader, ObIMigrateMacroBlockWriter*& writer); void free_migrate_writer(ObIMigrateMacroBlockWriter*& writer); - private: +private: static const int64_t MAX_RETRY_TIMES = 3; static const int64_t OB_FETCH_MAJOR_BLOCK_RETRY_INTERVAL = 1 * 1000 * 1000L; // 1s bool is_inited_; @@ -1063,7 +1063,7 @@ class ObMigrateCopyPhysicalTask : public share::ObITask { }; class ObMigrateFinishPhysicalTask : public share::ObITask { - public: +public: ObMigrateFinishPhysicalTask(); virtual ~ObMigrateFinishPhysicalTask(); int init(ObPartitionMigrateCtx& part_finish_ctx); @@ -1073,12 +1073,12 @@ class ObMigrateFinishPhysicalTask : public share::ObITask { return sstable_ctx_; } - private: +private: int check_sstable_meta( const blocksstable::ObSSTableBaseMeta& src_meta, const blocksstable::ObSSTableBaseMeta& write_meta); int acquire_sstable(const ObITable::TableKey& dest_table_key, ObTableHandle& handle); - private: +private: bool is_inited_; ObPartitionMigrateCtx* part_migrate_ctx_; ObMigratePhysicalSSTableCtx sstable_ctx_; @@ -1086,7 +1086,7 @@ class ObMigrateFinishPhysicalTask : public share::ObITask { }; class ObMigrateFinishTask : public share::ObITask { - public: +public: static const int64_t OB_CHECK_LOG_SYNC_INTERVAL = 200 * 1000; // 200ms static const int64_t OB_WAIT_LOG_SYNC_TIMEOUT = 30 * 1000 * 1000; // 30 s static const int64_t OB_CHECK_MINOR_MERGE_FINISH_INTERVAL = 100 * 1000; // 100ms @@ -1097,7 +1097,7 @@ class ObMigrateFinishTask : public share::ObITask { int init(ObMigrateCtx& ctx); virtual int process() override; - private: +private: int check_pg_available_index_all_exist(); int check_available_index_all_exist(const ObPartitionKey& pkey, ObPartitionStorage* storage); int wait_log_sync(uint64_t max_clog_id = OB_INVALID_TIMESTAMP); @@ -1114,14 +1114,14 @@ class ObMigrateFinishTask : public share::ObITask { const int64_t epoch_number); int enable_replay(); - private: +private: bool is_inited_; ObMigrateCtx* ctx_; DISALLOW_COPY_AND_ASSIGN(ObMigrateFinishTask); }; class ObGroupMigrateDag : public share::ObIDag { - public: +public: ObGroupMigrateDag(); virtual ~ObGroupMigrateDag(); virtual bool operator==(const ObIDag& other) const override; @@ -1140,12 +1140,12 @@ class ObGroupMigrateDag : public share::ObIDag { INHERIT_TO_STRING_KV("ObIDag", ObIDag, KP(this), K(group_task_)); - private: +private: int report_result(const bool is_batch_mode, const ObIArray& report_list); int single_report_result(const ObIArray& report_list); int batch_report_result(const ObIArray& report_list); - private: +private: bool is_inited_; ObPartGroupTask* group_task_; int64_t tenant_id_; @@ -1154,32 +1154,32 @@ class ObGroupMigrateDag : public share::ObIDag { }; class ObGroupMigrateExecuteTask : public share::ObITask { - public: +public: ObGroupMigrateExecuteTask(); virtual ~ObGroupMigrateExecuteTask(); int init(ObPartGroupTask* group_task); virtual int process() override; - private: +private: bool is_inited_; ObPartGroupTask* group_task_; DISALLOW_COPY_AND_ASSIGN(ObGroupMigrateExecuteTask); }; class ObMigrateGetLeaderUtil { - public: +public: static int get_leader( const common::ObPartitionKey& pkey, ObMigrateSrcInfo& leader_info, const bool force_renew = false); static int get_clog_parent(clog::ObIPartitionLogService& log_service, ObMigrateSrcInfo& parent_info); }; class ObMigratePostPrepareTask : public ObMigratePrepareTask { - public: +public: ObMigratePostPrepareTask(); virtual ~ObMigratePostPrepareTask(); virtual int process() override; - private: +private: int schedule_migrate_tasks(); int enable_replay_with_new_partition(); int deal_with_rebuild_partition(); @@ -1189,7 +1189,7 @@ class ObMigratePostPrepareTask : public ObMigratePrepareTask { int deal_with_standby_restore_partition(); int generate_restore_tailored_task(share::ObITask* last_task); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMigratePostPrepareTask); }; @@ -1200,46 +1200,46 @@ OB_INLINE bool ObMigrateCtx::is_migrate_compat_version() const class ObRestoreTailoredFinishTask; class ObRestoreTailoredPrepareTask : public share::ObITask { - public: +public: ObRestoreTailoredPrepareTask(); virtual ~ObRestoreTailoredPrepareTask(); int init(); virtual int process() override; - private: +private: int schedule_restore_tailored_task(ObRestoreTailoredFinishTask& finish_task); int schedule_restore_tailored_finish_task(); int filter_tailored_tables(common::ObIArray& index_ids, ObRecoveryPointSchemaFilter& schema_filter); int update_restore_flag_cut_data(); int check_need_generate_task(bool& need_generate); - private: +private: int schedule_restore_table_tailored_task_(const common::ObIArray& index_ids, const ObPartitionKey& partition_key, ObPartitionStorage& storage, ObRestoreTailoredFinishTask& finish_task); - private: +private: bool is_inited_; ObMigrateCtx* ctx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRestoreTailoredPrepareTask); }; class ObRestoreTailoredTask : public share::ObITask { - public: +public: ObRestoreTailoredTask(); virtual ~ObRestoreTailoredTask(); int init(const uint64_t index_id, const ObTablesHandle& minor_tables_handle, const ObTableHandle& major_table_handle, const ObPGKey& pg_key, const ObPartitionKey& partition_key, ObRestoreTailoredFinishTask& finish_task); virtual int process() override; - private: +private: int get_tailored_table_key(ObITable::TableKey& table_key); int generate_new_minor_sstable(const ObITable::TableKey& table_key, blocksstable::ObMacroBlocksWriteCtx& block_write_ctx, blocksstable::ObMacroBlocksWriteCtx& lob_block_write_ctx); int generate_major_sstable(); - private: +private: bool is_inited_; ObMigrateCtx* ctx_; uint64_t index_id_; @@ -1249,12 +1249,12 @@ class ObRestoreTailoredTask : public share::ObITask { ObPartitionKey partition_key_; ObRestoreTailoredFinishTask* finish_task_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRestoreTailoredTask); }; class ObRestoreTailoredFinishTask : public share::ObITask { - public: +public: ObRestoreTailoredFinishTask(); virtual ~ObRestoreTailoredFinishTask(); int init(); @@ -1262,7 +1262,7 @@ class ObRestoreTailoredFinishTask : public share::ObITask { int add_sstable_handle(const ObPartitionKey& pkey, ObTableHandle& handle); int set_schema_version(const int64_t schema_version); - private: +private: bool is_inited_; ObMigrateCtx* ctx_; common::SpinRWLock lock_; diff --git a/src/storage/ob_partition_migrator_table_key_mgr.h b/src/storage/ob_partition_migrator_table_key_mgr.h index a0094770a..28bc326b2 100644 --- a/src/storage/ob_partition_migrator_table_key_mgr.h +++ b/src/storage/ob_partition_migrator_table_key_mgr.h @@ -30,7 +30,7 @@ class ObTableKeyMgrUtil { virtual ~ObTableKeyMgrUtil() {} - public: +public: static int convert_minor_table_key( const storage::ObITable::TableKey& minor_table_key, storage::ObITable::TableKey& tmp_table_key); static int classify_mgirate_tables(const uint64_t table_id, const common::ObIArray& all_tables, @@ -38,13 +38,13 @@ class ObTableKeyMgrUtil { static int convert_src_table_keys(const int64_t log_id, const int64_t table_id, const bool is_only_major_sstable, const ObTablesHandle& handle, ObIArray& table_keys); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableKeyMgrUtil); }; // src table key manager class ObSrcTableKeyManager { - public: +public: ObSrcTableKeyManager(); virtual ~ObSrcTableKeyManager(); int init(const int64_t snapshot_version, const int64_t table_id, const ObPartitionKey& pkey, @@ -52,7 +52,7 @@ class ObSrcTableKeyManager { int add_table_key(const ObITable::TableKey& table_key); int get_table_keys(common::ObIArray& table_keys); - private: +private: int add_major_table(const ObITable::TableKey& table_key); int add_minor_table(const ObITable::TableKey& table_key); int add_mem_table(const ObITable::TableKey& mem_table_key); @@ -60,7 +60,7 @@ class ObSrcTableKeyManager { const ObITable::TableKey& mem_table_key, common::ObIArray& tmp_key_list); int check_and_cut_memtable_range(ObITable::TableKey& table_key); - private: +private: static const int64_t RETRY_INTERVAL = 1000 * 1000L; bool is_inited_; int64_t snapshot_version_; @@ -74,7 +74,7 @@ class ObSrcTableKeyManager { }; class ObDestTableKeyManager { - public: +public: ObDestTableKeyManager() {} virtual ~ObDestTableKeyManager() @@ -91,7 +91,7 @@ class ObDestTableKeyManager { static int convert_sstable_info_to_table_key( const ObMigrateTableInfo::SSTableInfo& sstable_info, ObITable::TableKey& table_key); - private: +private: static int check_table_continues(const common::ObIArray& tables, bool& is_continues); static int get_all_needed_table(const common::ObIArray& local_inc_tables, const common::ObIArray& remote_inc_tables, diff --git a/src/storage/ob_partition_parallel_merge_ctx.h b/src/storage/ob_partition_parallel_merge_ctx.h index 4be1bef3e..d6f5d4585 100644 --- a/src/storage/ob_partition_parallel_merge_ctx.h +++ b/src/storage/ob_partition_parallel_merge_ctx.h @@ -23,7 +23,7 @@ namespace storage { class ObSSTableMergeCtx; class ObParallelMergeCtx { - public: +public: enum ParallelMergeType { PARALLEL_MAJOR = 0, PARALLEL_MINI = 1, @@ -44,7 +44,7 @@ class ObParallelMergeCtx { const int64_t parallel_idx, common::ObExtStoreRange& merge_range, common::ObIAllocator& allocator); TO_STRING_KV(K_(parallel_type), K_(range_array), K_(first_sstable), K_(concurrent_cnt), K_(is_inited)); - private: +private: static const int64_t MIN_PARALLEL_MINI_MINOR_MERGE_THREASHOLD = 2; static const int64_t MIN_PARALLEL_MERGE_BLOCKS = 32; static const int64_t PARALLEL_MERGE_TARGET_TASK_CNT = 20; @@ -56,7 +56,7 @@ class ObParallelMergeCtx { int calc_mini_minor_parallel_degree( const int64_t tablet_size, const int64_t total_size, const int64_t sstable_count, int64_t& parallel_degree); - private: +private: ParallelMergeType parallel_type_; common::ObSEArray range_array_; ObSSTable* first_sstable_; diff --git a/src/storage/ob_partition_range_spliter.h b/src/storage/ob_partition_range_spliter.h index 06572c0fb..ed806faa8 100644 --- a/src/storage/ob_partition_range_spliter.h +++ b/src/storage/ob_partition_range_spliter.h @@ -96,7 +96,7 @@ struct ObSSTableRangePara { }; class ObMacroEndkeyIterator { - public: +public: ObMacroEndkeyIterator(); ~ObMacroEndkeyIterator() = default; OB_INLINE bool is_valid() const @@ -120,7 +120,7 @@ class ObMacroEndkeyIterator { }; class ObPartitionParallelRanger { - public: +public: explicit ObPartitionParallelRanger(common::ObArenaAllocator& allocator); ~ObPartitionParallelRanger(); ObPartitionParallelRanger() = delete; @@ -135,7 +135,7 @@ class ObPartitionParallelRanger { TO_STRING_KV(KPC(store_range_), K_(endkey_iters), KP_(last_macro_endkey), K_(total_endkey_cnt), K_(sample_cnt), K_(parallel_target_count), K_(is_inited)); - private: +private: int calc_sample_count(common::ObIArray& range_paras, const int64_t paralell_target_count); int init_macro_iters(common::ObIArray& range_paras); int build_parallel_range_heap(); @@ -145,7 +145,7 @@ class ObPartitionParallelRanger { int check_rowkey_equal(const common::ObStoreRowkey& rowkey1, const common::ObStoreRowkey& rowkey2, bool& equal); int check_continuous(common::ObIArray& range_array); - private: +private: const common::ObStoreRange* store_range_; common::ObArray endkey_iters_; common::ObArenaAllocator& allocator_; @@ -185,7 +185,7 @@ struct ObRangeSplitInfo { }; class ObPartitionRangeSpliter { - public: +public: ObPartitionRangeSpliter(); ~ObPartitionRangeSpliter(); void reset(); @@ -195,20 +195,20 @@ class ObPartitionRangeSpliter { common::ObIArray& range_array); TO_STRING_KV(K_(parallel_ranger)); - private: +private: int build_range_paras(common::ObIArray& sstables, const common::ObStoreRange& store_range, common::ObIArray& range_paras); int build_range_para(ObSSTable* sstable, const ObExtStoreRange& ext_range, ObSSTableRangePara& range_para); int get_size_info(common::ObIArray& range_paras, int64_t& total_row_count, int64_t& total_size); int get_single_range_info(const ObSSTableRangePara& range_para, int64_t& total_row_count, int64_t& total_size); - private: +private: common::ObArenaAllocator allocator_; ObPartitionParallelRanger parallel_ranger_; }; class ObPartitionMultiRangeSpliter { - public: +public: // return total size(byte) of all sstables in read_tables int get_multi_range_size( ObTablesHandle& read_tables, const common::ObIArray& range_array, int64_t& total_size); @@ -216,7 +216,7 @@ class ObPartitionMultiRangeSpliter { const int64_t expected_task_count, common::ObIAllocator& allocator, common::ObArrayArray& multi_range_split_array); - private: +private: static const int64_t MIN_SPLIT_TASK_SIZE = 2 << 20; static const int64_t MIN_SPLIT_TAGET_SSTABLE_SIZE = MIN_SPLIT_TASK_SIZE * 3; static const int64_t SPLIT_TASK_SIZE_HIGH_WATER_MARK_FACTOR = 125; @@ -225,7 +225,7 @@ class ObPartitionMultiRangeSpliter { typedef common::ObSEArray RangeSplitArray; typedef common::ObSEArray RangeSplitInfoArray; - private: +private: int get_split_sstables(ObTablesHandle& read_tables, common::ObIArray& sstables); int split_multi_ranges(RangeSplitInfoArray& range_info_array, const int64_t expected_task_count, const int64_t total_size, common::ObIAllocator& allocator, @@ -238,7 +238,7 @@ class ObPartitionMultiRangeSpliter { int build_single_range_array(const common::ObIArray& range_array, common::ObIAllocator& allocator, common::ObArrayArray& multi_range_split_array); - private: +private: ObPartitionRangeSpliter range_spliter_; }; diff --git a/src/storage/ob_partition_scheduler.h b/src/storage/ob_partition_scheduler.h index ff1d1dbcd..e43c89b11 100644 --- a/src/storage/ob_partition_scheduler.h +++ b/src/storage/ob_partition_scheduler.h @@ -30,7 +30,7 @@ class ObWriteCheckpointDag; } // namespace storage namespace storage { class ObBloomFilterLoadTask : public common::IObDedupTask { - public: +public: ObBloomFilterLoadTask( const uint64_t table_id, const blocksstable::MacroBlockId& macro_id, const ObITable::TableKey& table_key); virtual ~ObBloomFilterLoadTask(); @@ -44,18 +44,18 @@ class ObBloomFilterLoadTask : public common::IObDedupTask { } virtual int process(); - private: +private: int load_bloom_filter(); uint64_t table_id_; blocksstable::MacroBlockId macro_id_; ObITable::TableKey table_key_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBloomFilterLoadTask); }; class ObBloomFilterBuildTask : public common::IObDedupTask { - public: +public: ObBloomFilterBuildTask(const uint64_t table_id, const blocksstable::MacroBlockId& macro_id, const int64_t prefix_len, const ObITable::TableKey& table_key); virtual ~ObBloomFilterBuildTask(); @@ -69,7 +69,7 @@ class ObBloomFilterBuildTask : public common::IObDedupTask { } virtual int process(); - private: +private: int build_bloom_filter(); uint64_t table_id_; blocksstable::MacroBlockId macro_id_; @@ -79,7 +79,7 @@ class ObBloomFilterBuildTask : public common::IObDedupTask { ObTableAccessContext access_context_; common::ObArenaAllocator allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObBloomFilterBuildTask); }; @@ -92,43 +92,43 @@ struct ObMergeStatEntry { }; class ObMergeStatistic { - public: +public: ObMergeStatistic(); virtual ~ObMergeStatistic(); int notify_merge_start(const int64_t frozen_version); int notify_merge_finish(const int64_t frozen_version); int get_entry(const int64_t frozen_version, ObMergeStatEntry& entry); - private: +private: int search_entry(const int64_t frozen_version, ObMergeStatEntry*& pentry); static const int64_t MAX_KEPT_HISTORY = 16; obsys::CRWLock lock_; ObMergeStatEntry stats_[MAX_KEPT_HISTORY]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMergeStatistic); }; class ObMinorMergeHistory { - public: +public: explicit ObMinorMergeHistory(const uint64_t tenant_id); virtual ~ObMinorMergeHistory(); int notify_minor_merge_start(const int64_t snapshot_version); int notify_minor_merge_finish(const int64_t snapshot_version); - private: +private: static const int64_t MAX_MINOR_HISTORY = 16; lib::ObMutex mutex_; int64_t count_; uint64_t tenant_id_; int64_t snapshot_history_[MAX_MINOR_HISTORY]; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMinorMergeHistory); }; class ObFastFreezeChecker { - public: +public: explicit ObFastFreezeChecker(const int64_t tenant_id); virtual ~ObFastFreezeChecker(); void reset(); @@ -139,18 +139,18 @@ class ObFastFreezeChecker { int check_hotspot_need_fast_freeze(ObIPartitionGroup& pg, bool& need_fast_freeze); TO_STRING_KV(K_(tenant_id), K_(enable_fast_freeze)); - private: +private: // the minimum schedule interval of fast freeze is 2min static const int64_t FAST_FREEZE_INTERVAL_US = 120 * 1000 * 1000; ObFastFreezeChecker() = default; - private: +private: int64_t tenant_id_; bool enable_fast_freeze_; }; class ObClearTransTableTask : public common::ObTimerTask { - public: +public: ObClearTransTableTask(); virtual ~ObClearTransTableTask(); virtual void runTimerTask() override; @@ -166,7 +166,7 @@ struct ObMergePriorityCompare { class ObPartitionScheduler { friend ObClearTransTableTask; - public: +public: static ObPartitionScheduler& get_instance(); // NOT thread safe. // There is a timer in the ObPartitionScheduler, which will be scheduled periodically after @@ -232,15 +232,15 @@ class ObPartitionScheduler { } int64_t get_min_schema_version(const int64_t tenant_id); - private: +private: class MergeRetryTask : public common::ObTimerTask { - public: + public: MergeRetryTask(); virtual ~MergeRetryTask(); virtual void runTimerTask(); }; class WriteCheckpointTask : public common::ObTimerTask { - public: + public: WriteCheckpointTask() : is_enable_(false) {} virtual ~WriteCheckpointTask() @@ -253,25 +253,25 @@ class ObPartitionScheduler { bool is_enable_; }; class MinorMergeScanTask : public common::ObTimerTask { - public: + public: MinorMergeScanTask(); virtual ~MinorMergeScanTask() override; virtual void runTimerTask() override; }; class MergeCheckTask : public common::ObTimerTask { - public: + public: MergeCheckTask() = default; virtual ~MergeCheckTask() = default; virtual void runTimerTask() override; }; class UpdateCacheInfoTask : public common::ObTimerTask { - public: + public: UpdateCacheInfoTask() = default; virtual ~UpdateCacheInfoTask() = default; virtual void runTimerTask() override; }; - private: +private: friend class ObBuildIndexDag; static const int64_t DEFAULT_FAILURE_FAST_RETRY_INTERVAL_US = 1000L * 1000L * 60L; static const int64_t DEFAULT_WRITE_CHECKPOINT_INTERVAL_US = 1000L * 1000L * 60L; @@ -351,7 +351,7 @@ class ObPartitionScheduler { int check_partition_exist(const ObPartitionKey& pkey, bool& exist); int can_schedule_partition(const ObMergeType merge_type, bool& can_schedule); - private: +private: typedef common::hash::ObHashMap MinorMergeHistoryMap; typedef common::hash::ObHashMap TenantSnapshotMap; @@ -388,7 +388,7 @@ class ObPartitionScheduler { TenantMinSSTableSchemaVersionMap min_sstable_schema_version_map_; UpdateCacheInfoTask update_cache_info_task_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionScheduler); }; diff --git a/src/storage/ob_partition_schema_recorder.h b/src/storage/ob_partition_schema_recorder.h index cf7e6ec5a..4f960e104 100644 --- a/src/storage/ob_partition_schema_recorder.h +++ b/src/storage/ob_partition_schema_recorder.h @@ -44,7 +44,7 @@ class ObPGPartition; class ObPartitionSchemaRecorder { - public: +public: // follower int replay_schema_log(const char* buf, const int64_t size, const int64_t log_id); diff --git a/src/storage/ob_partition_service.cpp b/src/storage/ob_partition_service.cpp index 14ba3b59d..837562f89 100644 --- a/src/storage/ob_partition_service.cpp +++ b/src/storage/ob_partition_service.cpp @@ -4466,7 +4466,7 @@ int ObPartitionService::get_role_for_partition_table(const common::ObPartitionKe int ObPartitionService::get_role_unsafe(const common::ObPartitionKey& pkey, common::ObRole& role) const { class GetRoleFunctor { - public: + public: GetRoleFunctor() : role_(common::ObRole::INVALID_ROLE) {} int operator()(const common::ObPartitionKey& pkey, const int64_t* file_id, ObIPartitionGroup* partition) diff --git a/src/storage/ob_partition_service.h b/src/storage/ob_partition_service.h index 9961fc2ce..ec0bf755c 100644 --- a/src/storage/ob_partition_service.h +++ b/src/storage/ob_partition_service.h @@ -143,7 +143,7 @@ struct ObPartMigrationRes { }; class ObRestoreInfo { - public: +public: typedef common::hash::ObHashMap*, common::hash::NoPthreadDefendMode> SSTableInfoMap; @@ -163,7 +163,7 @@ class ObRestoreInfo { } TO_STRING_KV(K_(arg)); - private: +private: bool is_inited_; share::ObRestoreArgs arg_; SSTableInfoMap backup_sstable_info_map_; @@ -278,7 +278,7 @@ class ObPartitionService : public share::ObIPSCb, public common::ObIDataAccessService, public ObPartitionMetaRedoModule, public common::ObTableStatDataService { - public: +public: static const int64_t MC_WAIT_INTERVAL = 200 * 1000; // 200ms the interval of checking the completion of member change log syncing static const int64_t MC_SLEEP_TIME = 100000; // 100ms @@ -304,12 +304,12 @@ class ObPartitionService : public share::ObIPSCb, static const int64_t TENANT_PART_NUM_THRESHOLD = 1000; static constexpr const char RPScanIteratorLabel[] = "RPScanIterator"; - public: +public: ObPartitionService(); virtual ~ObPartitionService(); static OB_INLINE ObPartitionService& get_instance(); - public: +public: virtual int init(const blocksstable::ObStorageEnv& env, const common::ObAddr& self_addr, ObPartitionComponentFactory* cp_fty, share::schema::ObMultiVersionSchemaService* schema_service, share::ObIPartitionLocationCache* location_cache, share::ObRsMgr* rs_mgr, storage::ObIPartitionReport* rs_cb, @@ -838,9 +838,9 @@ class ObPartitionService : public share::ObIPSCb, // @brief: used for revoke all partition int try_revoke_all_leader(const election::ObElection::RevokeType& revoke_type); - private: +private: class ObStoreCtxGuard { - public: + public: ObStoreCtxGuard() : is_inited_(false), trans_desc_(NULL), pkey_(), ctx_(), txs_(NULL), init_ts_(0) {} virtual ~ObStoreCtxGuard() @@ -870,7 +870,7 @@ class ObPartitionService : public share::ObIPSCb, transaction::ObTransService& txs); ObStoreCtx& get_store_ctx(); - private: + private: bool is_inited_; transaction::ObTransDesc* trans_desc_; common::ObPartitionKey pkey_; @@ -888,11 +888,11 @@ class ObPartitionService : public share::ObIPSCb, TO_STRING_KV(K_(in_tran_service), K_(in_election), K_(in_replay_engine)); }; - protected: +protected: virtual int init_partition_group(ObIPartitionGroup& pg, const common::ObPartitionKey& pkey) override; virtual int post_replay_remove_pg_partition(const ObChangePartitionLogEntry& log_entry) override; - private: +private: int check_can_physical_flashback_(); bool is_tenant_active_(const uint64_t tenant_id) const; int check_init(void* cp, const char* cp_name) const; @@ -1040,13 +1040,13 @@ class ObPartitionService : public share::ObIPSCb, const int64_t cluster_id, hash::ObHashSet& src_set, common::ObIArray& src_array); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObPartitionService); - private: +private: class ReloadLocalityTask : public common::ObTimerTask { - public: + public: ReloadLocalityTask(); virtual ~ReloadLocalityTask() {} @@ -1054,44 +1054,44 @@ class ObPartitionService : public share::ObIPSCb, virtual void runTimerTask(); void destroy(); - private: + private: bool is_inited_; ObPartitionService* ptt_svr_; }; class PurgeRetireMemstoreTask : public common::ObTimerTask { - public: + public: PurgeRetireMemstoreTask(); virtual ~PurgeRetireMemstoreTask() {} - public: + public: int init(); void destroy(); virtual void runTimerTask(); - private: + private: bool is_inited_; }; class ClogRequiredMinorFreezeTask : public common::ObTimerTask { - public: + public: ClogRequiredMinorFreezeTask(); virtual ~ClogRequiredMinorFreezeTask() {} - public: + public: int init(clog::ObICLogMgr* clog_mgr); void destroy(); virtual void runTimerTask(); - private: + private: bool is_inited_; clog::ObICLogMgr* clog_mgr_; }; class ObRefreshLocalityTask : public common::IObDedupTask { - public: + public: explicit ObRefreshLocalityTask(ObPartitionService* partition_service); virtual ~ObRefreshLocalityTask(); virtual int64_t hash() const; @@ -1104,7 +1104,7 @@ class ObPartitionService : public share::ObIPSCb, } virtual int process(); - private: + private: ObPartitionService* partition_service_; }; @@ -1113,7 +1113,7 @@ class ObPartitionService : public share::ObIPSCb, int64_t size_; }; class PrintHashedFreezeFunctor { - public: + public: PrintHashedFreezeFunctor() {} bool operator()(const common::ObPartitionKey& pkey, ObIPSFreezeCb* cb) @@ -1125,7 +1125,7 @@ class ObPartitionService : public share::ObIPSCb, } }; - private: +private: friend class ObPartitionIterator; static const int64_t BITS_PER_BITSETWORD = 32; static const int64_t BITSETWORD_SHIFT_NUM = 5; diff --git a/src/storage/ob_partition_service_rpc.h b/src/storage/ob_partition_service_rpc.h index 543e42e1d..fd8ced3af 100644 --- a/src/storage/ob_partition_service_rpc.h +++ b/src/storage/ob_partition_service_rpc.h @@ -59,7 +59,7 @@ struct ObMCLogRpcInfo { }; struct ObMemberChangeArg { - public: +public: common::ObPartitionKey key_; common::ObReplicaMember member_; bool no_used_; @@ -83,29 +83,29 @@ struct ObMemberChangeArg { }; struct ObMemberChangeBatchResult { - public: +public: ObMemberChangeBatchResult() : return_array_() {} - public: +public: TO_STRING_KV(K_(return_array)); - public: +public: common::ObSArray return_array_; OB_UNIS_VERSION(3); }; struct ObMemberChangeBatchArg { - public: +public: ObMemberChangeBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -114,21 +114,21 @@ struct ObMemberChangeBatchArg { }; struct ObModifyQuorumBatchResult { - public: +public: ObModifyQuorumBatchResult() : return_array_() {} - public: +public: TO_STRING_KV(K_(return_array)); - public: +public: common::ObSArray return_array_; OB_UNIS_VERSION(3); }; struct ObModifyQuorumArg { - public: +public: common::ObPartitionKey key_; int64_t quorum_; int64_t orig_quorum_; @@ -146,15 +146,15 @@ struct ObModifyQuorumArg { }; struct ObModifyQuorumBatchArg { - public: +public: ObModifyQuorumBatchArg() : arg_array_(), timeout_ts_(0), task_id_() {} - public: +public: bool is_valid() const; TO_STRING_KV(K_(arg_array), K_(timeout_ts), K_(task_id)); - public: +public: common::ObSArray arg_array_; int64_t timeout_ts_; share::ObTaskId task_id_; @@ -199,7 +199,7 @@ struct ObRemoveReplicaArgs { struct ObFetchMacroBlockArg { OB_UNIS_VERSION(2); - public: +public: ObFetchMacroBlockArg() : macro_block_index_(0), data_version_(0), data_seq_(0) {} void reset(); @@ -213,7 +213,7 @@ struct ObFetchMacroBlockArg { struct ObFetchMacroBlockListArg { OB_UNIS_VERSION(2); - public: +public: ObFetchMacroBlockListArg(); TO_STRING_KV(K_(table_key), "arg_count", arg_list_.count()); storage::ObITable::TableKey table_key_; @@ -618,7 +618,7 @@ struct ObBatchFetchReplicaInfoRes { struct ObSuspendPartitionArg { OB_UNIS_VERSION(1); - public: +public: ObSuspendPartitionArg() { reset(); @@ -629,7 +629,7 @@ struct ObSuspendPartitionArg { bool is_valid() const; TO_STRING_KV(K(pg_key_), K(mig_dest_server_), K(need_force_change_owner_), K(is_batch_)); - public: +public: ObPGKey pg_key_; ObAddr mig_dest_server_; bool need_force_change_owner_; @@ -639,7 +639,7 @@ struct ObSuspendPartitionArg { struct ObSuspendPartitionRes { OB_UNIS_VERSION(1); - public: +public: ObSuspendPartitionRes() { reset(); @@ -650,7 +650,7 @@ struct ObSuspendPartitionRes { bool is_valid() const; TO_STRING_KV(K(pg_key_), K(max_clog_id_)); - public: +public: ObPGKey pg_key_; uint64_t max_clog_id_; }; @@ -666,7 +666,7 @@ enum ObHandoverPartitionType : int8_t { struct ObHandoverPartitionArg { OB_UNIS_VERSION(1); - public: +public: ObHandoverPartitionArg() { reset(); @@ -677,7 +677,7 @@ struct ObHandoverPartitionArg { bool is_valid() const; TO_STRING_KV(K(type_), K(pg_key_), K(src_file_id_), K(candidate_server_)); - public: +public: ObHandoverPartitionType type_; ObPGKey pg_key_; int64_t src_file_id_; @@ -685,7 +685,7 @@ struct ObHandoverPartitionArg { }; class ObPartitionServiceRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObPartitionServiceRpcProxy); // 1.4x old rpc to fetch store info RPC_S(PR5 fetch_migrate_info, OB_PTS_FETCH_INFO, (ObMigrateInfoFetchArg), ObMigrateInfoFetchResult); @@ -731,7 +731,7 @@ class ObPartitionServiceRpcProxy : public obrpc::ObRpcProxy { // 1.4x old rpc to fetch store info class ObPTSFetchInfoP : public ObRpcProcessor > { - public: +public: explicit ObPTSFetchInfoP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObPTSFetchInfoP() @@ -739,15 +739,15 @@ class ObPTSFetchInfoP : public ObRpcProcessor > { - public: +public: explicit ObPTSAddMemberP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObPTSAddMemberP() @@ -755,15 +755,15 @@ class ObPTSAddMemberP : public ObRpcProcessor > { - public: +public: explicit ObPTSRemoveMemberP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObPTSRemoveMemberP() @@ -771,15 +771,15 @@ class ObPTSRemoveMemberP : public ObRpcProcessor > { - public: +public: explicit ObPTSRemoveReplicaP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObPTSRemoveReplicaP() @@ -787,16 +787,16 @@ class ObPTSRemoveReplicaP : public ObRpcProcessor > { - public: +public: explicit ObBatchRemoveReplicaP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObBatchRemoveReplicaP() @@ -804,16 +804,16 @@ class ObBatchRemoveReplicaP partition_service_ = NULL; } - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; class ObIsMemberChangeDoneP : public ObRpcProcessor > { - public: +public: explicit ObIsMemberChangeDoneP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObIsMemberChangeDoneP() @@ -821,15 +821,15 @@ class ObIsMemberChangeDoneP partition_service_ = NULL; } - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; class ObWarmUpRequestP : public ObRpcProcessor > { - public: +public: explicit ObWarmUpRequestP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObWarmUpRequestP() @@ -837,45 +837,45 @@ class ObWarmUpRequestP : public ObRpcProcessor > { - public: +public: explicit ObSplitDestPartitionRequestP(storage::ObPartitionService* ps) : ps_(ps) {} virtual ~ObSplitDestPartitionRequestP() {} - protected: +protected: int process(); - private: +private: storage::ObPartitionService* ps_; }; class ObReplicaSplitProgressRequestP : public ObRpcProcessor > { - public: +public: explicit ObReplicaSplitProgressRequestP(storage::ObPartitionService* ps) : ps_(ps) {} virtual ~ObReplicaSplitProgressRequestP() {} - protected: +protected: int process(); - private: +private: storage::ObPartitionService* ps_; }; class ObGetMemberListP : public ObRpcProcessor > { - public: +public: explicit ObGetMemberListP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} ~ObGetMemberListP() @@ -883,16 +883,16 @@ class ObGetMemberListP : public ObRpcProcessor > { - public: +public: explicit ObCheckMemberMajorSSTableEnoughP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} @@ -901,16 +901,16 @@ class ObCheckMemberMajorSSTableEnoughP partition_service_ = NULL; } - protected: +protected: virtual int process(); - private: +private: storage::ObPartitionService* partition_service_; }; class ObCheckMemberPGMajorSSTableEnoughP : public ObRpcProcessor > { - public: +public: explicit ObCheckMemberPGMajorSSTableEnoughP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} @@ -919,15 +919,15 @@ class ObCheckMemberPGMajorSSTableEnoughP partition_service_ = NULL; } - protected: +protected: virtual int process(); - private: +private: storage::ObPartitionService* partition_service_; }; class ObFetchReplicaInfoP : public ObRpcProcessor > { - public: +public: explicit ObFetchReplicaInfoP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObFetchReplicaInfoP() @@ -935,15 +935,15 @@ class ObFetchReplicaInfoP : public ObRpcProcessor { - public: +public: ObWarmUpRPCCB() {} virtual ~ObWarmUpRPCCB() @@ -963,7 +963,7 @@ class ObWarmUpRPCCB : public ObPartitionServiceRpcProxy::AsyncCB { - public: +public: ObSplitDestPartitionRPCCB() : ps_(NULL) {} virtual ~ObSplitDestPartitionRPCCB() @@ -1009,20 +1009,20 @@ class ObSplitDestPartitionRPCCB : public ObPartitionServiceRpcProxy::AsyncCB { - public: +public: ObReplicaSplitProgressRPCCB() : ps_(NULL) {} virtual ~ObReplicaSplitProgressRPCCB() @@ -1054,26 +1054,26 @@ class ObReplicaSplitProgressRPCCB return newcb; } - public: +public: int process(); void on_timeout(); - private: +private: storage::ObPartitionService* ps_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObReplicaSplitProgressRPCCB); }; template class ObCommonPartitionServiceRpcP : public ObRpcProcessor > { - public: +public: explicit ObCommonPartitionServiceRpcP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObCommonPartitionServiceRpcP() {} - protected: +protected: template int fill_data(const Data& data); template @@ -1084,7 +1084,7 @@ class ObCommonPartitionServiceRpcP : public ObRpcProcessor class ObLogicPartitionServiceRpcP : public ObRpcProcessor > { - public: +public: explicit ObLogicPartitionServiceRpcP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObLogicPartitionServiceRpcP(); - protected: +protected: template int fill_data(const Data& data); int reserve_header(); @@ -1110,7 +1110,7 @@ class ObLogicPartitionServiceRpcP : public ObRpcProcessor > { - public: +public: explicit ObFetchBaseDataMetaP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObFetchBaseDataMetaP(); - protected: +protected: int process(); }; // 1.4x old rpc class ObFetchMacroBlockOldP : public ObCommonPartitionServiceRpcP { - public: +public: explicit ObFetchMacroBlockOldP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObFetchMacroBlockOldP() {} - protected: +protected: int process(); }; class ObFetchMacroBlockP : public ObCommonPartitionServiceRpcP { - public: +public: explicit ObFetchMacroBlockP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObFetchMacroBlockP() {} - protected: +protected: int process(); - private: +private: int64_t total_macro_block_count_; }; class ObBatchRemoveMemberP : public ObPartitionServiceRpcProxy::Processor { - public: +public: explicit ObBatchRemoveMemberP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObBatchRemoveMemberP() @@ -1166,15 +1166,15 @@ class ObBatchRemoveMemberP : public ObPartitionServiceRpcProxy::Processor { - public: +public: explicit ObBatchAddMemberP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObBatchAddMemberP() @@ -1182,15 +1182,15 @@ class ObBatchAddMemberP : public ObPartitionServiceRpcProxy::Processor { - public: +public: explicit ObBatchMemberChangeDoneP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} @@ -1199,15 +1199,15 @@ class ObBatchMemberChangeDoneP : public ObPartitionServiceRpcProxy::Processor { - public: +public: explicit ObFetchPartitionInfoP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObFetchPartitionInfoP() @@ -1215,15 +1215,15 @@ class ObFetchPartitionInfoP : public ObPartitionServiceRpcProxy::Processor > { - public: +public: explicit ObFetchTableInfoP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} virtual ~ObFetchTableInfoP() @@ -1231,37 +1231,37 @@ class ObFetchTableInfoP : public ObRpcProcessor { - public: +public: ObFetchLogicBaseMetaP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); ~ObFetchLogicBaseMetaP() {} - protected: +protected: int process(); }; class ObFetchPhysicalBaseMetaP : public ObCommonPartitionServiceRpcP { - public: +public: ObFetchPhysicalBaseMetaP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); ~ObFetchPhysicalBaseMetaP() {} - protected: +protected: int process(); }; class ObFetchLogicRowInfo final { - public: +public: ObFetchLogicRowInfo(); ~ObFetchLogicRowInfo(); int add_row(const storage::ObStoreRow& row); @@ -1269,7 +1269,7 @@ class ObFetchLogicRowInfo final { K_(sparse_row_count), "dml_count", common::ObArrayWrap(dml_count_, storage::T_DML_MAX), "first_dml_count", common::ObArrayWrap(first_dml_count_, storage::T_DML_MAX)); - private: +private: int64_t total_row_count_; int64_t not_exist_row_count_; int64_t exist_row_count_; @@ -1281,35 +1281,35 @@ class ObFetchLogicRowInfo final { }; class ObFetchLogicRowP : public ObCommonPartitionServiceRpcP { - public: +public: ObFetchLogicRowP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); ~ObFetchLogicRowP() {} - protected: +protected: int process(); }; class ObFetchLogicDataChecksumP : public ObCommonPartitionServiceRpcP { - public: +public: ObFetchLogicDataChecksumP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObFetchLogicDataChecksumP() {} - protected: +protected: int process(); }; class ObFetchLogicDataChecksumSliceP : public ObLogicPartitionServiceRpcP { - public: +public: ObFetchLogicDataChecksumSliceP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObFetchLogicDataChecksumSliceP() {} - protected: +protected: int process(); int fill_rpc_buffer(const ObLogicDataChecksumProtocol& checksum_protocol); int set_data_checksum_protocol(const bool is_rowkey_valid, const int64_t schema_rowkey_cnt, @@ -1317,18 +1317,18 @@ class ObFetchLogicDataChecksumSliceP : public ObLogicPartitionServiceRpcP { - public: +public: ObFetchLogicRowSliceP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObFetchLogicRowSliceP() {} - protected: +protected: int process(); }; class ObFetchPartitionGroupInfoP : public ObPartitionServiceRpcProxy::Processor { - public: +public: explicit ObFetchPartitionGroupInfoP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} @@ -1337,28 +1337,28 @@ class ObFetchPartitionGroupInfoP : public ObPartitionServiceRpcProxy::Processor< partition_service_ = NULL; } - protected: +protected: int process(); - private: +private: storage::ObPartitionService* partition_service_; }; class ObFetchPGPartitioninfoP : public ObCommonPartitionServiceRpcP { - public: +public: explicit ObFetchPGPartitioninfoP( storage::ObPartitionService* partition_service, common::ObInOutBandwidthThrottle* bandwidth_throttle); virtual ~ObFetchPGPartitioninfoP() {} - protected: +protected: int process(); }; } // namespace obrpc namespace storage { class ObIPartitionServiceRpc { - public: +public: ObIPartitionServiceRpc() {} virtual ~ObIPartitionServiceRpc() @@ -1367,7 +1367,7 @@ class ObIPartitionServiceRpc { const common::ObAddr& self, obrpc::ObCommonRpcProxy* rs_rpc_proxy) = 0; virtual void destroy() = 0; - public: +public: virtual int post_add_replica_mc_msg( const common::ObAddr& server, const obrpc::ObMemberChangeArg& arg, obrpc::ObMCLogRpcInfo& mc_log_info) = 0; virtual int post_add_replica_res(const common::ObAddr& server, const obrpc::ObAddReplicaRes& res) = 0; @@ -1413,7 +1413,7 @@ class ObIPartitionServiceRpc { }; class ObPartitionServiceRpc : public ObIPartitionServiceRpc { - public: +public: ObPartitionServiceRpc() : is_inited_(false), rpc_proxy_(NULL), @@ -1430,7 +1430,7 @@ class ObPartitionServiceRpc : public ObIPartitionServiceRpc { const common::ObAddr& self, obrpc::ObCommonRpcProxy* rs_rpc_proxy); void destroy(); - public: +public: int post_add_replica_mc_msg( const common::ObAddr& server, const obrpc::ObMemberChangeArg& arg, obrpc::ObMCLogRpcInfo& mc_log_info); int post_remove_replica_mc_msg( @@ -1488,7 +1488,7 @@ class ObPartitionServiceRpc : public ObIPartitionServiceRpc { const common::ObReplicaType& replica_type, const int64_t cluster_id, const bool use_slave_safe_read_ts, obrpc::ObFetchPGInfoResult& res); - private: +private: bool is_inited_; obrpc::ObPartitionServiceRpcProxy* rpc_proxy_; ObPartitionService* partition_service_; diff --git a/src/storage/ob_partition_split.h b/src/storage/ob_partition_split.h index 206fe4d2f..e5a2c57d7 100644 --- a/src/storage/ob_partition_split.h +++ b/src/storage/ob_partition_split.h @@ -320,7 +320,7 @@ inline bool is_physical_split_finished(const ObPartitionSplitStateEnum state) class ObPartitionSplitSourceLog : public ObNonTransLog { OB_UNIS_VERSION(1); - public: +public: ObPartitionSplitSourceLog() : schema_version_(0), spp_(), slave_read_ts_(0) {} ~ObPartitionSplitSourceLog() @@ -342,7 +342,7 @@ class ObPartitionSplitSourceLog : public ObNonTransLog { virtual int replace_tenant_id(const uint64_t new_tenant_id) override; TO_STRING_KV(K_(schema_version), K_(slave_read_ts), K_(spp)); - private: +private: int64_t schema_version_; share::ObSplitPartitionPair spp_; // record the current slave read timestamp on the split leader, @@ -353,7 +353,7 @@ class ObPartitionSplitSourceLog : public ObNonTransLog { class ObPartitionSplitDestLog : public ObNonTransLog { OB_UNIS_VERSION(1); - public: +public: ObPartitionSplitDestLog() : split_version_(0), schema_version_(0), source_log_id_(0), source_log_ts_(0), spp_() {} ~ObPartitionSplitDestLog() @@ -384,7 +384,7 @@ class ObPartitionSplitDestLog : public ObNonTransLog { virtual int replace_tenant_id(const uint64_t new_tenant_id) override; TO_STRING_KV(K_(split_version), K_(schema_version), K_(source_log_id), K_(source_log_ts), K_(spp)); - private: +private: int64_t split_version_; int64_t schema_version_; int64_t source_log_id_; @@ -395,14 +395,14 @@ class ObPartitionSplitDestLog : public ObNonTransLog { class ObPartitionSplitState { OB_UNIS_VERSION(1); - public: +public: ObPartitionSplitState() : state_(UNKNOWN_SPLIT_STATE), save_state_(UNKNOWN_SPLIT_STATE), pkey_() {} ~ObPartitionSplitState() {} int init(const common::ObPartitionKey& pkey); - public: +public: int set_partition_key(const common::ObPartitionKey& pkey); int switch_state(const ObPartitionSplitAction& action); int restore_state(); @@ -417,7 +417,7 @@ class ObPartitionSplitState { } TO_STRING_KV(K_(pkey), "state", to_state_str(state_), "save_state", to_state_str(save_state_)); - private: +private: ObPartitionSplitStateEnum state_; // do not need serialize ObPartitionSplitStateEnum save_state_; @@ -425,7 +425,7 @@ class ObPartitionSplitState { }; class ObSplitLogCb : public clog::ObISubmitLogCb { - public: +public: ObSplitLogCb() : partition_service_(NULL), log_type_(OB_LOG_UNKNOWN) {} virtual ~ObSplitLogCb() @@ -436,16 +436,16 @@ class ObSplitLogCb : public clog::ObISubmitLogCb { int on_finished(const common::ObPartitionKey& pkey, const uint64_t log_id); TO_STRING_KV(KP(this), KP_(partition_service), K_(log_type)); - private: +private: ObPartitionService* partition_service_; ObStorageLogType log_type_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSplitLogCb); }; class ObSplitLogCbFactory { - public: +public: static ObSplitLogCb* alloc(); static void release(ObSplitLogCb* cb); }; @@ -453,7 +453,7 @@ class ObSplitLogCbFactory { class ObPartitionSplitInfo { OB_UNIS_VERSION(1); - public: +public: ObPartitionSplitInfo() { reset(); @@ -470,7 +470,7 @@ class ObPartitionSplitInfo { } bool is_valid() const; - public: +public: void set_split_version(const int64_t split_version) { split_version_ = split_version; @@ -518,7 +518,7 @@ class ObPartitionSplitInfo { TO_STRING_KV(K_(split_version), K_(schema_version), K_(source_log_id), K_(source_log_ts), K_(partition_pair), K_(split_type), K_(receive_split_ts)); - public: +public: static const int64_t UNKNWON_SPLIT_TYPE = -1; static const int64_t SPLIT_SOURCE_PARTITION = 0; static const int64_t SPLIT_DEST_PARTITION = 1; @@ -527,7 +527,7 @@ class ObPartitionSplitInfo { return SPLIT_SOURCE_PARTITION == split_type || SPLIT_DEST_PARTITION == split_type; } - private: +private: int64_t schema_version_; share::ObSplitPartitionPair partition_pair_; int64_t split_type_; @@ -536,19 +536,19 @@ class ObPartitionSplitInfo { int64_t source_log_ts_; int64_t receive_split_ts_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionSplitInfo); }; template class ObSplitProgressTemplate { - public: +public: ObSplitProgressTemplate() : obj_(), progress_(share::UNKNOWN_SPLIT_PROGRESS) {} ~ObSplitProgressTemplate() {} - public: +public: Type obj_; int progress_; TO_STRING_KV(K_(obj), K_(progress)); @@ -558,13 +558,13 @@ typedef ObSplitProgressTemplate ObReplicaSplitProgress; template class ObSplitProgressArray { - public: +public: ObSplitProgressArray() : is_inited_(false) {} ~ObSplitProgressArray() {} - public: +public: int init(const common::ObIArray& obj_array) { int ret = common::OB_SUCCESS; @@ -695,10 +695,10 @@ class ObSplitProgressArray { return progress_array_; } - public: +public: TO_STRING_KV(K_(is_inited), K_(progress_array)); - private: +private: bool is_inited_; common::ObSArray > progress_array_; }; diff --git a/src/storage/ob_partition_split_task.h b/src/storage/ob_partition_split_task.h index de8a2ece9..b1e3b738e 100644 --- a/src/storage/ob_partition_split_task.h +++ b/src/storage/ob_partition_split_task.h @@ -89,7 +89,7 @@ struct ObSSTableSplitCtx { }; class ObSSTableSplitDag : public share::ObIDag { - public: +public: ObSSTableSplitDag(); virtual ~ObSSTableSplitDag(); ObSSTableSplitCtx& get_ctx() @@ -111,7 +111,7 @@ class ObSSTableSplitDag : public share::ObIDag { } INHERIT_TO_STRING_KV("ObIDag", ObIDag, "param", ctx_); - private: +private: bool is_inited_; share::ObWorker::CompatMode compat_mode_; ObSSTableSplitCtx ctx_; @@ -119,27 +119,27 @@ class ObSSTableSplitDag : public share::ObIDag { }; class ObSSTableSplitPrepareTask : public share::ObITask { - public: +public: ObSSTableSplitPrepareTask(); virtual ~ObSSTableSplitPrepareTask() {} int init(); virtual int process(); - private: +private: int generate_split_task(const bool has_lob_column); int build_split_ctx(ObPartitionStorage& storage, storage::ObSSTableSplitCtx& ctx); int get_schemas_to_split(storage::ObSSTableSplitCtx& ctx); int cal_split_param(storage::ObSSTableSplitCtx& ctx); int build_split_sstable_handle(storage::ObSSTableSplitCtx& ctx); - private: +private: ObSSTableSplitDag* split_dag_; bool is_inited_; }; class ObLobSplitHelper { - public: +public: enum ObLobSplitHelperStatus { STATUS_INVALID = 0, STATUS_WRITE = 1, STATUS_READ = 2, STATUS_EMPTY = 3 }; ObLobSplitHelper(); virtual ~ObLobSplitHelper(); @@ -149,14 +149,14 @@ class ObLobSplitHelper { int read_lob_columns(ObStoreRow* store_row); int switch_for_read(); - private: +private: OB_INLINE bool is_valid() const { return status_ != STATUS_INVALID; } int build_lob_block_id_map(); - private: +private: blocksstable::ObLobMergeWriter lob_writer_; blocksstable::ObLobDataReader lob_reader_; common::hash::ObCuckooHashMap lob_block_id_map_; @@ -166,7 +166,7 @@ class ObLobSplitHelper { // split task for one sstable class ObSSTableSplitTask : public share::ObITask { - public: +public: ObSSTableSplitTask(); virtual ~ObSSTableSplitTask(); @@ -174,7 +174,7 @@ class ObSSTableSplitTask : public share::ObITask { int generate_next_task(ObITask*& next_task); virtual int process(); - private: +private: int build_row_iterator(ObSSTableSplitCtx& split_ctx, ObIStoreRowIterator*& row_iter); int split_sstable(ObSSTableSplitCtx& split_ctx, ObSSTable* sstable, storage::ObMacroBlockIterator& macro_block_iter); int split_sstable(ObSSTableSplitCtx& split_ctx, ObIStoreRowIterator* row_iter); @@ -190,7 +190,7 @@ class ObSSTableSplitTask : public share::ObITask { int init_table_split_param(ObSSTableSplitCtx& split_ctx); int terminate_split_iteration(const int64_t partition_id); - private: +private: static const int64_t DEFAULT_SPLIT_SORT_MEMORY_LIMIT = 64L * 1024L * 1024L; ObSSTableSplitDag* split_dag_; ObArenaAllocator allocator_; @@ -223,7 +223,7 @@ class ObSSTableSplitTask : public share::ObITask { // split finish task for one sstable class ObSSTableSplitFinishTask : public share::ObITask { - public: +public: ObSSTableSplitFinishTask(); virtual ~ObSSTableSplitFinishTask(); int init(const common::ObPartitionKey& dest_pkey, const bool has_lob_column); @@ -233,7 +233,7 @@ class ObSSTableSplitFinishTask : public share::ObITask { int process_range_split(); int process_row_split(); - private: +private: ObSSTableSplitDag* split_dag_; ObSSTableMergeContext split_context_; ObArenaAllocator allocator_; @@ -243,7 +243,7 @@ class ObSSTableSplitFinishTask : public share::ObITask { }; class ObSplitRowComparer { - public: +public: ObSplitRowComparer(int& comp_ret) : result_code_(comp_ret), column_cnt_(0) {} virtual ~ObSplitRowComparer() diff --git a/src/storage/ob_partition_split_worker.h b/src/storage/ob_partition_split_worker.h index 041aa6bcd..02d4665f9 100644 --- a/src/storage/ob_partition_split_worker.h +++ b/src/storage/ob_partition_split_worker.h @@ -25,7 +25,7 @@ namespace storage { class ObPartitionService; class ObPartitionSplitTask { - public: +public: ObPartitionSplitTask() : schema_version_(0), partition_pair_(), next_run_ts_(0) {} ~ObPartitionSplitTask() @@ -50,23 +50,23 @@ class ObPartitionSplitTask { bool is_valid() const; void reset(); - public: +public: TO_STRING_KV(K_(schema_version), K_(partition_pair), K_(next_run_ts)); - private: +private: int64_t schema_version_; share::ObSplitPartitionPair partition_pair_; int64_t next_run_ts_; }; class ObPartitionSplitTaskFactory { - public: +public: static ObPartitionSplitTask* alloc(); static void release(ObPartitionSplitTask* task); }; class ObPartitionSplitWorker : public share::ObThreadPool { - public: +public: ObPartitionSplitWorker() : is_inited_(false), partition_service_(NULL), queue_() {} ~ObPartitionSplitWorker() @@ -81,14 +81,14 @@ class ObPartitionSplitWorker : public share::ObThreadPool { void run1(); int push(ObPartitionSplitTask* task); - private: +private: static const int64_t CHECK_PHYSICAL_SPLIT_PROGRESS_INTERVAL = 10 * 1000 * 1000; - private: +private: int handle_(ObPartitionSplitTask* task); int push_(ObPartitionSplitTask* task); - private: +private: bool is_inited_; storage::ObPartitionService* partition_service_; common::ObLightyQueue queue_; diff --git a/src/storage/ob_partition_storage.h b/src/storage/ob_partition_storage.h index 7c65be69b..56d669108 100644 --- a/src/storage/ob_partition_storage.h +++ b/src/storage/ob_partition_storage.h @@ -59,7 +59,7 @@ class ObPGStorage; class ObTableScanIterator; class ObStoreRowkeyHashFunc { - public: +public: uint64_t operator()(const common::ObStoreRowkey& rowkey, const uint64_t hash) { return rowkey.murmurhash(hash); @@ -76,7 +76,7 @@ struct ObColumnChecksumEntry { }; class ObStorageWriterGuard { - public: +public: int refresh_and_protect_table(ObRelativeTable& relative_table); int refresh_and_protect_pg_memtable(ObPGStorage& pg_storage, ObTablesHandle& tables_handle); @@ -112,16 +112,16 @@ class ObStorageWriterGuard { ObStorageWriterGuard(const ObStorageWriterGuard&) = delete; ObStorageWriterGuard& operator=(const ObStorageWriterGuard&) = delete; - private: +private: bool need_to_refresh_table(ObTablesHandle& tables_handle); bool check_if_need_log(); void reset(); - private: +private: static const int64_t LOG_INTERVAL_US = 30 * 1000 * 1000; static const int64_t GET_TS_INTERVAL = 10 * 1000; - private: +private: const bool need_control_mem_; const bool is_replay_; ObPartitionStore* store_; @@ -179,23 +179,23 @@ class ObPartitionStorage : public ObIPartitionStorage { friend class oceanbase::storageperf::ObMultiBlockBench; friend class ObPGStorage; - public: +public: ObPartitionStorage(); virtual ~ObPartitionStorage(); - inline virtual const share::schema::ObMultiVersionSchemaService *get_schema_service() const override + inline virtual const share::schema::ObMultiVersionSchemaService* get_schema_service() const override { return schema_service_; } - virtual int init( - const common::ObPartitionKey &pkey, - ObIPartitionComponentFactory *cp_fty, - share::schema::ObMultiVersionSchemaService *schema_service, - transaction::ObTransService *txs, - ObPGMemtableMgr &pg_memtable_mgr) override; + virtual int init(const common::ObPartitionKey& pkey, ObIPartitionComponentFactory* cp_fty, + share::schema::ObMultiVersionSchemaService* schema_service, transaction::ObTransService* txs, + ObPGMemtableMgr& pg_memtable_mgr) override; virtual void destroy() override; - virtual const common::ObPartitionKey &get_partition_key() const override { return pkey_; } + virtual const common::ObPartitionKey& get_partition_key() const override + { + return pkey_; + } bool is_inited() const; TO_STRING_KV(K_(pkey), K_(store)); @@ -279,31 +279,22 @@ class ObPartitionStorage : public ObIPartitionStorage { // @param affected_rows [out] successfully insert row number // @param duplicated_rows [out] the iterator of the rowkey(s) of conflict row(s) // - virtual int insert_row(const ObStoreCtx &ctx, - const ObDMLBaseParam &dml_param, - const common::ObIArray &column_ids, - const common::ObNewRow &row); + virtual int insert_row(const ObStoreCtx& ctx, const ObDMLBaseParam& dml_param, + const common::ObIArray& column_ids, const common::ObNewRow& row); - virtual int insert_row(const ObStoreCtx &ctx, - const ObDMLBaseParam &dml_param, - const common::ObIArray &column_ids, - const common::ObIArray &duplicated_column_ids, - const common::ObNewRow &row, - const ObInsertFlag flag, - int64_t &affected_rows, - common::ObNewRowIterator *&duplicated_rows) override; - //check whether row has conflict in storage - //in_column_ids describe columns of the row, begin with rowey, must include local unique index - //out_column_ids describe column of conflict row - //check_row_iter is the iterator of rows that will be checked - //dup_row_iters are iterators of conflict rows, the number of iterators is same with number of checked rows - virtual int fetch_conflict_rows(const ObStoreCtx &ctx, - const ObDMLBaseParam &dml_param, - const common::ObIArray &in_column_ids, - const common::ObIArray &out_column_ids, - common::ObNewRowIterator &check_row_iter, - common::ObIArray &dup_row_iters) override; - virtual int revert_insert_iter(common::ObNewRowIterator *iter) override; + virtual int insert_row(const ObStoreCtx& ctx, const ObDMLBaseParam& dml_param, + const common::ObIArray& column_ids, const common::ObIArray& duplicated_column_ids, + const common::ObNewRow& row, const ObInsertFlag flag, int64_t& affected_rows, + common::ObNewRowIterator*& duplicated_rows) override; + // check whether row has conflict in storage + // in_column_ids describe columns of the row, begin with rowey, must include local unique index + // out_column_ids describe column of conflict row + // check_row_iter is the iterator of rows that will be checked + // dup_row_iters are iterators of conflict rows, the number of iterators is same with number of checked rows + virtual int fetch_conflict_rows(const ObStoreCtx& ctx, const ObDMLBaseParam& dml_param, + const common::ObIArray& in_column_ids, const common::ObIArray& out_column_ids, + common::ObNewRowIterator& check_row_iter, common::ObIArray& dup_row_iters) override; + virtual int revert_insert_iter(common::ObNewRowIterator* iter) override; // // update rows // update table rows and index rows @@ -350,29 +341,19 @@ class ObPartitionStorage : public ObIPartitionStorage { // @retval OB_TRANS_IS_READONLY // @retval OB_ERR_EXCLUSIVE_LOCK_CONFLICT // - virtual int lock_rows(const ObStoreCtx &ctx, - const ObDMLBaseParam &dml_param, - const int64_t abs_lock_timeout, - common::ObNewRowIterator *row_iter, - ObLockFlag lock_flag, - int64_t &affected_rows) override; - virtual int lock_rows(const ObStoreCtx &ctx, - const ObDMLBaseParam &dml_param, - const int64_t abs_lock_timeout, - const common::ObNewRow &row, - ObLockFlag lock_flag) override; + virtual int lock_rows(const ObStoreCtx& ctx, const ObDMLBaseParam& dml_param, const int64_t abs_lock_timeout, + common::ObNewRowIterator* row_iter, ObLockFlag lock_flag, int64_t& affected_rows) override; + virtual int lock_rows(const ObStoreCtx& ctx, const ObDMLBaseParam& dml_param, const int64_t abs_lock_timeout, + const common::ObNewRow& row, ObLockFlag lock_flag) override; - virtual int get_concurrent_cnt(uint64_t table_id, int64_t schema_version, int64_t &concurrent_cnt) override; + virtual int get_concurrent_cnt(uint64_t table_id, int64_t schema_version, int64_t& concurrent_cnt) override; - virtual int get_batch_rows(const ObTableScanParam ¶m, - const storage::ObBatch &batch, - int64_t &logical_row_count, - int64_t &physical_row_count, - common::ObIArray &est_records) override; + virtual int get_batch_rows(const ObTableScanParam& param, const storage::ObBatch& batch, int64_t& logical_row_count, + int64_t& physical_row_count, common::ObIArray& est_records) override; - virtual int get_table_stat(const uint64_t table_id, common::ObTableStat &stat) override; + virtual int get_table_stat(const uint64_t table_id, common::ObTableStat& stat) override; - virtual int lock(const ObStoreCtx &ctx) override; + virtual int lock(const ObStoreCtx& ctx) override; virtual void set_merge_status(bool merge_success); virtual bool can_schedule_merge(); @@ -469,10 +450,10 @@ class ObPartitionStorage : public ObIPartitionStorage { int erase_stat_cache(); - public: +public: typedef common::hash::ObHashMap ColumnChecksumMap; - private: +private: struct RowReshape { RowReshape() : row_reshape_cells_(NULL), @@ -497,7 +478,7 @@ class ObPartitionStorage : public ObIPartitionStorage { }; struct ObDMLRunningCtx { - public: + public: ObDMLRunningCtx(const ObStoreCtx& store_ctx, const ObDMLBaseParam& dml_param, common::ObIAllocator& allocator, const ObRowDml dml_type) : store_ctx_(store_ctx), @@ -523,12 +504,12 @@ class ObPartitionStorage : public ObIPartitionStorage { static int prepare_column_desc( const common::ObIArray& column_ids, const ObRelativeTable& table, ObColDescIArray& col_descs); - private: + private: void free_work_members(); int prepare_index_row(); int prepare_column_info(const common::ObIArray& column_ids); - public: + public: const ObStoreCtx& store_ctx_; const ObDMLBaseParam& dml_param_; common::ObIAllocator& allocator_; @@ -540,13 +521,13 @@ class ObPartitionStorage : public ObIPartitionStorage { ObStoreRow tbl_row_; ObStoreRow* idx_row_; // not a must, allocate dynamically - private: + private: bool is_inited_; }; static const int32_t LOCK_WAIT_INTERVAL = 5; // 5us - private: +private: int write_index_row(ObRelativeTable& relative_table, const ObStoreCtx& ctx, const ObColDescIArray& idx_columns, ObStoreRow& index_row); int check_other_columns_in_column_ids(const ObRelativeTables& rel_schema, const share::schema::ColumnMap* col_map, @@ -646,7 +627,7 @@ class ObPartitionStorage : public ObIPartitionStorage { virtual int extract_rowkey(const ObRelativeTable& table, const common::ObStoreRowkey& rowkey, char* buffer, const int64_t buffer_len, const common::ObTimeZoneInfo* tz_info = NULL); - private: +private: int get_depend_table_schema(const share::schema::ObTableSchema* table_schema, share::schema::ObSchemaGetterGuard& schema_guard, const share::schema::ObTableSchema*& dep_table_schema); int report_checksum(const uint64_t execution_id, const uint64_t task_id, @@ -713,7 +694,7 @@ class ObPartitionStorage : public ObIPartitionStorage { // disallow copy; DISALLOW_COPY_AND_ASSIGN(ObPartitionStorage); - protected: +protected: // data members static const int64_t DELAY_SCHEDULE_TIME_UNIT = 1000 * 1000 * 1; // 1s static const int64_t MAGIC_NUM_BEFORE_1461 = -0xABCD; diff --git a/src/storage/ob_partition_store.h b/src/storage/ob_partition_store.h index ee9958b58..2b6f223f1 100644 --- a/src/storage/ob_partition_store.h +++ b/src/storage/ob_partition_store.h @@ -65,7 +65,7 @@ class ObPartitionStore { friend class ObPGStorage; friend class ObPartitionStorage; - public: +public: typedef common::hash::ObCuckooHashMap TableStoreMap; typedef TableStoreMap* TableStoreMapPtr; static const int64_t TABLE_STORE_BUCKET_NUM = 2; @@ -179,7 +179,7 @@ class ObPartitionStore { TO_STRING_KV(K_(is_inited), K_(log_seq_num), "meta", *meta_); - private: +private: int create_partition_store(const ObPGPartitionStoreMeta& meta, const bool write_slog, ObIPartitionGroup* pg, ObFreezeInfoSnapshotMgr& freeze_info_mgr, ObPGMemtableMgr* pg_memtable_mgr); int init(const ObPGPartitionStoreMeta& meta, ObIPartitionGroup* pg, ObFreezeInfoSnapshotMgr& freeze_info_mgr); @@ -300,7 +300,7 @@ class ObPartitionStore { int get_restore_point_normal_tables_(const int64_t snapshot_version, const int64_t publish_version, ObRecoveryPointSchemaFilter& schema_filter, ObTablesHandle& handle, bool& is_ready); - private: +private: bool is_inited_; bool is_removed_; ObPGPartitionStoreMeta meta_buf_[2]; diff --git a/src/storage/ob_partition_worker.h b/src/storage/ob_partition_worker.h index 312275d02..e22d2cd67 100644 --- a/src/storage/ob_partition_worker.h +++ b/src/storage/ob_partition_worker.h @@ -23,7 +23,7 @@ class ObIPartitionGroup; class ObPartitionWorker : public share::ObThreadPool { const int64_t DIVISION_PARTITION_CNT = 100; - public: +public: ObPartitionWorker() : inited_(false), partition_service_(NULL) {} ~ObPartitionWorker() @@ -36,13 +36,13 @@ class ObPartitionWorker : public share::ObThreadPool { void stop(); void wait(); - public: +public: virtual void run1() override; - private: +private: int scan_all_partitions_(int64_t& valid_user_part_count, int64_t& valid_inner_part_count); - private: +private: bool inited_; storage::ObPartitionService* partition_service_; }; diff --git a/src/storage/ob_pg_all_meta_checkpoint_reader.h b/src/storage/ob_pg_all_meta_checkpoint_reader.h index d42320741..97ee451ad 100644 --- a/src/storage/ob_pg_all_meta_checkpoint_reader.h +++ b/src/storage/ob_pg_all_meta_checkpoint_reader.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { class ObPGAllMetaCheckpointReader final { - public: +public: ObPGAllMetaCheckpointReader(); ~ObPGAllMetaCheckpointReader() = default; int init(const blocksstable::MacroBlockId& macro_entry_block, const blocksstable::MacroBlockId& pg_entry_block, @@ -30,7 +30,7 @@ class ObPGAllMetaCheckpointReader final { void reset(); int get_meta_block_list(common::ObIArray& meta_block_ids); - private: +private: bool is_inited_; ObPGMacroMetaCheckpointReader macro_meta_reader_; ObPGMetaCheckpointReader pg_meta_reader_; diff --git a/src/storage/ob_pg_all_meta_checkpoint_writer.h b/src/storage/ob_pg_all_meta_checkpoint_writer.h index 5d24d78da..682d5b5fd 100644 --- a/src/storage/ob_pg_all_meta_checkpoint_writer.h +++ b/src/storage/ob_pg_all_meta_checkpoint_writer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { struct ObPGCheckpointInfo final { - public: +public: ObPGCheckpointInfo(); ~ObPGCheckpointInfo() = default; bool is_valid() const @@ -37,7 +37,7 @@ struct ObPGCheckpointInfo final { }; class ObPGAllMetaCheckpointWriter final { - public: +public: ObPGAllMetaCheckpointWriter(); ~ObPGAllMetaCheckpointWriter() = default; int init(ObPGCheckpointInfo& pg_checkpoint_info, blocksstable::ObStorageFile* file, @@ -45,7 +45,7 @@ class ObPGAllMetaCheckpointWriter final { int write_checkpoint(); void reset(); - private: +private: bool is_inited_; ObPGMacroMetaCheckpointWriter macro_meta_writer_; ObPGMetaCheckpointWriter pg_meta_writer_; diff --git a/src/storage/ob_pg_index.h b/src/storage/ob_pg_index.h index 66c2c47d6..8b2d6a737 100644 --- a/src/storage/ob_pg_index.h +++ b/src/storage/ob_pg_index.h @@ -24,7 +24,7 @@ typedef common::LinkHashNode ObPGHashNode; typedef common::LinkHashValue ObPGHashValue; class ObPGKeyWrap : public ObPGHashValue { - public: +public: ObPGKeyWrap() {} ~ObPGKeyWrap() @@ -50,12 +50,12 @@ class ObPGKeyWrap : public ObPGHashValue { } TO_STRING_KV(K_(pg_key)); - private: +private: common::ObPGKey pg_key_; }; class PGKeyInfoAlloc { - public: +public: static ObPGKeyWrap* alloc_value() { return op_alloc(ObPGKeyWrap); @@ -85,7 +85,7 @@ class PGKeyInfoAlloc { typedef common::ObLinkHashMap ObPGIndexMap; class ObPartitionGroupIndex { - public: +public: ObPartitionGroupIndex(); virtual ~ObPartitionGroupIndex() { @@ -98,10 +98,10 @@ class ObPartitionGroupIndex { int remove_partition(const common::ObPartitionKey& pkey); int get_pg_key(const common::ObPartitionKey& pkey, common::ObPGKey& pg_key); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionGroupIndex); - private: +private: bool is_inited_; ObPGIndexMap pg_index_map_; mutable lib::ObMutex change_mutex_; diff --git a/src/storage/ob_pg_log.h b/src/storage/ob_pg_log.h index fefd880ae..8d366c52e 100644 --- a/src/storage/ob_pg_log.h +++ b/src/storage/ob_pg_log.h @@ -29,7 +29,7 @@ namespace storage { class ObOfflinePartitionLog : public ObNonTransLog { OB_UNIS_VERSION(1); - public: +public: ObOfflinePartitionLog() { reset(); @@ -41,7 +41,7 @@ class ObOfflinePartitionLog : public ObNonTransLog { int init(const int64_t log_type, const bool is_physical_drop); void reset(); - public: +public: int64_t get_log_type() const { return log_type_; @@ -62,10 +62,10 @@ class ObOfflinePartitionLog : public ObNonTransLog { } VIRTUAL_TO_STRING_KV(K_(log_type), K_(is_physical_drop), K_(cluster_id)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObOfflinePartitionLog); - protected: +protected: bool is_inited_; int64_t log_type_; bool is_physical_drop_; @@ -75,7 +75,7 @@ class ObOfflinePartitionLog : public ObNonTransLog { class ObAddPartitionToPGLog : public ObNonTransLog { OB_UNIS_VERSION(1); - public: +public: ObAddPartitionToPGLog() { reset(); @@ -85,7 +85,7 @@ class ObAddPartitionToPGLog : public ObNonTransLog { int init(const int64_t log_type, const obrpc::ObCreatePartitionArg& arg); void reset(); - public: +public: int64_t get_log_type() const { return log_type_; @@ -106,10 +106,10 @@ class ObAddPartitionToPGLog : public ObNonTransLog { } VIRTUAL_TO_STRING_KV(K_(log_type), K_(arg)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObAddPartitionToPGLog); - protected: +protected: bool is_inited_; int64_t log_type_; obrpc::ObCreatePartitionArg arg_; @@ -118,7 +118,7 @@ class ObAddPartitionToPGLog : public ObNonTransLog { class ObRemovePartitionFromPGLog : public ObNonTransLog { OB_UNIS_VERSION(1); - public: +public: ObRemovePartitionFromPGLog() { reset(); @@ -128,7 +128,7 @@ class ObRemovePartitionFromPGLog : public ObNonTransLog { int init(const int64_t log_type, const ObPGKey& pg_key, const ObPartitionKey& pkey); void reset(); - public: +public: int64_t get_log_type() const { return log_type_; @@ -145,10 +145,10 @@ class ObRemovePartitionFromPGLog : public ObNonTransLog { virtual int replace_tenant_id(const uint64_t new_tenant_id) override; VIRTUAL_TO_STRING_KV(K_(log_type), K_(pg_key), K_(partition_key)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRemovePartitionFromPGLog); - protected: +protected: bool is_inited_; int64_t log_type_; common::ObPGKey pg_key_; @@ -158,7 +158,7 @@ class ObRemovePartitionFromPGLog : public ObNonTransLog { class ObPGSchemaChangeLog : public ObNonTransLog { OB_UNIS_VERSION(1); - public: +public: ObPGSchemaChangeLog() { reset(); @@ -169,7 +169,7 @@ class ObPGSchemaChangeLog : public ObNonTransLog { const int64_t schema_version, const uint64_t index_id); void reset(); - public: +public: int64_t get_log_type() const { return log_type_; @@ -194,10 +194,10 @@ class ObPGSchemaChangeLog : public ObNonTransLog { virtual int replace_tenant_id(const uint64_t new_tenant_id) override; VIRTUAL_TO_STRING_KV(K_(log_type), K_(pg_key), K_(pkey), K_(schema_version), K_(index_id)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPGSchemaChangeLog); - protected: +protected: bool is_inited_; int64_t log_type_; common::ObPGKey pg_key_; @@ -215,7 +215,7 @@ enum ObPGWriteLogState { }; class ObAddPartitionToPGLogCb : public clog::ObISubmitLogCb { - public: +public: ObAddPartitionToPGLogCb() { reset(); @@ -250,7 +250,7 @@ class ObAddPartitionToPGLogCb : public clog::ObISubmitLogCb { virtual bool is_valid() const; VIRTUAL_TO_STRING_KV(K_(log_type), K_(pg_key), K_(partition_key), K_(write_clog_state)); - private: +private: bool is_inited_; int64_t log_type_; common::ObPGKey pg_key_; @@ -264,7 +264,7 @@ class ObAddPartitionToPGLogCb : public clog::ObISubmitLogCb { }; class ObRemovePartitionFromPGLogCb : public clog::ObISubmitLogCb { - public: +public: ObRemovePartitionFromPGLogCb() { reset(); @@ -295,7 +295,7 @@ class ObRemovePartitionFromPGLogCb : public clog::ObISubmitLogCb { virtual bool is_valid() const; VIRTUAL_TO_STRING_KV(K_(log_type), K_(pg_key), K_(partition_key)); - private: +private: bool is_inited_; int64_t log_type_; common::ObPGKey pg_key_; @@ -305,7 +305,7 @@ class ObRemovePartitionFromPGLogCb : public clog::ObISubmitLogCb { }; class ObSchemaChangeClogCb : public clog::ObISubmitLogCb { - public: +public: ObSchemaChangeClogCb() { reset(); @@ -340,7 +340,7 @@ class ObSchemaChangeClogCb : public clog::ObISubmitLogCb { virtual bool is_valid() const; VIRTUAL_TO_STRING_KV(K_(log_type), K_(pg_key), K_(partition_key), K_(write_clog_state)); - private: +private: bool is_inited_; int64_t log_type_; common::ObPGKey pg_key_; @@ -354,7 +354,7 @@ class ObSchemaChangeClogCb : public clog::ObISubmitLogCb { }; class ObOfflinePartitionCb : public clog::ObISubmitLogCb { - public: +public: ObOfflinePartitionCb() : is_inited_(false), is_physical_drop_(false), cb_async_worker_(nullptr) {} virtual ~ObOfflinePartitionCb() @@ -369,7 +369,7 @@ class ObOfflinePartitionCb : public clog::ObISubmitLogCb { const uint64_t log_id, const int64_t version, const bool batch_committed, const bool batch_last_succeed); int on_finished(const common::ObPGKey& pg_key, const uint64_t log_id); - private: +private: bool is_inited_; bool is_physical_drop_; ObCLogCallbackAsyncWorker* cb_async_worker_; diff --git a/src/storage/ob_pg_macro_meta_checkpoint_reader.h b/src/storage/ob_pg_macro_meta_checkpoint_reader.h index 38733f7ec..29ef874bb 100644 --- a/src/storage/ob_pg_macro_meta_checkpoint_reader.h +++ b/src/storage/ob_pg_macro_meta_checkpoint_reader.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace storage { struct ObPGMacroMetaPair final { - public: +public: ObPGMacroMetaPair() : meta_(nullptr), block_index_(0) {} ~ObPGMacroMetaPair() = default; @@ -35,7 +35,7 @@ struct ObPGMacroMetaPair final { }; class ObPGMacroMetaCheckpointReader final { - public: +public: ObPGMacroMetaCheckpointReader(); ~ObPGMacroMetaCheckpointReader() = default; int init(const blocksstable::MacroBlockId& entry_block, blocksstable::ObStorageFileHandle& file_handle, @@ -44,10 +44,10 @@ class ObPGMacroMetaCheckpointReader final { void reset(); common::ObIArray& get_meta_block_list(); - private: +private: int read_next_entry(ObPGMacroBlockMetaCheckpointEntry& entry); - private: +private: ObPGMetaItemReader reader_; ObMacroMetaReplayMap* replay_map_; bool is_inited_; diff --git a/src/storage/ob_pg_macro_meta_checkpoint_writer.h b/src/storage/ob_pg_macro_meta_checkpoint_writer.h index f3d0811ce..920748cd7 100644 --- a/src/storage/ob_pg_macro_meta_checkpoint_writer.h +++ b/src/storage/ob_pg_macro_meta_checkpoint_writer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { struct ObPGMacroBlockMetaCheckpointEntry final { - public: +public: static const int64_t PG_MACRO_META_ENTRY_VERSION = 1; ObPGMacroBlockMetaCheckpointEntry(blocksstable::ObMacroBlockMetaV2& meta) : disk_no_(0), macro_block_id_(), table_key_(), meta_(meta) @@ -34,7 +34,7 @@ struct ObPGMacroBlockMetaCheckpointEntry final { TO_STRING_KV(K_(table_key), K_(macro_block_id), K_(table_key), K_(meta)); OB_UNIS_VERSION_V(PG_MACRO_META_ENTRY_VERSION); - public: +public: int64_t disk_no_; blocksstable::MacroBlockId macro_block_id_; ObITable::TableKey table_key_; @@ -42,7 +42,7 @@ struct ObPGMacroBlockMetaCheckpointEntry final { }; class ObPGMacroMeta : public ObIPGMetaItem { - public: +public: ObPGMacroMeta(); virtual ~ObPGMacroMeta() = default; void set_meta_entry(ObPGMacroBlockMetaCheckpointEntry& entry); @@ -52,10 +52,10 @@ class ObPGMacroMeta : public ObIPGMetaItem { return PG_MACRO_META; } - private: +private: int extend_buf(const int64_t request_size); - private: +private: common::ObArenaAllocator allocator_; char* buf_; int64_t buf_size_; @@ -63,14 +63,14 @@ class ObPGMacroMeta : public ObIPGMetaItem { }; class ObPGMacroMetaIterator : public ObIPGMetaItemIterator { - public: +public: ObPGMacroMetaIterator(); virtual ~ObPGMacroMetaIterator() = default; int init(ObTablesHandle& tables_handle); virtual int get_next_item(ObIPGMetaItem*& item) override; void reset(); - private: +private: bool is_inited_; ObTablesHandle tables_handle_; ObArray block_infos_; @@ -82,14 +82,14 @@ class ObPGMacroMetaIterator : public ObIPGMetaItemIterator { }; class ObPGMacroMetaCheckpointWriter final { - public: +public: ObPGMacroMetaCheckpointWriter(); ~ObPGMacroMetaCheckpointWriter() = default; int init(ObTablesHandle& tables_handle, ObPGMetaItemWriter& writer); int write_checkpoint(); void reset(); - private: +private: bool is_inited_; ObPGMetaItemWriter* writer_; ObPGMacroMetaIterator iter_; diff --git a/src/storage/ob_pg_memory_garbage_collector.h b/src/storage/ob_pg_memory_garbage_collector.h index cb558d407..a0c3a246f 100644 --- a/src/storage/ob_pg_memory_garbage_collector.h +++ b/src/storage/ob_pg_memory_garbage_collector.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class ObPGRecycleNode : public common::ObDLinkBase { - public: +public: ObPGRecycleNode() : pg_(nullptr) {} virtual ~ObPGRecycleNode() = default; @@ -32,19 +32,19 @@ class ObPGRecycleNode : public common::ObDLinkBase { return pg_; } - private: +private: ObIPartitionGroup* pg_; }; class ObPGMemoryGCTask : public common::ObTimerTask { - public: +public: ObPGMemoryGCTask() = default; virtual ~ObPGMemoryGCTask() = default; virtual void runTimerTask() override; }; class ObPGMemoryGarbageCollector { - public: +public: ObPGMemoryGarbageCollector(); ~ObPGMemoryGarbageCollector() = default; static ObPGMemoryGarbageCollector& get_instance(); @@ -56,7 +56,7 @@ class ObPGMemoryGarbageCollector { void wait(); void destroy(); - private: +private: static const int64_t GC_INTERVAL_US = 10 * 1000 * 1000L; common::ObDList pg_list_; common::ObArray pg_node_pool_; diff --git a/src/storage/ob_pg_memtable_mgr.h b/src/storage/ob_pg_memtable_mgr.h index 54ab87509..3d2995db1 100644 --- a/src/storage/ob_pg_memtable_mgr.h +++ b/src/storage/ob_pg_memtable_mgr.h @@ -30,7 +30,7 @@ class ObIPartitionComponentFactory; class ObTableHandle; class ObPGMemtableMgr { - public: +public: ObPGMemtableMgr(); ~ObPGMemtableMgr() { @@ -86,7 +86,7 @@ class ObPGMemtableMgr { DECLARE_VIRTUAL_TO_STRING; - private: +private: // minor freeze int save_frozen_base_storage_info_(const ObSavedStorageInfoV2& info); int wait_old_memtable_release_(); @@ -109,11 +109,11 @@ class ObPGMemtableMgr { DISALLOW_COPY_AND_ASSIGN(ObPGMemtableMgr); - private: +private: static const int64_t PRINT_READABLE_INFO_DURATION_US = 1000 * 1000 * 60 * 10L; // 10min static const int64_t MAX_MEMSTORE_CNT = 16; - private: +private: int64_t memtable_head_; int64_t memtable_tail_; memtable::ObMemtable* memtables_[MAX_MEMSTORE_CNT]; diff --git a/src/storage/ob_pg_meta_block_reader.h b/src/storage/ob_pg_meta_block_reader.h index 9cfbda100..7e2d2f132 100644 --- a/src/storage/ob_pg_meta_block_reader.h +++ b/src/storage/ob_pg_meta_block_reader.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class ObPGMetaBlockReader final { - public: +public: ObPGMetaBlockReader(); ~ObPGMetaBlockReader() = default; int init(const blocksstable::MacroBlockId& entry_block, blocksstable::ObStorageFileHandle& file_handle); @@ -29,13 +29,13 @@ class ObPGMetaBlockReader final { void reset(); ObIArray& get_meta_block_list(); - private: +private: int get_meta_blocks(const blocksstable::MacroBlockId& entry_block); int prefetch_block(); int check_data_checksum(const char* buf, const int64_t buf_len); int get_previous_block_id(const char* buf, const int64_t buf_len, blocksstable::MacroBlockId& previous_block_id); - private: +private: static const int64_t HANDLE_CNT = 2; bool is_inited_; common::ObIODesc io_desc_; @@ -48,7 +48,7 @@ class ObPGMetaBlockReader final { }; struct ObPGMetaItemBuffer final { - public: +public: ObPGMetaItemBuffer() : buf_(nullptr), buf_len_(0), item_type_(0) {} ~ObPGMetaItemBuffer() = default; @@ -60,14 +60,14 @@ struct ObPGMetaItemBuffer final { item_type_ = 0; } - public: +public: const char* buf_; int64_t buf_len_; int16_t item_type_; }; class ObPGMetaItemReader final { - public: +public: ObPGMetaItemReader(); ~ObPGMetaItemReader() = default; int init(const blocksstable::MacroBlockId& entry_block, blocksstable::ObStorageFileHandle& file_handle); @@ -75,11 +75,11 @@ class ObPGMetaItemReader final { void reset(); common::ObIArray& get_meta_block_list(); - private: +private: int read_item_block(); int parse_item(ObPGMetaItemBuffer& item); - private: +private: static const int64_t HANDLE_CNT = 2; bool is_inited_; const blocksstable::ObMacroBlockCommonHeader* common_header_; diff --git a/src/storage/ob_pg_meta_block_writer.h b/src/storage/ob_pg_meta_block_writer.h index 0e57e1625..7e18a486d 100644 --- a/src/storage/ob_pg_meta_block_writer.h +++ b/src/storage/ob_pg_meta_block_writer.h @@ -29,7 +29,7 @@ enum ObPGMetaItemType { }; class ObIPGMetaItem { - public: +public: ObIPGMetaItem() = default; virtual ~ObIPGMetaItem() = default; virtual int serialize(const char*& buf, int64_t& pos) = 0; @@ -37,21 +37,21 @@ class ObIPGMetaItem { }; class ObIPGWriteMetaItemCallback { - public: +public: ObIPGWriteMetaItemCallback(); virtual ~ObIPGWriteMetaItemCallback(); virtual int process() = 0; }; class ObIPGMetaItemIterator { - public: +public: ObIPGMetaItemIterator() = default; virtual ~ObIPGMetaItemIterator() = default; virtual int get_next_item(ObIPGMetaItem*& meta_item) = 0; }; class ObPGMetaBlockWriter final { - public: +public: ObPGMetaBlockWriter(); ~ObPGMetaBlockWriter() = default; int init(blocksstable::ObStorageFileHandle& file_handle); @@ -62,7 +62,7 @@ class ObPGMetaBlockWriter final { ObIArray& get_meta_block_list(); void reset(); - private: +private: bool is_inited_; common::ObArenaAllocator allocator_; common::ObIODesc io_desc_; @@ -75,7 +75,7 @@ class ObPGMetaBlockWriter final { }; struct ObPGMetaItemHeader { - public: +public: ObPGMetaItemHeader() : type_(0), reserved_(0), size_(0) {} ~ObPGMetaItemHeader() = default; @@ -85,7 +85,7 @@ struct ObPGMetaItemHeader { }; class ObPGMetaItemWriter final { - public: +public: ObPGMetaItemWriter(); ~ObPGMetaItemWriter() = default; int init(blocksstable::ObStorageFileHandle& file_handle); @@ -95,12 +95,12 @@ class ObPGMetaItemWriter final { int close(); void reset(); - private: +private: int write_block(); int write_item_header(const ObIPGMetaItem* item, const int64_t item_len); int write_item_content(const char* item_buf, const int64_t item_buf_len, int64_t& item_pos); - private: +private: static const int64_t HEADER_SIZE = sizeof(blocksstable::ObMacroBlockCommonHeader) + sizeof(blocksstable::ObLinkedMacroBlockHeaderV2); bool is_inited_; diff --git a/src/storage/ob_pg_meta_checkpoint_reader.h b/src/storage/ob_pg_meta_checkpoint_reader.h index feb18f8a1..906fd7c3f 100644 --- a/src/storage/ob_pg_meta_checkpoint_reader.h +++ b/src/storage/ob_pg_meta_checkpoint_reader.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class ObPGMetaCheckpointReader final { - public: +public: ObPGMetaCheckpointReader(); ~ObPGMetaCheckpointReader() = default; int init(const blocksstable::MacroBlockId& entry_block, blocksstable::ObStorageFileHandle& file_handle, @@ -30,10 +30,10 @@ class ObPGMetaCheckpointReader final { void reset(); common::ObIArray& get_meta_block_list(); - private: +private: int read_item(ObPGMetaItemBuffer& item); - private: +private: bool is_inited_; ObPGMetaItemReader reader_; blocksstable::ObStorageFileHandle file_handle_; diff --git a/src/storage/ob_pg_meta_checkpoint_writer.h b/src/storage/ob_pg_meta_checkpoint_writer.h index 543ad918e..34d9975b5 100644 --- a/src/storage/ob_pg_meta_checkpoint_writer.h +++ b/src/storage/ob_pg_meta_checkpoint_writer.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { class ObPGMetaItem : public ObIPGMetaItem { - public: +public: ObPGMetaItem(); virtual ~ObPGMetaItem() = default; virtual int serialize(const char*& buf, int64_t& buf_len) override; @@ -35,21 +35,21 @@ class ObPGMetaItem : public ObIPGMetaItem { } TO_STRING_KV(KP_(buf), K_(buf_len)); - private: +private: const char* buf_; int64_t buf_len_; }; // sstable meta and pg meta class ObPGMetaCheckpointWriter final { - public: +public: ObPGMetaCheckpointWriter(); ~ObPGMetaCheckpointWriter() = default; int init(ObPGMetaItem& pg_meta, ObPGMetaItemWriter& writer); int write_checkpoint(); void reset(); - private: +private: bool is_inited_; ObPGMetaItemWriter* writer_; ObPGMetaItem pg_meta_; diff --git a/src/storage/ob_pg_mgr.h b/src/storage/ob_pg_mgr.h index 38d44656b..3cf77d07c 100644 --- a/src/storage/ob_pg_mgr.h +++ b/src/storage/ob_pg_mgr.h @@ -28,7 +28,7 @@ class ObPGPartition; class ObPGPartitionGuard; class ObIPartitionGroupGuard; class ObPGMgr { - public: +public: friend class ObPartitionGroupIterator; friend class ObPGPartitionIterator; ObPGMgr() @@ -79,13 +79,13 @@ class ObPGMgr { } int remove_duplicate_pgs(); - private: +private: OB_INLINE void free_pg(ObIPartitionGroup* pg) const; void del_pg_impl(ObIPartitionGroup* pg); int choose_preserve_pg(ObIPartitionGroup* left_pg, ObIPartitionGroup* right_pg, ObIPartitionGroup*& result_pg); int remove_duplicate_pg_in_linklist(ObIPartitionGroup*& head); - private: +private: static const bool ENABLE_RECOVER_ALL_ZONE = false; bool is_inited_; // total pg + total standalone partition @@ -102,7 +102,7 @@ class ObPGMgr { // iterate all pgs and all standalone partitions class ObIPartitionGroupIterator { - public: +public: ObIPartitionGroupIterator() {} virtual ~ObIPartitionGroupIterator() @@ -111,7 +111,7 @@ class ObIPartitionGroupIterator { }; class ObPartitionGroupIterator : public ObIPartitionGroupIterator { - public: +public: ObPartitionGroupIterator(); virtual ~ObPartitionGroupIterator(); virtual int get_next(ObIPartitionGroup*& partition); @@ -121,7 +121,7 @@ class ObPartitionGroupIterator : public ObIPartitionGroupIterator { pg_mgr_ = &pg_mgr; } - private: +private: common::ObArray partitions_; int64_t bucket_pos_; int64_t array_idx_; @@ -132,7 +132,7 @@ typedef common::ObSEArray ObPGPartitionGuardArray; // iterate all pg partition in current server class ObIPGPartitionIterator { - public: +public: ObIPGPartitionIterator() : need_trans_table_(false) {} virtual ~ObIPGPartitionIterator() @@ -140,12 +140,12 @@ class ObIPGPartitionIterator { virtual int get_next(ObPGPartition*& pg_partition) = 0; int get_pg_partition_guard_array(ObIPartitionGroup* partition, ObPGPartitionGuardArray& pg_partition_guard_arr); - protected: +protected: bool need_trans_table_; }; class ObSinglePGPartitionIterator : public ObIPGPartitionIterator { - public: +public: ObSinglePGPartitionIterator(); virtual ~ObSinglePGPartitionIterator(); int init(ObIPartitionGroup* pg, const bool need_trans_table = false); @@ -156,14 +156,14 @@ class ObSinglePGPartitionIterator : public ObIPGPartitionIterator { return pg_partition_guard_arr_; } - private: +private: ObPGPartitionGuardArray pg_partition_guard_arr_; int64_t array_idx_; bool is_inited_; }; class ObPGPartitionIterator : public ObIPGPartitionIterator { - public: +public: ObPGPartitionIterator(); virtual ~ObPGPartitionIterator(); virtual int get_next(ObPGPartition*& pg_partition); @@ -173,10 +173,10 @@ class ObPGPartitionIterator : public ObIPGPartitionIterator { pg_mgr_ = &pg_mgr; } - private: +private: int next_pg_(); - private: +private: int64_t bucket_pos_; ObPGPartitionGuardArray pg_partition_guard_arr_; int64_t array_idx_; @@ -184,7 +184,7 @@ class ObPGPartitionIterator : public ObIPGPartitionIterator { }; class ObIPartitionGroupGuard { - public: +public: ObIPartitionGroupGuard() : pg_mgr_(nullptr), pg_(nullptr) {} virtual ~ObIPartitionGroupGuard() @@ -211,7 +211,7 @@ class ObIPartitionGroupGuard { return pg_; } - private: +private: const ObPGMgr* pg_mgr_; ObIPartitionGroup* pg_; DISALLOW_COPY_AND_ASSIGN(ObIPartitionGroupGuard); diff --git a/src/storage/ob_pg_partition.h b/src/storage/ob_pg_partition.h index e570cc238..289a6e9ee 100644 --- a/src/storage/ob_pg_partition.h +++ b/src/storage/ob_pg_partition.h @@ -35,7 +35,7 @@ class ObPGMemtableMgr; typedef common::LinkHashNode ObPGPartitionHashNode; typedef common::LinkHashValue ObPGPartitionHashValue; class ObPGPartition : public ObPGPartitionHashValue { - public: +public: ObPGPartition(); virtual ~ObPGPartition(); void destroy(); @@ -121,14 +121,14 @@ class ObPGPartition : public ObPGPartitionHashValue { int64_t& schema_version, int64_t& refreshed_schema_ts, uint64_t& log_id, int64_t& log_ts); TO_STRING_KV(K_(pkey), KP_(cp_fty), KP_(storage)); - private: +private: bool is_gc_starting_() const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPGPartition); static const int64_t DELAY_SCHEDULE_TIME_UNIT = 1000 * 1000 * 1; // 1s static const int64_t MAX_DELAY_SCHEDULE_TIME_UNIT = 1000 * 1000 * 60; // 60s - private: +private: bool is_inited_; common::ObPartitionKey pkey_; ObIPartitionComponentFactory* cp_fty_; @@ -151,7 +151,7 @@ class ObPGPartition : public ObPGPartitionHashValue { // Memory Alloc class PGPartitionInfoAlloc { - public: +public: static ObPGPartition* alloc_value() { return op_alloc(ObPGPartition); @@ -182,16 +182,16 @@ typedef common::ObLinkHashMap { - public: + public: Node(const common::ObPartitionKey& key) : key_(key) {} const common::ObPartitionKey key_; }; typedef common::ObDList List; - public: +public: ObPartitionKeyList() : lock_(), list_() {} @@ -271,13 +271,13 @@ class ObPartitionKeyList { } } - private: +private: TCRWLock lock_; List list_; }; class ObPGPartitionGuard { - public: +public: ObPGPartitionGuard() : pg_partition_(NULL), map_(NULL) {} ObPGPartitionGuard(const common::ObPartitionKey& pkey, const ObPGPartitionMap& map) : pg_partition_(NULL), map_(NULL) @@ -331,14 +331,14 @@ class ObPGPartitionGuard { } TO_STRING_KV(KP_(pg_partition), K_(pkey), KP_(map)); - private: +private: ObPGPartition* pg_partition_; common::ObPartitionKey pkey_; ObPGPartitionMap* map_; }; class ObPGPartitionArrayGuard { - public: +public: ObPGPartitionArrayGuard(ObPGPartitionMap& map) : pg_partition_map_(map) {} ~ObPGPartitionArrayGuard(); @@ -356,7 +356,7 @@ class ObPGPartitionArrayGuard { return pg_partition_map_; } - private: +private: common::ObSEArray partitions_; ObPGPartitionMap& pg_partition_map_; }; diff --git a/src/storage/ob_pg_sstable_garbage_collector.h b/src/storage/ob_pg_sstable_garbage_collector.h index 8da5d4be7..28ef5b2e9 100644 --- a/src/storage/ob_pg_sstable_garbage_collector.h +++ b/src/storage/ob_pg_sstable_garbage_collector.h @@ -19,17 +19,17 @@ namespace oceanbase { namespace storage { class ObPGSSTableGCTask : public common::ObTimerTask { - public: +public: ObPGSSTableGCTask(); virtual ~ObPGSSTableGCTask(); virtual void runTimerTask() override; - private: +private: static const int64_t ONE_ROUND_RECYCLE_COUNT_THRESHOLD = 100000L; }; class ObPGSSTableGarbageCollector { - public: +public: ObPGSSTableGarbageCollector(); ~ObPGSSTableGarbageCollector(); int init(); @@ -38,10 +38,10 @@ class ObPGSSTableGarbageCollector { void wait(); void destroy(); - private: +private: int schedule_gc_task(); - private: +private: static const int64_t GC_INTERVAL_US = 1 * 1000 * 1000L; bool is_inited_; common::ObTimer timer_; diff --git a/src/storage/ob_pg_sstable_mgr.h b/src/storage/ob_pg_sstable_mgr.h index 9ab4c186c..de514e350 100644 --- a/src/storage/ob_pg_sstable_mgr.h +++ b/src/storage/ob_pg_sstable_mgr.h @@ -28,7 +28,7 @@ enum ObRedoLogSubType { }; class ObPGSSTableMgr { - public: +public: ObPGSSTableMgr(); virtual ~ObPGSSTableMgr(); int init(const common::ObPGKey& pg_key); @@ -58,11 +58,11 @@ class ObPGSSTableMgr { } int get_clean_out_log_ts(int64_t& clean_out_log_ts); - private: +private: static const int64_t DEFAULT_HASH_BUCKET_COUNT = 100; static const int64_t DEFAULT_MAX_RECYCLE_COUNT = 1000; struct TableNode : public common::hash::ObPreAllocLinkHashNode { - public: + public: explicit TableNode(ObITable& item) : ObPreAllocLinkHashNode(item), next_(NULL) {} virtual ~TableNode() @@ -82,17 +82,17 @@ class ObPGSSTableMgr { }; typedef common::hash::ObPreAllocLinkHashMap TableMap; class TableGetFunctor : public TableMap::GetFunctor { - public: + public: explicit TableGetFunctor(ObTableHandle& table_handle) : table_handle_(table_handle) {} virtual ~TableGetFunctor() = default; virtual int operator()(ObITable& table) override; - private: + private: ObTableHandle& table_handle_; }; class UnusedTableFunctor : public TableMap::ForeachFunctor { - public: + public: UnusedTableFunctor() : is_inited_(false), is_full_(false), max_recycle_cnt_(0), tables_() {} virtual ~UnusedTableFunctor() = default; @@ -108,14 +108,14 @@ class ObPGSSTableMgr { return is_full_; } - private: + private: bool is_inited_; bool is_full_; int64_t max_recycle_cnt_; common::ObArray tables_; }; class CheckAllTableUnusedFunctor : public TableMap::ForeachFunctor { - public: + public: CheckAllTableUnusedFunctor() : is_all_unused_(true) {} virtual ~CheckAllTableUnusedFunctor() = default; @@ -125,11 +125,11 @@ class ObPGSSTableMgr { return is_all_unused_; } - private: + private: bool is_all_unused_; }; class GetCleanOutLogIdFunctor : public TableMap::ForeachFunctor { - public: + public: GetCleanOutLogIdFunctor() : clean_out_log_ts_(INT64_MAX) {} virtual ~GetCleanOutLogIdFunctor() = default; @@ -139,7 +139,7 @@ class ObPGSSTableMgr { } virtual int operator()(ObITable& table, bool& is_full) override; - private: + private: int64_t clean_out_log_ts_; }; void destroy(); @@ -151,7 +151,7 @@ class ObPGSSTableMgr { int alloc_sstable(const int64_t tenant_id, ObSSTable*& sstable); int64_t get_serialize_size(); - private: +private: bool is_inited_; ObPGKey pg_key_; common::ObBucketLock bucket_lock_; diff --git a/src/storage/ob_pg_storage.cpp b/src/storage/ob_pg_storage.cpp index f21363c89..4f20d8710 100644 --- a/src/storage/ob_pg_storage.cpp +++ b/src/storage/ob_pg_storage.cpp @@ -7525,11 +7525,9 @@ int ObPGStorage::get_freeze_info_(const common::ObVersion& version, ObFreezeInfo int ret = OB_SUCCESS; freeze_info.reset(); if (OB_FAIL(ObFreezeInfoMgrWrapper::get_instance().get_freeze_info_by_major_version( - pkey_.get_table_id(), - version.major_, - freeze_info))) { - if (OB_ENTRY_NOT_EXIST == ret - || (OB_EAGAIN == ret && OB_ALL_CORE_TABLE_TID == extract_pure_id(pkey_.get_table_id()))) { + pkey_.get_table_id(), version.major_, freeze_info))) { + if (OB_ENTRY_NOT_EXIST == ret || + (OB_EAGAIN == ret && OB_ALL_CORE_TABLE_TID == extract_pure_id(pkey_.get_table_id()))) { LOG_WARN("failed to get freeze info", K(ret), K(pkey_)); ObFreezeInfoSnapshotMgr::FreezeInfoLite freeze_info_lite; if (OB_FAIL(ObFreezeInfoMgrWrapper::get_instance().get_freeze_info_by_major_version( diff --git a/src/storage/ob_pg_storage.h b/src/storage/ob_pg_storage.h index 86b1cdc96..baeca3fcc 100644 --- a/src/storage/ob_pg_storage.h +++ b/src/storage/ob_pg_storage.h @@ -51,7 +51,7 @@ class ObIPartitionComponentFactory; class ObPartitionMigrateCtx; struct ObPGCreateSSTableParam final { - public: +public: ObPGCreateSSTableParam() : with_partition_param_(nullptr), with_table_param_(nullptr), @@ -82,7 +82,7 @@ struct ObPGCreateSSTableParam final { class ObPGStorage { friend class ObPGPartitionArrayGuard; - public: +public: ObPGStorage(); ~ObPGStorage(); int init(const ObPartitionKey& key, ObIPartitionComponentFactory* cp_fty, @@ -396,9 +396,9 @@ class ObPGStorage { TO_STRING_KV(KP(this), K_(pkey), KP_(meta), K_(log_seq_num), K_(last_freeze_ts)); - private: +private: class GetPGPartitionCountFunctor { - public: + public: GetPGPartitionCountFunctor(const bool include_trans_table, int64_t& count) : include_trans_table_(include_trans_table), count_(count) {} @@ -419,12 +419,12 @@ class ObPGStorage { return ret; } - private: + private: bool include_trans_table_; int64_t& count_; }; class GetAllPGPartitionKeyFunctor { - public: + public: explicit GetAllPGPartitionKeyFunctor(ObPartitionArray& arr) : pkeys_(arr) {} ~GetAllPGPartitionKeyFunctor() @@ -441,11 +441,11 @@ class ObPGStorage { return ret; } - private: + private: ObPartitionArray& pkeys_; }; class RemovePGIndexFunctor { - public: + public: explicit RemovePGIndexFunctor(ObPartitionGroupIndex& pg_index) : pg_index_(pg_index) {} ~RemovePGIndexFunctor() @@ -462,12 +462,12 @@ class ObPGStorage { return ret; } - private: + private: ObPartitionGroupIndex& pg_index_; }; class GetAllPGPartitionFunctor { - public: + public: explicit GetAllPGPartitionFunctor(ObPGPartitionArrayGuard& guard) : guard_(guard) {} int operator()(const common::ObPartitionKey& pkey) @@ -492,11 +492,11 @@ class ObPGStorage { return ret; } - private: + private: ObPGPartitionArrayGuard& guard_; }; class RemovePGPartitionFunctor { - public: + public: RemovePGPartitionFunctor(ObPGPartitionMap& map) : map_(map) {} void operator()(const common::ObPartitionKey& pkey) @@ -508,7 +508,7 @@ class ObPGStorage { } } - private: + private: ObPGPartitionMap& map_; }; struct SerializePair { @@ -521,7 +521,7 @@ class ObPGStorage { int64_t size_; }; - private: +private: int register_pg_partition_(const common::ObPartitionKey& pkey, ObPGPartition* pg_info); int create_pg_memtable_(ObPGPartition* pg_partition); int get_all_pg_partition_keys_(common::ObPartitionArray& pkeys, const bool include_trans_table = false); @@ -613,10 +613,10 @@ class ObPGStorage { int get_restore_point_max_schema_version_( const int64_t publish_version, const ObPartitionArray& partitions, int64_t& schema_version); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPGStorage); - private: +private: static const int64_t MAGIC_NUM_BEFORE_2_2_70 = -0xBCDE; static const int64_t MAGIC_NUM_2_2_70 = -0xBCDF; static const int64_t MAGIC_NUM = -0xBCE0; diff --git a/src/storage/ob_query_iterator_factory.h b/src/storage/ob_query_iterator_factory.h index ff2fbb6f1..4c4765d66 100644 --- a/src/storage/ob_query_iterator_factory.h +++ b/src/storage/ob_query_iterator_factory.h @@ -27,7 +27,7 @@ class ObValueRowIterator; class ObColMap; class ObStoreRow; class ObQueryIteratorFactory { - public: +public: static ObMultipleScanMerge* get_multi_scan_merge_iter(); static ObMultipleGetMerge* get_multi_get_merge_iter(); static ObIndexMerge* get_index_merge_iter(); @@ -42,10 +42,10 @@ class ObQueryIteratorFactory { static void free_col_map(ObColMap* col_map); static void free_work_row(ObStoreRow* row); - private: +private: static void print_count(); - private: +private: static int64_t single_row_merge_alloc_count_; static int64_t single_row_merge_release_count_; static int64_t multi_scan_merge_alloc_count_; diff --git a/src/storage/ob_range_iterator.cpp b/src/storage/ob_range_iterator.cpp index 984392343..d37d29257 100644 --- a/src/storage/ob_range_iterator.cpp +++ b/src/storage/ob_range_iterator.cpp @@ -98,7 +98,7 @@ OB_INLINE static int always_false(const ObStoreRange& range, const ObIArray* column_orders) : column_orders_(column_orders) {} @@ -122,7 +122,7 @@ class RangeCmp { return cmp < 0; } - private: +private: const ObIArray* column_orders_; }; diff --git a/src/storage/ob_range_iterator.h b/src/storage/ob_range_iterator.h index 564b6120e..bec455313 100644 --- a/src/storage/ob_range_iterator.h +++ b/src/storage/ob_range_iterator.h @@ -67,7 +67,7 @@ struct ObBatch final { }; class ObRangeIterator final { - public: +public: ObRangeIterator() : scan_param_(NULL), cur_idx_(0), @@ -88,13 +88,13 @@ class ObRangeIterator final { int set_scan_param(ObTableScanParam& scan_param); int get_org_range_array_idx(const int64_t range_idx, int64_t& org_range_array_idx); - private: +private: int convert_key_ranges(const int64_t range_begin_pos, const int64_t range_end_pos, const int64_t range_array_idx, ObIAllocator& allocator, common::ObIArray& store_ranges); template void set_range_array_idx(const int64_t range_array_idx, T& range); - private: +private: ObTableScanParam* scan_param_; int64_t cur_idx_; ScanRangeArray order_ranges_; diff --git a/src/storage/ob_range_purger.h b/src/storage/ob_range_purger.h index 2eecf0e16..a095457f1 100644 --- a/src/storage/ob_range_purger.h +++ b/src/storage/ob_range_purger.h @@ -24,7 +24,7 @@ class ObMvccRow; namespace storage { class ObRangePurgerBase { - public: +public: typedef memtable::ObMemtableScanIterator Iter; typedef memtable::ObMemtableKey Key; typedef memtable::ObMvccRow Value; @@ -53,7 +53,7 @@ class ObRangePurgerBase { val_ = NULL; } - private: +private: Iter* iter_; int64_t range_pos_; bool is_last_inmem_; @@ -62,7 +62,7 @@ class ObRangePurgerBase { }; class ObRangePurger { - public: +public: typedef common::ObIArray Stores; ObRangePurger() : has_partial_read_(false), memstore_cnt_(0) {} @@ -81,7 +81,7 @@ class ObRangePurger { void try_purge(int64_t range_pos, int iter_idx, bool is_del, bool read_elr_data); void skip_range(int idx); - private: +private: bool has_partial_read_; int memstore_cnt_; ObRangePurgerBase purger_[common::MAX_MEMSTORE_CNT_IN_STORAGE]; diff --git a/src/storage/ob_range_skip.h b/src/storage/ob_range_skip.h index c61d4a812..226655679 100644 --- a/src/storage/ob_range_skip.h +++ b/src/storage/ob_range_skip.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace storage { class ObRangeSkip { - public: +public: ObRangeSkip() : iters_(NULL) {} ~ObRangeSkip() @@ -37,7 +37,7 @@ class ObRangeSkip { int inspect_gap(int idx, const bool is_memtable, uint8_t in_gap_flag, int64_t& range_idx, const ObStoreRowkey*& rowkey, int64_t limit); - private: +private: ObMultipleMerge::MergeIterators* iters_; }; diff --git a/src/storage/ob_rebuild_scheduler.h b/src/storage/ob_rebuild_scheduler.h index 638c85833..a2d864af5 100644 --- a/src/storage/ob_rebuild_scheduler.h +++ b/src/storage/ob_rebuild_scheduler.h @@ -74,7 +74,7 @@ struct ObRebuildReplicaResult { class ObRebuildReplicaService; class ObRebuildReplicaTaskProducer : public common::ObTimerTask { - public: +public: ObRebuildReplicaTaskProducer(ObRebuildReplicaTaskScheduler& scheduler); virtual ~ObRebuildReplicaTaskProducer(); int init(ObPartitionService* partition_service, obrpc::ObPartitionServiceRpcProxy* srv_rpc_proxy, @@ -87,7 +87,7 @@ class ObRebuildReplicaTaskProducer : public common::ObTimerTask { void destroy(); virtual void runTimerTask(); - private: +private: struct ObRebuildReplicaConvergeInfo { ObRebuildReplicaConvergeInfo(); int assign(const ObRebuildReplicaConvergeInfo& task); @@ -101,7 +101,7 @@ class ObRebuildReplicaTaskProducer : public common::ObTimerTask { DISALLOW_COPY_AND_ASSIGN(ObRebuildReplicaConvergeInfo); }; - private: +private: int generate_replica_info(); int build_local_replica_info(); int get_remote_replica_info(); @@ -109,7 +109,7 @@ class ObRebuildReplicaTaskProducer : public common::ObTimerTask { int set_replica_info(const ObRebuildReplicaInfo& d_replica_info); int add_replica_info(); - private: +private: bool is_inited_; volatile bool stopped_; storage::ObPartitionService* partition_service_; @@ -118,12 +118,12 @@ class ObRebuildReplicaTaskProducer : public common::ObTimerTask { common::ObArray converge_info_array_; ObRebuildReplicaTaskScheduler& scheduler_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRebuildReplicaTaskProducer); }; class ObRebuildReplicaTaskScheduler : public lib::ThreadPool { - public: +public: ObRebuildReplicaTaskScheduler(); virtual ~ObRebuildReplicaTaskScheduler(); int init(ObPartitionService* partition_service, ObRebuildReplicaService* rebuild_replica_service); @@ -132,7 +132,7 @@ class ObRebuildReplicaTaskScheduler : public lib::ThreadPool { void run1() final; void notify(); - private: +private: struct HeapComparator { explicit HeapComparator(int& ret); bool operator()(const ObRebuildReplicaInfo* info1, const ObRebuildReplicaInfo* info2); @@ -141,11 +141,11 @@ class ObRebuildReplicaTaskScheduler : public lib::ThreadPool { return ret_; } - private: + private: int& ret_; }; - private: +private: typedef common::ObBinaryHeap Heap; typedef common::hash::ObHashMap ObReplicaInfoMap; int build_task_heap(Heap& heap); @@ -154,7 +154,7 @@ class ObRebuildReplicaTaskScheduler : public lib::ThreadPool { int add_replica_info_to_heap(Heap& heap); int change_rebuild_action(const ObPGKey& pg_key, const ObRebuildReplicaInfo::RebuildAction rebuild_action); - private: +private: static const int64_t SCHEDULER_WAIT_TIME_MS = 60 * 1000; // 60s bool is_inited_; ObPartitionService* partition_service_; @@ -165,12 +165,12 @@ class ObRebuildReplicaTaskScheduler : public lib::ThreadPool { common::ObThreadCond cond_; bool need_idle_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRebuildReplicaTaskScheduler); }; class ObRebuildReplicaService { - public: +public: ObRebuildReplicaService(); virtual ~ObRebuildReplicaService(); void destroy(); @@ -183,7 +183,7 @@ class ObRebuildReplicaService { } void stop(); - private: +private: static const int64_t DELAY_US = 15LL * 1000LL * 1000LL; // 15s bool is_inited_; common::TCRWLock lock_; @@ -192,7 +192,7 @@ class ObRebuildReplicaService { ObArray replica_info_array_; common::ObTimer task_procuder_timer_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRebuildReplicaService); }; diff --git a/src/storage/ob_relative_table.h b/src/storage/ob_relative_table.h index ece0a79f7..4b7cc24ef 100644 --- a/src/storage/ob_relative_table.h +++ b/src/storage/ob_relative_table.h @@ -23,7 +23,7 @@ namespace storage { class ObRelativeTable { friend class ObRelativeTables; - public: +public: ObTablesHandle tables_handle_; ObRelativeTable() @@ -81,14 +81,14 @@ class ObRelativeTable { TO_STRING_KV("index_id", NULL == schema_ ? 0 : schema_->get_table_id(), KP(schema_), K_(allow_not_ready), K_(use_schema_param), KPC(schema_param_)); - private: +private: int get_rowkey_col_desc_by_idx(const int64_t idx, share::schema::ObColDesc& col_desc) const; // must follow index column order int set_index_value(const common::ObNewRow& table_row, const share::schema::ColumnMap& col_map, const share::schema::ObColDesc& col_desc, const int64_t rowkey_size, common::ObNewRow& index_row, common::ObIArray* idx_columns); - private: +private: bool allow_not_ready_; const share::schema::ObTableSchema* schema_; const share::schema::ObTableSchemaParam* schema_param_; @@ -96,7 +96,7 @@ class ObRelativeTable { }; class ObRelativeTables { - public: +public: explicit ObRelativeTables(common::ObIAllocator& allocator) : idx_cnt_(0), max_col_num_(0), @@ -147,7 +147,7 @@ class ObRelativeTables { return index_tables_buf_count_; } - private: +private: int prepare_data_table(const int64_t read_snapshot, ObPartitionStore& store); int prepare_index_tables( const int64_t read_snapshot, const common::ObIArray* upd_col_ids, ObPartitionStore& store); @@ -159,13 +159,13 @@ class ObRelativeTables { int check_tenant_schema_version(share::schema::ObMultiVersionSchemaService& schema_service, const uint64_t tenant_id, const uint64_t table_id, const int64_t tenant_schema_version); - public: +public: int64_t idx_cnt_; int64_t max_col_num_; ObRelativeTable data_table_; ObRelativeTable* index_tables_; - private: +private: int64_t index_tables_buf_count_; common::ObIAllocator& allocator_; diff --git a/src/storage/ob_replay_status.cpp b/src/storage/ob_replay_status.cpp index 91dba2a82..1a05143a2 100644 --- a/src/storage/ob_replay_status.cpp +++ b/src/storage/ob_replay_status.cpp @@ -877,28 +877,28 @@ int ObReplayStatus::set_need_filter_trans_log(const ObPartitionKey& pkey, const return ret; } -int ObReplayStatus::check_and_submit_task(const ObPartitionKey &pkey, - const uint64_t log_id, - const int64_t log_ts, - const bool need_replay, - const clog::ObLogType log_type, - const int64_t next_replay_log_ts) +int ObReplayStatus::check_and_submit_task(const ObPartitionKey& pkey, const uint64_t log_id, const int64_t log_ts, + const bool need_replay, const clog::ObLogType log_type, const int64_t next_replay_log_ts) { int ret = OB_SUCCESS; - //check when log slide out + // check when log slide out const int64_t last_slide_out_log_id = get_last_slide_out_log_id(); if (OB_UNLIKELY(!is_enabled())) { ret = OB_ERR_UNEXPECTED; - REPLAY_LOG(ERROR, "replay status is not enabled", K(need_replay), K(pkey), K(log_id), K(log_type), - K(log_ts), K(ret)); - } else if (OB_UNLIKELY(!pkey.is_valid() - || OB_INVALID_TIMESTAMP == log_ts - || OB_INVALID_ID == log_id - || OB_INVALID_TIMESTAMP == next_replay_log_ts - || next_replay_log_ts > log_ts)) { + REPLAY_LOG( + ERROR, "replay status is not enabled", K(need_replay), K(pkey), K(log_id), K(log_type), K(log_ts), K(ret)); + } else if (OB_UNLIKELY(!pkey.is_valid() || OB_INVALID_TIMESTAMP == log_ts || OB_INVALID_ID == log_id || + OB_INVALID_TIMESTAMP == next_replay_log_ts || next_replay_log_ts > log_ts)) { ret = OB_INVALID_ARGUMENT; - REPLAY_LOG(ERROR, "invalid arguments", K(need_replay), K(pkey), K(log_id), K(log_ts), - K(log_type), K(next_replay_log_ts), K(ret)); + REPLAY_LOG(ERROR, + "invalid arguments", + K(need_replay), + K(pkey), + K(log_id), + K(log_ts), + K(log_type), + K(next_replay_log_ts), + K(ret)); } else if (log_id != (last_slide_out_log_id + 1)) { ret = OB_ERR_UNEXPECTED; REPLAY_LOG( @@ -934,7 +934,7 @@ int ObReplayStatus::check_and_submit_task(const ObPartitionKey &pkey, } else { { if (!submit_log_task_.need_submit_log()) { - //here must modify log_ts first, or may lead to the rollback of min_unreplay_log_timestamp + // here must modify log_ts first, or may lead to the rollback of min_unreplay_log_timestamp WLockGuard wlock_guard(get_submit_log_info_rwlock()); const uint64_t old_next_submit_log_id = get_next_submit_log_id(); const int64_t old_next_submit_log_ts = get_next_submit_log_ts(); diff --git a/src/storage/ob_replay_status.h b/src/storage/ob_replay_status.h index cf92c17ce..a6f6e3fbf 100644 --- a/src/storage/ob_replay_status.h +++ b/src/storage/ob_replay_status.h @@ -52,7 +52,7 @@ enum ObReplayPostBarrierStatus { typedef ObReplayPostBarrierStatus PostBarrierStatus; // for debug class ObReplayTaskInfo { - public: +public: ObReplayTaskInfo() : log_id_(common::OB_INVALID_ID), log_type_(OB_LOG_UNKNOWN) {} ObReplayTaskInfo(uint64_t log_id, ObStorageLogType log_type) : log_id_(log_id), log_type_(log_type) @@ -80,7 +80,7 @@ class ObReplayTaskInfo { } TO_STRING_KV(K(log_id_), K(log_type_)); - private: +private: uint64_t log_id_; ObStorageLogType log_type_; }; @@ -92,7 +92,7 @@ enum ObReplayTaskType { }; struct ObReplayTask { - public: +public: ObReplayTask() : type_(INVALID_LOG_TASK), enqueue_ts_(0), throttled_ts_(OB_INVALID_TIMESTAMP), replay_status_(NULL), fail_info_() {} @@ -101,10 +101,10 @@ struct ObReplayTask { void reuse(); void reset(); - public: +public: // record info after replay failed struct FailRoundInfo { - public: + public: FailRoundInfo() { reset(); @@ -134,7 +134,7 @@ struct ObReplayTask { } TO_STRING_KV(K(has_encount_fatal_error_), K(table_version_), K(fail_ts_), K(log_id_), K(log_type_), K(ret_code_)); - public: + public: bool has_encount_fatal_error_; int64_t table_version_; int64_t fail_ts_; @@ -215,7 +215,7 @@ struct ObReplayTask { } VIRTUAL_TO_STRING_KV(K(type_), K(enqueue_ts_), KP(replay_status_), K(fail_info_)); - public: +public: ObReplayTaskType type_; int64_t enqueue_ts_; int64_t throttled_ts_; // the lastest time of writing throttle @@ -226,7 +226,7 @@ struct ObReplayTask { }; struct ObSubmitReplayLogTask : public ObReplayTask { - public: +public: ObSubmitReplayLogTask() : ObReplayTask(), storage_log_type_(ObStorageLogType::OB_LOG_UNKNOWN), @@ -277,7 +277,7 @@ struct ObSubmitReplayLogTask : public ObReplayTask { K(get_next_submit_log_id()), K(get_next_submit_log_ts()), K(get_last_slide_out_log_id()), K(get_last_slide_out_log_ts())); - public: +public: ObStorageLogType storage_log_type_; // recode log_type when failed to check condition before submit int64_t accum_checksum_; //-----------new added members for decoupling of replay engine and sliding window---------// @@ -288,10 +288,10 @@ struct ObSubmitReplayLogTask : public ObReplayTask { }; struct ObReplayLogTaskQueue : public ObReplayTask { - public: +public: typedef common::ObLink Link; - public: +public: ObReplayLogTaskQueue() : ref_(0), index_(0) { type_ = REPLAY_LOG_TASK; @@ -327,7 +327,7 @@ struct ObReplayLogTaskQueue : public ObReplayTask { } INHERIT_TO_STRING_KV("ObReplayTask", ObReplayTask, K(ref_), K(index_)); - public: +public: // guarantee the effectiveness of the object when invoked in function get_min_unreplay_log_id() int64_t ref_; int64_t index_; @@ -335,9 +335,9 @@ struct ObReplayLogTaskQueue : public ObReplayTask { }; struct ObReplayLogTask : common::ObLink { - public: +public: struct RefBuf { - public: + public: RefBuf() : ref_cnt_(0), buf_(NULL) {} ~RefBuf() @@ -351,12 +351,12 @@ struct ObReplayLogTask : common::ObLink { return ATOMIC_SAF(&ref_cnt_, 1); } - public: + public: int64_t ref_cnt_; void* buf_; }; - public: +public: ObReplayLogTask() { reset(); @@ -395,7 +395,7 @@ struct ObReplayLogTask : common::ObLink { } int64_t get_trans_inc_no() const; - public: +public: common::ObPartitionKey pk_; ObStorageLogType log_type_; int64_t log_submit_timestamp_; @@ -418,7 +418,7 @@ struct ObReplayLogTaskEx { }; struct ObReplayErrInfo { - public: +public: ObReplayErrInfo() { reset(); @@ -442,20 +442,20 @@ struct ObReplayErrInfo { } TO_STRING_KV(K(task_info_), K(err_ts_), K(err_ret_)); - public: +public: ObReplayTaskInfo task_info_; int64_t err_ts_; // the timestamp that partition encounts fatal error int err_ret_; // the ret code of fatal error }; class ObReplayStatus { - public: +public: typedef common::SpinRWLock RWLock; typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; typedef common::ObSpinLockGuard SpinLockGuard; struct CheckCanReplayResult { - public: + public: CheckCanReplayResult(common::ObPartitionKey pkey, ObReplayTaskInfo& task_info); CheckCanReplayResult() { @@ -470,7 +470,7 @@ class ObReplayStatus { TO_STRING_KV(K(ret_code_), K(is_out_of_memstore_mem_), K(has_barrier_), K(is_pre_barrier_), K(need_wait_schema_refresh_), K(pkey_), K(task_info_)); - public: + public: int ret_code_; bool is_out_of_memstore_mem_; bool has_barrier_; @@ -480,13 +480,13 @@ class ObReplayStatus { ObReplayTaskInfo task_info_; }; - public: +public: ObReplayStatus(); ~ObReplayStatus(); int init(const uint64_t tenant_id, replayengine::ObILogReplayEngine* rp_eg_, SafeRef2& safe_ref); void destroy(); - public: +public: void reuse(); void reset(); @@ -532,15 +532,10 @@ class ObReplayStatus { { return submit_log_task_.get_pending_submit_task_count(); } - int check_and_submit_task(const common::ObPartitionKey &pkey, - const uint64_t log_id, - const int64_t log_ts, - const bool need_replay, - const clog::ObLogType log_type, - const int64_t next_replay_log_ts); - int submit_restore_task(const common::ObPartitionKey &pkey, const uint64_t log_id, - const int64_t log_ts); - int push_task(ObReplayLogTask &task, uint64_t task_sign); + int check_and_submit_task(const common::ObPartitionKey& pkey, const uint64_t log_id, const int64_t log_ts, + const bool need_replay, const clog::ObLogType log_type, const int64_t next_replay_log_ts); + int submit_restore_task(const common::ObPartitionKey& pkey, const uint64_t log_id, const int64_t log_ts); + int push_task(ObReplayLogTask& task, uint64_t task_sign); void add_task(ObReplayLogTask& task); void remove_task(ObReplayLogTask& task); void dec_task_count(const common::ObPartitionKey& pkey); @@ -719,7 +714,7 @@ class ObReplayStatus { K(total_submitted_task_num_), K(total_replayed_task_num_), K(is_enabled_), K(is_pending_), K(can_receive_log_), K(offline_partition_log_id_), K(offline_partition_task_submitted_), K(submit_log_task_)); - private: +private: int check_barrier_(const ObStorageLogType log_type, const common::ObPartitionKey& pkey); void check_eagain_too_many_(const ObReplayStatus::CheckCanReplayResult& result); @@ -737,7 +732,7 @@ class ObReplayStatus { int push_(ObReplayLogTask& task, uint64_t task_sign); bool is_tenant_out_of_memory_() const; - private: +private: static const int64_t PENDING_COUNT_THRESHOLD = 100; static const int64_t EAGAIN_COUNT_THRESHOLD = 50000; static const int64_t EAGAIN_INTERVAL_NORMAL_THRESHOLD = 10 * 1000 * 1000LL; // 10s for normal retry diff --git a/src/storage/ob_reserved_data_mgr.h b/src/storage/ob_reserved_data_mgr.h index 6f0764286..f47d1765c 100644 --- a/src/storage/ob_reserved_data_mgr.h +++ b/src/storage/ob_reserved_data_mgr.h @@ -27,7 +27,7 @@ class ObPGSSTableMgr; class ObRecoveryPointInfo; class ObRecoveryTableData { - public: +public: static const int64_t OB_RECOVERY_TABLE_DATA_VERSION = 1; ObRecoveryTableData(); virtual ~ObRecoveryTableData(); @@ -47,7 +47,7 @@ class ObRecoveryTableData { TO_STRING_KV(K(tables_.count())); OB_UNIS_VERSION(OB_RECOVERY_TABLE_DATA_VERSION); - private: +private: // members won't be serialized bool is_inited_; common::ObFixedArray tables_; @@ -57,7 +57,7 @@ class ObRecoveryTableData { }; class ObRecoveryPointData : public ObDLinkBase { - public: +public: typedef common::ObSEArray TableKeyArray; static const int64_t OB_RECOVERY_POINT_DATA_VERSION = 1; static const int64_t MAX_TABLE_CNT_IN_BUCKET = 10; @@ -113,7 +113,7 @@ class ObRecoveryPointData : public ObDLinkBase { DECLARE_VIRTUAL_TO_STRING; - private: +private: int add_table_(const int64_t table_id, const TableKeyArray& table_keys, const ObTablesHandle& tables_handle); void clear_table_map_(); void clear_table_keys_map_(); @@ -124,7 +124,7 @@ class ObRecoveryPointData : public ObDLinkBase { } void free_table_data_(ObRecoveryTableData* table_data); - private: +private: // members won't be serialized bool is_inited_; common::hash::ObHashMap table_map_; @@ -142,7 +142,7 @@ class ObRecoveryPointData : public ObDLinkBase { // WARNING: not thread safe, must be protected class ObRecoveryData { - public: +public: ObRecoveryData(); virtual ~ObRecoveryData(); void destroy(); @@ -193,7 +193,7 @@ class ObRecoveryData { int remove_recovery_points(const ObIArray& point_list); DECLARE_VIRTUAL_TO_STRING; - private: +private: static const int64_t OB_RECOVERY_DATA_VERSION = 1; ObPartitionKey pg_key_; ObDList recover_point_list_; @@ -209,7 +209,7 @@ enum ObRecoveryPointType { BACKUP = 2, }; class ObRecoveryDataMgr { - public: +public: struct SerializePair { SerializePair(char* buf, int64_t size) : buf_(buf), size_(size) {} @@ -267,7 +267,7 @@ class ObRecoveryDataMgr { TO_STRING_KV(K_(pg_key), K_(restore_point_data), K_(backup_point_data)); - private: +private: int add_recovery_point_(const ObRecoveryPointType point_type, const int64_t snapshot_version, const ObPartitionGroupMeta& pg_meta, const ObIArray& partition_store_metas, const ObTablesHandle& tables_handle, ObRecoveryData& recovery_data); @@ -280,7 +280,7 @@ class ObRecoveryDataMgr { int replay_add_backup_point_(const ObRecoveryPointData& point_data); int replay_remove_backup_point_(const int64_t replay_log_ts); - private: +private: static const int64_t OLD_MAGIC_NUM = -0xABCD; static const int64_t MAGIC_NUM = -0xABCE; static const int64_t OB_RECOVERY_DATA_MGR_VERSION = 1; @@ -300,7 +300,7 @@ class ObRecoveryDataMgr { }; class ObRecoveryPointInfo { - public: +public: ObRecoveryPointInfo() : type_(ObRecoveryPointType::UNKNOWN_TYPE), tables_handle_(), snapshot_version_(0) {} virtual ~ObRecoveryPointInfo() @@ -326,14 +326,14 @@ class ObRecoveryPointInfo { int assign(const ObRecoveryPointInfo& other); TO_STRING_KV(K_(type), K(tables_handle_.get_count()), K_(snapshot_version)); - private: +private: ObRecoveryPointType type_; ObTablesHandle tables_handle_; int64_t snapshot_version_; }; // Iterate all the recovery points in one PG class ObIRecoveryPointIterator { - public: +public: ObIRecoveryPointIterator() {} virtual ~ObIRecoveryPointIterator() @@ -342,7 +342,7 @@ class ObIRecoveryPointIterator { }; class ObRecoveryPointIterator : public ObIRecoveryPointIterator { - public: +public: ObRecoveryPointIterator() : points_info_(), array_idx_(0), data_mgr_(NULL) {} virtual ~ObRecoveryPointIterator() @@ -362,7 +362,7 @@ class ObRecoveryPointIterator : public ObIRecoveryPointIterator { return data_mgr_ != NULL; } - private: +private: common::ObArray points_info_; int64_t array_idx_; ObRecoveryDataMgr* data_mgr_; diff --git a/src/storage/ob_resource_map.h b/src/storage/ob_resource_map.h index 700128cea..7e1cd23a3 100644 --- a/src/storage/ob_resource_map.h +++ b/src/storage/ob_resource_map.h @@ -31,7 +31,7 @@ class ObResourceMap; template class ObResourceValueStore { - public: +public: ObResourceValueStore(); virtual ~ObResourceValueStore(); virtual int inc_ref_cnt(); @@ -46,7 +46,7 @@ class ObResourceValueStore { ptr_ = ptr; } - private: +private: Value* ptr_; int64_t ref_cnt_; }; @@ -94,7 +94,7 @@ class ObResourceHandle { template friend class oceanbase::storage::ObResourceMap; - public: +public: ObResourceHandle() : ptr_(NULL) {} virtual ~ObResourceHandle() @@ -105,14 +105,14 @@ class ObResourceHandle { } virtual void reset() = 0; - protected: +protected: DISALLOW_COPY_AND_ASSIGN(ObResourceHandle); ObResourceValueStore* ptr_; }; template class ObResourceDefaultCallback { - public: +public: ObResourceDefaultCallback(){}; virtual ~ObResourceDefaultCallback() {} @@ -125,12 +125,12 @@ class ObResourceDefaultCallback { template class ObForeachCallbackAdaptor { - public: +public: ObForeachCallbackAdaptor(Callback& callback); virtual ~ObForeachCallbackAdaptor(); int operator()(common::hash::HashMapPair*>& pair); - private: +private: Callback& callback_; }; @@ -154,7 +154,7 @@ int ObForeachCallbackAdaptor::operator()( template class ObResourceMap { - public: +public: explicit ObResourceMap(); virtual ~ObResourceMap(); int init(const int64_t bucket_num, const char* label, const int64_t total_limit, const int64_t hold_limit, @@ -174,11 +174,11 @@ class ObResourceMap { return allocator_; } - private: +private: int inc_handle_ref(ObResourceValueStore* ptr); void free_resource(ObResourceValueStore* ptr); - private: +private: typedef ObResourceValueStore ValueStore; typedef common::hash::ObHashMap MAP; MAP map_; diff --git a/src/storage/ob_row_fuse.h b/src/storage/ob_row_fuse.h index 39d847782..9b5f2b4a9 100644 --- a/src/storage/ob_row_fuse.h +++ b/src/storage/ob_row_fuse.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class ObNopPos { - public: +public: ObNopPos() : allocator_(NULL), capacity_(0), count_(0), nops_(NULL) {} ~ObNopPos() @@ -49,7 +49,7 @@ class ObNopPos { int set_count(const int64_t count); int set_nop_pos(const int64_t idx, const int64_t pos); - public: +public: common::ObIAllocator* allocator_; int64_t capacity_; int64_t count_; @@ -57,7 +57,7 @@ class ObNopPos { }; class ObObjShallowCopy { - public: +public: OB_INLINE int operator()(const common::ObObj& src_obj, common::ObObj& dst_obj) { dst_obj = src_obj; @@ -66,7 +66,7 @@ class ObObjShallowCopy { }; class ObObjDeepCopy { - public: +public: ObObjDeepCopy(common::ObArenaAllocator& allocator) : allocator_(allocator) {} OB_INLINE int operator()(const common::ObObj& src_obj, common::ObObj& dst_obj) @@ -74,12 +74,12 @@ class ObObjDeepCopy { return common::deep_copy_obj(allocator_, src_obj, dst_obj); } - private: +private: common::ObArenaAllocator& allocator_; }; class ObRowFuse { - public: +public: // // fuse multiple versions rows // @param [in] former, the row with smaller version diff --git a/src/storage/ob_row_sample_iterator.h b/src/storage/ob_row_sample_iterator.h index 48847c525..a856a4201 100644 --- a/src/storage/ob_row_sample_iterator.h +++ b/src/storage/ob_row_sample_iterator.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { class ObRowSampleIterator : public ObISampleIterator { - public: +public: explicit ObRowSampleIterator(const common::SampleInfo& sample_info); virtual ~ObRowSampleIterator(); int open(ObQueryRowIterator& iterator); @@ -28,7 +28,7 @@ class ObRowSampleIterator : public ObISampleIterator { virtual int get_next_row(ObStoreRow*& row) override; virtual void reset() override; - private: +private: ObQueryRowIterator* iterator_; int64_t row_num_; }; diff --git a/src/storage/ob_safe_ref.h b/src/storage/ob_safe_ref.h index 675ce569e..2adfd336a 100644 --- a/src/storage/ob_safe_ref.h +++ b/src/storage/ob_safe_ref.h @@ -53,7 +53,7 @@ struct SafeRef2 { }; class SafeRefAlloc { - public: +public: typedef common::ObLinkQueue FreeList; SafeRef* alloc() { @@ -74,12 +74,12 @@ class SafeRefAlloc { (void)free_list_.push(p); } - private: +private: FreeList free_list_; }; class ObSafeRefKeeper { - public: +public: typedef SafeRefAlloc Alloc; ObSafeRefKeeper() {} @@ -130,7 +130,7 @@ class ObSafeRefKeeper { } } - private: +private: Alloc alloc_; }; diff --git a/src/storage/ob_saved_storage_info.h b/src/storage/ob_saved_storage_info.h index c3bd3fa54..f8936ed34 100644 --- a/src/storage/ob_saved_storage_info.h +++ b/src/storage/ob_saved_storage_info.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { class ObSavedStorageInfo : public common::ObBaseStorageInfo { - public: +public: ObSavedStorageInfo() : common::ObBaseStorageInfo(), memstore_version_(0), @@ -32,7 +32,7 @@ class ObSavedStorageInfo : public common::ObBaseStorageInfo { virtual ~ObSavedStorageInfo() {} - public: +public: void set_memstore_version(const common::ObVersion& version); const common::ObVersion& get_memstore_version() const; void set_publish_version(const int64_t publish_version); @@ -55,14 +55,14 @@ class ObSavedStorageInfo : public common::ObBaseStorageInfo { "frozen_timestamp", frozen_timestamp_); OB_UNIS_VERSION(1); - private: +private: common::ObVersion memstore_version_; int64_t publish_version_; int64_t schema_version_; common::ObVersion frozen_version_; int64_t frozen_timestamp_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSavedStorageInfo); }; diff --git a/src/storage/ob_saved_storage_info_v2.h b/src/storage/ob_saved_storage_info_v2.h index 3bc442787..f8aec344c 100644 --- a/src/storage/ob_saved_storage_info_v2.h +++ b/src/storage/ob_saved_storage_info_v2.h @@ -27,10 +27,10 @@ namespace storage { class ObSavedStorageInfo; struct ObRecoverPoint { - public: +public: OB_UNIS_VERSION(1); - public: +public: int64_t snapshot_version_; uint64_t recover_log_id_; int64_t checksum_; @@ -74,10 +74,10 @@ struct ObRecoverPoint { }; class ObRecoverVec { - public: +public: OB_UNIS_VERSION(1); - public: +public: static const int64_t OB_RECOVER_ARRAY_COUNT = 16; typedef common::ObSEArray RecoverVec; typedef common::ObSEArray::iterator RecoverIter; @@ -108,17 +108,17 @@ class ObRecoverVec { } TO_STRING_KV(K(recover_vec_)); - private: +private: int record_major_recover_point_(const int64_t prev_version, const int64_t version); int add_recover_point_(const ObRecoverPoint& point); - private: +private: common::ObSpinLock lock_; RecoverVec recover_vec_; }; class ObSavedStorageInfoV2 { - public: +public: ObSavedStorageInfoV2() : version_(STORAGE_INFO_VERSION_V3), clog_info_(), data_info_(), pg_file_id_(common::OB_INVALID_DATA_FILE_ID) {} @@ -160,14 +160,14 @@ class ObSavedStorageInfoV2 { TO_STRING_KV("clog_info", clog_info_, "data_info", data_info_, K_(pg_file_id)); OB_UNIS_VERSION(1); - private: +private: int query_log_info_with_log_id(const common::ObPartitionKey& pkey, const int64_t log_id, const int64_t timeout, int64_t& accum_checksum, int64_t& submit_timestamp, int64_t& epoch_id); int update_last_replay_log_info_(const common::ObPartitionKey& pkey, const bool replica_with_data, const common::ObBaseStorageInfo& old_clog_info, const int64_t timeout, const bool log_info_usable); int get_last_replay_log_info_(const common::ObPartitionKey& pkey, const int64_t timeout, ObRecoverPoint& point); - private: +private: static const int16_t STORAGE_INFO_VERSION_V1 = 1; static const int16_t STORAGE_INFO_VERSION_V2 = 2; static const int16_t STORAGE_INFO_VERSION_V3 = 3; @@ -180,7 +180,7 @@ class ObSavedStorageInfoV2 { // for ofs mode int64_t pg_file_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSavedStorageInfoV2); }; diff --git a/src/storage/ob_scan_merge_loser_tree.h b/src/storage/ob_scan_merge_loser_tree.h index ed90bda01..f88447794 100644 --- a/src/storage/ob_scan_merge_loser_tree.h +++ b/src/storage/ob_scan_merge_loser_tree.h @@ -36,7 +36,7 @@ struct ObScanMergeLoserTreeItem { }; class ObScanMergeLoserTreeCmp { - public: +public: typedef common::ObFixedArray RowkeyCmpFuncArray; ObScanMergeLoserTreeCmp() : cmp_funcs_(), rowkey_size_(0), error_(common::OB_SUCCESS), reverse_(false), is_inited_(false) @@ -53,7 +53,7 @@ class ObScanMergeLoserTreeCmp { static int compare_rowkey(const ObStoreRow& l_row, const ObStoreRow& r_row, const int64_t& rowkey_size, RowkeyCmpFuncArray& cmp_funcs, int32_t& cmp_result); - private: +private: template int make_rowkey_cmp_funcs(const int64_t rowkey_size, const ObColDescIArray& col_descs, ObIAllocator& allocator); @@ -67,7 +67,7 @@ class ObScanMergeLoserTreeCmp { typedef common::ObLoserTree ObScanMergeLoserTreeBase; class ObScanMergeLoserTree : public ObScanMergeLoserTreeBase { - public: +public: ObScanMergeLoserTree(ObScanMergeLoserTreeCmp& cmp) : ObScanMergeLoserTreeBase(cmp), has_king_(false), is_king_eq_champion_(false), king_() {} @@ -100,11 +100,11 @@ class ObScanMergeLoserTree : public ObScanMergeLoserTreeBase { return has_king_ ? !is_king_eq_champion_ : is_unique_champion_; } - protected: +protected: virtual int duel(ObScanMergeLoserTreeItem& offender, ObScanMergeLoserTreeItem& defender, const int64_t match_idx, bool& is_offender_win) override; - private: +private: // optimization for only the top item get pop. Usually, the next row from same iter will still be // the max/min row. So it can be cached in king_ without rebuilding the whole tree bool has_king_; diff --git a/src/storage/ob_server_checkpoint_log_reader.h b/src/storage/ob_server_checkpoint_log_reader.h index c3214f673..104ad91ce 100644 --- a/src/storage/ob_server_checkpoint_log_reader.h +++ b/src/storage/ob_server_checkpoint_log_reader.h @@ -21,12 +21,12 @@ namespace oceanbase { namespace storage { class ObServerCheckpointLogReader final { - public: +public: ObServerCheckpointLogReader(); ~ObServerCheckpointLogReader() = default; int read_checkpoint_and_replay_log(); - private: +private: int get_replay_start_point(const common::ObLogCursor& org_log_cursor, common::ObLogCursor& replay_start_cursor); int read_tenant_file_super_block_checkpoint(const blocksstable::ObSuperBlockMetaEntry& meta_entry); int replay_server_slog(const common::ObLogCursor& replay_start_cursor, @@ -37,20 +37,20 @@ class ObServerCheckpointLogReader final { blocksstable::ObStorageLogCommittedTransGetter& committed_trans_getter); int set_meta_block_list(); - private: +private: ObServerPGMetaCheckpointReader pg_meta_reader_; ObTenantFileSuperBlockCheckpointReader tenant_file_reader_; ObTenantConfigMetaCheckpointReader tenant_config_meta_reader_; }; class ObServerPGMetaSLogFilter : public blocksstable::ObISLogFilter { - public: +public: ObServerPGMetaSLogFilter() : cmd_filter_(), file_filter_() {} virtual ~ObServerPGMetaSLogFilter() = default; virtual int filter(const ObISLogFilter::Param& param, bool& is_filtered) const override; - private: +private: blocksstable::ObNotReplaySuperBlockAndConfigMetaSLogFilter cmd_filter_; ObTenantFileSLogFilter file_filter_; }; diff --git a/src/storage/ob_server_checkpoint_log_reader_v1.h b/src/storage/ob_server_checkpoint_log_reader_v1.h index d93f4b2f9..d9da737e5 100644 --- a/src/storage/ob_server_checkpoint_log_reader_v1.h +++ b/src/storage/ob_server_checkpoint_log_reader_v1.h @@ -23,13 +23,13 @@ class ObLogCursor; namespace storage { class ObServerCheckpointLogReaderV1 final { - public: +public: ObServerCheckpointLogReaderV1() = default; ~ObServerCheckpointLogReaderV1() = default; int read_checkpoint_and_replay_log( blocksstable::ObSuperBlockV2& super_block, common::ObIArray& meta_block_list); - private: +private: int read_checkpoint(blocksstable::ObSuperBlockV2& super_block, common::ObLogCursor& cursor, common::ObIArray& meta_block_list); int set_replay_log_seq_num(blocksstable::ObSuperBlockV2& super_block); diff --git a/src/storage/ob_server_checkpoint_writer.h b/src/storage/ob_server_checkpoint_writer.h index 25febfe10..bb470d01b 100644 --- a/src/storage/ob_server_checkpoint_writer.h +++ b/src/storage/ob_server_checkpoint_writer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class ObServerCheckpointWriter final { - public: +public: static ObServerCheckpointWriter& get_instance(); int init(); int write_checkpoint(const common::ObLogCursor& checkpoint); @@ -30,12 +30,12 @@ class ObServerCheckpointWriter final { int get_meta_block_list(common::ObIArray& meta_block_list); void reset(); - private: +private: ObServerCheckpointWriter(); ~ObServerCheckpointWriter() = default; int update_tenant_file_super_block(common::hash::ObHashMap& hash_map); - private: +private: static const int64_t MAX_SERVER_META_MACRO_CNT = 10L; static const int64_t FILE_CNT_PER_SERVER = 10000L; ObServerPGMetaCheckpointWriter meta_writer_; diff --git a/src/storage/ob_server_log.h b/src/storage/ob_server_log.h index 567748399..33f3f190f 100644 --- a/src/storage/ob_server_log.h +++ b/src/storage/ob_server_log.h @@ -27,7 +27,7 @@ enum ObServerRedoLogSubcmd { }; struct ObUpdateTenantFileSuperBlockLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t UPDATE_TENANT_FILE_SUPER_BLOCK_VERSION = 1; ObUpdateTenantFileSuperBlockLogEntry(); virtual ~ObUpdateTenantFileSuperBlockLogEntry() = default; @@ -42,7 +42,7 @@ struct ObUpdateTenantFileSuperBlockLogEntry : public blocksstable::ObIBaseStorag }; struct ObRemoveTenantFileSuperBlockLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t REMOVE_TENANT_FILE_SUPER_BLOCK_VERSION = 1; ObRemoveTenantFileSuperBlockLogEntry() : key_(), delete_file_(false) {} @@ -61,7 +61,7 @@ struct ObRemoveTenantFileSuperBlockLogEntry : public blocksstable::ObIBaseStorag }; struct ObAddPGToTenantFileLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t ADD_PG_TO_TENANT_FILE_VERSION = 1; ObAddPGToTenantFileLogEntry() : file_key_(), pg_key_() {} @@ -80,7 +80,7 @@ struct ObAddPGToTenantFileLogEntry : public blocksstable::ObIBaseStorageLogEntry }; struct ObRemovePGFromTenantFileLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t REMOVE_PG_FROM_TENANT_FILE_VERSION = 1; ObRemovePGFromTenantFileLogEntry() : file_key_(), pg_key_() {} @@ -99,7 +99,7 @@ struct ObRemovePGFromTenantFileLogEntry : public blocksstable::ObIBaseStorageLog }; struct ObUpdateTenantFileInfoLogEntry : public blocksstable::ObIBaseStorageLogEntry { - public: +public: static const int64_t UPDATE_TENANT_FILE_INFO_VERSION = 1; ObUpdateTenantFileInfoLogEntry() : file_info_() {} diff --git a/src/storage/ob_server_pg_meta_checkpoint_reader.h b/src/storage/ob_server_pg_meta_checkpoint_reader.h index 641689108..17aebe1a2 100644 --- a/src/storage/ob_server_pg_meta_checkpoint_reader.h +++ b/src/storage/ob_server_pg_meta_checkpoint_reader.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { class ObServerPGMetaCheckpointReader final { - public: +public: ObServerPGMetaCheckpointReader(); ~ObServerPGMetaCheckpointReader() = default; int read_checkpoint(ObBaseFileMgr& file_mgr, ObPartitionMetaRedoModule& pg_mgr); diff --git a/src/storage/ob_server_pg_meta_checkpoint_writer.h b/src/storage/ob_server_pg_meta_checkpoint_writer.h index 5ef8c7a30..47ebbd26c 100644 --- a/src/storage/ob_server_pg_meta_checkpoint_writer.h +++ b/src/storage/ob_server_pg_meta_checkpoint_writer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { struct ObPGTenantFileComparator final { - public: +public: ObPGTenantFileComparator(int& ret) : ret_(ret) {} ~ObPGTenantFileComparator() = default; @@ -30,7 +30,7 @@ struct ObPGTenantFileComparator final { }; class ObServerPGMetaCheckpointWriter final { - public: +public: ObServerPGMetaCheckpointWriter(); ~ObServerPGMetaCheckpointWriter() = default; int init(ObPartitionMetaRedoModule& partition_meta_service, ObBaseFileMgr& server_file_mgr, @@ -42,10 +42,10 @@ class ObServerPGMetaCheckpointWriter final { return file_checkpoint_map_; } - private: +private: int write_tenant_file_checkpoint(const ObTenantFileKey& file_key, common::ObIArray& pg_array); - private: +private: static const int64_t MAX_FILE_CNT_PER_SERVER = 10000L; ObPartitionMetaRedoModule* partition_meta_mgr_; ObBaseFileMgr* server_file_mgr_; diff --git a/src/storage/ob_single_merge.h b/src/storage/ob_single_merge.h index 404da55de..0934495ff 100644 --- a/src/storage/ob_single_merge.h +++ b/src/storage/ob_single_merge.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { class ObSingleMerge : public ObMultipleMerge { - public: +public: ObSingleMerge(); virtual ~ObSingleMerge(); int open(const common::ObExtStoreRowkey& rowkey); @@ -29,22 +29,22 @@ class ObSingleMerge : public ObMultipleMerge { static int estimate_row_count(const common::ObQueryFlag query_flag, const uint64_t table_id, const common::ObExtStoreRowkey& rowkey, const common::ObIArray& stores, ObPartitionEst& part_estimate); - protected: +protected: virtual int calc_scan_range() override; virtual int construct_iters() override; virtual int is_range_valid() const override; virtual int inner_get_next_row(ObStoreRow& row); virtual void collect_merge_stat(ObTableStoreStat& stat) const override; - private: +private: virtual int get_table_row(const int64_t table_idx, const ObIArray& tables, const ObStoreRow*& prow, ObStoreRow& fuse_row, bool& final_result, int64_t& sstable_end_log_ts, bool& stop_reading); - private: +private: const common::ObExtStoreRowkey* rowkey_; blocksstable::ObFuseRowValueHandle handle_; - private: +private: static const int64_t SINGLE_GET_FUSE_ROW_CACHE_PUT_COUNT_THRESHOLD = 50; ObFuseRowCacheFetcher fuse_row_cache_fetcher_; // disallow copy diff --git a/src/storage/ob_slog_writer_queue_thread.h b/src/storage/ob_slog_writer_queue_thread.h index 804880751..098188196 100644 --- a/src/storage/ob_slog_writer_queue_thread.h +++ b/src/storage/ob_slog_writer_queue_thread.h @@ -25,7 +25,7 @@ namespace storage { class ObPartitionService; class ObMsInfoTask { - public: +public: ObMsInfoTask() : pkey_(), server_(), @@ -112,7 +112,7 @@ class ObMsInfoTask { ms_log_id_, "mc_timestamp", mc_timestamp_, "replica_num", replica_num_, "prev_member_list", prev_member_list_, "curr_member_list", curr_member_list_, "ms_proposal_id", ms_proposal_id_); - private: +private: common::ObPartitionKey pkey_; common::ObAddr server_; int64_t cluster_id_; @@ -126,13 +126,13 @@ class ObMsInfoTask { }; class ObSlogWriterQueueThread : public lib::TGTaskHandler { - public: +public: static const int64_t QUEUE_THREAD_NUM = 4; static const int64_t MINI_MODE_QUEUE_THREAD_NUM = 2; ObSlogWriterQueueThread(); virtual ~ObSlogWriterQueueThread(); - public: +public: virtual int init(ObPartitionService* partition_service, int tg_id); virtual int push(const ObMsInfoTask* task); virtual void handle(void* task); @@ -142,18 +142,18 @@ class ObSlogWriterQueueThread : public lib::TGTaskHandler { return tg_id_; } - private: +private: int get_task(ObMsInfoTask*& task); void free_task(ObMsInfoTask* task); - private: +private: bool inited_; ObPartitionService* partition_service_; common::ObFixedQueue free_queue_; ObMsInfoTask* tasks_; int tg_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSlogWriterQueueThread); }; diff --git a/src/storage/ob_sstable.h b/src/storage/ob_sstable.h index 49e348c02..5566c76fa 100644 --- a/src/storage/ob_sstable.h +++ b/src/storage/ob_sstable.h @@ -64,7 +64,7 @@ class ObPartitionMetaRedoModule; class ObSSTableV1; class ObSSTable : public ObITable { - public: +public: static const int64_t DEFAULT_MACRO_BLOCK_NUM = 4; static const int64_t DEFAULT_ALLOCATOR_BLOCK_SIZE = 512; static const int64_t DEFAULT_MACRO_BLOCK_ARRAY_PAGE_SIZE = @@ -77,9 +77,9 @@ class ObSSTable : public ObITable { typedef common::ObSEArray MacroBlockArray; typedef common::hash::ObCuckooHashMap LogicBlockIdMap; - public: +public: class ObSSTableGroupMacroBlocks { - public: + public: ObSSTableGroupMacroBlocks(const MacroBlockArray& data_macro_blocks, const MacroBlockArray& lob_macro_blocks); ~ObSSTableGroupMacroBlocks(); OB_INLINE int64_t data_macro_block_count() const @@ -98,16 +98,16 @@ class ObSSTable : public ObITable { int at(const int64_t idx, blocksstable::MacroBlockId& block_id) const; virtual int64_t to_string(char* buf, int64_t buf_len) const; - private: + private: ObSSTableGroupMacroBlocks(); DISALLOW_COPY_AND_ASSIGN(ObSSTableGroupMacroBlocks); - private: + private: const MacroBlockArray& data_macro_blocks_; const MacroBlockArray& lob_macro_blocks_; }; - public: +public: ObSSTable(); virtual ~ObSSTable(); @@ -271,35 +271,40 @@ class ObSSTable : public ObITable { int get_range( const int64_t idx, const int64_t concurrent_cnt, common::ObIAllocator& allocator, common::ObExtStoreRange& range); - int get_concurrent_cnt(int64_t tablet_size, int64_t &concurrent_cnt); - int query_range_to_macros(common::ObIAllocator &allocator, - const common::ObIArray &ranges, - const int64_t type, - uint64_t *macros_count, - const int64_t *total_task_count, - common::ObIArray *splitted_ranges, - common::ObIArray *split_index); - int exist(const ObStoreCtx &ctx, - const uint64_t table_id, - const common::ObStoreRowkey &rowkey, - const common::ObIArray &column_ids, - bool &is_exist, - bool &has_found) override; - virtual int prefix_exist( - storage::ObRowsInfo &rows_info, - bool &may_exist) override; - int exist( - ObRowsInfo &rows_info, - bool &is_exist, - bool &all_rows_found) override; - int64_t get_occupy_size() const { return meta_.occupy_size_; } - int64_t get_total_row_count() const { return meta_.row_count_; } - int64_t get_macro_block_count() const { return meta_.macro_block_count_; } - inline uint64_t get_table_id() const {return meta_.index_id_; } - inline int64_t get_rowkey_column_count() const { return meta_.rowkey_column_count_; } - OB_INLINE int64_t get_logical_data_version() const { return meta_.logical_data_version_; } - int get_table_stat(common::ObTableStat &stat); - virtual int get_frozen_schema_version(int64_t &schema_version) const override; + int get_concurrent_cnt(int64_t tablet_size, int64_t& concurrent_cnt); + int query_range_to_macros(common::ObIAllocator& allocator, const common::ObIArray& ranges, + const int64_t type, uint64_t* macros_count, const int64_t* total_task_count, + common::ObIArray* splitted_ranges, common::ObIArray* split_index); + int exist(const ObStoreCtx& ctx, const uint64_t table_id, const common::ObStoreRowkey& rowkey, + const common::ObIArray& column_ids, bool& is_exist, bool& has_found) override; + virtual int prefix_exist(storage::ObRowsInfo& rows_info, bool& may_exist) override; + int exist(ObRowsInfo& rows_info, bool& is_exist, bool& all_rows_found) override; + int64_t get_occupy_size() const + { + return meta_.occupy_size_; + } + int64_t get_total_row_count() const + { + return meta_.row_count_; + } + int64_t get_macro_block_count() const + { + return meta_.macro_block_count_; + } + inline uint64_t get_table_id() const + { + return meta_.index_id_; + } + inline int64_t get_rowkey_column_count() const + { + return meta_.rowkey_column_count_; + } + OB_INLINE int64_t get_logical_data_version() const + { + return meta_.logical_data_version_; + } + int get_table_stat(common::ObTableStat& stat); + virtual int get_frozen_schema_version(int64_t& schema_version) const override; int fill_old_meta_info( const int64_t schema_version, const int64_t step_merge_start_version, const int64_t step_merge_end_version); virtual int bf_may_contain_rowkey(const common::ObStoreRowkey& rowkey, bool& contain); @@ -349,7 +354,7 @@ class ObSSTable : public ObITable { INHERIT_TO_STRING_KV( "ObITable", ObITable, KP(this), K_(status), K_(meta), K_(file_handle), K_(dump_memtable_timestamp)); - private: +private: int read_second_index(const MacroBlockArray& indexes, MacroBlockArray& blocks, const int64_t block_cnt); int sort_ranges( const common::ObIArray& ranges, common::ObIArray& ordered_ranges); @@ -391,7 +396,7 @@ class ObSSTable : public ObITable { int64_t get_schema_map_serialize_size() const; int add_macro_ref(); - private: +private: void set_multi_version_rowkey_type(const ObMultiVersionRowkeyHelpper::MultiVersionRowkeyType rowkey_type) { if (is_multi_version_table()) { @@ -401,7 +406,7 @@ class ObSSTable : public ObITable { } } - private: +private: static const int64_t DDL_VERSION_COUNT = 16; friend class ObMacroBlockIterator; common::ObArenaAllocator allocator_; diff --git a/src/storage/ob_sstable_dump_error_info.h b/src/storage/ob_sstable_dump_error_info.h index 051c41c1d..2409f6dc9 100644 --- a/src/storage/ob_sstable_dump_error_info.h +++ b/src/storage/ob_sstable_dump_error_info.h @@ -21,7 +21,7 @@ using namespace share::schema; namespace storage { class ObSSTableDumpErrorInfo { - public: +public: ObSSTableDumpErrorInfo() : param_(), context_(), @@ -41,10 +41,10 @@ class ObSSTableDumpErrorInfo { void reset(); void destory(); - private: +private: static const int64_t COL_ARRAY_LEN = 128; - private: +private: int find_extra_row( ObSSTable& sstable1, const ObTableSchema& schema1, ObSSTable& sstable2, const ObTableSchema& schema2); OB_INLINE int transform_rowkey( @@ -57,7 +57,7 @@ class ObSSTableDumpErrorInfo { common::ObSEArray& projector, int64_t& found_row_cnt); int prepare_sstable_query_param(ObSSTable& sstable, const ObTableSchema& schema); - private: +private: ObObj rowkey_obj_[OB_MAX_ROWKEY_COLUMN_NUMBER]; ObTableIterParam param_; ObTableAccessContext context_; diff --git a/src/storage/ob_sstable_estimator.h b/src/storage/ob_sstable_estimator.h index eedb094db..57d9d557a 100644 --- a/src/storage/ob_sstable_estimator.h +++ b/src/storage/ob_sstable_estimator.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { struct ObSSTableEstimateContext { - public: +public: ObSSTableEstimateContext(); ~ObSSTableEstimateContext(); void reset(); @@ -40,7 +40,7 @@ struct ObSSTableEstimateContext { }; class ObISSTableEstimator { - public: +public: explicit ObISSTableEstimator() {} virtual ~ObISSTableEstimator() @@ -58,7 +58,7 @@ class ObISSTableEstimator { } virtual int estimate_row_count(ObPartitionEst& part_est) = 0; - protected: +protected: void reset() { context_.reset(); @@ -74,12 +74,12 @@ class ObISSTableEstimator { static int get_rowkey_column_desc( const blocksstable::ObFullMacroBlockMeta& meta, common::ObIArray& columns); - protected: +protected: ObSSTableEstimateContext context_; }; class ObISSTableEstimatorWrapper { - public: +public: explicit ObISSTableEstimatorWrapper() : estimator_(NULL) {} virtual ~ObISSTableEstimatorWrapper() @@ -121,16 +121,16 @@ class ObISSTableEstimatorWrapper { return ret; } - protected: +protected: virtual int alloc_estimator(const ObSSTable& sstable) = 0; - protected: +protected: common::ObArenaAllocator allocator_; ObISSTableEstimator* estimator_; }; class ObStoreRowMultiGetEstimator : public ObISSTableEstimator { - public: +public: ObStoreRowMultiGetEstimator(); virtual ~ObStoreRowMultiGetEstimator(); virtual int set_context(ObSSTableEstimateContext& context) override; @@ -138,7 +138,7 @@ class ObStoreRowMultiGetEstimator : public ObISSTableEstimator { }; class ObSSTableScanEstimator : public ObISSTableEstimatorWrapper { - public: +public: ObSSTableScanEstimator() {} virtual ~ObSSTableScanEstimator() @@ -147,7 +147,7 @@ class ObSSTableScanEstimator : public ObISSTableEstimatorWrapper { }; class ObStoreRowSingleScanEstimator : public ObISSTableEstimator { - public: +public: ObStoreRowSingleScanEstimator(); virtual ~ObStoreRowSingleScanEstimator(); int set_context(ObSSTableEstimateContext& context); @@ -155,7 +155,7 @@ class ObStoreRowSingleScanEstimator : public ObISSTableEstimator { void reset(); virtual int estimate_row_count(ObPartitionEst& part_est); - private: +private: int estimate_macro_row_count(const blocksstable::ObMacroBlockCtx& macro_block_ctx, const bool is_start_block, const bool is_last_block, ObPartitionEst& part_est); int estimate_border_cost(const common::ObIArray& micro_infos, @@ -168,13 +168,13 @@ class ObStoreRowSingleScanEstimator : public ObISSTableEstimator { const common::ObStoreRowkey& key1, const common::ObStoreRowkey& key2, int64_t& length); static int get_common_rowkey(const common::ObStoreRange& range, common::ObStoreRowkey& rowkey); - private: +private: bool is_empty_scan_; bool is_first_scan_; }; class ObMultiVersionSingleScanEstimator : public ObISSTableEstimator { - public: +public: ObMultiVersionSingleScanEstimator(common::ObArenaAllocator& allocator) : allocator_(allocator) {} virtual ~ObMultiVersionSingleScanEstimator() @@ -184,16 +184,16 @@ class ObMultiVersionSingleScanEstimator : public ObISSTableEstimator { int set_context(ObSSTableEstimateContext& context) override; int estimate_row_count(ObPartitionEst& part_est) override; - private: +private: int estimate_macro_row_count(const blocksstable::ObMacroBlockCtx& macro_block_ctx, const bool is_left_border, const bool is_right_border, ObPartitionEst& part_est, int64_t& gap_size, int64_t& purged_phy_row_count); - private: +private: common::ObArenaAllocator& allocator_; }; class ObStoreRowMultiScanEstimator : public ObISSTableEstimator { - public: +public: ObStoreRowMultiScanEstimator(); virtual ~ObStoreRowMultiScanEstimator(); virtual int estimate_row_count(ObPartitionEst& part_est); diff --git a/src/storage/ob_sstable_garbage_collector.h b/src/storage/ob_sstable_garbage_collector.h index 5b9fafd67..67e2d29d2 100644 --- a/src/storage/ob_sstable_garbage_collector.h +++ b/src/storage/ob_sstable_garbage_collector.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class ObSSTableGarbageCollector : public lib::ThreadPool { - public: +public: ObSSTableGarbageCollector(); virtual ~ObSSTableGarbageCollector(); int init(transaction::ObTransService* trans_service); @@ -29,7 +29,7 @@ class ObSSTableGarbageCollector : public lib::ThreadPool { void destroy(); void run1() override; - private: +private: static const int64_t SSTABLE_GC_INTERVAL = 30 * 1000 * 1000L; transaction::ObTransService* trans_service_; bool is_inited_; diff --git a/src/storage/ob_sstable_merge_info_mgr.h b/src/storage/ob_sstable_merge_info_mgr.h index e403a335a..a832a198f 100644 --- a/src/storage/ob_sstable_merge_info_mgr.h +++ b/src/storage/ob_sstable_merge_info_mgr.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace storage { struct ObSSTableMergeInfoKey { - public: +public: ObSSTableMergeInfoKey() : table_id_(common::OB_INVALID_ID), partition_id_(common::OB_INVALID_ID) {} ObSSTableMergeInfoKey(const int64_t table_id, const int64_t partition_id) @@ -63,7 +63,7 @@ struct ObSSTableMergeInfoValue { }; struct ObTableModificationInfo { - public: +public: ObTableModificationInfo() { reset(); @@ -81,7 +81,7 @@ struct ObTableModificationInfo { TO_STRING_KV(K_(table_id), K_(partition_id), K_(insert_row_count), K_(update_row_count), K_(delete_row_count), K_(max_snapshot_version)); - public: +public: uint64_t table_id_; int64_t partition_id_; int64_t insert_row_count_; @@ -91,14 +91,14 @@ struct ObTableModificationInfo { }; class ObSSTableMergeInfoIterator { - public: +public: ObSSTableMergeInfoIterator(); virtual ~ObSSTableMergeInfoIterator(); int open(); int get_next_merge_info(ObSSTableMergeInfo& merge_info); void reset(); - private: +private: int64_t major_info_idx_; int64_t major_info_cnt_; int64_t minor_info_idx_; @@ -107,14 +107,14 @@ class ObSSTableMergeInfoIterator { }; class ObSSTableMergeInfoMgr { - public: +public: int init(const int64_t memory_limit = MERGE_INFO_MEMORY_LIMIT); void destroy(); static ObSSTableMergeInfoMgr& get_instance(); int add_sstable_merge_info(const ObSSTableMergeInfo& merge_info); int get_modification_infos(common::ObIArray& infos); - private: +private: friend class ObSSTableMergeInfoIterator; typedef common::hash::ObHashMap ObSSTableMergeInfoMap; diff --git a/src/storage/ob_sstable_multi_version_row_iterator.h b/src/storage/ob_sstable_multi_version_row_iterator.h index 589e12aae..7ee123b21 100644 --- a/src/storage/ob_sstable_multi_version_row_iterator.h +++ b/src/storage/ob_sstable_multi_version_row_iterator.h @@ -22,13 +22,13 @@ namespace oceanbase { namespace storage { class ObSSTableMultiVersionRowIterator : public ObISSTableRowIterator { - public: +public: ObSSTableMultiVersionRowIterator(); virtual ~ObSSTableMultiVersionRowIterator(); virtual void reset(); virtual void reuse() override; - protected: +protected: virtual int inner_open(const ObTableIterParam& iter_param, ObTableAccessContext& access_ctx, ObITable* table, const void* query_range) = 0; virtual int inner_get_next_row(const ObStoreRow*& row) = 0; @@ -36,7 +36,7 @@ class ObSSTableMultiVersionRowIterator : public ObISSTableRowIterator { int new_iterator(common::ObArenaAllocator& allocator); int get_not_exist_row(const common::ObStoreRowkey& rowkey, const ObStoreRow*& row); - protected: +protected: const ObTableIterParam* iter_param_; ObTableAccessContext* access_ctx_; ObSSTable* sstable_; @@ -56,7 +56,7 @@ class ObSSTableMultiVersionRowIterator : public ObISSTableRowIterator { }; class ObSSTableMultiVersionRowScannerBase : public ObSSTableMultiVersionRowIterator { - public: +public: ObSSTableMultiVersionRowScannerBase() : skip_range_(), trans_version_range_(), gap_rowkey_() {} virtual ~ObSSTableMultiVersionRowScannerBase() @@ -65,14 +65,14 @@ class ObSSTableMultiVersionRowScannerBase : public ObSSTableMultiVersionRowItera virtual void reset(); virtual void reuse() override; - protected: +protected: common::ObExtStoreRange skip_range_; common::ObVersionRange trans_version_range_; common::ObStoreRowkey gap_rowkey_; }; class ObSSTableMultiVersionRowGetter : public ObSSTableMultiVersionRowIterator { - public: +public: ObSSTableMultiVersionRowGetter() {} virtual ~ObSSTableMultiVersionRowGetter() @@ -80,17 +80,17 @@ class ObSSTableMultiVersionRowGetter : public ObSSTableMultiVersionRowIterator { virtual void reset() override; virtual void reuse() override; - protected: +protected: virtual int inner_open(const ObTableIterParam& iter_param, ObTableAccessContext& access_ctx, ObITable* table, const void* query_range) override; virtual int inner_get_next_row(const ObStoreRow*& row) override; - private: +private: common::ObExtStoreRange multi_version_range_; }; class ObSSTableMultiVersionRowScanner : public ObSSTableMultiVersionRowScannerBase { - public: +public: ObSSTableMultiVersionRowScanner() : multi_version_range_() {} virtual ~ObSSTableMultiVersionRowScanner() @@ -100,17 +100,17 @@ class ObSSTableMultiVersionRowScanner : public ObSSTableMultiVersionRowScannerBa virtual int skip_range(int64_t range_idx, const common::ObStoreRowkey* gap_key, const bool include_gap_key) override; virtual int get_gap_end(int64_t& range_idx, const common::ObStoreRowkey*& gap_key, int64_t& gap_size) override; - protected: +protected: virtual int inner_open(const ObTableIterParam& iter_param, ObTableAccessContext& access_ctx, ObITable* table, const void* query_range) override; virtual int inner_get_next_row(const ObStoreRow*& row) override; - private: +private: common::ObExtStoreRange multi_version_range_; }; class ObSSTableMultiVersionRowMultiGetter : public ObSSTableMultiVersionRowIterator { - public: +public: ObSSTableMultiVersionRowMultiGetter() : multi_version_ranges_(), pending_row_(NULL) {} virtual ~ObSSTableMultiVersionRowMultiGetter() @@ -118,18 +118,18 @@ class ObSSTableMultiVersionRowMultiGetter : public ObSSTableMultiVersionRowItera virtual void reset() override; virtual void reuse() override; - protected: +protected: virtual int inner_open(const ObTableIterParam& iter_param, ObTableAccessContext& access_ctx, ObITable* table, const void* query_range) override; virtual int inner_get_next_row(const ObStoreRow*& row) override; - private: +private: common::ObArray multi_version_ranges_; const ObStoreRow* pending_row_; }; class ObSSTableMultiVersionRowMultiScanner : public ObSSTableMultiVersionRowScannerBase { - public: +public: ObSSTableMultiVersionRowMultiScanner() : multi_version_ranges_(), pending_row_(NULL), @@ -144,12 +144,12 @@ class ObSSTableMultiVersionRowMultiScanner : public ObSSTableMultiVersionRowScan virtual int skip_range(int64_t range_idx, const ObStoreRowkey* gap_rowkey, const bool include_gap_key) override; virtual int get_gap_end(int64_t& range_idx, const common::ObStoreRowkey*& gap_key, int64_t& gap_size) override; - protected: +protected: virtual int inner_open(const ObTableIterParam& iter_param, ObTableAccessContext& access_ctx, ObITable* table, const void* query_range) override; virtual int inner_get_next_row(const ObStoreRow*& row) override; - private: +private: common::ObArray multi_version_ranges_; const ObStoreRow* pending_row_; int64_t last_pending_range_idx_; diff --git a/src/storage/ob_sstable_row_exister.h b/src/storage/ob_sstable_row_exister.h index 8e6b8fb23..6d6587d23 100644 --- a/src/storage/ob_sstable_row_exister.h +++ b/src/storage/ob_sstable_row_exister.h @@ -19,14 +19,14 @@ namespace oceanbase { namespace storage { class ObSSTableRowExister : public ObSSTableRowGetter { - public: +public: ObSSTableRowExister(); virtual ~ObSSTableRowExister(); - protected: +protected: virtual int fetch_row(ObSSTableReadHandle& read_handle, const ObStoreRow*& store_row); - private: +private: ObStoreRow store_row_; }; diff --git a/src/storage/ob_sstable_row_getter.h b/src/storage/ob_sstable_row_getter.h index b715d8a6d..dc201c19b 100644 --- a/src/storage/ob_sstable_row_getter.h +++ b/src/storage/ob_sstable_row_getter.h @@ -19,19 +19,19 @@ namespace oceanbase { namespace storage { class ObSSTableRowGetter : public ObSSTableRowIterator { - public: +public: ObSSTableRowGetter(); virtual ~ObSSTableRowGetter(); virtual void reset(); virtual void reuse() override; - protected: +protected: virtual int get_handle_cnt(const void* query_range, int64_t& read_handle_cnt, int64_t& micro_handle_cnt); virtual int prefetch_read_handle(ObSSTableReadHandle& read_handle); virtual int fetch_row(ObSSTableReadHandle& read_handle, const ObStoreRow*& store_row); virtual int get_range_count(const void* query_range, int64_t& range_count) const; - protected: +protected: bool has_prefetched_; }; diff --git a/src/storage/ob_sstable_row_iterator.h b/src/storage/ob_sstable_row_iterator.h index f27a40ecb..362fdadb6 100644 --- a/src/storage/ob_sstable_row_iterator.h +++ b/src/storage/ob_sstable_row_iterator.h @@ -39,7 +39,7 @@ struct ObSSTableRowState { }; struct ObSSTableReadHandle { - public: +public: ObSSTableReadHandle(); virtual ~ObSSTableReadHandle(); void reset(); @@ -51,7 +51,7 @@ struct ObSSTableReadHandle { TO_STRING_KV(K_(is_get), K_(state), K_(range_idx), K_(macro_block_ctx), K_(macro_idx), K_(micro_begin_idx), K_(micro_end_idx), K_(is_left_border), K_(is_right_border)); - public: +public: union { uint16 flag_; struct { @@ -67,10 +67,10 @@ struct ObSSTableReadHandle { blocksstable::ObMacroBlockCtx macro_block_ctx_; blocksstable::ObFullMacroBlockMeta full_meta_; int64_t macro_idx_; // macro idx in range - private: +private: ObMicroBlockIndexHandle index_handle_; - public: +public: int64_t micro_begin_idx_; int64_t micro_end_idx_; union { @@ -82,7 +82,7 @@ struct ObSSTableReadHandle { }; class ObMicroInfoComparor { - public: +public: ObMicroInfoComparor(common::ObIArray& micro_infos) : micro_infos_(micro_infos) {} virtual ~ObMicroInfoComparor() @@ -92,7 +92,7 @@ class ObMicroInfoComparor { return micro_infos_.at(i).offset_ < micro_infos_.at(j).offset_; } - private: +private: common::ObIArray& micro_infos_; }; @@ -107,7 +107,7 @@ struct ObSSTableMicroBlockInfo { }; class ObSSTableMicroBlockInfoCmp { - public: +public: ObSSTableMicroBlockInfoCmp() {} virtual ~ObSSTableMicroBlockInfoCmp() @@ -121,7 +121,7 @@ class ObSSTableMicroBlockInfoCmp { }; class ObSSTableMicroBlockInfoIterator { - public: +public: ObSSTableMicroBlockInfoIterator(); virtual ~ObSSTableMicroBlockInfoIterator(); void reset(); @@ -134,7 +134,7 @@ class ObSSTableMicroBlockInfoIterator { step_ = is_reverse_ ? -1 : 1; } - private: +private: OB_INLINE int64_t get_micro_block_info_count() { return !is_get_ ? micro_block_infos_.count() : (micro_info_.is_valid() ? 1 : 0); @@ -144,7 +144,7 @@ class ObSSTableMicroBlockInfoIterator { return !is_get_ ? micro_block_infos_.at(idx) : micro_info_; } - private: +private: bool is_reverse_; int64_t total_micro_cnt_; int64_t cur_micro_idx_; @@ -158,7 +158,7 @@ class ObSSTableMicroBlockInfoIterator { }; class ObISSTableRowIterator : public ObStoreRowIterator { - public: +public: ObISSTableRowIterator() : sstable_(NULL), lob_allocator_(NULL), @@ -182,7 +182,7 @@ class ObISSTableRowIterator : public ObStoreRowIterator { } virtual int read_lob_columns(const ObStoreRow* store_row); - protected: +protected: virtual int inner_open(const ObTableIterParam& iter_param, ObTableAccessContext& access_ctx, ObITable* table, const void* query_range) = 0; virtual int inner_get_next_row(const ObStoreRow*& store_row) = 0; @@ -190,7 +190,7 @@ class ObISSTableRowIterator : public ObStoreRowIterator { int batch_get_next_row(blocksstable::ObIMicroBlockRowScanner* scanner, const ObStoreRow*& store_row); - protected: +protected: ObSSTable* sstable_; ObIAllocator* lob_allocator_; blocksstable::ObLobDataReader* lob_reader_; @@ -200,7 +200,7 @@ class ObISSTableRowIterator : public ObStoreRowIterator { }; struct ObSSTableSkipRangeCtx { - public: +public: ObSSTableSkipRangeCtx() : range_idx_(-1), macro_idx_(-1), @@ -235,7 +235,7 @@ struct ObSSTableSkipRangeCtx { template class ObSimpleArray { - public: +public: ObSimpleArray() : array_(nullptr), capacity_(0) {} ~ObSimpleArray() @@ -271,7 +271,7 @@ class ObSimpleArray { return array_[i]; } - private: +private: T* array_; int64_t capacity_; }; @@ -316,7 +316,7 @@ class ObSSTableRowIterator : public ObISSTableRowIterator { typedef ObSimpleArray BlockDataHandleArray; typedef ObSimpleArray MicroInfoArray; - public: +public: ObSSTableRowIterator(); virtual ~ObSSTableRowIterator(); virtual void reset(); @@ -336,7 +336,7 @@ class ObSSTableRowIterator : public ObISSTableRowIterator { return is_base_; } - protected: +protected: virtual int inner_open( const ObTableIterParam& access_param, ObTableAccessContext& access_ctx, ObITable* table, const void* query_range); virtual int inner_get_next_row(const ObStoreRow*& store_row); @@ -355,7 +355,7 @@ class ObSSTableRowIterator : public ObISSTableRowIterator { } virtual void set_row_snapshot(ObStoreRow& row); - private: +private: int prefetch(); int prefetch_handle(const int64_t prefetch_handle_cnt); int prefetch_block(const int64_t sstable_micro_cnt); @@ -370,7 +370,7 @@ class ObSSTableRowIterator : public ObISSTableRowIterator { int set_row_scn(const ObStoreRow*& store_row); int check_block_row_lock(ObSSTableReadHandle& read_handle, ObStoreRowLockState& lock_state); - protected: +protected: static const int64_t USE_HANDLE_CACHE_RANGE_COUNT_THRESHOLD = 300; static const int64_t LIMIT_PREFETCH_BLOCK_CACHE_THRESHOLD = 100; static const int64_t DEFAULT_PREFETCH_HANDLE_DEPTH = 4; @@ -395,7 +395,7 @@ class ObSSTableRowIterator : public ObISSTableRowIterator { ObSSTableSkipRangeCtx skip_ctx_; blocksstable::ObStorageFile* storage_file_; - private: +private: bool is_opened_; bool is_base_; blocksstable::ObIMicroBlockCache* block_cache_; diff --git a/src/storage/ob_sstable_row_lock_checker.h b/src/storage/ob_sstable_row_lock_checker.h index f711cb7f2..ad816dfaa 100644 --- a/src/storage/ob_sstable_row_lock_checker.h +++ b/src/storage/ob_sstable_row_lock_checker.h @@ -21,7 +21,7 @@ using namespace transaction; namespace storage { class ObSSTableRowLockChecker : public ObSSTableRowGetter { - public: +public: ObSSTableRowLockChecker(); virtual ~ObSSTableRowLockChecker(); bool is_curr_row_locked() const @@ -37,11 +37,11 @@ class ObSSTableRowLockChecker : public ObSSTableRowGetter { return lock_state_.lock_trans_id_; } - protected: +protected: virtual int fetch_row(ObSSTableReadHandle& read_handle, const ObStoreRow*& store_row); virtual void set_row_snapshot(ObStoreRow& row) override; - private: +private: ObStoreRow store_row_; ObStoreRowLockState lock_state_; }; diff --git a/src/storage/ob_sstable_row_multi_exister.h b/src/storage/ob_sstable_row_multi_exister.h index d4802e245..56ae7a0a9 100644 --- a/src/storage/ob_sstable_row_multi_exister.h +++ b/src/storage/ob_sstable_row_multi_exister.h @@ -19,14 +19,14 @@ namespace oceanbase { namespace storage { class ObSSTableRowMultiExister : public ObSSTableRowMultiGetter { - public: +public: ObSSTableRowMultiExister(); virtual ~ObSSTableRowMultiExister(); - protected: +protected: virtual int fetch_row(ObSSTableReadHandle& read_handle, const ObStoreRow*& store_row); - private: +private: ObStoreRow store_row_; }; diff --git a/src/storage/ob_sstable_row_multi_getter.h b/src/storage/ob_sstable_row_multi_getter.h index 7f113036d..e2cc2a34e 100644 --- a/src/storage/ob_sstable_row_multi_getter.h +++ b/src/storage/ob_sstable_row_multi_getter.h @@ -19,21 +19,21 @@ namespace oceanbase { namespace storage { class ObSSTableRowMultiGetter : public ObSSTableRowGetter { - public: +public: ObSSTableRowMultiGetter(); virtual ~ObSSTableRowMultiGetter(); virtual void reset(); virtual void reuse() override; virtual int skip_range(int64_t range_idx, const common::ObStoreRowkey* gap_key, const bool include_gap_key) override; - protected: +protected: virtual int get_handle_cnt(const void* query_range, int64_t& read_handle_cnt, int64_t& micro_handle_cnt); virtual int prefetch_read_handle(ObSSTableReadHandle& read_handle); virtual int get_range_count(const void* query_range, int64_t& range_count) const; virtual int get_skip_range_ctx( ObSSTableReadHandle& read_handle, const int64_t cur_micro_idx, ObSSTableSkipRangeCtx*& ctx) override; - private: +private: static const int64_t MULTIGET_READ_HANDLE_CNT = 512; static const int64_t MULTIGET_MICRO_HANDLE_CNT = 512; int32_t prefetch_idx_; diff --git a/src/storage/ob_sstable_row_multi_scanner.h b/src/storage/ob_sstable_row_multi_scanner.h index a008ea1e9..d0a90827b 100644 --- a/src/storage/ob_sstable_row_multi_scanner.h +++ b/src/storage/ob_sstable_row_multi_scanner.h @@ -19,20 +19,20 @@ namespace oceanbase { namespace storage { class ObSSTableRowMultiScanner : public ObSSTableRowScanner { - public: +public: ObSSTableRowMultiScanner(); virtual ~ObSSTableRowMultiScanner(); virtual void reset(); virtual void reuse(); virtual int skip_range(int64_t range_idx, const common::ObStoreRowkey* gap_key, const bool include_gap_key) override; - protected: +protected: virtual int get_handle_cnt(const void* query_range, int64_t& read_handle_cnt, int64_t& micro_handle_cnt); virtual int prefetch_read_handle(ObSSTableReadHandle& read_handle); virtual int fetch_row(ObSSTableReadHandle& read_handle, const ObStoreRow*& store_row); virtual int get_range_count(const void* query_range, int64_t& range_count) const; - private: +private: static const int64_t MULTISCAN_READ_HANDLE_CNT = 32; static const int64_t MULTISCAN_MICRO_HANDLE_CNT = 32; bool has_prefetched_; diff --git a/src/storage/ob_sstable_row_scanner.cpp b/src/storage/ob_sstable_row_scanner.cpp index f34c22fd8..8acd10fe0 100644 --- a/src/storage/ob_sstable_row_scanner.cpp +++ b/src/storage/ob_sstable_row_scanner.cpp @@ -275,7 +275,7 @@ int ObSSTableRowScanner::generate_new_range(const int64_t range_idx, const ObSto } struct GapCompare { - public: +public: explicit GapCompare(const bool is_reverse, int& ret, bool* is_equal = NULL) : is_reverse_(is_reverse), ret_(ret), is_equal_(is_equal) {} @@ -302,7 +302,7 @@ struct GapCompare { return bret; } - private: +private: bool is_reverse_; int& ret_; bool* is_equal_; diff --git a/src/storage/ob_sstable_row_scanner.h b/src/storage/ob_sstable_row_scanner.h index b4f0bf6ef..0eabeace1 100644 --- a/src/storage/ob_sstable_row_scanner.h +++ b/src/storage/ob_sstable_row_scanner.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class ObSSTableRowScanner : public ObSSTableRowIterator { - public: +public: ObSSTableRowScanner(); virtual ~ObSSTableRowScanner(); virtual void reset(); @@ -34,7 +34,7 @@ class ObSSTableRowScanner : public ObSSTableRowIterator { int get_gap_end_impl(const ObExtStoreRange& org_range, ObStoreRowkey& gap_key, int64_t& gap_size); int get_row_iter_flag_impl(uint8_t& flag); - protected: +protected: virtual int get_handle_cnt(const void* query_range, int64_t& read_handle_cnt, int64_t& micro_handle_cnt); virtual int prefetch_read_handle(ObSSTableReadHandle& read_handle); virtual int fetch_row(ObSSTableReadHandle& read_handle, const ObStoreRow*& store_row); @@ -45,11 +45,11 @@ class ObSSTableRowScanner : public ObSSTableRowIterator { ObMicroBlockIndexHandle& block_index_handle); virtual int get_range_count(const void* query_range, int64_t& range_count) const; - private: +private: int skip_batch_rows( const int64_t range_idx, const ObStoreRowkey& gap_key, const bool include_gap_key, bool& need_actual_skip); - protected: +protected: static const int64_t SCAN_READ_HANDLE_CNT = 4; static const int64_t SCAN_MICRO_HANDLE_CNT = 32; static const int64_t SCAN_DEFAULT_MACRO_BLOCK_CNT = 2; @@ -57,7 +57,7 @@ class ObSSTableRowScanner : public ObSSTableRowIterator { int64_t prefetch_macro_idx_; int64_t macro_block_cnt_; - private: +private: int64_t prefetch_macro_order_; ObExtStoreRange last_range_; ObExtStoreRange new_range_; diff --git a/src/storage/ob_sstable_row_whole_scanner.h b/src/storage/ob_sstable_row_whole_scanner.h index 571a6f699..5e0058fbc 100644 --- a/src/storage/ob_sstable_row_whole_scanner.h +++ b/src/storage/ob_sstable_row_whole_scanner.h @@ -20,9 +20,9 @@ namespace oceanbase { namespace storage { class ObSSTableRowWholeScanner : public ObISSTableRowIterator { - private: +private: struct MacroScanHandle { - public: + public: MacroScanHandle() : macro_io_handle_(), meta_(), is_left_border_(false), is_right_border_(false) {} ~MacroScanHandle() @@ -38,11 +38,11 @@ class ObSSTableRowWholeScanner : public ObISSTableRowIterator { bool is_left_border_; bool is_right_border_; - private: + private: DISALLOW_COPY_AND_ASSIGN(MacroScanHandle); }; - public: +public: ObSSTableRowWholeScanner() : iter_param_(NULL), access_ctx_(NULL), @@ -61,7 +61,7 @@ class ObSSTableRowWholeScanner : public ObISSTableRowIterator { const common::ObExtStoreRange* query_range, const blocksstable::ObMacroBlockCtx& macro_block_ctx, ObSSTable* sstable); - protected: +protected: virtual int inner_open(const ObTableIterParam& iter_param, ObTableAccessContext& access_ctx, ObITable* table, const void* query_range) override; virtual int inner_get_next_row(const ObStoreRow*& row) override; @@ -69,7 +69,7 @@ class ObSSTableRowWholeScanner : public ObISSTableRowIterator { virtual void reuse() override; virtual const common::ObIArray* get_rowkey_cmp_funcs(); - private: +private: int open_macro_block(); int prefetch(); int open_micro_block(const bool is_first_open); @@ -83,7 +83,7 @@ class ObSSTableRowWholeScanner : public ObISSTableRowIterator { range.get_start_key().get_obj_cnt() == multi_version_rowkey_col_cnt); } - private: +private: static const int64_t DEFAULT_MACRO_BLOCK_CTX = 1024; static const int64_t PREFETCH_DEPTH = 2; diff --git a/src/storage/ob_sstable_rowkey_helper.h b/src/storage/ob_sstable_rowkey_helper.h index 069bedcf1..1e000528f 100644 --- a/src/storage/ob_sstable_rowkey_helper.h +++ b/src/storage/ob_sstable_rowkey_helper.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace storage { class ObRowkeyObjComparer { - public: +public: enum ObjComparerType { COMPARER_MYSQL = 0, COMPARER_ORACLE = 1, @@ -48,7 +48,7 @@ class ObRowkeyObjComparer { static int sstable_oracle_collation_free_cmp_func( const common::ObObj& obj1, const common::ObObj& obj2, const common::ObCompareCtx& cmp_ctx); - public: +public: ObRowkeyObjComparer(); virtual ~ObRowkeyObjComparer() = default; virtual void reset(); @@ -87,7 +87,7 @@ class ObRowkeyObjComparer { } TO_STRING_KV(K_(type), K_(is_collation_free), K_(cmp_ctx)); - protected: +protected: rowkey_obj_comp_func cmp_func_; common::ObCompareCtx cmp_ctx_; bool is_collation_free_; @@ -95,15 +95,15 @@ class ObRowkeyObjComparer { }; class ObRowkeyObjComparerOracle : public ObRowkeyObjComparer { - public: +public: ObRowkeyObjComparerOracle() { type_ = COMPARER_ORACLE; cmp_ctx_.null_pos_ = NULL_LAST; } virtual ~ObRowkeyObjComparerOracle() = default; - virtual int init_compare_func_collation_free(const common::ObObjMeta &obj_meta) override; - virtual OB_INLINE int32_t compare_semi_nullsafe(const common::ObObj &obj1, const common::ObObj &obj2) override + virtual int init_compare_func_collation_free(const common::ObObjMeta& obj_meta) override; + virtual OB_INLINE int32_t compare_semi_nullsafe(const common::ObObj& obj1, const common::ObObj& obj2) override { int32_t cmp_ret = ObObjCmpFuncs::CR_EQ; if (obj2.is_null()) { @@ -116,7 +116,7 @@ class ObRowkeyObjComparerOracle : public ObRowkeyObjComparer { }; class ObRowkeyObjComparerNullsafeMysql : public ObRowkeyObjComparer { - public: +public: ObRowkeyObjComparerNullsafeMysql() { type_ = COMPARER_MYSQL_NULLSAFE; @@ -124,7 +124,7 @@ class ObRowkeyObjComparerNullsafeMysql : public ObRowkeyObjComparer { cmp_ctx_.null_pos_ = NULL_FIRST; } virtual ~ObRowkeyObjComparerNullsafeMysql() = default; - virtual OB_INLINE int32_t compare(const common::ObObj &obj1, const common::ObObj &obj2) override + virtual OB_INLINE int32_t compare(const common::ObObj& obj1, const common::ObObj& obj2) override { int32_t cmp_ret = 0; if (OB_UNLIKELY(obj1.is_null() || obj2.is_null())) { @@ -147,7 +147,7 @@ class ObRowkeyObjComparerNullsafeMysql : public ObRowkeyObjComparer { }; class ObRowkeyObjComparerNullsafeOracle : public ObRowkeyObjComparerOracle { - public: +public: ObRowkeyObjComparerNullsafeOracle() { type_ = COMPARER_ORACLE_NULLSAFE; @@ -155,7 +155,7 @@ class ObRowkeyObjComparerNullsafeOracle : public ObRowkeyObjComparerOracle { cmp_ctx_.null_pos_ = NULL_LAST; } virtual ~ObRowkeyObjComparerNullsafeOracle() = default; - virtual OB_INLINE int32_t compare(const common::ObObj &obj1, const common::ObObj &obj2) override + virtual OB_INLINE int32_t compare(const common::ObObj& obj1, const common::ObObj& obj2) override { int32_t cmp_ret = 0; if (OB_UNLIKELY(obj1.is_null() || obj2.is_null())) { @@ -178,7 +178,7 @@ class ObRowkeyObjComparerNullsafeOracle : public ObRowkeyObjComparerOracle { }; class ObSSTableRowkeyHelper { - public: +public: typedef common::ObFixedArray RowkeyArray; typedef common::ObFixedArray RowkeyCmpFuncArray; ObSSTableRowkeyHelper(); @@ -288,9 +288,9 @@ class ObSSTableRowkeyHelper { return cmp_ret; } - public: +public: class RowkeyComparor { - public: + public: RowkeyComparor() = delete; RowkeyComparor(RowkeyCmpFuncArray& cmp_funcs, const bool prefix_check) : cmp_funcs_(cmp_funcs), prefix_check_(prefix_check) @@ -308,7 +308,7 @@ class ObSSTableRowkeyHelper { const bool prefix_check_; }; - private: +private: int get_macro_block_meta(const blocksstable::MacroBlockId& macro_id, blocksstable::ObFullMacroBlockMeta& macro_meta, const int64_t schema_rowkey_column_cnt); int build_macro_endkeys(const common::ObIArray& macro_ids, ObIAllocator& allocator, @@ -323,7 +323,7 @@ class ObSSTableRowkeyHelper { int locate_block_idx_(const ObExtStoreRowkey& ext_rowkey, const int64_t cmp_rowkey_col_cnt, const bool use_lower_bound, const int64_t last_block_idx, int64_t& block_idx); - private: +private: RowkeyArray endkeys_; RowkeyArray collation_free_endkeys_; RowkeyCmpFuncArray cmp_funcs_; diff --git a/src/storage/ob_sstable_struct.h b/src/storage/ob_sstable_struct.h index 4a78d8e40..3692bc102 100644 --- a/src/storage/ob_sstable_struct.h +++ b/src/storage/ob_sstable_struct.h @@ -26,7 +26,7 @@ const int64_t MACRO_BLOCK_CNT_PER_THREAD = 128; enum ObSSTableMergeInfoStatus { MERGE_START = 0, MERGE_RUNNING = 1, MERGE_FINISH = 2, MERGE_STATUS_MAX }; struct ObMultiVersionSSTableMergeInfo final { - public: +public: ObMultiVersionSSTableMergeInfo(); ~ObMultiVersionSSTableMergeInfo() = default; int add(const ObMultiVersionSSTableMergeInfo& info); @@ -34,7 +34,7 @@ struct ObMultiVersionSSTableMergeInfo final { TO_STRING_KV(K_(delete_logic_row_count), K_(update_logic_row_count), K_(insert_logic_row_count), K_(empty_delete_logic_row_count)); - public: +public: uint64_t delete_logic_row_count_; uint64_t update_logic_row_count_; uint64_t insert_logic_row_count_; @@ -42,7 +42,7 @@ struct ObMultiVersionSSTableMergeInfo final { }; struct ObSSTableMergeInfo final { - public: +public: ObSSTableMergeInfo(); ~ObSSTableMergeInfo() = default; int add(const ObSSTableMergeInfo& other); @@ -61,7 +61,7 @@ struct ObSSTableMergeInfo final { K_(total_child_task), K_(finish_child_task), K_(is_complement), K_(merge_type), K_(step_merge_start_version), K_(step_merge_end_version), K_(macro_bloomfilter_count)); - public: +public: uint64_t table_id_; int64_t partition_id_; common::ObVersion version_; @@ -101,7 +101,7 @@ struct ObSSTableMergeInfo final { }; struct ObMergeChecksumInfo final { - public: +public: ObMergeChecksumInfo(); ~ObMergeChecksumInfo() = default; int64_t* column_checksums_; @@ -111,7 +111,7 @@ struct ObMergeChecksumInfo final { }; struct ObCreateSSTableParam { - public: +public: ObCreateSSTableParam() : table_key_(), schema_version_(-1), @@ -161,7 +161,7 @@ struct ObCreateSSTableParam { }; struct ObCreateSSTableParamWithTable final : public ObCreateSSTableParam { - public: +public: ObCreateSSTableParamWithTable() : ObCreateSSTableParam(), schema_(NULL) {} ~ObCreateSSTableParamWithTable() = default; @@ -173,12 +173,12 @@ struct ObCreateSSTableParamWithTable final : public ObCreateSSTableParam { K_(progressive_merge_end_version), K_(create_snapshot_version), K_(checksum_method), K_(progressive_merge_round), K_(progressive_merge_step), K_(logical_data_version)); - public: +public: const share::schema::ObTableSchema* schema_; }; struct ObCreateSSTableParamWithPartition final : public ObCreateSSTableParam { - public: +public: ObCreateSSTableParamWithPartition() : ObCreateSSTableParam(), schema_(NULL), is_inited_(false) {} ~ObCreateSSTableParamWithPartition() = default; @@ -195,10 +195,10 @@ struct ObCreateSSTableParamWithPartition final : public ObCreateSSTableParam { K_(progressive_merge_end_version), K_(create_snapshot_version), K_(checksum_method), K_(progressive_merge_round), K_(progressive_merge_step), K_(logical_data_version)); - public: +public: const ObCreatePartitionMeta* schema_; - private: +private: bool is_inited_; }; diff --git a/src/storage/ob_storage_log_type.h b/src/storage/ob_storage_log_type.h index 91b06797d..84ee1c171 100644 --- a/src/storage/ob_storage_log_type.h +++ b/src/storage/ob_storage_log_type.h @@ -81,7 +81,7 @@ enum ObStorageLogType { }; class ObStorageLogTypeToString { - public: +public: static const char* storage_log_type_to_string(const int64_t log_type) { const char* log_type_str = NULL; @@ -226,7 +226,7 @@ class ObStorageLogTypeToString { } }; class ObStorageLogTypeChecker { - public: +public: static bool is_trans_log(const int64_t log_type) { return (OB_LOG_TRANS_REDO == log_type || OB_LOG_TRANS_PREPARE == log_type || @@ -357,7 +357,7 @@ class ObStorageLogTypeChecker { }; class ObTransLogType { - public: +public: static bool is_valid(const int64_t log_type) { return ObStorageLogTypeChecker::is_trans_log(log_type); diff --git a/src/storage/ob_storage_struct.h b/src/storage/ob_storage_struct.h index 5a7ba7d1d..bb0170879 100644 --- a/src/storage/ob_storage_struct.h +++ b/src/storage/ob_storage_struct.h @@ -107,7 +107,7 @@ inline bool need_migrate_trans_table(const ObReplicaOpType replica_op) } struct ObMigrateStatusHelper { - public: +public: static int trans_replica_op(const ObReplicaOpType& op_type, ObMigrateStatus& migrate_status); static int trans_fail_status(const ObMigrateStatus& cur_status, ObMigrateStatus& fail_status); static int trans_reboot_status(const ObMigrateStatus& cur_status, ObMigrateStatus& reboot_status); @@ -200,7 +200,7 @@ struct ObPartitionStoreMeta { K_(split_info), K_(replica_property)); OB_UNIS_VERSION_V(PARTITION_STORE_META_VERSION); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionStoreMeta); }; @@ -229,7 +229,7 @@ struct ObPGPartitionStoreMeta { K_(replica_type), K_(create_timestamp)); OB_UNIS_VERSION(PARTITION_STORE_META_VERSION_V2); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPGPartitionStoreMeta); }; @@ -280,7 +280,7 @@ struct ObPartitionGroupMeta { OB_UNIS_VERSION_V(PARTITION_GROUP_META_VERSION); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionGroupMeta); }; @@ -371,7 +371,7 @@ struct ObPartitionReadableInfo { }; struct ObCreatePGParam { - public: +public: ObCreatePGParam(); virtual ~ObCreatePGParam() {} @@ -440,7 +440,7 @@ bool ObMigrateStatusHelper::check_can_migrate_out(const ObMigrateStatus& cur_sta class ObCreatePartitionMeta { - public: +public: ObCreatePartitionMeta() { reset(); @@ -506,7 +506,7 @@ class ObCreatePartitionMeta { TO_STRING_KV(K_(is_valid), K_(table_id), K_(data_table_id), K_(progressive_merge_round), K_(is_global_index_table), K_(table_type), K_(table_mode), K_(index_type), K_(rowkey_column_num), K_(column_ids), KP(id_hash_array_)); - private: +private: //!!!! attention:only after successfully extracting from a ObTableSchema instance, can is_valid_ be true bool is_valid_; @@ -524,7 +524,7 @@ class ObCreatePartitionMeta { class ObCreatePartitionParam { - public: +public: ObCreatePartitionParam() { reset(); @@ -549,7 +549,7 @@ class ObCreatePartitionParam { K_(memstore_version), K_(lease_start), K_(replica_type), K_(restore), K_(frozen_timestamp), K_(pg_key), K_(schemas)); - public: +public: //!!!! attention:only after successfully extracting from a ObTableSchema instance, can is_valid_ be true bool is_valid_; @@ -567,7 +567,7 @@ class ObCreatePartitionParam { }; struct ObTransTableStatus { - public: +public: ObTransTableStatus() : end_log_ts_(0), row_count_(0) {} int64_t end_log_ts_; @@ -606,7 +606,7 @@ struct ObMigrateRemoteTableInfo { }; class ObRecoveryPointSchemaFilter final { - public: +public: ObRecoveryPointSchemaFilter(); virtual ~ObRecoveryPointSchemaFilter(); bool is_inited() const; @@ -623,7 +623,7 @@ class ObRecoveryPointSchemaFilter final { TO_STRING_KV( K_(is_inited), K_(tenant_id), K_(tenant_recovery_point_schema_version), K_(tenant_current_schema_version)); - private: +private: int get_table_ids_in_pg_(const common::ObPartitionKey& pgkey, common::ObIArray& table_ids, share::schema::ObSchemaGetterGuard& schema_guard); int check_partition_exist_(const common::ObPartitionKey pkey, const bool check_dropped_partition, @@ -632,7 +632,7 @@ class ObRecoveryPointSchemaFilter final { int check_if_table_miss_by_schema_(const common::ObPartitionKey& pgkey, const common::hash::ObHashSet& table_ids, share::schema::ObSchemaGetterGuard& schema_guard); - private: +private: bool is_inited_; int64_t tenant_id_; int64_t tenant_recovery_point_schema_version_; @@ -644,12 +644,12 @@ class ObRecoveryPointSchemaFilter final { }; class ObBackupRestoreTableSchemaChecker { - public: +public: static int check_backup_restore_need_skip_table(const share::schema::ObTableSchema* table_schema, bool& need_skip); }; class ObRebuildListener { - public: +public: // the upper layer need guarantee the life cycle of the // partition ctx mgr pointer should be safe before destruction ObRebuildListener(transaction::ObPartitionTransCtxMgr& mgr); @@ -657,12 +657,12 @@ class ObRebuildListener { // whether the partition is in rebuild bool on_partition_rebuild(); - private: +private: transaction::ObPartitionTransCtxMgr& ob_partition_ctx_mgr_; }; class ObRestoreFakeMemberListHelper { - public: +public: static int fake_restore_member_list(const int64_t replica_cnt, common::ObMemberList& fake_member_list); }; diff --git a/src/storage/ob_store_row_comparer.h b/src/storage/ob_store_row_comparer.h index c89aee10f..49cf04967 100644 --- a/src/storage/ob_store_row_comparer.h +++ b/src/storage/ob_store_row_comparer.h @@ -18,14 +18,14 @@ namespace oceanbase { namespace storage { class ObIComparerCancel { - public: +public: ObIComparerCancel() = default; virtual ~ObIComparerCancel() = default; virtual bool need_cancel() = 0; }; class ObStoreRowComparer { - public: +public: ObStoreRowComparer(int& comp_ret, const common::ObIArray& sort_column_index) : result_code_(comp_ret), sort_column_index_(sort_column_index), cancel_(NULL), cmp_times_(0) {} @@ -34,7 +34,7 @@ class ObStoreRowComparer { OB_INLINE bool operator()(const ObStoreRow* left, const ObStoreRow* right); int& result_code_; - private: +private: const common::ObIArray& sort_column_index_; ObIComparerCancel* cancel_; int64_t cmp_times_; diff --git a/src/storage/ob_store_row_filter.h b/src/storage/ob_store_row_filter.h index 23f77eb14..4925c198a 100644 --- a/src/storage/ob_store_row_filter.h +++ b/src/storage/ob_store_row_filter.h @@ -29,7 +29,7 @@ namespace storage { struct ObStoreRow; class ObIStoreRowFilter { - public: +public: virtual int check(const ObStoreRow& store_row, bool& is_filtered) const = 0; virtual int init(const sql::ObTableLocation* part_filter, sql::ObExecContext* exec_ctx, common::ObPartMgr* part_mgr, const common::ObPartitionKey& pkey) = 0; @@ -37,7 +37,7 @@ class ObIStoreRowFilter { }; class ObStoreRowFilter : public ObIStoreRowFilter { - public: +public: ObStoreRowFilter() : part_filter_(NULL), exec_ctx_(NULL), part_mgr_(NULL), pkey_() {} virtual ~ObStoreRowFilter() @@ -47,7 +47,7 @@ class ObStoreRowFilter : public ObIStoreRowFilter { int check(const ObStoreRow& store_row, bool& is_filtered) const override; TO_STRING_KV(KP_(part_filter), KP_(exec_ctx), KP_(part_mgr), K_(pkey)); - private: +private: const sql::ObTableLocation* part_filter_; sql::ObExecContext* exec_ctx_; common::ObPartMgr* part_mgr_; diff --git a/src/storage/ob_table_mgr.h b/src/storage/ob_table_mgr.h index c2bfc8479..45b50ec28 100644 --- a/src/storage/ob_table_mgr.h +++ b/src/storage/ob_table_mgr.h @@ -27,14 +27,14 @@ class ObPartitionComponentFactory; class ObOldSSTable; class ObTableMgrGCTask : public common::ObTimerTask { - public: +public: ObTableMgrGCTask(); virtual ~ObTableMgrGCTask(); virtual void runTimerTask() override; }; class ObTableMgr : public blocksstable::ObIRedoModule { - public: +public: static const int64_t DEFAULT_HASH_MAP_BUCKETS_COUNT = 100000; // 10w static const int64_t GC_INTERVAL_US = 60 * 1000 * 1000; struct CompletedTableNode; @@ -44,7 +44,7 @@ class ObTableMgr : public blocksstable::ObIRedoModule { typedef common::hash::ObPreAllocLinkHashMap AllTableMap; struct CompletedTableNode : public common::hash::ObPreAllocLinkHashNode { - public: + public: explicit CompletedTableNode(ObITable& item) : ObPreAllocLinkHashNode(item), next_(NULL) {} virtual ~CompletedTableNode() @@ -64,20 +64,20 @@ class ObTableMgr : public blocksstable::ObIRedoModule { }; class CompletedTableGetFunctor : public CompletedTableMap::GetFunctor { - public: + public: explicit CompletedTableGetFunctor(ObTableHandle& handle) : handle_(handle) {} virtual ~CompletedTableGetFunctor() {} virtual int operator()(ObITable& table) override; - private: + private: ObTableHandle& handle_; DISALLOW_COPY_AND_ASSIGN(CompletedTableGetFunctor); }; class UnneedCompletedTableFinder : public CompletedTableMap::ForeachFunctor { - public: + public: UnneedCompletedTableFinder(); virtual ~UnneedCompletedTableFinder(); int init(const int64_t max_batch_count); @@ -92,7 +92,7 @@ class ObTableMgr : public blocksstable::ObIRedoModule { return is_full_; } - private: + private: bool is_inited_; int64_t max_batch_count_; bool is_full_; @@ -124,7 +124,7 @@ class ObTableMgr : public blocksstable::ObIRedoModule { }; class UnneedAllTableFinder : public AllTableMap::ForeachFunctor { - public: + public: UnneedAllTableFinder() {} virtual ~UnneedAllTableFinder() @@ -135,13 +135,13 @@ class ObTableMgr : public blocksstable::ObIRedoModule { return del_tables_; } - private: + private: common::ObArray del_tables_; DISALLOW_COPY_AND_ASSIGN(UnneedAllTableFinder); }; class AllTableEraseChecker : public AllTableMap::EraseChecker { - public: + public: virtual int operator()(ObITable& table) override; }; @@ -167,7 +167,7 @@ class ObTableMgr : public blocksstable::ObIRedoModule { int free_all_sstables(); int get_all_tables(ObTablesHandle& handle); - private: +private: ObTableMgr(); virtual ~ObTableMgr(); int complete_memtable(memtable::ObMemtable* memtable, const int64_t snapshot_version, const int64_t freeze_log_ts); @@ -197,7 +197,7 @@ class ObTableMgr : public blocksstable::ObIRedoModule { int lock_multi_bucket_lock(common::ObMultiBucketLockGuard& guard, common::ObIArray& tables); void free_all_tables(); - private: +private: bool is_inited_; CompletedTableMap completed_table_map_; AllTableMap all_table_map_; diff --git a/src/storage/ob_table_mgr_meta_block_reader.h b/src/storage/ob_table_mgr_meta_block_reader.h index 4db6e7289..12ade77a3 100644 --- a/src/storage/ob_table_mgr_meta_block_reader.h +++ b/src/storage/ob_table_mgr_meta_block_reader.h @@ -19,15 +19,15 @@ namespace oceanbase { namespace storage { class ObTableMgrMetaBlockReader : public blocksstable::ObMetaBlockReader { - public: +public: ObTableMgrMetaBlockReader(); virtual ~ObTableMgrMetaBlockReader(); - protected: +protected: virtual int parse(const blocksstable::ObMacroBlockCommonHeader& common_header, const blocksstable::ObLinkedMacroBlockHeader& linked_header, const char* buf, const int64_t buf_len); - private: +private: common::ObArenaAllocator allocator_; char* read_buf_; int64_t offset_; diff --git a/src/storage/ob_table_scan_iterator.h b/src/storage/ob_table_scan_iterator.h index b37a3950e..7ec671f53 100644 --- a/src/storage/ob_table_scan_iterator.h +++ b/src/storage/ob_table_scan_iterator.h @@ -38,7 +38,7 @@ class ObTableScanParam; class ObPartitionStore; class ObIStoreRowFilter; class ObTableScanStoreRowIterator { - public: +public: ObTableScanStoreRowIterator(); virtual ~ObTableScanStoreRowIterator(); int init(transaction::ObTransService& trans_service, const ObStoreCtx& ctx, ObTableScanParam& scan_param, @@ -48,7 +48,7 @@ class ObTableScanStoreRowIterator { int rescan(const ObRangeArray& key_ranges, const ObPosArray& range_array_pos); int switch_iterator(const int64_t range_array_idx); - private: +private: static const int64_t LOOP_RESCAN_BUFFER_SIZE = 8 * 1024; // 8K int prepare_table_param(); int prepare_table_context(const ObIStoreRowFilter* row_filter); @@ -83,12 +83,12 @@ class ObTableScanStoreRowIterator { bool is_iter_opened_; bool use_fuse_row_cache_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTableScanStoreRowIterator); }; class ObTableScanRangeArrayRowIterator : public common::ObNewRowIterator { - public: +public: ObTableScanRangeArrayRowIterator(); virtual ~ObTableScanRangeArrayRowIterator(); int init(const bool is_reverse_scan, ObTableScanStoreRowIterator& iter); @@ -101,7 +101,7 @@ class ObTableScanRangeArrayRowIterator : public common::ObNewRowIterator { virtual void reset(); int set_range_array_idx(const int64_t range_array_idx); - private: +private: bool is_inited_; ObTableScanStoreRowIterator* row_iter_; ObStoreRow* cur_row_; @@ -110,11 +110,11 @@ class ObTableScanRangeArrayRowIterator : public common::ObNewRowIterator { }; class ObTableScanIterIterator : public common::ObNewIterIterator { - public: +public: static constexpr int64_t RP_MAX_FREE_LIST_NUM = 1024; static constexpr const char LABEL[] = "RPTblScanIterIter"; - public: +public: ObTableScanIterIterator(); virtual ~ObTableScanIterIterator(); virtual int get_next_iter(common::ObNewRowIterator*& iter); @@ -123,10 +123,10 @@ class ObTableScanIterIterator : public common::ObNewIterIterator { int rescan(ObTableScanParam& scan_param); virtual void reset(); - private: +private: int get_next_range(); - private: +private: ObTableScanStoreRowIterator store_row_iter_; ObTableScanRangeArrayRowIterator range_row_iter_; int64_t range_array_cursor_; @@ -135,11 +135,11 @@ class ObTableScanIterIterator : public common::ObNewIterIterator { }; class ObTableScanIterator : public common::ObNewRowIterator { - public: +public: static constexpr int64_t RP_MAX_FREE_LIST_NUM = 1024; static constexpr const char LABEL[] = "RPTableScanIter"; - public: +public: ObTableScanIterator(); virtual ~ObTableScanIterator(); virtual int get_next_row(common::ObNewRow*& row) override; @@ -153,18 +153,18 @@ class ObTableScanIterator : public common::ObNewRowIterator { int rescan(ObTableScanParam& scan_param); virtual void reset() override; - private: +private: ObTableScanIterIterator iter_; ObNewRowIterator* row_iter_; }; class ObTableScanNewRowIterator { - public: +public: explicit ObTableScanNewRowIterator(ObNewIterIterator& iter); virtual ~ObTableScanNewRowIterator(); int get_next_row(common::ObNewRow*& row); - private: +private: ObNewIterIterator& iter_; ObNewRowIterator* row_iter_; }; diff --git a/src/storage/ob_table_store.h b/src/storage/ob_table_store.h index 2a81e3a41..af56b98d0 100644 --- a/src/storage/ob_table_store.h +++ b/src/storage/ob_table_store.h @@ -41,7 +41,7 @@ struct ObVirtualPartitionSplitInfo { }; class ObTableStore { - public: +public: friend class ObPrintableTableSchema; static const int64_t OB_TABLE_STORE_VERSION = 1; struct ObITableIDCompare { @@ -161,7 +161,7 @@ class ObTableStore { int get_recovery_point_tables(const int64_t snapshot_version, ObTablesHandle& handle); DECLARE_VIRTUAL_TO_STRING; - private: +private: // Common Section bool is_multi_version_break(const ObVersionRange& new_version_range, const int64_t last_snapshot_vesion); int classify_tables(const ObTablesHandle& old_handle, common::ObArray& major_tables, @@ -237,7 +237,7 @@ class ObTableStore { const ObTablesHandle& old_handle, int64_t& first_reference_pos, int64_t& last_reference_pos); int get_major_split_table_pos(const ObTablesHandle& old_handle, int64_t& pos); - protected: +protected: static const int64_t INVAID_TABLE_POS = -1; static const int64_t DEFAULT_SSTABLE_CNT = 6; static const int64_t OB_HIST_MINOR_FACTOR = 3; @@ -271,7 +271,7 @@ OB_INLINE bool ObTableStore::is_valid() const } class ObLogTsCompater { - public: +public: ObLogTsCompater() : version_(0), log_ts_range_(nullptr), is_base_(false) {} ~ObLogTsCompater() @@ -299,7 +299,7 @@ class ObLogTsCompater { }; class ObTableCompater { - public: +public: static const int64_t OB_MAX_COMPAT_LOG_TS = MAX_SSTABLE_CNT_IN_STORAGE * MAX_SSTABLE_CNT_IN_STORAGE; ObTableCompater() : compaters_() {} @@ -314,15 +314,15 @@ class ObTableCompater { int fill_log_ts(); TO_STRING_KV(K_(compaters)); - private: +private: ObSEArray compaters_; }; class ObPrintableTableStore final : public ObTableStore { - public: +public: virtual int64_t to_string(char* buf, const int64_t buf_len) const override; - private: +private: void table_to_string(ObITable* table, const char* table_type, char* buf, const int64_t buf_len, int64_t& pos) const; ObPrintableTableStore() = delete; }; diff --git a/src/storage/ob_table_store_stat_mgr.h b/src/storage/ob_table_store_stat_mgr.h index 801a1a04a..00f19c138 100644 --- a/src/storage/ob_table_store_stat_mgr.h +++ b/src/storage/ob_table_store_stat_mgr.h @@ -25,7 +25,7 @@ namespace oceanbase { namespace storage { struct ObMergeIterStat { - public: +public: ObMergeIterStat() { reset(); @@ -45,7 +45,7 @@ struct ObMergeIterStat { }; struct ObBlockAccessStat { - public: +public: ObBlockAccessStat() { reset(); @@ -65,7 +65,7 @@ struct ObBlockAccessStat { }; struct ObTableStoreStat { - public: +public: ObTableStoreStat(); ~ObTableStoreStat() = default; @@ -105,7 +105,7 @@ struct ObTableStoreStat { }; struct ObTableStoreStatKey { - public: +public: ObTableStoreStatKey() : table_id_(common::OB_INVALID_ID), partition_id_(common::OB_INVALID_ID) {} ObTableStoreStatKey(const uint64_t table_id, const int64_t partition_id) @@ -134,7 +134,7 @@ struct ObTableStoreStatKey { }; struct ObTableStoreStatNode { - public: +public: ObTableStoreStatNode() : pre_(NULL), next_(NULL), stat_(NULL) {} ~ObTableStoreStatNode() @@ -152,26 +152,26 @@ struct ObTableStoreStatNode { }; class ObTableStoreStatIterator { - public: +public: ObTableStoreStatIterator(); virtual ~ObTableStoreStatIterator(); int open(); int get_next_stat(ObTableStoreStat& stat); void reset(); - private: +private: int64_t cur_idx_; bool is_opened_; }; class ObTableStoreStatMgr { - public: +public: int init(const int64_t limit_cnt = DEFAULT_MAX_CNT); void destroy(); static ObTableStoreStatMgr& get_instance(); int report_stat(const ObTableStoreStat& stat); - private: +private: ObTableStoreStatMgr(); virtual ~ObTableStoreStatMgr(); void move_node_to_head(ObTableStoreStatNode* node); @@ -188,7 +188,7 @@ class ObTableStoreStatMgr { static const int64_t REPORT_TASK_INTERVAL_US = 1000 * 1000; // 1 seconds class ReportTask : public common::ObTimerTask { - public: + public: ReportTask() : stat_mgr_(NULL) {} virtual ~ReportTask() @@ -202,7 +202,7 @@ class ObTableStoreStatMgr { } virtual void runTimerTask(); - private: + private: ObTableStoreStatMgr* stat_mgr_; DISALLOW_COPY_AND_ASSIGN(ReportTask); }; diff --git a/src/storage/ob_tenant_config_meta_block_reader.h b/src/storage/ob_tenant_config_meta_block_reader.h index f3c71942e..ce7d6da23 100644 --- a/src/storage/ob_tenant_config_meta_block_reader.h +++ b/src/storage/ob_tenant_config_meta_block_reader.h @@ -19,15 +19,15 @@ namespace oceanbase { namespace storage { class ObTenantConfigMetaBlockReader : public blocksstable::ObMetaBlockReader { - public: +public: ObTenantConfigMetaBlockReader(); virtual ~ObTenantConfigMetaBlockReader(); - protected: +protected: virtual int parse(const blocksstable::ObMacroBlockCommonHeader& common_header, const blocksstable::ObLinkedMacroBlockHeader& linked_header, const char* buf, const int64_t buf_len); - private: +private: share::TenantUnits tenant_units_; }; diff --git a/src/storage/ob_tenant_config_meta_checkpoint_reader.h b/src/storage/ob_tenant_config_meta_checkpoint_reader.h index 421bb7151..c44e9f6b8 100644 --- a/src/storage/ob_tenant_config_meta_checkpoint_reader.h +++ b/src/storage/ob_tenant_config_meta_checkpoint_reader.h @@ -19,14 +19,14 @@ namespace oceanbase { namespace storage { class ObTenantConfigMetaCheckpointReader final { - public: +public: ObTenantConfigMetaCheckpointReader(); ~ObTenantConfigMetaCheckpointReader() = default; int init(const blocksstable::MacroBlockId& entry_block, blocksstable::ObStorageFileHandle& file_handle); int read_checkpoint(); common::ObIArray& get_meta_block_list(); - private: +private: bool is_inited_; ObPGMetaItemReader reader_; }; diff --git a/src/storage/ob_tenant_config_meta_checkpoint_writer.h b/src/storage/ob_tenant_config_meta_checkpoint_writer.h index c5540bdbe..4e873b94b 100644 --- a/src/storage/ob_tenant_config_meta_checkpoint_writer.h +++ b/src/storage/ob_tenant_config_meta_checkpoint_writer.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class ObTenantConfigMetaItem : public ObIPGMetaItem { - public: +public: ObTenantConfigMetaItem(); virtual ~ObTenantConfigMetaItem() = default; virtual int serialize(const char*& buf, int64_t& buf_len) override; @@ -33,20 +33,20 @@ class ObTenantConfigMetaItem : public ObIPGMetaItem { } void set_tenant_units(share::TenantUnits& tenant_units); - private: +private: share::TenantUnits* tenant_units_; common::ObArenaAllocator allocator_; }; class ObTenantConfigMetaCheckpointWriter final { - public: +public: ObTenantConfigMetaCheckpointWriter(); ~ObTenantConfigMetaCheckpointWriter() = default; int write_checkpoint(blocksstable::ObSuperBlockMetaEntry& meta_entry); void reset(); common::ObIArray& get_meta_block_list(); - private: +private: ObPGMetaItemWriter writer_; }; diff --git a/src/storage/ob_tenant_config_mgr.h b/src/storage/ob_tenant_config_mgr.h index e1679a44d..1044e3557 100644 --- a/src/storage/ob_tenant_config_mgr.h +++ b/src/storage/ob_tenant_config_mgr.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class ObTenantConfigMgr : public blocksstable::ObIRedoModule { - public: +public: static ObTenantConfigMgr& get_instance(); int init(); @@ -36,13 +36,13 @@ class ObTenantConfigMgr : public blocksstable::ObIRedoModule { virtual int replay(const blocksstable::ObRedoModuleReplayParam& param) override; virtual int parse(const int64_t subcmd, const char* buf, const int64_t len, FILE* stream) override; - private: +private: ObTenantConfigMgr(); virtual ~ObTenantConfigMgr(); int replay_update_tenant_config(const char* buf, const int64_t buf_len); bool is_tenant_changed(const share::TenantUnits& old_tenant, const share::TenantUnits& new_tenant); - private: +private: bool is_inited_; share::TenantUnits tenant_units_; mutable lib::ObMutex mutex_; diff --git a/src/storage/ob_tenant_file_checkpoint_reader.h b/src/storage/ob_tenant_file_checkpoint_reader.h index 574923a68..5007c87d4 100644 --- a/src/storage/ob_tenant_file_checkpoint_reader.h +++ b/src/storage/ob_tenant_file_checkpoint_reader.h @@ -19,13 +19,13 @@ namespace oceanbase { namespace storage { class ObTenantFileCheckpointReader final { - public: +public: ObTenantFileCheckpointReader(); ~ObTenantFileCheckpointReader() = default; int read_checkpoint(const ObTenantFileKey& file_key, const ObTenantFileSuperBlock& super_block, ObBaseFileMgr& file_mgr, ObPartitionMetaRedoModule& pg_mgr); - private: +private: ObTenantFilePGMetaCheckpointReader pg_meta_reader_; }; diff --git a/src/storage/ob_tenant_file_checkpoint_writer.h b/src/storage/ob_tenant_file_checkpoint_writer.h index 612d4c459..e4884bcd3 100644 --- a/src/storage/ob_tenant_file_checkpoint_writer.h +++ b/src/storage/ob_tenant_file_checkpoint_writer.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class ObTenantFileCheckpointWriter final { - public: +public: ObTenantFileCheckpointWriter(); ~ObTenantFileCheckpointWriter() = default; int init( @@ -27,7 +27,7 @@ class ObTenantFileCheckpointWriter final { int write_checkpoint(); void reset(); - private: +private: ObTenantFilePGMetaCheckpointWriter pg_meta_writer_; ObTenantFileKey tenant_file_key_; ObBaseFileMgr* file_mgr_; diff --git a/src/storage/ob_tenant_file_mgr.h b/src/storage/ob_tenant_file_mgr.h index cac37cb22..a824e5512 100644 --- a/src/storage/ob_tenant_file_mgr.h +++ b/src/storage/ob_tenant_file_mgr.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace storage { class ObTenantFileMgr final { - public: +public: ObTenantFileMgr(); ~ObTenantFileMgr(); int init(const uint64_t tenant_id, common::ObConcurrentFIFOAllocator& allocator); @@ -59,10 +59,10 @@ class ObTenantFileMgr final { int clear_replay_map(); int is_from_svr_ckpt(const ObTenantFileKey& file_key, bool& from_svr_skpt) const; - public: +public: static const int64_t START_FILE_ID = 1L; - private: +private: static const int64_t TENANT_MAX_FILE_CNT = 1000; static const int64_t TENANT_MIN_FILE_CNT = 10; typedef common::hash::ObHashMap TENANT_FILE_MAP; @@ -81,7 +81,7 @@ class ObTenantFileMgr final { int update_tenant_file_meta_blocks_impl( const ObTenantFileKey& file_key, const common::ObIArray& meta_block_list); - private: +private: common::TCRWLock lock_; TENANT_FILE_MAP tenant_file_map_; common::ObConcurrentFIFOAllocator* allocator_; @@ -90,7 +90,7 @@ class ObTenantFileMgr final { }; class ObBaseFileMgr : public blocksstable::ObIRedoModule { - public: +public: ObBaseFileMgr(); virtual ~ObBaseFileMgr(); int init(); @@ -122,7 +122,7 @@ class ObBaseFileMgr : public blocksstable::ObIRedoModule { int remove_pg(const ObTenantFileKey& file_key, const common::ObPGKey& pg_key); int is_from_svr_ckpt(const ObTenantFileKey& file_key, bool& from_svr_skpt); - private: +private: typedef common::hash::ObHashMap TENANT_MGR_MAP; int get_tenant_mgr(const uint64_t tenant_id, ObTenantFileMgr*& tenant_mgr); int replay_update_tenant_file_super_block(const char* buf, const int64_t buf_len); @@ -131,33 +131,33 @@ class ObBaseFileMgr : public blocksstable::ObIRedoModule { int replay_remove_pg_from_file(const char* buf, const int64_t len); int replay_update_tenant_file_info(const char* buf, const int64_t buf_len); - private: +private: static const int64_t MAX_TENANT_CNT = 1000; static const int64_t MEM_LIMIT = 10 * 1024 * 1024 * 1024L; lib::ObMutex lock_; TENANT_MGR_MAP tenant_mgr_map_; common::ObConcurrentFIFOAllocator allocator_; - protected: +protected: bool is_inited_; }; class ObFileRecycleTask : public common::ObTimerTask { - public: +public: static const int64_t RECYCLE_CYCLE_US = 1000L * 1000L * 10L; // 10s - public: +public: explicit ObFileRecycleTask(ObBaseFileMgr& file_mgr) : file_mgr_(file_mgr) {} virtual ~ObFileRecycleTask() {} virtual void runTimerTask() override; - private: +private: ObBaseFileMgr& file_mgr_; }; class ObServerFileMgr : public ObBaseFileMgr { - public: +public: static ObServerFileMgr& get_instance(); int init(); void destroy(); @@ -165,7 +165,7 @@ class ObServerFileMgr : public ObBaseFileMgr { void stop(); void wait(); - private: +private: ObServerFileMgr() : recycle_timer_(), recycle_task_(*this) {} virtual ~ObServerFileMgr() @@ -173,13 +173,13 @@ class ObServerFileMgr : public ObBaseFileMgr { destroy(); } - private: +private: common::ObTimer recycle_timer_; ObFileRecycleTask recycle_task_; }; class ObTenantFileSLogFilter : public blocksstable::ObISLogFilter { - public: +public: ObTenantFileSLogFilter() = default; virtual ~ObTenantFileSLogFilter() = default; virtual int filter(const ObISLogFilter::Param& param, bool& is_filtered) const override; diff --git a/src/storage/ob_tenant_file_pg_meta_checkpoint_reader.h b/src/storage/ob_tenant_file_pg_meta_checkpoint_reader.h index b8af48d86..ddc9956bb 100644 --- a/src/storage/ob_tenant_file_pg_meta_checkpoint_reader.h +++ b/src/storage/ob_tenant_file_pg_meta_checkpoint_reader.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { class ObTenantFilePGMetaCheckpointReader final { - public: +public: ObTenantFilePGMetaCheckpointReader(); ~ObTenantFilePGMetaCheckpointReader() = default; int read_checkpoint(const ObTenantFileKey& file_key, const ObTenantFileSuperBlock& super_block, diff --git a/src/storage/ob_tenant_file_pg_meta_checkpoint_writer.h b/src/storage/ob_tenant_file_pg_meta_checkpoint_writer.h index 99ca414f0..7e55c1569 100644 --- a/src/storage/ob_tenant_file_pg_meta_checkpoint_writer.h +++ b/src/storage/ob_tenant_file_pg_meta_checkpoint_writer.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class ObTenantFilePGMetaCheckpointWriter final { - public: +public: ObTenantFilePGMetaCheckpointWriter(); ~ObTenantFilePGMetaCheckpointWriter() = default; int init(ObPartitionMetaRedoModule& partition_meta_mgr, ObBaseFileMgr& pg_super_block_mgr, @@ -30,7 +30,7 @@ class ObTenantFilePGMetaCheckpointWriter final { int get_file_checkpoint_entry(ObTenantFileCheckpointEntry& entry); void reset(); - private: +private: ObPartitionMetaRedoModule* partition_meta_mgr_; ObBaseFileMgr* server_file_mgr_; ObTenantFileKey tenant_file_key_; diff --git a/src/storage/ob_tenant_file_struct.h b/src/storage/ob_tenant_file_struct.h index 3c5d9912e..d8b7cab55 100644 --- a/src/storage/ob_tenant_file_struct.h +++ b/src/storage/ob_tenant_file_struct.h @@ -25,7 +25,7 @@ class ObStorageFile; namespace storage { struct ObTenantFileKey final { - public: +public: ObTenantFileKey() : tenant_id_(common::OB_INVALID_ID), file_id_(0) {} ObTenantFileKey(const uint64_t tenant_id, const int64_t file_id) : tenant_id_(tenant_id), file_id_(file_id) @@ -54,7 +54,7 @@ enum ObTenantFileStatus { }; struct ObTenantFileSuperBlock final { - public: +public: static const int64_t TENANT_FILE_SUPER_BLOCK_VERSION_V1 = 1; ObTenantFileSuperBlock(); ~ObTenantFileSuperBlock() = default; @@ -71,7 +71,7 @@ struct ObTenantFileSuperBlock final { TO_STRING_KV(K_(macro_meta_entry), K_(pg_meta_entry), K_(status)); OB_UNIS_VERSION(TENANT_FILE_SUPER_BLOCK_VERSION_V1); - public: +public: blocksstable::ObSuperBlockMetaEntry macro_meta_entry_; blocksstable::ObSuperBlockMetaEntry pg_meta_entry_; ObTenantFileStatus status_; @@ -79,7 +79,7 @@ struct ObTenantFileSuperBlock final { }; struct ObTenantFileInfo : public blocksstable::ObISuperBlock { - public: +public: ObTenantFileInfo() : tenant_key_(), tenant_file_super_block_(), pg_map_() {} virtual ~ObTenantFileInfo() @@ -135,7 +135,7 @@ struct ObTenantFileInfo : public blocksstable::ObISuperBlock { }; class ObMetaBlockListHandle final { - public: +public: ObMetaBlockListHandle(); ~ObMetaBlockListHandle(); int add_macro_blocks(const common::ObIArray& block_list, const bool need_switch_handle); @@ -148,18 +148,18 @@ class ObMetaBlockListHandle final { } void set_storage_file(blocksstable::ObStorageFile* file); - private: +private: void switch_handle(); void reset_new_handle(); - private: +private: static const int64_t META_BLOCK_HANDLE_CNT = 2; blocksstable::ObMacroBlocksHandle meta_handles_[META_BLOCK_HANDLE_CNT]; int64_t cur_handle_pos_; }; struct ObTenantFileValue final { - public: +public: static const int64_t MAX_REF_CNT_PER_FILE = 1000; static const int64_t META_HANDLE_CNT = 2; ObTenantFileValue() @@ -180,7 +180,7 @@ struct ObTenantFileValue final { }; class ObTenantFileFilter final { - public: +public: ObTenantFileFilter(); ~ObTenantFileFilter() = default; void reset(); @@ -190,7 +190,7 @@ class ObTenantFileFilter final { }; class ObTenantFileCheckpointEntry final { - public: +public: ObTenantFileCheckpointEntry(); ~ObTenantFileCheckpointEntry(); void reset(); diff --git a/src/storage/ob_tenant_file_super_block_checkpoint_reader.h b/src/storage/ob_tenant_file_super_block_checkpoint_reader.h index 2638b013e..1d3b84497 100644 --- a/src/storage/ob_tenant_file_super_block_checkpoint_reader.h +++ b/src/storage/ob_tenant_file_super_block_checkpoint_reader.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class ObTenantFileSuperBlockCheckpointReader final { - public: +public: ObTenantFileSuperBlockCheckpointReader(); ~ObTenantFileSuperBlockCheckpointReader() = default; void reset() @@ -32,7 +32,7 @@ class ObTenantFileSuperBlockCheckpointReader final { blocksstable::ObStorageFileHandle& file_handle); common::ObIArray& get_meta_block_list(); - private: +private: ObPGMetaItemReader reader_; }; diff --git a/src/storage/ob_tenant_file_super_block_checkpoint_writer.h b/src/storage/ob_tenant_file_super_block_checkpoint_writer.h index 43ea219b7..741f81672 100644 --- a/src/storage/ob_tenant_file_super_block_checkpoint_writer.h +++ b/src/storage/ob_tenant_file_super_block_checkpoint_writer.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { struct ObTenantFileSuperBlockCheckpointEntry final { - public: +public: static const int64_t TENANT_FILE_ENTRY_VERSION = 1; explicit ObTenantFileSuperBlockCheckpointEntry(ObTenantFileInfo& file_info) : file_info_(file_info) {} @@ -31,7 +31,7 @@ struct ObTenantFileSuperBlockCheckpointEntry final { }; class ObTenantFileSuperBlockItem : public ObIPGMetaItem { - public: +public: ObTenantFileSuperBlockItem(); virtual ~ObTenantFileSuperBlockItem(); void set_tenant_file_entry(ObTenantFileSuperBlockCheckpointEntry& entry); @@ -42,10 +42,10 @@ class ObTenantFileSuperBlockItem : public ObIPGMetaItem { } TO_STRING_KV(KP_(buf), K_(buf_size), KP_(entry)); - private: +private: int extend_buf(const int64_t request_size); - public: +public: common::ObArenaAllocator allocator_; char* buf_; int64_t buf_size_; @@ -53,7 +53,7 @@ class ObTenantFileSuperBlockItem : public ObIPGMetaItem { }; class ObTenantFileSuperBlockCheckpointWriter final { - public: +public: ObTenantFileSuperBlockCheckpointWriter(); ~ObTenantFileSuperBlockCheckpointWriter() = default; int write_checkpoint(blocksstable::ObStorageFileHandle& server_root_handle, ObBaseFileMgr& file_mgr, @@ -62,7 +62,7 @@ class ObTenantFileSuperBlockCheckpointWriter final { ObIArray& get_meta_block_list(); void reset(); - private: +private: ObPGMetaItemWriter writer_; }; diff --git a/src/storage/ob_tenant_meta_memory_mgr.h b/src/storage/ob_tenant_meta_memory_mgr.h index 4bcf5b62d..63b3f6ee5 100644 --- a/src/storage/ob_tenant_meta_memory_mgr.h +++ b/src/storage/ob_tenant_meta_memory_mgr.h @@ -19,15 +19,15 @@ namespace oceanbase { namespace storage { class ObTenantMetaMemoryMgr { - public: +public: int init(); // need update when the schema_version or memory_size has been changed int try_update_tenant_info(const uint64_t tenant_id, const int64_t schema_version); static ObTenantMetaMemoryMgr& get_instance(); - private: +private: struct TenantInfo { - public: + public: TenantInfo() : schema_version_(0), memory_size_(0) {} TenantInfo(const int64_t schema_version, const int64_t memory_size) @@ -47,7 +47,7 @@ class ObTenantMetaMemoryMgr { virtual ~ObTenantMetaMemoryMgr(); void destroy(); - private: +private: lib::ObMutex lock_; // key: tenant_id common::hash::ObHashMap tenant_meta_memory_map_; diff --git a/src/storage/ob_trans_checkpoint_worker.h b/src/storage/ob_trans_checkpoint_worker.h index bb4c1b2a4..8476c67e5 100644 --- a/src/storage/ob_trans_checkpoint_worker.h +++ b/src/storage/ob_trans_checkpoint_worker.h @@ -21,7 +21,7 @@ class ObPartitionService; class ObIPartitionGroup; class ObTransCheckpointAdapter : public share::ObThreadPool { - public: +public: ObTransCheckpointAdapter() : inited_(false), partition_service_(nullptr) {} ~ObTransCheckpointAdapter() @@ -35,16 +35,16 @@ class ObTransCheckpointAdapter : public share::ObThreadPool { void wait(); virtual void run1() override; - private: +private: int scan_all_partitions_(int64_t& valid_user_part_count, int64_t& valid_inner_part_count); - private: +private: bool inited_; storage::ObPartitionService* partition_service_; }; class ObTransCheckpointWorker { - public: +public: ObTransCheckpointWorker() : inited_(false) {} ~ObTransCheckpointWorker() @@ -57,10 +57,10 @@ class ObTransCheckpointWorker { void stop(); void wait(); - private: +private: static const int64_t MAX_CHECKPOINT_NUM = 2; - private: +private: bool inited_; ObTransCheckpointAdapter checkpoint_adapters_[MAX_CHECKPOINT_NUM]; }; diff --git a/src/storage/ob_value_row_iterator.h b/src/storage/ob_value_row_iterator.h index 0c6d4cfb9..c4f411405 100644 --- a/src/storage/ob_value_row_iterator.h +++ b/src/storage/ob_value_row_iterator.h @@ -26,7 +26,7 @@ class ObValueRowIterator : public common::ObNewRowIterator { static const int64_t DEFAULT_ROW_NUM = 2; typedef common::ObSEArray RowArray; - public: +public: ObValueRowIterator(); virtual ~ObValueRowIterator(); virtual int init(bool unique); @@ -35,14 +35,14 @@ class ObValueRowIterator : public common::ObNewRowIterator { virtual int add_row(common::ObNewRow& row); virtual void reset(); - private: +private: bool is_inited_; bool unique_; common::ObArenaAllocator allocator_; RowArray rows_; int64_t cur_idx_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObValueRowIterator); }; diff --git a/src/storage/ob_warm_up.h b/src/storage/ob_warm_up.h index acfa4401a..d2e4be39b 100644 --- a/src/storage/ob_warm_up.h +++ b/src/storage/ob_warm_up.h @@ -32,7 +32,7 @@ class ObTransDesc; namespace storage { class ObWarmUpCtx { - public: +public: ObWarmUpCtx(); ~ObWarmUpCtx(); void record_exist_check(const common::ObPartitionKey& pkey, const int64_t table_id, @@ -66,7 +66,7 @@ class ObWarmUpCtx { } TO_STRING_KV(K_(request_list)); - private: +private: const static int64_t MAX_WARM_UP_REQUESTS_SIZE = 32 * 1024; common::ObArenaAllocator allocator_; ObWarmUpRequestList request_list_; @@ -77,7 +77,7 @@ class ObWarmUpCtx { class ObWarmUpService; class ObSendWarmUpTask : public common::IObDedupTask { - public: +public: ObSendWarmUpTask(); virtual ~ObSendWarmUpTask(); void assign(ObWarmUpService& warm_service, ObWarmUpCtx& warm_ctx, int64_t task_create_time); @@ -98,18 +98,18 @@ class ObSendWarmUpTask : public common::IObDedupTask { virtual int process(); TO_STRING_KV(K_(warm_ctx)); - private: +private: const static int64_t TASK_EXPIRE_TIME = 1000 * 1000; // 1s ObWarmUpService* warm_service_; ObWarmUpCtx* warm_ctx_; int64_t task_create_time_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSendWarmUpTask); }; class ObWarmUpService { - public: +public: ObWarmUpService(); ~ObWarmUpService(); void stop(); @@ -119,11 +119,11 @@ class ObWarmUpService { int deregister_warm_up_ctx(transaction::ObTransDesc& trans_desc); int send_warm_up_request(const ObWarmUpCtx& warm_up_ctx); - private: +private: int check_need_warm_up(bool& is_need); int get_members(const common::ObPartitionKey& pkey, common::ObMemberList& members); - private: +private: typedef common::hash::ObHashMap MemberMap; typedef common::hash::ObHashMap ServerMap; static const int32_t MAX_SEND_TASK_THREAD_CNT = 1; diff --git a/src/storage/ob_warm_up_request.h b/src/storage/ob_warm_up_request.h index 307468fe9..5b65d8042 100644 --- a/src/storage/ob_warm_up_request.h +++ b/src/storage/ob_warm_up_request.h @@ -43,7 +43,7 @@ struct ObWarmUpRequestType { }; class ObIWarmUpRequest { - public: +public: explicit ObIWarmUpRequest(common::ObIAllocator& allocator); virtual ~ObIWarmUpRequest(); virtual ObWarmUpRequestType::ObWarmUpRequestEnum get_request_type() const = 0; @@ -60,7 +60,7 @@ class ObIWarmUpRequest { TO_STRING_KV(K_(pkey), K_(table_id)); OB_UNIS_VERSION_V(1); - protected: +protected: int assign(const common::ObPartitionKey& pkey, const uint64_t table_id, const common::ObIArray& column_ids); int prepare_store_ctx(memtable::ObIMemtableCtxFactory* memctx_factory, ObStoreCtx* store_ctx) const; @@ -72,17 +72,17 @@ class ObIWarmUpRequest { common::ObSEArray column_ids_; common::ObIAllocator& allocator_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIWarmUpRequest); }; class ObIWarmUpReadRequest : public ObIWarmUpRequest { - public: +public: explicit ObIWarmUpReadRequest(common::ObIAllocator& allocator); virtual ~ObIWarmUpReadRequest(); OB_UNIS_VERSION_V(1); - protected: +protected: int assign(const ObTableAccessParam& param, const ObTableAccessContext& ctx); int prepare(ObTableAccessParam& param, ObTableAccessContext& context, common::ObArenaAllocator& allocator, blocksstable::ObBlockCacheWorkingSet& block_cache_ws, ObStoreCtx& store_ctx) const; @@ -92,12 +92,12 @@ class ObIWarmUpReadRequest : public ObIWarmUpRequest { common::ObSEArray out_cols_param_; common::ObQueryFlag query_flag_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIWarmUpReadRequest); }; class ObWarmUpExistRequest : public ObIWarmUpRequest { - public: +public: explicit ObWarmUpExistRequest(common::ObIAllocator& allocator); virtual ~ObWarmUpExistRequest(); int assign(const common::ObPartitionKey& pkey, const int64_t table_id, const common::ObStoreRowkey& rowkey, @@ -106,13 +106,13 @@ class ObWarmUpExistRequest : public ObIWarmUpRequest { virtual int warm_up(memtable::ObIMemtableCtxFactory* memctx_factory, const common::ObIArray& stores) const; OB_UNIS_VERSION_V(1); - private: +private: common::ObStoreRowkey rowkey_; DISALLOW_COPY_AND_ASSIGN(ObWarmUpExistRequest); }; class ObWarmUpGetRequest : public ObIWarmUpReadRequest { - public: +public: explicit ObWarmUpGetRequest(common::ObIAllocator& allocator); virtual ~ObWarmUpGetRequest(); int assign(const ObTableAccessParam& param, const ObTableAccessContext& ctx, const common::ObExtStoreRowkey& rowkey); @@ -120,13 +120,13 @@ class ObWarmUpGetRequest : public ObIWarmUpReadRequest { virtual int warm_up(memtable::ObIMemtableCtxFactory* memctx_factory, const common::ObIArray& stores) const; OB_UNIS_VERSION_V(1); - private: +private: common::ObExtStoreRowkey rowkey_; DISALLOW_COPY_AND_ASSIGN(ObWarmUpGetRequest); }; class ObWarmUpMultiGetRequest : public ObIWarmUpReadRequest { - public: +public: explicit ObWarmUpMultiGetRequest(common::ObIAllocator& allocator); virtual ~ObWarmUpMultiGetRequest(); int assign(const ObTableAccessParam& param, const ObTableAccessContext& ctx, @@ -135,13 +135,13 @@ class ObWarmUpMultiGetRequest : public ObIWarmUpReadRequest { virtual int warm_up(memtable::ObIMemtableCtxFactory* memctx_factory, const common::ObIArray& stores) const; OB_UNIS_VERSION_V(1); - private: +private: common::ObArray rowkeys_; DISALLOW_COPY_AND_ASSIGN(ObWarmUpMultiGetRequest); }; class ObWarmUpScanRequest : public ObIWarmUpReadRequest { - public: +public: explicit ObWarmUpScanRequest(common::ObIAllocator& allocator); virtual ~ObWarmUpScanRequest(); int assign(const ObTableAccessParam& param, const ObTableAccessContext& ctx, const common::ObExtStoreRange& range); @@ -149,13 +149,13 @@ class ObWarmUpScanRequest : public ObIWarmUpReadRequest { virtual int warm_up(memtable::ObIMemtableCtxFactory* memctx_factory, const common::ObIArray& stores) const; OB_UNIS_VERSION_V(1); - private: +private: common::ObExtStoreRange range_; DISALLOW_COPY_AND_ASSIGN(ObWarmUpScanRequest); }; class ObWarmUpMultiScanRequest : public ObIWarmUpReadRequest { - public: +public: explicit ObWarmUpMultiScanRequest(common::ObIAllocator& allocator); virtual ~ObWarmUpMultiScanRequest(); int assign(const ObTableAccessParam& param, const ObTableAccessContext& ctx, @@ -164,7 +164,7 @@ class ObWarmUpMultiScanRequest : public ObIWarmUpReadRequest { virtual int warm_up(memtable::ObIMemtableCtxFactory* memctx_factory, const common::ObIArray& stores) const; OB_UNIS_VERSION_V(1); - private: +private: common::ObSEArray ranges_; DISALLOW_COPY_AND_ASSIGN(ObWarmUpMultiScanRequest); }; @@ -172,7 +172,7 @@ class ObWarmUpMultiScanRequest : public ObIWarmUpReadRequest { typedef common::ObList ObWarmUpRequestList; class ObWarmUpRequestWrapper { - public: +public: ObWarmUpRequestWrapper(); virtual ~ObWarmUpRequestWrapper(); int add_request(const ObIWarmUpRequest& request); @@ -188,7 +188,7 @@ class ObWarmUpRequestWrapper { TO_STRING_KV(K_(request_list)); OB_UNIS_VERSION(1); - private: +private: common::ObArenaAllocator allocator_; ObWarmUpRequestList request_list_; }; diff --git a/src/storage/replayengine/ob_i_log_replay_engine.h b/src/storage/replayengine/ob_i_log_replay_engine.h index 62bf54e48..564ceb3ef 100644 --- a/src/storage/replayengine/ob_i_log_replay_engine.h +++ b/src/storage/replayengine/ob_i_log_replay_engine.h @@ -29,13 +29,13 @@ class ObIPartitionGroup; } // namespace storage namespace replayengine { class ObILogReplayEngine { - public: +public: ObILogReplayEngine() {} virtual ~ObILogReplayEngine() {} - public: +public: struct ObLogReplayEngineConfig { int64_t total_limit_; int64_t hold_limit_; @@ -47,7 +47,7 @@ class ObILogReplayEngine { TO_STRING_KV(K(total_limit_), K(hold_limit_), K(page_size_)); }; - public: +public: virtual int init(transaction::ObTransService* trans_replay_service, storage::ObPartitionService* partition_service, const ObLogReplayEngineConfig& config) = 0; virtual void destroy() = 0; diff --git a/src/storage/replayengine/ob_log_replay_engine.cpp b/src/storage/replayengine/ob_log_replay_engine.cpp index 083a11cc9..64db5f822 100644 --- a/src/storage/replayengine/ob_log_replay_engine.cpp +++ b/src/storage/replayengine/ob_log_replay_engine.cpp @@ -507,12 +507,8 @@ bool ObLogReplayEngine::is_valid_param( } /* -----------------submit log task related begin------ */ -int ObLogReplayEngine::submit_replay_log_task_sequentially(const common::ObPartitionKey &pkey, - const uint64_t log_id, - const int64_t log_ts, - const bool need_replay, - const ObLogType log_type, - const int64_t next_replay_log_ts) +int ObLogReplayEngine::submit_replay_log_task_sequentially(const common::ObPartitionKey& pkey, const uint64_t log_id, + const int64_t log_ts, const bool need_replay, const ObLogType log_type, const int64_t next_replay_log_ts) { int ret = OB_SUCCESS; if (IS_NOT_INIT) { @@ -553,13 +549,12 @@ int ObLogReplayEngine::submit_replay_log_task_sequentially(const common::ObParti } else { ObReplayStatus::RLockGuard rlock_guard(replay_status->get_rwlock()); bool need_submit = true; - if (need_replay && OB_FAIL(check_need_submit_current_log_(pkey, *partition, log_id, log_ts, - *replay_status, need_submit))) { - REPLAY_LOG(ERROR, "failed to check_need_submit_current_log_", - K(pkey), K(need_replay), K(log_id), K(log_ts), K(ret)); - } else if (OB_FAIL(replay_status->check_and_submit_task(pkey, log_id, log_ts, - (need_replay && need_submit), - log_type, next_replay_log_ts))) { + if (need_replay && + OB_FAIL(check_need_submit_current_log_(pkey, *partition, log_id, log_ts, *replay_status, need_submit))) { + REPLAY_LOG( + ERROR, "failed to check_need_submit_current_log_", K(pkey), K(need_replay), K(log_id), K(log_ts), K(ret)); + } else if (OB_FAIL(replay_status->check_and_submit_task( + pkey, log_id, log_ts, (need_replay && need_submit), log_type, next_replay_log_ts))) { if (OB_EAGAIN == ret) { if (REACH_TIME_INTERVAL(1000 * 1000)) { REPLAY_LOG(WARN, diff --git a/src/storage/replayengine/ob_log_replay_engine.h b/src/storage/replayengine/ob_log_replay_engine.h index a4ebd3e42..f16a684a6 100644 --- a/src/storage/replayengine/ob_log_replay_engine.h +++ b/src/storage/replayengine/ob_log_replay_engine.h @@ -44,47 +44,41 @@ class ObReplayLogTaskQueue; namespace replayengine { class ObLogReplayEngine : public ObILogReplayEngine, public lib::TGTaskHandler { - public: +public: typedef storage::ObReplayLogTask ObReplayLogTask; ObLogReplayEngine(); virtual ~ObLogReplayEngine(); - public: - virtual int init(transaction::ObTransService *trans_replay_service, - storage::ObPartitionService *partition_service, - const ObLogReplayEngineConfig &config); - virtual int submit_replay_log_task_sequentially(const common::ObPartitionKey &pkey, - const uint64_t log_id, - const int64_t log_submit_ts, - const bool need_replay, - const clog::ObLogType log_type, - const int64_t next_replay_log_ts); - virtual int submit_replay_log_task_by_restore(const common::ObPartitionKey &pkey, - const uint64_t log_id, - const int64_t log_ts); - virtual int add_partition(const common::ObPartitionKey &partition_key); - virtual int remove_partition(const common::ObPartitionKey &pkey, - storage::ObIPartitionGroup *partition); - virtual int remove_partition(const common::ObPartitionKey &partition_key); - virtual int reset_partition(const common::ObPartitionKey &partition_key); - virtual int set_need_filter_trans_log(const common::ObPartitionKey &partition_key, - const bool need_filter); +public: + virtual int init(transaction::ObTransService* trans_replay_service, storage::ObPartitionService* partition_service, + const ObLogReplayEngineConfig& config); + virtual int submit_replay_log_task_sequentially(const common::ObPartitionKey& pkey, const uint64_t log_id, + const int64_t log_submit_ts, const bool need_replay, const clog::ObLogType log_type, + const int64_t next_replay_log_ts); + virtual int submit_replay_log_task_by_restore( + const common::ObPartitionKey& pkey, const uint64_t log_id, const int64_t log_ts); - virtual int is_replay_finished(const common::ObPartitionKey &partition_key, bool &is_finished) const; - virtual int is_submit_finished(const common::ObPartitionKey &partition_key, bool &is_finished) const; - virtual int check_can_receive_log(const common::ObPartitionKey &pkey, bool &can_receive_log) const; - virtual int get_pending_submit_task_count(const common::ObPartitionKey &partition_key, int64_t &pending_count) const; - virtual void handle(void *task); - virtual int submit_task_into_queue(storage::ObReplayTask *task); + virtual int add_partition(const common::ObPartitionKey& partition_key); + virtual int remove_partition(const common::ObPartitionKey& pkey, storage::ObIPartitionGroup* partition); + virtual int remove_partition(const common::ObPartitionKey& partition_key); + virtual int reset_partition(const common::ObPartitionKey& partition_key); + virtual int set_need_filter_trans_log(const common::ObPartitionKey& partition_key, const bool need_filter); + + virtual int is_replay_finished(const common::ObPartitionKey& partition_key, bool& is_finished) const; + virtual int is_submit_finished(const common::ObPartitionKey& partition_key, bool& is_finished) const; + virtual int check_can_receive_log(const common::ObPartitionKey& pkey, bool& can_receive_log) const; + virtual int get_pending_submit_task_count(const common::ObPartitionKey& partition_key, int64_t& pending_count) const; + virtual void handle(void* task); + virtual int submit_task_into_queue(storage::ObReplayTask* task); virtual int is_tenant_out_of_memory(const common::ObPartitionKey& partition_key, bool& is_out_of_mem); virtual void stop(); virtual void wait(); virtual void destroy(); - private: +private: typedef common::ObSEArray ReplayLogTaskArray; struct ObTenantThreadKey { - public: + public: ObTenantThreadKey() { reset(); @@ -116,12 +110,12 @@ class ObLogReplayEngine : public ObILogReplayEngine, public lib::TGTaskHandler { } TO_STRING_KV(K_(tenant_id), K_(thread_idx)); - public: + public: uint64_t tenant_id_; uint64_t thread_idx_; }; struct ObThrottleEndTime { - public: + public: ObThrottleEndTime() { reset(); @@ -136,14 +130,14 @@ class ObLogReplayEngine : public ObILogReplayEngine, public lib::TGTaskHandler { } TO_STRING_KV(K(end_ts_)); - public: + public: union { int64_t end_ts_; // Writing throttling end time int64_t fail_count_; // count of consecutive failures }; }; - private: +private: void add_task(storage::ObReplayStatus& replay_status, ObReplayLogTask& replay_task); void remove_task(storage::ObReplayStatus& replay_status, ObReplayLogTask& replay_task); void destroy_task(storage::ObReplayStatus& replay_status, ObReplayLogTask& replay_task); @@ -205,7 +199,7 @@ class ObLogReplayEngine : public ObILogReplayEngine, public lib::TGTaskHandler { int get_throttle_end_time_( const uint64_t tenant_id, const bool create_if_not_exist_in_map, ObThrottleEndTime*& throttle_end_time); - private: +private: const int64_t MAX_REPLAY_TIME_PER_ROUND = 10 * 1000; // 10ms const int64_t MAX_SUBMIT_TIME_PER_ROUND = 10 * 1000; // 10ms const int64_t TASK_QUEUE_WAIT_IN_GLOBAL_QUEUE_TIME_THRESHOLD = 5 * 1000 * 1000; // 10s @@ -225,7 +219,7 @@ class ObLogReplayEngine : public ObILogReplayEngine, public lib::TGTaskHandler { static const int64_t REPLAY_CONTROL_ARRAY_SIZE = 128 * 1024L; const uint64_t MAX_CACHE_TENANT_ID = 5000; - private: +private: bool is_inited_; bool is_stopped_; int tg_id_; diff --git a/src/storage/transaction/ob_clog_adapter.h b/src/storage/transaction/ob_clog_adapter.h index f99f4da61..f184383a3 100644 --- a/src/storage/transaction/ob_clog_adapter.h +++ b/src/storage/transaction/ob_clog_adapter.h @@ -46,7 +46,7 @@ class ObIPartitionGroup; namespace transaction { class ObIClogAdapter { - public: +public: ObIClogAdapter() {} virtual ~ObIClogAdapter(){}; @@ -91,7 +91,7 @@ class ObIClogAdapter { }; class ObClogAdapter : public ObIClogAdapter, public lib::TGTaskHandler { - public: +public: ObClogAdapter(); ~ObClogAdapter() { @@ -136,13 +136,13 @@ class ObClogAdapter : public ObIClogAdapter, public lib::TGTaskHandler { int submit_backfill_nop_log_task(const common::ObPartitionKey& partition, const clog::ObLogMeta& log_meta); int get_last_submit_timestamp(const common::ObPartitionKey& partition, int64_t& timestamp); - public: +public: static bool need_retry(const int ret) { return OB_ALLOCATE_MEMORY_FAILED == ret || OB_EAGAIN == ret; } - private: +private: void reset_statistics(); void statistics(); int submit_log_(const common::ObPartitionKey& partition, const common::ObVersion& version, const char* buf, @@ -157,15 +157,15 @@ class ObClogAdapter : public ObIClogAdapter, public lib::TGTaskHandler { int64_t& leader_epoch, common::ObTsWindows& changing_leader_windows); bool is_cluster_allow_submit_log_(const common::ObPartitionArray& partition_array) const; - private: +private: // apply for a queue with TOTAL_TASK length, at most (TOTAL_TASK - RESERVE_TASK) // outside tasks is allowed, RESERVE_TASK reserved for inner tasks. static const int64_t RESERVE_TASK = 10000; // the upper limit of participants on a single observer is 500k, plus 10000 for reserved ctx - public: +public: static const int64_t TOTAL_TASK = MAX_PART_CTX_COUNT + RESERVE_TASK; - private: +private: bool is_inited_; bool is_running_; storage::ObPartitionService* partition_service_; @@ -178,7 +178,7 @@ class ObClogAdapter : public ObIClogAdapter, public lib::TGTaskHandler { }; class AllocLogIdTask : public ObTransTask { - public: +public: AllocLogIdTask() : ObTransTask(), log_type_(storage::ObStorageLogType::OB_LOG_UNKNOWN), ctx_(NULL) {} virtual ~AllocLogIdTask() @@ -200,14 +200,14 @@ class AllocLogIdTask : public ObTransTask { return ctx_; } - private: +private: int64_t log_type_; ObTransCtx* ctx_; DISALLOW_COPY_AND_ASSIGN(AllocLogIdTask); }; class SubmitLogTask : public ObTransTask { - public: +public: SubmitLogTask() : ObTransTask(), with_need_update_version_(false), clog_buf_(NULL), cb_(NULL), allocator_(NULL) { reset(); @@ -222,7 +222,7 @@ class SubmitLogTask : public ObTransTask { const int64_t size, const bool with_need_update_version, const int64_t local_trans_version, const bool with_base_ts, const int64_t base_ts, ObITransSubmitLogCb* cb, ObConcurrentFIFOAllocator* allocator); - public: +public: const common::ObPartitionKey& get_partition() const { return partition_; @@ -268,12 +268,12 @@ class SubmitLogTask : public ObTransTask { process_begin_ts_ = ObTimeUtility::current_time(); } - public: +public: TO_STRING_KV(KP(this), K_(partition), K_(version), K_(with_need_update_version), K_(local_trans_version), K_(with_base_ts), K_(base_ts), K_(submit_task_ts), K_(process_begin_ts), "cb", *(static_cast(cb_))); - private: +private: common::ObPartitionKey partition_; common::ObVersion version_; bool with_need_update_version_; @@ -290,7 +290,7 @@ class SubmitLogTask : public ObTransTask { }; class BackfillNopLogTask : public ObTransTask { - public: +public: BackfillNopLogTask() : ObTransTask() { reset(); @@ -315,16 +315,16 @@ class BackfillNopLogTask : public ObTransTask { } bool is_valid() const; - public: +public: TO_STRING_KV(KP(this), K_(partition), K_(log_meta)); - private: +private: common::ObPartitionKey partition_; clog::ObLogMeta log_meta_; }; class AggreLogTask : public ObTransTask { - public: +public: AggreLogTask() : ObTransTask() { reset(); @@ -356,10 +356,10 @@ class AggreLogTask : public ObTransTask { return in_queue_; } - public: +public: TO_STRING_KV(KP(this), K_(partition)); - private: +private: common::ObPartitionKey partition_; ObTransLogBufferAggreContainer* container_; bool in_queue_; diff --git a/src/storage/transaction/ob_dup_table.h b/src/storage/transaction/ob_dup_table.h index 22181d969..56c7ac829 100644 --- a/src/storage/transaction/ob_dup_table.h +++ b/src/storage/transaction/ob_dup_table.h @@ -32,7 +32,7 @@ typedef common::LinkHashNode DupTableLeaseInfoHashNode; typedef common::LinkHashValue DupTableLeaseInfoHashValue; class ObDupTableLeaseInfo : public DupTableLeaseInfoHashValue { - public: +public: ObDupTableLeaseInfo() { reset(); @@ -56,7 +56,7 @@ class ObDupTableLeaseInfo : public DupTableLeaseInfoHashValue { void destroy(); TO_STRING_KV(K_(lease_expired_ts), K_(cur_log_id)); - private: +private: // expire time of lease, -1 means already expired int64_t lease_expired_ts_; uint64_t cur_log_id_; @@ -64,7 +64,7 @@ class ObDupTableLeaseInfo : public DupTableLeaseInfoHashValue { // for virtual table display only class ObDupTableLeaseInfoStat { - public: +public: ObDupTableLeaseInfoStat(const common::ObAddr& addr, const int64_t lease_expired_ts, const uint64_t cur_log_id) : addr_(addr), lease_expired_ts_(lease_expired_ts), cur_log_id_(cur_log_id) {} @@ -83,7 +83,7 @@ class ObDupTableLeaseInfoStat { } TO_STRING_KV(K_(addr), K_(lease_expired_ts), K_(cur_log_id)); - private: +private: common::ObAddr addr_; int64_t lease_expired_ts_; uint64_t cur_log_id_; @@ -91,7 +91,7 @@ class ObDupTableLeaseInfoStat { // statistics data about lease request class ObDupTableLeaseRequestStatistics { - public: +public: ObDupTableLeaseRequestStatistics() { reset(); @@ -131,7 +131,7 @@ class ObDupTableLeaseRequestStatistics { } void statistics(const common::ObPartitionKey& pkey); - private: +private: int64_t request_count_; int64_t resp_succ_count_; int64_t resp_lease_expired_count_; @@ -144,7 +144,7 @@ class ObDupTableLeaseRequestStatistics { typedef common::ObSEArray ObDupTableLeaseInfoArray; class ObDupTablePartitionInfo { - public: +public: ObDupTablePartitionInfo() { reset(); @@ -179,10 +179,10 @@ class ObDupTablePartitionInfo { lease_request_statistics_.statistics(pkey); } - private: +private: bool check_trans_log_id_replayed_(const ObTransID& trans_id, const uint64_t log_id); - private: +private: ObPartitionTransCtxMgr* partition_mgr_; // expire time of lease int64_t lease_expired_ts_; @@ -196,7 +196,7 @@ class ObDupTablePartitionInfo { }; class DupTableLeaseInfoAlloc { - public: +public: ObDupTableLeaseInfo* alloc_value() { return NULL; @@ -226,7 +226,7 @@ typedef common::ObLinkHashMap ObDupTableLeaseTaskHashValue; class ObDupTableLeaseTask : public ObITimeoutTask, public ObDupTableLeaseTaskHashValue { - public: +public: ObDupTableLeaseTask() : is_inited_(false), trans_service_(NULL) {} virtual ~ObDupTableLeaseTask() @@ -441,21 +441,21 @@ class ObDupTableLeaseTask : public ObITimeoutTask, public ObDupTableLeaseTaskHas int init(const common::ObPartitionKey pkey, ObTransService* trans_service); void reset(); - public: +public: virtual void runTimerTask() override; virtual uint64_t hash() const override { return pkey_.hash(); } - private: +private: bool is_inited_; ObTransService* trans_service_; common::ObPartitionKey pkey_; }; class ObDupTableRedoSyncTask : public ObTransTask { - public: +public: ObDupTableRedoSyncTask() : ObTransTask(ObTransRetryTaskType::UNKNOWN) { reset(); @@ -515,7 +515,7 @@ class ObDupTableRedoSyncTask : public ObTransTask { TO_STRING_KV(K_(trans_id), K_(partition), K_(log_id), K_(task_type), K_(log_type), K_(timestamp), K_(last_generate_mask_set_ts), K_(is_mask_set_ready)); - public: +public: ObTransID trans_id_; common::ObPartitionKey partition_; uint64_t log_id_; diff --git a/src/storage/transaction/ob_dup_table_rpc.h b/src/storage/transaction/ob_dup_table_rpc.h index a2828581f..b033af54f 100644 --- a/src/storage/transaction/ob_dup_table_rpc.h +++ b/src/storage/transaction/ob_dup_table_rpc.h @@ -37,7 +37,7 @@ class ObTransService; class ObDupTableMsgHeader { OB_UNIS_VERSION(1); - public: +public: ObDupTableMsgHeader() { reset(); @@ -60,7 +60,7 @@ class ObDupTableMsgHeader { } TO_STRING_KV(K_(src), K_(dst), K_(proxy)); - protected: +protected: ObAddr src_; ObAddr dst_; ObAddr proxy_; @@ -69,7 +69,7 @@ class ObDupTableMsgHeader { class ObDupTableLeaseRequestMsg : public ObDupTableMsgHeader { OB_UNIS_VERSION(1); - public: +public: ObDupTableLeaseRequestMsg() { reset(); @@ -102,7 +102,7 @@ class ObDupTableLeaseRequestMsg : public ObDupTableMsgHeader { void reset(); TO_STRING_KV(K_(request_ts), K_(partition), K_(addr), K_(last_log_id), K_(request_lease_interval_us)); - private: +private: // the send timestamp of a copy replica applying for lease int64_t request_ts_; common::ObPartitionKey partition_; @@ -115,7 +115,7 @@ class ObDupTableLeaseRequestMsg : public ObDupTableMsgHeader { class ObDupTableLeaseResponseMsg : public ObDupTableMsgHeader { OB_UNIS_VERSION(1); - public: +public: ObDupTableLeaseResponseMsg() { reset(); @@ -154,7 +154,7 @@ class ObDupTableLeaseResponseMsg : public ObDupTableMsgHeader { void reset(); TO_STRING_KV(K_(request_ts), K_(partition), K_(cur_log_id), K_(status), K_(lease_interval_us)); - private: +private: // the send timestamp of a copy replica applying for lease int64_t request_ts_; common::ObPartitionKey partition_; @@ -167,7 +167,7 @@ class ObDupTableLeaseResponseMsg : public ObDupTableMsgHeader { class ObRedoLogSyncRequestMsg : public ObDupTableMsgHeader { OB_UNIS_VERSION(1); - public: +public: ObRedoLogSyncRequestMsg() { reset(); @@ -200,7 +200,7 @@ class ObRedoLogSyncRequestMsg : public ObDupTableMsgHeader { void reset(); TO_STRING_KV(K_(partition), K_(log_id), K_(log_ts), K_(trans_id), K_(log_type)); - private: +private: common::ObPartitionKey partition_; uint64_t log_id_; int64_t log_ts_; @@ -211,7 +211,7 @@ class ObRedoLogSyncRequestMsg : public ObDupTableMsgHeader { class ObRedoLogSyncResponseMsg : public ObDupTableMsgHeader { OB_UNIS_VERSION(1); - public: +public: ObRedoLogSyncResponseMsg() { reset(); @@ -250,7 +250,7 @@ class ObRedoLogSyncResponseMsg : public ObDupTableMsgHeader { void reset(); TO_STRING_KV(K_(partition), K_(log_id), K_(trans_id), K_(addr), K_(status)); - private: +private: common::ObPartitionKey partition_; uint64_t log_id_; ObTransID trans_id_; @@ -262,7 +262,7 @@ class ObRedoLogSyncResponseMsg : public ObDupTableMsgHeader { namespace obrpc { class ObDupTableRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObDupTableRpcProxy); RPC_AP(PRZ post_dup_table_lease_request, OB_DUP_TABLE_LEASE_REQUEST, (transaction::ObDupTableLeaseRequestMsg)); @@ -272,63 +272,63 @@ class ObDupTableRpcProxy : public obrpc::ObRpcProxy { }; class ObDupTableLeaseRequestMsgP : public ObRpcProcessor> { - public: +public: explicit ObDupTableLeaseRequestMsgP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDupTableLeaseRequestMsgP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObDupTableLeaseResponseMsgP : public ObRpcProcessor> { - public: +public: explicit ObDupTableLeaseResponseMsgP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDupTableLeaseResponseMsgP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObRedoLogSyncRequestP : public ObRpcProcessor> { - public: +public: explicit ObRedoLogSyncRequestP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRedoLogSyncRequestP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObRedoLogSyncResponseP : public ObRpcProcessor> { - public: +public: explicit ObRedoLogSyncResponseP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObRedoLogSyncResponseP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; @@ -336,7 +336,7 @@ class ObRedoLogSyncResponseP : public ObRpcProcessor GCInfoNode; typedef common::LinkHashValue GCInfoValue; class GCInfo : public GCInfoValue { - public: +public: GCInfo() : access_ts_(common::ObTimeUtility::current_time()), update_ts_(0), status_(GC_STATUS_UNKNOWN) {} ~GCInfo() @@ -68,14 +68,14 @@ class GCInfo : public GCInfoValue { (void)ATOMIC_STORE(&access_ts_, common::ObTimeUtility::current_time()); } - private: +private: int64_t access_ts_; int64_t update_ts_; int status_; }; class GCInfoAlloc { - public: +public: static GCInfo* alloc_value() { return NULL; @@ -104,13 +104,13 @@ class GCInfoAlloc { typedef common::ObLinkHashMap GCMap; class ObGCPartitionAdapter : public share::ObThreadPool { - public: +public: ObGCPartitionAdapter() : is_inited_(false), is_running_(false), sql_proxy_(NULL) {} ~ObGCPartitionAdapter() {} - public: +public: int init(common::ObMySQLProxy* sql_proxy); int start(); void stop(); @@ -118,16 +118,16 @@ class ObGCPartitionAdapter : public share::ObThreadPool { void destroy(); void run1(); - public: +public: int check_partition_exist(const common::ObPartitionKey& pkey, bool& exist); - public: +public: static ObGCPartitionAdapter& get_instance(); - private: +private: static const int64_t BATCH_GC_PARTITION_QUERY = 64; - private: +private: int refresh_all_partition_status_(); int refresh_partition_status_(const common::ObIArray& pkey_array); int clear_obsolete_partition_(); @@ -137,7 +137,7 @@ class ObGCPartitionAdapter : public share::ObThreadPool { int update_partition_status_( const common::ObIArray& pkey_array, const common::ObIArray& status_array); - private: +private: bool is_inited_; bool is_running_; common::ObMySQLProxy* sql_proxy_; @@ -147,29 +147,29 @@ class ObGCPartitionAdapter : public share::ObThreadPool { #define GC_PARTITION_ADAPTER (oceanbase::transaction::ObGCPartitionAdapter::get_instance()) class GetUnknownPartition { - public: +public: explicit GetUnknownPartition(common::ObIArray& array) : array_(array) {} ~GetUnknownPartition() {} bool operator()(const common::ObPartitionKey& pkey, GCInfo* info); - private: +private: static const int64_t MAX_STATUS_REFRESH_INTERVAL = 1 * 1000 * 1000; - private: +private: common::ObIArray& array_; }; class RemoveObsoletePartition { - public: +public: RemoveObsoletePartition() {} ~RemoveObsoletePartition() {} bool operator()(const common::ObPartitionKey& pkey, GCInfo* info); - private: +private: static const int64_t STATUS_OBSOLETE_TIME = 600 * 1000 * 1000; }; diff --git a/src/storage/transaction/ob_gts_local_cache.h b/src/storage/transaction/ob_gts_local_cache.h index 92ea8ea64..57ac5dad2 100644 --- a/src/storage/transaction/ob_gts_local_cache.h +++ b/src/storage/transaction/ob_gts_local_cache.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace transaction { class ObGTSLocalCache { - public: +public: ObGTSLocalCache() { reset(); @@ -63,7 +63,7 @@ class ObGTSLocalCache { TO_STRING_KV(K_(srr), K_(gts), K_(local_trans_version), K_(barrier_ts), K_(latest_srr)); - private: +private: // send rpc request timestamp MonotonicTs srr_; // The latest local gts value is always less than or equal to the gts leader diff --git a/src/storage/transaction/ob_gts_mgr.h b/src/storage/transaction/ob_gts_mgr.h index c37a90754..880f37c7b 100644 --- a/src/storage/transaction/ob_gts_mgr.h +++ b/src/storage/transaction/ob_gts_mgr.h @@ -29,18 +29,18 @@ class ObReqTransport; namespace transaction { class ObIGtsResponseRpc; class ObITimestampService { - public: +public: virtual int get_timestamp(const common::ObPartitionKey& partition, int64_t& gts, common::ObAddr& leader) const = 0; }; class ObIGlobalTimestampService { - public: +public: virtual int handle_request(const ObGtsRequest& request, obrpc::ObGtsRpcResult& result) = 0; virtual int get_gts(const ObPartitionKey& gts_pkey, ObAddr& leader, int64_t& gts) = 0; }; class ObGlobalTimestampService : public ObIGlobalTimestampService { - public: +public: ObGlobalTimestampService() : is_inited_(false), is_running_(false), ts_service_(NULL), rpc_(NULL) {} ~ObGlobalTimestampService() @@ -53,11 +53,11 @@ class ObGlobalTimestampService : public ObIGlobalTimestampService { int wait(); void destroy(); - public: +public: int handle_request(const ObGtsRequest& request, obrpc::ObGtsRpcResult& result); int get_gts(const ObPartitionKey& gts_pkey, ObAddr& leader, int64_t& gts); - private: +private: int handle_local_request_(const ObGtsRequest& request, obrpc::ObGtsRpcResult& result); bool is_inited_; bool is_running_; diff --git a/src/storage/transaction/ob_gts_msg.h b/src/storage/transaction/ob_gts_msg.h index 8e67b6b54..752f472de 100644 --- a/src/storage/transaction/ob_gts_msg.h +++ b/src/storage/transaction/ob_gts_msg.h @@ -27,7 +27,7 @@ namespace transaction { class ObGtsRequest { OB_UNIS_VERSION(1); - public: +public: ObGtsRequest() : tenant_id_(0), srr_(0), range_size_(0), gts_pkey_(), sender_() {} ~ObGtsRequest() @@ -36,7 +36,7 @@ class ObGtsRequest { const common::ObPartitionKey& gts_pkey, const common::ObAddr& sender); bool is_valid() const; - public: +public: uint64_t get_tenant_id() const { return tenant_id_; @@ -55,7 +55,7 @@ class ObGtsRequest { } TO_STRING_KV(K_(tenant_id), K_(srr), K_(range_size), K_(gts_pkey), K_(sender)); - private: +private: uint64_t tenant_id_; MonotonicTs srr_; int64_t range_size_; @@ -66,7 +66,7 @@ class ObGtsRequest { class ObGtsErrResponse { OB_UNIS_VERSION(1); - public: +public: ObGtsErrResponse() : tenant_id_(0), srr_(0), status_(0), leader_(), sender_() {} ~ObGtsErrResponse() @@ -75,7 +75,7 @@ class ObGtsErrResponse { const common::ObAddr& sender); bool is_valid() const; - public: +public: uint64_t get_tenant_id() const { return tenant_id_; @@ -98,7 +98,7 @@ class ObGtsErrResponse { } TO_STRING_KV(K_(tenant_id), K_(srr), K_(status), K_(leader), K_(sender)); - private: +private: uint64_t tenant_id_; MonotonicTs srr_; int status_; diff --git a/src/storage/transaction/ob_gts_response_handler.h b/src/storage/transaction/ob_gts_response_handler.h index 1b88965d6..5b2755cc8 100644 --- a/src/storage/transaction/ob_gts_response_handler.h +++ b/src/storage/transaction/ob_gts_response_handler.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace transaction { class ObTsMgr; class ObGtsResponseHandler : public rpc::frame::ObReqProcessor { - public: +public: ObGtsResponseHandler() { reset(); @@ -33,7 +33,7 @@ class ObGtsResponseHandler : public rpc::frame::ObReqProcessor { int init(observer::ObSrvTask* task, ObTsMgr* ts_mgr); void reset(); - protected: +protected: int deserialize() { return common::OB_SUCCESS; @@ -54,14 +54,14 @@ class ObGtsResponseHandler : public rpc::frame::ObReqProcessor { return common::OB_SUCCESS; } - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGtsResponseHandler); observer::ObSrvTask* task_; ObTsMgr* ts_mgr_; }; // end of class ObGtsResponseHandler class ObGtsResponseTask : public observer::ObSrvTask { - public: +public: ObGtsResponseTask() { reset(); @@ -88,7 +88,7 @@ class ObGtsResponseTask : public observer::ObSrvTask { } TO_STRING_KV(KP(this), K_(queue_index), K_(ts_type)); - private: +private: uint64_t tenant_id_; int64_t queue_index_; ObGtsResponseHandler handler_; @@ -96,11 +96,11 @@ class ObGtsResponseTask : public observer::ObSrvTask { }; class ObGtsResponseTaskFactory { - public: +public: static ObGtsResponseTask* alloc(); static void free(ObGtsResponseTask* task); - private: +private: static int64_t alloc_count_; static int64_t free_count_; }; diff --git a/src/storage/transaction/ob_gts_rpc.h b/src/storage/transaction/ob_gts_rpc.h index cf6cf7fe3..730a8fb4f 100644 --- a/src/storage/transaction/ob_gts_rpc.h +++ b/src/storage/transaction/ob_gts_rpc.h @@ -47,7 +47,7 @@ namespace obrpc { class ObGtsRpcResult { OB_UNIS_VERSION(1); - public: +public: ObGtsRpcResult() { reset(); @@ -80,10 +80,10 @@ class ObGtsRpcResult { bool is_valid() const; TO_STRING_KV(K_(tenant_id), K_(status), K_(srr), K_(gts_start), K_(gts_end)); - public: +public: static const int64_t OB_GTS_RPC_TIMEOUT = 1 * 1000 * 1000; - private: +private: uint64_t tenant_id_; int status_; transaction::MonotonicTs srr_; @@ -92,7 +92,7 @@ class ObGtsRpcResult { }; class ObGtsRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObGtsRpcProxy); RPC_AP(PR1 post, OB_GET_GTS_REQUEST, (transaction::ObGtsRequest), ObGtsRpcResult); @@ -100,38 +100,38 @@ class ObGtsRpcProxy : public obrpc::ObRpcProxy { }; class ObGtsP : public ObRpcProcessor > { - public: +public: explicit ObGtsP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGtsP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObGtsErrRespP : public ObRpcProcessor > { - public: +public: explicit ObGtsErrRespP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObGtsErrRespP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; template class ObGtsRPCCB : public ObGtsRpcProxy::AsyncCB { - public: +public: ObGtsRPCCB() : is_inited_(false), tenant_id_(0), ts_mgr_(NULL), gts_worker_(NULL) {} ~ObGtsRPCCB() @@ -169,7 +169,7 @@ class ObGtsRPCCB : public ObGtsRpcProxy::AsyncCB { return newcb; } - public: +public: int process() { const ObGtsRpcResult& result = ObGtsRpcProxy::AsyncCB::result_; @@ -207,7 +207,7 @@ class ObGtsRPCCB : public ObGtsRpcProxy::AsyncCB { } } - private: +private: int process_(const obrpc::ObGtsRpcResult& result, const common::ObAddr& dst, obrpc::ObRpcResultCode& rcode) { int ret = OB_SUCCESS; @@ -291,7 +291,7 @@ class ObGtsRPCCB : public ObGtsRpcProxy::AsyncCB { namespace transaction { class ObIGtsRequestRpc { - public: +public: ObIGtsRequestRpc() {} virtual ~ObIGtsRequestRpc() @@ -301,12 +301,12 @@ class ObIGtsRequestRpc { virtual int wait() = 0; virtual void destroy() = 0; - public: +public: virtual int post(const uint64_t tenant_id, const common::ObAddr& server, const ObGtsRequest& msg) = 0; }; class ObGtsRequestRpc : public ObIGtsRequestRpc { - public: +public: ObGtsRequestRpc() : is_inited_(false), is_running_(false), rpc_proxy_(NULL), global_timestamp_service_(NULL), ts_mgr_(NULL) {} @@ -321,10 +321,10 @@ class ObGtsRequestRpc : public ObIGtsRequestRpc { int wait(); void destroy(); - public: +public: int post(const uint64_t tenant_id, const common::ObAddr& server, const ObGtsRequest& msg); - private: +private: bool is_inited_; bool is_running_; obrpc::ObGtsRpcProxy* rpc_proxy_; @@ -335,18 +335,18 @@ class ObGtsRequestRpc : public ObIGtsRequestRpc { }; class ObIGtsResponseRpc { - public: +public: ObIGtsResponseRpc() {} virtual ~ObIGtsResponseRpc() {} - public: +public: virtual int post(const uint64_t tenant_id, const common::ObAddr& server, const ObGtsErrResponse& msg) = 0; }; class ObGtsResponseRpc : public ObIGtsResponseRpc { - public: +public: ObGtsResponseRpc() : is_inited_(false), is_running_(false) {} ~ObGtsResponseRpc() @@ -359,10 +359,10 @@ class ObGtsResponseRpc : public ObIGtsResponseRpc { int wait(); void destroy(); - public: +public: int post(const uint64_t tenant_id, const common::ObAddr& server, const ObGtsErrResponse& msg); - private: +private: bool is_inited_; bool is_running_; obrpc::ObGtsRpcProxy rpc_proxy_; diff --git a/src/storage/transaction/ob_gts_source.h b/src/storage/transaction/ob_gts_source.h index 368af96ec..97f7f42a0 100644 --- a/src/storage/transaction/ob_gts_source.h +++ b/src/storage/transaction/ob_gts_source.h @@ -37,7 +37,7 @@ namespace transaction { class ObGtsStatistics { static const int64_t STAT_INTERVAL = 5 * 1000 * 1000; - public: +public: ObGtsStatistics() { reset(); @@ -76,7 +76,7 @@ class ObGtsStatistics { } void statistics(); - private: +private: uint64_t tenant_id_; int64_t last_stat_ts_; int64_t gts_rpc_cnt_; @@ -91,7 +91,7 @@ class ObGtsStatistics { }; class ObGtsSource : public ObITsSource { - public: +public: ObGtsSource() : log_interval_(3 * 1000 * 1000) { reset(); @@ -116,7 +116,7 @@ class ObGtsSource : public ObITsSource { int get_latest_srr(MonotonicTs& latest_srr); int64_t get_task_count() const; - public: +public: int update_gts(const int64_t gts, bool& update); int get_gts(const MonotonicTs stc, ObTsCbTask* task, int64_t& gts, MonotonicTs& receive_gts_ts); int get_gts(ObTsCbTask* task, int64_t& gts); @@ -140,7 +140,7 @@ class ObGtsSource : public ObITsSource { } TO_STRING_KV(K_(tenant_id), K_(gts_pkey), K_(gts_local_cache), K_(server)); - private: +private: int generate_gts_pkey_(); int get_gts_leader_(common::ObAddr& leader); int refresh_gts_location_(); @@ -151,13 +151,13 @@ class ObGtsSource : public ObITsSource { int get_gts_from_local_timestamp_service_(common::ObAddr& leader, int64_t& gts); int verify_publish_version_(const int64_t publish_version); - public: +public: static const int64_t GET_GTS_QUEUE_COUNT = 1; static const int64_t WAIT_GTS_QUEUE_COUNT = 1; static const int64_t WAIT_GTS_QUEUE_START_INDEX = GET_GTS_QUEUE_COUNT; static const int64_t TOTAL_GTS_QUEUE_COUNT = GET_GTS_QUEUE_COUNT + WAIT_GTS_QUEUE_COUNT; - private: +private: bool is_inited_; int64_t tenant_id_; common::ObPartitionKey gts_pkey_; diff --git a/src/storage/transaction/ob_gts_task_queue.h b/src/storage/transaction/ob_gts_task_queue.h index 3c888767e..6f18f525d 100644 --- a/src/storage/transaction/ob_gts_task_queue.h +++ b/src/storage/transaction/ob_gts_task_queue.h @@ -24,7 +24,7 @@ namespace transaction { class ObTsCbTask; class ObGTSTaskQueue { - public: +public: ObGTSTaskQueue() : is_inited_(false), task_type_(INVALID_GTS_TASK_TYPE) {} ~ObGTSTaskQueue() @@ -42,10 +42,10 @@ class ObGTSTaskQueue { return queue_.size(); } - private: +private: static const int64_t TOTAL_WAIT_TASK_NUM = 500 * 1000; - private: +private: bool is_inited_; ObGTSCacheTaskType task_type_; common::ObLinkQueue queue_; diff --git a/src/storage/transaction/ob_gts_worker.h b/src/storage/transaction/ob_gts_worker.h index 7b356e72b..94a3efef2 100644 --- a/src/storage/transaction/ob_gts_worker.h +++ b/src/storage/transaction/ob_gts_worker.h @@ -22,7 +22,7 @@ namespace transaction { class ObGtsResponseTask; class ObTsMgr; class ObGtsWorker : public lib::TGTaskHandler { - public: +public: ObGtsWorker() : is_inited_(false), use_local_worker_(false), ts_mgr_(NULL) {} ~ObGtsWorker() @@ -32,16 +32,16 @@ class ObGtsWorker : public lib::TGTaskHandler { void wait(); void destroy(); - public: +public: int push_task(const uint64_t tenant_id, ObGtsResponseTask* task); void handle(void* task); - public: +public: static const int64_t THREAD_NUM = 8; static const int64_t MINI_MODE_THREAD_NUM = 1; static const int64_t MAX_TASK_NUM = 10240; - private: +private: bool is_inited_; bool use_local_worker_; ObTsMgr* ts_mgr_; diff --git a/src/storage/transaction/ob_ha_gts_source.h b/src/storage/transaction/ob_ha_gts_source.h index ee98731ca..0064a0639 100644 --- a/src/storage/transaction/ob_ha_gts_source.h +++ b/src/storage/transaction/ob_ha_gts_source.h @@ -32,7 +32,7 @@ class ObIGtsRequestRpc; namespace transaction { class ObHaGtsSource : public ObITsSource { - public: +public: ObHaGtsSource() : log_interval_(3 * 1000 * 1000) { reset(); @@ -54,7 +54,7 @@ class ObHaGtsSource : public ObITsSource { int get_latest_srr(MonotonicTs& latest_srr); int64_t get_task_count() const; - public: +public: int update_gts(const int64_t gts, bool& update); int get_gts(const MonotonicTs stc, ObTsCbTask* task, int64_t& gts, MonotonicTs& receive_gts_ts); int get_gts(ObTsCbTask* task, int64_t& gts); @@ -74,17 +74,17 @@ class ObHaGtsSource : public ObITsSource { int get_publish_version(int64_t& publish_version); TO_STRING_KV(K_(tenant_id), K_(gts_local_cache), K_(server)); - private: +private: void statistics_(); int refresh_gts_(const bool need_refresh); - public: +public: static const int64_t GET_GTS_QUEUE_COUNT = 1; static const int64_t WAIT_GTS_QUEUE_COUNT = 1; static const int64_t WAIT_GTS_QUEUE_START_INDEX = GET_GTS_QUEUE_COUNT; static const int64_t TOTAL_GTS_QUEUE_COUNT = GET_GTS_QUEUE_COUNT + WAIT_GTS_QUEUE_COUNT; - private: +private: bool is_inited_; int64_t tenant_id_; ObGTSLocalCache gts_local_cache_; diff --git a/src/storage/transaction/ob_i_ts_source.h b/src/storage/transaction/ob_i_ts_source.h index 6ec4cc220..9c271483e 100644 --- a/src/storage/transaction/ob_i_ts_source.h +++ b/src/storage/transaction/ob_i_ts_source.h @@ -40,7 +40,7 @@ inline bool is_ts_type_external_consistent(const int64_t ts_type) } class ObTsParam { - public: +public: ObTsParam() { reset(); @@ -66,14 +66,14 @@ class ObTsParam { return need_inc_; } - private: +private: // Whether the gts value needs to be +1, // it is increased by one by default in the gts cache management bool need_inc_; }; class ObITsSource { - public: +public: virtual int update_gts(const int64_t gts, bool& update) = 0; virtual int update_local_trans_version(const int64_t version, bool& update) = 0; virtual int get_gts(const MonotonicTs stc, ObTsCbTask* task, int64_t& gts, MonotonicTs& receive_gts_ts) = 0; @@ -92,7 +92,7 @@ class ObITsSource { virtual int update_publish_version(const int64_t publish_version) = 0; virtual int get_publish_version(int64_t& publish_version) = 0; - public: +public: VIRTUAL_TO_STRING_KV("", ""); }; diff --git a/src/storage/transaction/ob_i_weak_read_service.h b/src/storage/transaction/ob_i_weak_read_service.h index 31aa68bf0..1f552890f 100644 --- a/src/storage/transaction/ob_i_weak_read_service.h +++ b/src/storage/transaction/ob_i_weak_read_service.h @@ -57,11 +57,11 @@ const char* wrs_level_to_str(const int level); class ObIWrsRpc; class ObIWeakReadService { - public: +public: virtual ~ObIWeakReadService() {} - public: +public: /// get SERVER level wrs version /// /// @param [in] tenant_id target tenant ID @@ -93,7 +93,7 @@ class ObIWeakReadService { virtual void process_cluster_heartbeat_rpc_cb(const uint64_t tenant_id, const obrpc::ObRpcResultCode& rcode, const obrpc::ObWrsClusterHeartbeatResponse& res, const common::ObAddr& dst) = 0; - public: +public: virtual int start() = 0; virtual void stop() = 0; virtual void wait() = 0; diff --git a/src/storage/transaction/ob_location_adapter.h b/src/storage/transaction/ob_location_adapter.h index 9f2343b12..c1adb453d 100644 --- a/src/storage/transaction/ob_location_adapter.h +++ b/src/storage/transaction/ob_location_adapter.h @@ -40,7 +40,7 @@ class ObPartitionLocation; namespace transaction { class ObILocationAdapter { - public: +public: ObILocationAdapter() {} virtual ~ObILocationAdapter() @@ -49,7 +49,7 @@ class ObILocationAdapter { share::ObIPartitionLocationCache* location_cache, share::schema::ObMultiVersionSchemaService* schema_service) = 0; virtual void destroy() = 0; - public: +public: virtual int get_strong_leader(const common::ObPartitionKey& partition, common::ObAddr& server) = 0; virtual int nonblock_get_strong_leader(const common::ObPartitionKey& partition, common::ObAddr& server) = 0; virtual int nonblock_renew(const common::ObPartitionKey& partition, const int64_t expire_renew_time) = 0; @@ -58,7 +58,7 @@ class ObILocationAdapter { }; class ObLocationAdapter : public ObILocationAdapter { - public: +public: ObLocationAdapter(); ~ObLocationAdapter() {} @@ -67,18 +67,18 @@ class ObLocationAdapter : public ObILocationAdapter { share::ObIPartitionLocationCache* location_cache, share::schema::ObMultiVersionSchemaService* schema_service); void destroy(); - public: +public: int get_strong_leader(const common::ObPartitionKey& partition, common::ObAddr& server); int nonblock_get_strong_leader(const common::ObPartitionKey& partition, common::ObAddr& server); int nonblock_renew(const common::ObPartitionKey& partition, const int64_t expire_renew_time); int nonblock_get(const uint64_t table_id, const int64_t partition_id, share::ObPartitionLocation& location); - private: +private: int get_strong_leader_(const common::ObPartitionKey& partition, const bool is_sync, common::ObAddr& server); void reset_statistics(); void statistics(); - private: +private: bool is_inited_; share::ObIPartitionLocationCache* location_cache_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/src/storage/transaction/ob_lts_source.h b/src/storage/transaction/ob_lts_source.h index a7e4c2782..917766b06 100644 --- a/src/storage/transaction/ob_lts_source.h +++ b/src/storage/transaction/ob_lts_source.h @@ -20,13 +20,13 @@ namespace oceanbase { namespace transaction { class ObLtsSource : public ObITsSource { - public: +public: ObLtsSource() {} ~ObLtsSource() {} - public: +public: int update_gts(const int64_t gts, bool& update); int update_local_trans_version(const int64_t version, bool& update); int get_gts(const MonotonicTs stc, ObTsCbTask* task, int64_t& gts, MonotonicTs& receive_gts_ts); @@ -45,7 +45,7 @@ class ObLtsSource : public ObITsSource { int update_publish_version(const int64_t publish_version); int get_publish_version(int64_t& publish_version); - public: +public: TO_STRING_KV("ts_source", "LTS"); }; } // namespace transaction diff --git a/src/storage/transaction/ob_mask_set.h b/src/storage/transaction/ob_mask_set.h index d0354de99..1c427e676 100644 --- a/src/storage/transaction/ob_mask_set.h +++ b/src/storage/transaction/ob_mask_set.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace common { class ObMaskSet { - public: +public: ObMaskSet() : is_inited_(false), is_bounded_staleness_read_(false), @@ -37,7 +37,7 @@ class ObMaskSet { int init(const ObPartitionArray& partitions); void reset(); - public: +public: int mask(const ObPartitionKey& partition); int multi_mask(const ObPartitionArray& partitions); bool is_all_mask() const; @@ -55,7 +55,7 @@ class ObMaskSet { int get_not_mask(ObPartitionLeaderArray& pla) const; bool is_mask(const ObPartitionKey& partition, const ObAddr& addr); - protected: +protected: bool is_inited_; bool is_bounded_staleness_read_; ObPartitionLeaderArray pla_; diff --git a/src/storage/transaction/ob_sql_poll.h b/src/storage/transaction/ob_sql_poll.h index 543d20c49..5fe359f52 100644 --- a/src/storage/transaction/ob_sql_poll.h +++ b/src/storage/transaction/ob_sql_poll.h @@ -29,7 +29,7 @@ class ObSqlString; namespace transaction { class ObSqlTask { - public: +public: ObSqlTask() { reset(); @@ -44,7 +44,7 @@ class ObSqlTask { void reset(); void destroy(); - private: +private: bool is_inited_; ObSqlString sql_; int64_t max_retry_time_; @@ -53,7 +53,7 @@ class ObSqlTask { }; class ObSqlPool : public common::ObSimpleThreadPool { - public: +public: ObSqlPool(); ~ObSqlPool() { @@ -68,11 +68,11 @@ class ObSqlPool : public common::ObSimpleThreadPool { int add_task(void* task); void handle(void* task); - private: +private: static const int64_t MAX_TASK_PER_SEC = 100; static const int64_t TOTAL_TASK = 10000; - private: +private: bool is_inited_; bool is_running_; common::ObMySQLProxy sql_proxy_; diff --git a/src/storage/transaction/ob_tenant_weak_read_cluster_service.h b/src/storage/transaction/ob_tenant_weak_read_cluster_service.h index 4bc6f0024..cc715c95f 100644 --- a/src/storage/transaction/ob_tenant_weak_read_cluster_service.h +++ b/src/storage/transaction/ob_tenant_weak_read_cluster_service.h @@ -47,11 +47,11 @@ class ObTenantWeakReadClusterService { // before counting the version number to ensure that all servers are counted static const int64_t FORCE_UPDATE_VERSION_TIME_AFTER_START_SERVICE = 2 * 1000 * 1000L; - public: +public: ObTenantWeakReadClusterService(); virtual ~ObTenantWeakReadClusterService(); - public: +public: const common::ObPartitionKey& get_cluster_service_pkey() const { return wrs_pkey_; @@ -125,7 +125,7 @@ class ObTenantWeakReadClusterService { int update_server_version(const common::ObAddr& addr, const int64_t version, const int64_t valid_part_count, const int64_t total_part_count, const int64_t generate_timestamp); - private: +private: int check_leader_info_(int64_t& leader_epoch) const; void update_valid_server_count_(); int query_cluster_version_range_(int64_t& cur_min_version, int64_t& cur_max_version, bool& record_exist); @@ -148,14 +148,14 @@ class ObTenantWeakReadClusterService { const common::ObAddr& self, const common::ObMemberList& member_list, common::ObAddr& candidate) const; void reset_change_leader_info_(); - private: +private: typedef common::SpinRWLock RWLock; typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; typedef ObTenantWeakReadClusterVersionMgr ClusterVersionMgr; - private: +private: bool inited_; common::ObPartitionKey wrs_pkey_; storage::ObPartitionService* ps_; diff --git a/src/storage/transaction/ob_tenant_weak_read_cluster_version_mgr.h b/src/storage/transaction/ob_tenant_weak_read_cluster_version_mgr.h index dd984894f..4e0b1801a 100644 --- a/src/storage/transaction/ob_tenant_weak_read_cluster_version_mgr.h +++ b/src/storage/transaction/ob_tenant_weak_read_cluster_version_mgr.h @@ -30,11 +30,11 @@ class ObTenantWeakReadClusterVersionMgr { /// be a problem with the server, and there is no need to send the request. static const int64_t MAX_SERVER_ALIVE_HEARTBEAT_INTERVAL = 10 * 1000 * 1000L; - public: +public: ObTenantWeakReadClusterVersionMgr(); ~ObTenantWeakReadClusterVersionMgr(); - public: +public: void reset(const uint64_t tenant_id); /// update server version @@ -53,11 +53,11 @@ class ObTenantWeakReadClusterVersionMgr { // get server count in cluster master cached registered servers int64_t get_server_count() const; - private: +private: class ServerInfo; bool find_match_server(int64_t& pre_count, const common::ObAddr& addr, ServerInfo*& psi); - private: +private: // Spin Lock typedef common::ObByteLock SpinLock; typedef common::ObByteLockGuard SpinLockGuard; @@ -91,7 +91,7 @@ class ObTenantWeakReadClusterVersionMgr { typedef common::ObSEArray ServerArray; - private: +private: uint64_t tenant_id_; ServerArray svr_array_; RWLock rwlock_; diff --git a/src/storage/transaction/ob_tenant_weak_read_server_version_mgr.h b/src/storage/transaction/ob_tenant_weak_read_server_version_mgr.h index 158a5f6e4..c7f6f76f3 100644 --- a/src/storage/transaction/ob_tenant_weak_read_server_version_mgr.h +++ b/src/storage/transaction/ob_tenant_weak_read_server_version_mgr.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace transaction { class ObTenantWeakReadServerVersionMgr { - public: +public: ObTenantWeakReadServerVersionMgr(); ~ObTenantWeakReadServerVersionMgr(); @@ -40,10 +40,10 @@ class ObTenantWeakReadServerVersionMgr { int generate_new_version(const uint64_t tenant_id, const int64_t epoch_tstamp, const int64_t base_version_when_no_valid_partition, const bool need_print_status); - public: +public: TO_STRING_KV(K_(server_version), K_(server_version_for_stat)); - public: +public: struct ServerVersion { int64_t version_; // server version, including inner and user partitions int64_t total_part_count_; // total partition count @@ -73,7 +73,7 @@ class ObTenantWeakReadServerVersionMgr { TO_STRING_KV(K_(version), K_(total_part_count), K_(valid_inner_part_count), K_(valid_user_part_count)); }; - private: +private: // Server local version struct ServerVersionInner : public ServerVersion { // server version update epoch, indicate server version generation epoch @@ -105,7 +105,7 @@ class ObTenantWeakReadServerVersionMgr { K_(version), K_(total_part_count), K_(valid_inner_part_count), K_(valid_user_part_count), K_(epoch_tstamp)); }; - private: +private: ServerVersionInner server_version_; // SERVER level VERSION mutable common::SpinRWLock rwlock_; // Lock @@ -117,7 +117,7 @@ class ObTenantWeakReadServerVersionMgr { // Assumption: Single thread update ServerVersionInner server_version_for_stat_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantWeakReadServerVersionMgr); }; diff --git a/src/storage/transaction/ob_tenant_weak_read_service.h b/src/storage/transaction/ob_tenant_weak_read_service.h index 53cf0c603..d7ffb5adb 100644 --- a/src/storage/transaction/ob_tenant_weak_read_service.h +++ b/src/storage/transaction/ob_tenant_weak_read_service.h @@ -54,15 +54,15 @@ class ObTenantWeakReadService : public lib::TGRunnable { // force refresh location cache interval static const int64_t REFRESH_LOCATION_CACHE_INTERVAL = 500 * 1000L; - public: +public: ObTenantWeakReadService(); ~ObTenantWeakReadService(); - public: +public: // TENANT WORK THREAD void run1(); - public: +public: int init(const uint64_t tenant_id, storage::ObPartitionService& ps, common::ObMySQLProxy& mysql_proxy, ObIWrsRpc& wrs_rpc, share::ObIPartitionLocationCache& location_cache, const common::ObAddr& self); void destroy(); @@ -104,15 +104,15 @@ class ObTenantWeakReadService : public lib::TGRunnable { // get weak read info stat void get_weak_read_stat(ObTenantWeakReadStat& wrs_stat) const; - public: +public: // tenant level variables init and destroy function static int mtl_init(ObTenantWeakReadService*& twrs); static void mtl_destroy(ObTenantWeakReadService*& twrs); - public: +public: TO_STRING_KV(K_(inited), K_(tenant_id), K_(self), K_(svr_version_mgr)); - private: +private: /// internal get cluster version function /// /// @retval OB_SUCCESS success @@ -139,7 +139,7 @@ class ObTenantWeakReadService : public lib::TGRunnable { void set_force_self_check_(bool need_stop_service); void set_cluster_service_master_(const common::ObAddr& addr); - private: +private: struct ModuleInfo { ModuleInfo(ObTenantWeakReadService& twrs, const char* mod); ~ModuleInfo(); @@ -151,7 +151,7 @@ class ObTenantWeakReadService : public lib::TGRunnable { }; typedef common::ObTimeGuard TimeGuard; - private: +private: bool inited_; uint64_t tenant_id_; ObIWrsRpc* wrs_rpc_; @@ -186,7 +186,7 @@ class ObTenantWeakReadService : public lib::TGRunnable { bool force_self_check_; int tg_id_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTenantWeakReadService); }; diff --git a/src/storage/transaction/ob_tenant_weak_read_stat.h b/src/storage/transaction/ob_tenant_weak_read_stat.h index 807f38c0d..ee86459c2 100644 --- a/src/storage/transaction/ob_tenant_weak_read_stat.h +++ b/src/storage/transaction/ob_tenant_weak_read_stat.h @@ -22,12 +22,12 @@ namespace oceanbase { using namespace common; namespace transaction { class ObTenantWeakReadStat { - public: +public: ObTenantWeakReadStat(); virtual ~ObTenantWeakReadStat(); void destroy(); - public: +public: uint64_t tenant_id_; // server level weak read info stat int64_t server_version_; // server level weak read version diff --git a/src/storage/transaction/ob_time_wheel.h b/src/storage/transaction/ob_time_wheel.h index 220c003c7..82a418107 100644 --- a/src/storage/transaction/ob_time_wheel.h +++ b/src/storage/transaction/ob_time_wheel.h @@ -25,10 +25,10 @@ namespace oceanbase { namespace common { class ObTimeWheelTask : public ObDLinkBase { - public: +public: static const int64_t INVALID_BUCKET_IDX = -1; - public: +public: ObTimeWheelTask() : lock_() { reset(); @@ -41,7 +41,7 @@ class ObTimeWheelTask : public ObDLinkBase { void destroy() {} - public: +public: void lock() { (void)lock_.lock(); @@ -82,14 +82,14 @@ class ObTimeWheelTask : public ObDLinkBase { } void runTask(); - public: +public: virtual void runTimerTask() = 0; virtual uint64_t hash() const = 0; virtual void begin_run() {} virtual int64_t to_string(char* buf, const int64_t buf_len) const; - protected: +protected: int64_t magic_number_; int64_t bucket_idx_; int64_t run_ticket_; @@ -101,7 +101,7 @@ class ObTimeWheelTask : public ObDLinkBase { typedef ObDList TaskList; class TaskBucket { - public: +public: TaskBucket() : lock_(ObLatchIds::TIME_WHEEL_BUCKET_LOCK) {} ~TaskBucket() @@ -116,15 +116,15 @@ class TaskBucket { (void)lock_.unlock(); } - public: +public: TaskList list_; - private: +private: mutable common::ObSpinLock lock_; } CACHE_ALIGNED; class TimeWheelBase : public share::ObThreadPool { - public: +public: TimeWheelBase() : is_inited_(false), tid_(0), precision_(1), start_ticket_(0), scan_ticket_(0) {} ~TimeWheelBase() @@ -133,23 +133,23 @@ class TimeWheelBase : public share::ObThreadPool { } int init(const int64_t precision, const char* name); - public: +public: void run1() final; int schedule(ObTimeWheelTask* task, const int64_t delay); int cancel(ObTimeWheelTask* task); - private: +private: int schedule_(ObTimeWheelTask* task, const int64_t run_ticket); int scan(); - private: +private: static const int64_t MAX_BUCKET = 10000; // scanner max sleep 1000000us static const int64_t MAX_SCAN_SLEEP = 1000000; static const int64_t MAX_TIMER_NAME_LEN = 16; - private: +private: bool is_inited_; pthread_t tid_; TaskBucket buckets_[MAX_BUCKET]; @@ -160,7 +160,7 @@ class TimeWheelBase : public share::ObThreadPool { }; class ObTimeWheel { - public: +public: ObTimeWheel() { reset(); @@ -180,15 +180,15 @@ class ObTimeWheel { return is_running_; } - public: +public: int schedule(ObTimeWheelTask* task, const int64_t delay); int cancel(ObTimeWheelTask* task); - private: +private: static const int64_t MAX_THREAD_NUM = 64; static const int64_t MAX_TIMER_NAME_LEN = 16; - private: +private: bool is_inited_; int64_t precision_; bool is_running_; diff --git a/src/storage/transaction/ob_trans_audit_record_mgr.h b/src/storage/transaction/ob_trans_audit_record_mgr.h index bec34d021..578af6e0d 100644 --- a/src/storage/transaction/ob_trans_audit_record_mgr.h +++ b/src/storage/transaction/ob_trans_audit_record_mgr.h @@ -104,7 +104,7 @@ typedef common::ObSimpleIterator free_addrs_; ObTransAuditRecord* records_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransAuditRecordMgr); }; class ObTransAuditRecordIterator { - public: +public: ObTransAuditRecordIterator() : last_ret_(common::OB_SUCCESS), record_index_(0), record_mgr_(nullptr) {} ~ObTransAuditRecordIterator() @@ -215,14 +215,14 @@ class ObTransAuditRecordIterator { bool is_vaild(); int get_next(ObTransAuditRecord*& record); - private: +private: int last_ret_; int32_t record_index_; ObTransAuditRecordMgr* record_mgr_; }; class ObTransAuditDataIterator { - public: +public: ObTransAuditDataIterator() {} ~ObTransAuditDataIterator() @@ -236,16 +236,16 @@ class ObTransAuditDataIterator { return rec_iter_.is_vaild(); } - public: +public: int get_next( ObTransAuditCommonInfo& common_info, ObTransAuditInfo& trans_info, char* trace_log_buffer, int64_t buf_len); - private: +private: ObTransAuditRecordIterator rec_iter_; }; class ObTransSQLAuditDataIterator { - public: +public: ObTransSQLAuditDataIterator() {} ~ObTransSQLAuditDataIterator() @@ -256,10 +256,10 @@ class ObTransSQLAuditDataIterator { return stmt_info_iter_.is_ready() && rec_iter_.is_vaild(); } - public: +public: int get_next(ObTransAuditCommonInfo& common_info, ObTransAuditStmtInfo& stmt_info); - private: +private: ObTransAuditStmtInfoIterator stmt_info_iter_; ObTransAuditCommonInfo common_info_; ObTransAuditRecordIterator rec_iter_; diff --git a/src/storage/transaction/ob_trans_coord_ctx.h b/src/storage/transaction/ob_trans_coord_ctx.h index a944db7fd..0f9190087 100644 --- a/src/storage/transaction/ob_trans_coord_ctx.h +++ b/src/storage/transaction/ob_trans_coord_ctx.h @@ -38,7 +38,7 @@ typedef ObSEArray ObVersionArray; // coordinator transaction context class ObCoordTransCtx : public ObDistTransCtx, public ObTsCbTask { - public: +public: ObCoordTransCtx() : ObDistTransCtx("coordinator", ObTransCtxType::COORDINATOR), partition_log_info_arr_(ObModIds::OB_TRANS_PARTITION_LOG_INFO_ARRAY, OB_MALLOC_NORMAL_BLOCK_SIZE), @@ -59,7 +59,7 @@ class ObCoordTransCtx : public ObDistTransCtx, public ObTsCbTask { int construct_context(const ObTransMsg& msg); int construct_context(const ObTrxMsgBase& msg, const int64_t msg_type); - public: +public: int handle_message(const ObTransMsg& msg); bool is_inited() const; int handle_timeout(const int64_t delay); @@ -133,13 +133,13 @@ class ObCoordTransCtx : public ObDistTransCtx, public ObTsCbTask { int handle_2pc_local_clear_response(const ObPartitionKey& partition); /////////Performance optimization for single machine trans (END)//////////// - public: +public: INHERIT_TO_STRING_KV("ObDistTransCtx", ObDistTransCtx, K_(prepare_unknown_count), K_(prepare_error_count), K_(batch_commit_trans), K_(have_prev_trans), K_(trans_location_cache), K_(stmt_rollback_info), K_(split_info_arr), K_(is_waiting_xa_commit)); static const int64_t OP_LOCAL_NUM = 16; - private: +private: int drive_(); int switch_state_(const int64_t state); int update_global_trans_version_(const int64_t trans_version); @@ -166,7 +166,7 @@ class ObCoordTransCtx : public ObDistTransCtx, public ObTsCbTask { int collect_partition_log_info_(const ObPartitionKey& partition, const uint64_t log_id, const int64_t log_timestamp); bool can_batch_commit_(); - private: +private: // handle 2pc response from participants int handle_2pc_pre_prepare_response_( const ObPartitionKey& partition, const int status, const int64_t prepare_log_id, const int64_t prepare_log_ts); @@ -183,7 +183,7 @@ class ObCoordTransCtx : public ObDistTransCtx, public ObTsCbTask { int handle_2pc_local_commit_request_(); int handle_2pc_local_clear_request_(); - private: +private: // handle trans request from scheduler int handle_trans_request_(const ObTransLocationCache& trans_location, const ObStmtRollbackInfo& stmt_rollback_info, const bool is_dup_table_trans, const int64_t commit_times, const bool is_rollback); @@ -220,15 +220,15 @@ class ObCoordTransCtx : public ObDistTransCtx, public ObTsCbTask { int xa_drive_after_rollback_(); void DEBUG_SYNC_slow_txn_during_2pc_commit_phase_for_physical_backup_1055_(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCoordTransCtx); - private: +private: // 0x78746364726f6f63 means reset coordctx static const int64_t COORD_CTX_MAGIC_NUM = 0x78746364726f6f63; static const int64_t SAME_LEADER_PARTITION_BATCH_RPC_THRESHOLD = 3; - private: +private: bool is_inited_; // check if response to scheduler or not bool already_response_; diff --git a/src/storage/transaction/ob_trans_ctx.h b/src/storage/transaction/ob_trans_ctx.h index 5e048e87f..2d96d8e2e 100644 --- a/src/storage/transaction/ob_trans_ctx.h +++ b/src/storage/transaction/ob_trans_ctx.h @@ -102,7 +102,7 @@ typedef common::LinkHashNode TransCtxHashNode; typedef common::LinkHashValue TransCtxHashValue; class ObTransState { - public: +public: ObTransState() { reset(); @@ -129,7 +129,7 @@ class ObTransState { } VIRTUAL_TO_STRING_KV(K_(prepare_version), K_(state)); - public: +public: common::ObByteLock lock_; int64_t prepare_version_; int64_t state_; @@ -143,9 +143,9 @@ class ObTransState { class ObTransCtx : public TransCtxHashValue { friend class CtxLock; - protected: +protected: class TransAuditRecordMgrGuard { - public: + public: TransAuditRecordMgrGuard() : with_tenant_ctx_(NULL){}; ~TransAuditRecordMgrGuard() { @@ -155,12 +155,12 @@ class ObTransCtx : public TransCtxHashValue { void destroy(); ObTransAuditRecordMgr* get_trans_audit_record_mgr(); - private: + private: share::ObTenantSpaceFetcher* with_tenant_ctx_; char buf_[sizeof(share::ObTenantSpaceFetcher)]; }; - public: +public: ObTransCtx(const char* ctx_type_str = "unknow", const int64_t ctx_type = ObTransCtxType::UNKNOWN) : magic_number_(UNKNOWN_RESET_CTX_MAGIC_NUM), ctx_type_str_(ctx_type_str), @@ -209,7 +209,7 @@ class ObTransCtx : public TransCtxHashValue { virtual void destroy(); void reset(); - public: +public: void get_ctx_guard(CtxLockGuard& guard); void print_trace_log(); // ATTENTION! There is no lock protect @@ -320,7 +320,7 @@ class ObTransCtx : public TransCtxHashValue { return is_elr_prepared_(); } - public: +public: bool is_exiting() const { return is_exiting_; @@ -367,7 +367,7 @@ class ObTransCtx : public TransCtxHashValue { } int reset_trans_audit_record(); - public: +public: virtual bool is_inited() const = 0; virtual int handle_timeout(const int64_t delay) = 0; virtual int kill(const KillTransArg& arg, ObEndTransCallbackArray& cb_array) = 0; @@ -384,12 +384,12 @@ class ObTransCtx : public TransCtxHashValue { return false; } - public: +public: VIRTUAL_TO_STRING_KV(KP(this), K_(ctx_type), K_(trans_id), K_(tenant_id), K_(is_exiting), K_(trans_type), K_(is_readonly), K_(trans_expired_time), K_(self), K_(state), K_(cluster_version), K_(trans_need_wait_wrap), K_(trans_param), K_(can_elr), "uref", get_uref(), K_(ctx_create_time)); - protected: +protected: int set_trans_param_(const ObStartTransParam& trans_param); // There was a problem in the online pre delivery environment. // After timeout of transaction that did not enter 2pc, the time task did not clean it up, @@ -485,14 +485,14 @@ class ObTransCtx : public TransCtxHashValue { } void remove_trans_table_(); - public: +public: // for resource pool // assume the size of transaction context(Scheduler/Coordinator/Participant) is about 200B, // then the total size of trans_ctx preallocated by resource pool is 200B * 100 * 1000 = 20MB. // Taking the concurrency num into consideration, obviously, it is appropriate. static const int64_t RP_TOTAL_NUM = 100 * 1000; - protected: +protected: static const int64_t MAX_TRANS_2PC_TIMEOUT_US = 3 * 1000 * 1000; // 3s // if 600 seconds after trans timeout, warn is required static const int64_t OB_TRANS_WARN_USE_TIME = 600 * 1000 * 1000; @@ -506,13 +506,13 @@ class ObTransCtx : public TransCtxHashValue { // the time interval of asking scheduler for rs static const int64_t CHECK_RS_SCHEDULER_STATUS_INTERVAL = 60 * 1000 * 1000; - private: +private: int alloc_audit_rec_and_trace_log_(ObTransService* trans_service, ObTransTraceLog*& trace_log); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransCtx); - protected: +protected: TransAuditRecordMgrGuard record_mgr_guard_; int64_t magic_number_; const char* const ctx_type_str_; @@ -566,7 +566,7 @@ class ObTransCtx : public TransCtxHashValue { }; class TransCtxAlloc { - public: +public: ObTransCtx* alloc_value() { return NULL; @@ -595,7 +595,7 @@ class ObDistTransCtx : public ObTransCtx { friend class CtxLock; friend class IterateTransStatFunctor; - public: +public: explicit ObDistTransCtx(const char* ctx_type_str, const int64_t ctx_type) : ObTransCtx(ctx_type_str, ctx_type), participants_(ObModIds::OB_TRANS_PARTITION_ARRAY, OB_MALLOC_NORMAL_BLOCK_SIZE), @@ -618,7 +618,7 @@ class ObDistTransCtx : public ObTransCtx { virtual void destroy(); void reset(); - public: +public: int set_scheduler(const common::ObAddr& scheduler); int set_coordinator(const common::ObPartitionKey& coordinator); int set_participants(const common::ObPartitionArray& participants); @@ -647,11 +647,11 @@ class ObDistTransCtx : public ObTransCtx { return !xid_.empty(); } - public: +public: INHERIT_TO_STRING_KV("ObTransCtx", ObTransCtx, K_(scheduler), K_(coordinator), K_(participants), K_(request_id), K_(timeout_task), K_(xid)); - protected: +protected: int set_scheduler_(const common::ObAddr& scheduler); int set_coordinator_(const common::ObPartitionKey& coordinator); int set_participants_(const common::ObPartitionArray& participants); @@ -679,10 +679,10 @@ class ObDistTransCtx : public ObTransCtx { int set_app_trace_id_(const ObString& app_trace_id); int set_xid_(const ObXATransID& xid); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDistTransCtx); - protected: +protected: common::ObAddr scheduler_; common::ObPartitionKey coordinator_; common::ObPartitionArray participants_; diff --git a/src/storage/transaction/ob_trans_ctx_lock.h b/src/storage/transaction/ob_trans_ctx_lock.h index 2be8372fd..fa7d1f320 100644 --- a/src/storage/transaction/ob_trans_ctx_lock.h +++ b/src/storage/transaction/ob_trans_ctx_lock.h @@ -30,7 +30,7 @@ class ObTransService; class ObTransCtx; class LocalTask : public common::ObDLinkBase { - public: +public: LocalTask(int64_t msg_type) : msg_(msg_type) {} ~LocalTask() @@ -48,14 +48,14 @@ class LocalTask : public common::ObDLinkBase { return msg_; } - private: +private: ObTransMsgUnion msg_; }; typedef common::ObDList LocalTaskList; class CtxLockArg { - public: +public: CtxLockArg() : task_list_(), end_trans_cb_(), @@ -64,7 +64,7 @@ class CtxLockArg { p_mt_ctx_(NULL) {} - public: +public: LocalTaskList task_list_; ObEndTransCallback end_trans_cb_; @@ -76,7 +76,7 @@ class CtxLockArg { }; class LocalTaskFactory { - public: +public: static LocalTask* alloc(int64_t msg_type) { return op_reclaim_alloc_args(LocalTask, msg_type); @@ -93,7 +93,7 @@ class LocalTaskFactory { }; class CtxLock { - public: +public: CtxLock() : lock_(), ctx_(NULL) {} ~CtxLock() @@ -111,16 +111,16 @@ class CtxLock { return ctx_; } - private: +private: DISALLOW_COPY_AND_ASSIGN(CtxLock); - private: +private: common::ObLatch lock_; ObTransCtx* ctx_; }; class CtxLockGuard { - public: +public: CtxLockGuard() : lock_(NULL) {} explicit CtxLockGuard(CtxLock& lock, const bool need_lock = true) : lock_(&lock) @@ -132,15 +132,15 @@ class CtxLockGuard { void set(CtxLock& lock); void reset(); - private: +private: DISALLOW_COPY_AND_ASSIGN(CtxLockGuard); - private: +private: CtxLock* lock_; }; class TransTableSeqLock { - public: +public: TransTableSeqLock() : seq_(0) {} ~TransTableSeqLock() @@ -153,12 +153,12 @@ class TransTableSeqLock { DISABLE_COPY_ASSIGN(TransTableSeqLock); - private: +private: uint64_t seq_; }; class CtxTransTableLockGuard : public CtxLockGuard { - public: +public: CtxTransTableLockGuard() : CtxLockGuard(), lock_(NULL) {} explicit CtxTransTableLockGuard(CtxLock& lock, TransTableSeqLock& seqlock, const bool need_lock = true) @@ -174,7 +174,7 @@ class CtxTransTableLockGuard : public CtxLockGuard { DISABLE_COPY_ASSIGN(CtxTransTableLockGuard); - private: +private: TransTableSeqLock* lock_; }; diff --git a/src/storage/transaction/ob_trans_ctx_mgr.h b/src/storage/transaction/ob_trans_ctx_mgr.h index c629ab68d..ff0a04a21 100644 --- a/src/storage/transaction/ob_trans_ctx_mgr.h +++ b/src/storage/transaction/ob_trans_ctx_mgr.h @@ -116,7 +116,7 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { friend class ObSlaveTransCtx; friend class ObTransTimer; - public: +public: typedef common::RWLock RWLock; typedef RWLock::RLockGuard RLockGuard; typedef RWLock::WLockGuard WLockGuard; @@ -134,7 +134,7 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { void destroy(); void reset(); - public: +public: // alloc transaction context if alloc is set true when transaction context not exist int get_trans_ctx(const ObTransID& trans_id, const bool for_replay, const bool is_readonly, const bool is_bounded_staleness_read, const bool need_completed_dirty_txn, bool& alloc, ObTransCtx*& ctx); @@ -194,7 +194,7 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { } int recover_pg_guard(); - public: +public: void inc_total_ctx_count() { (void)ATOMIC_AAF(&total_ctx_count_, 1); @@ -366,21 +366,21 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { K_(total_ctx_count), K_(restore_snapshot_version), K_(last_restore_log_id), "uref", ((ObTransCtxType::SCHEDULER == ctx_type_ || !is_inited_) ? -1 : get_uref())); - private: +private: bool is_participant_() const { return ObTransCtxType::PARTICIPANT == ctx_type_ || ObTransCtxType::SLAVE_PARTICIPANT == ctx_type_; } int get_partition_state_(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartitionTransCtxMgr); - private: +private: static const int64_t OB_TRANS_STATISTICS_INTERVAL = 60 * 1000 * 1000; static const int64_t OB_PARTITION_AUDIT_LOCAL_STORAGE_COUNT = 4; - private: +private: // erase transaction context from hashmap int erase_trans_ctx_(const ObTransID& trans_id); int remove_ctx_from_arr_(ObTransCtx* ctx); @@ -413,12 +413,12 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { const transaction::ObTransID& read_trans_id, const transaction::ObTransID& data_trans_id, const int32_t sql_sequence, storage::ObStoreRowLockState& lock_state); - public: +public: static const int64_t MAX_HASH_ITEM_PRINT = 16; - private: +private: class CtxMapMgr { - public: + public: CtxMapMgr() : ctx_map_(nullptr) { reset(); @@ -433,20 +433,20 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { // it is used to filter partition template class ObPartitionForEachFilterFunctor { - public: + public: explicit ObPartitionForEachFilterFunctor(const ObPartitionKey& partition, Fn& fn) : partition_(partition), fn_(fn) {} ~ObPartitionForEachFilterFunctor() {} bool operator()(const ObTransKey& trans_key, ObTransCtx* ctx_base); - private: + private: ObPartitionKey partition_; Fn& fn_; }; template class ObPartitionRemoveIfFilterFunctor { - public: + public: explicit ObPartitionRemoveIfFilterFunctor(const ObPartitionKey& partition, Fn& fn) : partition_(partition), fn_(fn) {} @@ -454,7 +454,7 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { {} bool operator()(const ObTransKey& trans_key, ObTransCtx* ctx_base); - private: + private: ObPartitionKey partition_; Fn& fn_; }; @@ -495,12 +495,12 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { return ret; } - private: + private: ObPartitionKey partition_; CtxMap* ctx_map_; }; class State { - public: + public: static const int64_t INVALID = -1; static const int64_t INIT = 0; static const int64_t F_WORKING = 1; @@ -512,14 +512,14 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { static const int64_t END = 7; static const int64_t MAX = 8; - public: + public: static bool is_valid(const int64_t state) { return state > INVALID && state < MAX; } }; class Ops { - public: + public: static const int64_t INVALID = -1; static const int64_t START = 0; static const int64_t LEADER_REVOKE = 1; @@ -530,14 +530,14 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { static const int64_t REMOVE = 6; static const int64_t MAX = 7; - public: + public: static bool is_valid(const int64_t op) { return op > INVALID && op < MAX; } }; class StateHelper { - public: + public: explicit StateHelper(int64_t& state) : state_(state), last_state_(State::INVALID), is_switching_(false) {} ~StateHelper() @@ -545,13 +545,13 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { int switch_state(const int64_t op); void restore_state(); - private: + private: int64_t& state_; int64_t last_state_; bool is_switching_; }; - private: +private: bool is_master_() const { return State::L_WORKING == state_ || State::L_BLOCKED == state_; @@ -565,7 +565,7 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { return State::STOPPED == ATOMIC_LOAD(&state_); } - private: +private: bool is_inited_; int64_t ctx_type_; int64_t state_; @@ -623,7 +623,7 @@ class ObPartitionTransCtxMgr : public PartitionTransCtxMgrHashValue { }; class PartitionTransCtxMgrAlloc { - public: +public: static ObPartitionTransCtxMgr* alloc_value() { return NULL; @@ -653,13 +653,13 @@ typedef common::ObLinkHashMap class ObPointerCache { - public: +public: ObPointerCache() { reset(); @@ -752,14 +752,14 @@ class ObPointerCache { return common::OB_SUCCESS; } - private: +private: T* cache_[CACHE_NUM]; }; class ObTransCtxMgrImpl { enum { CACHE_NUM = 17313, CONTEXT_MAP_COUNT = 1 << 6 }; - public: +public: ObTransCtxMgrImpl() : ctx_map_(nullptr), ts_mgr_(nullptr) { reset(); @@ -772,7 +772,7 @@ class ObTransCtxMgrImpl { void reset(); void destroy(); - protected: +protected: int add_partition(const common::ObPartitionKey& partition); int block_partition(const common::ObPartitionKey& partition, bool& is_all_trans_clear); int stop_partition(const common::ObPartitionKey& partition, const bool graceful); @@ -794,7 +794,7 @@ class ObTransCtxMgrImpl { int leader_takeover(const common::ObPartitionKey& partition, const int64_t checkpoint); int leader_active(const common::ObPartitionKey& partition, const storage::LeaderActiveArg& arg); - public: +public: template int foreach_partition(Fn& fn) { @@ -809,7 +809,7 @@ class ObTransCtxMgrImpl { int get_partition_trans_ctx_mgr_with_ref(const ObPartitionKey& partition, ObTransStateTableGuard& guard); int revert_partition_trans_ctx_mgr_with_ref(ObPartitionTransCtxMgr* mgr); - protected: +protected: int64_t ctx_type_; PartitionCtxMap partition_ctx_map_; ObPointerCache mgr_cache_; @@ -820,12 +820,12 @@ class ObTransCtxMgrImpl { int64_t partition_alloc_cnt_; int64_t partition_del_cnt_; - protected: +protected: storage::ObPartitionService* partition_service_; }; class ObCoordTransCtxMgr : public ObITransCtxMgr, public ObTransCtxMgrImpl { - public: +public: ObCoordTransCtxMgr() { reset(); @@ -841,7 +841,7 @@ class ObCoordTransCtxMgr : public ObITransCtxMgr, public ObTransCtxMgrImpl { void destroy(); void reset(); - public: +public: int get_trans_ctx(const common::ObPartitionKey& partition, const ObTransID& trans_id, const bool for_replay, const bool is_readonly, bool& alloc, ObTransCtx*& ctx); int add_partition(const common::ObPartitionKey& partition); @@ -857,17 +857,17 @@ class ObCoordTransCtxMgr : public ObITransCtxMgr, public ObTransCtxMgrImpl { int wait_all_trans_clear(const common::ObPartitionKey& partition); int wait_1pc_trx_end(const common::ObPartitionKey& partition); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObCoordTransCtxMgr); - private: +private: bool is_inited_; bool is_running_; mutable common::DRWLock rwlock_; }; class ObPartTransCtxMgr : public ObITransCtxMgr, public ObTransCtxMgrImpl { - public: +public: ObPartTransCtxMgr() { reset(); @@ -883,7 +883,7 @@ class ObPartTransCtxMgr : public ObITransCtxMgr, public ObTransCtxMgrImpl { int wait(); void reset(); - public: +public: int get_trans_ctx(const common::ObPartitionKey& partition, const ObTransID& trans_id, const bool for_replay, const bool is_readonly, bool& alloc, ObTransCtx*& ctx); int get_trans_ctx(const common::ObPartitionKey& partition, const ObTransID& trans_id, const bool for_replay, @@ -978,10 +978,10 @@ class ObPartTransCtxMgr : public ObITransCtxMgr, public ObTransCtxMgrImpl { int get_active_read_write_count(const ObPartitionKey& partition, int64_t& count); int init_dup_table_mgr(const ObPartitionKey& partition); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartTransCtxMgr); - private: +private: bool is_inited_; bool is_running_; mutable common::DRWLock rwlock_; diff --git a/src/storage/transaction/ob_trans_define.h b/src/storage/transaction/ob_trans_define.h index 42b316185..c3ce0d810 100644 --- a/src/storage/transaction/ob_trans_define.h +++ b/src/storage/transaction/ob_trans_define.h @@ -70,7 +70,7 @@ class ObPartTransCtxMgr; class ObPartitionTransCtxMgr; class ObTransErrsim { - public: +public: static inline bool is_memory_errsim() { bool ret = false; @@ -115,7 +115,7 @@ struct TransModulePageAllocator : public common::ModulePageAllocator { class ObTransID final { OB_UNIS_VERSION(1); - public: +public: ObTransID() { reset(); @@ -124,7 +124,7 @@ class ObTransID final { explicit ObTransID(const common::ObAddr& server); ObTransID(const common::ObAddr& server, const int64_t inc, const int64_t timestamp); - public: +public: bool is_valid() const { return server_.is_valid() && 0 <= inc_ && 0 < timestamp_; @@ -158,19 +158,19 @@ class ObTransID final { void reset(); DECLARE_TO_STRING_AND_YSON; - private: +private: static const int64_t SAMPLE_INTERVAL = 3 * 1000 * 1000; - private: +private: uint64_t hash_() const; - private: +private: // static increase number for generating trans id static int64_t s_inc_num; // last sample timestamp static int64_t s_last_sample_ts; - private: +private: uint64_t hv_; common::ObAddr server_; int64_t inc_; @@ -201,7 +201,7 @@ struct ObLockForReadArg { }; class ObTransKey final { - public: +public: ObTransKey() { reset(); @@ -218,7 +218,7 @@ class ObTransKey final { calc_hash_(); } - public: +public: bool is_valid() const { return pkey_.is_valid() && trans_id_.is_valid(); @@ -279,7 +279,7 @@ class ObTransKey final { } DECLARE_TO_STRING_AND_YSON; - private: +private: OB_INLINE uint64_t calc_hash_() { uint64_t hash_val = 0; @@ -290,25 +290,25 @@ class ObTransKey final { return hash_val_ = hash_val; } - private: +private: common::ObPartitionKey pkey_; ObTransID trans_id_; uint64_t hash_val_; }; class ObTransAccessMode { - public: +public: static const int32_t UNKNOWN = -1; static const int32_t READ_ONLY = 0; static const int32_t READ_WRITE = 1; - public: +public: static bool is_valid(const int32_t mode) { return READ_ONLY == mode || READ_WRITE == mode; } - private: +private: ObTransAccessMode() {} ~ObTransAccessMode() @@ -316,13 +316,13 @@ class ObTransAccessMode { }; class ObTransSnapshotGeneType { - public: +public: static const int32_t UNKNOWN = -1; static const int32_t CONSULT = 0; static const int32_t APPOINT = 1; static const int32_t NOTHING = 2; - public: +public: static bool is_valid(const int32_t type) { return CONSULT == type || APPOINT == type || NOTHING == type; @@ -350,7 +350,7 @@ class ObTransSnapshotGeneType { return ret_str; } - public: +public: ObTransSnapshotGeneType() {} ~ObTransSnapshotGeneType() @@ -358,19 +358,19 @@ class ObTransSnapshotGeneType { }; class TransType { - public: +public: static const int32_t UNKNOWN = -1; static const int32_t SP_TRANS = 0; static const int32_t MINI_SP_TRANS = 1; static const int32_t DIST_TRANS = 2; - public: +public: static bool is_valid(const int32_t type) { return SP_TRANS == type || MINI_SP_TRANS == type || DIST_TRANS == type; } - private: +private: TransType() {} ~TransType() @@ -378,20 +378,20 @@ class TransType { }; class ObTransType { - public: +public: static const int32_t UNKNOWN = -1; static const int32_t TRANS_NORMAL = 0; static const int32_t TRANS_MAJOR_FREEZE = 1; static const int32_t TRANS_SYSTEM = 2; static const int32_t TRANS_USER = 3; - public: +public: static bool is_valid(const int32_t type) { return TRANS_NORMAL == type || TRANS_MAJOR_FREEZE == type || TRANS_SYSTEM == type || TRANS_USER == type; } - private: +private: ObTransType() {} ~ObTransType() @@ -416,12 +416,12 @@ class ObTransType { */ class ObTransConsistencyType { - public: +public: static const int32_t UNKNOWN = -1; static const int32_t CURRENT_READ = 0; static const int32_t BOUNDED_STALENESS_READ = 1; - public: +public: static bool is_valid(const int64_t consistency_type) { return CURRENT_READ == consistency_type || BOUNDED_STALENESS_READ == consistency_type; @@ -454,7 +454,7 @@ class ObTransConsistencyType { return str; } - private: +private: ObTransConsistencyType() {} ~ObTransConsistencyType() @@ -462,13 +462,13 @@ class ObTransConsistencyType { }; class ObTransReadSnapshotType { - public: +public: static const int32_t UNKNOWN = -1; static const int32_t TRANSACTION_SNAPSHOT = 0; static const int32_t STATEMENT_SNAPSHOT = 1; static const int32_t PARTICIPANT_SNAPSHOT = 2; - public: +public: static bool is_valid(const int32_t type) { return TRANSACTION_SNAPSHOT == type || STATEMENT_SNAPSHOT == type || PARTICIPANT_SNAPSHOT == type; @@ -502,7 +502,7 @@ class ObTransReadSnapshotType { }; class ObStmtParam { - public: +public: ObStmtParam() { reset(); @@ -511,7 +511,7 @@ class ObStmtParam { {} void reset(); - public: +public: int init(const uint64_t tenant_id, const int64_t stmt_expired_time, const bool is_retry_sql); int init(const uint64_t tenant_id, const int64_t stmt_expired_time, const bool is_retry_sql, const int64_t safe_weak_read_snapshot, const int64_t weak_read_snapshot_source, const bool trx_elr); @@ -543,7 +543,7 @@ class ObStmtParam { int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: uint64_t tenant_id_; int64_t stmt_expired_time_; bool is_retry_sql_; @@ -556,10 +556,10 @@ class ObStmtParam { class ObStartTransParam { OB_UNIS_VERSION(1); - public: +public: const static uint64_t INVALID_CLUSTER_VERSION = 0; - public: +public: ObStartTransParam() { reset(); @@ -570,7 +570,7 @@ class ObStartTransParam { } void reset(); - public: +public: int set_access_mode(const int32_t access_mode); int32_t get_access_mode() const { @@ -645,7 +645,7 @@ class ObStartTransParam { bool is_serializable_isolation() const; int reset_read_snapshot_type_for_isolation(); - public: +public: bool is_readonly() const { return ObTransAccessMode::READ_ONLY == access_mode_; @@ -654,11 +654,11 @@ class ObStartTransParam { int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: static const uint64_t MAGIC_NUM = 0xF0F0F0F0F0F0F0F0; static const uint64_t INVALID_MAGIC_NUM = 0x4348454E4D494E47; - private: +private: // READONLY or READ_WRITE int32_t access_mode_; // transaction type: TRANS_NORMAL @@ -675,7 +675,7 @@ class ObStartTransParam { // record the info from user to db class ObTraceInfo { - public: +public: ObTraceInfo() { reset(); @@ -703,10 +703,10 @@ class ObTraceInfo { } TO_STRING_KV(K_(app_trace_info), K_(app_trace_id)); - private: +private: static const int64_t MAX_TRACE_INFO_BUFFER = 128; - private: +private: char app_trace_info_buffer_[MAX_TRACE_INFO_BUFFER + 1]; common::ObString app_trace_info_; char app_trace_id_buffer_[common::OB_MAX_TRACE_ID_BUFFER_SIZE + 1]; @@ -714,18 +714,18 @@ class ObTraceInfo { }; class ObTransConsistencyLevel { - public: +public: static const int64_t UNKNOWN = -1; static const int64_t STRONG = 0; static const int64_t WEAK = 1; - public: +public: static bool is_valid(const int64_t type) { return STRONG == type || WEAK == type; } - private: +private: ObTransConsistencyLevel() {} ~ObTransConsistencyLevel() @@ -735,7 +735,7 @@ class ObTransConsistencyLevel { struct ObStmtDesc { OB_UNIS_VERSION(1); - public: +public: ObStmtDesc() { reset(); @@ -744,7 +744,7 @@ struct ObStmtDesc { {} void reset(); - public: +public: bool is_valid() const { // no need to check execution_id and stmt_tenant_id for compatibility @@ -770,15 +770,15 @@ struct ObStmtDesc { return sql_id_.ptr(); } - public: +public: ObStmtDesc& operator=(const ObStmtDesc& stmt_desc); int64_t to_string(char* buf, const int64_t buf_len) const; - public: +public: static const int64_t SQL_ID_LENGTH = 16; static const int64_t TRACE_ID_LENGTH = 35; - public: +public: // local, remote, distributed sql::ObPhyPlanType phy_plan_type_; // INSERT, UPDATE ... @@ -804,7 +804,7 @@ struct ObStmtDesc { // no need to serialize class ObPartitionSchemaInfo { - public: +public: ObPartitionSchemaInfo() { reset(); @@ -827,7 +827,7 @@ class ObPartitionSchemaInfo { } TO_STRING_KV(K_(pkey), K_(schema_version)); - private: +private: common::ObPartitionKey pkey_; int64_t schema_version_; }; @@ -835,7 +835,7 @@ class ObPartitionSchemaInfo { typedef common::ObSEArray ObPartitionSchemaInfoArray; class ObTransTraceLog : public common::ObTraceEventRecorderBase<100, 2250> { - public: +public: ObTransTraceLog() : common::ObTraceEventRecorderBase<100, 2250>::ObTraceEventRecorderBase( true, common::ObLatchIds::TRANS_TRACE_RECORDER_LOCK) @@ -849,7 +849,7 @@ class ObTransTraceLog : public common::ObTraceEventRecorderBase<100, 2250> { class ObStmtInfo { OB_UNIS_VERSION(1); - public: +public: ObStmtInfo() { reset(); @@ -887,7 +887,7 @@ class ObStmtInfo { void reset_stmt_info(); TO_STRING_KV(K_(nested_sql), K_(start_stmt_cnt), K_(end_stmt_cnt)); - private: +private: bool nested_sql_; int64_t start_stmt_cnt_; int64_t end_stmt_cnt_; @@ -896,7 +896,7 @@ class ObStmtInfo { class ObTaskInfo { OB_UNIS_VERSION(1); - public: +public: ObTaskInfo() : sql_no_(0), active_task_cnt_(1), snapshot_version_(common::OB_INVALID_VERSION) {} ObTaskInfo(const int32_t sql_no, const int64_t snapshot_version) @@ -908,7 +908,7 @@ class ObTaskInfo { } TO_STRING_KV(K_(sql_no), K_(active_task_cnt), K_(snapshot_version)); - public: +public: int32_t sql_no_; int32_t active_task_cnt_; int64_t snapshot_version_; @@ -917,7 +917,7 @@ class ObTaskInfo { class ObTransTaskInfo { OB_UNIS_VERSION(1); - public: +public: int start_stmt(const int32_t sql_no); int start_task(const int32_t sql_no, const int64_t snapshot_version); void end_task(); @@ -934,14 +934,14 @@ class ObTransTaskInfo { } TO_STRING_KV(K(tasks_)); - private: +private: common::ObSEArray tasks_; }; class ObTransStmtInfo { OB_UNIS_VERSION(1); - public: +public: ObTransStmtInfo() { reset(); @@ -1010,7 +1010,7 @@ class ObTransStmtInfo { TO_STRING_KV(K_(sql_no), K_(start_task_cnt), K_(end_task_cnt), K_(need_rollback), K_(task_info)); - private: +private: void update_sql_no(const int64_t sql_no) { if (sql_no > sql_no_) { @@ -1033,16 +1033,16 @@ class ObTransStmtInfo { }; class ObTransVersion { - public: +public: static const int64_t INVALID_TRANS_VERSION = -1; - public: +public: static bool is_valid(const int64_t trans_version) { return trans_version >= 0; } - private: +private: ObTransVersion() {} ~ObTransVersion() @@ -1052,7 +1052,7 @@ class ObTransVersion { typedef struct MonotonicTs { OB_UNIS_VERSION(1); - public: +public: explicit MonotonicTs(int64_t mts) : mts_(mts) {} MonotonicTs() @@ -1112,7 +1112,7 @@ typedef struct MonotonicTs { } MonotonicTs; class ObTransNeedWaitWrap { - public: +public: ObTransNeedWaitWrap() { reset(); @@ -1146,7 +1146,7 @@ class ObTransNeedWaitWrap { } TO_STRING_KV(K_(receive_gts_ts), K_(need_wait_interval_us)); - private: +private: MonotonicTs receive_gts_ts_; int64_t need_wait_interval_us_; }; @@ -1155,7 +1155,7 @@ class ObTransNeedWaitWrap { typedef common::ObFixedLengthString<128> ObSavepointIdString; class ObSavepointInfo { - public: +public: ObSavepointInfo() { reset(); @@ -1184,14 +1184,14 @@ class ObSavepointInfo { } TO_STRING_KV(K_(id), K_(id_len), K_(sql_no)); - private: +private: int64_t sql_no_; ObSavepointIdString id_; int64_t id_len_; }; class ObSavepointPartitionInfo { - public: +public: ObSavepointPartitionInfo() { reset(); @@ -1221,7 +1221,7 @@ class ObSavepointPartitionInfo { int update_max_sql_no(const int64_t sql_no); TO_STRING_KV(K_(partition), K_(max_sql_no)); - private: +private: common::ObPartitionKey partition_; int64_t max_sql_no_; }; @@ -1230,7 +1230,7 @@ typedef common::ObSEArray ObSavepo typedef common::ObSEArray ObSavepointPartitionInfoArray; class ObSavepointMgr { - public: +public: ObSavepointMgr() { reset(); @@ -1256,13 +1256,13 @@ class ObSavepointMgr { int get_savepoint_rollback_info(const common::ObString& id, int64_t& sql_no, common::ObPartitionArray& partition_arr); TO_STRING_KV(K_(savepoint_arr), K_(savepoint_partition_arr)); - private: +private: int64_t find_savepoint_location_(const common::ObString& id); int64_t find_savepoint_partition_location_(const common::ObPartitionKey& partition); int find_savepoint_rollback_partitions_(const int64_t sql_no, common::ObPartitionArray& partition_arr); int get_savepoint_rollback_partitions_(const int64_t sql_no, common::ObPartitionArray& partition_arr); - protected: +protected: ObSavepointInfoArray savepoint_arr_; ObSavepointPartitionInfoArray savepoint_partition_arr_; }; @@ -1270,7 +1270,7 @@ class ObSavepointMgr { class ObTransSnapInfo { OB_UNIS_VERSION(1); - public: +public: ObTransSnapInfo() { reset(); @@ -1324,11 +1324,11 @@ class ObTransSnapInfo { reset(); } - public: +public: bool is_valid() const; TO_STRING_KV(K_(snapshot_version), K_(read_sql_no), K_(sql_no), K_(trans_id), K_(is_cursor_or_nested)); - private: +private: int64_t snapshot_version_; int64_t read_sql_no_; int64_t sql_no_; // deprecated, for compact reason only @@ -1339,7 +1339,7 @@ class ObTransSnapInfo { class ObStmtPair { OB_UNIS_VERSION(1); - public: +public: ObStmtPair() : from_(0), to_(0) {} ObStmtPair(const int64_t from, const int64_t to) : from_(from), to_(to) @@ -1364,7 +1364,7 @@ class ObStmtPair { } TO_STRING_KV(K_(from), K_(to)); - private: +private: int64_t from_; int64_t to_; }; @@ -1372,20 +1372,20 @@ class ObStmtPair { class ObStmtRollbackInfo { OB_UNIS_VERSION(1); - public: +public: ObStmtRollbackInfo() {} ~ObStmtRollbackInfo() {} void reset(); - public: +public: int push(const ObStmtPair& stmt_pair); int search(const int64_t sql_no, ObStmtPair& stmt_pair) const; int assign(const ObStmtRollbackInfo& other); TO_STRING_KV(K_(stmt_pair_array)); - private: +private: common::ObSEArray stmt_pair_array_; }; @@ -1394,7 +1394,7 @@ class ObTransDesc; class ObStandaloneStmtDesc { friend class ObTransDesc; - public: +public: ObStandaloneStmtDesc() { reset(); @@ -1481,7 +1481,7 @@ class ObStandaloneStmtDesc { K_(read_snapshot_type), K_(snapshot_version), K_(is_local_single_partition), K_(is_standalone_stmt_end), K_(first_pkey)); - private: +private: // for standalone transaction uint64_t magic_; ObTransID trans_id_; @@ -1510,7 +1510,7 @@ enum ObXAReqType { class ObXATransID { OB_UNIS_VERSION(1); - public: +public: ObXATransID() { reset(); @@ -1549,12 +1549,12 @@ class ObXATransID { TO_STRING_KV(K_(gtrid_str), K_(bqual_str), K_(format_id), KPHEX(gtrid_str_.ptr(), gtrid_str_.length()), KPHEX(bqual_str_.ptr(), bqual_str_.length())); - public: +public: static const int32_t MAX_GTRID_LENGTH = 64; static const int32_t MAX_BQUAL_LENGTH = 64; static const int32_t MAX_XID_LENGTH = MAX_GTRID_LENGTH + MAX_BQUAL_LENGTH; - private: +private: char gtrid_buf_[MAX_GTRID_LENGTH]; common::ObString gtrid_str_; char bqual_buf_[MAX_BQUAL_LENGTH]; @@ -1565,7 +1565,7 @@ class ObXATransID { class ObTransDesc : public ObSavepointMgr { OB_UNIS_VERSION_V(1); - public: +public: ObTransDesc(); ~ObTransDesc() { @@ -1574,7 +1574,7 @@ class ObTransDesc : public ObSavepointMgr { void reset(); void destroy(); - public: +public: int init(sql::ObBasicSessionInfo* session); // for test int test_init(); @@ -2090,20 +2090,20 @@ class ObTransDesc : public ObSavepointMgr { K_(trans_need_wait_wrap), K_(is_fast_select), K_(trace_info), K_(standalone_stmt_desc), K_(need_check_at_end_participant), K_(is_nested_stmt), K_(stmt_min_sql_no), K_(xid), K_(gc_participants)); - public: +public: static const int32_t MAX_XID_LENGTH = 128; - private: +private: bool contain_(const common::ObPartitionArray& participants, const common::ObPartitionKey& participant) const; DISALLOW_COPY_AND_ASSIGN(ObTransDesc); - public: +public: bool cluster_version_before_2271() const { return cluster_version_ < CLUSTER_VERSION_2271; } - private: +private: uint64_t tenant_id_; ObTransID trans_id_; int64_t snapshot_version_; @@ -2146,7 +2146,7 @@ class ObTransDesc : public ObSavepointMgr { int64_t stmt_min_sql_no_; bool is_tightly_coupled_; - private: +private: // no need to serialize ObTransCtx* part_ctx_; ObScheTransCtx* sche_ctx_; @@ -2174,7 +2174,7 @@ class ObTransDesc : public ObSavepointMgr { }; class ObTransIsolation { - public: +public: enum { /* * after the discussion, we decide to adjust the value of @@ -2190,7 +2190,7 @@ class ObTransIsolation { }; static const common::ObString LEVEL_NAME[MAX_LEVEL]; - public: +public: static bool is_valid(const int32_t level) { return level == READ_COMMITED || level == REPEATABLE_READ || level == SERIALIZABLE; @@ -2198,7 +2198,7 @@ class ObTransIsolation { static int32_t get_level(const common::ObString& level_name); static const common::ObString& get_name(int32_t level); - private: +private: ObTransIsolation() {} ~ObTransIsolation() @@ -2206,7 +2206,7 @@ class ObTransIsolation { }; class ObPartTransAction { - public: +public: static const int64_t UNKNOWN = -1; static const int64_t START_TASK = 1; static const int64_t END_TASK = 2; @@ -2215,13 +2215,13 @@ class ObPartTransAction { static const int64_t DIED = 5; static const int64_t END = 6; - public: +public: static bool is_valid(const int64_t state) { return state >= START_TASK && state < END; } - private: +private: ObPartTransAction() {} ~ObPartTransAction() @@ -2229,18 +2229,18 @@ class ObPartTransAction { }; class ObRunningState { - public: +public: static const int64_t UNKNOWN = -1; static const int64_t INIT = 0; static const int64_t ABORT = 200; - public: +public: static bool is_valid(const int64_t state) { return INIT == state || ABORT == state; } - private: +private: ObRunningState() {} ~ObRunningState() @@ -2248,20 +2248,20 @@ class ObRunningState { }; class ObSpState { - public: +public: static const int64_t UNKNOWN = -1; static const int64_t INIT = 0; static const int64_t PREPARE = 100; static const int64_t COMMIT = 101; static const int64_t ABORT = 102; - public: +public: static bool is_valid(const int64_t state) { return INIT == state || PREPARE == state || COMMIT == state || ABORT == state; } - private: +private: ObSpState() {} ~ObSpState() @@ -2269,7 +2269,7 @@ class ObSpState { }; class Ob2PCState { - public: +public: static const int64_t UNKNOWN = -1; static const int64_t INIT = 0; static const int64_t PREPARE = 1; @@ -2279,13 +2279,13 @@ class Ob2PCState { static const int64_t PRE_PREPARE = 5; static const int64_t PRE_COMMIT = 6; - public: +public: static bool is_valid(const int64_t state) { return state >= INIT && state <= PRE_COMMIT; } - private: +private: Ob2PCState() {} ~Ob2PCState() @@ -2293,7 +2293,7 @@ class Ob2PCState { }; class ObXATransState { - public: +public: static const int32_t UNKNOWN = -1; static const int32_t NON_EXISTING = 0; static const int32_t ACTIVE = 1; @@ -2303,7 +2303,7 @@ class ObXATransState { static const int32_t ROLLBACKED = 5; static const int32_t PREPARING = 6; - public: +public: static bool is_valid(const int32_t state) { return state >= NON_EXISTING && state <= PREPARING; @@ -2343,7 +2343,7 @@ class ObXATransState { }; class ObXAFlag { - public: +public: enum { TMNOFLAGS = 0, // non-standard xa protocol, to denote a readonly xa trans @@ -2359,7 +2359,7 @@ class ObXAFlag { TMONEPHASE = 0x40000000, }; - public: +public: static bool is_valid(const int64_t flag, const int64_t xa_req_type); static bool is_valid_inner_flag(const int64_t flag); static bool contain_tmreadonly(const int64_t flag) @@ -2410,13 +2410,13 @@ class ObXAFlag { }; class ObTransSubmitLogState { - public: +public: static const int64_t INIT = 0; static const int64_t SUBMIT_LOG = 1; static const int64_t SUBMIT_LOG_PENDING = 2; static const int64_t SUBMIT_LOG_SUCCESS = 3; - public: +public: bool is_valid(const int64_t state) { return INIT == state || SUBMIT_LOG == state || SUBMIT_LOG_PENDING == state || SUBMIT_LOG_SUCCESS == state; @@ -2424,7 +2424,7 @@ class ObTransSubmitLogState { }; class ObTransRetryTaskType { - public: +public: static const int64_t UNKNOWN = -1; // submit log static const int64_t SUBMIT_LOG = 0; @@ -2446,7 +2446,7 @@ class ObTransRetryTaskType { static const int64_t AGGRE_LOG_TASK = 12; static const int64_t MAX = 13; - public: +public: static bool is_valid(const int64_t task_type) { return task_type > UNKNOWN && task_type < MAX; @@ -2456,7 +2456,7 @@ class ObTransRetryTaskType { class ObPartitionLeaderInfo final { OB_UNIS_VERSION(1); - public: +public: ObPartitionLeaderInfo() {} ObPartitionLeaderInfo(const common::ObPartitionKey& partition, const common::ObAddr& addr) @@ -2479,7 +2479,7 @@ class ObPartitionLeaderInfo final { TO_STRING_KV(K_(partition), K_(addr)); - private: +private: common::ObPartitionKey partition_; common::ObAddr addr_; }; @@ -2487,7 +2487,7 @@ class ObPartitionLeaderInfo final { class ObPartitionLogInfo final { OB_UNIS_VERSION(1); - public: +public: ObPartitionLogInfo() : log_id_(0), log_timestamp_(0) {} ObPartitionLogInfo(const common::ObPartitionKey& partition, const int64_t log_id, const int64_t log_timestamp) @@ -2521,7 +2521,7 @@ class ObPartitionLogInfo final { } TO_STRING_KV(K_(partition), K_(log_id), K_(log_timestamp)); - private: +private: common::ObPartitionKey partition_; int64_t log_id_; int64_t log_timestamp_; @@ -2530,7 +2530,7 @@ class ObPartitionLogInfo final { class ObPartitionEpochInfo final { OB_UNIS_VERSION(1); - public: +public: ObPartitionEpochInfo() : partition_(), epoch_(0) {} ObPartitionEpochInfo(const common::ObPartitionKey& partition, const int64_t epoch) @@ -2556,20 +2556,20 @@ class ObPartitionEpochInfo final { } TO_STRING_KV(K_(partition), K_(epoch)); - private: +private: common::ObPartitionKey partition_; int64_t epoch_; }; class ObTransCtxType { - public: +public: static const int64_t UNKNOWN = -1; static const int64_t SCHEDULER = 0; static const int64_t COORDINATOR = 1; static const int64_t PARTICIPANT = 2; static const int64_t SLAVE_PARTICIPANT = 3; - public: +public: static bool is_valid(const int64_t type) { return SCHEDULER == type || COORDINATOR == type || PARTICIPANT == type || SLAVE_PARTICIPANT == type; @@ -2579,7 +2579,7 @@ class ObTransCtxType { typedef common::ObSEArray ObLeaderEpochArray; class ObPartitionLeaderEpochInfo { - public: +public: ObPartitionLeaderEpochInfo() { reset(); @@ -2598,14 +2598,14 @@ class ObPartitionLeaderEpochInfo { bool is_all_identical_epoch() const; TO_STRING_KV(K_(partition), K_(epoch_arr)); - private: +private: bool is_inited_; common::ObPartitionKey partition_; ObLeaderEpochArray epoch_arr_; }; class ObMemtableKeyInfo { - public: +public: ObMemtableKeyInfo() { reset(); @@ -2641,10 +2641,10 @@ class ObMemtableKeyInfo { TO_STRING_KV(K_(buf)); - public: +public: static const int MEMTABLE_KEY_INFO_BUF_SIZE = 512; - private: +private: uint64_t table_id_; uint64_t hash_val_; void* row_lock_; @@ -2654,7 +2654,7 @@ class ObMemtableKeyInfo { class ObElrTransInfo final { OB_UNIS_VERSION(1); - public: +public: ObElrTransInfo() { reset(); @@ -2692,7 +2692,7 @@ class ObElrTransInfo final { } TO_STRING_KV(K_(trans_id), K_(commit_version), K_(result), K_(ctx_id)); - private: +private: ObTransID trans_id_; int64_t commit_version_; int result_; @@ -2700,14 +2700,14 @@ class ObElrTransInfo final { }; class ObTransResultState { - public: +public: static const int INVALID = -1; static const int UNKNOWN = 0; static const int COMMIT = 1; static const int ABORT = 2; static const int MAX = 3; - public: +public: static bool is_valid(const int state) { return state > INVALID && state < MAX; @@ -2731,7 +2731,7 @@ class ObTransResultState { }; class ObTransTask { - public: +public: ObTransTask() : retry_interval_us_(0), next_handle_ts_(0), task_type_(ObTransRetryTaskType::UNKNOWN) {} ObTransTask(int64_t task_type) : retry_interval_us_(0), next_handle_ts_(0), task_type_(task_type) @@ -2754,19 +2754,19 @@ class ObTransTask { bool ready_to_handle(); TO_STRING_KV(K_(task_type), K_(retry_interval_us), K_(next_handle_ts)); - public: +public: static const int64_t RP_TOTAL_NUM = 512; static const int64_t RP_RESERVE_NUM = 64; static const int64_t RETRY_SLEEP_TIME_US = 100; - protected: +protected: int64_t retry_interval_us_; int64_t next_handle_ts_; int64_t task_type_; }; class ObBatchCommitState { - public: +public: static const int INVALID = -1; static const int INIT = 0; static const int ALLOC_LOG_ID_TS = 1; @@ -2799,7 +2799,7 @@ enum ObPartitionAuditOperator { }; struct ObPartitionAuditInfoCache { - public: +public: ObPartitionAuditInfoCache() { reset(); @@ -2831,7 +2831,7 @@ struct ObPartitionAuditInfoCache { int update_audit_info(const enum ObPartitionAuditOperator op, const int32_t count); int stmt_end_update_audit_info(bool commit); - public: +public: int32_t insert_row_count_; int32_t delete_row_count_; int32_t update_row_count_; @@ -2854,7 +2854,7 @@ struct ObPartitionAuditInfoCache { }; struct ObPartitionAuditInfo { - public: +public: ObPartitionAuditInfo() : lock_(common::ObLatchIds::PARTITION_AUDIT_SPIN_LOCK) { reset(); @@ -2895,7 +2895,7 @@ struct ObPartitionAuditInfo { ATOMIC_SET(&base_row_count_, count); } - public: +public: common::ObSpinLock lock_; int64_t base_row_count_; int64_t insert_row_count_; @@ -2919,7 +2919,7 @@ struct ObPartitionAuditInfo { }; class ObCoreLocalPartitionAuditInfo : public common::ObCoreLocalStorage { - public: +public: ObCoreLocalPartitionAuditInfo() {} ~ObCoreLocalPartitionAuditInfo() @@ -2950,7 +2950,7 @@ enum ELRState { ELR_INIT = 0, ELR_PREPARING = 1, ELR_PREPARED = 2 }; enum CHANGING_LEADER_STATE { NO_CHANGING_LEADER = 0, STATEMENT_NOT_FINISH = 1, LOGGING_NOT_FINISH = 2 }; class ObAddrLogId { - public: +public: ObAddrLogId(const common::ObAddr& addr, const uint64_t log_id) : addr_(addr), log_id_(log_id) {} ObAddrLogId() @@ -2977,7 +2977,7 @@ class ObAddrLogId { } TO_STRING_KV(K_(addr), K_(log_id)); - private: +private: common::ObAddr addr_; uint64_t log_id_; }; @@ -2987,7 +2987,7 @@ enum class ObTransTableStatusType : int64_t { RUNNING = 0, COMMIT, ABORT }; class ObUndoAction { OB_UNIS_VERSION(1); - public: +public: ObUndoAction() { reset(); @@ -3038,7 +3038,7 @@ class ObUndoAction { } TO_STRING_KV(K_(undo_from), K_(undo_to)); - private: +private: // from > to int64_t undo_from_; int64_t undo_to_; @@ -3049,7 +3049,7 @@ typedef common::ObSEArray ObUndoActionArray; class ObTransUndoStatus { OB_UNIS_VERSION(1); - public: +public: ObTransUndoStatus() : latch_(common::ObLatchIds::UNDO_STATUS_LOCK) { reset(); @@ -3072,13 +3072,13 @@ class ObTransUndoStatus { int deep_copy(ObTransUndoStatus& status); TO_STRING_KV(K_(undo_action_arr)); - protected: +protected: mutable common::ObSpinLock latch_; ObUndoActionArray undo_action_arr_; }; class ObTransStatusInfo { - public: +public: ObTransStatusInfo() : status_(ObTransTableStatusType::RUNNING), trans_version_(common::OB_INVALID_VERSION), @@ -3095,7 +3095,7 @@ class ObTransStatusInfo { class ObTransTableStatusInfo { OB_UNIS_VERSION(1); - public: +public: ObTransTableStatusInfo() { reset(); @@ -3164,7 +3164,7 @@ class ObTransTableStatusInfo { } TO_STRING_KV(K_(status), K_(trans_version), K_(undo_status), K_(terminate_log_ts), K_(checksum), K_(checksum_log_ts)); - private: +private: ObTransTableStatusType status_; int64_t trans_version_; ObTransUndoStatus undo_status_; @@ -3174,7 +3174,7 @@ class ObTransTableStatusInfo { }; class ObSameLeaderPartitionArr { - public: +public: ObSameLeaderPartitionArr() { reset(); @@ -3207,7 +3207,7 @@ class ObSameLeaderPartitionArr { } TO_STRING_KV(K_(leader), K_(partition_arr)); - private: +private: common::ObAddr leader_; common::ObPartitionArray partition_arr_; }; @@ -3215,7 +3215,7 @@ class ObSameLeaderPartitionArr { typedef common::ObSEArray ObSameLeaderPartitionArrArray; class ObSameLeaderPartitionArrMgr { - public: +public: ObSameLeaderPartitionArrMgr() { reset(); @@ -3248,13 +3248,13 @@ class ObSameLeaderPartitionArrMgr { } TO_STRING_KV(K_(array)); - private: +private: ObSameLeaderPartitionArrArray array_; bool is_ready_; }; class ObPartTransSameLeaderBatchRpcItem { - public: +public: ObPartTransSameLeaderBatchRpcItem() { reset(); @@ -3282,10 +3282,10 @@ class ObPartTransSameLeaderBatchRpcItem { TO_STRING_KV(K_(msg_type), K_(trans_id), K_(participants)); static const int64_t ALLOW_PREEMPT_INTERVAL_US = 1 * 1000 * 1000; - private: +private: bool allow_to_preempt_(const ObTransID& trans_id); - private: +private: common::ObLatch lock_; int64_t msg_type_; ObTransID trans_id_; @@ -3295,7 +3295,7 @@ class ObPartTransSameLeaderBatchRpcItem { } CACHE_ALIGNED; class ObPartTransSameLeaderBatchRpcMgr { - public: +public: ObPartTransSameLeaderBatchRpcMgr() { reset(); @@ -3316,12 +3316,12 @@ class ObPartTransSameLeaderBatchRpcMgr { // 2^17 static const int64_t SAME_LEADER_BATCH_RPC_ITEM_ARR_SIZE = 131072; - private: +private: ObPartTransSameLeaderBatchRpcItem batch_rpc_item_arr_[SAME_LEADER_BATCH_RPC_ITEM_ARR_SIZE]; }; class ObTransLogBufferAggreContainer { - public: +public: ObTransLogBufferAggreContainer() { reset(); @@ -3360,10 +3360,10 @@ class ObTransLogBufferAggreContainer { static const int64_t FLUSH_INTERVAL_US = 1 * 1000 * 1000; TO_STRING_KV(K_(offset), K_(last_flush_ts), K_(is_inited)); - private: +private: void flush_(bool& need_submit_log); - private: +private: clog::ObAggreBuffer* aggre_buffer_; AggreLogTask* task_; int64_t offset_; @@ -3373,7 +3373,7 @@ class ObTransLogBufferAggreContainer { }; class ObLightTransCtxItem { - public: +public: ObLightTransCtxItem() { reset(); @@ -3396,13 +3396,13 @@ class ObLightTransCtxItem { return trans_ctx_; } - private: +private: common::ObLatch lock_; ObTransCtx* trans_ctx_; }; class ObLightTransCtxMgr { - public: +public: ObLightTransCtxMgr() { reset(); @@ -3425,10 +3425,10 @@ class ObLightTransCtxMgr { bool remove_trans_ctx(const common::ObPartitionKey& partition, const ObTransID& trans_id); bool add_trans_ctx(ObTransCtx* ctx); - public: +public: static const int64_t LIGHT_TRANS_CTX_MGR_TABLE_SIZE = 400000; - private: +private: ObLightTransCtxItem item_array_[LIGHT_TRANS_CTX_MGR_TABLE_SIZE]; ObPartTransCtxMgr* part_trans_ctx_mgr_; }; @@ -3440,7 +3440,7 @@ typedef common::ObSEArray ObRedoLogIdArra struct ObTransSSTableDurableCtxInfo { OB_UNIS_VERSION(1); - public: +public: ObTransSSTableDurableCtxInfo() { reset(); @@ -3540,7 +3540,7 @@ struct CtxInfo final { typedef common::ObSEArray ObTransCtxArray; class ObTransStateTable { - public: +public: ObTransStateTable() : partition_trans_ctx_mgr_(NULL) {} ~ObTransStateTable() @@ -3588,12 +3588,12 @@ class ObTransStateTable { const ObLockForReadArg& lock_for_read_arg, bool& can_read, int64_t& trans_version, bool& is_determined_state); TO_STRING_KV(KP_(partition_trans_ctx_mgr)); - private: +private: ObPartitionTransCtxMgr* partition_trans_ctx_mgr_; }; class ObTransStateTableGuard { - public: +public: ObTransStateTableGuard() { reset(); @@ -3621,7 +3621,7 @@ class ObTransStateTableGuard { } TO_STRING_KV(K_(trans_state_table)); - private: +private: ObTransStateTable trans_state_table_; }; diff --git a/src/storage/transaction/ob_trans_dependency.h b/src/storage/transaction/ob_trans_dependency.h index 5c3c6ad1b..442dad640 100644 --- a/src/storage/transaction/ob_trans_dependency.h +++ b/src/storage/transaction/ob_trans_dependency.h @@ -28,7 +28,7 @@ class ObPartTransCtxDependencyWrap { friend class ObElrPrevTransArrIterator; friend class ObElrNextTransArrIterator; - public: +public: ObPartTransCtxDependencyWrap() { reset(); @@ -65,10 +65,10 @@ class ObPartTransCtxDependencyWrap { void clear_cur_stmt_prev_trans_item(); int merge_cur_stmt_prev_trans_arr(); - public: +public: TO_STRING_KV(K_(prev_trans_arr), K_(next_trans_arr), K_(prev_trans_commit_count)); - private: +private: // merge prev transaction and clear duplicate item int add_cur_stmt_prev_trans_item_(const ObTransID& trans_id, uint32_t ctx_id, int64_t commit_version); int remove_prev_trans_item_(const ObTransID& trans_id, uint32_t ctx_id, int64_t commit_version); @@ -89,7 +89,7 @@ class ObPartTransCtxDependencyWrap { } int merge_cur_stmt_prev_trans_item_(); - private: +private: ObPartTransCtx* part_ctx_; ObElrTransInfoArray prev_trans_arr_; ObElrTransInfoArray cur_stmt_prev_trans_arr_; @@ -102,7 +102,7 @@ class ObPartTransCtxDependencyWrap { }; class ObElrTransArrGuard { - public: +public: ObElrTransArrGuard() : trans_arr_(NULL), trans_lock_(NULL) {} ~ObElrTransArrGuard(); @@ -112,13 +112,13 @@ class ObElrTransArrGuard { return *trans_arr_; } - private: +private: ObElrTransInfoArray* trans_arr_; common::SpinRWLock* trans_lock_; }; class ObElrTransArrIterator { - public: +public: ObElrTransArrIterator(ObElrTransInfoArray& trans_arr, common::SpinRWLock& trans_lock) : trans_arr_(trans_arr), trans_lock_(trans_lock), index_(0) {} @@ -126,14 +126,14 @@ class ObElrTransArrIterator { {} ObElrTransInfo* next(); - private: +private: ObElrTransInfoArray& trans_arr_; common::SpinRWLock& trans_lock_; int index_; }; class ObElrPrevTransArrIterator : public ObElrTransArrIterator { - public: +public: ObElrPrevTransArrIterator(ObPartTransCtxDependencyWrap& ctx_dependency_wrap) : ObElrTransArrIterator(ctx_dependency_wrap.prev_trans_arr_, ctx_dependency_wrap.prev_trans_lock_) {} @@ -142,7 +142,7 @@ class ObElrPrevTransArrIterator : public ObElrTransArrIterator { }; class ObElrNextTransArrIterator : public ObElrTransArrIterator { - public: +public: ObElrNextTransArrIterator(ObPartTransCtxDependencyWrap& ctx_dependency_wrap) : ObElrTransArrIterator(ctx_dependency_wrap.next_trans_arr_, ctx_dependency_wrap.next_trans_lock_) {} diff --git a/src/storage/transaction/ob_trans_elr_task.h b/src/storage/transaction/ob_trans_elr_task.h index 56b1e933b..502e1fc40 100644 --- a/src/storage/transaction/ob_trans_elr_task.h +++ b/src/storage/transaction/ob_trans_elr_task.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace transaction { class WaitTransEndTask : public ObTransTask { - public: +public: WaitTransEndTask() { reset(); @@ -44,14 +44,14 @@ class WaitTransEndTask : public ObTransTask { } TO_STRING_KV(K_(partition), K_(trans_id)); - private: +private: ObTransID trans_id_; common::ObPartitionKey partition_; DISALLOW_COPY_AND_ASSIGN(WaitTransEndTask); }; class CallbackTransTask : public ObTransTask { - public: +public: CallbackTransTask() : ObTransTask(ObTransRetryTaskType::UNKNOWN) { reset(); @@ -85,7 +85,7 @@ class CallbackTransTask : public ObTransTask { } TO_STRING_KV(K_(partition), K_(trans_id), K_(prev_trans_id), K_(status)); - private: +private: common::ObPartitionKey partition_; ObTransID trans_id_; ObTransID prev_trans_id_; diff --git a/src/storage/transaction/ob_trans_end_trans_callback.h b/src/storage/transaction/ob_trans_end_trans_callback.h index 25709c72e..56f698e73 100644 --- a/src/storage/transaction/ob_trans_end_trans_callback.h +++ b/src/storage/transaction/ob_trans_end_trans_callback.h @@ -33,7 +33,7 @@ struct ObEndTransCallbackItem { typedef common::ObArray ObEndTransCallbackArray; class ObEndTransCallback { - public: +public: ObEndTransCallback() : callback_count_(0), cb_(NULL), cb_type_(NULL), tenant_id_(common::OB_INVALID_TENANT_ID) {} ~ObEndTransCallback() @@ -58,7 +58,7 @@ class ObEndTransCallback { return cb_; } - private: +private: int64_t callback_count_; sql::ObIEndTransCallback* cb_; const char* cb_type_; @@ -66,7 +66,7 @@ class ObEndTransCallback { }; class EndTransCallbackTask : public ObTransTask { - public: +public: EndTransCallbackTask() { reset(); @@ -87,7 +87,7 @@ class EndTransCallbackTask : public ObTransTask { static const int64_t MAX_NEED_WAIT_US = 500; TO_STRING_KV(K_(param), K_(trans_need_wait_wrap)); - private: +private: ObEndTransCallback end_trans_cb_; int param_; ObTransNeedWaitWrap trans_need_wait_wrap_; diff --git a/src/storage/transaction/ob_trans_event.h b/src/storage/transaction/ob_trans_event.h index e8b258be7..ccc1662db 100644 --- a/src/storage/transaction/ob_trans_event.h +++ b/src/storage/transaction/ob_trans_event.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace transaction { class ObTransStatItem { - public: +public: explicit ObTransStatItem(const char* const item_name) : item_name_(item_name) { reset(); @@ -35,14 +35,14 @@ class ObTransStatItem { void add(const int64_t value); int64_t to_string(char* buf, const int64_t buf_len) const; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransStatItem); - private: +private: static const int64_t STAT_BUFFER_COUNT = 60; static const int64_t STAT_INTERVAL = 1 * 1000 * 1000; - private: +private: const char* const item_name_; int64_t total_; int64_t save_; @@ -53,7 +53,7 @@ class ObTransStatItem { }; class ObTransStatistic { - public: +public: static ObTransStatistic& get_instance() { static ObTransStatistic trans_statistic_; @@ -202,7 +202,7 @@ class ObTransStatistic { // count the time spent on data relocation void add_relocate_total_time(const uint64_t tenant_id, const int64_t value); - private: +private: ObTransStatistic() : sys_trans_count_stat_("trans_sys_count"), user_trans_count_stat_("trans_user_count"), @@ -255,7 +255,7 @@ class ObTransStatistic { {} DISALLOW_COPY_AND_ASSIGN(ObTransStatistic); - private: +private: ObTransStatItem sys_trans_count_stat_; ObTransStatItem user_trans_count_stat_; ObTransStatItem trans_commit_count_stat_; diff --git a/src/storage/transaction/ob_trans_factory.h b/src/storage/transaction/ob_trans_factory.h index 654be1fa6..db3e90760 100644 --- a/src/storage/transaction/ob_trans_factory.h +++ b/src/storage/transaction/ob_trans_factory.h @@ -46,7 +46,7 @@ class ObGtsRequestRpc; class EndTransCallbackTask; class ObTransCtxFactory { - public: +public: static ObTransCtx* alloc(const int64_t ctx_type); static void release(ObTransCtx* ctx); static int64_t get_alloc_count() @@ -66,7 +66,7 @@ class ObTransCtxFactory { return ATOMIC_LOAD(&active_part_ctx_count_); } - private: +private: static const char* mod_type_; static int64_t active_sche_ctx_count_; static int64_t active_coord_ctx_count_; @@ -76,7 +76,7 @@ class ObTransCtxFactory { template class TransObjFactory { - public: +public: explicit TransObjFactory(const char* mod_type) : alloc_count_(0), release_count_(0) { (void)snprintf(mod_type_, sizeof(mod_type_) - 1, "%s", mod_type); @@ -98,7 +98,7 @@ class TransObjFactory { return mod_type_; } - private: +private: static const int64_t MOD_TYPE_SIZE = 64; char mod_type_[MOD_TYPE_SIZE]; int64_t alloc_count_; @@ -144,14 +144,14 @@ void TransObjFactory::release(T* obj) #define MAKE_FACTORY_CLASS_DEFINE_(object_name, object_name2) \ class object_name##Factory { \ - public: \ + public: \ static object_name2* alloc(); \ static void release(object_name2* obj); \ static int64_t get_alloc_count(); \ static int64_t get_release_count(); \ static const char* get_mod_type(); \ \ - private: \ + private: \ static const char* mod_type_; \ static int64_t alloc_count_; \ static int64_t release_count_; \ @@ -161,14 +161,14 @@ void TransObjFactory::release(T* obj) #define MAKE_FACTORY_CLASS_DEFINE_V2(object_name, object_name2) MAKE_FACTORY_CLASS_DEFINE_(object_name, object_name2) class ObPartitionTransCtxMgrFactory { - public: +public: static ObPartitionTransCtxMgr* alloc(const uint64_t tenant_id); static void release(ObPartitionTransCtxMgr* mgr); static int64_t get_alloc_count(); static int64_t get_release_count(); static const char* get_mod_type(); - private: +private: static const char* mod_type_; static int64_t alloc_count_; static int64_t release_count_; diff --git a/src/storage/transaction/ob_trans_functor.h b/src/storage/transaction/ob_trans_functor.h index b9b156965..7f95783dc 100644 --- a/src/storage/transaction/ob_trans_functor.h +++ b/src/storage/transaction/ob_trans_functor.h @@ -45,7 +45,7 @@ class ObTransCtx; namespace transaction { class LeaderActiveFunctor { - public: +public: LeaderActiveFunctor(const common::ObPartitionKey& partition, const storage::LeaderActiveArg& arg) : partition_(partition), leader_active_arg_(arg) {} @@ -65,13 +65,13 @@ class LeaderActiveFunctor { return bool_ret; } - private: +private: common::ObPartitionKey partition_; storage::LeaderActiveArg leader_active_arg_; }; class LeaderTakeoverFunctor { - public: +public: explicit LeaderTakeoverFunctor(const common::ObPartitionKey& partition, const int64_t checkpoint) : partition_(partition), checkpoint_(checkpoint) {} @@ -91,13 +91,13 @@ class LeaderTakeoverFunctor { return bool_ret; } - private: +private: common::ObPartitionKey partition_; int64_t checkpoint_; }; class ReleaseAllTransCtxFunctor { - public: +public: explicit ReleaseAllTransCtxFunctor(ObPartitionTransCtxMgr& ctx_mgr) : ctx_mgr_(ctx_mgr), released_count_(0) {} int64_t get_released_count() const @@ -126,13 +126,13 @@ class ReleaseAllTransCtxFunctor { return bool_ret; } - private: +private: ObPartitionTransCtxMgr& ctx_mgr_; int64_t released_count_; }; class InactiveCtxFunctor { - public: +public: InactiveCtxFunctor(const uint64_t tenant_id, ObEndTransCallbackArray& cb_array) : tenant_id_(tenant_id), cb_array_(cb_array) {} @@ -159,13 +159,13 @@ class InactiveCtxFunctor { return bool_ret; } - private: +private: uint64_t tenant_id_; ObEndTransCallbackArray& cb_array_; }; class KillTransCtxFunctor { - public: +public: KillTransCtxFunctor(const KillTransArg& arg, ObEndTransCallbackArray& cb_array) : arg_(arg), cb_array_(cb_array), freeze_version_() {} @@ -206,7 +206,7 @@ class KillTransCtxFunctor { return OB_SUCCESS == ret; } - private: +private: KillTransArg arg_; ObEndTransCallbackArray& cb_array_; ObVersion freeze_version_; @@ -214,7 +214,7 @@ class KillTransCtxFunctor { }; class StopPartitionFunctor { - public: +public: StopPartitionFunctor() {} ~StopPartitionFunctor() @@ -239,7 +239,7 @@ class StopPartitionFunctor { }; class WaitPartitionFunctor { - public: +public: explicit WaitPartitionFunctor(int64_t& retry_count) : retry_count_(retry_count) {} ~WaitPartitionFunctor() @@ -269,12 +269,12 @@ class WaitPartitionFunctor { return bool_ret; } - private: +private: int64_t& retry_count_; }; class RemovePartitionFunctor { - public: +public: RemovePartitionFunctor() {} ~RemovePartitionFunctor() @@ -303,7 +303,7 @@ class RemovePartitionFunctor { }; class CalculateCostFunctor { - public: +public: explicit CalculateCostFunctor(const ObTransID& tid) : tid_(tid), total_cost_(0) {} ~CalculateCostFunctor() @@ -335,13 +335,13 @@ class CalculateCostFunctor { return total_cost_; } - private: +private: ObTransID tid_; uint64_t total_cost_; }; class IteratePartitionFunctor { - public: +public: explicit IteratePartitionFunctor(ObPartitionIterator& partition_iter) : partition_iter_(partition_iter) {} bool operator()(const ObPartitionKey& partition, ObPartitionTransCtxMgr* part_trans_ctx_mgr) @@ -361,12 +361,12 @@ class IteratePartitionFunctor { return bool_ret; } - private: +private: ObPartitionIterator& partition_iter_; }; class ObELRStatSummaryFunctor { - public: +public: explicit ObELRStatSummaryFunctor(ObELRStatSummary& elr_stat) : elr_stat_(elr_stat) {} bool operator()(const ObPartitionKey& partition, ObPartitionTransCtxMgr* part_trans_ctx_mgr) @@ -390,12 +390,12 @@ class ObELRStatSummaryFunctor { return bool_ret; } - private: +private: ObELRStatSummary& elr_stat_; }; class IteratePartitionMgrStatFunctor { - public: +public: IteratePartitionMgrStatFunctor(ObTransPartitionMgrStatIterator& partition_mgr_stat_iter, const ObAddr& addr) : partition_mgr_stat_iter_(partition_mgr_stat_iter), addr_(addr) {} @@ -440,13 +440,13 @@ class IteratePartitionMgrStatFunctor { return bool_ret; } - private: +private: ObTransPartitionMgrStatIterator& partition_mgr_stat_iter_; const ObAddr& addr_; }; class IterateTransSchemaVersionStat { - public: +public: explicit IterateTransSchemaVersionStat(const int64_t schema_version, const int64_t refreshed_schema_ts) : base_schema_version_(schema_version), refreshed_schema_ts_(refreshed_schema_ts), ret_(common::OB_SUCCESS) {} @@ -481,14 +481,14 @@ class IterateTransSchemaVersionStat { return ret_; } - private: +private: int64_t base_schema_version_; int64_t refreshed_schema_ts_; int ret_; }; class IterateCtxCreateTimestamp { - public: +public: explicit IterateCtxCreateTimestamp(const int64_t ts) : base_ctx_create_ts_(ts) {} bool operator()(const ObTransID& trans_id, ObTransCtx* ctx_base) @@ -514,12 +514,12 @@ class IterateCtxCreateTimestamp { return bool_ret; } - private: +private: int64_t base_ctx_create_ts_; }; class IterateMinPrepareVersionFunctor { - public: +public: explicit IterateMinPrepareVersionFunctor() : min_prepare_version_(INT64_MAX) {} int64_t get_min_prepare_version() const @@ -549,12 +549,12 @@ class IterateMinPrepareVersionFunctor { return (OB_SUCCESS == tmp_ret); } - private: +private: int64_t min_prepare_version_; }; class IterateMinPrepareVersionBeforeLogtsFunctor { - public: +public: explicit IterateMinPrepareVersionBeforeLogtsFunctor(const int64_t log_ts) : min_prepare_version_(INT64_MAX), min_logts_(log_ts) {} @@ -585,13 +585,13 @@ class IterateMinPrepareVersionBeforeLogtsFunctor { return (OB_SUCCESS == tmp_ret); } - private: +private: int64_t min_prepare_version_; int64_t min_logts_; }; class IterateMinLogIdFunctor { - public: +public: IterateMinLogIdFunctor() : min_uncommit_log_id_(UINT64_MAX), min_uncommit_log_ts_(INT64_MAX) {} uint64_t get_min_uncommit_log_id() const @@ -635,13 +635,13 @@ class IterateMinLogIdFunctor { return bool_ret; } - private: +private: uint64_t min_uncommit_log_id_; int64_t min_uncommit_log_ts_; }; class IteratePartCtxAskSchedulerStatusFunctor { - public: +public: IteratePartCtxAskSchedulerStatusFunctor() {} bool operator()(const ObTransID& trans_id, ObTransCtx* ctx_base) @@ -672,7 +672,7 @@ class IteratePartCtxAskSchedulerStatusFunctor { }; class IterateTransStatFunctor { - public: +public: explicit IterateTransStatFunctor(ObTransStatIterator& trans_stat_iter) : trans_stat_iter_(trans_stat_iter) {} bool operator()(const ObTransID& trans_id, ObTransCtx* ctx_base) @@ -828,12 +828,12 @@ class IterateTransStatFunctor { return bool_ret; } - private: +private: ObTransStatIterator& trans_stat_iter_; }; class IterateTransTableFunctor { - public: +public: explicit IterateTransTableFunctor(blocksstable::ObMacroBlockWriter& writer) : writer_(writer), store_row_(), @@ -936,11 +936,11 @@ class IterateTransTableFunctor { return clean_trx_cnt_; } - private: +private: static const int64_t COLUMN_CNT = 2; static const int64_t BUF_LENGTH = 1000; - private: +private: blocksstable::ObMacroBlockWriter& writer_; storage::ObStoreRow store_row_; ObObj cells_[COLUMN_CNT]; @@ -954,7 +954,7 @@ class IterateTransTableFunctor { }; class CopyTransTableFunctor { - public: +public: explicit CopyTransTableFunctor() : trans_table_guards_(), txs_(NULL), trx_count_(0) {} int init(ObTransService* txs, const common::ObIArray& pkeys) @@ -1058,14 +1058,14 @@ class CopyTransTableFunctor { return trx_count_; } - private: +private: ObSEArray trans_table_guards_; ObTransService* txs_; int64_t trx_count_; }; class IterateTransLockStatFunctor { - public: +public: explicit IterateTransLockStatFunctor(ObTransLockStatIterator& trans_lock_stat_iter) : trans_lock_stat_iter_(trans_lock_stat_iter) {} @@ -1122,12 +1122,12 @@ class IterateTransLockStatFunctor { return bool_ret; } - private: +private: ObTransLockStatIterator& trans_lock_stat_iter_; }; class IterateTransResultInfoFunctor { - public: +public: IterateTransResultInfoFunctor( ObTransResultInfoStatIterator& iter, common::ObPartitionKey& partition, common::ObAddr& addr) : trans_result_info_stat_iter_(iter), partition_(partition), addr_(addr) @@ -1158,14 +1158,14 @@ class IterateTransResultInfoFunctor { return true; } - private: +private: ObTransResultInfoStatIterator& trans_result_info_stat_iter_; common::ObPartitionKey& partition_; common::ObAddr& addr_; }; class ReplayStartWorkingLogFunctor { - public: +public: ReplayStartWorkingLogFunctor(const int64_t timestamp, const uint64_t log_id) : timestamp_(timestamp), log_id_(log_id) {} ~ReplayStartWorkingLogFunctor() @@ -1189,13 +1189,13 @@ class ReplayStartWorkingLogFunctor { return true; } - private: +private: int64_t timestamp_; uint64_t log_id_; }; class WaitAll1PCTrxEndFunctor { - public: +public: WaitAll1PCTrxEndFunctor() {} bool operator()(const ObTransID& trans_id, ObTransCtx* ctx_base) @@ -1224,7 +1224,7 @@ class WaitAll1PCTrxEndFunctor { }; class CheckAllTransInTransTableStateFunctor { - public: +public: CheckAllTransInTransTableStateFunctor() : all_in_trans_table_state_(true) {} bool operator()(const ObTransID& trans_id, ObTransCtx* ctx_base) @@ -1248,12 +1248,12 @@ class CheckAllTransInTransTableStateFunctor { return all_in_trans_table_state_; } - private: +private: bool all_in_trans_table_state_; }; class SubmitLogForSplitFunctor { - public: +public: SubmitLogForSplitFunctor() : log_finished_(true) {} bool operator()(const ObTransID& trans_id, ObTransCtx* ctx_base) @@ -1285,12 +1285,12 @@ class SubmitLogForSplitFunctor { return log_finished_; } - private: +private: bool log_finished_; }; class LeaderRevokeFunctor { - public: +public: LeaderRevokeFunctor( const bool first_check, ObPartitionTransCtxMgr& ctx_mgr, ObEndTransCallbackArray& cb_array, int64_t& retry_count) : first_check_(first_check), ctx_mgr_(ctx_mgr), cb_array_(cb_array), retry_count_(retry_count) @@ -1326,7 +1326,7 @@ class LeaderRevokeFunctor { return bool_ret; } - private: +private: bool first_check_; ObPartitionTransCtxMgr& ctx_mgr_; ObEndTransCallbackArray& cb_array_; @@ -1334,7 +1334,7 @@ class LeaderRevokeFunctor { }; class PrintFunctor { - public: +public: PrintFunctor(const int64_t max_print_count, const bool verbose) : max_print_count_(max_print_count), print_count_(0), verbose_(verbose) { @@ -1360,14 +1360,14 @@ class PrintFunctor { return bool_ret; } - private: +private: int64_t max_print_count_; int64_t print_count_; bool verbose_; }; class PrintAllPartitionTransCtxFunctor { - public: +public: PrintAllPartitionTransCtxFunctor() {} ~PrintAllPartitionTransCtxFunctor() @@ -1391,7 +1391,7 @@ class PrintAllPartitionTransCtxFunctor { }; class CheckpointFunctor { - public: +public: explicit CheckpointFunctor(storage::ObPartitionLoopWorker* lp_worker, const int64_t start_ckp_ts, const int64_t checkpoint_base_version, int64_t& ckp_total_cnt, int64_t& ckp_succ_cnt) : worker_(lp_worker), @@ -1443,7 +1443,7 @@ class CheckpointFunctor { return ckp_succ_cnt_; } - private: +private: storage::ObPartitionLoopWorker* worker_; // Record the start time of the checkpoint, those contexts created after this point // will be operated in the next round to avoid long-term occupation of the checkpoint thread @@ -1456,7 +1456,7 @@ class CheckpointFunctor { }; class ObTransDataRelocateFunctor { - public: +public: explicit ObTransDataRelocateFunctor(memtable::ObIMemtable* memtable) : memtable_(memtable) {} ~ObTransDataRelocateFunctor() @@ -1478,12 +1478,12 @@ class ObTransDataRelocateFunctor { return bool_ret; } - private: +private: memtable::ObIMemtable* memtable_; }; class ObXASchedulerHbFunctor { - public: +public: ObXASchedulerHbFunctor() {} ~ObXASchedulerHbFunctor() @@ -1507,7 +1507,7 @@ class ObXASchedulerHbFunctor { }; class ObPrepareChangingLeaderFunctor { - public: +public: explicit ObPrepareChangingLeaderFunctor(const common::ObAddr& proposal_leader, const int64_t round, const int64_t cnt) : proposal_leader_(proposal_leader), round_(round), cnt_(cnt) {} @@ -1532,14 +1532,14 @@ class ObPrepareChangingLeaderFunctor { return bool_ret; } - private: +private: common::ObAddr proposal_leader_; int64_t round_; int64_t cnt_; }; class ObRemoveAllCtxFunctor { - public: +public: explicit ObRemoveAllCtxFunctor() {} ~ObRemoveAllCtxFunctor() @@ -1557,7 +1557,7 @@ class ObRemoveAllCtxFunctor { }; class ObRemoveCallbackFunctor { - public: +public: explicit ObRemoveCallbackFunctor(memtable::ObMemtable* mt) : mt_(mt) {} ~ObRemoveCallbackFunctor() @@ -1584,12 +1584,12 @@ class ObRemoveCallbackFunctor { return bool_ret; } - private: +private: memtable::ObMemtable* mt_; }; class ObRemoveMemCtxFunctor { - public: +public: explicit ObRemoveMemCtxFunctor(memtable::ObMemtable* mt) : mt_(mt) {} ~ObRemoveMemCtxFunctor() @@ -1616,12 +1616,12 @@ class ObRemoveMemCtxFunctor { return bool_ret; } - private: +private: memtable::ObMemtable* mt_; }; class ObDirtyTransMarkerFunctor { - public: +public: explicit ObDirtyTransMarkerFunctor( const memtable::ObMemtable* const frozen_memtable, const memtable::ObMemtable* const active_memtable) : frozen_memtable_(frozen_memtable), active_memtable_(active_memtable), cb_cnt_(0), applied_log_ts_(INT64_MAX) @@ -1660,7 +1660,7 @@ class ObDirtyTransMarkerFunctor { return applied_log_ts_; } - private: +private: const memtable::ObMemtable* const frozen_memtable_; const memtable::ObMemtable* const active_memtable_; int64_t cb_cnt_; @@ -1668,7 +1668,7 @@ class ObDirtyTransMarkerFunctor { }; class ObGetAppliedLogTsFunctor { - public: +public: ObGetAppliedLogTsFunctor() : applied_log_ts_(INT64_MAX) {} @@ -1693,12 +1693,12 @@ class ObGetAppliedLogTsFunctor { return applied_log_ts_; } - private: +private: int64_t applied_log_ts_; }; class ObGetMaxTransVersionBeforeLogFunctor { - public: +public: explicit ObGetMaxTransVersionBeforeLogFunctor(const int64_t log_ts) : log_ts_(log_ts), max_trans_version_(0), is_all_rollback_trans_(true), has_related_trans_(false) {} @@ -1741,7 +1741,7 @@ class ObGetMaxTransVersionBeforeLogFunctor { return is_all_rollback_trans_ && has_related_trans_; } - private: +private: int64_t log_ts_; int64_t max_trans_version_; bool is_all_rollback_trans_; @@ -1749,7 +1749,7 @@ class ObGetMaxTransVersionBeforeLogFunctor { }; class ObCleanTransTableFunctor { - public: +public: explicit ObCleanTransTableFunctor(const int64_t max_cleanout_log_ts) : max_cleanout_log_ts_(max_cleanout_log_ts) {} bool operator()(const ObTransID& trans_id, ObTransCtx* ctx_base) @@ -1776,12 +1776,12 @@ class ObCleanTransTableFunctor { return OB_SUCC(ret); } - private: +private: int64_t max_cleanout_log_ts_; }; class ObCheckHasTerminatedTrxBeforeLogFunction { - public: +public: explicit ObCheckHasTerminatedTrxBeforeLogFunction(const int64_t start_log_ts, const int64_t end_log_ts) : start_log_ts_(start_log_ts), end_log_ts_(end_log_ts), has_terminated_trx_(false) {} @@ -1810,7 +1810,7 @@ class ObCheckHasTerminatedTrxBeforeLogFunction { return has_terminated_trx_; } - private: +private: int64_t start_log_ts_; int64_t end_log_ts_; bool has_terminated_trx_; @@ -1819,7 +1819,7 @@ class ObCheckHasTerminatedTrxBeforeLogFunction { // For physical backup and restore, after pulling the log, // use this interface to garbage collect unfinished transactions class ObClearTransAfterRestoreLog { - public: +public: explicit ObClearTransAfterRestoreLog( const int64_t restore_snapshot_version, const uint64_t last_restore_log_id, const int64_t fake_terminate_log_ts) : ret_(OB_SUCCESS), @@ -1852,7 +1852,7 @@ class ObClearTransAfterRestoreLog { return OB_SUCCESS == ret; } - private: +private: int ret_; int64_t restore_snapshot_version_; uint64_t last_restore_log_id_; diff --git a/src/storage/transaction/ob_trans_listener_handler.h b/src/storage/transaction/ob_trans_listener_handler.h index 639ed183b..be50ac59b 100644 --- a/src/storage/transaction/ob_trans_listener_handler.h +++ b/src/storage/transaction/ob_trans_listener_handler.h @@ -25,7 +25,7 @@ class ObTransSplitInfo; enum ListenerAction { LISTENER_COMMIT = 0, LISTENER_ABORT, LISTENER_CLEAR }; class ObTransListenerHandler { - public: +public: ObTransListenerHandler() : part_ctx_(NULL), is_commit_log_synced_(false), is_inited_(false), in_clear_(false) {} ~ObTransListenerHandler() @@ -94,12 +94,12 @@ class ObTransListenerHandler { } TO_STRING_KV(K_(is_commit_log_synced), K_(is_inited)); - private: +private: int init_listener_mask_set_(ObPartTransCtx* ctx); int try_respond_participant_(const int64_t msg_type, const ListenerAction action); DISALLOW_COPY_AND_ASSIGN(ObTransListenerHandler); - private: +private: ObPartTransCtx* part_ctx_; common::ObMaskSet listener_mask_set_; bool is_commit_log_synced_; diff --git a/src/storage/transaction/ob_trans_log.h b/src/storage/transaction/ob_trans_log.h index 305437561..044a78c12 100644 --- a/src/storage/transaction/ob_trans_log.h +++ b/src/storage/transaction/ob_trans_log.h @@ -39,7 +39,7 @@ static const int64_t LOG_VERSION_1 = 1; class ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransLog() : log_type_(storage::OB_LOG_UNKNOWN), partition_(), trans_id_(), cluster_id_(0) {} ObTransLog( @@ -51,7 +51,7 @@ class ObTransLog { int init(const int64_t log_type, const common::ObPartitionKey& partition, const ObTransID& trans_id, const uint64_t cluster_id); - public: +public: int64_t get_log_type() const { return log_type_; @@ -73,7 +73,7 @@ class ObTransLog { int inner_replace_tenant_id(const uint64_t tenant_id); VIRTUAL_TO_STRING_KV(K_(log_type), K_(partition), K_(trans_id), K_(cluster_id)); - public: +public: virtual uint64_t get_tenant_id() const { return partition_.get_tenant_id(); @@ -82,10 +82,10 @@ class ObTransLog { // the extended class must implement this method virtual int replace_tenant_id(const uint64_t new_tenant_id) = 0; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransLog); - protected: +protected: int64_t log_type_; common::ObPartitionKey partition_; ObTransID trans_id_; @@ -95,7 +95,7 @@ class ObTransLog { // log buffer for submitting log template class LogBuf { - public: +public: LogBuf() { reset(); @@ -115,13 +115,13 @@ class LogBuf { return BUFSIZE; } - public: +public: // When ob_resource_pool is used to allocate clog_buf and mutator buf, total number is 128 by default, // after this value is exceeded, ob_malloc/ob_free will be used for operation static const int64_t RP_TOTAL_NUM = 256; static const int64_t RP_RESERVE_NUM = 64; - private: +private: char buf_[BUFSIZE]; }; @@ -131,7 +131,7 @@ typedef LogBuf MutatorBuf; class ObTransMutator : public common::ObDataBuffer { OB_UNIS_VERSION(1); - public: +public: ObTransMutator() : mutator_buf_(NULL), use_mutator_buf_(true) { reset(); @@ -147,7 +147,7 @@ class ObTransMutator : public common::ObDataBuffer { reset(); } - public: +public: MutatorBuf* get_mutator_buf() { return mutator_buf_; @@ -161,10 +161,10 @@ class ObTransMutator : public common::ObDataBuffer { TO_STRING_KV(KP_(mutator_buf), K_(use_mutator_buf), K_(data), K_(position), K_(capacity)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransMutator); - private: +private: MutatorBuf* mutator_buf_; // If MutatorBuf is not used to store data, data will not be copied during deserialization, // and the data pointer directly points to the deserialized buffer. @@ -173,7 +173,7 @@ class ObTransMutator : public common::ObDataBuffer { }; class ObTransMutatorIterator { - public: +public: ObTransMutatorIterator() : ptr_(NULL), size_(0), pos_(0) {} ~ObTransMutatorIterator() @@ -183,14 +183,14 @@ class ObTransMutatorIterator { int get_next(common::ObPartitionKey& pkey, const char*& ptr, int64_t& size); int get_next(common::ObPartitionKey& pkey, ObTransMutator& mutator, int64_t& size); - private: +private: const char* ptr_; int64_t size_; int64_t pos_; }; class ObTransRedoLogHelper { - public: +public: ObTransRedoLogHelper() : tenant_id_(common::OB_INVALID_TENANT_ID), log_no_(-1), @@ -207,7 +207,7 @@ class ObTransRedoLogHelper { ~ObTransRedoLogHelper() {} - public: +public: uint64_t tenant_id_; int64_t log_no_; common::ObAddr scheduler_; @@ -224,7 +224,7 @@ class ObTransRedoLogHelper { class ObTransRedoLog : public ObTransLog { OB_UNIS_VERSION_V(1); - public: +public: ObTransRedoLog(ObTransRedoLogHelper& helper) : ObTransLog(), tenant_id_(helper.tenant_id_), @@ -263,7 +263,7 @@ class ObTransRedoLog : public ObTransLog { {} int init(); - public: +public: uint64_t get_tenant_id() const { return tenant_id_; @@ -324,10 +324,10 @@ class ObTransRedoLog : public ObTransLog { K_(coordinator), K_(participants), K_(trans_param), K_(cluster_id), K_(active_memstore_version), K_(prev_trans_arr), K_(can_elr), K_(xid), K_(is_last)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransRedoLog); - private: +private: uint64_t tenant_id_; int64_t log_no_; common::ObAddr& scheduler_; @@ -343,7 +343,7 @@ class ObTransRedoLog : public ObTransLog { }; class ObTransPrepareLogHelper { - public: +public: ObTransPrepareLogHelper() : tenant_id_(common::OB_INVALID_TENANT_ID), scheduler_(), @@ -364,7 +364,7 @@ class ObTransPrepareLogHelper { ~ObTransPrepareLogHelper() {} - public: +public: uint64_t tenant_id_; common::ObAddr scheduler_; common::ObPartitionKey coordinator_; @@ -395,7 +395,7 @@ class ObTransPrepareLogHelper { class ObTransPrepareLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransPrepareLog(const int64_t log_type, common::ObPartitionKey& partition, ObTransID& trans_id, const uint64_t tenant_id, common::ObAddr& scheduler, common::ObPartitionKey& coordinator, common::ObPartitionArray& participants, ObStartTransParam& trans_param, const int prepare_status, @@ -444,7 +444,7 @@ class ObTransPrepareLog : public ObTransLog { ~ObTransPrepareLog() {} - public: +public: uint64_t get_tenant_id() const { return tenant_id_; @@ -514,10 +514,10 @@ class ObTransPrepareLog : public ObTransLog { K_(active_memstore_version), K_(app_trace_id_str), K_(partition_log_info_arr), K_(checkpoint), K_(prev_trans_arr), K_(can_elr), K_(app_trace_info), K_(xid)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransPrepareLog); - private: +private: uint64_t tenant_id_; common::ObAddr& scheduler_; common::ObPartitionKey& coordinator_; @@ -548,7 +548,7 @@ class ObTransPrepareLog : public ObTransLog { class ObTransCommitLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransCommitLog(PartitionLogInfoArray& partition_log_info_arr) : ObTransLog(), partition_log_info_arr_(partition_log_info_arr), global_trans_version_(-1), checksum_(0) {} @@ -563,7 +563,7 @@ class ObTransCommitLog : public ObTransLog { ~ObTransCommitLog() {} - public: +public: int64_t get_global_trans_version() const { return global_trans_version_; @@ -585,10 +585,10 @@ class ObTransCommitLog : public ObTransLog { TO_STRING_KV(K_(log_type), K_(partition), K_(trans_id), K_(partition_log_info_arr), K_(global_trans_version), K_(checksum), K_(cluster_id)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransCommitLog); - private: +private: PartitionLogInfoArray& partition_log_info_arr_; int64_t global_trans_version_; uint64_t checksum_; @@ -598,7 +598,7 @@ class ObTransCommitLog : public ObTransLog { class ObTransPreCommitLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransPreCommitLog() : ObTransLog(), publish_version_(-1) {} ~ObTransPreCommitLog() @@ -612,17 +612,17 @@ class ObTransPreCommitLog : public ObTransLog { bool is_valid() const; virtual int replace_tenant_id(const uint64_t new_tenant_id) override; - public: +public: TO_STRING_KV(K_(log_type), K_(partition), K_(trans_id), K_(cluster_id), K_(publish_version)); - private: +private: int64_t publish_version_; }; class ObTransAbortLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransAbortLog() : ObTransLog(), partition_log_info_arr_() {} ~ObTransAbortLog() @@ -637,10 +637,10 @@ class ObTransAbortLog : public ObTransLog { } TO_STRING_KV(K_(log_type), K_(partition), K_(trans_id), K_(cluster_id), K_(partition_log_info_arr)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransAbortLog); - private: +private: PartitionLogInfoArray partition_log_info_arr_; ObTransSplitInfo split_info_; }; @@ -648,7 +648,7 @@ class ObTransAbortLog : public ObTransLog { class ObTransClearLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransClearLog() : ObTransLog() {} ~ObTransClearLog() @@ -657,17 +657,17 @@ class ObTransClearLog : public ObTransLog { const uint64_t cluster_id); virtual int replace_tenant_id(const uint64_t new_tenant_id) override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransClearLog); - public: +public: bool is_valid() const; }; class ObSpTransRedoLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObSpTransRedoLog() : ObTransLog(), tenant_id_(common::OB_INVALID_TENANT_ID), @@ -684,7 +684,7 @@ class ObSpTransRedoLog : public ObTransLog { const uint64_t tenant_id, const int64_t log_no, const ObStartTransParam& trans_param, const uint64_t cluster_id, const ObElrTransInfoArray& prev_trans_arr, const bool can_elr); - public: +public: uint64_t get_tenant_id() const { return tenant_id_; @@ -725,10 +725,10 @@ class ObSpTransRedoLog : public ObTransLog { VIRTUAL_TO_STRING_KV(K_(log_type), K_(partition), K_(trans_id), K_(tenant_id), K_(log_no), K_(trans_param), K_(cluster_id), K_(active_memstore_version), K_(prev_trans_arr), K_(can_elr)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSpTransRedoLog); - protected: +protected: uint64_t tenant_id_; int64_t log_no_; ObStartTransParam trans_param_; @@ -741,7 +741,7 @@ class ObSpTransRedoLog : public ObTransLog { class ObSpTransCommitLog : public ObSpTransRedoLog { OB_UNIS_VERSION(1); - public: +public: ObSpTransCommitLog() : ObSpTransRedoLog(), global_trans_version_(-1), @@ -759,7 +759,7 @@ class ObSpTransCommitLog : public ObSpTransRedoLog { const common::ObString& app_trace_id_str, const int64_t checkpoint, const ObElrTransInfoArray& prev_trans_arr, const bool can_elr, const common::ObString& app_trace_info); - public: +public: uint64_t get_checksum() const { return checksum_; @@ -795,10 +795,10 @@ class ObSpTransCommitLog : public ObSpTransRedoLog { K_(active_memstore_version), K_(checksum), K_(prev_redo_log_ids), K_(app_trace_id_str), K_(checkpoint), K_(prev_trans_arr), K_(app_trace_info)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSpTransCommitLog); - private: +private: // global_trans_version_ is not used anymore. // before version 2.2, before submitting sp commit log, global_trans_version // will be pre-allocated and recorded in the log body. @@ -817,7 +817,7 @@ class ObSpTransCommitLog : public ObSpTransRedoLog { class ObSpTransAbortLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObSpTransAbortLog() : ObTransLog() {} ~ObSpTransAbortLog() @@ -825,26 +825,26 @@ class ObSpTransAbortLog : public ObTransLog { int init(const int64_t log_type, const common::ObPartitionKey& partition, const ObTransID& trans_id, const uint64_t cluster_id); - public: +public: bool is_valid() const; virtual int replace_tenant_id(const uint64_t new_tenant_id) override; TO_STRING_KV(K_(log_type), K_(partition), K_(trans_id), K_(cluster_id)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObSpTransAbortLog); }; class ObCheckpointLog { OB_UNIS_VERSION(1); - public: +public: ObCheckpointLog() : checkpoint_(0) {} ~ObCheckpointLog() {} int init(const int64_t checkpoint); - public: +public: int64_t get_checkpoint() const { return checkpoint_; @@ -852,14 +852,14 @@ class ObCheckpointLog { bool is_valid() const; TO_STRING_KV(K_(checkpoint)); - private: +private: int64_t checkpoint_; }; class ObTransStateLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransStateLog() : create_ts_(0), tenant_id_(common::OB_INVALID_TENANT_ID), @@ -887,7 +887,7 @@ class ObTransStateLog : public ObTransLog { const uint64_t cluster_version, const int64_t snapshot_version, const int64_t cur_query_start_time, const int64_t stmt_expired_time, const ObXATransID& xid); - public: +public: int64_t get_create_ts() const { return create_ts_; @@ -973,7 +973,7 @@ class ObTransStateLog : public ObTransLog { return xid_; } - public: +public: bool is_valid() const { return true; @@ -985,7 +985,7 @@ class ObTransStateLog : public ObTransLog { K_(proposal_leader), K_(cluster_version), K_(snapshot_version), K_(cur_query_start_time), K_(stmt_expired_time), K_(xid)); - private: +private: int64_t create_ts_; int64_t tenant_id_; int64_t trans_expired_time_; @@ -1012,7 +1012,7 @@ class ObTransStateLog : public ObTransLog { class ObTransMutatorLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransMutatorLog() : ObTransLog(), tenant_id_(common::OB_INVALID_TENANT_ID), @@ -1035,7 +1035,7 @@ class ObTransMutatorLog : public ObTransLog { void destroy() {} - public: +public: uint64_t get_tenant_id() const { return tenant_id_; @@ -1074,11 +1074,11 @@ class ObTransMutatorLog : public ObTransLog { } virtual int replace_tenant_id(const uint64_t new_tenant_id) override; - public: +public: TO_STRING_KV(K_(log_type), K_(partition), K_(trans_id), K_(cluster_id), K_(tenant_id), K_(trans_expired_time), K_(trans_param), K_(log_no), K_(prev_trans_arr), K_(can_elr), K_(cluster_version)); - private: +private: int64_t tenant_id_; int64_t trans_expired_time_; ObStartTransParam trans_param_; @@ -1092,7 +1092,7 @@ class ObTransMutatorLog : public ObTransLog { class ObTransMutatorAbortLog : public ObTransLog { OB_UNIS_VERSION(1); - public: +public: ObTransMutatorAbortLog() {} ~ObTransMutatorAbortLog() @@ -1105,7 +1105,7 @@ class ObTransMutatorAbortLog : public ObTransLog { // Provide related methods for log analysis class ObTransLogParseUtils { - public: +public: static int parse_redo_prepare_log( const clog::ObLogEntry& log_entry, uint64_t& log_id, int64_t& log_timestamp, ObTransID& trans_id); }; diff --git a/src/storage/transaction/ob_trans_memory_stat.h b/src/storage/transaction/ob_trans_memory_stat.h index 45308c911..d9cddd8fc 100644 --- a/src/storage/transaction/ob_trans_memory_stat.h +++ b/src/storage/transaction/ob_trans_memory_stat.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace transaction { class ObTransMemoryStat { - public: +public: ObTransMemoryStat() { reset(); @@ -47,10 +47,10 @@ class ObTransMemoryStat { TO_STRING_KV(K_(addr), "type", type_, K_(alloc_count), K_(release_count)); - public: +public: static const int64_t OB_TRANS_MEMORY_MOD_TYPE_SIZE = 64; - private: +private: common::ObAddr addr_; char type_[OB_TRANS_MEMORY_MOD_TYPE_SIZE]; int64_t alloc_count_; diff --git a/src/storage/transaction/ob_trans_migrate_worker.h b/src/storage/transaction/ob_trans_migrate_worker.h index 9b17ead2c..15dff224a 100644 --- a/src/storage/transaction/ob_trans_migrate_worker.h +++ b/src/storage/transaction/ob_trans_migrate_worker.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace transaction { class ObTransMigrateWorker : public lib::TGTaskHandler { - public: +public: ObTransMigrateWorker() : is_inited_(false), is_running_(false) {} ~ObTransMigrateWorker() @@ -34,10 +34,10 @@ class ObTransMigrateWorker : public lib::TGTaskHandler { void destroy(); int push(void* task); - public: +public: void handle(void* task); - private: +private: bool is_inited_; bool is_running_; }; diff --git a/src/storage/transaction/ob_trans_msg.h b/src/storage/transaction/ob_trans_msg.h index a1451106a..d5e3a333e 100644 --- a/src/storage/transaction/ob_trans_msg.h +++ b/src/storage/transaction/ob_trans_msg.h @@ -35,7 +35,7 @@ namespace transaction { class ObTransMsgBase : public obrpc::ObIFill { OB_UNIS_VERSION(1); - public: +public: ObTransMsgBase() { reset(); @@ -48,7 +48,7 @@ class ObTransMsgBase : public obrpc::ObIFill { void reset(); bool is_valid() const; - public: +public: uint64_t get_tenant_id() const { return tenant_id_; @@ -86,7 +86,7 @@ class ObTransMsgBase : public obrpc::ObIFill { return sender_addr_; } - protected: +protected: uint64_t tenant_id_; ObTransID trans_id_; int64_t msg_type_; @@ -101,7 +101,7 @@ class ObTransMsgBase : public obrpc::ObIFill { class ObTransMsg : public ObTransMsgBase { OB_UNIS_VERSION(1); - public: +public: ObTransMsg() : participants_(common::ObModIds::OB_TRANS_PARTITION_ARRAY, common::OB_MALLOC_NORMAL_BLOCK_SIZE), partition_log_info_arr_( @@ -301,7 +301,7 @@ class ObTransMsg : public ObTransMsgBase { const ObStartTransParam& trans_param, const common::ObAddr& sender_addr, const common::ObAddr& scheduler, const int32_t status); - public: +public: const common::ObAddr& get_scheduler() const { return scheduler_; @@ -491,16 +491,16 @@ class ObTransMsg : public ObTransMsgBase { K_(can_elr), K_(is_dup_table_trans), K_(is_not_create_ctx_participant), K_(batch_same_leader_partitions), K_(app_trace_info), K_(xid), K_(is_xa_prepare), K_(stmt_rollback_participants), K_(msg_timeout)); - public: +public: bool is_valid() const; - private: +private: bool cluster_version_before_2271_() const { return cluster_version_ < CLUSTER_VERSION_2271; } - private: +private: bool is_inited_; common::ObAddr scheduler_; common::ObPartitionKey coordinator_; diff --git a/src/storage/transaction/ob_trans_msg2.h b/src/storage/transaction/ob_trans_msg2.h index e539c4450..9fc5a1ae2 100644 --- a/src/storage/transaction/ob_trans_msg2.h +++ b/src/storage/transaction/ob_trans_msg2.h @@ -26,7 +26,7 @@ namespace transaction { struct ObTrxMsgBase : public obrpc::ObIFill { OB_UNIS_VERSION(1); - public: +public: ObTrxMsgBase() : tenant_id_(common::OB_INVALID_TENANT_ID), msg_type_(OB_TRX_MSG_UNKNOWN), trans_time_(0), timestamp_(0) {} @@ -48,7 +48,7 @@ struct ObTrxMsgBase : public obrpc::ObIFill { TO_STRING_KV(K_(tenant_id), K_(trans_id), K_(msg_type), K_(trans_time), K_(sender), K_(receiver), K_(trans_param), K_(sender_addr), K_(timestamp)); - public: +public: uint64_t tenant_id_; ObTransID trans_id_; int64_t msg_type_; @@ -342,7 +342,7 @@ PartitionLogInfoArray partition_log_info_arr_; struct ObTrx2PCPrepareRequest : public ObTrxMsgBase { OB_UNIS_VERSION(1); - public: +public: ObTrx2PCPrepareRequest() : status_(common::OB_SUCCESS), request_id_(0), stc_(0), is_xa_prepare_(false) {} int init(const uint64_t tenant_id, const ObTransID& trans_id, const int64_t msg_type, const int64_t trans_time, @@ -368,7 +368,7 @@ struct ObTrx2PCPrepareRequest : public ObTrxMsgBase { TO_STRING_KV(K_(scheduler), K_(coordinator), K_(participants), K_(request_id), K_(status), K_(stc), K_(partition_log_info_arr), K_(batch_same_leader_partitions), K_(app_trace_info), K_(xid), K_(is_xa_prepare)); - public: +public: common::ObAddr scheduler_; common::ObPartitionKey coordinator_; common::ObPartitionArray participants_; @@ -386,7 +386,7 @@ struct ObTrx2PCPrepareRequest : public ObTrxMsgBase { struct ObTrx2PCPrepareResponse : public ObTrxMsgBase { OB_UNIS_VERSION(1); - public: +public: ObTrx2PCPrepareResponse() : prepare_log_id_(0), prepare_log_timestamp_(0), @@ -423,7 +423,7 @@ struct ObTrx2PCPrepareResponse : public ObTrxMsgBase { K_(partition_log_info_arr), K_(trans_version), K_(prepare_log_id), K_(prepare_log_timestamp), K_(need_wait_interval_us), K_(app_trace_info), K_(publish_version), K_(xid), K_(is_xa_prepare)); - public: +public: common::ObAddr scheduler_; common::ObPartitionKey coordinator_; common::ObPartitionArray participants_; @@ -445,7 +445,7 @@ struct ObTrx2PCPrepareResponse : public ObTrxMsgBase { struct ObTrx2PCCommitRequest : public ObTrxMsgBase { OB_UNIS_VERSION(1); - public: +public: ObTrx2PCCommitRequest() : trans_version_(0), request_id_(0), status_(common::OB_SUCCESS) {} int init(const uint64_t tenant_id, const ObTransID& trans_id, const int64_t msg_type, const int64_t trans_time, @@ -465,7 +465,7 @@ struct ObTrx2PCCommitRequest : public ObTrxMsgBase { TO_STRING_KV( K_(scheduler), K_(coordinator), K_(participants), K_(request_id), K_(status), K_(batch_same_leader_partitions)); - public: +public: common::ObAddr scheduler_; common::ObPartitionKey coordinator_; common::ObPartitionArray participants_; @@ -481,10 +481,10 @@ typedef ObTrx2PCPreCommitRequest ObTrx2PCPreCommitResponse; struct ObTrxListenerCommitRequest : public ObTrx2PCCommitRequest { OB_UNIS_VERSION(1); - public: +public: INHERIT_TO_STRING_KV("ObTrx2PCCommitRequest", ObTrx2PCCommitRequest, K_(split_info)); - public: +public: ObTransSplitInfo split_info_; }; @@ -493,7 +493,7 @@ typedef ObTrxListenerCommitRequest ObTrxListenerCommitResponse; struct ObTrx2PCCommitResponse : public ObTrxMsgBase { OB_UNIS_VERSION(1); - public: +public: ObTrx2PCCommitResponse() : trans_version_(0), request_id_(0), status_(common::OB_SUCCESS), commit_log_ts_(0) {} int init(const uint64_t tenant_id, const ObTransID& trans_id, const int64_t msg_type, const int64_t trans_time, @@ -514,7 +514,7 @@ struct ObTrx2PCCommitResponse : public ObTrxMsgBase { TO_STRING_KV(K_(scheduler), K_(coordinator), K_(participants), K_(request_id), K_(status), K_(batch_same_leader_partitions), K_(commit_log_ts)); - public: +public: common::ObAddr scheduler_; common::ObPartitionKey coordinator_; common::ObPartitionArray participants_; @@ -528,7 +528,7 @@ struct ObTrx2PCCommitResponse : public ObTrxMsgBase { struct ObTrx2PCAbortRequest : public ObTrxMsgBase { OB_UNIS_VERSION(1); - public: +public: ObTrx2PCAbortRequest() : request_id_(0), status_(common::OB_SUCCESS) {} int init(const uint64_t tenant_id, const ObTransID& trans_id, const int64_t msg_type, const int64_t trans_time, @@ -548,7 +548,7 @@ struct ObTrx2PCAbortRequest : public ObTrxMsgBase { TO_STRING_KV( K_(scheduler), K_(coordinator), K_(participants), K_(request_id), K_(status), K_(batch_same_leader_partitions)); - public: +public: common::ObAddr scheduler_; common::ObPartitionKey coordinator_; common::ObPartitionArray participants_; @@ -562,7 +562,7 @@ typedef ObTrx2PCAbortRequest ObTrx2PCAbortResponse; struct ObTrx2PCClearRequest : public ObTrxMsgBase { OB_UNIS_VERSION(1); - public: +public: ObTrx2PCClearRequest() : request_id_(0), status_(common::OB_SUCCESS), clear_log_base_ts_(0) {} int init(const uint64_t tenant_id, const ObTransID& trans_id, const int64_t msg_type, const int64_t trans_time, @@ -582,7 +582,7 @@ struct ObTrx2PCClearRequest : public ObTrxMsgBase { TO_STRING_KV(K_(scheduler), K_(coordinator), K_(participants), K_(request_id), K_(status), K_(batch_same_leader_partitions), K_(clear_log_base_ts)); - public: +public: common::ObAddr scheduler_; common::ObPartitionKey coordinator_; common::ObPartitionArray participants_; @@ -596,10 +596,10 @@ typedef ObTrx2PCClearRequest ObTrx2PCClearResponse; struct ObTrxListenerAbortRequest : public ObTrx2PCAbortRequest { OB_UNIS_VERSION(1); - public: +public: INHERIT_TO_STRING_KV("ObTrx2PCAbortRequest", ObTrx2PCAbortRequest, K_(split_info)); - public: +public: ObTransSplitInfo split_info_; }; @@ -677,7 +677,7 @@ union ObTransMsgUnionData { }; class ObTransMsgUnion { - public: +public: ObTransMsgUnion(const int64_t msg_type); ~ObTransMsgUnion(); void set_receiver(const common::ObPartitionKey& receiver); diff --git a/src/storage/transaction/ob_trans_msg_handler.h b/src/storage/transaction/ob_trans_msg_handler.h index 6d3e35bb0..a5ca67b8e 100644 --- a/src/storage/transaction/ob_trans_msg_handler.h +++ b/src/storage/transaction/ob_trans_msg_handler.h @@ -27,7 +27,7 @@ class ObITransRpc; class ObCoordTransCtx; class ObTransMsgHandler { - public: +public: ObTransMsgHandler() { reset(); @@ -50,7 +50,7 @@ class ObTransMsgHandler { int coord_ctx_handle_response(const ObTrxMsgBase& msg, const int64_t msg_type); int orphan_msg_handle(const ObTrxMsgBase& msg, const int64_t msg_type); - private: +private: int handle_orphan_2pc_clear_request_(const ObTrx2PCClearRequest& msg); int handle_orphan_2pc_abort_request_(const ObTrx2PCAbortRequest& msg); int handle_orphan_2pc_commit_request_(const ObTrx2PCCommitRequest& msg); @@ -63,7 +63,7 @@ class ObTransMsgHandler { int coord_ctx_handle_response_helper_( ObCoordTransCtx* coord_ctx, const bool alloc, const ObTrxMsgBase& msg, const int64_t msg_type); - private: +private: ObTransService* txs_; ObPartTransCtxMgr* part_trans_ctx_mgr_; ObCoordTransCtxMgr* coord_trans_ctx_mgr_; diff --git a/src/storage/transaction/ob_trans_msg_type.h b/src/storage/transaction/ob_trans_msg_type.h index eddd3abee..f7b7e664b 100644 --- a/src/storage/transaction/ob_trans_msg_type.h +++ b/src/storage/transaction/ob_trans_msg_type.h @@ -73,7 +73,7 @@ enum ObTransMsgType { const int32_t OB_TRX_NEW_MSG_TYPE_BASE = 1000; class ObTransMsgTypeChecker { - public: +public: static bool is_valid_msg_type(const int64_t msg_type) { return ((0 <= msg_type && 16 >= msg_type) || (96 <= msg_type && 111 >= msg_type) || @@ -98,7 +98,7 @@ class ObTransMsgTypeChecker { return (msg_type >= OB_TRANS_2PC_LOG_ID_REQUEST && msg_type <= OB_TRANS_2PC_PRE_COMMIT_RESPONSE); } - private: +private: ObTransMsgTypeChecker() {} ~ObTransMsgTypeChecker() diff --git a/src/storage/transaction/ob_trans_msg_type2.h b/src/storage/transaction/ob_trans_msg_type2.h index 6b92adaf2..54348f87b 100644 --- a/src/storage/transaction/ob_trans_msg_type2.h +++ b/src/storage/transaction/ob_trans_msg_type2.h @@ -69,7 +69,7 @@ enum ObTransMsgType2 { }; class ObTransMsgType2Checker { - public: +public: static bool is_valid_msg_type(const int64_t msg_type) { return OB_TRX_2PC_CLEAR_REQUEST == msg_type || OB_TRX_2PC_CLEAR_RESPONSE == msg_type || diff --git a/src/storage/transaction/ob_trans_part_ctx.h b/src/storage/transaction/ob_trans_part_ctx.h index ff46847a3..171d3b077 100644 --- a/src/storage/transaction/ob_trans_part_ctx.h +++ b/src/storage/transaction/ob_trans_part_ctx.h @@ -60,7 +60,7 @@ enum { namespace transaction { class TransResultInfo { - public: +public: TransResultInfo() : result_info_(NULL), registered_(false) {} ~TransResultInfo() @@ -82,7 +82,7 @@ class TransResultInfo { registered_ = registered; } - private: +private: ObTransResultInfo* result_info_; bool registered_; }; @@ -91,7 +91,7 @@ class TransResultInfo { class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { friend class IterateTransStatFunctor; - public: +public: ObPartTransCtx() : ObDistTransCtx("participant", ObTransCtxType::PARTICIPANT), ObTsCbTask(), @@ -116,7 +116,7 @@ class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { void reset(); int construct_context(const ObTransMsg& msg); - public: +public: int start_trans(); int start_task(const ObTransDesc& trans_desc, const int64_t snapshot_version, const bool need_update_gts, storage::ObIPartitionGroup* ob_partition); @@ -201,7 +201,7 @@ class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { return mutator_log_no_; } - public: +public: int replay_sp_redo_log( const ObSpTransRedoLog& log, const int64_t timestamp, const uint64_t log_id, int64_t& log_table_version); int replay_sp_commit_log(const ObSpTransCommitLog& log, const int64_t timestamp, const uint64_t log_id); @@ -382,7 +382,7 @@ class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { virtual int64_t get_part_trans_action() const override; int rollback_stmt(const int64_t from_sql_no, const int64_t to_sql_no); - public: +public: INHERIT_TO_STRING_KV("ObDistTransCtx", ObDistTransCtx, K_(snapshot_version), K_(local_trans_version), K_(submit_log_pending_count), K_(submit_log_count), K_(stmt_info), K_(global_trans_version), K_(redo_log_no), K_(mutator_log_no), K_(session_id), K_(is_gts_waiting), K_(part_trans_action), K_(timeout_task), @@ -394,10 +394,10 @@ class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { K_(same_leader_batch_partitions_count), K_(is_hazardous_ctx), K(mt_ctx_.get_callback_count()), K_(in_xa_prepare_state), K_(is_listener), K_(last_replayed_redo_log_id)); - public: +public: static const int64_t OP_LOCAL_NUM = 16; - private: +private: int init_memtable_ctx_(ObTransService* txs, const uint64_t tenant_id); bool is_in_2pc_() const; bool is_logging_() const; @@ -438,7 +438,7 @@ class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { } int submit_log_sync_(const int64_t log_type, bool& has_redo_log); - private: +private: int handle_start_stmt_request_(const ObTransMsg& msg); int handle_stmt_rollback_request_(const ObTransMsg& msg); int handle_2pc_prepare_request_(const ObTransMsg& msg); @@ -457,7 +457,7 @@ class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { int handle_2pc_prepare_request_raw_(int status); int handle_2pc_prepare_redo_request_raw_(int status); - private: +private: int drive_(); void check_prev_trans_state_(); int start_trans_(); @@ -599,10 +599,10 @@ class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { int fake_kill_(const int64_t terminate_log_ts); int kill_v2_(const int64_t terminate_log_ts); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObPartTransCtx); - private: +private: // 0x0078746374726170 means reset partctx static const int64_t PART_CTX_MAGIC_NUM = 0x0078746374726170; static const int64_t REPLAY_PRINT_TRACE_THRESHOLD = 10 * 1000; // 10 ms @@ -610,7 +610,7 @@ class ObPartTransCtx : public ObDistTransCtx, public ObTsCbTask { static const int64_t END_STMT_SLEEP_US = 10 * 1000; // 10ms static const int64_t MAX_END_STMT_RETRY_TIMES = 100; - private: +private: bool is_inited_; ObIClogAdapter* clog_adapter_; ObTransSubmitLogCb submit_log_cb_; diff --git a/src/storage/transaction/ob_trans_partition_stat.h b/src/storage/transaction/ob_trans_partition_stat.h index 93899eff6..5c82ce2fa 100644 --- a/src/storage/transaction/ob_trans_partition_stat.h +++ b/src/storage/transaction/ob_trans_partition_stat.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace transaction { class ObTransPartitionStat { - public: +public: ObTransPartitionStat() { reset(); @@ -104,7 +104,7 @@ class ObTransPartitionStat { K_(with_dependency_trx_count), K_(without_dependency_trx_count), K_(end_trans_by_prev_count), K_(end_trans_by_checkpoint_count), K_(end_trans_by_self_count)); - private: +private: common::ObAddr addr_; common::ObPartitionKey partition_; int64_t ctx_type_; diff --git a/src/storage/transaction/ob_trans_result.h b/src/storage/transaction/ob_trans_result.h index 3162bb73e..de690437f 100644 --- a/src/storage/transaction/ob_trans_result.h +++ b/src/storage/transaction/ob_trans_result.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace transaction { class ObTransCond { - public: +public: ObTransCond() { reset(); @@ -31,7 +31,7 @@ class ObTransCond { {} void reset(); - public: +public: // when SQL submit or abort transaction, it must wait transaction response for some time. // safer to call wait(wait_time_us, result) int wait(const int64_t wait_time_us, int& result); @@ -43,10 +43,10 @@ class ObTransCond { static void usleep(const int64_t us); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransCond); - private: +private: bool finished_; mutable tbutil::Monitor monitor_; int result_; diff --git a/src/storage/transaction/ob_trans_result_info_mgr.h b/src/storage/transaction/ob_trans_result_info_mgr.h index f6ceb888f..c81d0955f 100644 --- a/src/storage/transaction/ob_trans_result_info_mgr.h +++ b/src/storage/transaction/ob_trans_result_info_mgr.h @@ -25,7 +25,7 @@ namespace transaction { class ObTransResultInfoFactory; class ObTransResultInfoLinkNode { - public: +public: ObTransResultInfoLinkNode() { reset(); @@ -51,13 +51,13 @@ class ObTransResultInfoLinkNode { next_ = next; } - protected: +protected: ObTransResultInfoLinkNode* next_; ObTransResultInfoLinkNode* prev_; }; class ObTransResultInfo : public ObTransResultInfoLinkNode { - public: +public: ObTransResultInfo() { reset(); @@ -118,10 +118,10 @@ class ObTransResultInfo : public ObTransResultInfoLinkNode { } TO_STRING_KV(K_(state), K_(commit_version), K_(min_log_id), K_(trans_id)); - public: +public: static const int64_t TOTAL_NUM = 1024; - private: +private: int state_; int64_t commit_version_; uint64_t min_log_id_; @@ -130,7 +130,7 @@ class ObTransResultInfo : public ObTransResultInfoLinkNode { }; class ObGetMinLogIdFunction { - public: +public: ObGetMinLogIdFunction() : min_log_id_(UINT64_MAX), min_log_ts_(INT64_MAX) {} ~ObGetMinLogIdFunction() @@ -152,13 +152,13 @@ class ObGetMinLogIdFunction { return min_log_ts_; } - private: +private: uint64_t min_log_id_; int64_t min_log_ts_; }; class ObITransResultInfoMgr { - public: +public: ObITransResultInfoMgr() {} virtual ~ObITransResultInfoMgr() @@ -197,7 +197,7 @@ struct ObTransResultInfoBucketHeader { } CACHE_ALIGNED; class ObTransResultInfoMgr : public ObITransResultInfoMgr { - public: +public: ObTransResultInfoMgr() { reset(); @@ -245,7 +245,7 @@ class ObTransResultInfoMgr : public ObITransResultInfoMgr { return ret; } - private: +private: int gc_by_checkpoint_(const int64_t checkpoint, ObTransResultInfo* info, ObTransResultInfo*& release_point); int release_trans_result_info_(ObTransResultInfo* info); int get_partition_checkpoint_version_(int64_t& checkpoint); @@ -271,12 +271,12 @@ class ObTransResultInfoMgr : public ObITransResultInfoMgr { return bool_ret; } - private: +private: // TODO: dynamic scale by transaction concurrency grade static const int64_t TRANS_RESULT_INFO_BUCKET_COUNT = 512; static const int64_t TRANS_RESULT_INFO_GC_INTERVAL_US = 1000 * 1000; - private: +private: bool is_inited_; ObTransResultInfoBucketHeader bucket_header_[TRANS_RESULT_INFO_BUCKET_COUNT]; storage::ObPartitionService* partition_service_; diff --git a/src/storage/transaction/ob_trans_rpc.h b/src/storage/transaction/ob_trans_rpc.h index 171297b39..bc2aa3c72 100644 --- a/src/storage/transaction/ob_trans_rpc.h +++ b/src/storage/transaction/ob_trans_rpc.h @@ -58,7 +58,7 @@ namespace obrpc { class ObTransRpcResult { OB_UNIS_VERSION(1); - public: +public: ObTransRpcResult() { reset(); @@ -78,16 +78,16 @@ class ObTransRpcResult { void reset(); TO_STRING_KV(K_(status), K_(send_timestamp)); - public: +public: static const int64_t OB_TRANS_RPC_TIMEOUT_THRESHOLD = 3 * 1000 * 1000; - private: +private: int status_; int64_t send_timestamp_; }; class ObTransRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObTransRpcProxy); RPC_AP(PR3 post_trans_msg, OB_TRANS, (transaction::ObTransMsg), ObTransRpcResult); @@ -95,38 +95,38 @@ class ObTransRpcProxy : public obrpc::ObRpcProxy { }; class ObTransP : public ObRpcProcessor > { - public: +public: ObTransP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransP); - private: +private: storage::ObPartitionService* partition_service_; }; class ObTransRespP : public ObRpcProcessor > { - public: +public: ObTransRespP(storage::ObPartitionService* partition_service) : partition_service_(partition_service) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransRespP); - private: +private: storage::ObPartitionService* partition_service_; }; template class ObTransRPCCB : public ObTransRpcProxy::AsyncCB { - public: +public: ObTransRPCCB() : is_inited_(false), msg_type_(transaction::OB_TRANS_MSG_UNKNOWN), @@ -161,11 +161,11 @@ class ObTransRPCCB : public ObTransRpcProxy::AsyncCB { return newcb; } - public: +public: int process(); void on_timeout(); - private: +private: bool is_inited_; common::ObPartitionKey pkey_; transaction::ObTransID trans_id_; @@ -337,7 +337,7 @@ void ObTransRPCCB::on_timeout() namespace transaction { class TransRpcTask : public ObTransTask { - public: +public: TransRpcTask() { reset(); @@ -395,7 +395,7 @@ class TransRpcTask : public ObTransTask { TO_STRING_KV(K_(partition), K_(trans_id), K_(msg_type), K_(status), K_(msg), K_(task_type), K_(addr), K_(request_id), K_(sql_no), K_(task_timeout)); - public: +public: ObPartitionKey partition_; ObTransID trans_id_; int64_t msg_type_; @@ -408,7 +408,7 @@ class TransRpcTask : public ObTransTask { }; class ObITransRpc { - public: +public: ObITransRpc() {} virtual ~ObITransRpc() @@ -418,7 +418,7 @@ class ObITransRpc { virtual void wait() = 0; virtual void destroy() = 0; - public: +public: virtual int post_trans_msg( const uint64_t tenant_id, const common::ObAddr& server, const ObTransMsg& msg, const int64_t msg_type) = 0; virtual int post_trans_msg( @@ -427,7 +427,7 @@ class ObITransRpc { }; class ObTransRpc : public ObITransRpc { - public: +public: ObTransRpc() : is_inited_(false), is_running_(false), @@ -448,20 +448,20 @@ class ObTransRpc : public ObITransRpc { void wait(); void destroy(); - public: +public: int post_trans_msg( const uint64_t tenant_id, const common::ObAddr& server, const ObTransMsg& msg, const int64_t msg_type); int post_trans_msg( const uint64_t tenant_id, const common::ObAddr& server, const ObTrxMsgBase& msg, const int64_t msg_type); int post_trans_resp_msg(const uint64_t tenant_id, const ObAddr& server, const ObTransMsg& msg); - private: +private: void statistics_(); - private: +private: static const int64_t STAT_INTERVAL = 1 * 1000 * 1000; - private: +private: bool is_inited_; bool is_running_; obrpc::ObTransRpcProxy* rpc_proxy_; @@ -474,7 +474,7 @@ class ObTransRpc : public ObITransRpc { }; class ObTransBatchRpc : public ObITransRpc { - public: +public: ObTransBatchRpc() : trx_rpc_(), batch_rpc_(NULL) {} ~ObTransBatchRpc() @@ -488,14 +488,14 @@ class ObTransBatchRpc : public ObITransRpc { void wait(); void destroy(); - public: +public: int post_trans_msg( const uint64_t tenant_id, const common::ObAddr& server, const ObTransMsg& msg, const int64_t msg_type); int post_trans_msg( const uint64_t tenant_id, const common::ObAddr& server, const ObTrxMsgBase& msg, const int64_t msg_type); int post_trans_resp_msg(const uint64_t tenant_id, const ObAddr& server, const ObTransMsg& msg); - private: +private: ObTransRpc trx_rpc_; obrpc::ObBatchRpc* batch_rpc_; DISALLOW_COPY_AND_ASSIGN(ObTransBatchRpc); diff --git a/src/storage/transaction/ob_trans_sche_ctx.h b/src/storage/transaction/ob_trans_sche_ctx.h index 78b4f85ac..fe6b760c2 100644 --- a/src/storage/transaction/ob_trans_sche_ctx.h +++ b/src/storage/transaction/ob_trans_sche_ctx.h @@ -55,7 +55,7 @@ typedef common::ObSEArray ObXABranchInfoArray; // one transaction include scheduler context, coordinator context and participant context // scheduler transaction context class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { - public: +public: ObScheTransCtx() : ObDistTransCtx("scheduler", ObTransCtxType::SCHEDULER), last_stmt_participants_(ObModIds::OB_TRANS_PARTITION_ARRAY, OB_MALLOC_NORMAL_BLOCK_SIZE), @@ -77,7 +77,7 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { virtual void destroy(); void reset(); - public: +public: int handle_message(const ObTransMsg& msg); bool is_inited() const; int handle_timeout(const int64_t delay); @@ -105,13 +105,13 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { } int inactive(ObEndTransCallbackArray& cb_array); - public: +public: static bool need_retry_end_trans(const int retcode) { return OB_LOCATION_LEADER_NOT_EXIST == retcode || OB_LOCATION_NOT_EXIST == retcode || OB_NOT_MASTER == retcode; } - public: +public: int start_trans(const ObTransDesc& trans_desc); int end_trans(const ObTransDesc& trans_desc, const bool is_rollback, sql::ObIEndTransCallback* cb, const int64_t trans_expired_time, const int64_t stmt_expired_time, const MonotonicTs commit_time); @@ -257,7 +257,7 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { // this func can only be called in original sche (tighly coupled mode) int xa_end_stmt(const ObXATransID& xid, const ObTransDesc& trans_desc, const bool from_remote, const int64_t seq_no); - public: +public: INHERIT_TO_STRING_KV("ObDistTransCtx", ObDistTransCtx, K_(state), K_(sql_no), K_(is_rollback), K_(session_id), K_(proxy_session_id), K_(cluster_id), K_(commit_times), K_(is_tenant_active), K_(app_trace_id_str), K_(is_gts_waiting), K_(can_elr), K_(savepoint_sql_no), K_(is_xa_end_trans), K_(is_xa_readonly), @@ -265,7 +265,7 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { K_(is_terminated), K_(stmt_rollback_req_timeout)); static const int64_t OP_LOCAL_NUM = 16; - private: +private: int merge_partition_leader_info_(const ObPartitionLeaderArray& partition_leader_arr); int merge_stmt_participants_pla_(const ObPartitionLeaderArray& pla); int submit_trans_request_(const int64_t msg_type); @@ -289,7 +289,7 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { int handle_savepoint_rollback_response_(const ObTransMsg& msg); int get_trans_location_(const ObPartitionKey& partition, ObAddr& addr); - private: +private: int drive_(); int drive_(bool& need_callback); int end_trans_(const bool is_rollback, bool& need_callback); @@ -320,9 +320,9 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { // get unprepared branch count for tightly coupled xa trans int64_t get_unprepared_branch_count_(); - private: +private: class State { - public: + public: static const int64_t INVALID = -1; static const int64_t UNKNOWN = 0; static const int64_t START_TRANS = 1; @@ -331,14 +331,14 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { static const int64_t END_TRANS = 4; static const int64_t MAX = 5; - public: + public: static bool is_valid(const int64_t state) { return state > INVALID && state < MAX; } }; class Ops { - public: + public: static const int64_t INVALID = -1; static const int64_t START_TRANS = 0; static const int64_t START_STMT = 1; @@ -346,14 +346,14 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { static const int64_t END_TRANS = 3; static const int64_t MAX = 4; - public: + public: static bool is_valid(const int64_t op) { return op > INVALID && op < MAX; } }; class StateHelper { - public: + public: explicit StateHelper(int64_t& state) : state_(state), last_state_(State::INVALID), is_switching_(false) {} ~StateHelper() @@ -361,21 +361,21 @@ class ObScheTransCtx : public ObDistTransCtx, public ObTsCbTask { int switch_state(const int64_t op); void restore_state(); - private: + private: int64_t& state_; int64_t last_state_; bool is_switching_; }; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObScheTransCtx); - private: +private: // 0x0078746365686373 means reset schectx static const int64_t SCHE_CTX_MAGIC_NUM = 0x0078746365686373; static const int64_t RETRY_STMT_ROLLBACK_TASK_INTERVAL_US = 10 * 1000; - private: +private: bool is_inited_; int64_t sql_no_; int64_t cur_stmt_snapshot_version_; diff --git a/src/storage/transaction/ob_trans_service.h b/src/storage/transaction/ob_trans_service.h index 113ebff86..cdd0446d1 100644 --- a/src/storage/transaction/ob_trans_service.h +++ b/src/storage/transaction/ob_trans_service.h @@ -92,7 +92,7 @@ typedef common::ObSimpleIterator ObDupTableLeaseTaskMap; class KillTransArg { - public: +public: KillTransArg(const bool graceful, const bool ignore_ro_trans, const bool need_kill_coord_ctx = true) : graceful_(graceful), ignore_ro_trans_(ignore_ro_trans), need_kill_coord_ctx_(need_kill_coord_ctx) {} @@ -100,7 +100,7 @@ class KillTransArg { {} TO_STRING_KV(K_(graceful), K_(ignore_ro_trans), K_(need_kill_coord_ctx)); - public: +public: bool graceful_; bool ignore_ro_trans_; bool need_kill_coord_ctx_; @@ -114,12 +114,12 @@ enum class ObThreadLocalTransCtxState : int { }; class ObThreadLocalTransCtx { - public: +public: static const int64_t MAX_BIG_TRANS_WORKER = 8; static const int64_t MINI_MODE_MAX_BIG_TRANS_WORKER = 1; static const int64_t MAX_BIG_TRANS_TASK = 100 * 1000; - public: +public: ObThreadLocalTransCtx() : state_(ObThreadLocalTransCtxState::OB_THREAD_LOCAL_CTX_READY) {} ~ObThreadLocalTransCtx() @@ -132,13 +132,13 @@ class ObThreadLocalTransCtx { } void destroy(); - public: +public: memtable::ObMemtableCtx memtable_ctx_; ObThreadLocalTransCtxState state_; } CACHE_ALIGNED; class ObTransService : public common::ObSimpleThreadPool { - public: +public: ObTransService(); virtual ~ObTransService() { @@ -160,7 +160,7 @@ class ObTransService : public common::ObSimpleThreadPool { int push(void* task); virtual void handle(void* task) override; - public: +public: memtable::ObIMemtableCtxFactory* get_mem_ctx_factory(); // interfaces for SQL /* @@ -574,7 +574,7 @@ class ObTransService : public common::ObSimpleThreadPool { return &xa_rpc_; } - private: +private: int generate_transaction_snapshot_(ObTransDesc& trans_desc, int64_t& snapshot_version); int end_trans_(bool is_rollback, ObTransDesc& trans_desc, sql::ObIEndTransCallback& cb, const int64_t stmt_expired_time, const MonotonicTs commit_time); @@ -588,7 +588,7 @@ class ObTransService : public common::ObSimpleThreadPool { int end_trans_callback_(sql::ObIEndTransCallback& cb, const int cb_param, const uint64_t tenant_id); int init_memtable_ctx_(memtable::ObMemtableCtx* mem_ctx, const uint64_t tenant_id); - private: +private: int recover_sche_ctx_(ObTransDesc& trans_desc, ObPartTransCtx* part_ctx); int handle_dist_start_stmt_(const ObStmtParam& stmt_param, const ObPartitionLeaderArray& pla, const ObStmtDesc& stmt_desc, ObTransDesc& trans_desc, ObPartitionArray& unreachable_partitions); @@ -641,7 +641,7 @@ class ObTransService : public common::ObSimpleThreadPool { int set_trans_snapshot_version_for_serializable_( ObTransDesc& trans_desc, const int64_t stmt_snapshot_version, const bool is_stmt_snapshot_version_valid); - private: +private: int check_and_handle_orphan_msg_(const int ret_code, const int64_t leader_epoch, const ObTransMsg& msg); int handle_participant_msg_(const ObTransMsg& msg, const common::ObPartitionKey& partition, const bool alloc); int handle_participant_bounded_staleness_msg_(const ObTransMsg& msg, const bool alloc); @@ -736,7 +736,7 @@ class ObTransService : public common::ObSimpleThreadPool { int alloc_tmp_sche_ctx_(ObTransDesc& trans_desc, bool& use_tmp_sche_ctx); void free_tmp_sche_ctx_(ObTransDesc& trans_desc); - private: +private: static const int64_t END_STMT_MORE_TIME_US = 100 * 1000; // max task count in message process queue static const int64_t MAX_MSG_TASK = 10 * 1000 * 1000; @@ -747,13 +747,13 @@ class ObTransService : public common::ObSimpleThreadPool { static const int64_t MAX_TIME_INTERVAL_BETWEEN_MACHINE_US = 200 * 1000; static const int64_t CHANGING_LEADER_TXN_PER_ROUND = 200; - public: +public: // send lease renew request interval for duplicated table partition static const int64_t DUP_TABLE_LEASE_INTERVAL_US = 1 * 1000 * 1000; // 1s // default duplicated table partition lease timeout static const int64_t DEFAULT_DUP_TABLE_LEASE_TIMEOUT_INTERVAL_US = 11 * 1000 * 1000; // 11s static const int64_t DUP_TABLE_LEASE_START_RENEW_INTERVAL_US = 4 * 1000 * 1000; // 4s - protected: +protected: bool is_inited_; bool is_running_; // for ObTransID @@ -772,7 +772,7 @@ class ObTransService : public common::ObSimpleThreadPool { // dup table lease timer ObDupTableLeaseTimer dup_table_lease_timer_; - protected: +protected: bool use_def_; // transaction communication on rpc ObITransRpc* rpc_; @@ -785,7 +785,7 @@ class ObTransService : public common::ObSimpleThreadPool { storage::ObPartitionService* partition_service_; share::schema::ObMultiVersionSchemaService* schema_service_; - private: +private: // scheduler transaction context manager ObScheTransCtxMgr sche_trans_ctx_mgr_; // coordinator transaction context manager @@ -809,7 +809,7 @@ class ObTransService : public common::ObSimpleThreadPool { ObXARpc xa_rpc_; ObLightTransCtxMgr light_trans_ctx_mgr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransService); }; diff --git a/src/storage/transaction/ob_trans_slave_ctx.h b/src/storage/transaction/ob_trans_slave_ctx.h index ba5c5b381..bdc82d59a 100644 --- a/src/storage/transaction/ob_trans_slave_ctx.h +++ b/src/storage/transaction/ob_trans_slave_ctx.h @@ -42,7 +42,7 @@ namespace transaction { class ObSlaveTransCtx : public ObDistTransCtx { friend class IterateTransStatFunctor; - public: +public: ObSlaveTransCtx() : ObDistTransCtx("slave_participant", ObTransCtxType::SLAVE_PARTICIPANT), mt_ctx_() { reset(); @@ -115,7 +115,7 @@ class ObSlaveTransCtx : public ObDistTransCtx { INHERIT_TO_STRING_KV( "ObDistTransCtx", ObDistTransCtx, K_(snapshot_version), K_(stmt_info), K_(session_id), K_(proxy_session_id)); - private: +private: int trans_end_(const bool commit, const int64_t commit_version); int trans_clear_(); int do_clear_(); @@ -137,13 +137,13 @@ class ObSlaveTransCtx : public ObDistTransCtx { int post_ask_scheduler_status_msg_(); DISALLOW_COPY_AND_ASSIGN(ObSlaveTransCtx); - private: +private: // 0x0078746374726170 means reset partctx static const int64_t PART_CTX_MAGIC_NUM = 0x0078746374726170; static const int64_t REPLAY_PRINT_TRACE_THRESHOLD = 10 * 1000; // 10 ms static const int64_t OP_LOCAL_NUM = 16; - private: +private: bool is_inited_; memtable::ObMemtableCtx mt_ctx_; memtable::ObIMemtableCtxFactory* mt_ctx_factory_; diff --git a/src/storage/transaction/ob_trans_split_adapter.h b/src/storage/transaction/ob_trans_split_adapter.h index ba3b0bc3e..b38e8cb44 100644 --- a/src/storage/transaction/ob_trans_split_adapter.h +++ b/src/storage/transaction/ob_trans_split_adapter.h @@ -36,7 +36,7 @@ class ObTrx2PCPrepareResponse; class ObTransSplitInfo { OB_UNIS_VERSION(1); - public: +public: int init(const common::ObPartitionKey& src_pk, const common::ObIArray& dest_pks); bool is_valid() const { @@ -54,7 +54,7 @@ class ObTransSplitInfo { int assign(const ObTransSplitInfo& other); TO_STRING_KV(K_(src_pk), K_(dest_pks)); - private: +private: common::ObPartitionKey src_pk_; common::ObPartitionArray dest_pks_; }; @@ -62,7 +62,7 @@ class ObTransSplitInfo { typedef common::ObSEArray ObTransSplitInfoArray; class ObTransSplitAdapter { - public: +public: static int update_participant_list(ObCoordTransCtx* ctx, common::ObPartitionArray& ctx_participants, common::ObMaskSet& ctx_mask_set, const ObTransSplitInfoArray& split_info_arr, common::ObPartitionArray& new_participants); diff --git a/src/storage/transaction/ob_trans_stat.h b/src/storage/transaction/ob_trans_stat.h index 0c2fbb86f..867734e7e 100644 --- a/src/storage/transaction/ob_trans_stat.h +++ b/src/storage/transaction/ob_trans_stat.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace transaction { class ObTransStat { - public: +public: ObTransStat() : participants_(common::ObModIds::OB_TRANS_PARTITION_ARRAY, common::OB_MALLOC_NORMAL_BLOCK_SIZE) { reset(); @@ -155,7 +155,7 @@ class ObTransStat { K_(ctx_addr), K_(prev_trans_arr), K_(next_trans_arr), K_(prev_trans_commit_count), K_(ctx_id), K_(pending_log_size), K_(flushed_log_size)); - private: +private: bool is_inited_; common::ObAddr addr_; ObTransID trans_id_; @@ -190,7 +190,7 @@ class ObTransStat { }; class ObTransLockStat { - public: +public: ObTransLockStat() { reset(); @@ -241,7 +241,7 @@ class ObTransLockStat { TO_STRING_KV(K_(addr), K_(tenant_id), K_(partition), K_(memtable_key), K_(session_id), K_(proxy_session_id), K_(trans_id), K_(ctx_create_time), K_(expired_time)); - private: +private: bool is_inited_; common::ObAddr addr_; uint64_t tenant_id_; @@ -255,7 +255,7 @@ class ObTransLockStat { }; class ObTransResultInfoStat { - public: +public: ObTransResultInfoStat() { reset(); @@ -292,7 +292,7 @@ class ObTransResultInfoStat { TO_STRING_KV(K_(state), K_(commit_version), K_(min_log_id), K_(trans_id), K_(partition), K_(addr)); - private: +private: bool is_inited_; int state_; int64_t commit_version_; @@ -303,7 +303,7 @@ class ObTransResultInfoStat { }; class ObDuplicatePartitionStat { - public: +public: ObDuplicatePartitionStat() { reset(); @@ -341,7 +341,7 @@ class ObDuplicatePartitionStat { } TO_STRING_KV(K_(addr), K_(partition), K_(cur_log_id), K_(is_master), K_(lease_list)); - private: +private: common::ObAddr addr_; common::ObPartitionKey partition_; uint64_t cur_log_id_; diff --git a/src/storage/transaction/ob_trans_status.h b/src/storage/transaction/ob_trans_status.h index 6d18f865d..5b964d233 100644 --- a/src/storage/transaction/ob_trans_status.h +++ b/src/storage/transaction/ob_trans_status.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace transaction { class ObTransStatus { - public: +public: ObTransStatus() : trans_id_(), status_(common::OB_TRANS_UNKNOWN) {} ObTransStatus(const ObTransID& trans_id, const int status) : trans_id_(trans_id), status_(status) @@ -30,7 +30,7 @@ class ObTransStatus { ~ObTransStatus() {} - public: +public: const ObTransID& get_trans_id() const { return trans_id_; @@ -41,13 +41,13 @@ class ObTransStatus { } TO_STRING_KV(K_(trans_id), K_(status)); - private: +private: ObTransID trans_id_; int status_; }; class ObTransStatusMgr { - public: +public: ObTransStatusMgr() {} ~ObTransStatusMgr() @@ -55,11 +55,11 @@ class ObTransStatusMgr { int set_status(const ObTransID& trans_id, const ObTransStatus& status); int get_status(const ObTransID& trans_id, ObTransStatus& status); - private: +private: static const int64_t MAX_TRANS_STATUS = 1 * 1024 * 1024; static const int64_t MAX_LOCK = 64 * 1024; - private: +private: common::ObSpinLock lock_[MAX_LOCK]; ObTransStatus status_array_[MAX_TRANS_STATUS]; }; diff --git a/src/storage/transaction/ob_trans_submit_log_cb.h b/src/storage/transaction/ob_trans_submit_log_cb.h index c6179940e..c48924566 100644 --- a/src/storage/transaction/ob_trans_submit_log_cb.h +++ b/src/storage/transaction/ob_trans_submit_log_cb.h @@ -41,7 +41,7 @@ class ObPartTransCtx; namespace transaction { class ObITransSubmitLogCb : public clog::ObISubmitLogCb { - public: +public: virtual int on_submit_log_success( const bool with_need_update_version, const uint64_t cur_log_id, const int64_t cur_log_timestamp) = 0; virtual int on_submit_log_fail(const int retcode) = 0; @@ -55,7 +55,7 @@ class ObITransSubmitLogCb : public clog::ObISubmitLogCb { }; class ObTransSubmitLogCb : public ObITransSubmitLogCb { - public: +public: ObTransSubmitLogCb() { reset(); @@ -86,7 +86,7 @@ class ObTransSubmitLogCb : public ObITransSubmitLogCb { return ctx_; } - public: +public: int on_success(const common::ObPartitionKey& partition_key, const clog::ObLogType clog_log_type, const uint64_t log_id, const int64_t timestamp, const bool batch_committed, const bool batch_first_participant); int on_submit_log_success( @@ -97,16 +97,16 @@ class ObTransSubmitLogCb : public ObITransSubmitLogCb { return is_callbacking_; } - private: +private: int retry_redo_sync_task_(uint64_t log_id); - public: +public: TO_STRING_KV(KP_(ts), K_(partition), K_(trans_id), K_(log_type), K_(submit_timestamp), KP_(ctx), K_(have_prev_trans)); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransSubmitLogCb); - private: +private: bool is_inited_; ObTransService* ts_; common::ObPartitionKey partition_; diff --git a/src/storage/transaction/ob_trans_task_worker.h b/src/storage/transaction/ob_trans_task_worker.h index a9bd60bb4..a0126a8c8 100644 --- a/src/storage/transaction/ob_trans_task_worker.h +++ b/src/storage/transaction/ob_trans_task_worker.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace transaction { class BigTransCallbackTask : public ObTransTask { - public: +public: BigTransCallbackTask() { reset(); @@ -60,7 +60,7 @@ class BigTransCallbackTask : public ObTransTask { bool is_valid() const; TO_STRING_KV(KP(this), K_(partition), K_(log_type), K_(log_id), K_(log_timestamp)); - private: +private: common::ObPartitionKey partition_; int64_t log_type_; int64_t log_id_; @@ -69,7 +69,7 @@ class BigTransCallbackTask : public ObTransTask { }; class ObTransTaskWorker : public lib::TGTaskHandler { - public: +public: ObTransTaskWorker() : is_inited_(false), is_running_(false) {} ~ObTransTaskWorker() @@ -82,12 +82,12 @@ class ObTransTaskWorker : public lib::TGTaskHandler { void wait(); void destroy(); - public: +public: void handle(void* task); int submit_big_trans_callback_task(const common::ObPartitionKey& partition, const int64_t log_type, const uint64_t log_id, const int64_t submit_timestamp, ObTransCtx* ctx); - private: +private: bool is_inited_; bool is_running_; DISALLOW_COPY_AND_ASSIGN(ObTransTaskWorker); diff --git a/src/storage/transaction/ob_trans_timer.h b/src/storage/transaction/ob_trans_timer.h index 3beaf221e..387a35f39 100644 --- a/src/storage/transaction/ob_trans_timer.h +++ b/src/storage/transaction/ob_trans_timer.h @@ -36,7 +36,7 @@ class ObTransService; namespace transaction { class ObITimeoutTask : public common::ObTimeWheelTask { - public: +public: ObITimeoutTask() : is_registered_(false), is_running_(false), delay_(0) {} virtual ~ObITimeoutTask() @@ -49,7 +49,7 @@ class ObITimeoutTask : public common::ObTimeWheelTask { common::ObTimeWheelTask::reset(); } - public: +public: void set_registered(const bool is_registered) { is_registered_ = is_registered; @@ -71,14 +71,14 @@ class ObITimeoutTask : public common::ObTimeWheelTask { delay_ = delay; } - protected: +protected: bool is_registered_; bool is_running_; int64_t delay_; }; class ObITransTimer { - public: +public: ObITransTimer() {} virtual ~ObITransTimer() @@ -89,13 +89,13 @@ class ObITransTimer { virtual int wait() = 0; virtual void destroy() = 0; - public: +public: virtual int register_timeout_task(ObITimeoutTask& task, const int64_t delay) = 0; virtual int unregister_timeout_task(ObITimeoutTask& task) = 0; }; class ObTransTimeoutTask : public ObITimeoutTask { - public: +public: ObTransTimeoutTask() : is_inited_(false), ctx_(NULL) {} virtual ~ObTransTimeoutTask() @@ -104,21 +104,21 @@ class ObTransTimeoutTask : public ObITimeoutTask { void destroy(); void reset(); - public: +public: void runTimerTask(); uint64_t hash() const; - public: +public: TO_STRING_KV(K_(is_inited), K_(is_registered), K_(is_running), K_(delay), KP_(ctx), K_(bucket_idx), K_(run_ticket), K_(is_scheduled), KP_(prev), KP_(next)); - private: +private: bool is_inited_; ObTransCtx* ctx_; }; class ObPrepareChangingLeaderTask : public ObITimeoutTask { - public: +public: ObPrepareChangingLeaderTask() : is_inited_(false), expected_ts_(0), txs_(NULL), pkey_(), proposal_leader_(), round_(1), cnt_(0) {} @@ -143,13 +143,13 @@ class ObPrepareChangingLeaderTask : public ObITimeoutTask { reset(); } - public: +public: void runTimerTask(); uint64_t hash() const; int run(); TO_STRING_KV(K_(is_inited), K_(expected_ts), KP_(txs), K_(pkey), K_(proposal_leader), K_(round), K_(cnt)); - private: +private: bool is_inited_; int64_t expected_ts_; ObTransService* txs_; @@ -160,7 +160,7 @@ class ObPrepareChangingLeaderTask : public ObITimeoutTask { }; class ObTransTimer : public ObITransTimer { - public: +public: ObTransTimer() : is_inited_(false), is_running_(false) {} virtual ~ObTransTimer() @@ -171,14 +171,14 @@ class ObTransTimer : public ObITransTimer { virtual int wait(); virtual void destroy(); - public: +public: virtual int register_timeout_task(ObITimeoutTask& task, const int64_t delay); virtual int unregister_timeout_task(ObITimeoutTask& task); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransTimer); - protected: +protected: // schedule timeout task precision. us static const int64_t TRANS_TIMEOUT_TASK_PRECISION_US = 5000; static const int64_t THREAD_NUM = 4; @@ -189,14 +189,14 @@ class ObTransTimer : public ObITransTimer { }; class ObDupTableLeaseTimer : public ObTransTimer { - public: +public: ObDupTableLeaseTimer() {} virtual ~ObDupTableLeaseTimer() {} int init(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObDupTableLeaseTimer); }; diff --git a/src/storage/transaction/ob_trans_version_mgr.h b/src/storage/transaction/ob_trans_version_mgr.h index 4306f8907..8f9eaf288 100644 --- a/src/storage/transaction/ob_trans_version_mgr.h +++ b/src/storage/transaction/ob_trans_version_mgr.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace transaction { class ObITransVersionMgr { - public: +public: ObITransVersionMgr() {} virtual ~ObITransVersionMgr() @@ -32,7 +32,7 @@ class ObITransVersionMgr { virtual void destroy() = 0; virtual void reset() = 0; - public: +public: virtual int get_and_update_local_trans_version(int64_t& local_trans_version) = 0; virtual int get_local_trans_version(int64_t& local_trans_version) = 0; virtual int update_local_trans_version(const int64_t local_trans_version) = 0; @@ -41,7 +41,7 @@ class ObITransVersionMgr { }; class ObTransVersionMgr : public ObITransVersionMgr { - public: +public: ObTransVersionMgr() { reset(); @@ -53,24 +53,24 @@ class ObTransVersionMgr : public ObITransVersionMgr { void destroy(); void reset(); - public: +public: int get_and_update_local_trans_version(int64_t& local_trans_version); int get_local_trans_version(int64_t& local_trans_version); int update_local_trans_version(const int64_t local_trans_version); int get_publish_version(int64_t& publish_version); int update_publish_version(const int64_t publish_version); - public: +public: static ObTransVersionMgr& get_instance(); - private: +private: int update_local_trans_version_(const int64_t local_trans_version); int update_publish_version_(const int64_t publish_version); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTransVersionMgr); - private: +private: int64_t publish_version_; int64_t local_trans_version_; }; diff --git a/src/storage/transaction/ob_ts_mgr.h b/src/storage/transaction/ob_ts_mgr.h index 39001bceb..746bf802c 100644 --- a/src/storage/transaction/ob_ts_mgr.h +++ b/src/storage/transaction/ob_ts_mgr.h @@ -51,7 +51,7 @@ class ObITsSource; class ObGtsRequestRpc; class ObTsCbTask : public common::ObLink { - public: +public: ObTsCbTask() {} virtual ~ObTsCbTask() @@ -66,7 +66,7 @@ class ObTsCbTask : public common::ObLink { }; class ObITsMgr { - public: +public: virtual int update_gts(const uint64_t tenant_id, const int64_t gts, bool& update) = 0; virtual int update_local_trans_version(const uint64_t tenant_id, const int64_t version, bool& update) = 0; virtual int get_gts( @@ -87,13 +87,13 @@ class ObITsMgr { virtual int get_publish_version(const uint64_t tenant_id, int64_t& publish_version) = 0; virtual int get_gts_and_type(const uint64_t tenant_id, const MonotonicTs stc, int64_t& gts, int64_t& ts_type) = 0; - public: +public: VIRTUAL_TO_STRING_KV("", ""); }; class ObTsSourceInfo; class ObTsSourceGuard { - public: +public: ObTsSourceGuard() : ts_source_(NULL), ts_source_info_(NULL), ts_type_(0) {} ~ObTsSourceGuard(); @@ -124,14 +124,14 @@ class ObTsSourceGuard { return ts_type_; } - private: +private: ObITsSource* ts_source_; ObTsSourceInfo* ts_source_info_; int ts_type_; }; class ObQSyncLock { - public: +public: ObQSyncLock() : write_flag_(0) {} ~ObQSyncLock() @@ -141,7 +141,7 @@ class ObQSyncLock { void wrlock(); void wrunlock(); - private: +private: int64_t write_flag_; common::ObQSync qsync_; }; @@ -151,7 +151,7 @@ typedef common::LinkHashValue ObTsTenantInfoValue; class ObTsSourceInfo : public ObTsTenantInfoValue { friend class ObTsSourceGuard; - public: +public: ObTsSourceInfo(); ~ObTsSourceInfo() { @@ -160,7 +160,7 @@ class ObTsSourceInfo : public ObTsTenantInfoValue { int init(const uint64_t tenant_id); void destroy(); - public: +public: uint64_t get_tenant_id() const { return tenant_id_; @@ -190,15 +190,15 @@ class ObTsSourceInfo : public ObTsTenantInfoValue { int set_invalid(); int switch_ts_source(const uint64_t tenant_id, const int ts_type); - private: +private: int switch_ts_source_(const uint64_t tenant_id, const int ts_type); void revert_ts_source_(ObTsSourceGuard& guard); - private: +private: static const int64_t DEFAULT_CHECK_SWITCH_INTERVAL_US = 100 * 1000; static const int64_t MAX_CHECK_SWITCH_INTERVAL_US = 3 * 1000 * 1000; - private: +private: bool is_inited_; bool is_valid_; uint64_t tenant_id_; @@ -215,7 +215,7 @@ class ObTsSourceInfo : public ObTsTenantInfoValue { }; class ObTsSourceInfoAlloc { - public: +public: static ObTsSourceInfo* alloc_value() { return NULL; @@ -243,7 +243,7 @@ class ObTsSourceInfoAlloc { }; class ObGtsRefreshFunctor { - public: +public: ObGtsRefreshFunctor() {} ~ObGtsRefreshFunctor() @@ -283,7 +283,7 @@ class ObGtsRefreshFunctor { }; class GetObsoleteTenantFunctor { - public: +public: GetObsoleteTenantFunctor(const int64_t obsolete_time, common::ObIArray& array) : obsolete_time_(obsolete_time), array_(array) { @@ -311,14 +311,14 @@ class GetObsoleteTenantFunctor { return true; } - private: +private: const int64_t obsolete_time_; common::ObIArray& array_; }; class ObTsMgr; class ObTsSourceInfoGuard { - public: +public: ObTsSourceInfoGuard() : ts_source_info_(NULL), mgr_(NULL), need_revert_(true) {} ~ObTsSourceInfoGuard(); @@ -349,7 +349,7 @@ class ObTsSourceInfoGuard { return need_revert_; } - private: +private: ObTsSourceInfo* ts_source_info_; ObTsMgr* mgr_; bool need_revert_; @@ -359,7 +359,7 @@ typedef common::ObLinkHashMap { - public: + public: ClusterHeartbeatCB() : wrs_(NULL) {} virtual ~ClusterHeartbeatCB() {} - public: + public: void init(ObIWeakReadService* wrs) { wrs_ = wrs; @@ -74,14 +74,14 @@ class ObWrsRpc : public ObIWrsRpc { void on_timeout(); void on_invalid(); - private: + private: int do_process_(const obrpc::ObRpcResultCode& rcode); - private: + private: ObIWeakReadService* wrs_; }; - private: +private: bool inited_; obrpc::ObWrsRpcProxy proxy_; ClusterHeartbeatCB cluster_heartbeat_cb_; diff --git a/src/storage/transaction/ob_weak_read_service_rpc_define.h b/src/storage/transaction/ob_weak_read_service_rpc_define.h index 8a8d41cec..728b1311d 100644 --- a/src/storage/transaction/ob_weak_read_service_rpc_define.h +++ b/src/storage/transaction/ob_weak_read_service_rpc_define.h @@ -99,7 +99,7 @@ struct ObWrsClusterHeartbeatResponse { }; class ObWrsRpcProxy : public obrpc::ObRpcProxy { - public: +public: DEFINE_TO(ObWrsRpcProxy); // get CLUSTER level weak read version @@ -113,30 +113,30 @@ class ObWrsRpcProxy : public obrpc::ObRpcProxy { ///////////////////////////////// RPC process functions ///////////////////////////////////// class ObWrsGetClusterVersionP : public ObWrsRpcProxy::Processor { - public: +public: explicit ObWrsGetClusterVersionP(transaction::ObIWeakReadService* wrs) : wrs_(wrs) {} virtual ~ObWrsGetClusterVersionP() {} - protected: +protected: int process(); - private: +private: transaction::ObIWeakReadService* wrs_; }; class ObWrsClusterHeartbeatP : public ObWrsRpcProxy::Processor { - public: +public: explicit ObWrsClusterHeartbeatP(transaction::ObIWeakReadService* wrs) : wrs_(wrs) {} virtual ~ObWrsClusterHeartbeatP() {} - protected: +protected: int process(); - private: +private: transaction::ObIWeakReadService* wrs_; }; diff --git a/src/storage/transaction/ob_weak_read_util.h b/src/storage/transaction/ob_weak_read_util.h index 1156599a7..774168874 100644 --- a/src/storage/transaction/ob_weak_read_util.h +++ b/src/storage/transaction/ob_weak_read_util.h @@ -22,7 +22,7 @@ class ObWeakReadUtil { static const int64_t DEFAULT_MAX_STALE_BUFFER_TIME = 500 * 1000L; static const int64_t DEFAULT_REPLICA_KEEPALIVE_INTERVAL = 3000 * 1000L; - public: +public: static const int64_t IGNORE_TENANT_EXIST_WARN = 1; static int64_t replica_keepalive_interval(); static int64_t generate_min_weak_read_version(const uint64_t tenant_id); @@ -34,7 +34,7 @@ class ObWeakReadUtil { return DEFAULT_MAX_STALE_TIME_FOR_WEAK_CONSISTENCY; }; - private: +private: ObWeakReadUtil(){}; virtual ~ObWeakReadUtil(){}; }; diff --git a/src/storage/transaction/ob_xa_inner_table_gc_worker.h b/src/storage/transaction/ob_xa_inner_table_gc_worker.h index 8e2b37553..a5ed6b529 100644 --- a/src/storage/transaction/ob_xa_inner_table_gc_worker.h +++ b/src/storage/transaction/ob_xa_inner_table_gc_worker.h @@ -22,7 +22,7 @@ namespace transaction { class ObTransService; class ObXAInnerTableGCWorker : public share::ObThreadPool { - public: +public: ObXAInnerTableGCWorker() : is_inited_(false), is_running_(false), txs_(NULL) {} ~ObXAInnerTableGCWorker() @@ -35,10 +35,10 @@ class ObXAInnerTableGCWorker : public share::ObThreadPool { void wait(); void destroy(); - public: +public: virtual void run1() override; - private: +private: bool is_inited_; bool is_running_; ObTransService* txs_; diff --git a/src/storage/transaction/ob_xa_rpc.h b/src/storage/transaction/ob_xa_rpc.h index e1eb51044..40fa5b8bc 100644 --- a/src/storage/transaction/ob_xa_rpc.h +++ b/src/storage/transaction/ob_xa_rpc.h @@ -33,7 +33,7 @@ static const int64_t OB_XA_RPC_TIMEOUT = 5000000; class ObXAPrepareRPCRequest { OB_UNIS_VERSION(1); - public: +public: ObXAPrepareRPCRequest() {} ~ObXAPrepareRPCRequest() @@ -57,7 +57,7 @@ class ObXAPrepareRPCRequest { } TO_STRING_KV(K_(trans_id), K_(xid), K_(stmt_timeout)); - private: +private: transaction::ObTransID trans_id_; transaction::ObXATransID xid_; int64_t stmt_timeout_; @@ -66,7 +66,7 @@ class ObXAPrepareRPCRequest { class ObXAEndTransRPCRequest { OB_UNIS_VERSION(1); - public: +public: ObXAEndTransRPCRequest() {} ~ObXAEndTransRPCRequest() @@ -99,7 +99,7 @@ class ObXAEndTransRPCRequest { } TO_STRING_KV(K_(trans_id), K_(xid), K_(is_rollback), K_(is_terminated)); - private: +private: transaction::ObTransID trans_id_; transaction::ObXATransID xid_; bool is_rollback_; @@ -110,7 +110,7 @@ class ObXAEndTransRPCRequest { class ObXASyncStatusRPCRequest { OB_UNIS_VERSION(1); - public: +public: ObXASyncStatusRPCRequest() {} ~ObXASyncStatusRPCRequest() @@ -160,7 +160,7 @@ class ObXASyncStatusRPCRequest { TO_STRING_KV(K_(trans_id), K_(xid), K_(sender), K_(is_new_branch), K_(is_stmt_pull), K_(is_tightly_coupled), K_(pull_trans_desc), K_(timeout_seconds)); - private: +private: transaction::ObTransID trans_id_; transaction::ObXATransID xid_; common::ObAddr sender_; @@ -175,7 +175,7 @@ class ObXASyncStatusRPCRequest { class ObXASyncStatusRPCResponse { OB_UNIS_VERSION(1); - public: +public: ObXASyncStatusRPCResponse() {} ~ObXASyncStatusRPCResponse() @@ -195,7 +195,7 @@ class ObXASyncStatusRPCResponse { } TO_STRING_KV(K_(trans_desc), K_(is_stmt_pull)); - private: +private: transaction::ObTransDesc trans_desc_; bool is_stmt_pull_; }; @@ -203,7 +203,7 @@ class ObXASyncStatusRPCResponse { class ObXAMergeStatusRPCRequest { OB_UNIS_VERSION(1); - public: +public: ObXAMergeStatusRPCRequest() {} ~ObXAMergeStatusRPCRequest() @@ -236,7 +236,7 @@ class ObXAMergeStatusRPCRequest { } TO_STRING_KV(K_(trans_desc), K_(is_stmt_push), K_(is_tightly_coupled), K_(xid), K_(seq_no)); - private: +private: transaction::ObTransDesc trans_desc_; bool is_stmt_push_; bool is_tightly_coupled_; @@ -247,7 +247,7 @@ class ObXAMergeStatusRPCRequest { class ObXAHbRequest { OB_UNIS_VERSION(1); - public: +public: ObXAHbRequest() {} ~ObXAHbRequest() @@ -271,7 +271,7 @@ class ObXAHbRequest { } TO_STRING_KV(K_(trans_id), K_(xid), K_(sender)); - private: +private: transaction::ObTransID trans_id_; transaction::ObXATransID xid_; common::ObAddr sender_; @@ -296,7 +296,7 @@ private: };*/ class ObXARpcProxy : public ObRpcProxy { - public: +public: DEFINE_TO(ObXARpcProxy); RPC_AP(PR1 xa_prepare, OB_XA_PREPARE, (ObXAPrepareRPCRequest), Int64); RPC_AP(PR1 xa_end_trans, OB_XA_END_TRANS, (ObXAEndTransRPCRequest), Int64); @@ -308,113 +308,113 @@ class ObXARpcProxy : public ObRpcProxy { }; class ObXAPrepareP : public ObRpcProcessor> { - public: +public: explicit ObXAPrepareP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXAPrepareP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObXAEndTransP : public ObRpcProcessor> { - public: +public: explicit ObXAEndTransP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXAEndTransP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObXASyncStatusP : public ObRpcProcessor> { - public: +public: explicit ObXASyncStatusP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXASyncStatusP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObXASyncStatusResponseP : public ObRpcProcessor> { - public: +public: explicit ObXASyncStatusResponseP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXASyncStatusResponseP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObXAMergeStatusP : public ObRpcProcessor> { - public: +public: explicit ObXAMergeStatusP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXAMergeStatusP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObXAHbReqP : public ObRpcProcessor> { - public: +public: explicit ObXAHbReqP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXAHbReqP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; class ObXAHbRespP : public ObRpcProcessor> { - public: +public: explicit ObXAHbRespP(const observer::ObGlobalContext& global_ctx) : global_ctx_(global_ctx) {} - protected: +protected: int process(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObXAHbRespP); - private: +private: const observer::ObGlobalContext& global_ctx_; }; template class ObXARPCCB : public ObXARpcProxy::AsyncCB { - public: +public: ObXARPCCB() : is_inited_(false), cond_(NULL) {} ~ObXARPCCB() @@ -482,7 +482,7 @@ class ObXARPCCB : public ObXARpcProxy::AsyncCB { } } - private: +private: bool is_inited_; transaction::ObTransCond* cond_; }; @@ -494,7 +494,7 @@ using namespace obrpc; namespace transaction { class ObIXARpc { - public: +public: ObIXARpc() {} virtual ~ObIXARpc() @@ -504,7 +504,7 @@ class ObIXARpc { virtual int wait() = 0; virtual void destroy() = 0; - public: +public: virtual int xa_prepare(const uint64_t tenant_id, const common::ObAddr& server, const ObXAPrepareRPCRequest& req, ObXARPCCB& cb) = 0; virtual int xa_end_trans(const uint64_t tenant_id, const common::ObAddr& server, const ObXAEndTransRPCRequest& req, @@ -522,7 +522,7 @@ class ObIXARpc { }; class ObXARpc : public ObIXARpc { - public: +public: ObXARpc() : is_inited_(false), is_running_(false), rpc_proxy_(NULL) {} ~ObXARpc() @@ -535,7 +535,7 @@ class ObXARpc : public ObIXARpc { int wait(); void destroy(); - public: +public: int xa_prepare(const uint64_t tenant_id, const common::ObAddr& server, const ObXAPrepareRPCRequest& req, ObXARPCCB& cb); int xa_end_trans(const uint64_t tenant_id, const common::ObAddr& server, const ObXAEndTransRPCRequest& req, @@ -551,7 +551,7 @@ class ObXARpc : public ObIXARpc { int xa_hb_resp( const uint64_t tenant_id, const common::ObAddr& server, const ObXAHbResponse& resp, ObXARPCCB* cb); - private: +private: bool is_inited_; bool is_running_; ObXARpcProxy* rpc_proxy_; diff --git a/src/storage/transaction/ob_xa_trans_heartbeat_worker.h b/src/storage/transaction/ob_xa_trans_heartbeat_worker.h index 2e8ef4209..f36b1ea1e 100644 --- a/src/storage/transaction/ob_xa_trans_heartbeat_worker.h +++ b/src/storage/transaction/ob_xa_trans_heartbeat_worker.h @@ -21,7 +21,7 @@ namespace transaction { class ObTransService; class ObXATransHeartbeatWorker : public share::ObThreadPool { - public: +public: ObXATransHeartbeatWorker() : is_inited_(false), is_running_(false) {} ~ObXATransHeartbeatWorker() @@ -34,10 +34,10 @@ class ObXATransHeartbeatWorker : public share::ObThreadPool { void wait(); void destroy(); - public: +public: virtual void run1() override; - private: +private: bool is_inited_; bool is_running_; ObTransService* trans_service_; diff --git a/unittest/archive/test_archive_task.cpp b/unittest/archive/test_archive_task.cpp index cfcb9a46a..37c0ab2c4 100644 --- a/unittest/archive/test_archive_task.cpp +++ b/unittest/archive/test_archive_task.cpp @@ -24,7 +24,7 @@ namespace unittest { typedef common::ObLinkHashMap PGArchiveMap; class Works { - public: +public: Works() : flag_(false), map_(), queue_() {} ~Works() @@ -32,7 +32,7 @@ class Works { flag_ = false; } - public: +public: bool flag_; PGArchiveMap map_; ObSpLinkQueue queue_; diff --git a/unittest/clog/clog_mock_container/mock_election_mgr.h b/unittest/clog/clog_mock_container/mock_election_mgr.h index 9873f5992..f37cb3253 100644 --- a/unittest/clog/clog_mock_container/mock_election_mgr.h +++ b/unittest/clog/clog_mock_container/mock_election_mgr.h @@ -46,7 +46,7 @@ class ObIElectionCallback; namespace election { class MockObElectionMgr : public ObElectionMgr { - public: +public: MockObElectionMgr() {} ~MockObElectionMgr() @@ -93,7 +93,7 @@ class MockObElectionMgr : public ObElectionMgr { return OB_SUCCESS; } - public: +public: int add_partition( const common::ObPartitionKey& partition_key, const int64_t replica_num, ObIElectionCallback* election_cb) { @@ -119,7 +119,7 @@ class MockObElectionMgr : public ObElectionMgr { return OB_SUCCESS; } - public: +public: int handle_election_msg(const ObElectionMsgBuffer& msgbuf, obrpc::ObElectionRpcResult& result) { UNUSED(msgbuf); @@ -127,7 +127,7 @@ class MockObElectionMgr : public ObElectionMgr { return OB_SUCCESS; } - public: +public: int set_candidate(const common::ObPartitionKey& partition_key, const common::ObMemberList& prev_mlist, const common::ObMemberList& curr_mlist) { @@ -164,7 +164,7 @@ class MockObElectionMgr : public ObElectionMgr { return OB_SUCCESS; } - private: +private: ObIElection* get_election_(const common::ObPartitionKey& partition_key) const { UNUSED(partition_key); diff --git a/unittest/clog/clog_mock_container/mock_log_engine.h b/unittest/clog/clog_mock_container/mock_log_engine.h index 8ba9de9f6..28059e253 100644 --- a/unittest/clog/clog_mock_container/mock_log_engine.h +++ b/unittest/clog/clog_mock_container/mock_log_engine.h @@ -27,10 +27,10 @@ class ObILogNetTask; class ObConfirmedInfo; class ObLogTask; class MockObLogEngine : public ObILogEngine { - public: +public: typedef ObDiskBufferTask FlushTask; - public: +public: MockObLogEngine() {} ~MockObLogEngine() @@ -554,7 +554,7 @@ class MockObLogEngine : public ObILogEngine { return ret; } - private: +private: ObIndexInfoBlockHandler fake_handler_; ObLogDir si_dir_; ObLogDir ui_dir_; diff --git a/unittest/clog/clog_mock_container/mock_log_membership_mgr.h b/unittest/clog/clog_mock_container/mock_log_membership_mgr.h index 1bb7038bb..2fef5e2d2 100644 --- a/unittest/clog/clog_mock_container/mock_log_membership_mgr.h +++ b/unittest/clog/clog_mock_container/mock_log_membership_mgr.h @@ -32,13 +32,13 @@ class ObLogEntry; class ObLogEntryHeader; class MockObLogMembershipMgr : public ObILogMembershipMgr, public ObISubmitLogCb { - public: +public: MockObLogMembershipMgr() {} virtual ~MockObLogMembershipMgr() {} - public: +public: int init(const common::ObMemberList& member_list, const int64_t membership_timestamp, const uint64_t membership_log_id, const int64_t replica_num, const common::ObAddr& self, const common::ObPartitionKey& partition_key, ObILogSWForMS* sw, ObILogStateMgrForMS* state_mgr, @@ -287,7 +287,7 @@ class MockObLogMembershipMgr : public ObILogMembershipMgr, public ObISubmitLogCb return OB_SUCCESS; } - private: +private: common::ObMemberList member_list_; common::ObProposalID ms_proposal_id_; }; diff --git a/unittest/clog/clog_mock_container/mock_log_reconfirm.h b/unittest/clog/clog_mock_container/mock_log_reconfirm.h index 2c54281d4..4391e20dd 100644 --- a/unittest/clog/clog_mock_container/mock_log_reconfirm.h +++ b/unittest/clog/clog_mock_container/mock_log_reconfirm.h @@ -28,7 +28,7 @@ namespace clog { class ObILogMembershipMgr; class MockObLogReconfirm : public ObLogReconfirm { - public: +public: MockObLogReconfirm() {} virtual ~MockObLogReconfirm() @@ -83,7 +83,7 @@ class MockObLogReconfirm : public ObLogReconfirm { static const int64_t SUBMITED_TAG_BIT = 29; static const int64_t LOG_EXIST_TAG_BIT = 28; - private: +private: int init_reconfirm_() { return OB_SUCCESS; diff --git a/unittest/clog/clog_mock_container/mock_log_replay_engine.h b/unittest/clog/clog_mock_container/mock_log_replay_engine.h index e58cdb83b..b02f33263 100644 --- a/unittest/clog/clog_mock_container/mock_log_replay_engine.h +++ b/unittest/clog/clog_mock_container/mock_log_replay_engine.h @@ -19,20 +19,20 @@ namespace oceanbase { namespace clog { class MockObLogReplayEngineWrapper : public ObLogReplayEngineWrapper { - public: +public: MockObLogReplayEngineWrapper() {} virtual ~MockObLogReplayEngineWrapper() {} - public: +public: int init(replayengine::ObILogReplayEngine* log_replay_engine) { UNUSED(log_replay_engine); return OB_SUCCESS; } - public: +public: int submit_replay_task(const common::ObPartitionKey& partition_key, const ObLogEntry& log_entry) { UNUSED(partition_key); diff --git a/unittest/clog/clog_mock_container/mock_log_sliding_window.h b/unittest/clog/clog_mock_container/mock_log_sliding_window.h index c40e91f03..985adba5b 100644 --- a/unittest/clog/clog_mock_container/mock_log_sliding_window.h +++ b/unittest/clog/clog_mock_container/mock_log_sliding_window.h @@ -31,7 +31,7 @@ class ObIOutOfBandLogHandler; class ObILogStateMgrForSW; class MockObSlidingCallBack : public ObILogTaskCallBack { - public: +public: MockObSlidingCallBack() {} virtual ~MockObSlidingCallBack() diff --git a/unittest/clog/clog_mock_container/mock_log_state_mgr.h b/unittest/clog/clog_mock_container/mock_log_state_mgr.h index ccd916d67..6bd887fcf 100644 --- a/unittest/clog/clog_mock_container/mock_log_state_mgr.h +++ b/unittest/clog/clog_mock_container/mock_log_state_mgr.h @@ -32,7 +32,7 @@ class ObILogCallbackEngine; class ObILogAllocator; class MockObLogStateMgr : public ObLogStateMgr { - public: +public: MockObLogStateMgr() {} ~MockObLogStateMgr() @@ -40,7 +40,7 @@ class MockObLogStateMgr : public ObLogStateMgr { destroy(); } - public: +public: int init(ObILogSWForStateMgr* sw, ObILogReconfirm* reconfirm, ObILogEngine* log_engine, ObILogMembershipMgr* mm, election::ObIElectionMgr* election_mgr, ObILogReplayEngineWrapper* replay_engine, share::ObIPSCb* ps_cb, ObILogAllocator* alloc_mgr, const common::ObAddr& self, const common::ObProposalID& proposal_id, diff --git a/unittest/clog/clog_mock_container/mock_ps_cb.h b/unittest/clog/clog_mock_container/mock_ps_cb.h index 38acdfd75..56648add3 100644 --- a/unittest/clog/clog_mock_container/mock_ps_cb.h +++ b/unittest/clog/clog_mock_container/mock_ps_cb.h @@ -20,13 +20,13 @@ namespace oceanbase { namespace common { class MockObPSCb : public share::ObIPSCb { - public: +public: MockObPSCb() {} virtual ~MockObPSCb() {} - public: +public: int64_t get_min_using_file_id() const { return 0; diff --git a/unittest/clog/clog_mock_container/mock_submit_log_cb.h b/unittest/clog/clog_mock_container/mock_submit_log_cb.h index 9a8b2de8f..04ee38861 100644 --- a/unittest/clog/clog_mock_container/mock_submit_log_cb.h +++ b/unittest/clog/clog_mock_container/mock_submit_log_cb.h @@ -17,13 +17,13 @@ namespace oceanbase { namespace clog { class MockObSubmitLogCb : public ObISubmitLogCb { - public: +public: MockObSubmitLogCb() {} virtual ~MockObSubmitLogCb() {} - public: +public: int on_success(const common::ObPartitionKey& partition_key, const clog::ObLogType log_type, const uint64_t log_id, const int64_t version, const bool batch_committed, const bool batch_last_succeed) { diff --git a/unittest/clog/mock_log_engine.h b/unittest/clog/mock_log_engine.h index d0c9b0e7d..803fd7a51 100644 --- a/unittest/clog/mock_log_engine.h +++ b/unittest/clog/mock_log_engine.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace clog { class MockLogEngine : public MockObLogEngine { - public: +public: MockLogEngine() {} virtual ~MockLogEngine() @@ -258,7 +258,7 @@ class MockLogEngine : public MockObLogEngine { return 0; } - private: +private: ObIndexInfoBlockHandler fake_handler_; }; } // namespace clog diff --git a/unittest/clog/mock_log_reader.h b/unittest/clog/mock_log_reader.h index 44a8faf6b..95e5e860a 100644 --- a/unittest/clog/mock_log_reader.h +++ b/unittest/clog/mock_log_reader.h @@ -21,7 +21,7 @@ namespace oceanbase { using namespace clog; namespace clog { class MockFilePool : public IFilePool { - public: +public: virtual int get_fid_range(int64_t& min_fid, int64_t& max_fid) { UNUSED(min_fid); @@ -37,7 +37,7 @@ class MockFilePool : public IFilePool { }; class MockLogDirectReader : public ObILogDirectReader { - public: +public: virtual int init(IFilePool* reader_pool) { UNUSED(reader_pool); @@ -70,7 +70,7 @@ class MockLogDirectReader : public ObILogDirectReader { }; class MockRawLogIterator : public ObIRawLogIterator { - public: +public: int init() { num_ = 0; @@ -175,7 +175,7 @@ class MockRawLogIterator : public ObIRawLogIterator { return common::OB_SUCCESS; } - private: +private: int num_; ObLogEntry log_entry1; ObLogEntry log_entry2; diff --git a/unittest/clog/mock_ob_partition_log_service.h b/unittest/clog/mock_ob_partition_log_service.h index f9e95710d..b0ecb7fbc 100644 --- a/unittest/clog/mock_ob_partition_log_service.h +++ b/unittest/clog/mock_ob_partition_log_service.h @@ -25,7 +25,7 @@ class ObILogAllocator; } namespace clog { class MockPartitionLogService : public ObIPartitionLogService { - public: +public: virtual int init(ObILogEngine* log_engine, ObLogReplayEngineWrapper* replay_engine, ObIFetchLogEngine* fetch_log_engine, election::ObIElectionMgr* election_mgr, storage::ObPartitionService* partition_mgr, ObILogCallbackEngine* cb_engine, common::ObILogAllocator* alloc_mgr, @@ -1502,7 +1502,7 @@ class MockPartitionLogService : public ObIPartitionLogService { return OB_SUCCESS; } - private: +private: common::ObPartitionKey p_k_; }; diff --git a/unittest/clog/mock_ob_root_server.h b/unittest/clog/mock_ob_root_server.h index 8d1a993df..3662b9d46 100644 --- a/unittest/clog/mock_ob_root_server.h +++ b/unittest/clog/mock_ob_root_server.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace clog { class MockObRootServer : public ObIMembershipCallback { - public: +public: struct MockRootTableNode { int64_t mc_timestamp_; common::ObMemberList pre_member_list_; @@ -61,7 +61,7 @@ class MockObRootServer : public ObIMembershipCallback { } }; - public: +public: MockObRootServer(); ~MockObRootServer(); int init(); @@ -73,7 +73,7 @@ class MockObRootServer : public ObIMembershipCallback { int on_member_change_success(const common::ObPartitionKey& partition_key, const int64_t mc_timestamp, const common::ObMemberList& prev_member_list, const common::ObMemberList& curr_member_list); - private: +private: static const int64_t BUCKET_NUM = 1000; static const int32_t MOD_ID = 789789; diff --git a/unittest/clog/mock_partition_service.h b/unittest/clog/mock_partition_service.h index f150a8ba8..d980ab93c 100644 --- a/unittest/clog/mock_partition_service.h +++ b/unittest/clog/mock_partition_service.h @@ -20,11 +20,11 @@ namespace oceanbase { using namespace clog; namespace storage { class MockObPartition : public storage::MockObIPartition { - public: +public: MockObPartition() : valid_(false) {} - public: +public: int init(int32_t seed) { partition_key_.init(seed, seed, 1024); @@ -53,18 +53,18 @@ class MockObPartition : public storage::MockObIPartition { return 0; } - private: +private: clog::MockPartitionLogService mock_pls_; common::ObPartitionKey partition_key_; bool valid_; }; class MockObPartitionService : public storage::MockObIPartitionService { - public: +public: MockObPartitionService() : list_(NULL) {} - public: +public: struct MockPartitionNode { MockObPartition partition_; MockPartitionNode* next_; @@ -77,7 +77,7 @@ class MockObPartitionService : public storage::MockObIPartitionService { } }; class MockObPartitionIter : public storage::ObIPartitionIterator { - public: + public: MockObPartitionIter() : mgr_(NULL), curr_node_(NULL) {} MockObPartitionIter(ObPartitionService* mgr) @@ -106,12 +106,12 @@ class MockObPartitionService : public storage::MockObIPartitionService { return ret; } - private: + private: MockObPartitionService* mgr_; MockPartitionNode* curr_node_; }; - public: +public: int create_partition(int32_t seed) // int create_partition(common::ObMemberList &list, const ObPartitionKey &key, const int64_t replica_num) { @@ -174,7 +174,7 @@ class MockObPartitionService : public storage::MockObIPartitionService { return ret; } - private: +private: MockPartitionNode* list_; DISALLOW_COPY_AND_ASSIGN(MockObPartitionService); diff --git a/unittest/clog/test_accessor.h b/unittest/clog/test_accessor.h index b29f20517..6c75bd6ae 100644 --- a/unittest/clog/test_accessor.h +++ b/unittest/clog/test_accessor.h @@ -19,7 +19,7 @@ using namespace clog; namespace unittest { class ObLogReconfirmAccessor { - public: +public: void set_assert_on(ObLogReconfirm& reconfirm, bool assert) { reconfirm.set_assert_on_ = assert; diff --git a/unittest/clog/test_base.h b/unittest/clog/test_base.h index aa3821c06..36b718bfd 100644 --- a/unittest/clog/test_base.h +++ b/unittest/clog/test_base.h @@ -47,7 +47,7 @@ struct Callable { typedef void* (*pthread_handler_t)(void*); class BaseWorker { - public: +public: static const int64_t MAX_N_THREAD = 16; struct WorkContext { WorkContext() : callable_(NULL), idx_(0) @@ -65,7 +65,7 @@ class BaseWorker { int64_t idx_; }; - public: +public: BaseWorker() : n_thread_(0), thread_running_(false) {} ~BaseWorker() @@ -73,7 +73,7 @@ class BaseWorker { wait(); } - public: +public: BaseWorker& set_thread_num(int64_t n) { n_thread_ = n; @@ -137,7 +137,7 @@ class BaseWorker { return err; } - protected: +protected: int64_t n_thread_; bool thread_running_; WorkContext ctx_[MAX_N_THREAD]; @@ -201,13 +201,13 @@ class RWT : public Callable { int64_t idx_; }; - public: +public: RWT() : n_read_thread_(0), n_write_thread_(0), n_admin_thread_(0) {} virtual ~RWT() {} - public: +public: int64_t get_thread_num() { return 1 + n_read_thread_ + n_write_thread_ + n_admin_thread_; @@ -283,7 +283,7 @@ class RWT : public Callable { return 0; } - protected: +protected: int64_t n_read_thread_; int64_t n_write_thread_; int64_t n_admin_thread_; @@ -342,13 +342,13 @@ struct BaseConfig { }; class FixedAllocator : public ObIAllocator { - public: +public: FixedAllocator(char* buf, int64_t limit) : buf_(buf), limit_(limit), pos_(0) {} virtual ~FixedAllocator() {} - public: +public: void reset() { pos_ = 0; @@ -369,7 +369,7 @@ class FixedAllocator : public ObIAllocator { UNUSED(ptr); } - private: +private: char* buf_; int64_t limit_; int64_t pos_; diff --git a/unittest/clog/test_clog_writer.cpp b/unittest/clog/test_clog_writer.cpp index 77ada0676..e560457ba 100644 --- a/unittest/clog/test_clog_writer.cpp +++ b/unittest/clog/test_clog_writer.cpp @@ -38,7 +38,7 @@ using namespace oceanbase::lib; namespace oceanbase { namespace unittest { class MyMetaInfoGenerator : public ObIInfoBlockHandler { - public: +public: MyMetaInfoGenerator() {} virtual ~MyMetaInfoGenerator() @@ -78,7 +78,7 @@ int64_t MyMetaInfoGenerator::get_entry_cnt() const } class MyCLogItem : public ObICLogItem { - public: +public: MyCLogItem() : buf_(NULL), data_len_(0), is_flushed_(false), file_id_(0), offset_(0), err_code_(0) { cond_.init(1); @@ -138,13 +138,13 @@ void MyCLogItem::wait() } class TestCLogWriter : public ::testing::Test { - public: +public: TestCLogWriter(); virtual ~TestCLogWriter(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: char log_path_[1024]; char shm_path_[1024]; char* log_buf_; diff --git a/unittest/clog/test_info_block_handler.cpp b/unittest/clog/test_info_block_handler.cpp index 56057e56e..add262eb7 100644 --- a/unittest/clog/test_info_block_handler.cpp +++ b/unittest/clog/test_info_block_handler.cpp @@ -21,7 +21,7 @@ using namespace common; using namespace clog; namespace unittest { class ObInfoBlockHandlerTest : public testing::Test { - public: +public: static void SetUpTestCase() { EXPECT_EQ(OB_SUCCESS, commit_handler_.init()); diff --git a/unittest/clog/test_log_checksum_V2.cpp b/unittest/clog/test_log_checksum_V2.cpp index 3ba8c4bff..0e446ec6f 100644 --- a/unittest/clog/test_log_checksum_V2.cpp +++ b/unittest/clog/test_log_checksum_V2.cpp @@ -21,7 +21,7 @@ class ObLogChecksum; } namespace unittest { class TestObLogChecksum : public ::testing::Test { - protected: +protected: void SetUp() { const uint64_t TABLE_ID = 520; @@ -32,7 +32,7 @@ class TestObLogChecksum : public ::testing::Test { void TearDown() {} - protected: +protected: common::ObPartitionKey partition_key_; clog::ObLogChecksum check_sum_; }; diff --git a/unittest/clog/test_log_ext_ring_buffer.cpp b/unittest/clog/test_log_ext_ring_buffer.cpp index f8c181387..930be6513 100644 --- a/unittest/clog/test_log_ext_ring_buffer.cpp +++ b/unittest/clog/test_log_ext_ring_buffer.cpp @@ -25,12 +25,12 @@ namespace oceanbase { namespace unittest { class Runnable { - public: +public: virtual ~Runnable() {} virtual void routine() = 0; - public: +public: void run() { pthread_create(&thread_, NULL, pthread_routine_, this); @@ -40,7 +40,7 @@ class Runnable { pthread_join(thread_, NULL); } - private: +private: static void* pthread_routine_(void* arg) { Runnable* runnable = static_cast(arg); @@ -51,7 +51,7 @@ class Runnable { }; class Data : public clog::ObILogExtRingBufferData { - public: +public: virtual ~Data() {} virtual void destroy() @@ -75,7 +75,7 @@ class Data : public clog::ObILogExtRingBufferData { }; class SetRunnable : public Runnable { - public: +public: virtual void routine() { for (int64_t idx = 0; idx < cnt_; ++idx) { @@ -89,7 +89,7 @@ class SetRunnable : public Runnable { int64_t cnt_; }; class PopRunnable : public Runnable { - public: +public: virtual void routine() { // int64_t begin_sn = -1; diff --git a/unittest/clog/test_log_task.cpp b/unittest/clog/test_log_task.cpp index 025885851..846bc5fbc 100644 --- a/unittest/clog/test_log_task.cpp +++ b/unittest/clog/test_log_task.cpp @@ -23,7 +23,7 @@ namespace oceanbase { using namespace common; namespace clog { class MockSlidingCallBack : public MockObSlidingCallBack { - public: +public: MockSlidingCallBack() : err_no_(OB_SUCCESS) {} virtual ~MockSlidingCallBack() @@ -38,19 +38,19 @@ class MockSlidingCallBack : public MockObSlidingCallBack { err_no_ = err_no; } - private: +private: int err_no_; }; } // namespace clog namespace unittest { class ObLogTaskTest : public ::testing::Test { - protected: +protected: ObLogTaskTest() : log_task_(NULL), alloc_mgr_(NULL) {} virtual ~ObLogTaskTest() {} - protected: +protected: virtual void SetUp() { const uint64_t TABLE_ID = 15; @@ -83,7 +83,7 @@ class ObLogTaskTest : public ::testing::Test { alloc_mgr_ = NULL; } - protected: +protected: clog::ObLogTask* log_task_; clog::MockSlidingCallBack mock_sliding_cb_; common::ObTenantMutilAllocator* alloc_mgr_; diff --git a/unittest/clog/test_ob_index_entry.cpp b/unittest/clog/test_ob_index_entry.cpp index cf6be8358..50a9044ea 100644 --- a/unittest/clog/test_ob_index_entry.cpp +++ b/unittest/clog/test_ob_index_entry.cpp @@ -18,7 +18,7 @@ namespace oceanbase { using namespace clog; namespace unittest { class TestObIndexEntry : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} @@ -28,7 +28,7 @@ class TestObIndexEntry : public ::testing::Test { return index_; } - private: +private: ObIndexEntry index_; ObPartitionKey partition_key_; diff --git a/unittest/clog/test_ob_log_block.cpp b/unittest/clog/test_ob_log_block.cpp index 2e81997dd..bc9ab048a 100644 --- a/unittest/clog/test_ob_log_block.cpp +++ b/unittest/clog/test_ob_log_block.cpp @@ -20,7 +20,7 @@ using namespace oceanbase::clog; namespace oceanbase { namespace unittest { class TestObLogBlock : public ::testing::Test { - public: +public: virtual void SetUp() { type = OB_DATA_BLOCK; diff --git a/unittest/clog/test_ob_log_block_meta_v2.cpp b/unittest/clog/test_ob_log_block_meta_v2.cpp index ecd927657..0710d3623 100644 --- a/unittest/clog/test_ob_log_block_meta_v2.cpp +++ b/unittest/clog/test_ob_log_block_meta_v2.cpp @@ -20,7 +20,7 @@ using namespace oceanbase::clog; namespace oceanbase { namespace unittest { class TestObLogBlockMetaV2 : public ::testing::Test { - public: +public: TestObLogBlockMetaV2() {} ~TestObLogBlockMetaV2() diff --git a/unittest/clog/test_ob_log_broadcast_info_mgr.cpp b/unittest/clog/test_ob_log_broadcast_info_mgr.cpp index f6a2d32f4..69fe4b100 100644 --- a/unittest/clog/test_ob_log_broadcast_info_mgr.cpp +++ b/unittest/clog/test_ob_log_broadcast_info_mgr.cpp @@ -19,7 +19,7 @@ using namespace common; using namespace clog; namespace unittest { class TestMockObLogMembershipMgr : public MockObLogMembershipMgr { - public: +public: void set_replica_num(const int64_t replica_num) { replica_num_ = replica_num; @@ -37,13 +37,13 @@ class TestMockObLogMembershipMgr : public MockObLogMembershipMgr { return member_list_; } - private: +private: int64_t replica_num_; common::ObMemberList member_list_; }; class ObLogBroadcastInfoMgrTest : public testing::Test { - public: +public: void SetUp(); void TearDown(); diff --git a/unittest/clog/test_ob_log_direct_reader.cpp b/unittest/clog/test_ob_log_direct_reader.cpp index f2c47893c..8ba4d1dff 100644 --- a/unittest/clog/test_ob_log_direct_reader.cpp +++ b/unittest/clog/test_ob_log_direct_reader.cpp @@ -26,13 +26,13 @@ using namespace clog; namespace unittest { class TestObLogDirectReader : public ::testing::Test { - public: +public: TestObLogDirectReader(); virtual ~TestObLogDirectReader(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: int fd_; char log_path_[1024]; char shm_path_[1024]; diff --git a/unittest/clog/test_ob_log_entry.cpp b/unittest/clog/test_ob_log_entry.cpp index 060cdb06e..be3a2e4d3 100644 --- a/unittest/clog/test_ob_log_entry.cpp +++ b/unittest/clog/test_ob_log_entry.cpp @@ -22,7 +22,7 @@ namespace oceanbase { using namespace clog; namespace unittest { class TestObLogEntry : public ::testing::Test { - public: +public: virtual void SetUp() { ltype = OB_LOG_SUBMIT; // Test log type in normal case @@ -44,7 +44,7 @@ class TestObLogEntry : public ::testing::Test { virtual void TearDown() {} - public: +public: static const int64_t BUFSIZE = 1 << 9; // 256B ObLogEntryHeader header; clog::ObLogEntry entry; diff --git a/unittest/clog/test_ob_log_entry_header.cpp b/unittest/clog/test_ob_log_entry_header.cpp index d9ffa478f..1ea4653e9 100644 --- a/unittest/clog/test_ob_log_entry_header.cpp +++ b/unittest/clog/test_ob_log_entry_header.cpp @@ -19,7 +19,7 @@ namespace oceanbase { using namespace clog; namespace unittest { class TestObLogEntryHeader : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/clog/test_ob_log_file_pool.cpp b/unittest/clog/test_ob_log_file_pool.cpp index d358b9982..abb624809 100644 --- a/unittest/clog/test_ob_log_file_pool.cpp +++ b/unittest/clog/test_ob_log_file_pool.cpp @@ -28,7 +28,7 @@ extern int64_t get_free_quota(const char* path, const int64_t percent, int64_t& namespace unittest { class ObFormatter { - public: +public: ObFormatter(char* buf, int64_t len) : buf_(buf), len_(len), pos_(0) {} ~ObFormatter() @@ -52,7 +52,7 @@ class ObFormatter { return src; } - private: +private: char* buf_; int64_t len_; int64_t pos_; @@ -63,7 +63,7 @@ class ObFormatter { #define MAX_FILE_ID 10 class TestObLogFilePool : public ::testing::Test { - public: +public: virtual void SetUp() { char buf[BUFSIZE]; @@ -89,11 +89,11 @@ class TestObLogFilePool : public ::testing::Test { return ret; } - protected: +protected: }; class MyFunc { - public: +public: MyFunc() {} ~MyFunc() diff --git a/unittest/clog/test_ob_log_file_trailer.cpp b/unittest/clog/test_ob_log_file_trailer.cpp index 1d8b4f78a..96129d5de 100644 --- a/unittest/clog/test_ob_log_file_trailer.cpp +++ b/unittest/clog/test_ob_log_file_trailer.cpp @@ -21,7 +21,7 @@ namespace oceanbase { namespace unittest { class TestObLogFileTrailer : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/clog/test_ob_raw_entry_iterator.cpp b/unittest/clog/test_ob_raw_entry_iterator.cpp index 97c305fd5..0282d6c9a 100644 --- a/unittest/clog/test_ob_raw_entry_iterator.cpp +++ b/unittest/clog/test_ob_raw_entry_iterator.cpp @@ -27,7 +27,7 @@ namespace oceanbase { using namespace clog; namespace unittest { class TestObRawLogIterator : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown(); void prepare_entry(); diff --git a/unittest/clog/test_seg_array.cpp b/unittest/clog/test_seg_array.cpp index fceb52330..cd00ce385 100644 --- a/unittest/clog/test_seg_array.cpp +++ b/unittest/clog/test_seg_array.cpp @@ -30,13 +30,13 @@ void init_env() } class TestSegArray : public ::testing::Test { - public: +public: TestSegArray() {} virtual ~TestSegArray() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(TestSegArray); }; diff --git a/unittest/election/election_test_env.h b/unittest/election/election_test_env.h index 1233cd366..5fdce31a8 100644 --- a/unittest/election/election_test_env.h +++ b/unittest/election/election_test_env.h @@ -32,7 +32,7 @@ namespace election { static const char* tmp_dir = "tmpdir"; class ElectionTestEnv { - public: +public: ElectionTestEnv() {} diff --git a/unittest/election/election_tester.h b/unittest/election/election_tester.h index 42d522fda..a1ea37de2 100644 --- a/unittest/election/election_tester.h +++ b/unittest/election/election_tester.h @@ -64,11 +64,11 @@ class MockObElectionRpcStub; class ObElectionTester { friend class ObElectionTesterCluster; - public: +public: enum InitialState { NORMAL_MODE = 0, RANDOM_MOCK, MOCK }; enum NetWorkDirection { INVALID = 0, IN, OUT, IN_OUT }; - public: +public: ObElectionTester(); ~ObElectionTester(); @@ -77,7 +77,7 @@ class ObElectionTester { void destroy(void); void create(void); - public: +public: ObElectionTester& set_packet_loss_all(NetWorkDirection direction, int64_t start, int64_t end); ObElectionTester& set_packet_loss(ObElectionVoteMsgType type, NetWorkDirection direction, int64_t start, int64_t end); ObElectionTester& set_random_packet_loss( @@ -94,7 +94,7 @@ class ObElectionTester { ObElectionTester& add_to(ObElectionTesterCluster& cluster); const ObServer& get_self() const; - public: +public: void reset_rpc(void); void reset_clock(void); void reset_msg_handler(void); @@ -105,7 +105,7 @@ class ObElectionTester { bool is_real_leader() const; bool operator==(const ObServer& server) const; - private: +private: int init(const char* dev_name, const ObList& voters, const ObList& candidates, const ObList& watchers); @@ -118,14 +118,14 @@ class ObElectionTester { MockObElectionMsgHandler* msg_handler_loss_; MockObElectionMsgHandler* msg_handler_random_loss_; - private: +private: ObElectionServer* server_; // election server wrapped by this class ObElectionTesterCluster* cluster_; // cluster this tester belongs to InitialState skew_stat_; InitialState rpc_recv_stat_; InitialState rpc_send_stat_; - private: +private: bool inited_; // we need two step of init int port_; ObElectionMemberType server_role_; @@ -135,7 +135,7 @@ class ObElectionTester { class ObElectionTesterCluster { friend class ObElectionTester; - public: +public: ObElectionTesterCluster(); ObElectionTesterCluster& init(); ObElectionTesterCluster& init(const char* dev_name); @@ -147,7 +147,7 @@ class ObElectionTesterCluster { ObElectionTester* get_tester(const ObServer& server); ObElectionTester* get_one_slave(void) const; - private: +private: static int port; static const char* devname; // calc servers and push them into three list according to server role @@ -155,7 +155,7 @@ class ObElectionTesterCluster { int remove(const ObElectionTester* tester); bool add(ObElectionTester* tester); - private: +private: static const int MAX_TESTER = 64; ObElectionTester* vtester_[MAX_TESTER]; ObArrayHelper array_helper_; diff --git a/unittest/election/hf_mock_election_cb.h b/unittest/election/hf_mock_election_cb.h index a4e6d4f6a..4277fe4f9 100644 --- a/unittest/election/hf_mock_election_cb.h +++ b/unittest/election/hf_mock_election_cb.h @@ -23,7 +23,7 @@ using namespace election; namespace unittest { class MockElectionCallback : public ObIElectionCallback, public ObIElectionGroupPriorityGetter { - public: +public: MockElectionCallback() {} virtual ~MockElectionCallback() @@ -58,7 +58,7 @@ class MockElectionCallback : public ObIElectionCallback, public ObIElectionGroup return OB_SUCCESS; } - public: +public: ObElectionPriority priority_; ObElectionGroupPriority eg_priority_; }; diff --git a/unittest/election/hf_mock_election_cluster.h b/unittest/election/hf_mock_election_cluster.h index f4a87fd5a..a9663012a 100644 --- a/unittest/election/hf_mock_election_cluster.h +++ b/unittest/election/hf_mock_election_cluster.h @@ -33,7 +33,7 @@ static const int64_t MAX_SERVER_NUM = 7; static const int64_t REPLICA_NUM = 3; class MockElectionCluster { - public: +public: MockElectionCluster() : is_inited_(false), svr_cnt_(0) {} virtual ~MockElectionCluster() @@ -61,14 +61,14 @@ class MockElectionCluster { int start_partition( const ObPartitionKey& pkey, const ObAddr& leader, const int64_t lease_start, int64_t& leader_epoch); - private: +private: int init_server_(const char* ip, const int32_t rpc_port); int start_server_(const char* ip, const int32_t rpc_port); - private: +private: DISALLOW_COPY_AND_ASSIGN(MockElectionCluster); - public: +public: bool is_inited_; int64_t svr_cnt_; obrpc::ObBatchRpc batch_rpc_; diff --git a/unittest/election/hf_mock_election_mgr.h b/unittest/election/hf_mock_election_mgr.h index 8b9ef4045..9b5fe214d 100644 --- a/unittest/election/hf_mock_election_mgr.h +++ b/unittest/election/hf_mock_election_mgr.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace unittest { class MockElectionMgr : public election::ObElectionMgr { - public: +public: int set_election_rpc(election::ObIElectionRpc* election_rpc) { int ret = common::OB_SUCCESS; diff --git a/unittest/election/hf_mock_election_rpc.h b/unittest/election/hf_mock_election_rpc.h index d6298d750..9f988322d 100644 --- a/unittest/election/hf_mock_election_rpc.h +++ b/unittest/election/hf_mock_election_rpc.h @@ -28,7 +28,7 @@ using namespace common; namespace unittest { class ElectionMsgTask { - public: +public: ElectionMsgTask() { reset(); @@ -42,24 +42,24 @@ class ElectionMsgTask { send_ts_ = 0; } - public: +public: ObAddr sender_; ObElectionMsgBuffer msgbuf_; int64_t send_ts_; }; class ElectionMsgTaskFactory { - public: +public: static ElectionMsgTask* alloc(); static void release(ElectionMsgTask* task); - private: +private: static int64_t alloc_count_; static int64_t release_count_; }; class MockElectionRpc : public ObIElectionRpc, public common::ObSimpleThreadPool { - public: +public: MockElectionRpc() : is_inited_(false), election_mgr_(NULL), handle_cnt_(0), handle_time_(0) {} virtual ~MockElectionRpc() @@ -108,11 +108,11 @@ class MockElectionRpc : public ObIElectionRpc, public common::ObSimpleThreadPool void handle(void* task); - private: +private: const int64_t RPC_THREAD_NUM = 2; const int64_t RPC_TASK_LIMIT = 10000; - private: +private: bool is_inited_; ObAddr self_; ObIElectionMgr* election_mgr_; diff --git a/unittest/election/hf_mock_election_server.h b/unittest/election/hf_mock_election_server.h index 178ae1284..935d54df7 100644 --- a/unittest/election/hf_mock_election_server.h +++ b/unittest/election/hf_mock_election_server.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace unittest { class ObRpcLoss { - public: +public: ObRpcLoss() : loss_cnt_(0), total_cnt_(0), loss_rate_(0), end_time_(0) {} ~ObRpcLoss() @@ -49,7 +49,7 @@ class ObRpcLoss { return bool_ret; } - public: +public: int64_t loss_cnt_; int64_t total_cnt_; int64_t loss_rate_; @@ -57,7 +57,7 @@ class ObRpcLoss { }; class MockElectionServer { - public: +public: MockElectionServer() : is_inited_(false) {} virtual ~MockElectionServer() @@ -89,7 +89,7 @@ class MockElectionServer { } uint64_t get_eg_id_hash(const ObPartitionKey& pkey); - public: +public: bool is_inited_; common::ObAddr self_; ObRpcLoss rpc_loss_; diff --git a/unittest/election/hf_test_election_cluster.h b/unittest/election/hf_test_election_cluster.h index 26bd6da43..5a174168b 100644 --- a/unittest/election/hf_test_election_cluster.h +++ b/unittest/election/hf_test_election_cluster.h @@ -24,7 +24,7 @@ using namespace common; namespace unittest { class TestElectionCluster : public ::testing::Test { - public: +public: TestElectionCluster() {} virtual ~TestElectionCluster() diff --git a/unittest/election/loss.h b/unittest/election/loss.h index 863a6824f..848c477d1 100644 --- a/unittest/election/loss.h +++ b/unittest/election/loss.h @@ -22,15 +22,15 @@ namespace election { using namespace oceanbase::common; class Loss { - public: +public: Loss(int64_t loss_rate = 0, int64_t start = 0, int64_t end = 0); ~Loss(); - public: +public: void set_loss(int64_t loss_rate, int64_t start = INT64_MIN, int64_t end = INT64_MAX); bool is_loss(int64_t ts); - protected: +protected: int64_t loss_rate_; int64_t start_; int64_t end_; diff --git a/unittest/election/mock_election.h b/unittest/election/mock_election.h index 466dce59f..3aa03e257 100644 --- a/unittest/election/mock_election.h +++ b/unittest/election/mock_election.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace unittest { class MockElection : public election::ObIElection { - public: +public: virtual int init(const common::ObPartitionKey&, const common::ObAddr&, election::ObIElectionRpc*, common::ObTimeWheel*, const int64_t, election::ObIElectionCallback*, election::ObIElectionGroupMgr*, election::ObElectionEventHistoryArray*) @@ -36,7 +36,7 @@ class MockElection : public election::ObIElection { return 0; } - public: +public: virtual int handle_devote_prepare(const election::ObElectionMsgDEPrepare&, obrpc::ObElectionRpcResult&) { return 0; @@ -70,7 +70,7 @@ class MockElection : public election::ObIElection { return 0; } - public: +public: virtual int set_candidate(const int64_t, const common::ObMemberList&, const int64_t) { return 0; @@ -134,7 +134,7 @@ class MockElection : public election::ObIElection { return 0; } - public: +public: virtual int leader_takeover(const common::ObAddr&, const int64_t, int64_t&) { return 0; @@ -156,7 +156,7 @@ class MockElection : public election::ObIElection { return 0; } - public: +public: // for election group virtual int move_out_election_group(const election::ObElectionGroupId&) { @@ -187,7 +187,7 @@ class MockElection : public election::ObIElection { ts_ = ts; } - private: +private: election::lease_t lease_; int64_t ts_; }; diff --git a/unittest/election/mock_election_clock.h b/unittest/election/mock_election_clock.h index 8cead04f2..d2bc1cdbd 100644 --- a/unittest/election/mock_election_clock.h +++ b/unittest/election/mock_election_clock.h @@ -24,30 +24,30 @@ using namespace oceanbase::election; // for clock_skew class MockClockSkew : public ObElectionClock { - public: +public: MockClockSkew(int64_t skew = 0); ~MockClockSkew(); void set_skew(int64_t skew); - public: +public: virtual int64_t get_current_ts(void) const; - protected: +protected: int64_t skew_; mutable ObSpinLock lock_; }; // for clock_skew_random class MockClockSkewRandom : public ObElectionClock { - public: +public: MockClockSkewRandom(int64_t low = 0, int64_t high = 0); ~MockClockSkewRandom(); void set_skew_random(int64_t low, int64_t high); - public: +public: virtual int64_t get_current_ts(void) const; - protected: +protected: int64_t low_; int64_t high_; mutable ObSpinLock lock_; diff --git a/unittest/election/mock_election_handle_packet.h b/unittest/election/mock_election_handle_packet.h index b0df4897b..ceb546f99 100644 --- a/unittest/election/mock_election_handle_packet.h +++ b/unittest/election/mock_election_handle_packet.h @@ -25,17 +25,17 @@ using namespace oceanbase::common; using namespace oceanbase::election; class MockObElection : public ObElection { - public: +public: MockObElection(); - public: +public: virtual int handle_packet(const int64_t packet_code, ObDataBuffer& in_buff, ObDataBuffer& out_buff); int set_outage_for(ObElectionVoteMsgType type, int64_t start_time = 0, int64_t end_time = INT64_MAX); int set_outage_all(int64_t start_time = 0, int64_t end_time = INT64_MAX); - private: +private: Outage outage_map_[MAX_VOTE_MSG_TYPE]; }; } // namespace election diff --git a/unittest/election/mock_election_msg_handler.h b/unittest/election/mock_election_msg_handler.h index c6cdb6dbb..34d4ba87c 100644 --- a/unittest/election/mock_election_msg_handler.h +++ b/unittest/election/mock_election_msg_handler.h @@ -25,13 +25,13 @@ using namespace oceanbase::common; using namespace oceanbase::election; class MockObElectionMsgHandler : public ObElectionMsgHandler { - public: +public: MockObElectionMsgHandler(); ~MockObElectionMsgHandler(); virtual int init(ObElection* e); virtual void destroy(void); - public: +public: //////handlers for vote message virtual int handle_devote_prepare(const ObElectionMsgDEPrepare& msg, ObDataBuffer& out_buff); virtual int handle_devote_vote(const ObElectionMsgDEVote& msg, ObDataBuffer& out_buff); @@ -41,7 +41,7 @@ class MockObElectionMsgHandler : public ObElectionMsgHandler { virtual int handle_vote_vote(const ObElectionMsgVote& msg, ObDataBuffer& out_buff); virtual int handle_vote_success(const ObElectionMsgSuccess& msg, ObDataBuffer& out_buff); - public: +public: void set_outage_for(ObElectionVoteMsgType type, int64_t start, int64_t end); void set_outage_all(int64_t start, int64_t end); void reset_outage_for(ObElectionVoteMsgType type); @@ -50,7 +50,7 @@ class MockObElectionMsgHandler : public ObElectionMsgHandler { void set_loss_all(int64_t loss_rate, int64_t start = INT64_MIN, int64_t end = INT64_MAX); void reset_loss_all(void); - private: +private: bool inited_; Outage outage_map_[MAX_VOTE_MSG_TYPE]; Loss loss_map_[MAX_VOTE_MSG_TYPE]; diff --git a/unittest/election/mock_election_rpc.h b/unittest/election/mock_election_rpc.h index 399639965..2af02c6b6 100644 --- a/unittest/election/mock_election_rpc.h +++ b/unittest/election/mock_election_rpc.h @@ -27,16 +27,16 @@ namespace election { using namespace oceanbase::common; using namespace oceanbase::election; class MockObElectionRpcStub : public ObElectionRpcStub { - public: +public: virtual int init( const ObClientManager* client_mgr, ThreadSpecificBuffer* buffer, ObElection* e, const int64_t timeout); virtual void destroy(void); - public: +public: virtual int init(ObElectionServer& server); static const int64_t timeout = 3000000; - public: +public: virtual int send_devote_prepare(void); virtual int send_devote_vote(const ObServer& server); virtual int send_devote_success(const ObServer& server); @@ -44,7 +44,7 @@ class MockObElectionRpcStub : public ObElectionRpcStub { virtual int send_vote_vote(const ObServer& cur_leader, const ObServer& new_leader); virtual int send_vote_success(const ObServer& cur_leader, const ObServer& new_leader); - public: +public: void set_outage_for(ObElectionVoteMsgType type, int64_t start, int64_t end); void set_outage_all(int64_t start, int64_t end); void reset_outage_for(ObElectionVoteMsgType type); @@ -53,7 +53,7 @@ class MockObElectionRpcStub : public ObElectionRpcStub { void set_loss_all(int64_t loss_rate, int64_t start = INT64_MIN, int64_t end = INT64_MAX); void reset_loss_all(void); - private: +private: Outage outage_map_[MAX_VOTE_MSG_TYPE]; Loss loss_map_[MAX_VOTE_MSG_TYPE]; }; diff --git a/unittest/election/mock_ob_election_cb.h b/unittest/election/mock_ob_election_cb.h index 8f51015db..aabb795cd 100644 --- a/unittest/election/mock_ob_election_cb.h +++ b/unittest/election/mock_ob_election_cb.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace unittest { class MockObElectionCallback : public election::ObIElectionCallback { - public: +public: MockObElectionCallback() {} virtual ~MockObElectionCallback() @@ -44,7 +44,7 @@ class MockObElectionCallback : public election::ObIElectionCallback { return OB_SUCCESS; } - public: +public: ObElectionPriority priority_; }; diff --git a/unittest/election/mock_ob_election_mgr.h b/unittest/election/mock_ob_election_mgr.h index 097e5212b..4c99b557d 100644 --- a/unittest/election/mock_ob_election_mgr.h +++ b/unittest/election/mock_ob_election_mgr.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace unittest { class MockEGPriorityGetter : public election::ObIElectionGroupPriorityGetter { - public: +public: int get_election_group_priority(const uint64_t tenant_id, election::ObElectionGroupPriority& priority) const { UNUSED(tenant_id); @@ -30,7 +30,7 @@ class MockEGPriorityGetter : public election::ObIElectionGroupPriorityGetter { }; class MockObElectionMgr : public election::ObElectionMgr { - public: +public: int set_election_rpc(election::ObIElectionRpc* election_rpc) { int ret = common::OB_SUCCESS; @@ -53,7 +53,7 @@ class MockObElectionMgr : public election::ObElectionMgr { return idx_; } - public: +public: common::ObAddr addr_; int64_t idx_; }; diff --git a/unittest/election/mock_ob_election_rpc.h b/unittest/election/mock_ob_election_rpc.h index 8333fd28d..4ab077759 100644 --- a/unittest/election/mock_ob_election_rpc.h +++ b/unittest/election/mock_ob_election_rpc.h @@ -26,7 +26,7 @@ using namespace election; using namespace common; namespace unittest { class ElectionRpcTask { - public: +public: ElectionRpcTask() { reset(); @@ -41,7 +41,7 @@ class ElectionRpcTask { timestamp_ = 0; } - public: +public: ObAddr server_; ObElectionMsgBuffer msgbuf_; ObPartitionKey partition_; @@ -49,17 +49,17 @@ class ElectionRpcTask { }; class ElectionRpcTaskFactory { - public: +public: static ElectionRpcTask* alloc(); static void release(ElectionRpcTask* task); - private: +private: static int64_t alloc_count_; static int64_t release_count_; }; class MockObElectionRpc : public ObIElectionRpc, public common::S2MQueueThread { - public: +public: MockObElectionRpc() : inited_(false), election_mgr_(NULL) {} ~MockObElectionRpc() @@ -108,7 +108,7 @@ class MockObElectionRpc : public ObIElectionRpc, public common::S2MQueueThread { int init(ObIElectionMgr* election_mgr, const ObAddr& self); void handle(void* task, void* pdata); - private: +private: bool inited_; ObIElectionMgr* election_mgr_; }; diff --git a/unittest/election/outage.h b/unittest/election/outage.h index 615fdf5d4..136f8fb43 100644 --- a/unittest/election/outage.h +++ b/unittest/election/outage.h @@ -22,15 +22,15 @@ namespace election { using namespace oceanbase::common; class Outage { - public: +public: Outage(int64_t start = 0, int64_t end = 0); ~Outage(); - public: +public: void set_outage(int64_t start, int64_t end); bool in_outage(int64_t ts); - protected: +protected: int64_t start_; int64_t end_; mutable ObSpinLock lock_; diff --git a/unittest/election/test.cpp b/unittest/election/test.cpp index 93d472e35..8515dc63e 100644 --- a/unittest/election/test.cpp +++ b/unittest/election/test.cpp @@ -33,7 +33,7 @@ static const char* dev_name = "bond0"; static const int timeout = 300000; /*us*/ class TEST_CASE_NAME : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() @@ -41,7 +41,7 @@ class TEST_CASE_NAME : public ::testing::Test { int routine(int loop); - protected: +protected: ObServer self_; }; diff --git a/unittest/election/test_election_async_log.cpp b/unittest/election/test_election_async_log.cpp index 7ed6f8ca9..b35f4362c 100644 --- a/unittest/election/test_election_async_log.cpp +++ b/unittest/election/test_election_async_log.cpp @@ -22,7 +22,7 @@ using namespace election; using namespace common; class TestElectionAsyncLog : public ::testing::Test { - public: +public: TestElectionAsyncLog() {} virtual ~TestElectionAsyncLog() diff --git a/unittest/election/test_election_base.cpp b/unittest/election/test_election_base.cpp index 2ed9a0894..624e259fe 100644 --- a/unittest/election/test_election_base.cpp +++ b/unittest/election/test_election_base.cpp @@ -23,7 +23,7 @@ namespace unittest { using namespace common; using namespace election; class TestObElectionBase : public ::testing::Test { - public: +public: TestObElectionBase() {} ~TestObElectionBase() diff --git a/unittest/election/test_election_cluster.h b/unittest/election/test_election_cluster.h index 05621de64..69756bad9 100644 --- a/unittest/election/test_election_cluster.h +++ b/unittest/election/test_election_cluster.h @@ -27,18 +27,18 @@ static const int64_t MAX_OB_TRANS_SERVICE_NUM = 4; static const int64_t OB_REPLICA_NUM = 3; class ObRpcLoss { - public: +public: ObRpcLoss() : times_(0) {} ~ObRpcLoss() {} - public: +public: int64_t times_; }; class ObTestElectionCluster : public ObIElectionRpc { - public: +public: ObTestElectionCluster() {} virtual ~ObTestElectionCluster() @@ -59,11 +59,11 @@ class ObTestElectionCluster : public ObIElectionRpc { return OB_SUCCESS; } - private: +private: static const int32_t MAX_ELECTION_MSG_COUNT = 6; int start_one_(const int64_t idx, const char* ip, const int32_t rpc_port); - public: +public: bool inited_; int32_t base_rpc_port_; const char* ip_; @@ -77,7 +77,7 @@ class ObTestElectionCluster : public ObIElectionRpc { }; class TestObElectionCluster : public ::testing::Test { - public: +public: TestObElectionCluster() {} virtual ~TestObElectionCluster() @@ -89,7 +89,7 @@ class TestObElectionCluster : public ::testing::Test { static void TearDownTestCase() {} - public: +public: ObTestElectionCluster cluster_; common::ObPartitionKey test_partition_; common::ObAddr leader_; diff --git a/unittest/election/test_election_group_cache.cpp b/unittest/election/test_election_group_cache.cpp index 8972e664e..b588dad95 100644 --- a/unittest/election/test_election_group_cache.cpp +++ b/unittest/election/test_election_group_cache.cpp @@ -25,7 +25,7 @@ using namespace common; using namespace std; class TestObElectionGroupCache : public ::testing::Test { - public: +public: const vector ADDR = {ObAddr(ObAddr::VER::IPV4, "127.0.0.1", 34500), ObAddr(ObAddr::VER::IPV4, "127.0.0.2", 34501), ObAddr(ObAddr::VER::IPV4, "127.0.0.3", 34502), @@ -35,7 +35,7 @@ class TestObElectionGroupCache : public ::testing::Test { ObAddr(ObAddr::VER::IPV4, "127.0.0.7", 34506), ObAddr(ObAddr::VER::IPV4, "127.0.0.8", 34507)}; - public: +public: TestObElectionGroupCache() {} ~TestObElectionGroupCache() diff --git a/unittest/election/test_election_mem_stat.cpp b/unittest/election/test_election_mem_stat.cpp index 06889d6ab..614c4ea2a 100644 --- a/unittest/election/test_election_mem_stat.cpp +++ b/unittest/election/test_election_mem_stat.cpp @@ -22,7 +22,7 @@ namespace unittest { using namespace common; using namespace election; class TestObElectionMemStat : public ::testing::Test { - public: +public: TestObElectionMemStat() {} virtual ~TestObElectionMemStat() @@ -32,7 +32,7 @@ class TestObElectionMemStat : public ::testing::Test { virtual void TearDown() {} - public: +public: ObElectionMemStat mem_stat_; }; diff --git a/unittest/election/test_election_mgr.cpp b/unittest/election/test_election_mgr.cpp index 724e8ee27..82e0013f8 100644 --- a/unittest/election/test_election_mgr.cpp +++ b/unittest/election/test_election_mgr.cpp @@ -39,7 +39,7 @@ static uint64_t table_id_ = tenant_id_ << 40; static ObElectionMgr mgr_; class TestObElectionMgr : public ::testing::Test { - public: +public: TestObElectionMgr() {} ~TestObElectionMgr() @@ -53,10 +53,10 @@ class TestObElectionMgr : public ::testing::Test { virtual void TearDown() {} - public: +public: void init(); - public: +public: ObAddr self_; obrpc::ObBatchRpc batch_rpc_; MockEGPriorityGetter eg_cb_; @@ -64,7 +64,7 @@ class TestObElectionMgr : public ::testing::Test { }; class MyObElectionCallback : public ObIElectionCallback { - public: +public: MyObElectionCallback() {} ~MyObElectionCallback() diff --git a/unittest/election/test_election_msg.cpp b/unittest/election/test_election_msg.cpp index 7178fe31d..544dc3a40 100644 --- a/unittest/election/test_election_msg.cpp +++ b/unittest/election/test_election_msg.cpp @@ -29,7 +29,7 @@ namespace unittest { using namespace election; using namespace common; class TestObElectionMsg : public ::testing::Test { - public: +public: TestObElectionMsg() {} ~TestObElectionMsg() @@ -41,11 +41,11 @@ class TestObElectionMsg : public ::testing::Test { virtual void TearDown() {} - public: +public: void init(); int64_t get_current_ts(ObPartitionKey& pkey) const; - public: +public: static const int64_t OB_ELECTION_HASH_TABLE_NUM = 100; ObAddr self_; int64_t t1_; diff --git a/unittest/election/test_election_msg_pool.cpp b/unittest/election/test_election_msg_pool.cpp index b4ffd867c..141dc5d77 100644 --- a/unittest/election/test_election_msg_pool.cpp +++ b/unittest/election/test_election_msg_pool.cpp @@ -41,7 +41,7 @@ const vector ADDR = {ObAddr(ObAddr::VER::IPV4, "127.0.0.1", 34500), const vector REPLICA_NUM = {3, 5, 7}; class TestObElectionMsgPool : public ::testing::Test { - public: +public: TestObElectionMsgPool() {} ~TestObElectionMsgPool() @@ -62,10 +62,10 @@ class TestObElectionMsgPool : public ::testing::Test { msg_pool_.init(ADDR[0], &election_); } - private: +private: int init(); - public: +public: ObElectionVoteMsgPool msg_pool_; int64_t t1_; int64_t send_ts_; diff --git a/unittest/election/test_election_priority.cpp b/unittest/election/test_election_priority.cpp index 2c2cd3251..2693e76f9 100644 --- a/unittest/election/test_election_priority.cpp +++ b/unittest/election/test_election_priority.cpp @@ -29,7 +29,7 @@ using namespace election; using namespace common; class TestObElectionPriority : public ::testing::Test { - public: +public: TestObElectionPriority() {} ~TestObElectionPriority() @@ -42,10 +42,10 @@ class TestObElectionPriority : public ::testing::Test { virtual void TearDown() {} - private: +private: int init(); - public: +public: int create_deprepare_msg(common::ObSArray& priority_array, ObElectionVoteMsgPool& msg_pool); ObElectionVoteMsgPool msg_pool_; MockElection election_; diff --git a/unittest/election/test_election_rpc.cpp b/unittest/election/test_election_rpc.cpp index 9cf133f80..88adae9f8 100644 --- a/unittest/election/test_election_rpc.cpp +++ b/unittest/election/test_election_rpc.cpp @@ -29,7 +29,7 @@ using namespace obrpc; using namespace election; class MockObElectionProxy : public obrpc::ObElectionRpcProxy { - public: +public: DEFINE_TO(MockObElectionProxy); virtual int post_election_msg(const oceanbase::election::ObElectionMsgBuffer& msg_buf, AsyncCB<(oceanbase::obrpc::ObRpcPacketCode)1537>* async_cb, const oceanbase::obrpc::ObRpcOpts& opts) @@ -43,7 +43,7 @@ class MockObElectionProxy : public obrpc::ObElectionRpcProxy { }; class TestObElectionRpc : public ::testing::Test { - public: +public: TestObElectionRpc() : proxy_(&proxy_) {} virtual ~TestObElectionRpc() @@ -58,7 +58,7 @@ class TestObElectionRpc : public ::testing::Test { int init(); - protected: +protected: ObAddr addr_; ObElectionRpc rpc_; ObElectionMgr mgr_; diff --git a/unittest/election/test_election_timer.cpp b/unittest/election/test_election_timer.cpp index 170dd4c5e..2c221de9c 100644 --- a/unittest/election/test_election_timer.cpp +++ b/unittest/election/test_election_timer.cpp @@ -26,7 +26,7 @@ using namespace election; using namespace common; class TestObElectionTimer : public ::testing::Test { - public: +public: TestObElectionTimer() {} virtual ~TestObElectionTimer() @@ -35,14 +35,14 @@ class TestObElectionTimer : public ::testing::Test { virtual void SetUp(); virtual void TearDown(); - private: +private: static const int64_t TIMER_THREAD_COUNT = 6; int init(); int start(); int stop(); int wait(); - protected: +protected: election::ObElection e_; election::ObElectionTimer timer_; election::ObElectionRpc rpc_; diff --git a/unittest/observer/omt/test_manage_tenant.cpp b/unittest/observer/omt/test_manage_tenant.cpp index 74854c3f7..5e2523edd 100644 --- a/unittest/observer/omt/test_manage_tenant.cpp +++ b/unittest/observer/omt/test_manage_tenant.cpp @@ -23,7 +23,7 @@ using namespace oceanbase::observer; #define OMT_UNITTEST class TestManageTenant : public ::testing::Test, public ObMultiTenant { - public: +public: TestManageTenant() : ObMultiTenant(procor_) { all_mock_init(); @@ -35,7 +35,7 @@ class TestManageTenant : public ::testing::Test, public ObMultiTenant { virtual void TearDown() {} - protected: +protected: ObFakeWorkerProcessor procor_; ObGlobalContext gctx_; }; diff --git a/unittest/observer/omt/test_multi_tenant.cpp b/unittest/observer/omt/test_multi_tenant.cpp index 584fb38a1..377f77b9f 100644 --- a/unittest/observer/omt/test_multi_tenant.cpp +++ b/unittest/observer/omt/test_multi_tenant.cpp @@ -40,7 +40,7 @@ using namespace oceanbase::observer; #define OMT_UNITTEST class MockObPxPools : public ObPxPools { - public: +public: MockObPxPools() : ObPxPools() { this_seq_ = MockObPxPools::seq_++; @@ -69,7 +69,7 @@ class MockObPxPools : public ObPxPools { return this_seq_; } - private: +private: static int64_t seq_; int64_t this_seq_; }; @@ -78,7 +78,7 @@ int64_t MockObPxPools::seq_ = 0; class MockOMT : public ObMultiTenant { static constexpr auto TIMES_OF_WORKERS = 10; - public: +public: MockOMT() : ObMultiTenant(procor_) {} int add_tenant(uint64_t tenant_id) @@ -86,11 +86,11 @@ class MockOMT : public ObMultiTenant { return ObMultiTenant::add_tenant(tenant_id, 1, 1); } - private: +private: ObFakeWorkerProcessor procor_; }; class TestMultiTenant : public ::testing::Test { - public: +public: TestMultiTenant() { all_mock_init(); @@ -137,7 +137,7 @@ class TestMultiTenant : public ::testing::Test { // void clear() { omt_.clear(); } - protected: +protected: MockOMT omt_; }; @@ -216,7 +216,7 @@ TEST_F(TestMultiTenant, get_tenant_context) } class CtxMemConfigGetter : public ObICtxMemConfigGetter { - public: +public: virtual int get(common::ObIArray& configs) { int ret = OB_SUCCESS; diff --git a/unittest/observer/omt/test_token_calcer.cpp b/unittest/observer/omt/test_token_calcer.cpp index 5078f59da..d3c0d4051 100644 --- a/unittest/observer/omt/test_token_calcer.cpp +++ b/unittest/observer/omt/test_token_calcer.cpp @@ -29,7 +29,7 @@ static constexpr auto TIMES_OF_WORKERS = 10; // Fake ObTenant class class MockTenant : public ObTenant { - public: +public: MockTenant(const int64_t id, ObWorkerPool& worker_pool) : ObTenant(id, TIMES_OF_WORKERS, worker_pool, ctrl_) { stopped_ = false; @@ -40,7 +40,7 @@ class MockTenant : public ObTenant { MOCK_CONST_METHOD0(waiting_count, int64_t()); - private: +private: ObCgroupCtrl ctrl_; }; @@ -49,7 +49,7 @@ class MockTenant : public ObTenant { // get_tenant_list() // add_tenant() class MockOMT : public ObMultiTenant { - public: +public: MockOMT() : ObMultiTenant(procor_) {} @@ -66,12 +66,12 @@ class MockOMT : public ObMultiTenant { tenants_.reset(); } - private: +private: ObFakeWorkerProcessor procor_; }; class TestTokenCalcer : public ::testing::Test { - public: +public: TestTokenCalcer() : otc_(omt_) { all_mock_init(); @@ -98,7 +98,7 @@ class TestTokenCalcer : public ::testing::Test { omt_.clear(); } - protected: +protected: ObTenant* t1_; ObTenant* t2_; ObTenant* t3_; diff --git a/unittest/observer/omt/test_worker.cpp b/unittest/observer/omt/test_worker.cpp index 8483f6d8e..eec241b08 100644 --- a/unittest/observer/omt/test_worker.cpp +++ b/unittest/observer/omt/test_worker.cpp @@ -23,7 +23,7 @@ using namespace oceanbase::omt; using namespace oceanbase::observer; class TestWorker : public ObThWorker, public ::testing::Test { - public: +public: TestWorker() : ObThWorker(procor_), omt_(procor_) { all_mock_init(); @@ -46,7 +46,7 @@ class TestWorker : public ObThWorker, public ::testing::Test { destroy(); } - protected: +protected: ObFakeWorkerProcessor procor_; ObMultiTenant omt_; }; diff --git a/unittest/observer/omt/test_worker_pool.cpp b/unittest/observer/omt/test_worker_pool.cpp index f37ff86b4..a4333f09b 100644 --- a/unittest/observer/omt/test_worker_pool.cpp +++ b/unittest/observer/omt/test_worker_pool.cpp @@ -21,7 +21,7 @@ using namespace oceanbase::omt; using namespace oceanbase::observer; class TestWorkerPool : public ::testing::Test { - public: +public: TestWorkerPool() : pool_(procor_) {} @@ -35,7 +35,7 @@ class TestWorkerPool : public ::testing::Test { pool_.destroy(); } - protected: +protected: ObFakeWorkerProcessor procor_; ObGlobalContext gctx_; ObWorkerPool pool_; diff --git a/unittest/observer/test_information_schema.cpp b/unittest/observer/test_information_schema.cpp index 0803d462d..e6f178e03 100644 --- a/unittest/observer/test_information_schema.cpp +++ b/unittest/observer/test_information_schema.cpp @@ -33,7 +33,7 @@ namespace observer { class TestInformationSchemaService : public ::testing::Test { typedef int (*schema_create_func)(share::schema::ObTableSchema& table_schema); - public: +public: TestInformationSchemaService(); virtual ~TestInformationSchemaService() {} @@ -47,7 +47,7 @@ class TestInformationSchemaService : public ::testing::Test { void fill_session(); - protected: +protected: // ObSchemaManager schema_manager_; ObArenaAllocator allocator_; sql::ObSQLSessionInfo session_info_; @@ -117,7 +117,7 @@ void TestInformationSchemaService::fill_table_schema( } class MockObSchemaGetterGuard : public ObSchemaGetterGuard { - public: +public: int add_database_schema(ObDatabaseSchema* database_schema); int add_table_schema(ObTableSchema* table_schema); MOCK_METHOD2(get_database_schemas_in_tenant, @@ -128,7 +128,7 @@ class MockObSchemaGetterGuard : public ObSchemaGetterGuard { int get_table_schemas_from_database( const uint64_t tenant_id, const uint64_t database_id, ObIArray& table_schemas); - private: +private: ObSArray database_schemas_; ObSArray table_schemas_; }; diff --git a/unittest/observer/test_net_performance.h b/unittest/observer/test_net_performance.h index 42ead318e..ce4d34072 100644 --- a/unittest/observer/test_net_performance.h +++ b/unittest/observer/test_net_performance.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace obrpc { RPC_S_S(@PR5 test, OB_TEST_PCODE); class TestProxy : public ObRpcProxy { - public: +public: DEFINE_TO(TestProxy); RPC_S_M(@PR5 test, OB_TEST_PCODE); @@ -37,13 +37,13 @@ namespace oceanbase { namespace unittest { class Client : public share::ObThreadPool { - public: +public: Client(const obrpc::TestProxy& proxy) : proxy_(proxy) {} virtual void run1(); - private: +private: const obrpc::TestProxy& proxy_; }; // end of class Client diff --git a/unittest/pub/mock_server.h b/unittest/pub/mock_server.h index 9a98a5be0..fe0197466 100644 --- a/unittest/pub/mock_server.h +++ b/unittest/pub/mock_server.h @@ -26,7 +26,7 @@ namespace pub { template class MockP : public ObRpcProcessor { - public: +public: int process() { return ObRpcProcessor::response_result(); @@ -34,7 +34,7 @@ class MockP : public ObRpcProcessor { }; class MockPacketHandler : public ObNetRpcHandler { - public: +public: int process(easy_request_t* r) { int ret = EASY_OK; @@ -70,7 +70,7 @@ class MockPacketHandler : public ObNetRpcHandler { return ret; } - private: +private: #define REG_PKT(pcode) \ case pcode: { \ p = new MockP(); \ @@ -115,7 +115,7 @@ class MockPacketHandler : public ObNetRpcHandler { }; // end of class MockPacketHandler class MockServer : public ObNetEasy { - public: +public: int init(int port) { int ret = OB_SUCCESS; @@ -129,7 +129,7 @@ class MockServer : public ObNetEasy { return ret; } - private: +private: MockPacketHandler phandler_; }; // end of class MockServer diff --git a/unittest/rootserver/fake_partition_table_util.h b/unittest/rootserver/fake_partition_table_util.h index ca2a990d4..f83718421 100644 --- a/unittest/rootserver/fake_partition_table_util.h +++ b/unittest/rootserver/fake_partition_table_util.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace rootserver { class FakePartitionTableUtil : public ObPartitionTableUtil { - public: +public: FakePartitionTableUtil(ObZoneManager& cm) : cm_(cm) {} @@ -52,7 +52,7 @@ class FakePartitionTableUtil : public ObPartitionTableUtil { return common::OB_SUCCESS; } - private: +private: ObZoneManager& cm_; }; diff --git a/unittest/rootserver/fake_rs_list_change_cb.h b/unittest/rootserver/fake_rs_list_change_cb.h index 65af9f586..38ca0e862 100644 --- a/unittest/rootserver/fake_rs_list_change_cb.h +++ b/unittest/rootserver/fake_rs_list_change_cb.h @@ -15,7 +15,7 @@ namespace oceanbase { namespace share { using namespace common; class FakeRsListChangeCb : public ObIRsListChangeCb { - public: +public: virtual int submit_update_rslist_task(const bool force_update) { UNUSED(force_update); @@ -32,7 +32,7 @@ class FakeRsListChangeCb : public ObIRsListChangeCb { } }; class FakeMergeErrorCb : public ObIMergeErrorCb { - public: +public: FakeMergeErrorCb() {} ~FakeMergeErrorCb() diff --git a/unittest/rootserver/fake_server_manager.h b/unittest/rootserver/fake_server_manager.h index c0c85f961..b3826185a 100644 --- a/unittest/rootserver/fake_server_manager.h +++ b/unittest/rootserver/fake_server_manager.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace rootserver { class FakeServerMgr : public ObServerManager { - public: +public: FakeServerMgr() : server_id_(0) {} ~FakeServerMgr() @@ -37,7 +37,7 @@ class FakeServerMgr : public ObServerManager { return server_statuses.assign(server_statuses_); } - private: +private: int64_t server_id_; ObZoneManager* zone_mgr_; }; @@ -91,7 +91,7 @@ int FakeServerMgr::add_server(const common::ObAddr& server, const ObZone& zone) } class FakeServerManager : public ObServerManager { - public: +public: void set_is_inited(bool is_inited) { UNUSED(is_inited); @@ -370,7 +370,7 @@ class FakeServerManager : public ObServerManager { inited_ = inited; } - public: +public: common::ObArray all_; }; diff --git a/unittest/rootserver/fake_zone_manager.h b/unittest/rootserver/fake_zone_manager.h index e3e55d077..c78ae8076 100644 --- a/unittest/rootserver/fake_zone_manager.h +++ b/unittest/rootserver/fake_zone_manager.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace rootserver { class FakeZoneManager : public ObZoneManager { - public: +public: FakeZoneManager() : config_version_(1) {} ~FakeZoneManager() diff --git a/unittest/rootserver/mock_freeze_info_manager.h b/unittest/rootserver/mock_freeze_info_manager.h index 90a2072ba..2db3378f7 100644 --- a/unittest/rootserver/mock_freeze_info_manager.h +++ b/unittest/rootserver/mock_freeze_info_manager.h @@ -23,7 +23,7 @@ class ObFrozenStatus; namespace rootserver { class MockFreezeInfoManager : public ObFreezeInfoManager { - public: +public: virtual int get_freeze_info(int64_t input_frozen_version, storage::ObFrozenStatus& frozen_status) { UNUSED(input_frozen_version); @@ -36,7 +36,7 @@ class MockFreezeInfoManager : public ObFreezeInfoManager { MOCK_METHOD2( set_freeze_info, int(storage::ObFrozenStatus& src_frozen_status, storage::ObFrozenStatus& tgt_frozen_status)); - private: +private: static const int64_t ORIGIN_FROZEN_VERSION = 1; static const common::ObFreezeStatus ORIGIN_FREEZE_STATUS = common::COMMIT_SUCCEED; static const int64_t ORIGIN_FROZEN_TIMESTAMP = 1; diff --git a/unittest/rootserver/mock_leader_coordinate.h b/unittest/rootserver/mock_leader_coordinate.h index da8556cc9..5a9e0f4e6 100644 --- a/unittest/rootserver/mock_leader_coordinate.h +++ b/unittest/rootserver/mock_leader_coordinate.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace rootserver { class MockLeaderCoordinator : public ObLeaderCoordinator { - public: +public: MOCK_METHOD0(coordinate, int()); MOCK_METHOD0(smooth_coordinate, int()); MOCK_METHOD0(start_smooth_coordinate, int()); diff --git a/unittest/rootserver/mock_ob_bootstrap.h b/unittest/rootserver/mock_ob_bootstrap.h index 6c483022a..5c7f93cbe 100644 --- a/unittest/rootserver/mock_ob_bootstrap.h +++ b/unittest/rootserver/mock_ob_bootstrap.h @@ -14,7 +14,7 @@ namespace oceanbase { namespace rootserver { class MockObBaseBootstrap : public ObBaseBootstrap { - public: +public: MOCK_METHOD1(check_bootstrap_rs_list, int(const obrpc::ObServerInfoList& rs_list)); MOCK_METHOD1(create_partition, int(const uint64_t table_id)); }; @@ -26,7 +26,7 @@ namespace oceanbase { namespace rootserver { class MockObPreBootstrap : public ObPreBootstrap { - public: +public: MOCK_METHOD1(prepare_bootstrap, int(common::ObAddr& master_rs)); MOCK_METHOD1(check_is_all_server_empty, int(bool& is_empty)); MOCK_METHOD1(wait_elect_master_partition, int(common::ObAddr& master_rs)); @@ -39,7 +39,7 @@ namespace oceanbase { namespace rootserver { class MockObBootstrap : public ObBootstrap { - public: +public: MOCK_METHOD0(execute_bootstrap, int()); MOCK_METHOD1(check_is_already_bootstrap, int(bool& is_bootstrap)); MOCK_METHOD0(create_core_tables, int()); diff --git a/unittest/rootserver/ob_rs_test_utils.h b/unittest/rootserver/ob_rs_test_utils.h index 688607f22..fef57c926 100644 --- a/unittest/rootserver/ob_rs_test_utils.h +++ b/unittest/rootserver/ob_rs_test_utils.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace rootserver { class ObFakeCB : public ObIStatusChangeCallback { - public: +public: ObFakeCB() {} int wakeup_balancer() @@ -50,7 +50,7 @@ class ObFakeCB : public ObIStatusChangeCallback { }; class ObFakeServerChangeCB : public ObIServerChangeCallback { - public: +public: ObFakeServerChangeCB() {} virtual ~ObFakeServerChangeCB() @@ -62,7 +62,7 @@ class ObFakeServerChangeCB : public ObIServerChangeCallback { }; class ObNeverStopForTestOnly : public share::ObCheckStopProvider { - public: +public: ObNeverStopForTestOnly() {} virtual ~ObNeverStopForTestOnly() diff --git a/unittest/rootserver/server_status_builder.h b/unittest/rootserver/server_status_builder.h index d9eb70c7a..041f99164 100644 --- a/unittest/rootserver/server_status_builder.h +++ b/unittest/rootserver/server_status_builder.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace rootserver { class ObServerStatusBuilder { - public: +public: ObServerStatusBuilder() : config_(NULL), server_statuses_(), server_id_(OB_INIT_SERVER_ID) {} int init(ObServerConfig& config) @@ -41,7 +41,7 @@ class ObServerStatusBuilder { } int build(ObServerManager& server_mgr); - private: +private: ObServerConfig* config_; share::ObServerResourceInfo resource_; ObServerManager::ObServerStatusArray server_statuses_; diff --git a/unittest/rootserver/test_bootstrap.cpp b/unittest/rootserver/test_bootstrap.cpp index 4f8956382..5b7c3ab53 100644 --- a/unittest/rootserver/test_bootstrap.cpp +++ b/unittest/rootserver/test_bootstrap.cpp @@ -69,7 +69,7 @@ static int64_t& PID = FakePartPropertyGetter::PID(); namespace rootserver { class MockLocalityManager : public ObILocalityManager { - public: +public: struct ServerInfo { ServerInfo() : server_(), is_local_(false) {} @@ -103,7 +103,7 @@ class MockLocalityManager : public ObILocalityManager { }; class TestBootstrap : public ::testing::Test { - public: +public: TestBootstrap(); virtual ~TestBootstrap() {} @@ -112,7 +112,7 @@ class TestBootstrap : public ::testing::Test { int init_partition_table(); void call_execute_bootstrap(); - protected: +protected: DBInitializer db_initer_; ObMultiVersionSchemaService schema_service_; MockObSrvRpcProxy rpc_proxy_; diff --git a/unittest/rootserver/test_multi_cluster_manager.cpp b/unittest/rootserver/test_multi_cluster_manager.cpp index 0562dc28d..57bfe18fe 100644 --- a/unittest/rootserver/test_multi_cluster_manager.cpp +++ b/unittest/rootserver/test_multi_cluster_manager.cpp @@ -28,7 +28,7 @@ using ::testing::Return; namespace rootserver { // multiclustermanage class TestMultiClusterManager_load_Test : public testing::Test { - public: +public: TestMultiClusterManager_load_Test() : cluster_mgr_() {} virtual ~TestMultiClusterManager_load_Test() @@ -39,7 +39,7 @@ class TestMultiClusterManager_load_Test : public testing::Test { virtual void TestBody() {} - private: +private: ObMultiClusterManager cluster_mgr_; }; diff --git a/unittest/rootserver/test_recovery_helper.cpp b/unittest/rootserver/test_recovery_helper.cpp index 6ce4ca653..24879ef2c 100644 --- a/unittest/rootserver/test_recovery_helper.cpp +++ b/unittest/rootserver/test_recovery_helper.cpp @@ -129,7 +129,7 @@ namespace rootserver { //} class TestRecoveryHelper : public ::testing::Test { - public: +public: TestRecoveryHelper() {} virtual ~TestRecoveryHelper() @@ -141,7 +141,7 @@ class TestRecoveryHelper : public ::testing::Test { int build_partition(int64_t table_id, ObPartitionInfo& partition, int64_t replica_cnt, int64_t pos = 6); int add_server(); - public: +public: // DBInitializer db_initer_; // FakePartPropertyGetter prop_getter_; // FakePartitionTableOperator pt_; diff --git a/unittest/share/cache/ob_cache_test_utils.h b/unittest/share/cache/ob_cache_test_utils.h index 1ac3163c9..21ef3ce56 100644 --- a/unittest/share/cache/ob_cache_test_utils.h +++ b/unittest/share/cache/ob_cache_test_utils.h @@ -106,14 +106,14 @@ struct AllocBuf { class ObCacheTestTask; class ObICacheTestStat { - public: +public: virtual void add_task(ObCacheTestTask* task) = 0; virtual ObCacheTestTask* pop_oppo_task(ObCacheTestTask* task) = 0; virtual void inc_fail_count() = 0; }; class ObCacheTestTask { - public: +public: ObCacheTestTask(const int64_t tenant_id, const bool is_alloc, const int64_t alloc_size, const int64_t alloc_count, ObICacheTestStat* stat) : tenant_id_(tenant_id), @@ -198,7 +198,7 @@ class ObCacheTestTask { } TO_STRING_KV(K_(tenant_id), K_(is_alloc), K_(alloc_size), K_(alloc_count)); - public: +public: uint64_t tenant_id_; bool is_alloc_; // alloc or free int64_t alloc_size_; @@ -209,7 +209,7 @@ class ObCacheTestTask { }; class CacheTestStat : public ObICacheTestStat { - public: +public: CacheTestStat() : fail_count_(0), task_list_(NULL) {} virtual ~CacheTestStat() @@ -258,13 +258,13 @@ class CacheTestStat : public ObICacheTestStat { return oppo_task; } - private: +private: int64_t fail_count_; ObCacheTestTask* task_list_; }; class ObAllocatorStress : public share::ObThreadPool { - public: +public: ObAllocatorStress() : inited_(false), stat_(), queue_() {} virtual ~ObAllocatorStress() @@ -366,7 +366,7 @@ class ObAllocatorStress : public share::ObThreadPool { return &stat_; } - private: +private: bool inited_; CacheTestStat stat_; common::LightyQueue queue_; @@ -374,7 +374,7 @@ class ObAllocatorStress : public share::ObThreadPool { template class ObCacheStress : public share::ObThreadPool { - public: +public: typedef TestKVCacheKey TestKey; typedef TestKVCacheValue TestValue; @@ -445,7 +445,7 @@ class ObCacheStress : public share::ObThreadPool { return fail_count_; } - private: +private: bool inited_; uint64_t tenant_id_; int64_t put_count_; @@ -455,7 +455,7 @@ class ObCacheStress : public share::ObThreadPool { template class ObCacheGetStress : public share::ObThreadPool { - public: +public: typedef TestKVCacheKey TestKey; typedef TestKVCacheValue TestValue; @@ -539,7 +539,7 @@ class ObCacheGetStress : public share::ObThreadPool { return (double)hit_cnt / (double)kv_cnt_; } - private: +private: void do_monitor() { while (!has_set_stop()) { @@ -594,7 +594,7 @@ class ObCacheGetStress : public share::ObThreadPool { template class ObWorkingSetStress : public share::ObThreadPool { - public: +public: typedef TestKVCacheKey TestKey; typedef TestKVCacheValue TestValue; @@ -717,7 +717,7 @@ class ObWorkingSetStress : public share::ObThreadPool { return ws_.working_set_->get_limit(); } - private: +private: bool inited_; uint64_t tenant_id_; int64_t put_count_; diff --git a/unittest/share/cache/test_cache_working_set.cpp b/unittest/share/cache/test_cache_working_set.cpp index f1dce2102..84a37b838 100644 --- a/unittest/share/cache/test_cache_working_set.cpp +++ b/unittest/share/cache/test_cache_working_set.cpp @@ -28,7 +28,7 @@ namespace oceanbase { using namespace share; namespace common { class TestCacheWorkingSet : public ::testing::Test { - public: +public: static const int64_t K_SIZE = 10; static const int64_t V_SIZE = 16 * 1024; typedef TestKVCacheKey Key; @@ -39,7 +39,7 @@ class TestCacheWorkingSet : public ::testing::Test { virtual void SetUp(); virtual void TearDown(); - protected: +protected: uint64_t tenant_id_; int64_t mem_limit_; }; diff --git a/unittest/share/cache/test_kv_storecache.cpp b/unittest/share/cache/test_kv_storecache.cpp index c9a912fc5..73209f850 100644 --- a/unittest/share/cache/test_kv_storecache.cpp +++ b/unittest/share/cache/test_kv_storecache.cpp @@ -25,19 +25,19 @@ using namespace lib; using namespace observer; namespace common { class TestKVCache : public ::testing::Test { - public: +public: TestKVCache(); virtual ~TestKVCache(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestKVCache); - protected: +protected: // function members - protected: +protected: // data members int64_t tenant_id_; int64_t lower_mem_limit_; diff --git a/unittest/share/client_feedback/test_client_feedback.cpp b/unittest/share/client_feedback/test_client_feedback.cpp index 72adbcdac..8f15babd4 100644 --- a/unittest/share/client_feedback/test_client_feedback.cpp +++ b/unittest/share/client_feedback/test_client_feedback.cpp @@ -248,7 +248,7 @@ TEST(ObFeedbackManager, common) class ObForwardCompatibilityFeedbackPartitionLocation : public ObAbstractFeedbackObject { - public: +public: ObForwardCompatibilityFeedbackPartitionLocation() : ObAbstractFeedbackObject(PARTITION_LOCATION_FB_ELE) {} @@ -256,7 +256,7 @@ class ObForwardCompatibilityFeedbackPartitionLocation {} FB_OBJ_DEFINE_METHOD; - public: +public: uint64_t table_id_; int64_t partition_id_; }; @@ -312,7 +312,7 @@ TEST(ObFeedbackPartitionLocation, forward_compatibility) class ObBackwardCompatibilityFeedbackPartitionLocation : public ObAbstractFeedbackObject { - public: +public: ObBackwardCompatibilityFeedbackPartitionLocation() : ObAbstractFeedbackObject(PARTITION_LOCATION_FB_ELE) {} @@ -320,7 +320,7 @@ class ObBackwardCompatibilityFeedbackPartitionLocation {} FB_OBJ_DEFINE_METHOD; - public: +public: typedef common::ObSEArray ObTestFeedbackReplicaLocationArray; uint64_t table_id_; int64_t partition_id_; diff --git a/unittest/share/mock_mysql_proxy.h b/unittest/share/mock_mysql_proxy.h index d23c61caa..e0ac4cc32 100644 --- a/unittest/share/mock_mysql_proxy.h +++ b/unittest/share/mock_mysql_proxy.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace common { class MockMySQLProxy : public ObMySQLProxy { - public: +public: MOCK_METHOD2(read, int(ObMySQLProxy::ReadResult&, const char*)); MOCK_METHOD3(read, int(ObMySQLProxy::ReadResult&, const uint64_t, const char*)); diff --git a/unittest/share/mock_ob_rs_mgr.h b/unittest/share/mock_ob_rs_mgr.h index 096bd6be6..77ac0bdef 100644 --- a/unittest/share/mock_ob_rs_mgr.h +++ b/unittest/share/mock_ob_rs_mgr.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace share { class MockObRsMgr : public ObRsMgr { - public: +public: MOCK_CONST_METHOD1(get_master_root_server, int(common::ObAddr&)); virtual ~MockObRsMgr() {} diff --git a/unittest/share/partition_table/fake_part_property_getter.h b/unittest/share/partition_table/fake_part_property_getter.h index 650892410..c4d333156 100644 --- a/unittest/share/partition_table/fake_part_property_getter.h +++ b/unittest/share/partition_table/fake_part_property_getter.h @@ -73,7 +73,7 @@ const static common::ObRegion REGION3("region3"); // implement ObIPartPropertyGetter for unittesting. // all inlined for convenience. class FakePartPropertyGetter : public ObIPartPropertyGetter { - public: +public: static uint64_t& TEN() { static uint64_t id = 1; @@ -163,7 +163,7 @@ class FakePartPropertyGetter : public ObIPartPropertyGetter { return replicas_; } - private: +private: ReplicaArray replicas_; ObPartitionReplica::MemberList member_list_; }; diff --git a/unittest/share/partition_table/fake_schema_service.h b/unittest/share/partition_table/fake_schema_service.h index 80f046c3a..cb7fe073b 100644 --- a/unittest/share/partition_table/fake_schema_service.h +++ b/unittest/share/partition_table/fake_schema_service.h @@ -19,7 +19,7 @@ using namespace common; namespace share { namespace schema { class FakeSchemaService : public MockSchemaService { - public: +public: const static uint64_t TENANT_ID = 1; const static int64_t TABLE_COUNT = 256; FakeSchemaService() : null_table_id_(0), table_cnt_(0), version_(0) @@ -137,7 +137,7 @@ class FakeSchemaService : public MockSchemaService { //} virtual int check_table_exist(const uint64_t table_id, bool& exist); - public: +public: uint64_t null_table_id_; ObArray table_ids_; ObTableSchema tables_[TABLE_COUNT]; diff --git a/unittest/share/partition_table/test_location_update_task.cpp b/unittest/share/partition_table/test_location_update_task.cpp index 6f5f764c8..ad97eaa38 100644 --- a/unittest/share/partition_table/test_location_update_task.cpp +++ b/unittest/share/partition_table/test_location_update_task.cpp @@ -47,7 +47,7 @@ static const int64_t PART_NUM = 4; ObServerConfig& config = ObServerConfig::get_instance(); class MockLocalityManager : public ObILocalityManager { - public: +public: struct ServerInfo { ServerInfo() : server_(), is_local_(false) {} @@ -80,13 +80,13 @@ class MockLocalityManager : public ObILocalityManager { common::ObArray server_info_; }; class TestLocationUpdateTask : public ::testing::Test { - public: +public: TestLocationUpdateTask(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: void basic_test(const uint64_t tid); void whole_table_test(const uint64_t tid); void check_location(const uint64_t tid, const int64_t pid, const ObPartitionLocation& location); diff --git a/unittest/share/partition_table/test_partition_location_cache.cpp b/unittest/share/partition_table/test_partition_location_cache.cpp index 7dce78cd9..ce4bf99d1 100644 --- a/unittest/share/partition_table/test_partition_location_cache.cpp +++ b/unittest/share/partition_table/test_partition_location_cache.cpp @@ -58,7 +58,7 @@ ObServerConfig& config = ObServerConfig::get_instance(); DBInitializer db_initer; class ObPartitionTableEnvironment : public ::testing::Environment { - public: +public: ObPartitionTableEnvironment(); virtual ~ObPartitionTableEnvironment() {} @@ -69,7 +69,7 @@ class ObPartitionTableEnvironment : public ::testing::Environment { }; class MockLocalityManager : public ObILocalityManager { - public: +public: struct ServerInfo { ServerInfo() : server_(), is_local_(false) {} @@ -103,7 +103,7 @@ class MockLocalityManager : public ObILocalityManager { }; class MockPartitionTableOperator : public ObPartitionTableOperator { - public: +public: MockPartitionTableOperator(ObIPartPropertyGetter& prop_getter) : ObPartitionTableOperator(prop_getter) {} @@ -111,13 +111,13 @@ class MockPartitionTableOperator : public ObPartitionTableOperator { }; class TestPartitionLocationCache : public ::testing::Test { - public: +public: TestPartitionLocationCache(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: uint64_t TT(const uint64_t tid) { return is_sys_table(tid) ? OB_SYS_TENANT_ID : 2; diff --git a/unittest/share/partition_table/test_partition_location_cache_2.cpp b/unittest/share/partition_table/test_partition_location_cache_2.cpp index 3e21e82bb..74f89a1ea 100644 --- a/unittest/share/partition_table/test_partition_location_cache_2.cpp +++ b/unittest/share/partition_table/test_partition_location_cache_2.cpp @@ -57,7 +57,7 @@ ObServerConfig& config = ObServerConfig::get_instance(); DBInitializer db_initer; class MockLocalityManager : public ObILocalityManager { - public: +public: struct ServerInfo { ServerInfo() : server_(), is_local_(false) {} @@ -91,7 +91,7 @@ class MockLocalityManager : public ObILocalityManager { }; class MockPartitionTableOperator : public ObPartitionTableOperator { - public: +public: MockPartitionTableOperator(ObIPartPropertyGetter& prop_getter) : ObPartitionTableOperator(prop_getter) {} @@ -99,13 +99,13 @@ class MockPartitionTableOperator : public ObPartitionTableOperator { }; class TestPartitionLocationCache : public ::testing::Test { - public: +public: TestPartitionLocationCache(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: uint64_t TT(const uint64_t tid) { return is_sys_table(tid) ? OB_SYS_TENANT_ID : 2; diff --git a/unittest/share/partition_table/test_partition_table_iterator.cpp b/unittest/share/partition_table/test_partition_table_iterator.cpp index 3435ea53f..8c4ad1a1e 100644 --- a/unittest/share/partition_table/test_partition_table_iterator.cpp +++ b/unittest/share/partition_table/test_partition_table_iterator.cpp @@ -48,7 +48,7 @@ using ::testing::Invoke; using ::testing::Return; ObServerConfig& config = ObServerConfig::get_instance(); class TestPartitionTableIterator : public ::testing::Test { - public: +public: TestPartitionTableIterator() : operator_(prop_getter_) {} @@ -70,7 +70,7 @@ class TestPartitionTableIterator : public ::testing::Test { int gen_tenant_space_schema(uint64_t tenant_id); int release_tenant_space_schema(uint64_t tenant_id); - protected: +protected: DBInitializer db_initer_; FakePartPropertyGetter prop_getter_; MockObCommonRpcProxy rpc_proxy_; @@ -1051,12 +1051,12 @@ TEST_F(TestPartitionTableIterator, all_table_partition) } class MockPartitionInfo : public ObPartitionInfo { - public: +public: MOCK_METHOD1(filter, int(const ObIReplicaFilter&)); }; class MockPartitionTableOperator : public ObPartitionTableOperator { - public: +public: MockPartitionTableOperator(ObIPartPropertyGetter& prop_getter, ObPartitionTableOperator& pt_operator) : ObPartitionTableOperator(prop_getter), pt_operator_(pt_operator), return_error_(false) {} @@ -1079,7 +1079,7 @@ class MockPartitionTableOperator : public ObPartitionTableOperator { return_error_ = return_error; } - private: +private: ObPartitionTableOperator& pt_operator_; bool return_error_; }; diff --git a/unittest/share/partition_table/test_partition_table_operator.cpp b/unittest/share/partition_table/test_partition_table_operator.cpp index 64b02f102..e7dd2c2c8 100644 --- a/unittest/share/partition_table/test_partition_table_operator.cpp +++ b/unittest/share/partition_table/test_partition_table_operator.cpp @@ -40,7 +40,7 @@ static int64_t& PID = FakePartPropertyGetter::PID(); ObServerConfig& config = ObServerConfig::get_instance(); class TestPartitionTableOperator : public ::testing::Test { - public: +public: TestPartitionTableOperator() : operator_(prop_getter_) {} @@ -48,7 +48,7 @@ class TestPartitionTableOperator : public ::testing::Test { virtual void TearDown() {} - protected: +protected: DBInitializer db_initer_; FakePartPropertyGetter prop_getter_; MockObCommonRpcProxy rpc_proxy_; diff --git a/unittest/share/partition_table/test_persistent_partition_table.cpp b/unittest/share/partition_table/test_persistent_partition_table.cpp index 4ed5131a2..715796248 100644 --- a/unittest/share/partition_table/test_persistent_partition_table.cpp +++ b/unittest/share/partition_table/test_persistent_partition_table.cpp @@ -49,7 +49,7 @@ const static int64_t PID = FakePartPropertyGetter::PID(); }) class FakePartitionService : public ObPartitionService { - public: +public: FakePartitionService() {} virtual ~FakePartitionService() @@ -63,7 +63,7 @@ class FakePartitionService : public ObPartitionService { }; class TestPersistentPartitionTable : public ::testing::Test { - public: +public: TestPersistentPartitionTable() : pt_(prop_getter_) {} @@ -75,7 +75,7 @@ class TestPersistentPartitionTable : public ::testing::Test { void update_leader_test(uint64_t table_id); void to_leader_time_test(uint64_t table_id); - protected: +protected: DBInitializer db_initer_; FakePartPropertyGetter prop_getter_; ObPersistentPartitionTable pt_; diff --git a/unittest/share/partition_table/test_rpc_partition_table.cpp b/unittest/share/partition_table/test_rpc_partition_table.cpp index 908e67114..25f6f9cd9 100644 --- a/unittest/share/partition_table/test_rpc_partition_table.cpp +++ b/unittest/share/partition_table/test_rpc_partition_table.cpp @@ -44,7 +44,7 @@ int64_t& PID = FakePartPropertyGetter::PID(); ObServerConfig& config = ObServerConfig::get_instance(); class TestRpcPartitionTable : public ::testing::Test { - public: +public: TestRpcPartitionTable(); virtual ~TestRpcPartitionTable() {} @@ -53,7 +53,7 @@ class TestRpcPartitionTable : public ::testing::Test { virtual void TearDown() {} - protected: +protected: int get_wrapper(ObPartitionInfo& part_info, const ObRpcOpts& opts); int report_wrapper(const ObPartitionReplica& replica, const ObRpcOpts& opts); int remove_wrapper(const ObAddr& server, const ObRpcOpts& opts); diff --git a/unittest/share/redolog/test_log_disk_manager.cpp b/unittest/share/redolog/test_log_disk_manager.cpp index 49dceedf0..713fa5f50 100644 --- a/unittest/share/redolog/test_log_disk_manager.cpp +++ b/unittest/share/redolog/test_log_disk_manager.cpp @@ -18,7 +18,7 @@ namespace oceanbase { namespace common { class TestLogDiskMgr : public ::testing::Test { - public: +public: TestLogDiskMgr() {} virtual ~TestLogDiskMgr() @@ -26,7 +26,7 @@ class TestLogDiskMgr : public ::testing::Test { virtual void SetUp(); virtual void TearDown(); - public: +public: const static int64_t LOG_FILE_SIZE = 4 * 1024 * 1024; const static int DIO_WRITE_ALIGN_SIZE = 512; diff --git a/unittest/share/redolog/test_log_file_store.cpp b/unittest/share/redolog/test_log_file_store.cpp index 9abfb3172..41573375d 100644 --- a/unittest/share/redolog/test_log_file_store.cpp +++ b/unittest/share/redolog/test_log_file_store.cpp @@ -22,7 +22,7 @@ using namespace share; namespace common { class TestLogFileStore : public ::testing::Test { - public: +public: TestLogFileStore() {} virtual ~TestLogFileStore() @@ -30,7 +30,7 @@ class TestLogFileStore : public ::testing::Test { virtual void SetUp(); virtual void TearDown(); - public: +public: const static int64_t LOG_FILE_SIZE = 4 * 1024 * 1024; const static int DIO_WRITE_ALIGN_SIZE = 512; diff --git a/unittest/share/scheduler/test_dag_scheduler.cpp b/unittest/share/scheduler/test_dag_scheduler.cpp index 0007f1515..c9a104277 100644 --- a/unittest/share/scheduler/test_dag_scheduler.cpp +++ b/unittest/share/scheduler/test_dag_scheduler.cpp @@ -47,7 +47,7 @@ using namespace omt; namespace unittest { class TestAddTask : public ObITask { - public: +public: TestAddTask() : ObITask(ObITaskType::TASK_TYPE_UT), counter_(NULL), adder_(), seq_(0), task_cnt_(0), sleep_us_(0) {} ~TestAddTask() @@ -100,19 +100,19 @@ class TestAddTask : public ObITask { } VIRTUAL_TO_STRING_KV(KP_(counter), K_(seq), K_(task_cnt)); - private: +private: int64_t* counter_; int64_t adder_; int64_t seq_; int64_t task_cnt_; int sleep_us_; - private: +private: DISALLOW_COPY_AND_ASSIGN(TestAddTask); }; class TestMulTask : public ObITask { - public: +public: TestMulTask() : ObITask(ObITaskType::TASK_TYPE_UT), counter_(NULL), sleep_us_(0) {} ~TestMulTask() @@ -133,16 +133,16 @@ class TestMulTask : public ObITask { } VIRTUAL_TO_STRING_KV(KP_(counter)); - private: +private: int64_t* counter_; int sleep_us_; - private: +private: DISALLOW_COPY_AND_ASSIGN(TestMulTask); }; class AtomicOperator { - public: +public: AtomicOperator() : v_(0) {} AtomicOperator(int64_t v) : v_(v) @@ -168,7 +168,7 @@ class AtomicOperator { v_ = 0; } - private: +private: lib::ObMutex lock_; int64_t v_; }; @@ -176,7 +176,7 @@ class AtomicOperator { static const int64_t SLEEP_SLICE = 100; class AtomicMulTask : public ObITask { - public: +public: AtomicMulTask() : ObITask(ObITask::TASK_TYPE_UT), seq_(0), cnt_(0), error_seq_(-1), op_(NULL), sleep_us_(0) {} int init(int64_t seq, int64_t cnt, AtomicOperator& op, int sleep_us = 0, int64_t error_seq = -1) @@ -227,7 +227,7 @@ class AtomicMulTask : public ObITask { } VIRTUAL_TO_STRING_KV("type", "AtomicMul", K(*dag_), K_(seq), K_(cnt), KP_(op), K_(error_seq), K_(sleep_us)); - private: +private: int64_t seq_; int64_t cnt_; int64_t error_seq_; @@ -236,7 +236,7 @@ class AtomicMulTask : public ObITask { }; class AtomicIncTask : public ObITask { - public: +public: AtomicIncTask() : ObITask(ObITask::TASK_TYPE_UT), seq_(0), cnt_(0), error_seq_(-1), op_(NULL), sleep_us_(0) {} int init(int64_t seq, int64_t cnt, AtomicOperator& op, int sleep_us = 0, int64_t error_seq = -1) @@ -287,7 +287,7 @@ class AtomicIncTask : public ObITask { } VIRTUAL_TO_STRING_KV("type", "AtomicInc", K(*dag_), K_(seq), K_(cnt), KP_(op), K_(error_seq), K_(sleep_us)); - private: +private: int64_t seq_; int64_t cnt_; int64_t error_seq_; @@ -317,7 +317,7 @@ void wait_scheduler(ObDagScheduler& scheduler) } class TestDag : public ObIDag { - public: +public: TestDag() : ObIDag(ObIDagType::DAG_TYPE_UT, ObIDag::DAG_PRIO_SSTABLE_MINOR_MERGE), id_(0), @@ -400,7 +400,7 @@ class TestDag : public ObIDag { } VIRTUAL_TO_STRING_KV(K_(is_inited), K_(type), K_(id), K(task_list_.get_size())); - protected: +protected: int64_t id_; int64_t expect_; int expect_ret_; @@ -408,34 +408,34 @@ class TestDag : public ObIDag { bool running_; lib::ThreadPool* tester_; - private: +private: DISALLOW_COPY_AND_ASSIGN(TestDag); }; class TestLPDag : public TestDag { - public: +public: TestLPDag() : TestDag(ObIDagType::DAG_TYPE_CREATE_INDEX, ObIDag::DAG_PRIO_CREATE_INDEX) {} - private: +private: DISALLOW_COPY_AND_ASSIGN(TestLPDag); }; class TestMPDag : public TestDag { - public: +public: TestMPDag() : TestDag(ObIDagType::DAG_TYPE_SSTABLE_MAJOR_MERGE, ObIDag::DAG_PRIO_SSTABLE_MAJOR_MERGE) {} - private: +private: DISALLOW_COPY_AND_ASSIGN(TestMPDag); }; class TestHPDag : public TestDag { - public: +public: TestHPDag() : TestDag(ObIDagType::DAG_TYPE_SSTABLE_MINOR_MERGE, ObIDag::DAG_PRIO_SSTABLE_MINOR_MERGE) {} - private: +private: DISALLOW_COPY_AND_ASSIGN(TestHPDag); }; @@ -443,7 +443,7 @@ class TestPrepareTask : public ObITask { static const int64_t inc_task_cnt = 8; static const int64_t mul_task_cnt = 6; - public: +public: TestPrepareTask() : ObITask(ObITask::TASK_TYPE_UT), dag_id_(0), is_error_(false), sleep_us_(0), op_(NULL) {} @@ -512,7 +512,7 @@ class TestPrepareTask : public ObITask { return ret; } - private: +private: int64_t dag_id_; bool is_error_; int sleep_us_; @@ -520,7 +520,7 @@ class TestPrepareTask : public ObITask { }; class TestCyclePrepare : public ObITask { - public: +public: TestCyclePrepare() : ObITask(ObITask::TASK_TYPE_UT), op_(NULL) {} int init(AtomicOperator* op = NULL) @@ -580,14 +580,14 @@ class TestCyclePrepare : public ObITask { return ret; } - private: +private: AtomicOperator* op_; }; class DagSchedulerStressTester : public lib::ThreadPool { static const int64_t STRESS_THREAD_NUM = 16; - public: +public: DagSchedulerStressTester() : test_time_(0) {} @@ -699,7 +699,7 @@ class DagSchedulerStressTester : public lib::ThreadPool { return ATOMIC_FAA(&counter_, 1); } - private: +private: static int64_t counter_; int64_t test_time_; }; @@ -707,7 +707,7 @@ class DagSchedulerStressTester : public lib::ThreadPool { int64_t DagSchedulerStressTester::counter_ = 0; class TestDagScheduler : public ::testing::Test { - public: +public: TestDagScheduler() {} ~TestDagScheduler() @@ -724,7 +724,7 @@ class TestDagScheduler : public ::testing::Test { void TearDown() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(TestDagScheduler); }; diff --git a/unittest/share/schema/db_initializer.h b/unittest/share/schema/db_initializer.h index ed42277e7..7d6e5d794 100644 --- a/unittest/share/schema/db_initializer.h +++ b/unittest/share/schema/db_initializer.h @@ -35,7 +35,7 @@ namespace schema { // 2. create OceanBase system table schema in mysql server. // class DBInitializer { - public: +public: DBInitializer() {} virtual ~DBInitializer(); @@ -59,7 +59,7 @@ class DBInitializer { return common::ObServerConfig::get_instance(); } - private: +private: struct DBConfig { std::string host_; int port_; diff --git a/unittest/share/schema/mock_multi_version_schema_service_for_fallback.h b/unittest/share/schema/mock_multi_version_schema_service_for_fallback.h index b1fd66a8d..cc3f95b9b 100644 --- a/unittest/share/schema/mock_multi_version_schema_service_for_fallback.h +++ b/unittest/share/schema/mock_multi_version_schema_service_for_fallback.h @@ -24,7 +24,7 @@ namespace share { namespace schema { class MockMultiVersionSchemaServiceForFallback : public ObMultiVersionSchemaService { - public: +public: MockMultiVersionSchemaServiceForFallback() { baseline_schema_version_ = 0; diff --git a/unittest/share/schema/mock_schema_fetcher.h b/unittest/share/schema/mock_schema_fetcher.h index 5255fab93..b40473339 100644 --- a/unittest/share/schema/mock_schema_fetcher.h +++ b/unittest/share/schema/mock_schema_fetcher.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace share { namespace schema { class MockObSchemaFetcher : public ObSchemaFetcher { - public: +public: MOCK_METHOD2(init, int(ObSchemaService*, common::ObISQLClient*)); MOCK_METHOD5(fetch_schema, int(ObSchemaType, uint64_t, int64_t, common::ObIAllocator&, ObSchema*&)); MOCK_METHOD4(fetch_tenant_schema, int(uint64_t, int64_t, common::ObIAllocator&, ObTenantSchema*&)); diff --git a/unittest/share/schema/mock_schema_service.h b/unittest/share/schema/mock_schema_service.h index 68ef52480..25d0bc160 100644 --- a/unittest/share/schema/mock_schema_service.h +++ b/unittest/share/schema/mock_schema_service.h @@ -32,7 +32,7 @@ namespace share { namespace schema { class MockObTableSchema : public ObTableSchema { - public: +public: MockObTableSchema(common::ObIAllocator* allocator) : ObTableSchema(allocator) {} MockObTableSchema() @@ -52,7 +52,7 @@ class MockSchemaService : public ObMultiVersionSchemaService { typedef common::hash::ObHashMap NoSwapCache; - public: +public: MockSchemaService() {} virtual ~MockSchemaService() @@ -311,7 +311,7 @@ class MockSchemaService : public ObMultiVersionSchemaService { return ret; } - private: +private: int convert_to_simple_schema(const ObTenantSchema& schema, ObSimpleTenantSchema& simple_schema) { int ret = OB_SUCCESS; @@ -441,7 +441,7 @@ class MockSchemaService : public ObMultiVersionSchemaService { return ret; } - private: +private: ObSchemaMgr mgr_; NoSwapCache cache_; }; diff --git a/unittest/share/schema/ob_schema_test_utils.cpp b/unittest/share/schema/ob_schema_test_utils.cpp index a8282d1f9..86b599e36 100644 --- a/unittest/share/schema/ob_schema_test_utils.cpp +++ b/unittest/share/schema/ob_schema_test_utils.cpp @@ -342,7 +342,7 @@ bool operator<(const ObDatabaseSchema& lv, const ObDatabaseSchema& rv) }; class ObSchemaTestUtils { - public: +public: static void assert_view_equal(const ObViewSchema& l_view, const ObViewSchema& r_view); static void assert_expire_condition_equal(const ObString& l_ec, const ObString& r_ec); static void assert_tg_equal(const ObTablegroupSchema& l_tg, const ObTablegroupSchema& r_tg); diff --git a/unittest/share/schema/schema_test_utils.h b/unittest/share/schema/schema_test_utils.h index ba35f35f8..6ecac1f76 100644 --- a/unittest/share/schema/schema_test_utils.h +++ b/unittest/share/schema/schema_test_utils.h @@ -87,7 +87,7 @@ namespace schema { table_priv.set_schema_version(schema_version); class SchemaTestUtils { - public: +public: SchemaTestUtils() {} virtual ~SchemaTestUtils() @@ -140,7 +140,7 @@ class SchemaTestUtils { a.get_priv_set() == b.get_priv_set() && a.get_schema_version() == b.get_schema_version(); } - private: +private: }; } // namespace schema diff --git a/unittest/share/schema/test_ddl.cpp b/unittest/share/schema/test_ddl.cpp index 278c5a4e5..910f32df8 100644 --- a/unittest/share/schema/test_ddl.cpp +++ b/unittest/share/schema/test_ddl.cpp @@ -123,7 +123,7 @@ static uint64_t& TID = FakePartPropertyGetter::TID(); static int64_t& PID = FakePartPropertyGetter::PID(); class ObFakeCB : public ObIStatusChangeCallback { - public: +public: ObFakeCB() {} int wakeup_balancer() @@ -151,7 +151,7 @@ class ObFakeCB : public ObIStatusChangeCallback { } }; class MockLocalityManager : public ObILocalityManager { - public: +public: struct ServerInfo { ServerInfo() : server_(), is_local_(false) {} @@ -185,7 +185,7 @@ class MockLocalityManager : public ObILocalityManager { }; class ObFakeServerChangeCB : public ObIServerChangeCallback { - public: +public: ObFakeServerChangeCB() {} virtual ~ObFakeServerChangeCB() @@ -204,17 +204,17 @@ class ObFakeServerChangeCB : public ObIServerChangeCallback { } class TestDDL : public ::testing::Test { - public: +public: TestDDL(); virtual ~TestDDL(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestDDL); - protected: +protected: // function members void fill_tenant_schema(const uint64_t tenant_id, const char* tenant_name, ObTenantSchema& tenant_schema); int create_tenant(ObMySQLTransaction& trans, const uint64_t tenant_id); @@ -261,7 +261,7 @@ class TestDDL : public ::testing::Test { void do_print_tenant_schema(const uint64_t tenant_id, std::ofstream& of_tenant); void do_print_schema(ObStmt* stmt, std::ofstream& of_tmp); - protected: +protected: // table id // uint64_t next_user_table_id_; hash::ObHashMap next_user_table_id_map_; diff --git a/unittest/share/schema/test_fallback_schema_mgr.cpp b/unittest/share/schema/test_fallback_schema_mgr.cpp index 40dff0a9a..718cd02d9 100644 --- a/unittest/share/schema/test_fallback_schema_mgr.cpp +++ b/unittest/share/schema/test_fallback_schema_mgr.cpp @@ -21,7 +21,7 @@ namespace schema { using namespace common; class TestFallbackSchemaMgr : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() @@ -58,7 +58,7 @@ TEST_F(TestFallbackSchemaMgr, fallback_schema_for_liboblog) static int64_t global_version = 1; class Worker : public share::ObThreadPool { - public: +public: void run1() { diff --git a/unittest/share/schema/test_priv_mgr.cpp b/unittest/share/schema/test_priv_mgr.cpp index bf57a8b53..63de06538 100644 --- a/unittest/share/schema/test_priv_mgr.cpp +++ b/unittest/share/schema/test_priv_mgr.cpp @@ -26,12 +26,12 @@ using namespace common; namespace share { namespace schema { class TestPrivMgr : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} - protected: +protected: ObPrivMgr priv_mgr_; }; diff --git a/unittest/share/schema/test_schema_cache.cpp b/unittest/share/schema/test_schema_cache.cpp index 4a7426d94..f4ace00d9 100644 --- a/unittest/share/schema/test_schema_cache.cpp +++ b/unittest/share/schema/test_schema_cache.cpp @@ -31,7 +31,7 @@ namespace share { namespace schema { class GetBatchSchemasFuncs0 { - public: +public: // return non schema int get_batch_tenants(const int64_t schema_version, ObArray& tenant_ids, ObISQLClient& client, ObIArray& tenant_infos) @@ -102,7 +102,7 @@ class GetBatchSchemasFuncs0 { }; class GetBatchSchemasFuncs1 { - public: +public: // return one schema int get_batch_tenants(const int64_t schema_version, ObArray& tenant_ids, ObISQLClient& client, ObIArray& tenant_infos) @@ -197,11 +197,11 @@ class GetBatchSchemasFuncs1 { }; class TestSchemaCache : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown(); - private: +private: GetBatchSchemasFuncs0 get_batch_schemas_funcs0; GetBatchSchemasFuncs1 get_batch_schemas_funcs1; }; @@ -399,7 +399,7 @@ using ::testing::_; using ::testing::Invoke; using ::testing::Return; class MockSchemaServiceSQLImpl : public ObSchemaServiceSQLImpl { - public: +public: MOCK_METHOD4(get_batch_tenants, int(const int64_t, ObArray&, ObISQLClient&, ObIArray&)); MOCK_METHOD4(get_batch_users, int(const int64_t, ObArray&, ObISQLClient&, ObIArray&)); MOCK_METHOD4(get_batch_databases, int(const int64_t, ObArray&, ObISQLClient&, ObIArray&)); diff --git a/unittest/share/schema/test_schema_mgr_cache.cpp b/unittest/share/schema/test_schema_mgr_cache.cpp index 8a3702e7b..3acc1d86b 100644 --- a/unittest/share/schema/test_schema_mgr_cache.cpp +++ b/unittest/share/schema/test_schema_mgr_cache.cpp @@ -110,7 +110,7 @@ static void consume(ObSchemaMgrCache* mgr_cache) } class Consumer : public share::ObThreadPool { - public: +public: void run1() { @@ -120,7 +120,7 @@ class Consumer : public share::ObThreadPool { }; class Refresher : public share::ObThreadPool { - public: +public: void run1() { @@ -164,7 +164,7 @@ TEST_F(TestSchemaMgrCache, multithread_put_and_get) } class Refresher2 : public share::ObThreadPool { - public: +public: void run1() { diff --git a/unittest/share/schema/test_schema_service.cpp b/unittest/share/schema/test_schema_service.cpp index db70c7c7c..014550244 100644 --- a/unittest/share/schema/test_schema_service.cpp +++ b/unittest/share/schema/test_schema_service.cpp @@ -30,7 +30,7 @@ using namespace common; const int64_t BUFF_SIZE = 10240; class TestSchemaService : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/share/schema/test_schema_service_rpc_proxy.cpp b/unittest/share/schema/test_schema_service_rpc_proxy.cpp index ac3475861..ae7f09932 100644 --- a/unittest/share/schema/test_schema_service_rpc_proxy.cpp +++ b/unittest/share/schema/test_schema_service_rpc_proxy.cpp @@ -41,7 +41,7 @@ using namespace std; #define IO_CNT 1 class QHandler : public ObiReqQHandler { - public: +public: QHandler(ObMultiVersionSchemaService* schema_service) : mp_(schema_service) { mp_.init(); @@ -72,14 +72,14 @@ class QHandler : public ObiReqQHandler { return true; } - private: +private: ObGetAllSchemaP mp_; ObRpcSessionHandler shandler_; ObRpcReqContext ctx_; }; class ObTestDeliver : public rpc::frame::ObReqDeliver { - public: +public: ObTestDeliver(ObMultiVersionSchemaService* schema_service) : handler_(schema_service) {} int init() @@ -101,13 +101,13 @@ class ObTestDeliver : public rpc::frame::ObReqDeliver { queue_.wait(); } - protected: +protected: ObReqQueueThread queue_; QHandler handler_; }; class TestSchemaServiceRpcProxy : public ::testing::Test { - public: +public: TestSchemaServiceRpcProxy() : port_(3100), handler_(server_), server_(&schema_service_), transport_(NULL) {} @@ -199,7 +199,7 @@ class TestSchemaServiceRpcProxy : public ::testing::Test { return transport_->send(req, res); } - protected: +protected: int port_; rpc::frame::ObNetEasy net_; obrpc::ObRpcHandler handler_; diff --git a/unittest/share/schema/test_schema_utils.cpp b/unittest/share/schema/test_schema_utils.cpp index d09a1c573..fff5db950 100644 --- a/unittest/share/schema/test_schema_utils.cpp +++ b/unittest/share/schema/test_schema_utils.cpp @@ -32,10 +32,10 @@ namespace share { namespace schema { class TestSchemaUtils : public ::testing::Test { - public: +public: virtual void SetUp(); - private: +private: }; void TestSchemaUtils::SetUp() diff --git a/unittest/share/schema/test_server_schema_service.cpp b/unittest/share/schema/test_server_schema_service.cpp index 9cbb943e5..a24115ba0 100644 --- a/unittest/share/schema/test_server_schema_service.cpp +++ b/unittest/share/schema/test_server_schema_service.cpp @@ -25,7 +25,7 @@ namespace share { namespace schema { using namespace common; class TestServerSchemaService : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} diff --git a/unittest/share/schema/test_table_dml_param.cpp b/unittest/share/schema/test_table_dml_param.cpp index 31c221396..2a2759761 100644 --- a/unittest/share/schema/test_table_dml_param.cpp +++ b/unittest/share/schema/test_table_dml_param.cpp @@ -26,7 +26,7 @@ class ObOldTableSchemaParam { typedef common::ObFixedArray Columns; OB_UNIS_VERSION_V(1); - public: +public: explicit ObOldTableSchemaParam(common::ObIAllocator& allocator); virtual ~ObOldTableSchemaParam(); void reset(); diff --git a/unittest/share/schema/test_table_iter.cpp b/unittest/share/schema/test_table_iter.cpp index 7c4d48a7a..e1d74d0eb 100644 --- a/unittest/share/schema/test_table_iter.cpp +++ b/unittest/share/schema/test_table_iter.cpp @@ -27,7 +27,7 @@ using namespace common; namespace share { namespace schema { class TestTableIterator : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} diff --git a/unittest/share/test_alive_server_tracer.cpp b/unittest/share/test_alive_server_tracer.cpp index 11fc4fb18..264f8f98d 100644 --- a/unittest/share/test_alive_server_tracer.cpp +++ b/unittest/share/test_alive_server_tracer.cpp @@ -79,7 +79,7 @@ TEST(TestAliveServerMap, all) } class ServerList { - public: +public: int fetch_alive_server(const ObFetchAliveServerArg&, ObFetchAliveServerResult& res, const ObRpcOpts&) { return res.server_list_.assign(server_list_); diff --git a/unittest/share/test_all_cluster_proxy.cpp b/unittest/share/test_all_cluster_proxy.cpp index 4242439fe..7ad14b11f 100644 --- a/unittest/share/test_all_cluster_proxy.cpp +++ b/unittest/share/test_all_cluster_proxy.cpp @@ -22,12 +22,12 @@ using namespace common; using namespace share::schema; class TestAllClusterProxy : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} - protected: +protected: DBInitializer db_initer_; }; diff --git a/unittest/share/test_async_task_queue.cpp b/unittest/share/test_async_task_queue.cpp index 66ee14007..dbbd10c07 100644 --- a/unittest/share/test_async_task_queue.cpp +++ b/unittest/share/test_async_task_queue.cpp @@ -20,7 +20,7 @@ using namespace common; namespace share { class ObFakeTask : public ObAsyncTask { - public: +public: ObFakeTask(const bool copy_success, const bool process_success) : copy_success_(copy_success), process_success_(process_success) {} @@ -34,7 +34,7 @@ class ObFakeTask : public ObAsyncTask { } ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - protected: +protected: bool copy_success_; bool process_success_; }; diff --git a/unittest/share/test_core_table_proxy.cpp b/unittest/share/test_core_table_proxy.cpp index 4e2080393..26c3de8d2 100644 --- a/unittest/share/test_core_table_proxy.cpp +++ b/unittest/share/test_core_table_proxy.cpp @@ -24,17 +24,17 @@ using namespace common; using namespace share::schema; class TestCoreTableProxy : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} - protected: +protected: int insert_data(const char* table, int64_t cnt); void verify_data(ObCoreTableProxy& kv); - protected: +protected: schema::DBInitializer initer_; }; diff --git a/unittest/share/test_datum_cmp.cpp b/unittest/share/test_datum_cmp.cpp index 9683dc7dd..e75fa35f1 100644 --- a/unittest/share/test_datum_cmp.cpp +++ b/unittest/share/test_datum_cmp.cpp @@ -43,7 +43,7 @@ static bool is_equal_content(const char* tmp_file, const char* result_file) } class ObTestDatumCmp : public ::testing::Test { - public: +public: ObTestDatumCmp() {} ~ObTestDatumCmp() @@ -53,7 +53,7 @@ class ObTestDatumCmp : public ::testing::Test { virtual void TearDown() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTestDatumCmp); }; diff --git a/unittest/share/test_debug_sync.cpp b/unittest/share/test_debug_sync.cpp index 61b6ab5ad..b9390e463 100644 --- a/unittest/share/test_debug_sync.cpp +++ b/unittest/share/test_debug_sync.cpp @@ -203,7 +203,7 @@ TEST(common, ObDSSessionActions) } class Timer { - public: +public: Timer() { begin_ = ::oceanbase::common::ObTimeUtility::current_time(); @@ -213,7 +213,7 @@ class Timer { return ::oceanbase::common::ObTimeUtility::current_time() - begin_; } - public: +public: int64_t begin_; }; diff --git a/unittest/share/test_di_perf.cpp b/unittest/share/test_di_perf.cpp index a3c6b5749..e5b69a10c 100644 --- a/unittest/share/test_di_perf.cpp +++ b/unittest/share/test_di_perf.cpp @@ -46,16 +46,16 @@ using namespace share::schema; namespace observer { class MockObAllVirtualSysStat : public oceanbase::observer::ObAllVirtualSysStat { - public: +public: virtual int get_next_row(common::ObNewRow*& row); }; class MockObAllLatch : public oceanbase::observer::ObAllLatch { - public: +public: virtual int get_next_row(common::ObNewRow*& row); virtual int set_ip(common::ObAddr* addr); - private: +private: common::ObString ipstr_; int32_t port_; }; @@ -320,7 +320,7 @@ int MockObAllLatch::get_next_row(ObNewRow*& row) } class TestDIPerf : public ::testing::Test { - public: +public: TestDIPerf(); virtual ~TestDIPerf() {} @@ -328,7 +328,7 @@ class TestDIPerf : public ::testing::Test { virtual void TearDown() {} - protected: +protected: DBInitializer db_initer_; ObSchemaServiceSQLImpl schema_service_; ObMultiVersionSchemaService multi_schema_service_; diff --git a/unittest/share/test_global_stat_proxy.cpp b/unittest/share/test_global_stat_proxy.cpp index c388a8e38..331e00745 100644 --- a/unittest/share/test_global_stat_proxy.cpp +++ b/unittest/share/test_global_stat_proxy.cpp @@ -23,12 +23,12 @@ using namespace common; using namespace share::schema; class TestGlobalStatProxy : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} - protected: +protected: schema::DBInitializer initer_; }; diff --git a/unittest/share/test_inner_config_root_addr.cpp b/unittest/share/test_inner_config_root_addr.cpp index 7ff094faa..88fde89a8 100644 --- a/unittest/share/test_inner_config_root_addr.cpp +++ b/unittest/share/test_inner_config_root_addr.cpp @@ -24,14 +24,14 @@ using testing::_; using ::testing::Return; class TestInnerConfigRootAddr : public ::testing::Test { - public: +public: TestInnerConfigRootAddr(); ~TestInnerConfigRootAddr(); virtual void SetUp(); virtual void TearDown() {} - protected: +protected: ObServerConfig& config_; MockMySQLProxy sql_proxy_; ObInnerConfigRootAddr ic_; diff --git a/unittest/share/test_latch.cpp b/unittest/share/test_latch.cpp index 0036f6b43..69c56b472 100644 --- a/unittest/share/test_latch.cpp +++ b/unittest/share/test_latch.cpp @@ -23,7 +23,7 @@ namespace oceanbase { namespace common { class TestLatchStress : public share::ObThreadPool { - public: +public: TestLatchStress(); virtual ~TestLatchStress(); virtual void run1(); diff --git a/unittest/share/test_lease_struct.cpp b/unittest/share/test_lease_struct.cpp index f5ac0fcc3..bf9a93d4a 100644 --- a/unittest/share/test_lease_struct.cpp +++ b/unittest/share/test_lease_struct.cpp @@ -39,7 +39,7 @@ void try_reset(T&, const FalseType&) } class TestLeaseStruct : public ::testing::Test { - protected: +protected: template T* alloc(void) { diff --git a/unittest/share/test_locality_priority.cpp b/unittest/share/test_locality_priority.cpp index 446b9367b..59f58fa37 100644 --- a/unittest/share/test_locality_priority.cpp +++ b/unittest/share/test_locality_priority.cpp @@ -19,17 +19,17 @@ namespace share { using namespace common; class TestLocalityPriority : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown(); void get_primary_region_prioriry(const char* primary_zone, const common::ObIArray& locality_region_array, common::ObIArray& tenant_locality_region); - private: +private: typedef common::ObFixedLengthString Zone; - protected: +protected: common::ObSEArray locality_region_array_; }; diff --git a/unittest/share/test_national_encrypt_algorithm.cpp b/unittest/share/test_national_encrypt_algorithm.cpp index d9b2a6299..27340357a 100644 --- a/unittest/share/test_national_encrypt_algorithm.cpp +++ b/unittest/share/test_national_encrypt_algorithm.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; using namespace oceanbase::share; class TestNationalEncrypt : public ::testing::Test { - public: +public: bool equal(char* A, char* B, int len); }; diff --git a/unittest/share/test_ob_config.cpp b/unittest/share/test_ob_config.cpp index 66054c6df..ae7b08852 100644 --- a/unittest/share/test_ob_config.cpp +++ b/unittest/share/test_ob_config.cpp @@ -20,7 +20,7 @@ using namespace oceanbase; /* using namespace oceanbase::common::hash; */ class TestServerConfig : public ::testing::Test, public ObInitConfigContainer { - public: +public: bool check() const { bool ret = true; diff --git a/unittest/share/test_ob_log.cpp b/unittest/share/test_ob_log.cpp index f7fd6db40..1162aa5a0 100644 --- a/unittest/share/test_ob_log.cpp +++ b/unittest/share/test_ob_log.cpp @@ -24,15 +24,15 @@ using namespace oceanbase; using namespace common; class ObLoggerTest : public ::testing::Test { - public: - private: +public: +private: ObLoggerTest(const ObLoggerTest& other); ObLoggerTest& operator=(const ObLoggerTest& other); - private: +private: }; class ObTestLog { - public: +public: int64_t to_string(char* buf, int64_t buf_len) const { int64_t pos = 0; diff --git a/unittest/share/test_ob_tg_mgr.cpp b/unittest/share/test_ob_tg_mgr.cpp index 17bf3bbef..7bb4bb356 100644 --- a/unittest/share/test_ob_tg_mgr.cpp +++ b/unittest/share/test_ob_tg_mgr.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; using namespace oceanbase::lib; class MyRunnable : public TGRunnable { - public: +public: void run1() override { run_count_++; diff --git a/unittest/share/test_obj_cast.cpp b/unittest/share/test_obj_cast.cpp index 740d912eb..f9709f82d 100644 --- a/unittest/share/test_obj_cast.cpp +++ b/unittest/share/test_obj_cast.cpp @@ -21,7 +21,7 @@ namespace common { using namespace number; class TestObjCast : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} diff --git a/unittest/share/test_primary_zone_util.cpp b/unittest/share/test_primary_zone_util.cpp index 503f9f704..138e33d76 100644 --- a/unittest/share/test_primary_zone_util.cpp +++ b/unittest/share/test_primary_zone_util.cpp @@ -23,7 +23,7 @@ namespace oceanbase { namespace share { using namespace schema; class TestPrimaryZoneUtil : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/share/test_reentrant_thread.cpp b/unittest/share/test_reentrant_thread.cpp index 12c2b467e..0d3c7ef2a 100644 --- a/unittest/share/test_reentrant_thread.cpp +++ b/unittest/share/test_reentrant_thread.cpp @@ -21,7 +21,7 @@ using namespace common; namespace share { class TestReentrantThread : public ObReentrantThread { - public: +public: TestReentrantThread() : sleeped_cnt_(0) {} diff --git a/unittest/share/test_restore_uri_parser.cpp b/unittest/share/test_restore_uri_parser.cpp index f1b5aabfe..201af3551 100644 --- a/unittest/share/test_restore_uri_parser.cpp +++ b/unittest/share/test_restore_uri_parser.cpp @@ -21,19 +21,19 @@ using namespace oceanbase::common; using namespace oceanbase::share; class TestRestoreURIParser : public ::testing::Test { - public: +public: TestRestoreURIParser(); virtual ~TestRestoreURIParser(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestRestoreURIParser); - protected: +protected: // function members - protected: +protected: // data members }; diff --git a/unittest/share/test_rpc_struct.cpp b/unittest/share/test_rpc_struct.cpp index b58e606cb..769d1400a 100644 --- a/unittest/share/test_rpc_struct.cpp +++ b/unittest/share/test_rpc_struct.cpp @@ -20,7 +20,7 @@ using namespace common; namespace share { class TestRPCStruct : public ::testing::Test { - public: +public: TestRPCStruct() {} virtual ~TestRPCStruct() diff --git a/unittest/share/test_rs_mgr.cpp b/unittest/share/test_rs_mgr.cpp index 52492a0ed..56c2f968c 100644 --- a/unittest/share/test_rs_mgr.cpp +++ b/unittest/share/test_rs_mgr.cpp @@ -41,7 +41,7 @@ static ObArray global_rs_list; static ObArray global_readonly_rs_list; class FakeRootAddrAgent : public ObRootAddrAgent { - public: +public: virtual int store(const ObRootAddrList& addr_list, const ObRootAddrList& readonly_addr_list, const bool force) { int ret = OB_SUCCESS; @@ -71,7 +71,7 @@ class FakeRootAddrAgent : public ObRootAddrAgent { }; class FakeSrvRpcProxy : public ObCommonRpcProxy { - public: +public: FakeSrvRpcProxy() : ObCommonRpcProxy(this) {} @@ -92,12 +92,12 @@ class FakeSrvRpcProxy : public ObCommonRpcProxy { }; class TestRsMgr : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} - private: +private: ObServerConfig config_; DBInitializer db_initer_; diff --git a/unittest/share/test_scanner.cpp b/unittest/share/test_scanner.cpp index f298b4e11..ed45095f6 100644 --- a/unittest/share/test_scanner.cpp +++ b/unittest/share/test_scanner.cpp @@ -15,19 +15,19 @@ #include "lib/utility/ob_test_util.h" using namespace oceanbase::common; class TestScanner : public ::testing::Test { - public: +public: TestScanner(); virtual ~TestScanner(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestScanner); - protected: +protected: // function members - protected: +protected: // data members }; diff --git a/unittest/share/test_storage_file.cpp b/unittest/share/test_storage_file.cpp index 0f41b4528..665a9f5cf 100644 --- a/unittest/share/test_storage_file.cpp +++ b/unittest/share/test_storage_file.cpp @@ -26,7 +26,7 @@ using namespace oceanbase::common; class TestStorageFile : public ::testing::Test { - public: +public: TestStorageFile() {} virtual ~TestStorageFile() @@ -50,13 +50,13 @@ class TestStorageFile : public ::testing::Test { static void TearDownTestCase() {} - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestStorageFile); - protected: +protected: // function members - protected: +protected: char test_dir_[OB_MAX_URI_LENGTH]; char test_dir_uri_[OB_MAX_URI_LENGTH]; }; @@ -254,7 +254,7 @@ TEST_F(TestStorageFile, test_mkdir) TEST_F(TestStorageFile, test_parallel_mkdir) { class MakedirTask : public ObDynamicThreadTask { - public: + public: int init(const char* dir) { EXPECT_FALSE(NULL == dir); @@ -276,7 +276,7 @@ TEST_F(TestStorageFile, test_parallel_mkdir) return OB_SUCCESS; } - private: + private: char uri_[OB_MAX_URI_LENGTH]; }; diff --git a/unittest/share/test_tenant_mgr.cpp b/unittest/share/test_tenant_mgr.cpp index d51416996..0447b3bc1 100644 --- a/unittest/share/test_tenant_mgr.cpp +++ b/unittest/share/test_tenant_mgr.cpp @@ -76,7 +76,7 @@ int init_tenant_mgr() } class TestTenantStress : public share::ObThreadPool { - public: +public: TestTenantStress(); virtual ~TestTenantStress(); virtual void run1(); diff --git a/unittest/share/test_unit_getter.cpp b/unittest/share/test_unit_getter.cpp index fd204cd2d..6736938cd 100644 --- a/unittest/share/test_unit_getter.cpp +++ b/unittest/share/test_unit_getter.cpp @@ -26,7 +26,7 @@ using namespace share::schema; using namespace share::host; namespace share { class TestUnitGetter : public ::testing::Test { - public: +public: TestUnitGetter() {} virtual ~TestUnitGetter() @@ -36,7 +36,7 @@ class TestUnitGetter : public ::testing::Test { virtual void TearDown() {} - protected: +protected: void check_unit(const ObUnit& l, const ObUnit& r); void check_config(const ObUnitConfig& l, const ObUnitConfig& r); void check_pool(const ObResourcePool& l, const ObResourcePool& r); diff --git a/unittest/share/test_web_service_root_addr.cpp b/unittest/share/test_web_service_root_addr.cpp index 3a03c0d86..8ed5c8706 100644 --- a/unittest/share/test_web_service_root_addr.cpp +++ b/unittest/share/test_web_service_root_addr.cpp @@ -21,7 +21,7 @@ namespace share { using namespace common; class TestWebServiceRootAddr : public ::testing::Test { - public: +public: TestWebServiceRootAddr() : service_pid_(0) {} @@ -32,7 +32,7 @@ class TestWebServiceRootAddr : public ::testing::Test { void set_response_json(const char* json); void set_response_json2(const char* json); - protected: +protected: pid_t service_pid_; schema::DBInitializer initer_; schema::DBInitializer initer2_; diff --git a/unittest/share/test_web_service_root_addr2.cpp b/unittest/share/test_web_service_root_addr2.cpp index 11414d290..36f9cdbc7 100644 --- a/unittest/share/test_web_service_root_addr2.cpp +++ b/unittest/share/test_web_service_root_addr2.cpp @@ -21,7 +21,7 @@ namespace share { using namespace common; class TestWebServiceRootAddr : public ::testing::Test { - public: +public: TestWebServiceRootAddr() : service_pid_(0) {} @@ -30,7 +30,7 @@ class TestWebServiceRootAddr : public ::testing::Test { void set_response_json(const char* json); - protected: +protected: pid_t service_pid_; schema::DBInitializer initer_; schema::DBInitializer initer2_; diff --git a/unittest/share/test_zone_info.cpp b/unittest/share/test_zone_info.cpp index 3df67db6d..8b47c3ab8 100644 --- a/unittest/share/test_zone_info.cpp +++ b/unittest/share/test_zone_info.cpp @@ -23,12 +23,12 @@ using namespace common; using namespace share::schema; class TestZoneInfo : public ::testing::Test { - public: +public: virtual void SetUp(); virtual void TearDown() {} - protected: +protected: DBInitializer db_initer_; ObGlobalInfo global_info_; }; diff --git a/unittest/share/unit_info_builder.h b/unittest/share/unit_info_builder.h index a845e11b0..487ec9429 100644 --- a/unittest/share/unit_info_builder.h +++ b/unittest/share/unit_info_builder.h @@ -25,7 +25,7 @@ const ObZone ZONE = "test_zone"; const ObZone ZONE11 = "zone1"; static int64_t TEST_UNIT_MEMORY = OB_UNIT_MIN_MEMORY * 3; class UnitInfoBuilder { - public: +public: UnitInfoBuilder(common::ObMySQLProxy& proxy) : proxy_(proxy) { int ret = OB_SUCCESS; @@ -72,7 +72,7 @@ class UnitInfoBuilder { return pools_; } - private: +private: common::ObMySQLProxy& proxy_; ObUnitTableOperator ut_operator_; common::ObArray configs_; diff --git a/unittest/sql/code_generator/test_code_generator.cpp b/unittest/sql/code_generator/test_code_generator.cpp index 88de9e527..7008e55d0 100644 --- a/unittest/sql/code_generator/test_code_generator.cpp +++ b/unittest/sql/code_generator/test_code_generator.cpp @@ -31,7 +31,7 @@ using namespace oceanbase::common; namespace test { class MockVisitor : public ObPhyOperatorVisitor { - public: +public: MockVisitor() : level_(0) {} ~MockVisitor() @@ -102,28 +102,28 @@ class MockVisitor : public ObPhyOperatorVisitor { return OB_SUCCESS; } - private: +private: int level_; }; class TestCodeGenerator : public TestOptimizerUtils { - public: +public: TestCodeGenerator(); virtual ~TestCodeGenerator(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestCodeGenerator); - protected: +protected: // function members void do_optimize(ObStmt& stmt, ObLogPlan*& plan, ObPhyPlanType distr_method); void do_code_generate(const ObLogPlan& log_plan, ObCodeGenerator& code_gen, ObPhysicalPlan& phy_plan); int do_rewrite(ObStmt*& stmt, ObPhysicalPlan* phy_plan); - protected: +protected: // data members oceanbase::share::ObLocationFetcher fetcher_; ParamStore params_; diff --git a/unittest/sql/code_generator/test_expr_generator.cpp b/unittest/sql/code_generator/test_expr_generator.cpp index 66ccd82f5..8ab670a3f 100644 --- a/unittest/sql/code_generator/test_expr_generator.cpp +++ b/unittest/sql/code_generator/test_expr_generator.cpp @@ -27,21 +27,21 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestExprGenerator : public ::testing::Test { - public: +public: TestExprGenerator(); virtual ~TestExprGenerator(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestExprGenerator); - protected: +protected: // function members void generate_expr(const char* expr_str, const char*& post_expr); - protected: +protected: // data members ObPhysicalPlan phy_plan_; }; diff --git a/unittest/sql/code_generator/test_static_engine_cg.cpp b/unittest/sql/code_generator/test_static_engine_cg.cpp index b4ab2062f..de34ac683 100644 --- a/unittest/sql/code_generator/test_static_engine_cg.cpp +++ b/unittest/sql/code_generator/test_static_engine_cg.cpp @@ -30,7 +30,7 @@ using namespace oceanbase::share; namespace test { class MockVisitor : public ObPhyOperatorVisitor { - public: +public: MockVisitor() : level_(0) {} ~MockVisitor() @@ -101,28 +101,28 @@ class MockVisitor : public ObPhyOperatorVisitor { return OB_SUCCESS; } - private: +private: int level_; }; class TestCodeGenerator : public TestOptimizerUtils { - public: +public: TestCodeGenerator(); virtual ~TestCodeGenerator(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestCodeGenerator); - protected: +protected: // function members void do_optimize(ObStmt& stmt, ObLogPlan*& plan, ObPhyPlanType distr_method); void do_code_generate(const ObLogPlan& log_plan, ObCodeGenerator& code_gen, ObPhysicalPlan& phy_plan); int do_rewrite(ObStmt*& stmt, ObPhysicalPlan* phy_plan); - protected: +protected: // data members oceanbase::share::ObLocationFetcher fetcher_; ParamStore params_; diff --git a/unittest/sql/common/test_base64_encode.cpp b/unittest/sql/common/test_base64_encode.cpp index 45a9de2c2..033aad307 100644 --- a/unittest/sql/common/test_base64_encode.cpp +++ b/unittest/sql/common/test_base64_encode.cpp @@ -22,7 +22,7 @@ namespace oceanbase { namespace common { class TestBase64Encoder : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/sql/common/test_ob_diagnose_info.cpp b/unittest/sql/common/test_ob_diagnose_info.cpp index 70713aab5..a6afe1a44 100644 --- a/unittest/sql/common/test_ob_diagnose_info.cpp +++ b/unittest/sql/common/test_ob_diagnose_info.cpp @@ -19,18 +19,18 @@ using namespace common; #define OK(value) ASSERT_EQ(OB_SUCCESS, (value)) class ObDiagnoseInfoTest : public ::testing::Test { - public: +public: ObDiagnoseInfoTest(); virtual ~ObDiagnoseInfoTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObDiagnoseInfoTest(const ObDiagnoseInfoTest& other); ObDiagnoseInfoTest& operator=(const ObDiagnoseInfoTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/common/test_ob_end_trans_callback.cpp b/unittest/sql/common/test_ob_end_trans_callback.cpp index 95d8fa798..55e9e1338 100644 --- a/unittest/sql/common/test_ob_end_trans_callback.cpp +++ b/unittest/sql/common/test_ob_end_trans_callback.cpp @@ -24,7 +24,7 @@ using namespace oceanbase::transaction; namespace test { class ObEndTransCallbacksTest : public ::testing::Test { - public: +public: ObEndTransCallbacksTest() {} virtual ~ObEndTransCallbacksTest() @@ -34,12 +34,12 @@ class ObEndTransCallbacksTest : public ::testing::Test { virtual void TearDown() {} - private: +private: // disallow copy ObEndTransCallbacksTest(const ObEndTransCallbacksTest& other); ObEndTransCallbacksTest& operator=(const ObEndTransCallbacksTest& other); - private: +private: // data members }; TEST_F(ObEndTransCallbacksTest, signal_wait) diff --git a/unittest/sql/common/test_ob_sql_utils.cpp b/unittest/sql/common/test_ob_sql_utils.cpp index 72dae3864..ba4cdab33 100644 --- a/unittest/sql/common/test_ob_sql_utils.cpp +++ b/unittest/sql/common/test_ob_sql_utils.cpp @@ -19,7 +19,7 @@ using namespace oceanbase::sql; using namespace oceanbase::common; namespace test { class ObSQLUtilsTest : public ::testing::Test { - public: +public: ObSQLUtilsTest() {} virtual ~ObSQLUtilsTest() @@ -29,12 +29,12 @@ class ObSQLUtilsTest : public ::testing::Test { virtual void TearDown() {} - private: +private: // disallow copy ObSQLUtilsTest(const ObSQLUtilsTest& other); ObSQLUtilsTest& operator=(const ObSQLUtilsTest& other); - private: +private: // data members }; TEST_F(ObSQLUtilsTest, make_field_name) diff --git a/unittest/sql/common/test_rowkey.cpp b/unittest/sql/common/test_rowkey.cpp index 668ea631b..fafbe50db 100644 --- a/unittest/sql/common/test_rowkey.cpp +++ b/unittest/sql/common/test_rowkey.cpp @@ -22,7 +22,7 @@ namespace test { const int64_t SER_BUF_LEN = 10001; const int64_t ITEM_CNT = 5; class TestRowkey : public ::testing::Test { - public: +public: TestRowkey() {} ~TestRowkey() diff --git a/unittest/sql/common/test_urowid.cpp b/unittest/sql/common/test_urowid.cpp index bd6897bbc..8ba9de663 100644 --- a/unittest/sql/common/test_urowid.cpp +++ b/unittest/sql/common/test_urowid.cpp @@ -32,7 +32,7 @@ using std::endl; namespace oceanbase { namespace common { class TestAllocator : public ObIAllocator { - public: +public: virtual void* alloc(const int64_t size) override { return std::malloc(size); @@ -47,7 +47,7 @@ class TestAllocator : public ObIAllocator { } }; class TestURowID { - public: +public: // void SetUp() override {} // void TearDown() override {} diff --git a/unittest/sql/dtl/test_dtl.cpp b/unittest/sql/dtl/test_dtl.cpp index d6ad73d73..10e1c0b81 100644 --- a/unittest/sql/dtl/test_dtl.cpp +++ b/unittest/sql/dtl/test_dtl.cpp @@ -28,12 +28,12 @@ using namespace oceanbase::sql; using namespace oceanbase::sql::dtl; class Runnable { - public: +public: virtual void run() = 0; }; class Producer : public ObDtlTask, public Runnable { - public: +public: void run() { cout << "Producer" << endl; @@ -50,7 +50,7 @@ class Producer : public ObDtlTask, public Runnable { }; class Consumer : public ObDtlTask, public Runnable { - public: +public: void run() { cout << "Consumer" << endl; @@ -73,7 +73,7 @@ void th(void* arg) } class TestDtl : public ::testing::Test { - public: +public: virtual void SetUp() { cout << "set up" << endl; @@ -84,7 +84,7 @@ class TestDtl : public ::testing::Test { cout << "tear down" << endl; } - protected: +protected: Consumer c; Producer p; thread* thes_[10]; diff --git a/unittest/sql/dtl/test_dtl_rpc_channel.cpp b/unittest/sql/dtl/test_dtl_rpc_channel.cpp index 2d6a0e15e..6e1404406 100644 --- a/unittest/sql/dtl/test_dtl_rpc_channel.cpp +++ b/unittest/sql/dtl/test_dtl_rpc_channel.cpp @@ -31,7 +31,7 @@ ObAddr self_addr; class Msg : public ObDtlMsgTemp { OB_UNIS_VERSION(1); - public: +public: void reset() {} int ret_; diff --git a/unittest/sql/engine/aggregate/ob_aggregate_test_utils.h b/unittest/sql/engine/aggregate/ob_aggregate_test_utils.h index 7f04700ed..1cb646c8a 100644 --- a/unittest/sql/engine/aggregate/ob_aggregate_test_utils.h +++ b/unittest/sql/engine/aggregate/ob_aggregate_test_utils.h @@ -32,7 +32,7 @@ using namespace oceanbase::share; using namespace oceanbase::omt; class TestAggregateFactory { - public: +public: TestAggregateFactory() {} ~TestAggregateFactory() @@ -207,7 +207,7 @@ class TestAggregateFactory { return physical_plan_; } - private: +private: static void add_aggr_column( ObGroupBy& groupby_op, bool is_distinct, bool is_number = true, ObCollationType agg_cs_type = CS_TYPE_UTF8MB4_BIN) { @@ -409,7 +409,7 @@ class TestAggregateFactory { } } - private: +private: static ObPhysicalPlan physical_plan_; static ObFakeTable fake_table_; static ObFakeTable result_table_; diff --git a/unittest/sql/engine/aggregate/test_hash_distinct.cpp b/unittest/sql/engine/aggregate/test_hash_distinct.cpp index 6f919b2b6..ce28cb4ef 100644 --- a/unittest/sql/engine/aggregate/test_hash_distinct.cpp +++ b/unittest/sql/engine/aggregate/test_hash_distinct.cpp @@ -31,7 +31,7 @@ namespace sql { using namespace common; class TestEnv : public ::testing::Environment { - public: +public: virtual void SetUp() override { GCONF.enable_sql_operator_dump.set_value("True"); @@ -57,7 +57,7 @@ class TestEnv : public ::testing::Environment { ASSERT_FALSE(HasFatalFailure()); class TestHashDistinct : public ObHashDistinct { - public: +public: TestHashDistinct() : ObHashDistinct(alloc_) {} ~TestHashDistinct() @@ -69,7 +69,7 @@ class TestHashDistinct : public ObHashDistinct { ASSERT_FALSE(HasFatalFailure()); class TestHashDistinctTest : public blocksstable::TestDataFilePrepare { - public: +public: TestHashDistinctTest() : blocksstable::TestDataFilePrepare("TestDisk_distinct", 2 << 20, 5000) {} virtual ~TestHashDistinctTest(); @@ -280,7 +280,7 @@ class TestHashDistinctTest : public blocksstable::TestDataFilePrepare { return physical_plan_; } - protected: +protected: ObFakeTable fake_table_; ObFakeTable result_table_; ObPhysicalPlan physical_plan_; @@ -297,7 +297,7 @@ class TestHashDistinctTest : public blocksstable::TestDataFilePrepare { char hit_val[BUF_SIZE]; char hit_val_base[BUF_SIZE]; - private: +private: int64_t tenant_id_ = OB_SYS_TENANT_ID; int64_t ctx_id_ = ObCtxIds::WORK_AREA; int64_t mod_id_ = ObNewModIds::TEST1; @@ -307,7 +307,7 @@ class TestHashDistinctTest : public blocksstable::TestDataFilePrepare { TestHashDistinctTest(const TestHashDistinctTest& other); TestHashDistinctTest& operator=(const TestHashDistinctTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/aggregate/test_hash_groupby.cpp b/unittest/sql/engine/aggregate/test_hash_groupby.cpp index 9d614a758..d3d7bd04d 100644 --- a/unittest/sql/engine/aggregate/test_hash_groupby.cpp +++ b/unittest/sql/engine/aggregate/test_hash_groupby.cpp @@ -24,18 +24,18 @@ using namespace oceanbase::sql; using namespace oceanbase::blocksstable; class ObHashGroupbyTest : public TestDataFilePrepare { - public: +public: ObHashGroupbyTest(); virtual ~ObHashGroupbyTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObHashGroupbyTest(const ObHashGroupbyTest& other); ObHashGroupbyTest& operator=(const ObHashGroupbyTest& other); - private: +private: // data members }; ObHashGroupbyTest::ObHashGroupbyTest() : TestDataFilePrepare("TestDisk_groupby", 2 << 20, 5000) @@ -57,7 +57,7 @@ void ObHashGroupbyTest::TearDown() TestDataFilePrepare::TearDown(); } class TestHashGroupBy : public ObHashGroupBy { - public: +public: TestHashGroupBy() : ObHashGroupBy(alloc_) {} virtual ~TestHashGroupBy() diff --git a/unittest/sql/engine/aggregate/test_merge_distinct.cpp b/unittest/sql/engine/aggregate/test_merge_distinct.cpp index 66eba9ee7..ab9c1f7b8 100644 --- a/unittest/sql/engine/aggregate/test_merge_distinct.cpp +++ b/unittest/sql/engine/aggregate/test_merge_distinct.cpp @@ -21,7 +21,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; using namespace oceanbase::omt; class TestMergeDistinct : public ObMergeDistinct { - public: +public: TestMergeDistinct() : ObMergeDistinct(alloc_) {} ~TestMergeDistinct() @@ -29,7 +29,7 @@ class TestMergeDistinct : public ObMergeDistinct { }; class TestMergeDistinctTest : public ::testing::Test { - public: +public: TestMergeDistinctTest(); virtual ~TestMergeDistinctTest(); virtual void SetUp(); @@ -96,17 +96,17 @@ class TestMergeDistinctTest : public ::testing::Test { return physical_plan_; } - protected: +protected: ObFakeTable fake_table_; ObFakeTable result_table_; ObPhysicalPlan physical_plan_; - private: +private: // disallow copy TestMergeDistinctTest(const TestMergeDistinctTest& other); TestMergeDistinctTest& operator=(const TestMergeDistinctTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/aggregate/test_merge_groupby.cpp b/unittest/sql/engine/aggregate/test_merge_groupby.cpp index 2e18ead6b..53f72059b 100644 --- a/unittest/sql/engine/aggregate/test_merge_groupby.cpp +++ b/unittest/sql/engine/aggregate/test_merge_groupby.cpp @@ -21,18 +21,18 @@ using namespace oceanbase::sql; using namespace oceanbase::blocksstable; class ObMergeGroupbyTest : public TestDataFilePrepare { - public: +public: ObMergeGroupbyTest(); virtual ~ObMergeGroupbyTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObMergeGroupbyTest(const ObMergeGroupbyTest& other); ObMergeGroupbyTest& operator=(const ObMergeGroupbyTest& other); - private: +private: // data members }; @@ -55,7 +55,7 @@ void ObMergeGroupbyTest::TearDown() TestDataFilePrepare::TearDown(); } class TestMergeGroupBy : public ObMergeGroupBy { - public: +public: TestMergeGroupBy() : ObMergeGroupBy(alloc_) {} ~TestMergeGroupBy() diff --git a/unittest/sql/engine/aggregate/test_scalar_aggregate.cpp b/unittest/sql/engine/aggregate/test_scalar_aggregate.cpp index 6927eced2..14b607c6d 100644 --- a/unittest/sql/engine/aggregate/test_scalar_aggregate.cpp +++ b/unittest/sql/engine/aggregate/test_scalar_aggregate.cpp @@ -22,18 +22,18 @@ using namespace oceanbase::sql; using namespace oceanbase::blocksstable; class TestScalarAggregateTest : public TestDataFilePrepare { - public: +public: TestScalarAggregateTest(); virtual ~TestScalarAggregateTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestScalarAggregateTest(const TestScalarAggregateTest& other); TestScalarAggregateTest& operator=(const TestScalarAggregateTest& other); - private: +private: // data members }; TestScalarAggregateTest::TestScalarAggregateTest() : TestDataFilePrepare("TestDisk_scalar_groupby", 2 << 20, 5000) @@ -56,7 +56,7 @@ void TestScalarAggregateTest::TearDown() } class TestScalarAggregate : public ObScalarAggregate { - public: +public: TestScalarAggregate() : ObScalarAggregate(alloc_) {} ~TestScalarAggregate() diff --git a/unittest/sql/engine/basic/test_chunk_datum_store.cpp b/unittest/sql/engine/basic/test_chunk_datum_store.cpp index 381963337..7baef05d1 100644 --- a/unittest/sql/engine/basic/test_chunk_datum_store.cpp +++ b/unittest/sql/engine/basic/test_chunk_datum_store.cpp @@ -30,7 +30,7 @@ namespace sql { using namespace common; class TestEnv : public ::testing::Environment { - public: +public: virtual void SetUp() override { GCONF.enable_sql_operator_dump.set_value("True"); @@ -54,7 +54,7 @@ class TestEnv : public ::testing::Environment { ASSERT_FALSE(HasFatalFailure()); class TestChunkDatumStore : public blocksstable::TestDataFilePrepare { - public: +public: TestChunkDatumStore() : blocksstable::TestDataFilePrepare("TestDisk_chunk_datum_store", 2 << 20, 5000), eval_ctx_(exec_ctx_, eval_res_, eval_tmp_) @@ -253,7 +253,7 @@ class TestChunkDatumStore : public blocksstable::TestDataFilePrepare { void with_or_without_chunk(bool is_with); - protected: +protected: const static int64_t COLS = 3; bool enable_big_row_ = false; int64_t cell_cnt_; diff --git a/unittest/sql/engine/basic/test_chunk_row_store.cpp b/unittest/sql/engine/basic/test_chunk_row_store.cpp index 25892a719..c35379faf 100644 --- a/unittest/sql/engine/basic/test_chunk_row_store.cpp +++ b/unittest/sql/engine/basic/test_chunk_row_store.cpp @@ -28,7 +28,7 @@ namespace sql { using namespace common; class TestEnv : public ::testing::Environment { - public: +public: virtual void SetUp() override { GCONF.enable_sql_operator_dump.set_value("True"); @@ -52,7 +52,7 @@ class TestEnv : public ::testing::Environment { ASSERT_FALSE(HasFatalFailure()); class TestChunkRowStore : public blocksstable::TestDataFilePrepare { - public: +public: TestChunkRowStore() : blocksstable::TestDataFilePrepare("TestDisk_chunk_row_store", 2 << 20, 5000) {} @@ -223,7 +223,7 @@ class TestChunkRowStore : public blocksstable::TestDataFilePrepare { void with_or_without_chunk(bool is_with); - protected: +protected: const static int64_t COLS = 3; bool enable_big_row_ = false; ObObj cells_[COLS]; diff --git a/unittest/sql/engine/basic/test_ra_row_store.cpp b/unittest/sql/engine/basic/test_ra_row_store.cpp index 815a82216..6c76db695 100644 --- a/unittest/sql/engine/basic/test_ra_row_store.cpp +++ b/unittest/sql/engine/basic/test_ra_row_store.cpp @@ -25,7 +25,7 @@ namespace sql { using namespace common; class TestEnv : public ::testing::Environment { - public: +public: virtual void SetUp() override { GCONF.enable_sql_operator_dump.set_value("True"); @@ -50,7 +50,7 @@ class TestEnv : public ::testing::Environment { ASSERT_FALSE(HasFatalFailure()); class TestRARowStore : public blocksstable::TestDataFilePrepare { - public: +public: TestRARowStore() : blocksstable::TestDataFilePrepare("TestDiskIR", 2 << 20, 1000) {} @@ -142,7 +142,7 @@ class TestRARowStore : public blocksstable::TestDataFilePrepare { ASSERT_EQ(base + cnt, rs_.get_row_cnt()); } - protected: +protected: const static int64_t COLS = 3; bool enable_big_row_ = false; ObObj cells_[COLS]; diff --git a/unittest/sql/engine/dml/test_insert_up.cpp b/unittest/sql/engine/dml/test_insert_up.cpp index 9e1e08869..472f4bd9e 100644 --- a/unittest/sql/engine/dml/test_insert_up.cpp +++ b/unittest/sql/engine/dml/test_insert_up.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; namespace oceanbase { namespace sql { class TestInsertUp : public ::testing::Test { - public: +public: TestInsertUp() {} virtual ~TestInsertUp() diff --git a/unittest/sql/engine/dml/test_table_insert.cpp b/unittest/sql/engine/dml/test_table_insert.cpp index 6334c72e3..667ee07e0 100644 --- a/unittest/sql/engine/dml/test_table_insert.cpp +++ b/unittest/sql/engine/dml/test_table_insert.cpp @@ -23,7 +23,7 @@ using namespace oceanbase::sql; using namespace oceanbase::observer; class ObTableInsertTest : public ::testing::Test { - public: +public: ObTableInsertTest(); virtual ~ObTableInsertTest(); virtual void SetUp(); @@ -32,12 +32,12 @@ class ObTableInsertTest : public ::testing::Test { int create_const_expr(ObObj& obj, ObSqlExpression*& expr); int create_expr_values(ObExprValues*& expr_values); - private: +private: // disallow copy ObTableInsertTest(const ObTableInsertTest& other); ObTableInsertTest& operator=(const ObTableInsertTest& other); - protected: +protected: // data members ObPhysicalPlan physical_plan_; }; diff --git a/unittest/sql/engine/expr/ob_expr_abs_test.cpp b/unittest/sql/engine/expr/ob_expr_abs_test.cpp index f5ffefa22..4a7ad2d1f 100644 --- a/unittest/sql/engine/expr/ob_expr_abs_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_abs_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; TEST_OPERATOR(ObExprAbs); class TestObExprAbsTest : public ::testing::Test { - public: +public: TestObExprAbsTest(); virtual ~TestObExprAbsTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestObExprAbsTest(const TestObExprAbsTest& other); TestObExprAbsTest& operator=(const TestObExprAbsTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_add_test.cpp b/unittest/sql/engine/expr/ob_expr_add_test.cpp index a01a6b7e1..883bbcf4b 100644 --- a/unittest/sql/engine/expr/ob_expr_add_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_add_test.cpp @@ -20,18 +20,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprAddTest : public ::testing::Test { - public: +public: ObExprAddTest(); virtual ~ObExprAddTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprAddTest(const ObExprAddTest& other); ObExprAddTest& operator=(const ObExprAddTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_and_test.cpp b/unittest/sql/engine/expr/ob_expr_and_test.cpp index f82c6b8ca..62eb8d06c 100644 --- a/unittest/sql/engine/expr/ob_expr_and_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_and_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprAndTest : public ::testing::Test { - public: +public: ObExprAndTest(); virtual ~ObExprAndTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprAndTest(const ObExprAndTest& other); ObExprAndTest& operator=(const ObExprAndTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_arithmatic_test.cpp b/unittest/sql/engine/expr/ob_expr_arithmatic_test.cpp index cf864c15e..c68cf86d6 100644 --- a/unittest/sql/engine/expr/ob_expr_arithmatic_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_arithmatic_test.cpp @@ -33,7 +33,7 @@ using namespace oceanbase::sql; using namespace oceanbase::common::hash; class ObExprArithmaticTest : public ::testing::Test { - public: +public: ObExprArithmaticTest(); virtual ~ObExprArithmaticTest(); virtual void SetUp(); @@ -63,7 +63,7 @@ class ObExprArithmaticTest : public ::testing::Test { static int truncate_number_precision( number::ObNumber& num, number::ObNumber& num_trunc, int16_t scale, ObIAllocator& buf); - private: +private: // disallow copy ObExprArithmaticTest(const ObExprArithmaticTest& other); ObExprArithmaticTest& operator=(const ObExprArithmaticTest& other); @@ -73,7 +73,7 @@ class ObExprArithmaticTest : public ::testing::Test { static ObHashMap str_to_type_map_mysql_; static ObHashMap str_to_expr_type_map_; - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_between_test.cpp b/unittest/sql/engine/expr/ob_expr_between_test.cpp index 9b861cd7d..5aa00439f 100644 --- a/unittest/sql/engine/expr/ob_expr_between_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_between_test.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprBetweenTest : public ::testing::Test { - public: +public: ObExprBetweenTest(); virtual ~ObExprBetweenTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprBetweenTest(const ObExprBetweenTest& other); ObExprBetweenTest& operator=(const ObExprBetweenTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_case_test.cpp b/unittest/sql/engine/expr/ob_expr_case_test.cpp index c73d472d3..a39999b2d 100644 --- a/unittest/sql/engine/expr/ob_expr_case_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_case_test.cpp @@ -20,18 +20,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprCaseTest : public ::testing::Test { - public: +public: ObExprCaseTest(); virtual ~ObExprCaseTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprCaseTest(const ObExprCaseTest& other); ObExprCaseTest& operator=(const ObExprCaseTest& other); - private: +private: // data members }; ObExprCaseTest::ObExprCaseTest() diff --git a/unittest/sql/engine/expr/ob_expr_coalesce_test.cpp b/unittest/sql/engine/expr/ob_expr_coalesce_test.cpp index e8a0c278a..e6559b0ac 100644 --- a/unittest/sql/engine/expr/ob_expr_coalesce_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_coalesce_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprCoalesceTest : public ::testing::Test { - public: +public: ObExprCoalesceTest(); virtual ~ObExprCoalesceTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprCoalesceTest(const ObExprCoalesceTest& other); ObExprCoalesceTest& operator=(const ObExprCoalesceTest& other); - private: +private: // data members }; ObExprCoalesceTest::ObExprCoalesceTest() diff --git a/unittest/sql/engine/expr/ob_expr_compare_test.cpp b/unittest/sql/engine/expr/ob_expr_compare_test.cpp index 95095984c..29a952a5e 100644 --- a/unittest/sql/engine/expr/ob_expr_compare_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_compare_test.cpp @@ -19,7 +19,7 @@ using namespace oceanbase::common; using namespace oceanbase::obmysql; using namespace oceanbase::sql; class ObExprCompareTest : public ::testing::Test { - public: +public: ObExprCompareTest() {} virtual void SetUp() @@ -51,7 +51,7 @@ class ObExprCompareTest : public ::testing::Test { LOG_INFO("total ", K(total_my)); } - protected: +protected: }; TEST_F(ObExprCompareTest, calc) diff --git a/unittest/sql/engine/expr/ob_expr_concat_test.cpp b/unittest/sql/engine/expr/ob_expr_concat_test.cpp index 8b84b8e71..2f92de4e5 100644 --- a/unittest/sql/engine/expr/ob_expr_concat_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_concat_test.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprConcatTest : public ::testing::Test { - public: +public: ObExprConcatTest(); virtual ~ObExprConcatTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprConcatTest(const ObExprConcatTest& other); ObExprConcatTest& operator=(const ObExprConcatTest& other); - private: +private: // data members }; ObExprConcatTest::ObExprConcatTest() diff --git a/unittest/sql/engine/expr/ob_expr_concat_ws_test.cpp b/unittest/sql/engine/expr/ob_expr_concat_ws_test.cpp index f21c32a6e..7ab78059e 100644 --- a/unittest/sql/engine/expr/ob_expr_concat_ws_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_concat_ws_test.cpp @@ -19,7 +19,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestAllocator : public ObIAllocator { - public: +public: TestAllocator() : label_(ObModIds::TEST) {} virtual ~TestAllocator() @@ -42,23 +42,23 @@ class TestAllocator : public ObIAllocator { label_ = label; }; - private: +private: const char* label_; }; class ObExprConcatWsTest : public ::testing::Test { - public: +public: ObExprConcatWsTest(); virtual ~ObExprConcatWsTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprConcatWsTest(const ObExprConcatWsTest& other); ObExprConcatWsTest& operator=(const ObExprConcatWsTest& other); - private: +private: // data members }; ObExprConcatWsTest::ObExprConcatWsTest() diff --git a/unittest/sql/engine/expr/ob_expr_conv_test.cpp b/unittest/sql/engine/expr/ob_expr_conv_test.cpp index 515facb7d..fab3b60be 100644 --- a/unittest/sql/engine/expr/ob_expr_conv_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_conv_test.cpp @@ -20,7 +20,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestAllocator : public ObIAllocator { - public: +public: TestAllocator() : label_(ObModIds::TEST) {} virtual ~TestAllocator() @@ -43,23 +43,23 @@ class TestAllocator : public ObIAllocator { label_ = label; }; - private: +private: const char* label_; }; class ObExprConvTest : public ::testing::Test { - public: +public: ObExprConvTest(); virtual ~ObExprConvTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprConvTest(const ObExprConvTest& other); ObExprConvTest& operator=(const ObExprConvTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_date_add_test.cpp b/unittest/sql/engine/expr/ob_expr_date_add_test.cpp index e30d4d0b3..08c23952d 100644 --- a/unittest/sql/engine/expr/ob_expr_date_add_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_date_add_test.cpp @@ -20,18 +20,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprDateaddTest : public ::testing::Test { - public: +public: ObExprDateaddTest(); virtual ~ObExprDateaddTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprDateaddTest(const ObExprDateaddTest& other); ObExprDateaddTest& operator=(const ObExprDateaddTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_date_format_test.cpp b/unittest/sql/engine/expr/ob_expr_date_format_test.cpp index fc3e954a9..06abd02ba 100644 --- a/unittest/sql/engine/expr/ob_expr_date_format_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_date_format_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprDateFormatTest : public ::testing::Test { - public: +public: ObExprDateFormatTest(); virtual ~ObExprDateFormatTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprDateFormatTest(const ObExprDateFormatTest& other); ObExprDateFormatTest& operator=(const ObExprDateFormatTest& other); - private: +private: // data members }; ObExprDateFormatTest::ObExprDateFormatTest() diff --git a/unittest/sql/engine/expr/ob_expr_date_sub_test.cpp b/unittest/sql/engine/expr/ob_expr_date_sub_test.cpp index 61520a6db..08dd47971 100644 --- a/unittest/sql/engine/expr/ob_expr_date_sub_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_date_sub_test.cpp @@ -20,18 +20,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprDatesubTest : public ::testing::Test { - public: +public: ObExprDatesubTest(); virtual ~ObExprDatesubTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprDatesubTest(const ObExprDatesubTest& other); ObExprDatesubTest& operator=(const ObExprDatesubTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_div_test.cpp b/unittest/sql/engine/expr/ob_expr_div_test.cpp index 85065f254..2f409f7d5 100644 --- a/unittest/sql/engine/expr/ob_expr_div_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_div_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprDivTest : public ::testing::Test { - public: +public: ObExprDivTest(); virtual ~ObExprDivTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprDivTest(const ObExprDivTest& other); ObExprDivTest& operator=(const ObExprDivTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_equal_test.cpp b/unittest/sql/engine/expr/ob_expr_equal_test.cpp index db1d4c812..290783521 100644 --- a/unittest/sql/engine/expr/ob_expr_equal_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_equal_test.cpp @@ -16,18 +16,18 @@ using namespace oceanbase::sql; using namespace oceanbase::common; class ObExprEqualTest : public ::testing::Test { - public: +public: ObExprEqualTest(); virtual ~ObExprEqualTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprEqualTest(const ObExprEqualTest& other); ObExprEqualTest& operator=(const ObExprEqualTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_extract_test.cpp b/unittest/sql/engine/expr/ob_expr_extract_test.cpp index f42682d2c..9f2c629a6 100644 --- a/unittest/sql/engine/expr/ob_expr_extract_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_extract_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprExtractTest : public ::testing::Test { - public: +public: ObExprExtractTest(); virtual ~ObExprExtractTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprExtractTest(const ObExprExtractTest& other); ObExprExtractTest& operator=(const ObExprExtractTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_greater_equal_test.cpp b/unittest/sql/engine/expr/ob_expr_greater_equal_test.cpp index 5bfab6416..acbfb1383 100644 --- a/unittest/sql/engine/expr/ob_expr_greater_equal_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_greater_equal_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::sql; using namespace oceanbase::common; class ObExprGreaterEqualTest : public ::testing::Test { - public: +public: ObExprGreaterEqualTest(); virtual ~ObExprGreaterEqualTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprGreaterEqualTest(const ObExprGreaterEqualTest& other); ObExprGreaterEqualTest& operator=(const ObExprGreaterEqualTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_greater_than_test.cpp b/unittest/sql/engine/expr/ob_expr_greater_than_test.cpp index c7ce0edaf..f911bf3f5 100644 --- a/unittest/sql/engine/expr/ob_expr_greater_than_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_greater_than_test.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; #include class ObExprGreaterThanTest : public ::testing::Test { - public: +public: ObExprGreaterThanTest(); virtual ~ObExprGreaterThanTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprGreaterThanTest(const ObExprGreaterThanTest& other); ObExprGreaterThanTest& operator=(const ObExprGreaterThanTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_greatest_test.cpp b/unittest/sql/engine/expr/ob_expr_greatest_test.cpp index 70c549e97..ac6fda6d4 100644 --- a/unittest/sql/engine/expr/ob_expr_greatest_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_greatest_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprGreatestTest : public ::testing::Test { - public: +public: ObExprGreatestTest(); virtual ~ObExprGreatestTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprGreatestTest(const ObExprGreatestTest& other); ObExprGreatestTest& operator=(const ObExprGreatestTest& other); - private: +private: // data members }; ObExprGreatestTest::ObExprGreatestTest() diff --git a/unittest/sql/engine/expr/ob_expr_hex_test.cpp b/unittest/sql/engine/expr/ob_expr_hex_test.cpp index 5161d1d63..56d06121c 100644 --- a/unittest/sql/engine/expr/ob_expr_hex_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_hex_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprHexTest : public ::testing::Test { - public: +public: ObExprHexTest(); virtual ~ObExprHexTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprHexTest(const ObExprHexTest& other); ObExprHexTest& operator=(const ObExprHexTest& other); - private: +private: // data members }; ObExprHexTest::ObExprHexTest() diff --git a/unittest/sql/engine/expr/ob_expr_in_test.cpp b/unittest/sql/engine/expr/ob_expr_in_test.cpp index db15989ac..2b51d6866 100644 --- a/unittest/sql/engine/expr/ob_expr_in_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_in_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::sql; using namespace oceanbase::common; class ObExprInTest : public ::testing::Test { - public: +public: ObExprInTest(); virtual ~ObExprInTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprInTest(const ObExprInTest& other); ObExprInTest& operator=(const ObExprInTest& other); - protected: +protected: // data members }; @@ -2330,8 +2330,8 @@ TEST_F(ObExprInTest, basic_test) /// 2, datetime, 3); / R(ObIntType, 1, 8, 2, 4, timestamp, 1, timestamp, 2, timestamp, 2, timestamp, 1, timestamp, 1, /// timestamp, 2, timestamp, 2, timestamp, 3); / R(ObIntType, 1, 8, 2, 4, date, 1, date, 2, date, 2, date, 1, date, /// 1, date, 2, date, 2, date, 3); / R(ObIntType, 1, 8, 2, 4, time, 1, time, 2, time, 2, time, 1, time, 1, time, 2, - /// time, 2, time, 3); / R(ObIntType, 1, 8, 2, 4, year, 1, year, 2, year, 2, year, 1, year, 1, year, 2, year, 2, year, - /// 3); + /// time, 2, time, 3); / R(ObIntType, 1, 8, 2, 4, year, 1, year, 2, year, 2, year, 1, year, 1, year, 2, year, 2, + /// year, 3); // string R(ObIntType, diff --git a/unittest/sql/engine/expr/ob_expr_insert_test.cpp b/unittest/sql/engine/expr/ob_expr_insert_test.cpp index 3e9fd9c4c..1413541b6 100644 --- a/unittest/sql/engine/expr/ob_expr_insert_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_insert_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprInsertTest : public ::testing::Test { - public: +public: ObExprInsertTest(); virtual ~ObExprInsertTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprInsertTest(const ObExprInsertTest& other); ObExprInsertTest& operator=(const ObExprInsertTest& other); - private: +private: // data members }; ObExprInsertTest::ObExprInsertTest() diff --git a/unittest/sql/engine/expr/ob_expr_instr_test.cpp b/unittest/sql/engine/expr/ob_expr_instr_test.cpp index ff9b5b47a..912869128 100644 --- a/unittest/sql/engine/expr/ob_expr_instr_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_instr_test.cpp @@ -19,7 +19,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestAllocator : public ObIAllocator { - public: +public: TestAllocator() : label_(ObModIds::TEST) {} virtual ~TestAllocator() @@ -42,23 +42,23 @@ class TestAllocator : public ObIAllocator { label_ = label; }; - private: +private: const char* label_; }; class ObExprInstrTest : public ::testing::Test { - public: +public: ObExprInstrTest(); virtual ~ObExprInstrTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprInstrTest(const ObExprInstrTest& other); ObExprInstrTest& operator=(const ObExprInstrTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_int2ip_test.cpp b/unittest/sql/engine/expr/ob_expr_int2ip_test.cpp index bd1e128a6..0c4ec3a11 100644 --- a/unittest/sql/engine/expr/ob_expr_int2ip_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_int2ip_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprInt2ipTest : public ::testing::Test { - public: +public: ObExprInt2ipTest(); virtual ~ObExprInt2ipTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprInt2ipTest(const ObExprInt2ipTest& other); ObExprInt2ipTest& operator=(const ObExprInt2ipTest& other); - private: +private: // data members }; ObExprInt2ipTest::ObExprInt2ipTest() diff --git a/unittest/sql/engine/expr/ob_expr_int_div_test.cpp b/unittest/sql/engine/expr/ob_expr_int_div_test.cpp index d86d83184..55cda88c6 100644 --- a/unittest/sql/engine/expr/ob_expr_int_div_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_int_div_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprIntDivTest : public ::testing::Test { - public: +public: ObExprIntDivTest(); virtual ~ObExprIntDivTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprIntDivTest(const ObExprIntDivTest& other); ObExprIntDivTest& operator=(const ObExprIntDivTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_ip2int_test.cpp b/unittest/sql/engine/expr/ob_expr_ip2int_test.cpp index b9b9b1274..dec7930fd 100644 --- a/unittest/sql/engine/expr/ob_expr_ip2int_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_ip2int_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprIp2intTest : public ::testing::Test { - public: +public: ObExprIp2intTest(); virtual ~ObExprIp2intTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprIp2intTest(const ObExprIp2intTest& other); ObExprIp2intTest& operator=(const ObExprIp2intTest& other); - private: +private: // data members }; ObExprIp2intTest::ObExprIp2intTest() diff --git a/unittest/sql/engine/expr/ob_expr_is_not_test.cpp b/unittest/sql/engine/expr/ob_expr_is_not_test.cpp index 6575b156f..44304f444 100644 --- a/unittest/sql/engine/expr/ob_expr_is_not_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_is_not_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprIsNotTest : public ::testing::Test { - public: +public: ObExprIsNotTest(); virtual ~ObExprIsNotTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprIsNotTest(const ObExprIsNotTest& other); ObExprIsNotTest& operator=(const ObExprIsNotTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_is_test.cpp b/unittest/sql/engine/expr/ob_expr_is_test.cpp index 7e37e7f3f..0101721a5 100644 --- a/unittest/sql/engine/expr/ob_expr_is_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_is_test.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprIsTest : public ::testing::Test { - public: +public: ObExprIsTest(); virtual ~ObExprIsTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprIsTest(const ObExprIsTest& other); ObExprIsTest& operator=(const ObExprIsTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_least_test.cpp b/unittest/sql/engine/expr/ob_expr_least_test.cpp index e94edce5d..5c5ce660c 100644 --- a/unittest/sql/engine/expr/ob_expr_least_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_least_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprLeastTest : public ::testing::Test { - public: +public: ObExprLeastTest(); virtual ~ObExprLeastTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprLeastTest(const ObExprLeastTest& other); ObExprLeastTest& operator=(const ObExprLeastTest& other); - private: +private: // data members }; ObExprLeastTest::ObExprLeastTest() diff --git a/unittest/sql/engine/expr/ob_expr_length_test.cpp b/unittest/sql/engine/expr/ob_expr_length_test.cpp index 3cda7e8db..0b2addabb 100644 --- a/unittest/sql/engine/expr/ob_expr_length_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_length_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprLengthTest : public ::testing::Test { - public: +public: ObExprLengthTest(); virtual ~ObExprLengthTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprLengthTest(const ObExprLengthTest& other); ObExprLengthTest& operator=(const ObExprLengthTest& other); - private: +private: // data members }; ObExprLengthTest::ObExprLengthTest() diff --git a/unittest/sql/engine/expr/ob_expr_less_equal_test.cpp b/unittest/sql/engine/expr/ob_expr_less_equal_test.cpp index 9fd535110..dae59f984 100644 --- a/unittest/sql/engine/expr/ob_expr_less_equal_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_less_equal_test.cpp @@ -16,18 +16,18 @@ using namespace oceanbase::sql; using namespace oceanbase::common; class ObExprLessEqualTest : public ::testing::Test { - public: +public: ObExprLessEqualTest(); virtual ~ObExprLessEqualTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprLessEqualTest(const ObExprLessEqualTest& other); ObExprLessEqualTest& operator=(const ObExprLessEqualTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_less_than_test.cpp b/unittest/sql/engine/expr/ob_expr_less_than_test.cpp index 588df3098..d1ec7bc93 100644 --- a/unittest/sql/engine/expr/ob_expr_less_than_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_less_than_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::sql; using namespace oceanbase::common; class ObLessThanTest : public ::testing::Test { - public: +public: ObLessThanTest(); virtual ~ObLessThanTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObLessThanTest(const ObLessThanTest& other); ObLessThanTest& operator=(const ObLessThanTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_like_test.cpp b/unittest/sql/engine/expr/ob_expr_like_test.cpp index 56ee87f99..fae16c824 100644 --- a/unittest/sql/engine/expr/ob_expr_like_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_like_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprLikeTest : public ::testing::Test { - public: +public: ObExprLikeTest(); virtual ~ObExprLikeTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprLikeTest(const ObExprLikeTest& other); ObExprLikeTest& operator=(const ObExprLikeTest& other); - private: +private: // data members }; ObExprLikeTest::ObExprLikeTest() diff --git a/unittest/sql/engine/expr/ob_expr_lnnvl_test.cpp b/unittest/sql/engine/expr/ob_expr_lnnvl_test.cpp index 50acc4dfb..d1493b1a4 100644 --- a/unittest/sql/engine/expr/ob_expr_lnnvl_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_lnnvl_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprLnnvlTest : public ::testing::Test { - public: +public: ObExprLnnvlTest(); virtual ~ObExprLnnvlTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprLnnvlTest(const ObExprLnnvlTest& other); ObExprLnnvlTest& operator=(const ObExprLnnvlTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_locate_test.cpp b/unittest/sql/engine/expr/ob_expr_locate_test.cpp index 2f19334e7..cb771f209 100644 --- a/unittest/sql/engine/expr/ob_expr_locate_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_locate_test.cpp @@ -19,7 +19,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestAllocator : public ObIAllocator { - public: +public: TestAllocator() : label_(ObModIds::TEST) {} virtual ~TestAllocator() @@ -42,23 +42,23 @@ class TestAllocator : public ObIAllocator { label_ = label; }; - private: +private: const char* label_; }; class TestObExprLocateTest : public ::testing::Test { - public: +public: TestObExprLocateTest(); virtual ~TestObExprLocateTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestObExprLocateTest(const TestObExprLocateTest& other); TestObExprLocateTest& operator=(const TestObExprLocateTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_lower_test.cpp b/unittest/sql/engine/expr/ob_expr_lower_test.cpp index 3a970ccc9..5f1e93a88 100644 --- a/unittest/sql/engine/expr/ob_expr_lower_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_lower_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprLowerTest : public ::testing::Test { - public: +public: ObExprLowerTest(); virtual ~ObExprLowerTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprLowerTest(const ObExprLowerTest& other); ObExprLowerTest& operator=(const ObExprLowerTest& other); - private: +private: // data members }; ObExprLowerTest::ObExprLowerTest() diff --git a/unittest/sql/engine/expr/ob_expr_lrpad_test.cpp b/unittest/sql/engine/expr/ob_expr_lrpad_test.cpp index 537b092af..5c97e9dd9 100644 --- a/unittest/sql/engine/expr/ob_expr_lrpad_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_lrpad_test.cpp @@ -21,18 +21,18 @@ using namespace oceanbase::sql; using namespace oceanbase::share; class ObExprLRpadTest : public ::testing::Test { - public: +public: ObExprLRpadTest(); virtual ~ObExprLRpadTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprLRpadTest(const ObExprLRpadTest& other); ObExprLRpadTest& operator=(const ObExprLRpadTest& other); - private: +private: // data members }; ObExprLRpadTest::ObExprLRpadTest() diff --git a/unittest/sql/engine/expr/ob_expr_md5_test.cpp b/unittest/sql/engine/expr/ob_expr_md5_test.cpp index 28f8859fc..de8d01e24 100644 --- a/unittest/sql/engine/expr/ob_expr_md5_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_md5_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprMd5Test : public ::testing::Test { - public: +public: ObExprMd5Test(); virtual ~ObExprMd5Test(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprMd5Test(const ObExprMd5Test& other); ObExprMd5Test& operator=(const ObExprMd5Test& other); - private: +private: // data members }; ObExprMd5Test::ObExprMd5Test() diff --git a/unittest/sql/engine/expr/ob_expr_minus_test.cpp b/unittest/sql/engine/expr/ob_expr_minus_test.cpp index b2013c1e9..c9168ba3c 100644 --- a/unittest/sql/engine/expr/ob_expr_minus_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_minus_test.cpp @@ -20,18 +20,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprMinusTest : public ::testing::Test { - public: +public: ObExprMinusTest(); virtual ~ObExprMinusTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprMinusTest(const ObExprMinusTest& other); ObExprMinusTest& operator=(const ObExprMinusTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_mod_test.cpp b/unittest/sql/engine/expr/ob_expr_mod_test.cpp index 71c891a86..c2b4541b7 100644 --- a/unittest/sql/engine/expr/ob_expr_mod_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_mod_test.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprModTest : public ::testing::Test { - public: +public: ObExprModTest(); virtual ~ObExprModTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprModTest(const ObExprModTest& other); ObExprModTest& operator=(const ObExprModTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_mul_test.cpp b/unittest/sql/engine/expr/ob_expr_mul_test.cpp index a04213d36..f19e40f46 100644 --- a/unittest/sql/engine/expr/ob_expr_mul_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_mul_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprMulTest : public ::testing::Test { - public: +public: ObExprMulTest(); virtual ~ObExprMulTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprMulTest(const ObExprMulTest& other); ObExprMulTest& operator=(const ObExprMulTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_neg_test.cpp b/unittest/sql/engine/expr/ob_expr_neg_test.cpp index 9ec7b3e19..85ce14bb0 100644 --- a/unittest/sql/engine/expr/ob_expr_neg_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_neg_test.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprNegTest : public ::testing::Test { - public: +public: ObExprNegTest(); virtual ~ObExprNegTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprNegTest(const ObExprNegTest& other); ObExprNegTest& operator=(const ObExprNegTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_not_between_test.cpp b/unittest/sql/engine/expr/ob_expr_not_between_test.cpp index 85c909b9c..cb93b4893 100644 --- a/unittest/sql/engine/expr/ob_expr_not_between_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_not_between_test.cpp @@ -17,18 +17,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprNotBetweenTest : public ::testing::Test { - public: +public: ObExprNotBetweenTest(); virtual ~ObExprNotBetweenTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprNotBetweenTest(const ObExprNotBetweenTest& other); ObExprNotBetweenTest& operator=(const ObExprNotBetweenTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_not_equal_test.cpp b/unittest/sql/engine/expr/ob_expr_not_equal_test.cpp index 4ee84cf0e..0ad81cccc 100644 --- a/unittest/sql/engine/expr/ob_expr_not_equal_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_not_equal_test.cpp @@ -16,18 +16,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprNotEqualTest : public ::testing::Test { - public: +public: ObExprNotEqualTest(); virtual ~ObExprNotEqualTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprNotEqualTest(const ObExprNotEqualTest& other); ObExprNotEqualTest& operator=(const ObExprNotEqualTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_not_test.cpp b/unittest/sql/engine/expr/ob_expr_not_test.cpp index 6efc31a2c..5a3d7de45 100644 --- a/unittest/sql/engine/expr/ob_expr_not_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_not_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprNotTest : public ::testing::Test { - public: +public: ObExprNotTest(); virtual ~ObExprNotTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprNotTest(const ObExprNotTest& other); ObExprNotTest& operator=(const ObExprNotTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_nvl_test.cpp b/unittest/sql/engine/expr/ob_expr_nvl_test.cpp index 0ed90895a..fed442c51 100644 --- a/unittest/sql/engine/expr/ob_expr_nvl_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_nvl_test.cpp @@ -22,18 +22,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprNvlTest : public ::testing::Test { - public: +public: ObExprNvlTest(); virtual ~ObExprNvlTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprNvlTest(const ObExprNvlTest& other); ObExprNvlTest& operator=(const ObExprNvlTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_operator_factory_test.cpp b/unittest/sql/engine/expr/ob_expr_operator_factory_test.cpp index ea6884e98..6ec4fe60f 100644 --- a/unittest/sql/engine/expr/ob_expr_operator_factory_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_operator_factory_test.cpp @@ -17,19 +17,19 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestExprFactory : public ::testing::Test { - public: +public: TestExprFactory(); virtual ~TestExprFactory(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestExprFactory); - protected: +protected: // function members - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_quote_test.cpp b/unittest/sql/engine/expr/ob_expr_quote_test.cpp index 03bf49edb..38a1158da 100644 --- a/unittest/sql/engine/expr/ob_expr_quote_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_quote_test.cpp @@ -20,7 +20,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestAllocator : public ObIAllocator { - public: +public: TestAllocator() : label_(ObModIds::TEST) {} virtual ~TestAllocator() @@ -43,23 +43,23 @@ class TestAllocator : public ObIAllocator { label_ = label; }; - private: +private: const char* label_; }; class ObExprQuoteTest : public ::testing::Test { - public: +public: ObExprQuoteTest(); virtual ~ObExprQuoteTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprQuoteTest(const ObExprQuoteTest& other); ObExprQuoteTest& operator=(const ObExprQuoteTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_regexp_test.cpp b/unittest/sql/engine/expr/ob_expr_regexp_test.cpp index 5d0d57857..9de3bf740 100644 --- a/unittest/sql/engine/expr/ob_expr_regexp_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_regexp_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprRegexpTest : public ::testing::Test { - public: +public: ObExprRegexpTest(); virtual ~ObExprRegexpTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprRegexpTest(const ObExprRegexpTest& other); ObExprRegexpTest& operator=(const ObExprRegexpTest& other); - private: +private: // data members }; ObExprRegexpTest::ObExprRegexpTest() diff --git a/unittest/sql/engine/expr/ob_expr_replace_test.cpp b/unittest/sql/engine/expr/ob_expr_replace_test.cpp index 60eb62fc4..ecbefc28a 100644 --- a/unittest/sql/engine/expr/ob_expr_replace_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_replace_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprReplaceTest : public ::testing::Test { - public: +public: ObExprReplaceTest(); virtual ~ObExprReplaceTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprReplaceTest(const ObExprReplaceTest& other); ObExprReplaceTest& operator=(const ObExprReplaceTest& other); - private: +private: // data members }; ObExprReplaceTest::ObExprReplaceTest() diff --git a/unittest/sql/engine/expr/ob_expr_reverse_test.cpp b/unittest/sql/engine/expr/ob_expr_reverse_test.cpp index df2576abd..41ca6d8d7 100644 --- a/unittest/sql/engine/expr/ob_expr_reverse_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_reverse_test.cpp @@ -20,18 +20,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprFuncReverseTest : public ::testing::Test { - public: +public: ObExprFuncReverseTest(); virtual ~ObExprFuncReverseTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprFuncReverseTest(const ObExprFuncReverseTest& other); ObExprFuncReverseTest& operator=(const ObExprFuncReverseTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_right_test.cpp b/unittest/sql/engine/expr/ob_expr_right_test.cpp index 950db6c0f..2b28e5290 100644 --- a/unittest/sql/engine/expr/ob_expr_right_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_right_test.cpp @@ -20,18 +20,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprFuncRightTest : public ::testing::Test { - public: +public: ObExprFuncRightTest(); virtual ~ObExprFuncRightTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprFuncRightTest(const ObExprFuncRightTest& other); ObExprFuncRightTest& operator=(const ObExprFuncRightTest& other); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/expr/ob_expr_rpad_test.cpp b/unittest/sql/engine/expr/ob_expr_rpad_test.cpp index 9fb4b5f5b..6744c500e 100644 --- a/unittest/sql/engine/expr/ob_expr_rpad_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_rpad_test.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestAllocator : public ObIAllocator { - public: +public: TestAllocator() : label_(ObModIds::TEST) {} virtual ~TestAllocator() @@ -41,18 +41,18 @@ class TestAllocator : public ObIAllocator { label_ = label; }; - private: +private: const char* label_; }; class ObExprRpadTest : public ::testing::Test { - public: +public: ObExprRpadTest(); virtual ~ObExprRpadTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: ObExprRpadTest(const ObExprRpadTest& other); ObExprRpadTest& operator=(const ObExprRpadTest& other); }; diff --git a/unittest/sql/engine/expr/ob_expr_sign_test.cpp b/unittest/sql/engine/expr/ob_expr_sign_test.cpp index 99afffcdf..c7ae43d3e 100644 --- a/unittest/sql/engine/expr/ob_expr_sign_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_sign_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprSignTest : public ::testing::Test { - public: +public: ObExprSignTest(); virtual ~ObExprSignTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprSignTest(const ObExprSignTest& other); ObExprSignTest& operator=(const ObExprSignTest& other); - private: +private: // data members }; ObExprSignTest::ObExprSignTest() @@ -45,7 +45,7 @@ void ObExprSignTest::TearDown() {} class TestAllocator : public ObIAllocator { - public: +public: TestAllocator() : label_(ObModIds::TEST) {} virtual ~TestAllocator() @@ -68,7 +68,7 @@ class TestAllocator : public ObIAllocator { label_ = label; }; - private: +private: const char* label_; }; diff --git a/unittest/sql/engine/expr/ob_expr_str_to_date_test.cpp b/unittest/sql/engine/expr/ob_expr_str_to_date_test.cpp index e223222c5..235a9345a 100644 --- a/unittest/sql/engine/expr/ob_expr_str_to_date_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_str_to_date_test.cpp @@ -19,18 +19,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprStrtodateTest : public ::testing::Test { - public: +public: ObExprStrtodateTest(); virtual ~ObExprStrtodateTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprStrtodateTest(const ObExprStrtodateTest& other); ObExprStrtodateTest& operator=(const ObExprStrtodateTest& other); - private: +private: // data members }; ObExprStrtodateTest::ObExprStrtodateTest() diff --git a/unittest/sql/engine/expr/ob_expr_substr_test.cpp b/unittest/sql/engine/expr/ob_expr_substr_test.cpp index 03aa1dd0a..5272c7a86 100644 --- a/unittest/sql/engine/expr/ob_expr_substr_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_substr_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprSubstrTest : public ::testing::Test { - public: +public: ObExprSubstrTest(); virtual ~ObExprSubstrTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprSubstrTest(const ObExprSubstrTest& other); ObExprSubstrTest& operator=(const ObExprSubstrTest& other); - private: +private: // data members }; ObExprSubstrTest::ObExprSubstrTest() diff --git a/unittest/sql/engine/expr/ob_expr_substring_index_test.cpp b/unittest/sql/engine/expr/ob_expr_substring_index_test.cpp index 68149223c..717fa01ab 100644 --- a/unittest/sql/engine/expr/ob_expr_substring_index_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_substring_index_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprSubstringIndexTest : public ::testing::Test { - public: +public: ObExprSubstringIndexTest(); virtual ~ObExprSubstringIndexTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprSubstringIndexTest(const ObExprSubstringIndexTest& other); ObExprSubstringIndexTest& operator=(const ObExprSubstringIndexTest& other); - private: +private: // data members }; ObExprSubstringIndexTest::ObExprSubstringIndexTest() diff --git a/unittest/sql/engine/expr/ob_expr_test_utils.h b/unittest/sql/engine/expr/ob_expr_test_utils.h index ac72e3baf..be68415ee 100644 --- a/unittest/sql/engine/expr/ob_expr_test_utils.h +++ b/unittest/sql/engine/expr/ob_expr_test_utils.h @@ -24,7 +24,7 @@ static oceanbase::common::ObArenaAllocator g_alloc_; #define TEST_OPERATOR(expr_op) \ class Test##expr_op : public expr_op { \ - public: \ + public: \ Test##expr_op() : expr_op(g_alloc_) \ {} \ ~Test##expr_op() \ diff --git a/unittest/sql/engine/expr/ob_expr_trim_test.cpp b/unittest/sql/engine/expr/ob_expr_trim_test.cpp index 4272b242f..c18df7314 100644 --- a/unittest/sql/engine/expr/ob_expr_trim_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_trim_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprTrimTest : public ::testing::Test { - public: +public: ObExprTrimTest(); virtual ~ObExprTrimTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprTrimTest(const ObExprTrimTest& other); ObExprTrimTest& operator=(const ObExprTrimTest& other); - private: +private: // data members }; ObExprTrimTest::ObExprTrimTest() diff --git a/unittest/sql/engine/expr/ob_expr_unhex_test.cpp b/unittest/sql/engine/expr/ob_expr_unhex_test.cpp index a999bc93c..dc54df98f 100644 --- a/unittest/sql/engine/expr/ob_expr_unhex_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_unhex_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprUnhexTest : public ::testing::Test { - public: +public: ObExprUnhexTest(); virtual ~ObExprUnhexTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprUnhexTest(const ObExprUnhexTest& other); ObExprUnhexTest& operator=(const ObExprUnhexTest& other); - private: +private: // data members }; ObExprUnhexTest::ObExprUnhexTest() diff --git a/unittest/sql/engine/expr/ob_expr_upper_test.cpp b/unittest/sql/engine/expr/ob_expr_upper_test.cpp index 54709b034..61f7a04de 100644 --- a/unittest/sql/engine/expr/ob_expr_upper_test.cpp +++ b/unittest/sql/engine/expr/ob_expr_upper_test.cpp @@ -18,18 +18,18 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObExprUpperTest : public ::testing::Test { - public: +public: ObExprUpperTest(); virtual ~ObExprUpperTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExprUpperTest(const ObExprUpperTest& other); ObExprUpperTest& operator=(const ObExprUpperTest& other); - private: +private: // data members }; ObExprUpperTest::ObExprUpperTest() @@ -45,7 +45,7 @@ void ObExprUpperTest::TearDown() {} class TestAllocator : public ObIAllocator { - public: +public: TestAllocator() : label_(ObModIds::TEST) {} virtual ~TestAllocator() @@ -68,7 +68,7 @@ class TestAllocator : public ObIAllocator { label_ = label; }; - private: +private: const char* label_; }; diff --git a/unittest/sql/engine/expr/test_postfix_expression.cpp b/unittest/sql/engine/expr/test_postfix_expression.cpp index 3e3a12e47..b6e435262 100644 --- a/unittest/sql/engine/expr/test_postfix_expression.cpp +++ b/unittest/sql/engine/expr/test_postfix_expression.cpp @@ -19,7 +19,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestPostfixExpression : public ::testing::Test { - public: +public: TestPostfixExpression(); virtual ~TestPostfixExpression(); virtual void SetUp(); @@ -31,13 +31,13 @@ class TestPostfixExpression : public ::testing::Test { return time_val.tv_sec * 1000000 + time_val.tv_usec; } - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestPostfixExpression); - protected: +protected: // function members - protected: +protected: // data members }; diff --git a/unittest/sql/engine/join/join_data_generator.h b/unittest/sql/engine/join/join_data_generator.h index 991ce2b57..aa3350f1b 100644 --- a/unittest/sql/engine/join/join_data_generator.h +++ b/unittest/sql/engine/join/join_data_generator.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class JoinDataGenerator : public ObPhyOperator { - public: +public: const static int64_t CELL_CNT = 4; const static int64_t ROW_ID_CELL = 0; @@ -31,7 +31,7 @@ class JoinDataGenerator : public ObPhyOperator { const static int64_t INT_VARCHAR_BUF_SIZE = 10; class Ctx : public ObPhyOperatorCtx { - public: + public: Ctx(ObExecContext& c) : ObPhyOperatorCtx(c) {} virtual void destroy() @@ -169,7 +169,7 @@ class JoinDataGenerator : public ObPhyOperator { cells_[STR_CELL].set_varchar(str_, string_size_); } - public: +public: bool gen_varchar_cell_ = false; int64_t row_cnt_ = 1; bool reverse_ = false; @@ -181,7 +181,7 @@ class JoinDataGenerator : public ObPhyOperator { IdValFunc idx_val_ = [](const int64_t v) { return v; }; int iter_end_ret_ = OB_ITER_END; - private: +private: mutable common::ObNewRow row_; mutable common::ObObj cells_[CELL_CNT]; mutable int64_t row_id_ = 0; diff --git a/unittest/sql/engine/join/ob_hash_join_test.cpp b/unittest/sql/engine/join/ob_hash_join_test.cpp index cc72ceb6c..6cffde37b 100644 --- a/unittest/sql/engine/join/ob_hash_join_test.cpp +++ b/unittest/sql/engine/join/ob_hash_join_test.cpp @@ -34,7 +34,7 @@ using namespace oceanbase::observer; using namespace oceanbase::share; class MockSqlExpression : public ObSqlExpression { - public: +public: MockSqlExpression() : ObSqlExpression(alloc_) { set_item_count(10); @@ -44,11 +44,11 @@ class MockSqlExpression : public ObSqlExpression { }; class ObHashJoinTest : public ::testing::Test { - public: +public: ObHashJoinTest(); virtual ~ObHashJoinTest(); - protected: +protected: void join_test(int64_t case_id, ObJoinType join_type); void serialize_test(); void join_exception_test(int expect_ret); @@ -58,12 +58,12 @@ class ObHashJoinTest : public ::testing::Test { ObHashJoinTest(const ObHashJoinTest& other); ObHashJoinTest& operator=(const ObHashJoinTest& other); - private: +private: // data members }; class ObHashJoinPlan { - public: +public: static ObHashJoin& get_instance() { return hash_join_; @@ -129,7 +129,7 @@ class ObHashJoinPlan { allocator_.reuse(); } - private: +private: static void set_id() { hash_join_.set_id(0); @@ -201,10 +201,10 @@ class ObHashJoinPlan { return ret; } - private: +private: ObHashJoinPlan(); - private: +private: static ObPhysicalPlan phy_plan_; static MockSqlExpression equal_expr_[2]; static MockSqlExpression other_expr_[2]; diff --git a/unittest/sql/engine/join/ob_join_fake_table.h b/unittest/sql/engine/join/ob_join_fake_table.h index 0161c6fe6..81f184df2 100644 --- a/unittest/sql/engine/join/ob_join_fake_table.h +++ b/unittest/sql/engine/join/ob_join_fake_table.h @@ -43,7 +43,7 @@ typedef struct { } JoinData; class ObQueryRangeDummy { - public: +public: ObQueryRangeDummy() : scan_key_value_(0) {} ~ObQueryRangeDummy() @@ -57,12 +57,12 @@ class ObQueryRangeDummy { return scan_key_value_; } - private: +private: int64_t scan_key_value_; }; class ObJoinFakeTableScanInput : public ObIPhyOperatorInput { - public: +public: virtual int init(ObExecContext& ctx, ObTaskInfo& task_info, ObPhyOperator& op) { UNUSED(ctx); @@ -81,16 +81,16 @@ class ObJoinFakeTableScanInput : public ObIPhyOperatorInput { return query_range_; } - private: +private: ObQueryRangeDummy query_range_; }; static ObArenaAllocator alloc_; class ObJoinFakeTable : public ObPhyOperator { - protected: +protected: class ObJoinFakeTableCtx : public ObPhyOperatorCtx { friend class ObJoinFakeTable; - public: + public: ObJoinFakeTableCtx(ObExecContext& exex_ctx) : ObPhyOperatorCtx(exex_ctx), iter_(0) {} virtual void destroy() @@ -98,12 +98,12 @@ class ObJoinFakeTable : public ObPhyOperator { return ObPhyOperatorCtx::destroy_base(); } - private: + private: int64_t iter_; common::ObAddr server_; }; - public: +public: ObJoinFakeTable(); virtual ~ObJoinFakeTable(); int init(JoinOpTestType join_op_type); @@ -123,18 +123,18 @@ class ObJoinFakeTable : public ObPhyOperator { virtual int create_operator_input(ObExecContext& exec_ctx) const; virtual int inner_get_next_row(ObExecContext& exec_ctx, const common::ObNewRow*& row) const; - public: +public: int prepare_data(int64_t case_id, TableType table_type, ObJoinType join_type); void set_type(ObPhyOperatorType op_type) { op_type_ = op_type; } - private: +private: int cons_row(int64_t col1, int64_t col2, common::ObNewRow& row) const; int cons_row(int64_t col1, int64_t col2, int64_t col3, int64_t col4, common::ObNewRow& row) const; - private: +private: int64_t (*left_data_)[2]; int64_t (*right_data_)[2]; int64_t (*out_data_)[4]; diff --git a/unittest/sql/engine/join/ob_merge_join_test.cpp b/unittest/sql/engine/join/ob_merge_join_test.cpp index 589cf7eac..626a17b17 100644 --- a/unittest/sql/engine/join/ob_merge_join_test.cpp +++ b/unittest/sql/engine/join/ob_merge_join_test.cpp @@ -32,7 +32,7 @@ using namespace oceanbase::common; using namespace oceanbase::observer; using namespace oceanbase::share; class MockSqlExpression : public ObSqlExpression { - public: +public: MockSqlExpression() : ObSqlExpression(alloc_) { set_item_count(10); @@ -42,11 +42,11 @@ class MockSqlExpression : public ObSqlExpression { }; class ObMergeJoinTest : public ::testing::Test { - public: +public: ObMergeJoinTest(); virtual ~ObMergeJoinTest(); - protected: +protected: void join_test(int64_t case_id, ObJoinType join_type); void serialize_test(); void join_exception_test(int expect_ret); @@ -55,12 +55,12 @@ class ObMergeJoinTest : public ::testing::Test { ObMergeJoinTest(const ObMergeJoinTest& other); ObMergeJoinTest& operator=(const ObMergeJoinTest& other); - private: +private: // data members }; class ObMergeJoinPlan { - public: +public: static ObMergeJoin& get_instance() { return merge_join_; @@ -131,7 +131,7 @@ class ObMergeJoinPlan { allocator_.reuse(); } - private: +private: static void set_id() { merge_join_.set_id(0); @@ -203,10 +203,10 @@ class ObMergeJoinPlan { return ret; } - private: +private: ObMergeJoinPlan(); - private: +private: static ObPhysicalPlan phy_plan_; static MockSqlExpression equal_expr_[2]; static MockSqlExpression other_expr_[2]; diff --git a/unittest/sql/engine/join/ob_nested_loop_join_test.cpp b/unittest/sql/engine/join/ob_nested_loop_join_test.cpp index 3e3945e1b..fe8550cd8 100644 --- a/unittest/sql/engine/join/ob_nested_loop_join_test.cpp +++ b/unittest/sql/engine/join/ob_nested_loop_join_test.cpp @@ -24,11 +24,11 @@ using namespace oceanbase::sql::test; using namespace oceanbase::common; class ObNestedLoopJoinTest : public ::testing::Test { - public: +public: ObNestedLoopJoinTest(); virtual ~ObNestedLoopJoinTest(); - protected: +protected: void join_test(int64_t case_id, ObJoinType join_type); void serialize_test(); void join_exception_test(int expect_ret); @@ -37,12 +37,12 @@ class ObNestedLoopJoinTest : public ::testing::Test { ObNestedLoopJoinTest(const ObNestedLoopJoinTest& other); ObNestedLoopJoinTest& operator=(const ObNestedLoopJoinTest& other); - private: +private: // data members }; class ObNestedLoopJoinPlan { - public: +public: static ObNestedLoopJoin& get_instance() { return nested_loop_join_; @@ -88,7 +88,7 @@ class ObNestedLoopJoinPlan { allocator_.reuse(); } - private: +private: static void set_id() { nested_loop_join_.set_id(0); @@ -152,10 +152,10 @@ class ObNestedLoopJoinPlan { return ret; } - private: +private: ObNestedLoopJoinPlan(); - private: +private: static ObPhysicalPlan phy_plan_; static ObSqlExpression equal_expr_[2]; static ObSqlExpression other_expr_[2]; diff --git a/unittest/sql/engine/join/test_hash_join_dump.cpp b/unittest/sql/engine/join/test_hash_join_dump.cpp index 6de9b755d..194a28168 100644 --- a/unittest/sql/engine/join/test_hash_join_dump.cpp +++ b/unittest/sql/engine/join/test_hash_join_dump.cpp @@ -33,7 +33,7 @@ using namespace share; using namespace omt; class MockSqlExpression : public ObSqlExpression { - public: +public: MockSqlExpression(ObIAllocator& alloc) : ObSqlExpression(alloc) { set_item_count(10); @@ -44,7 +44,7 @@ class MockSqlExpression : public ObSqlExpression { #define TEST_HJ_DUMP_SET_HASH_AREA_SIZE(size) (set_hash_area_size(size)) class ObHashJoinDumpTest : public blocksstable::TestDataFilePrepare, public ::testing::WithParamInterface { - public: +public: ObHashJoinDumpTest() : blocksstable::TestDataFilePrepare("TestDiskIR", 2 << 20, 5000), hash_join_(alloc_), @@ -105,7 +105,7 @@ class ObHashJoinDumpTest : public blocksstable::TestDataFilePrepare, public ::te // iterate hash join result and verify result with merge join. void run_test(int64_t print_row_cnt = 0); - protected: +protected: struct JoinPlan { explicit JoinPlan(ObJoin& join, ObIAllocator& alloc) : join_(join), left_(alloc), right_(alloc), expr_(alloc) {} diff --git a/unittest/sql/engine/monitoring_dump/test_monitoring_dump.cpp b/unittest/sql/engine/monitoring_dump/test_monitoring_dump.cpp index 2df1df174..df974d356 100644 --- a/unittest/sql/engine/monitoring_dump/test_monitoring_dump.cpp +++ b/unittest/sql/engine/monitoring_dump/test_monitoring_dump.cpp @@ -43,9 +43,9 @@ static ObArenaAllocator alloc_; class ObSingleChildOperatorFake : public ObSingleChildPhyOperator { friend class ObPhyOperatorTest; - protected: +protected: class ObSingleOpCtx : public ObPhyOperator::ObPhyOperatorCtx { - public: + public: ObSingleOpCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual void destroy() @@ -54,7 +54,7 @@ class ObSingleChildOperatorFake : public ObSingleChildPhyOperator { } }; - public: +public: ObSingleChildOperatorFake() : ObSingleChildPhyOperator(alloc_) {} ObPhyOperatorType get_type() const @@ -90,7 +90,7 @@ class ObSingleChildOperatorFake : public ObSingleChildPhyOperator { } */ - protected: +protected: virtual int inner_get_next_row(ObExecContext& ctx, const ObNewRow*& row) const { int ret = OB_SUCCESS; @@ -134,9 +134,9 @@ class ObSingleChildOperatorFake : public ObSingleChildPhyOperator { } }; class ObTableScanFake : public ObNoChildrenPhyOperator { - protected: +protected: class ObTableScanFakeCtx : public ObPhyOperatorCtx { - public: + public: ObTableScanFakeCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual void destroy() @@ -145,7 +145,7 @@ class ObTableScanFake : public ObNoChildrenPhyOperator { } }; - public: +public: ObTableScanFake() : ObNoChildrenPhyOperator(alloc_), row_store_(NULL), store_size_(0), cur_index_(0) {} ObPhyOperatorType get_type() const @@ -189,7 +189,7 @@ class ObTableScanFake : public ObNoChildrenPhyOperator { } } - protected: +protected: virtual int inner_get_next_row(ObExecContext& ctx, const ObNewRow*& row) const { UNUSED(ctx); @@ -211,26 +211,26 @@ class ObTableScanFake : public ObNoChildrenPhyOperator { return ret; } - private: +private: ObNewRow* row_store_; int64_t store_size_; mutable int64_t cur_index_; }; class ObMonitoringDumpTest : public ::testing::Test { - public: +public: ObMonitoringDumpTest(){}; virtual ~ObMonitoringDumpTest() = default; virtual void SetUp(){}; virtual void TearDown(){}; void is_equal_content(const char* tmp_file, const char* result_file); - private: +private: // disallow copy ObMonitoringDumpTest(const ObMonitoringDumpTest& other); ObMonitoringDumpTest& operator=(const ObMonitoringDumpTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/px/ob_fake_partition_location_cache.h b/unittest/sql/engine/px/ob_fake_partition_location_cache.h index 4e7a91866..42f43ab09 100644 --- a/unittest/sql/engine/px/ob_fake_partition_location_cache.h +++ b/unittest/sql/engine/px/ob_fake_partition_location_cache.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace share { class ObFakePartitionKey { - public: +public: uint64_t table_id_; int64_t partition_id_; inline int64_t hash() const @@ -34,7 +34,7 @@ class ObFakePartitionKey { }; class ObFakePartitionLocationCache : public ObPartitionLocationCache { - public: +public: ObFakePartitionLocationCache(ObILocationFetcher& location_fetcher); virtual ~ObFakePartitionLocationCache(); @@ -44,7 +44,7 @@ class ObFakePartitionLocationCache : public ObPartitionLocationCache { int add_location(ObFakePartitionKey key, ObPartitionLocation location); - private: +private: common::hash::ObHashMap partition_loc_map_; DISALLOW_COPY_AND_ASSIGN(ObFakePartitionLocationCache); }; diff --git a/unittest/sql/engine/px/ob_fake_partition_service.h b/unittest/sql/engine/px/ob_fake_partition_service.h index d51044df8..986ededff 100644 --- a/unittest/sql/engine/px/ob_fake_partition_service.h +++ b/unittest/sql/engine/px/ob_fake_partition_service.h @@ -23,7 +23,7 @@ namespace oceanbase { namespace sql { class ObFakeTableScanIterator : public common::ObNewRowIterator { - public: +public: ObFakeTableScanIterator() : col_num_(0) {} virtual ~ObFakeTableScanIterator() @@ -42,18 +42,18 @@ class ObFakeTableScanIterator : public common::ObNewRowIterator { col_num_ = col_num; } - private: +private: common::ObRowStore::Iterator row_store_it_; int64_t col_num_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFakeTableScanIterator); }; } // namespace sql namespace storage { class ObFakePartitionServiceForSQL : public oceanbase::storage::ObPartitionService { - public: +public: ObFakePartitionServiceForSQL(); virtual ~ObFakePartitionServiceForSQL(); virtual int init(const blocksstable::ObStorageEnv& env, const common::ObAddr& self_addr, @@ -1298,21 +1298,21 @@ class ObFakePartitionServiceForSQL : public oceanbase::storage::ObPartitionServi return OB_SUCCESS; } - private: +private: common::ObScanner scanner_; int64_t col_num_; obrpc::ObCommonRpcProxy* rs_rpc_proxy_; ObPartitionServiceRpc* pts_rpc_; ObAddr addr_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFakePartitionServiceForSQL); }; class ObFakePartitionServiceForGI : public ObFakePartitionServiceForSQL { - public: +public: class ObGIResult { - public: + public: ObGIResult() : macros_count_idx_(), pkeys_(), macros_count_(){}; virtual ~ObGIResult() = default; int macros_count_idx_; @@ -1321,7 +1321,7 @@ class ObFakePartitionServiceForGI : public ObFakePartitionServiceForSQL { TO_STRING_KV(K(macros_count_), K(pkeys_)); }; - public: +public: ObFakePartitionServiceForGI() : ObFakePartitionServiceForSQL(), result_set_(), case_idx_(), pkey_idx_() {} virtual ~ObFakePartitionServiceForGI() = default; @@ -1330,13 +1330,13 @@ class ObFakePartitionServiceForGI : public ObFakePartitionServiceForSQL { const int64_t* total_task_count, ObIArray* splitted_ranges, common::ObIArray* split_index) override; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFakePartitionServiceForGI); - public: +public: ObSEArray result_set_; - private: +private: int case_idx_; int pkey_idx_; }; diff --git a/unittest/sql/engine/px/test_gi_pump.cpp b/unittest/sql/engine/px/test_gi_pump.cpp index 93c526883..90ca85eb6 100644 --- a/unittest/sql/engine/px/test_gi_pump.cpp +++ b/unittest/sql/engine/px/test_gi_pump.cpp @@ -38,7 +38,7 @@ using namespace oceanbase::share::schema; array.push_back(item) class ObGiPumpTest : public ::testing::Test { - public: +public: const static int64_t TEST_PARTITION_COUNT = 5; const static int64_t TEST_SPLIT_TASK_COUNT = 8; @@ -48,12 +48,12 @@ class ObGiPumpTest : public ::testing::Test { virtual void TearDown(); void TestGISplitTaskCase(int64_t case_idx); - private: +private: // disallow copy ObGiPumpTest(const ObGiPumpTest& other); ObGiPumpTest& operator=(const ObGiPumpTest& other); - public: +public: // data members ObSEArray pkeys_array_; ObFakePartitionServiceForGI partition_service_; diff --git a/unittest/sql/engine/px/test_merge_sort_receive.cpp b/unittest/sql/engine/px/test_merge_sort_receive.cpp index 6d2755d82..80056b9a8 100644 --- a/unittest/sql/engine/px/test_merge_sort_receive.cpp +++ b/unittest/sql/engine/px/test_merge_sort_receive.cpp @@ -29,27 +29,27 @@ using namespace oceanbase::common; using namespace oceanbase::sql::dtl; class ObMergeSortReceiveTest : public ::testing::Test { - public: +public: void test_sort(int64_t n_channel, bool local_order, int64_t row_count); int mock_channel_loop( ObPxMergeSortReceive::ObPxMergeSortReceiveCtx* recv_ctx, int64_t n_channel, int64_t row_count, bool local_order); int init_merge_sort_input(ObExecContext& ctx, ObPxMergeSortReceive::ObPxMergeSortReceiveCtx* recv_ctx, ObPxMergeSortReceive& merge_sort_receive, int64_t n_channel); - private: +private: int init_open(ObExecContext& ctx, ObPxMergeSortReceive& merge_sort_receive, int64_t n_channel, int64_t row_count, bool local_order); }; class ObMockPxNewRow : public ObPxNewRow { - public: +public: ObMockPxNewRow(int64_t count, bool local_order, int64_t n_channel) : count_(count), local_order_(local_order), cur_(0), n_channel_(n_channel) {} ~ObMockPxNewRow() = default; virtual int get_row(ObNewRow& row); - private: +private: int64_t count_; bool local_order_; int64_t cur_; @@ -57,7 +57,7 @@ class ObMockPxNewRow : public ObPxNewRow { }; class ObMockChannelLoop : public ObDtlChannelLoop { - public: +public: ObMockChannelLoop(int64_t n_channel) : n_channel_(n_channel), nth_process_channel_(0) {} ~ObMockChannelLoop() = default; @@ -65,7 +65,7 @@ class ObMockChannelLoop : public ObDtlChannelLoop { virtual int process_one(int64_t& nth_channel, int64_t timeout); virtual int process_one_if(PredFunc pred, int64_t timeout, int64_t& nth_channel); - private: +private: int64_t n_channel_; int64_t nth_process_channel_; }; diff --git a/unittest/sql/engine/px/test_random_affi.cpp b/unittest/sql/engine/px/test_random_affi.cpp index 2a99bec1c..8c36826ab 100644 --- a/unittest/sql/engine/px/test_random_affi.cpp +++ b/unittest/sql/engine/px/test_random_affi.cpp @@ -27,7 +27,7 @@ using namespace oceanbase::share; using namespace oceanbase::share::schema; class ObRandomAffiTaskSplitTest : public ::testing::Test { - public: +public: const static int64_t TEST_PARTITION_COUNT = 5; const static int64_t TEST_SPLIT_TASK_COUNT = 8; @@ -36,7 +36,7 @@ class ObRandomAffiTaskSplitTest : public ::testing::Test { virtual void SetUp(){}; virtual void TearDown(){}; - private: +private: // disallow copy ObRandomAffiTaskSplitTest(const ObRandomAffiTaskSplitTest& other); ObRandomAffiTaskSplitTest& operator=(const ObRandomAffiTaskSplitTest& other); diff --git a/unittest/sql/engine/recursive_cte/ob_recursive_cte_util.h b/unittest/sql/engine/recursive_cte/ob_recursive_cte_util.h index 8855d7b64..83f61ceff 100644 --- a/unittest/sql/engine/recursive_cte/ob_recursive_cte_util.h +++ b/unittest/sql/engine/recursive_cte/ob_recursive_cte_util.h @@ -43,7 +43,7 @@ } class TestRecursiveCTEFactory { - public: +public: TestRecursiveCTEFactory() {} ~TestRecursiveCTEFactory() @@ -355,7 +355,7 @@ class TestRecursiveCTEFactory { return physical_plan_; } - private: +private: static ObPhysicalPlan physical_plan_; static ObFakeTable fake_table1_planA_; static ObFakeTable fake_table2_PlanB_; diff --git a/unittest/sql/engine/set/ob_set_test_util.h b/unittest/sql/engine/set/ob_set_test_util.h index b3b41f6bf..f63a3fb2d 100644 --- a/unittest/sql/engine/set/ob_set_test_util.h +++ b/unittest/sql/engine/set/ob_set_test_util.h @@ -22,7 +22,7 @@ #include "sql/engine/test_engine_util.h" class TestSetOperatorFactory { - public: +public: TestSetOperatorFactory() {} ~TestSetOperatorFactory() @@ -101,7 +101,7 @@ class TestSetOperatorFactory { return physical_plan_; } - private: +private: static ObPhysicalPlan physical_plan_; static ObFakeTable fake_table1_; static ObFakeTable fake_table2_; diff --git a/unittest/sql/engine/set/set_data_generator.h b/unittest/sql/engine/set/set_data_generator.h index 077c750fb..4bae04e95 100644 --- a/unittest/sql/engine/set/set_data_generator.h +++ b/unittest/sql/engine/set/set_data_generator.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace sql { class SetDataGenerator : public ObPhyOperator { - public: +public: const static int64_t ROW_ID_CELL = 0; const static int64_t IDX_CELL = 1; const static int64_t STR_CELL = 2; @@ -29,7 +29,7 @@ class SetDataGenerator : public ObPhyOperator { const static int64_t INT_VARCHAR_BUF_SIZE = 10; class Ctx : public ObPhyOperatorCtx { - public: + public: Ctx(ObExecContext& c) : ObPhyOperatorCtx(c) {} virtual void destroy() @@ -168,7 +168,7 @@ class SetDataGenerator : public ObPhyOperator { cells_[STR_CELL].set_collation_type(ObCollationType::CS_TYPE_UTF8MB4_BIN); } - public: +public: bool gen_varchar_cell_ = false; int64_t row_cnt_ = 1; bool reverse_ = false; @@ -180,7 +180,7 @@ class SetDataGenerator : public ObPhyOperator { IdValFunc idx_val_ = [](const int64_t v) { return v; }; int iter_end_ret_ = OB_ITER_END; - private: +private: mutable common::ObNewRow row_; mutable common::ObObj cells_[CELL_CNT]; mutable int64_t row_id_ = 0; diff --git a/unittest/sql/engine/set/test_hash_set_dump.cpp b/unittest/sql/engine/set/test_hash_set_dump.cpp index d5e7614c0..0604b4955 100644 --- a/unittest/sql/engine/set/test_hash_set_dump.cpp +++ b/unittest/sql/engine/set/test_hash_set_dump.cpp @@ -38,7 +38,7 @@ using namespace share; using namespace omt; class MockSqlExpression : public ObSqlExpression { - public: +public: MockSqlExpression(ObIAllocator& alloc) : ObSqlExpression(alloc) { set_item_count(10); @@ -49,10 +49,10 @@ class MockSqlExpression : public ObSqlExpression { #define TEST_SET_DUMP_SET_HASH_AREA_SIZE(size) (set_hash_area_size(size)) class ObHashSetDumpTest : public blocksstable::TestDataFilePrepare, public ::testing::WithParamInterface { - public: +public: enum TestAlgo { UNION = 0, INTERSECT, EXCEPT }; - protected: +protected: struct SetPlan { explicit SetPlan(ObIAllocator& alloc) : set_op_(nullptr), left_(alloc), right_(alloc), expr_(alloc) {} @@ -68,7 +68,7 @@ class ObHashSetDumpTest : public blocksstable::TestDataFilePrepare, public ::tes MockSqlExpression expr_; }; - public: +public: ObHashSetDumpTest() : blocksstable::TestDataFilePrepare("TestDiskIR", 8 << 20, 5000), hash_union_(alloc_), @@ -145,7 +145,7 @@ class ObHashSetDumpTest : public blocksstable::TestDataFilePrepare, public ::tes // iterate hash join result and verify result with merge join. void run_test(int64_t print_row_cnt = 0); - protected: +protected: ObArenaAllocator alloc_; ObHashUnion hash_union_; diff --git a/unittest/sql/engine/set/test_merge_except.cpp b/unittest/sql/engine/set/test_merge_except.cpp index e02915ccd..3dcfa1e2a 100644 --- a/unittest/sql/engine/set/test_merge_except.cpp +++ b/unittest/sql/engine/set/test_merge_except.cpp @@ -27,7 +27,7 @@ using namespace oceanbase::sql; using namespace oceanbase::observer; class TestMergeExcept : public ObMergeExcept { - public: +public: TestMergeExcept() : ObMergeExcept(alloc_) {} ~TestMergeExcept() @@ -35,18 +35,18 @@ class TestMergeExcept : public ObMergeExcept { }; class TestMergeExceptTest : public ::testing::Test { - public: +public: TestMergeExceptTest(); virtual ~TestMergeExceptTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestMergeExceptTest(const TestMergeExceptTest& other); TestMergeExceptTest& operator=(const TestMergeExceptTest& other); - private: +private: // data members }; TestMergeExceptTest::TestMergeExceptTest() diff --git a/unittest/sql/engine/set/test_merge_intersect.cpp b/unittest/sql/engine/set/test_merge_intersect.cpp index 6f716ea41..bea3f7859 100644 --- a/unittest/sql/engine/set/test_merge_intersect.cpp +++ b/unittest/sql/engine/set/test_merge_intersect.cpp @@ -26,7 +26,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; using namespace oceanbase::observer; class TestMergeIntersect : public ObMergeIntersect { - public: +public: TestMergeIntersect() : ObMergeIntersect(alloc_) {} virtual ~TestMergeIntersect() @@ -34,18 +34,18 @@ class TestMergeIntersect : public ObMergeIntersect { }; class TestMergeIntersectTest : public ::testing::Test { - public: +public: TestMergeIntersectTest(); virtual ~TestMergeIntersectTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestMergeIntersectTest(const TestMergeIntersectTest& other); TestMergeIntersectTest& operator=(const TestMergeIntersectTest& other); - private: +private: // data members }; TestMergeIntersectTest::TestMergeIntersectTest() diff --git a/unittest/sql/engine/set/test_merge_union.cpp b/unittest/sql/engine/set/test_merge_union.cpp index d2fe7e311..0cee3630f 100644 --- a/unittest/sql/engine/set/test_merge_union.cpp +++ b/unittest/sql/engine/set/test_merge_union.cpp @@ -27,7 +27,7 @@ using namespace oceanbase::sql; using namespace oceanbase::observer; class TestMergeUnion : public ObMergeUnion { - public: +public: TestMergeUnion() : ObMergeUnion(alloc_) {} virtual ~TestMergeUnion() @@ -35,19 +35,19 @@ class TestMergeUnion : public ObMergeUnion { }; class TestMergeUnionTest : public ::testing::Test { - public: +public: TestMergeUnionTest(); virtual ~TestMergeUnionTest(); virtual void SetUp(); virtual void TearDown(); - protected: - private: +protected: +private: // disallow copy TestMergeUnionTest(const TestMergeUnionTest& other); TestMergeUnionTest& operator=(const TestMergeUnionTest& other); - private: +private: // data members }; TestMergeUnionTest::TestMergeUnionTest() diff --git a/unittest/sql/engine/sort/ob_fake_table.h b/unittest/sql/engine/sort/ob_fake_table.h index b48a7dbc9..e5a2f712e 100644 --- a/unittest/sql/engine/sort/ob_fake_table.h +++ b/unittest/sql/engine/sort/ob_fake_table.h @@ -21,7 +21,7 @@ namespace test { static common::ObArenaAllocator alloc_; // fake table to feed input for testing class ObFakeTable : public ObPhyOperator { - public: +public: const static int64_t COL0_RAND_STR = 0; const static int64_t COL1_ROW_ID = 1; const static int64_t COL2_ROW_ID_MOD_2 = 2; @@ -39,11 +39,11 @@ class ObFakeTable : public ObPhyOperator { const static int64_t COL14_RAND_INT = 14; const static int64_t COL15_RAND_INT = 15; - protected: +protected: class ObFakeTableCtx : public ObPhyOperatorCtx { friend class ObFakeTable; - public: + public: ObFakeTableCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx), get_count_(0) { buf_[0] = '\0'; @@ -55,15 +55,15 @@ class ObFakeTable : public ObPhyOperator { return ObPhyOperatorCtx::destroy_base(); } - private: + private: static const int VARCHAR_CELL_BUF_SIZE = 32; - private: + private: int64_t get_count_; char buf_[VARCHAR_CELL_BUF_SIZE]; }; - public: +public: ObFakeTable(); virtual ~ObFakeTable(); virtual ObPhyOperatorType get_type() const @@ -86,16 +86,16 @@ class ObFakeTable : public ObPhyOperator { n_segments_local_merge_sort_ = n_segments_local_merge_sort; } - protected: +protected: virtual int inner_get_next_row(ObExecContext& exec_ctx, const common::ObNewRow*& row) const; virtual int init_op_ctx(ObExecContext& ctx) const; - private: +private: // types and constants // static const int COLUMN_COUNT = 16; static const int COLUMN_COUNT = 32; - private: +private: // disallow copy ObFakeTable(const ObFakeTable& other); ObFakeTable& operator=(const ObFakeTable& other); @@ -106,7 +106,7 @@ class ObFakeTable : public ObPhyOperator { int rand_int(int max) const; virtual int inner_create_operator_ctx(ObExecContext& exec_ctx, ObPhyOperatorCtx*& op_ctx) const; - protected: +protected: int64_t row_count_; int64_t n_segments_local_merge_sort_; }; diff --git a/unittest/sql/engine/sort/ob_in_memory_sort_test.cpp b/unittest/sql/engine/sort/ob_in_memory_sort_test.cpp index 2b482601a..4f4a59c0b 100644 --- a/unittest/sql/engine/sort/ob_in_memory_sort_test.cpp +++ b/unittest/sql/engine/sort/ob_in_memory_sort_test.cpp @@ -25,7 +25,7 @@ using namespace oceanbase::common; using oceanbase::sql::test::ObFakeTable; class TestInMemorySortTest : public ::testing::Test { - public: +public: struct ColumnOpt { int64_t col; ObCollationType cs_type; @@ -34,12 +34,12 @@ class TestInMemorySortTest : public ::testing::Test { TestInMemorySortTest(); virtual ~TestInMemorySortTest(); - private: +private: // disallow copy TestInMemorySortTest(const TestInMemorySortTest& other); TestInMemorySortTest& operator=(const TestInMemorySortTest& other); - protected: +protected: typedef ObSArray ObSortColumns; void sort_test( int64_t row_count, ObArray& columns, ObBaseSort* base_sort, int64_t column_keys_pos = -1); @@ -48,7 +48,7 @@ class TestInMemorySortTest : public ::testing::Test { void serialize_test(int expect_ret); void sort_exception_test(int expect_ret); - private: +private: int init(ObBaseSort* base_sort, ObFakeTable& input_table, int64_t row_count, ObArray& columns, ObSortColumns& sort_columns); void cons_sort_columns(ObArray& columns, ObSortColumns& sort_columns); diff --git a/unittest/sql/engine/sort/ob_merge_sort_test.cpp b/unittest/sql/engine/sort/ob_merge_sort_test.cpp index 0a9506e84..02ac278f0 100644 --- a/unittest/sql/engine/sort/ob_merge_sort_test.cpp +++ b/unittest/sql/engine/sort/ob_merge_sort_test.cpp @@ -31,7 +31,7 @@ using namespace oceanbase::blocksstable; using oceanbase::sql::test::ObFakeTable; class TestMergeSort : public ObMergeSort { - public: +public: TestMergeSort(ObIAllocator& alloc) : ObMergeSort(alloc) {} ~TestMergeSort() @@ -45,7 +45,7 @@ class TestMergeSortTest : public oceanbase::blocksstable::TestDataFilePrepare { static const int64_t MACRO_BLOCK_COUNT = 50 * 1024; static const uint64_t TENATN_ID = 1; - public: +public: TestMergeSortTest(); virtual ~TestMergeSortTest(); virtual void SetUp(); @@ -53,18 +53,18 @@ class TestMergeSortTest : public oceanbase::blocksstable::TestDataFilePrepare { int init_tenant_mgr(); void destroy_tenant_mgr(); - private: +private: // disallow copy TestMergeSortTest(const TestMergeSortTest& other); TestMergeSortTest& operator=(const TestMergeSortTest& other); - protected: +protected: typedef ObSArray ObSortColumns; void sort_test(int64_t run_count, int64_t row_count, int64_t sort_col1, ObCollationType cs_type1, int64_t sort_col2, ObCollationType cs_type2); void sort_exception_test(int expect_ret); - private: +private: int init_op(TestMergeSort& merge_sort, ObFakeTable& input_table, ObSortColumns& sort_cols, int64_t row_count, int64_t sort_col1, ObCollationType cs_type1, int64_t sort_col2, ObCollationType cs_type2); int init_data(TestMergeSort& merge_sort, ObBaseSort& in_mem_sort, ObFakeTable& input_table, ObSortColumns& sort_cols, @@ -74,7 +74,7 @@ class TestMergeSortTest : public oceanbase::blocksstable::TestDataFilePrepare { void copy_cell_varchar(ObObj& cell, char* buf, int64_t buf_size); void cons_new_row(ObNewRow& row, int64_t column_count); - private: +private: ObPhysicalPlan physical_plan_; ObArenaAllocator alloc_; }; diff --git a/unittest/sql/engine/sort/ob_sort_test.cpp b/unittest/sql/engine/sort/ob_sort_test.cpp index 091292ef7..56275bb9e 100644 --- a/unittest/sql/engine/sort/ob_sort_test.cpp +++ b/unittest/sql/engine/sort/ob_sort_test.cpp @@ -38,16 +38,16 @@ using oceanbase::sql::test::ObFakeTable; #define TEST_SORT_DUMP_SET_HASH_AREA_SIZE(size) (set_sort_area_size(size)) class ObSortTest : public blocksstable::TestDataFilePrepare { - public: +public: ObSortTest(); virtual ~ObSortTest(); - private: +private: // disallow copy ObSortTest(const ObSortTest& other); ObSortTest& operator=(const ObSortTest& other); - protected: +protected: virtual void SetUp() override { GCONF.enable_sql_operator_dump.set_value("True"); @@ -100,7 +100,7 @@ class ObSortTest : public blocksstable::TestDataFilePrepare { void serialize_test(); void sort_exception_test(int expect_ret); - private: +private: static void copy_cell_varchar(ObObj& cell, char* buf, int64_t buf_size) { ObString str; @@ -127,7 +127,7 @@ class ObSortTest : public blocksstable::TestDataFilePrepare { }; class ObSortPlan { - public: +public: static ObSort& get_instance() { return *sort_; @@ -192,7 +192,7 @@ class ObSortPlan { row_count_ = -1; } - private: +private: ObSortPlan(); static void cons_run_filename(ObString& filename) { @@ -201,8 +201,8 @@ class ObSortPlan { return; } - public: - private: +public: +private: static ObPhysicalPlan* physical_plan_; static ObFakeTable* input_table_; static ObSort* sort_; @@ -549,7 +549,7 @@ TEST_F(ObSortTest, prefix_merge_sort_test) } class MockExpr : public ObSqlExpression { - public: +public: MockExpr(ObIAllocator& alloc, int64_t cnt) : ObSqlExpression(alloc) { set_item_count(1); diff --git a/unittest/sql/engine/sort/ob_specific_columns_sort_test.cpp b/unittest/sql/engine/sort/ob_specific_columns_sort_test.cpp index b876556fb..8403f5ad0 100644 --- a/unittest/sql/engine/sort/ob_specific_columns_sort_test.cpp +++ b/unittest/sql/engine/sort/ob_specific_columns_sort_test.cpp @@ -27,7 +27,7 @@ using namespace oceanbase::common; using oceanbase::sql::test::ObFakeTable; class TestInMemorySpecificColumnsSortTest : public ::testing::Test { - public: +public: struct ColumnOpt { int64_t col; ObCollationType cs_type; @@ -36,12 +36,12 @@ class TestInMemorySpecificColumnsSortTest : public ::testing::Test { TestInMemorySpecificColumnsSortTest(); virtual ~TestInMemorySpecificColumnsSortTest(); - private: +private: // disallow copy TestInMemorySpecificColumnsSortTest(const TestInMemorySpecificColumnsSortTest& other); TestInMemorySpecificColumnsSortTest& operator=(const TestInMemorySpecificColumnsSortTest& other); - protected: +protected: typedef ObSArray ObSortColumns; void sort_test( int64_t row_count, ObArray& columns, ObBaseSort* base_sort, int64_t column_keys_pos = -1); @@ -50,7 +50,7 @@ class TestInMemorySpecificColumnsSortTest : public ::testing::Test { void serialize_test(int expect_ret); void sort_exception_test(int expect_ret); - private: +private: int init(ObBaseSort* base_sort, ObFakeTable& input_table, int64_t row_count, ObArray& columns, ObSortColumns& sort_columns); void cons_sort_columns(ObArray& columns, ObSortColumns& sort_columns); diff --git a/unittest/sql/engine/sort/test_sort_impl.cpp b/unittest/sql/engine/sort/test_sort_impl.cpp index c8410993e..b6fe3db79 100644 --- a/unittest/sql/engine/sort/test_sort_impl.cpp +++ b/unittest/sql/engine/sort/test_sort_impl.cpp @@ -38,7 +38,7 @@ using namespace oceanbase::common; using namespace oceanbase::omt; class TestSortImpl : public blocksstable::TestDataFilePrepare { - public: +public: TestSortImpl() : blocksstable::TestDataFilePrepare("TestDiskIR", 2 << 20, 1000), data_(alloc_) {} void set_sort_area_size(int64_t size) diff --git a/unittest/sql/engine/subquery/test_subplan_filter.cpp b/unittest/sql/engine/subquery/test_subplan_filter.cpp index cd22f69b7..c6c3cb195 100644 --- a/unittest/sql/engine/subquery/test_subplan_filter.cpp +++ b/unittest/sql/engine/subquery/test_subplan_filter.cpp @@ -30,7 +30,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; using namespace oceanbase::observer; class ObSubPlanFilterTest : public ::testing::Test { - public: +public: ObSubPlanFilterTest(); virtual ~ObSubPlanFilterTest(); virtual void SetUp(); @@ -42,7 +42,7 @@ class ObSubPlanFilterTest : public ::testing::Test { void init_plan(ObExecContext& ctx); void init_plan_for_calc(ObExecContext& ctx); - protected: +protected: ObFakeTable fake_table1_; ObFakeTable fake_table2_; ObLimit limit_; @@ -50,12 +50,12 @@ class ObSubPlanFilterTest : public ::testing::Test { ObSubPlanFilter subplan_filter_; ObPhysicalPlan physical_plan_; - private: +private: // disallow copy ObSubPlanFilterTest(const ObSubPlanFilterTest& other); ObSubPlanFilterTest& operator=(const ObSubPlanFilterTest& other); - private: +private: // data members }; diff --git a/unittest/sql/engine/table/ob_fake_partition_location_cache.h b/unittest/sql/engine/table/ob_fake_partition_location_cache.h index d55a6dd1c..c065a3921 100644 --- a/unittest/sql/engine/table/ob_fake_partition_location_cache.h +++ b/unittest/sql/engine/table/ob_fake_partition_location_cache.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace share { class ObFakePartitionKey { - public: +public: uint64_t table_id_; int64_t partition_id_; inline int64_t hash() const @@ -34,7 +34,7 @@ class ObFakePartitionKey { }; class ObFakePartitionLocationCache : public ObPartitionLocationCache { - public: +public: ObFakePartitionLocationCache(); virtual ~ObFakePartitionLocationCache(); @@ -44,7 +44,7 @@ class ObFakePartitionLocationCache : public ObPartitionLocationCache { int add_location(ObFakePartitionKey key, ObPartitionLocation location); - private: +private: common::hash::ObHashMap partition_loc_map_; DISALLOW_COPY_AND_ASSIGN(ObFakePartitionLocationCache); }; diff --git a/unittest/sql/engine/table/ob_fake_partition_service.h b/unittest/sql/engine/table/ob_fake_partition_service.h index f6d8ef92c..9c6ab4f75 100644 --- a/unittest/sql/engine/table/ob_fake_partition_service.h +++ b/unittest/sql/engine/table/ob_fake_partition_service.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace sql { class ObFakeTableScanIterator : public common::ObNewRowIterator { - public: +public: ObFakeTableScanIterator() {} virtual ~ObFakeTableScanIterator() @@ -40,18 +40,18 @@ class ObFakeTableScanIterator : public common::ObNewRowIterator { col_num_ = col_num; } - private: +private: common::ObRowStore::Iterator row_store_it_; int64_t col_num_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFakeTableScanIterator); }; } // namespace sql namespace storage { class ObFakePartitionService : public ObPartitionService { - public: +public: ObFakePartitionService(); virtual ~ObFakePartitionService(); @@ -182,11 +182,11 @@ class ObFakePartitionService : public ObPartitionService { return OB_ERROR; } - private: +private: common::ObScanner scanner_; int64_t col_num_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObFakePartitionService); }; diff --git a/unittest/sql/engine/table/ob_fake_table.h b/unittest/sql/engine/table/ob_fake_table.h index 5caa37e94..a8f97d2bd 100644 --- a/unittest/sql/engine/table/ob_fake_table.h +++ b/unittest/sql/engine/table/ob_fake_table.h @@ -199,9 +199,9 @@ int fill_row(ObNewRow& row, ...) } static ObArenaAllocator alloc_; class ObFakeTable : public ObNoChildrenPhyOperator { - private: +private: class ObFakeTableCtx : public ObPhyOperatorCtx { - public: + public: ObFakeTableCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} int init(int64_t projector_size) @@ -226,12 +226,12 @@ class ObFakeTable : public ObNoChildrenPhyOperator { int64_t projector_size_; int32_t* projector_; - private: + private: ObRowStore::Iterator row_store_it_; friend class ObFakeTable; }; - public: +public: ObFakeTable(ObIAllocator& alloc) : ObNoChildrenPhyOperator(alloc), no_rescan_(false) {} @@ -297,7 +297,7 @@ class ObFakeTable : public ObNoChildrenPhyOperator { return OB_SUCCESS; } - private: +private: /** * @brief create operator context, only child operator can know it's specific operator type, * so must be overwrited by child operator, @@ -350,7 +350,7 @@ class ObFakeTable : public ObNoChildrenPhyOperator { DISALLOW_COPY_AND_ASSIGN(ObFakeTable); - private: +private: ObRowStore row_store_; bool no_rescan_; }; diff --git a/unittest/sql/engine/test_empty_table_scan.cpp b/unittest/sql/engine/test_empty_table_scan.cpp index c16bd9c56..1019ea41e 100644 --- a/unittest/sql/engine/test_empty_table_scan.cpp +++ b/unittest/sql/engine/test_empty_table_scan.cpp @@ -21,7 +21,7 @@ using namespace oceanbase::sql; using namespace oceanbase::share; class ObEmptyTableScanTest : public ::testing::Test { - public: +public: const static int64_t TEST_COL_NUM = 2; const static int64_t TEST_TABLE_ID = 1; @@ -37,12 +37,12 @@ class ObEmptyTableScanTest : public ::testing::Test { virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObEmptyTableScanTest(const ObEmptyTableScanTest& other); ObEmptyTableScanTest& operator=(const ObEmptyTableScanTest& other); - private: +private: // data members }; ObEmptyTableScanTest::ObEmptyTableScanTest() diff --git a/unittest/sql/engine/test_engine.cpp b/unittest/sql/engine/test_engine.cpp index 7470be09f..5d3433199 100644 --- a/unittest/sql/engine/test_engine.cpp +++ b/unittest/sql/engine/test_engine.cpp @@ -23,22 +23,22 @@ #include "observer/ob_req_time_service.h" namespace test { class TestEngine : public TestOptimizerUtils { - public: +public: TestEngine(); virtual ~TestEngine(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestEngine); - protected: +protected: // function members void do_code_generate(const ObLogPlan& log_plan, ObPhysicalPlan& phy_plan); int test_phy_plan(ObPhysicalPlan& plan); - protected: +protected: // data members }; diff --git a/unittest/sql/engine/test_exec_context.cpp b/unittest/sql/engine/test_exec_context.cpp index b4a175f13..7acb18c01 100644 --- a/unittest/sql/engine/test_exec_context.cpp +++ b/unittest/sql/engine/test_exec_context.cpp @@ -33,18 +33,18 @@ using namespace oceanbase::observer; using namespace oceanbase::share; class ObExecContextTest : public ::testing::Test { - public: +public: ObExecContextTest(); virtual ~ObExecContextTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObExecContextTest(const ObExecContextTest& other); ObExecContextTest& operator=(const ObExecContextTest& other); - private: +private: // data members }; ObExecContextTest::ObExecContextTest() @@ -60,7 +60,7 @@ void ObExecContextTest::TearDown() {} class ObPhyOperatorCtxFake : public ObPhyOperator::ObPhyOperatorCtx { - public: +public: ObPhyOperatorCtxFake(ObExecContext& ctx); ~ObPhyOperatorCtxFake(); virtual void destroy() @@ -71,7 +71,7 @@ class ObPhyOperatorCtxFake : public ObPhyOperator::ObPhyOperatorCtx { void set_phy_op_ctx_a(int a); void set_phy_op_ctx_b(int b); - private: +private: int phy_op_ctx_a_; int phy_op_ctx_b_; }; @@ -99,7 +99,7 @@ int ObPhyOperatorCtxFake::phy_op_calc() } class ObRootTransmitInput : public ObIPhyOperatorInput { - public: +public: ObRootTransmitInput(ObExecContext& ctx) : input_param_a_(0) { UNUSED(ctx); @@ -147,7 +147,7 @@ class ObRootTransmitInput : public ObIPhyOperatorInput { return PHY_ROOT_TRANSMIT; } - private: +private: int64_t input_param_a_; }; diff --git a/unittest/sql/engine/test_phy_operator.cpp b/unittest/sql/engine/test_phy_operator.cpp index a9a7c466e..d6f8b42ab 100644 --- a/unittest/sql/engine/test_phy_operator.cpp +++ b/unittest/sql/engine/test_phy_operator.cpp @@ -34,9 +34,9 @@ static ObArenaAllocator alloc_; class ObSingleChildOperatorFake : public ObSingleChildPhyOperator { friend class ObPhyOperatorTest; - protected: +protected: class ObSingleOpCtx : public ObPhyOperator::ObPhyOperatorCtx { - public: + public: ObSingleOpCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual void destroy() @@ -45,7 +45,7 @@ class ObSingleChildOperatorFake : public ObSingleChildPhyOperator { } }; - public: +public: ObSingleChildOperatorFake() : ObSingleChildPhyOperator(alloc_) {} ObPhyOperatorType get_type() const @@ -69,7 +69,7 @@ class ObSingleChildOperatorFake : public ObSingleChildPhyOperator { return ret; } - protected: +protected: virtual int inner_get_next_row(ObExecContext& ctx, const ObNewRow*& row) const { int ret = OB_SUCCESS; @@ -113,9 +113,9 @@ class ObSingleChildOperatorFake : public ObSingleChildPhyOperator { } }; class ObTableScanFake : public ObNoChildrenPhyOperator { - protected: +protected: class ObTableScanFakeCtx : public ObPhyOperatorCtx { - public: + public: ObTableScanFakeCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) {} virtual void destroy() @@ -124,7 +124,7 @@ class ObTableScanFake : public ObNoChildrenPhyOperator { } }; - public: +public: ObTableScanFake() : ObNoChildrenPhyOperator(alloc_), row_store_(NULL), store_size_(0), cur_index_(0) {} ObPhyOperatorType get_type() const @@ -168,7 +168,7 @@ class ObTableScanFake : public ObNoChildrenPhyOperator { } } - protected: +protected: virtual int inner_get_next_row(ObExecContext& ctx, const ObNewRow*& row) const { UNUSED(ctx); @@ -190,14 +190,14 @@ class ObTableScanFake : public ObNoChildrenPhyOperator { return ret; } - private: +private: ObNewRow* row_store_; int64_t store_size_; mutable int64_t cur_index_; }; class ObPhyOperatorTest : public ::testing::Test { - public: +public: ObPhyOperatorTest(); virtual ~ObPhyOperatorTest(); virtual void SetUp(); @@ -222,12 +222,12 @@ class ObPhyOperatorTest : public ::testing::Test { return phy_op.wrap_expr_ctx(exec_ctx, expr_ctx); } - private: +private: // disallow copy ObPhyOperatorTest(const ObPhyOperatorTest& other); ObPhyOperatorTest& operator=(const ObPhyOperatorTest& other); - private: +private: // data members }; ObPhyOperatorTest::ObPhyOperatorTest() diff --git a/unittest/sql/engine/test_physical_plan.cpp b/unittest/sql/engine/test_physical_plan.cpp index 3b4a65108..03e982290 100644 --- a/unittest/sql/engine/test_physical_plan.cpp +++ b/unittest/sql/engine/test_physical_plan.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::share::schema; namespace oceanbase { namespace sql { class TestPhysicalPlan : public ::testing::Test { - public: +public: TestPhysicalPlan() {} virtual ~TestPhysicalPlan() diff --git a/unittest/sql/engine/test_sql_fixed_array.cpp b/unittest/sql/engine/test_sql_fixed_array.cpp index a0991d8ba..f4cde8ebf 100644 --- a/unittest/sql/engine/test_sql_fixed_array.cpp +++ b/unittest/sql/engine/test_sql_fixed_array.cpp @@ -22,7 +22,7 @@ namespace oceanbase { namespace sql { class ObTestSqlFixedArray : public ::testing::Test { - public: +public: ObTestSqlFixedArray() {} ~ObTestSqlFixedArray() @@ -32,7 +32,7 @@ class ObTestSqlFixedArray : public ::testing::Test { virtual void TearDown() {} - private: +private: DISALLOW_COPY_AND_ASSIGN(ObTestSqlFixedArray); }; diff --git a/unittest/sql/executor/ob_mock_utils.h b/unittest/sql/executor/ob_mock_utils.h index ac8be3388..115c521c6 100644 --- a/unittest/sql/executor/ob_mock_utils.h +++ b/unittest/sql/executor/ob_mock_utils.h @@ -24,7 +24,7 @@ namespace sql { static const int64_t TEST_MOCK_COL_NUM = 3; class ObMockSqlExecutorRpc : public ObExecutorRpcImpl { - public: +public: ObMockSqlExecutorRpc(); virtual ~ObMockSqlExecutorRpc(); virtual int task_submit(ObExecContext& ctx, ObTask& task, const common::ObAddr& svr); @@ -36,22 +36,22 @@ class ObMockSqlExecutorRpc : public ObExecutorRpcImpl { virtual int task_fetch_result( const ObSliceID& ob_slice_id, const common::ObAddr& svr, FetchResultStreamHandle& handler); - public: +public: share::ObFakePartitionLocationCache partition_loc_cache_; storage::ObFakePartitionService partition_service_; - private: +private: bool task_location_exist(ObTaskLocation task_loc); - private: +private: common::ObArray task_loc_array_; - private: +private: DISALLOW_COPY_AND_ASSIGN(ObMockSqlExecutorRpc); }; class ObMockRemoteExecuteStreamHandle : public RemoteExecuteStreamHandle { - public: +public: ObMockRemoteExecuteStreamHandle(common::ObIAllocator& alloc) : RemoteExecuteStreamHandle(alloc) {} ~ObMockRemoteExecuteStreamHandle() @@ -61,7 +61,7 @@ class ObMockRemoteExecuteStreamHandle : public RemoteExecuteStreamHandle { }; class ObMockFetchResultStreamHandle : public FetchResultStreamHandle { - public: +public: ObMockFetchResultStreamHandle(common::ObIAllocator& alloc) : FetchResultStreamHandle(alloc) {} ~ObMockFetchResultStreamHandle() @@ -78,10 +78,10 @@ class ObMockFetchResultStreamHandle : public FetchResultStreamHandle { ob_slice_id_ = ob_slice_id; } - private: +private: bool task_location_exist(ObTaskLocation task_loc); - private: +private: common::ObArray task_loc_array_; common::ObAddr server_; ObSliceID ob_slice_id_; @@ -89,7 +89,7 @@ class ObMockFetchResultStreamHandle : public FetchResultStreamHandle { /************************************mock packet queue********************************/ class ObMockPacketQueueThread : public share::ObThreadPool { - public: +public: static const int64_t THREAD_COUNT = 1; static ObMockPacketQueueThread* get_instance(); @@ -101,7 +101,7 @@ class ObMockPacketQueueThread : public share::ObThreadPool { common::ObSPopMPushQueue packet_queue_; - private: +private: static ObMockPacketQueueThread* instance_; static tbutil::Mutex locker_; }; diff --git a/unittest/sql/module/test_parser_resolver.cpp b/unittest/sql/module/test_parser_resolver.cpp index b3387a42d..961ea6499 100644 --- a/unittest/sql/module/test_parser_resolver.cpp +++ b/unittest/sql/module/test_parser_resolver.cpp @@ -18,18 +18,18 @@ #define OK(value) ASSERT_EQ(OB_SUCCESS, (value)) class ObParserResolver : public ::testing::Test { - public: +public: ObParserResolver(); virtual ~ObParserResolver(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObParserResolver(const ObParserResolver& other); ObParserResolver& operator=(const ObParserResolver& other); - protected: +protected: // data members }; diff --git a/unittest/sql/monitor/test_monitor_info_manager.cpp b/unittest/sql/monitor/test_monitor_info_manager.cpp index e17bf7614..3f5f1061d 100644 --- a/unittest/sql/monitor/test_monitor_info_manager.cpp +++ b/unittest/sql/monitor/test_monitor_info_manager.cpp @@ -154,7 +154,7 @@ static const int64_t TEST_GET_COUNT = 4; namespace oceanbase { namespace sql { class TestMonitorInfoManager : public ::testing::Test, public share::ObThreadPool { - public: +public: TestMonitorInfoManager() : seq_(0), monitor_mgr_() // test1_(&monitor_mgr_), // test2_(&monitor_mgr_) @@ -202,7 +202,7 @@ class TestMonitorInfoManager : public ::testing::Test, public share::ObThreadPoo int do_gc(); int build_monitor_info(int64_t query_id, int64_t plan_id, ObPhyPlanMonitorInfo* plan); - public: +public: int64_t seq_; ObMonitorInfoManager monitor_mgr_; // TestGetByQueryId test1_; diff --git a/unittest/sql/monitor/test_phy_operator_stats.cpp b/unittest/sql/monitor/test_phy_operator_stats.cpp index ef2e9d716..03883a43c 100644 --- a/unittest/sql/monitor/test_phy_operator_stats.cpp +++ b/unittest/sql/monitor/test_phy_operator_stats.cpp @@ -23,7 +23,7 @@ using namespace oceanbase::sql; namespace oceanbase { namespace sql { class TestPhyOperatorStats : public ::testing::Test { - public: +public: TestPhyOperatorStats() {} ~TestPhyOperatorStats() diff --git a/unittest/sql/ob_mock_partition_location_cache.h b/unittest/sql/ob_mock_partition_location_cache.h index 173defeea..654e671c0 100644 --- a/unittest/sql/ob_mock_partition_location_cache.h +++ b/unittest/sql/ob_mock_partition_location_cache.h @@ -19,7 +19,7 @@ using oceanbase::share::ObPartitionLocation; using oceanbase::share::ObReplicaLocation; class MockPartitionLocationCache : public oceanbase::share::ObPartitionLocationCache { - public: +public: MockPartitionLocationCache() : ObPartitionLocationCache(fetcher_) {} virtual ~MockPartitionLocationCache() @@ -32,7 +32,7 @@ class MockPartitionLocationCache : public oceanbase::share::ObPartitionLocationC virtual int nonblock_get(const uint64_t table_id, const int64_t partition_id, ObPartitionLocation& location, const int64_t cluster_id = -1); - private: +private: oceanbase::share::ObLocationFetcher fetcher_; }; diff --git a/unittest/sql/optimizer/ob_mock_opt_stat_manager.h b/unittest/sql/optimizer/ob_mock_opt_stat_manager.h index ed85ba0d1..97745882a 100644 --- a/unittest/sql/optimizer/ob_mock_opt_stat_manager.h +++ b/unittest/sql/optimizer/ob_mock_opt_stat_manager.h @@ -307,7 +307,7 @@ namespace test { // }; class MockOptStatService : public oceanbase::common::ObOptStatService { - public: +public: static MockOptStatService& get_instance() { static MockOptStatService instance_; @@ -375,14 +375,14 @@ class MockOptStatService : public oceanbase::common::ObOptStatService { tstat_ = oceanbase::common::ObOptStatManager::get_default_table_stat(); } - private: +private: ObOptTableStat tstat_; ObOptColumnStat cstat_; ObHistogram hist_; }; class MockOptStatManager : public oceanbase::common::ObOptStatManager { - public: +public: static MockOptStatManager& get_instance() { static MockOptStatManager instance_; diff --git a/unittest/sql/optimizer/ob_mock_part_mgr.h b/unittest/sql/optimizer/ob_mock_part_mgr.h index d7915765c..9b3a846ef 100644 --- a/unittest/sql/optimizer/ob_mock_part_mgr.h +++ b/unittest/sql/optimizer/ob_mock_part_mgr.h @@ -27,7 +27,7 @@ class ObSchemaManager; } // namespace oceanbase namespace test { class ObMockPartMgr : public oceanbase::common::ObPartMgr { - public: +public: ObMockPartMgr() : schema_guard_(NULL) {} diff --git a/unittest/sql/optimizer/ob_mock_partition.h b/unittest/sql/optimizer/ob_mock_partition.h index bef0f3df8..1136d9b10 100644 --- a/unittest/sql/optimizer/ob_mock_partition.h +++ b/unittest/sql/optimizer/ob_mock_partition.h @@ -24,7 +24,7 @@ namespace test { class MockObPGPartition : public oceanbase::storage::ObPGPartition { - public: +public: MockObPGPartition() {} ~MockObPGPartition() @@ -34,12 +34,12 @@ class MockObPGPartition : public oceanbase::storage::ObPGPartition { return &storage_; } - private: +private: MockPartitionStorage storage_; }; class MockPartition : public oceanbase::storage::ObPartitionGroup { - public: +public: virtual oceanbase::storage::ObPartitionStorage* get_storage() { return NULL; @@ -61,7 +61,7 @@ class MockPartition : public oceanbase::storage::ObPartitionGroup { return pg_partition_.storage_; } - private: +private: MockObPGPartition pg_partition_; }; } // namespace test diff --git a/unittest/sql/optimizer/ob_mock_partition_service.h b/unittest/sql/optimizer/ob_mock_partition_service.h index c959e6429..7b4d8ff6f 100644 --- a/unittest/sql/optimizer/ob_mock_partition_service.h +++ b/unittest/sql/optimizer/ob_mock_partition_service.h @@ -26,7 +26,7 @@ using namespace oceanbase; namespace test { class MockPartitionService : public oceanbase::storage::ObPartitionService { - public: +public: MockPartitionService() {} virtual ~MockPartitionService() diff --git a/unittest/sql/optimizer/ob_mock_partition_storage.h b/unittest/sql/optimizer/ob_mock_partition_storage.h index 49157c4c8..3c5a0ae6e 100644 --- a/unittest/sql/optimizer/ob_mock_partition_storage.h +++ b/unittest/sql/optimizer/ob_mock_partition_storage.h @@ -18,7 +18,7 @@ namespace test { class MockPartitionStorage : public oceanbase::storage::ObPartitionStorage { - public: +public: MockPartitionStorage() : is_default_stat_(false) {} virtual ~MockPartitionStorage() @@ -45,7 +45,7 @@ class MockPartitionStorage : public oceanbase::storage::ObPartitionStorage { is_default_stat_ = is_default_stat; } - private: +private: bool is_default_stat_; }; } // namespace test diff --git a/unittest/sql/optimizer/ob_mock_stat_manager.h b/unittest/sql/optimizer/ob_mock_stat_manager.h index 60c30a32d..e0f6e4199 100644 --- a/unittest/sql/optimizer/ob_mock_stat_manager.h +++ b/unittest/sql/optimizer/ob_mock_stat_manager.h @@ -21,7 +21,7 @@ #include "share/schema/ob_column_schema.h" namespace test { class MockTableStatService : public oceanbase::common::ObTableStatDataService { - public: +public: static const int64_t DEFAULT_ROW_COUNT = 100; static const int64_t DEFAULT_ROW_SIZE = 100; static const int64_t DEFAULT_DATA_SIZE = DEFAULT_ROW_COUNT * DEFAULT_ROW_SIZE; @@ -60,12 +60,12 @@ class MockTableStatService : public oceanbase::common::ObTableStatDataService { table_stat_.set_row_count(row_count); } - private: +private: ObTableStat table_stat_; }; class MockColumnStatService : public oceanbase::common::ObColumnStatDataService { - public: +public: MockColumnStatService() {} virtual ~MockColumnStatService() @@ -133,7 +133,7 @@ class MockStatManager : public oceanbase::common::ObStatManager { static const int64_t DATE_MAX_VALUE = 2932896; static const int64_t DATE_MIN_VALUE = -354258; - public: +public: struct ColumnStatInfo { ObObj min_; ObObj max_; @@ -327,7 +327,7 @@ class MockStatManager : public oceanbase::common::ObStatManager { table2_row_count_ = table2_row_count; } - private: +private: oceanbase::sql::ObSchemaChecker* schema_checker_; ObArenaAllocator allocator_; ObSEArray column_stats_; diff --git a/unittest/sql/optimizer/ob_stdin_iter.h b/unittest/sql/optimizer/ob_stdin_iter.h index 3d1611dd4..18cac7cc1 100644 --- a/unittest/sql/optimizer/ob_stdin_iter.h +++ b/unittest/sql/optimizer/ob_stdin_iter.h @@ -34,7 +34,7 @@ using namespace sql; namespace common { class ObMockIterWithLimit : public ObNewRowIterator { - public: +public: ObMockIterWithLimit() : need_row_count_(0), got_row_count_(0){}; virtual ~ObMockIterWithLimit(){}; @@ -53,7 +53,7 @@ class ObMockIterWithLimit : public ObNewRowIterator { return need_row_count_ == got_row_count_; } - protected: +protected: void advance_iter() { ++got_row_count_; @@ -91,7 +91,7 @@ class ObMockIterWithLimit : public ObNewRowIterator { #define DECLARE_RANDOM_CELL_GEN(type) \ class RANDOM_CELL_GEN_CLASS_NAME(type) : public RandomCellGen { \ - public: \ + public: \ RANDOM_CELL_GEN_CLASS_NAME(type)() \ { \ type_ = AT_(type); \ @@ -111,16 +111,16 @@ class ObMockIterWithLimit : public ObNewRowIterator { } class ObStdinIter : public ObMockIterWithLimit { - public: +public: enum EOFBehavior { TERMINATE, REWIND, RANDOM }; - private: +private: EOFBehavior on_eof_; int64_t get_count_; bool pure_random_; class IRandomCellGen { - public: + public: virtual ObObj gen(ObIAllocator& buf, int64_t seed) = 0; void set_max(ObObj max) { @@ -136,7 +136,7 @@ class ObStdinIter : public ObMockIterWithLimit { }; class RandomCellGen : public IRandomCellGen { - public: + public: RandomCellGen() : type_(ObNullType), acc_(NULL), need_random(false), length(0), common_prefix_len(10), my_buf(NULL){}; virtual ObObj gen(ObIAllocator& buf, int64_t seed) = 0; @@ -185,7 +185,7 @@ class ObStdinIter : public ObMockIterWithLimit { char str_main_buf_[STR_MAIN_BUF_SIZE]; int64_t str_main_buf_ptr; - public: +public: ObStdinIter(ObIAllocator& buf) : on_eof_(TERMINATE), time_consumed_(0), @@ -287,14 +287,14 @@ class ObStdinIter : public ObMockIterWithLimit { }; static ObArenaAllocator alloc_; class MyMockOperator : public ObPhyOperator { - public: +public: mutable int64_t time_; class MyMockCtx : public ObPhyOperatorCtx { friend class MyMockOperator; - public: + public: MyMockCtx(ObExecContext& ctx) : ObPhyOperatorCtx(ctx) { UNUSED(ctx); diff --git a/unittest/sql/optimizer/test_explain_json_format.cpp b/unittest/sql/optimizer/test_explain_json_format.cpp index cb60f1e61..9b2209fa1 100644 --- a/unittest/sql/optimizer/test_explain_json_format.cpp +++ b/unittest/sql/optimizer/test_explain_json_format.cpp @@ -38,18 +38,18 @@ using namespace oceanbase::json; namespace test { class ObLogPlanTest : public ::testing::Test { - public: +public: ObLogPlanTest(); virtual ~ObLogPlanTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy ObLogPlanTest(const ObLogPlanTest& other); ObLogPlanTest& operator=(const ObLogPlanTest& other); - private: +private: // data members }; diff --git a/unittest/sql/optimizer/test_join_order.cpp b/unittest/sql/optimizer/test_join_order.cpp index 03ad40fa6..1a7817d77 100644 --- a/unittest/sql/optimizer/test_join_order.cpp +++ b/unittest/sql/optimizer/test_join_order.cpp @@ -22,7 +22,7 @@ class Path; } // namespace oceanbase namespace test { class TestJoinOrder : public TestOptimizerUtils { - public: +public: TestJoinOrder() {} ~TestJoinOrder() diff --git a/unittest/sql/optimizer/test_json_format.cpp b/unittest/sql/optimizer/test_json_format.cpp index 141194c2d..83abc9051 100644 --- a/unittest/sql/optimizer/test_json_format.cpp +++ b/unittest/sql/optimizer/test_json_format.cpp @@ -19,13 +19,13 @@ using namespace oceanbase::json; // using namespace oceanbase::sql; class TestJsonFormat : public ::testing::Test { - public: +public: TestJsonFormat(){}; virtual ~TestJsonFormat(){}; virtual void SetUp(){}; virtual void TearDown(){}; - private: +private: // disallow copy and assign TestJsonFormat(const TestJsonFormat& other); TestJsonFormat& operator=(const TestJsonFormat& ohter); diff --git a/unittest/sql/optimizer/test_location_part_id.cpp b/unittest/sql/optimizer/test_location_part_id.cpp index 6da10d763..ac74ce862 100644 --- a/unittest/sql/optimizer/test_location_part_id.cpp +++ b/unittest/sql/optimizer/test_location_part_id.cpp @@ -24,7 +24,7 @@ using namespace oceanbase::sql; using namespace oceanbase::observer; namespace test { class TestLocationPartitionId : public TestOptimizerUtils { - public: +public: TestLocationPartitionId() {} ~TestLocationPartitionId() diff --git a/unittest/sql/optimizer/test_opt_est_sel.cpp b/unittest/sql/optimizer/test_opt_est_sel.cpp index d2c5b33a5..ff410a4d3 100644 --- a/unittest/sql/optimizer/test_opt_est_sel.cpp +++ b/unittest/sql/optimizer/test_opt_est_sel.cpp @@ -36,7 +36,7 @@ class TestOptEstSel : public TestOptimizerUtils { }; static const uint8_t YEAR_MAX_VALUE = 10; - public: +public: TestOptEstSel(); virtual ~TestOptEstSel(); virtual void SetUp(); @@ -56,14 +56,14 @@ class TestOptEstSel : public TestOptimizerUtils { void get_log_plan(ObStmt& stmt, ObLogPlan*& plan); void run_test(const char* test_file, const char* result_file, const char* tmp_file, int64_t flag); - protected: +protected: ObOptimizerContext* optctx_; ObAddr addr_; ObQueryHint query_hint_; bool is_datetime_; oceanbase::sql::ObSchemaChecker schema_checker_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestOptEstSel); }; diff --git a/unittest/sql/optimizer/test_optimizer.cpp b/unittest/sql/optimizer/test_optimizer.cpp index dbbedce6d..67947a053 100644 --- a/unittest/sql/optimizer/test_optimizer.cpp +++ b/unittest/sql/optimizer/test_optimizer.cpp @@ -29,7 +29,7 @@ using namespace oceanbase::observer; namespace test { class TestOptimizer : public TestOptimizerUtils { - public: +public: TestOptimizer() {} ~TestOptimizer() diff --git a/unittest/sql/optimizer/test_optimizer_utils.h b/unittest/sql/optimizer/test_optimizer_utils.h index 6d04da7c3..fb1d8f603 100644 --- a/unittest/sql/optimizer/test_optimizer_utils.h +++ b/unittest/sql/optimizer/test_optimizer_utils.h @@ -48,17 +48,17 @@ using oceanbase::sql::ObTableLocation; namespace test { class MockCacheObjectFactory { - public: +public: static int alloc(ObCacheObject*& cache_obj, ObCacheObjType co_type, uint64_t tenant_id = common::OB_SERVER_TENANT_ID); static int alloc(ObPhysicalPlan*& plan, uint64_t tenant_id = common::OB_SERVER_TENANT_ID); static void free(ObCacheObject* cache_obj); - private: +private: static void inner_free(ObCacheObject*); }; class TestOptimizerUtils : public TestSqlUtils, public ::testing::Test { - public: +public: TestOptimizerUtils(); virtual ~TestOptimizerUtils(); virtual void init(); @@ -132,7 +132,7 @@ class TestOptimizerUtils : public TestSqlUtils, public ::testing::Test { return ret; } - protected: +protected: int64_t case_id_; ObOptimizerContext* optctx_; bool is_json_; @@ -146,7 +146,7 @@ class TestOptimizerUtils : public TestSqlUtils, public ::testing::Test { ::test::MockOptStatService opt_stat_; ::test::MockPartitionService partition_service_; // data members - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestOptimizerUtils); // function members diff --git a/unittest/sql/optimizer/test_route_policy.cpp b/unittest/sql/optimizer/test_route_policy.cpp index 22e0fed54..6d8ac76f8 100644 --- a/unittest/sql/optimizer/test_route_policy.cpp +++ b/unittest/sql/optimizer/test_route_policy.cpp @@ -28,7 +28,7 @@ using namespace oceanbase::storage; using namespace oceanbase::share; namespace test { class ObRoutePolicyTest : public ::testing::Test { - public: +public: ObRoutePolicyTest() : addr_(), part_service_(), route_policy_(addr_, part_service_), route_policy_ctx_() { route_policy_.has_readonly_zone_ = true; @@ -41,7 +41,7 @@ class ObRoutePolicyTest : public ::testing::Test { ObRoutePolicy::PositionType pos_type, ObRoutePolicy::MergeStatus merge_status, ObZoneType zone_type, oceanbase::share::ObZoneStatus::Status zone_status); - public: +public: ObAddr addr_; ObPartitionService part_service_; ObRoutePolicy route_policy_; diff --git a/unittest/sql/optimizer/test_skyline_prunning.cpp b/unittest/sql/optimizer/test_skyline_prunning.cpp index 294615c2b..57ac0c1e6 100644 --- a/unittest/sql/optimizer/test_skyline_prunning.cpp +++ b/unittest/sql/optimizer/test_skyline_prunning.cpp @@ -21,7 +21,7 @@ using namespace oceanbase::common; namespace test { class ObSkylinePrunningTest : public ::testing::Test { - public: +public: ObSkylinePrunningTest() {} virtual ~ObSkylinePrunningTest() @@ -47,7 +47,7 @@ class ObSkylinePrunningTest : public ::testing::Test { const uint64_t* filter_ids, const int64_t filter_cnt, const uint64_t* interest_ids, const int64_t interest_cnt, const uint64_t* range_ids, const int64_t range_cnt); - protected: +protected: ObArenaAllocator allocator_; }; diff --git a/unittest/sql/parser/test_multi_parser.cpp b/unittest/sql/parser/test_multi_parser.cpp index 4d23834d7..ea64133fa 100644 --- a/unittest/sql/parser/test_multi_parser.cpp +++ b/unittest/sql/parser/test_multi_parser.cpp @@ -26,17 +26,17 @@ using namespace oceanbase::sql; namespace test { class TestMultiParser : public TestSqlUtils, public ::testing::Test { - public: +public: TestMultiParser(); virtual ~TestMultiParser(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestMultiParser); - protected: +protected: // data members ObArenaAllocator allocator_; }; diff --git a/unittest/sql/parser/test_parser.cpp b/unittest/sql/parser/test_parser.cpp index 368a075fd..e369ca6a8 100644 --- a/unittest/sql/parser/test_parser.cpp +++ b/unittest/sql/parser/test_parser.cpp @@ -23,17 +23,17 @@ using namespace oceanbase::common; using namespace oceanbase::sql; namespace test { class TestParser : public TestSqlUtils, public ::testing::Test { - public: +public: TestParser(); virtual ~TestParser(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestParser); - protected: +protected: // function members void do_parse(const char* query_str, std::ofstream& of_result, int64_t expect_error = OB_SUCCESS); void print_parse_tree(const char* query_str, std::ofstream& of_result, int64_t expect_error = OB_SUCCESS); @@ -41,7 +41,7 @@ class TestParser : public TestSqlUtils, public ::testing::Test { void do_filter_hint(const char* query_str, std::ofstream& of_result, int64_t expect_error = OB_SUCCESS); bool pretreat_cmd(std::string line, int64_t& expect_error); - protected: +protected: // data members ObArenaAllocator allocator_; }; diff --git a/unittest/sql/parser/test_parser_perf.cpp b/unittest/sql/parser/test_parser_perf.cpp index 451b7426e..f27f1bc07 100644 --- a/unittest/sql/parser/test_parser_perf.cpp +++ b/unittest/sql/parser/test_parser_perf.cpp @@ -30,15 +30,15 @@ static bool PRINT_STAT = false; static bool IS_FP = false; class TestParserPerf { - public: +public: TestParserPerf(); virtual ~TestParserPerf(); void do_parse(const char* query_str); - private: +private: DISALLOW_COPY_AND_ASSIGN(TestParserPerf); - public: +public: ObArenaAllocator allocator_; int64_t total_t_; int64_t total_cnt_; diff --git a/unittest/sql/plan_cache/test_id_manager_allocator.cpp b/unittest/sql/plan_cache/test_id_manager_allocator.cpp index 35ed75ef8..9ca6271f8 100644 --- a/unittest/sql/plan_cache/test_id_manager_allocator.cpp +++ b/unittest/sql/plan_cache/test_id_manager_allocator.cpp @@ -17,13 +17,13 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class ObIdManagerAllocatorTest : public ::testing::Test { - public: +public: ObIdManagerAllocatorTest(); virtual ~ObIdManagerAllocatorTest(); void SetUp(); void TearDown(); - private: +private: DISALLOW_COPY_AND_ASSIGN(ObIdManagerAllocatorTest); }; diff --git a/unittest/sql/plan_cache/test_pcv_set.cpp b/unittest/sql/plan_cache/test_pcv_set.cpp index ee3ea241d..0d1a355cf 100644 --- a/unittest/sql/plan_cache/test_pcv_set.cpp +++ b/unittest/sql/plan_cache/test_pcv_set.cpp @@ -83,7 +83,7 @@ void generate_plan(TestSqlCtx& test_sql_ctx, const char* query, ParamStore& para } class TestPCVSet : public ::testing::Test { - public: +public: TestPCVSet() {} virtual ~TestPCVSet() @@ -93,7 +93,7 @@ class TestPCVSet : public ::testing::Test { void TearDown() {} - private: +private: // disallow copy TestPCVSet(const TestPCVSet& other); TestPCVSet& operator=(const TestPCVSet& other); diff --git a/unittest/sql/plan_cache/test_plan_cache.cpp b/unittest/sql/plan_cache/test_plan_cache.cpp index 4ec816476..029f6554b 100644 --- a/unittest/sql/plan_cache/test_plan_cache.cpp +++ b/unittest/sql/plan_cache/test_plan_cache.cpp @@ -55,7 +55,7 @@ void init_pc() } class TestPlanCache : public ::testing::Test { - public: +public: TestPlanCache() {} virtual ~TestPlanCache() @@ -65,7 +65,7 @@ class TestPlanCache : public ::testing::Test { void TearDown() {} - private: +private: // disallow copy TestPlanCache(const TestPlanCache& other); TestPlanCache& operator=(const TestPlanCache& other); @@ -293,7 +293,7 @@ void alter_table_schema_version() } class PlanCacheRunnable : public share::ObThreadPool { - public: +public: void run1() { UNUSED(arg); diff --git a/unittest/sql/plan_cache/test_plan_cache_manager.cpp b/unittest/sql/plan_cache/test_plan_cache_manager.cpp index f5d1baff4..70e00cf16 100644 --- a/unittest/sql/plan_cache/test_plan_cache_manager.cpp +++ b/unittest/sql/plan_cache/test_plan_cache_manager.cpp @@ -40,7 +40,7 @@ void init_pcm() } class TestPlanCacheManager : public ::testing::Test { - public: +public: TestPlanCacheManager() {} virtual ~TestPlanCacheManager() @@ -50,7 +50,7 @@ class TestPlanCacheManager : public ::testing::Test { void TearDown() {} - private: +private: // disallow copy TestPlanCacheManager(const TestPlanCacheManager& other); TestPlanCacheManager& operator=(const TestPlanCacheManager& other); @@ -79,7 +79,7 @@ void test_plan_cache_manager() } class ObPlanCacheManagerRunnable : public share::ObThreadPool { - public: +public: void run1() { test_plan_cache_manager(); diff --git a/unittest/sql/plan_cache/test_plan_cache_value.cpp b/unittest/sql/plan_cache/test_plan_cache_value.cpp index fa57652dc..5a173b7c4 100644 --- a/unittest/sql/plan_cache/test_plan_cache_value.cpp +++ b/unittest/sql/plan_cache/test_plan_cache_value.cpp @@ -54,7 +54,7 @@ void init_pcv() } class TestPlanCacheValue : public ::testing::Test { - public: +public: TestPlanCacheValue() {} virtual ~TestPlanCacheValue() @@ -64,7 +64,7 @@ class TestPlanCacheValue : public ::testing::Test { void TearDown() {} - private: +private: // disallow copy TestPlanCacheValue(const TestPlanCacheValue& other); TestPlanCacheValue& operator=(const TestPlanCacheValue& other); diff --git a/unittest/sql/plan_cache/test_plan_set.cpp b/unittest/sql/plan_cache/test_plan_set.cpp index 494bc8e56..2ab532482 100644 --- a/unittest/sql/plan_cache/test_plan_set.cpp +++ b/unittest/sql/plan_cache/test_plan_set.cpp @@ -44,7 +44,7 @@ int64_t allocate_sql_id() } class TestPlanSet : public ::testing::Test { - public: +public: TestPlanSet() {} virtual ~TestPlanSet() @@ -54,7 +54,7 @@ class TestPlanSet : public ::testing::Test { void TearDown() {} - private: +private: // disallow copy TestPlanSet(const TestPlanSet& other); TestPlanSet& operator=(const TestPlanSet& other); diff --git a/unittest/sql/plan_cache/test_sql.h b/unittest/sql/plan_cache/test_sql.h index f8e015e02..3449be173 100644 --- a/unittest/sql/plan_cache/test_sql.h +++ b/unittest/sql/plan_cache/test_sql.h @@ -37,7 +37,7 @@ struct TestSqlCtx { }; class TestSQL : public TestOptimizerUtils { - public: +public: TestSQL(const ObString& schema_file_name); virtual ~TestSQL(); void TestBody() @@ -81,11 +81,11 @@ class TestSQL : public TestOptimizerUtils { return merged_version_; } - protected: +protected: ObAddr addr_; // local addr int64_t merged_version_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestSQL); }; diff --git a/unittest/sql/plan_cache/test_sql_parameterization.cpp b/unittest/sql/plan_cache/test_sql_parameterization.cpp index 49a4f0b53..3c62162b1 100644 --- a/unittest/sql/plan_cache/test_sql_parameterization.cpp +++ b/unittest/sql/plan_cache/test_sql_parameterization.cpp @@ -24,18 +24,18 @@ using namespace share::schema; #define OK(value) ASSERT_EQ(OB_SUCCESS, (value)) class TestSqlParameterization : public ::testing::Test { - public: +public: TestSqlParameterization(); virtual ~TestSqlParameterization(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy TestSqlParameterization(const TestSqlParameterization& other); TestSqlParameterization& operator=(const TestSqlParameterization& other); - protected: +protected: // data members }; diff --git a/unittest/sql/resolver/ddl_resolver.cpp b/unittest/sql/resolver/ddl_resolver.cpp index 3a55f007c..ed9b4e408 100644 --- a/unittest/sql/resolver/ddl_resolver.cpp +++ b/unittest/sql/resolver/ddl_resolver.cpp @@ -38,14 +38,14 @@ struct SqlAndError { int64_t expect_error; }; class TestResolver : public TestSqlUtils, public ::testing::Test { - public: +public: TestResolver(); virtual ~TestResolver() {} virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestResolver); }; diff --git a/unittest/sql/resolver/expr/test_raw_expr_canonicalizer.cpp b/unittest/sql/resolver/expr/test_raw_expr_canonicalizer.cpp index 1c3671d13..67d52565e 100644 --- a/unittest/sql/resolver/expr/test_raw_expr_canonicalizer.cpp +++ b/unittest/sql/resolver/expr/test_raw_expr_canonicalizer.cpp @@ -24,21 +24,21 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestRawExprCanonicalizer : public ::testing::Test { - public: +public: TestRawExprCanonicalizer(); virtual ~TestRawExprCanonicalizer(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestRawExprCanonicalizer); - protected: +protected: // function members void canon(const char* expr, const char*& canon_expr); - protected: +protected: // data members }; diff --git a/unittest/sql/resolver/expr/test_raw_expr_hash.cpp b/unittest/sql/resolver/expr/test_raw_expr_hash.cpp index e95639d27..9730e42a6 100644 --- a/unittest/sql/resolver/expr/test_raw_expr_hash.cpp +++ b/unittest/sql/resolver/expr/test_raw_expr_hash.cpp @@ -32,7 +32,7 @@ namespace test { }) class TestRawExprToStr : public ::testing::Test { - public: +public: TestRawExprToStr() {} virtual ~TestRawExprToStr() @@ -42,7 +42,7 @@ class TestRawExprToStr : public ::testing::Test { virtual void TearDown() {} - private: +private: // disallow copy and assign TestRawExprToStr(const TestRawExprToStr& other); TestRawExprToStr& operator=(const TestRawExprToStr& ohter); diff --git a/unittest/sql/resolver/expr/test_raw_expr_print_visitor.cpp b/unittest/sql/resolver/expr/test_raw_expr_print_visitor.cpp index 670310033..7aee76271 100644 --- a/unittest/sql/resolver/expr/test_raw_expr_print_visitor.cpp +++ b/unittest/sql/resolver/expr/test_raw_expr_print_visitor.cpp @@ -18,19 +18,19 @@ using namespace oceanbase::common; using namespace oceanbase::sql; class TestRawExprPrintVisitor : public ::testing::Test { - public: +public: TestRawExprPrintVisitor(); virtual ~TestRawExprPrintVisitor(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestRawExprPrintVisitor); - protected: +protected: // function members - protected: +protected: // data members }; diff --git a/unittest/sql/resolver/expr/test_raw_expr_resolver.cpp b/unittest/sql/resolver/expr/test_raw_expr_resolver.cpp index d2ff54cb4..3799998c1 100644 --- a/unittest/sql/resolver/expr/test_raw_expr_resolver.cpp +++ b/unittest/sql/resolver/expr/test_raw_expr_resolver.cpp @@ -25,21 +25,21 @@ using namespace oceanbase::lib; using namespace oceanbase; class TestRawExprResolver : public ::testing::Test { - public: +public: TestRawExprResolver(); virtual ~TestRawExprResolver(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestRawExprResolver); - protected: +protected: // function members void resolve(const char* expr, const char*& json_expr); - protected: +protected: // data members }; diff --git a/unittest/sql/resolver/expr/test_raw_expr_to_str.cpp b/unittest/sql/resolver/expr/test_raw_expr_to_str.cpp index f931ac139..cb000533c 100644 --- a/unittest/sql/resolver/expr/test_raw_expr_to_str.cpp +++ b/unittest/sql/resolver/expr/test_raw_expr_to_str.cpp @@ -32,7 +32,7 @@ namespace test { }) class TestRawExprToStr : public ::testing::Test { - public: +public: TestRawExprToStr() {} virtual ~TestRawExprToStr() @@ -42,7 +42,7 @@ class TestRawExprToStr : public ::testing::Test { virtual void TearDown() {} - private: +private: // disallow copy and assign TestRawExprToStr(const TestRawExprToStr& other); TestRawExprToStr& operator=(const TestRawExprToStr& ohter); diff --git a/unittest/sql/resolver/test_raw_expr.cpp b/unittest/sql/resolver/test_raw_expr.cpp index 9121c59a7..cba79ee0f 100644 --- a/unittest/sql/resolver/test_raw_expr.cpp +++ b/unittest/sql/resolver/test_raw_expr.cpp @@ -33,7 +33,7 @@ using namespace oceanbase::sql; #define BUF_LEN 102400 namespace test { class TestRawExpr : public TestSqlUtils, public ::testing::Test { - public: +public: TestRawExpr(); virtual ~TestRawExpr(); virtual void SetUp(); @@ -41,17 +41,17 @@ class TestRawExpr : public TestSqlUtils, public ::testing::Test { ObArenaAllocator allocator; ObRawExprFactory expr_factory_; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestRawExpr); - protected: +protected: // function members int get_raw_expr(const char* expr, ObRawExpr*& raw_expr, const char*& json_expr); int get_result_tree(const char* sql, ParseResult& parse_result, ObIAllocator& allocator); void resolver(const char* expr, const char*& json_expr); - protected: +protected: // data members }; diff --git a/unittest/sql/resolver/test_resolver.cpp b/unittest/sql/resolver/test_resolver.cpp index a9f4858fa..b2a1a1b9a 100644 --- a/unittest/sql/resolver/test_resolver.cpp +++ b/unittest/sql/resolver/test_resolver.cpp @@ -37,14 +37,14 @@ namespace test { const char* SQL_DIR = "sql"; const char* RESULT_DIR = "result"; class TestResolver : public TestSqlUtils, public ::testing::Test { - public: +public: TestResolver(); virtual ~TestResolver() {} virtual void SetUp(); virtual void TearDown(); - protected: +protected: void do_equal_test(); void do_stmt_copy_test(); void do_padding_test(); @@ -56,7 +56,7 @@ class TestResolver : public TestSqlUtils, public ::testing::Test { bool is_show_sql(const ParseNode& node) const; static void get_index_name(std::string& str, const ObTableSchema& idx_schema); - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(TestResolver); }; diff --git a/unittest/sql/resolver/test_sql_bitset.cpp b/unittest/sql/resolver/test_sql_bitset.cpp index 227b21ef7..2620a5de4 100644 --- a/unittest/sql/resolver/test_sql_bitset.cpp +++ b/unittest/sql/resolver/test_sql_bitset.cpp @@ -20,13 +20,13 @@ using namespace oceanbase::lib; using namespace oceanbase; class TestSqlBitSet : public ::testing::Test { - public: +public: TestSqlBitSet(); virtual ~TestSqlBitSet(); virtual void SetUp(); virtual void TearDown(); - private: +private: DISALLOW_COPY_AND_ASSIGN(TestSqlBitSet); }; diff --git a/unittest/sql/rewrite/test_query_range.cpp b/unittest/sql/rewrite/test_query_range.cpp index 41a37f9e4..c6f38c1c7 100644 --- a/unittest/sql/rewrite/test_query_range.cpp +++ b/unittest/sql/rewrite/test_query_range.cpp @@ -31,7 +31,7 @@ using namespace oceanbase::share::schema; const int64_t BUF_LEN = 102400; class ObQueryRangeTest : public ::testing::Test { - public: +public: ObQueryRangeTest(); virtual ~ObQueryRangeTest(); virtual void SetUp(); @@ -254,12 +254,12 @@ class ObQueryRangeTest : public ::testing::Test { allocator_.reset(); } - private: +private: // disallow copy ObQueryRangeTest(const ObQueryRangeTest& other); ObQueryRangeTest& operator=(const ObQueryRangeTest& other); - protected: +protected: // data members uint64_t table_id_; uint64_t column_id1_; diff --git a/unittest/sql/rewrite/test_trans_utils.h b/unittest/sql/rewrite/test_trans_utils.h index d47f78108..d0ca67d36 100644 --- a/unittest/sql/rewrite/test_trans_utils.h +++ b/unittest/sql/rewrite/test_trans_utils.h @@ -27,7 +27,7 @@ namespace test { class TestTransUtils { static const int trans_type_[]; - public: +public: struct CmdLineParam { CmdLineParam() : use_it_(false) { @@ -37,18 +37,18 @@ class TestTransUtils { bool use_it_; }; - public: +public: TestTransUtils(); virtual ~TestTransUtils() {} - public: +public: static bool parse_cmd(int argc, char* argv[], CmdLineParam& param); - private: +private: static void print_help(); - private: +private: DISALLOW_COPY_AND_ASSIGN(TestTransUtils); }; } // namespace test diff --git a/unittest/sql/rewrite/test_transformer.cpp b/unittest/sql/rewrite/test_transformer.cpp index 664a7acd2..8ec4f0987 100644 --- a/unittest/sql/rewrite/test_transformer.cpp +++ b/unittest/sql/rewrite/test_transformer.cpp @@ -60,16 +60,16 @@ namespace test { test::TestTransUtils::CmdLineParam param; class TestRewrite : public TestOptimizerUtils { - public: +public: TestRewrite(); virtual ~TestRewrite(); - private: +private: void virtual SetUp(); // disallow copy DISALLOW_COPY_AND_ASSIGN(TestRewrite); - protected: +protected: // function members int parse_resolve_transform(std::ofstream& of_result, ObTransformerImpl& trans_util, ObString& sql, ObDMLStmt*& stmt, ObLogPlan*& logical_plan, bool do_transform, bool do_gen_plan, ObIAllocator* allocator); @@ -89,13 +89,13 @@ class TestRewrite : public TestOptimizerUtils { int optimize(ObDMLStmt*& stmt, ObLogPlan*& logical_plan); bool do_loop_test; - protected: +protected: ObTransformerCtx ctx_; ObSchemaChecker schema_checker_; }; class TestStackCheck : public TestOptimizerUtils { - public: +public: TestStackCheck() { memset(schema_file_path_, '\0', 128); diff --git a/unittest/sql/session/test_session_mgr.cpp b/unittest/sql/session/test_session_mgr.cpp index 364017a36..40c300e72 100644 --- a/unittest/sql/session/test_session_mgr.cpp +++ b/unittest/sql/session/test_session_mgr.cpp @@ -27,7 +27,7 @@ using namespace oceanbase::common; using namespace oceanbase::sql; using namespace oceanbase::observer; class DISABLED_TestSessionMgr : public ::testing::Test { - public: +public: DISABLED_TestSessionMgr() : mgr_(&pt_srv_) {} @@ -39,9 +39,9 @@ class DISABLED_TestSessionMgr : public ::testing::Test { virtual void TearDown() {} - private: +private: class SessionOperator { - public: + public: uint64_t sum; SessionOperator() : sum(0) {} @@ -54,7 +54,7 @@ class DISABLED_TestSessionMgr : public ::testing::Test { } }; - protected: +protected: oceanbase::storage::ObPartitionService pt_srv_; ObSQLSessionMgr mgr_; SessionOperator sess_operator_; @@ -178,7 +178,7 @@ TEST_F(DISABLED_TestSessionMgr, test_for_each) int64_t create_num = 0; class ObStressThread_create : public share::ObThreadPool { - public: +public: void run1() { ObSQLSessionInfo* sess_info = NULL; diff --git a/unittest/sql/test_sql_utils.h b/unittest/sql/test_sql_utils.h index ce0130947..c398604b9 100644 --- a/unittest/sql/test_sql_utils.h +++ b/unittest/sql/test_sql_utils.h @@ -93,14 +93,14 @@ inline bool casesame_cstr(const char* a, const char* b) enum ParserResultFormat { TREE_FORMAT, JSON_FORMAT }; class TestSqlUtils { - public: +public: TestSqlUtils(); virtual ~TestSqlUtils() {} virtual void init(); virtual void destroy(); - public: +public: static const int64_t MAX_SCHEMA_FILE_PATH = 128 - 1; // function members void load_schema_from_file(const char* file_path); @@ -137,7 +137,7 @@ class TestSqlUtils { return schema_guard_; } - public: +public: // table id hash::ObHashMap next_user_table_id_map_; // user_id @@ -165,7 +165,7 @@ class TestSqlUtils { ObPlanCacheManager plan_cache_mgr_; ::test::MockPartitionLocationCache part_cache_; - private: +private: DISALLOW_COPY_AND_ASSIGN(TestSqlUtils); }; } // namespace test diff --git a/unittest/storage/blocksstable/ob_data_file_prepare.h b/unittest/storage/blocksstable/ob_data_file_prepare.h index dc39db00a..903a4877f 100644 --- a/unittest/storage/blocksstable/ob_data_file_prepare.h +++ b/unittest/storage/blocksstable/ob_data_file_prepare.h @@ -37,7 +37,7 @@ using namespace storage; namespace blocksstable { class TestDataFilePrepareUtil { - public: +public: TestDataFilePrepareUtil(); virtual ~TestDataFilePrepareUtil() { @@ -57,7 +57,7 @@ class TestDataFilePrepareUtil { return OB_FILE_SYSTEM; } - private: +private: static const int64_t SLOG_MAX_SIZE = 64 * 1024 * 1024; bool is_inited_; char data_dir_[OB_MAX_FILE_NAME_LENGTH]; @@ -76,7 +76,7 @@ class TestDataFilePrepareUtil { }; class TestDataFilePrepare : public ::testing::Test { - public: +public: TestDataFilePrepare( const char* test_name, const int64_t macro_block_size = 64 * 1024, const int64_t macro_block_count = 100); virtual ~TestDataFilePrepare(); @@ -93,7 +93,7 @@ class TestDataFilePrepare : public ::testing::Test { } const ObStorageFileHandle& get_storage_file_handle(); - protected: +protected: static const int64_t TENANT_ID = 1; static const int64_t TABLE_ID = 3001; TestDataFilePrepareUtil util_; diff --git a/unittest/storage/blocksstable/ob_macro_meta_generate.h b/unittest/storage/blocksstable/ob_macro_meta_generate.h index a273f74a5..f2ae9d53b 100644 --- a/unittest/storage/blocksstable/ob_macro_meta_generate.h +++ b/unittest/storage/blocksstable/ob_macro_meta_generate.h @@ -20,7 +20,7 @@ namespace oceanbase { using namespace common; namespace blocksstable { class ObMacroMetaGenerator { - public: +public: ObMacroMetaGenerator() {} virtual ~ObMacroMetaGenerator() diff --git a/unittest/storage/blocksstable/ob_row_generate.h b/unittest/storage/blocksstable/ob_row_generate.h index 8aa3eb1af..a0fc6c95d 100644 --- a/unittest/storage/blocksstable/ob_row_generate.h +++ b/unittest/storage/blocksstable/ob_row_generate.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace blocksstable { class ObRowGenerate { - public: +public: ObRowGenerate(); ~ObRowGenerate(); inline int init( @@ -59,7 +59,7 @@ class ObRowGenerate { return schema_; } - private: +private: int generate_one_row(storage::ObStoreRow& row, const int64_t seed, const storage::ObRowDml first_dml = storage::T_DML_UNKNOWN, const storage::ObRowDml dml = storage::T_DML_UNKNOWN, const int64_t trans_version = 0); @@ -69,7 +69,7 @@ class ObRowGenerate { int get_seed(const common::ObObjType& column_type, const common::ObObj obj, int64_t& seed); int generate_urowid_obj(const int64_t rowkey_pos, const int64_t seed, const int64_t value, ObObj& urowid_obj); - private: +private: common::ObArenaAllocator allocator_; common::ObArenaAllocator* p_allocator_; share::schema::ObTableSchema schema_; diff --git a/unittest/storage/blocksstable/ob_schema_generator.h b/unittest/storage/blocksstable/ob_schema_generator.h index 450b05c68..4afff2c1d 100644 --- a/unittest/storage/blocksstable/ob_schema_generator.h +++ b/unittest/storage/blocksstable/ob_schema_generator.h @@ -17,11 +17,11 @@ namespace oceanbase { namespace blocksstable { class ObSchemaGenerator { - public: +public: static inline int generate_table(const uint64_t table_id, const int64_t column_count, const int64_t rowkey_count, share::schema::ObTableSchema& table_schema); - private: +private: static void set_column_type(const common::ObObjType obj_type, share::schema::ObColumnSchemaV2& column); }; diff --git a/unittest/storage/blocksstable/slog/simple_ob_partition_image.h b/unittest/storage/blocksstable/slog/simple_ob_partition_image.h index b7c159ff1..0b0733ee6 100644 --- a/unittest/storage/blocksstable/slog/simple_ob_partition_image.h +++ b/unittest/storage/blocksstable/slog/simple_ob_partition_image.h @@ -37,7 +37,7 @@ struct SimpleObPartition : public ObIBaseStorageLogEntry { static void build(int64_t table_id, int64_t partition_id, int64_t macro_block_cnt, SimpleObPartition& partition); TO_STRING_EMPTY(); - public: +public: NEED_SERIALIZE_AND_DESERIALIZE; }; @@ -51,7 +51,7 @@ struct SimpleObPartitionNode { enum SimpleObPartitionOperation { ADD_PARTITION = 0, REMOVE_PARTITION = 1 }; class SimpleObPartitionImage : public ObIRedoModule { - public: +public: SimpleObPartitionImage(); virtual ~SimpleObPartitionImage(); int init(const char* data_dir, ObBaseStorageLogger* redo_log); @@ -71,7 +71,7 @@ class SimpleObPartitionImage : public ObIRedoModule { bool operator==(SimpleObPartitionImage& image); bool operator!=(SimpleObPartitionImage& image); - public: +public: static const int64_t BUCKET_NUM = 1523; static int64_t hash(const int64_t table_id, const int64_t partition_id); int do_add_partition(const SimpleObPartition& partition); diff --git a/unittest/storage/blocksstable/slog/test_slog_disk_error.cpp b/unittest/storage/blocksstable/slog/test_slog_disk_error.cpp index 1fb9632bd..15eb47801 100644 --- a/unittest/storage/blocksstable/slog/test_slog_disk_error.cpp +++ b/unittest/storage/blocksstable/slog/test_slog_disk_error.cpp @@ -25,7 +25,7 @@ using namespace ::testing; namespace oceanbase { namespace blocksstable { class TestSlogDiskError : public ::testing::Test { - public: +public: TestSlogDiskError() {} virtual ~TestSlogDiskError() @@ -38,7 +38,7 @@ class TestSlogDiskError : public ::testing::Test { virtual int make_log_ruined(const ObLogCursor& last_log_cursor); virtual int replay_log(); - protected: +protected: ObLogCursor replay_start_cursor_; }; diff --git a/unittest/storage/blocksstable/slog/test_storage_log_reader_writer.cpp b/unittest/storage/blocksstable/slog/test_storage_log_reader_writer.cpp index f1fe06a70..19ed4b349 100644 --- a/unittest/storage/blocksstable/slog/test_storage_log_reader_writer.cpp +++ b/unittest/storage/blocksstable/slog/test_storage_log_reader_writer.cpp @@ -24,7 +24,7 @@ using namespace ::testing; namespace oceanbase { namespace blocksstable { class TestStorageLogReaderWriter : public ::testing::Test { - public: +public: TestStorageLogReaderWriter() {} virtual ~TestStorageLogReaderWriter() @@ -499,7 +499,7 @@ TEST_F(TestStorageLogReaderWriter, switch_file_revise) { int ret = OB_SUCCESS; const char LOG_DIR[512] = "./test_storage_log_rw"; - const int64_t LOG_FILE_SIZE = 16 * 1024; // 16KB + const int64_t LOG_FILE_SIZE = 16 * 1024; // 16KB const int64_t CONCURRENT_TRANS_CNT = 8; const int64_t LOG_BUFFER_SIZE = 1966080L; // 1.875MB @@ -546,14 +546,14 @@ TEST_F(TestStorageLogReaderWriter, switch_file_revise) int64_t revise_size = 0; ret = FileDirectoryUtils::get_file_size("./test_storage_log_rw/1", revise_size); ASSERT_EQ(OB_SUCCESS, ret); - ASSERT_EQ(3 * 4096, revise_size); // truncate last 4k + ASSERT_EQ(3 * 4096, revise_size); // truncate last 4k } TEST_F(TestStorageLogReaderWriter, errsim_io_hung) { int ret = OB_SUCCESS; const char LOG_DIR[512] = "./test_storage_log_rw"; - const int64_t LOG_FILE_SIZE = 16 * 1024; // 16KB + const int64_t LOG_FILE_SIZE = 16 * 1024; // 16KB const int64_t CONCURRENT_TRANS_CNT = 8; const int64_t LOG_BUFFER_SIZE = 1966080L; // 1.875MB diff --git a/unittest/storage/blocksstable/test_bloom_filter_data.cpp b/unittest/storage/blocksstable/test_bloom_filter_data.cpp index 65052f34f..8a2cd1716 100644 --- a/unittest/storage/blocksstable/test_bloom_filter_data.cpp +++ b/unittest/storage/blocksstable/test_bloom_filter_data.cpp @@ -28,13 +28,13 @@ using namespace oceanbase::storage; using namespace oceanbase::share::schema; class TestBloomFilterDataReaderWriter : public TestDataFilePrepare { - public: +public: TestBloomFilterDataReaderWriter(); virtual ~TestBloomFilterDataReaderWriter(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: int prepare_rowkey(ObStoreRowkey& rowkey, const int64_t rowkey_column_cnt = TEST_ROWKEY_COLUMN_CNT); void prepare_schema(); int prepare_block_ctx(const MacroBlockId& block_id, ObMacroBlockCtx& bf_block_ctx); @@ -47,7 +47,7 @@ class TestBloomFilterDataReaderWriter : public TestDataFilePrepare { int check_bloom_filter_cache(const ObBloomFilterCacheValue& new_bf_cache_value, const ObBloomFilterCacheValue& bf_cache_value, const ObBloomFilterCacheValue& bf_cache_value2); - protected: +protected: static const int64_t TEST_COLUMN_CNT = ObExtendType - 1; static const int64_t TEST_ROWKEY_COLUMN_CNT = 2; static const int64_t TEST_ROW_COUNT = 100; diff --git a/unittest/storage/blocksstable/test_column_map.cpp b/unittest/storage/blocksstable/test_column_map.cpp index 1a05064d3..41a2268fe 100644 --- a/unittest/storage/blocksstable/test_column_map.cpp +++ b/unittest/storage/blocksstable/test_column_map.cpp @@ -21,7 +21,7 @@ using namespace blocksstable; using namespace common; namespace unittest { class TestColumnMap : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() @@ -36,7 +36,7 @@ class TestColumnMap : public ::testing::Test { const share::schema::ColumnMap* cols_id_map = nullptr, const ObIArray* projector = nullptr, const bool is_multi_version = false); - public: +public: ObArenaAllocator allocator_; }; diff --git a/unittest/storage/blocksstable/test_data_buffer.cpp b/unittest/storage/blocksstable/test_data_buffer.cpp index 0edad430b..89d4a7d38 100644 --- a/unittest/storage/blocksstable/test_data_buffer.cpp +++ b/unittest/storage/blocksstable/test_data_buffer.cpp @@ -21,13 +21,13 @@ using namespace common; namespace blocksstable { class TestDataBuffer : public ::testing::Test { - public: +public: TestDataBuffer(); virtual ~TestDataBuffer(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: char* buf_; int64_t buf_size_; }; diff --git a/unittest/storage/blocksstable/test_inspect_bad_block.cpp b/unittest/storage/blocksstable/test_inspect_bad_block.cpp index 7649999bf..99f0c1138 100644 --- a/unittest/storage/blocksstable/test_inspect_bad_block.cpp +++ b/unittest/storage/blocksstable/test_inspect_bad_block.cpp @@ -32,19 +32,19 @@ static const uint32_t TEST_COLUMN_COUNT = ObExtendType - 1; static const uint32_t TEST_MACRO_BLOCK_SIZE = 2 * 1024 * 1024; class TestInspectBadBlock : public TestDataFilePrepare { - public: +public: TestInspectBadBlock(); virtual ~TestInspectBadBlock(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: void prepare_schema(); void prepare_data(const int64_t row_cnt, ObSSTable& sstable); void get_macro_block(const int32_t macro_idx, ObMacroBlockHandle& macro_block_handle, ObFullMacroBlockMeta& meta); void check_macro_block(); - protected: +protected: ObSSTable sstable_; ObTableSchema table_schema_; ObITable::TableKey table_key_; @@ -289,7 +289,7 @@ void TestInspectBadBlock::check_macro_block() } class TestMacroBlock_LZ4 : public TestInspectBadBlock { - public: +public: TestMacroBlock_LZ4() { compressor_name_ = "lz4_1.0"; @@ -297,7 +297,7 @@ class TestMacroBlock_LZ4 : public TestInspectBadBlock { }; class TestMacroBlock_Snappy : public TestInspectBadBlock { - public: +public: TestMacroBlock_Snappy() { compressor_name_ = "snappy_1.0"; @@ -305,7 +305,7 @@ class TestMacroBlock_Snappy : public TestInspectBadBlock { }; class TestMacroBlock_Zlib : public TestInspectBadBlock { - public: +public: TestMacroBlock_Zlib() { compressor_name_ = "zlib_1.0"; @@ -313,7 +313,7 @@ class TestMacroBlock_Zlib : public TestInspectBadBlock { }; class TestMacroBlock_Zstd : public TestInspectBadBlock { - public: +public: TestMacroBlock_Zstd() { compressor_name_ = "zstd_1.0"; @@ -321,7 +321,7 @@ class TestMacroBlock_Zstd : public TestInspectBadBlock { }; class TestMacroBlock_Zstd_1_3_8 : public TestInspectBadBlock { - public: +public: TestMacroBlock_Zstd_1_3_8() { compressor_name_ = "zstd_1.3.8"; @@ -389,7 +389,7 @@ TEST(TestIOManager, callback_size) } class TestPhysicalChecksum : public TestInspectBadBlock { - public: +public: TestPhysicalChecksum() { need_calc_physical_checksum_ = true; diff --git a/unittest/storage/blocksstable/test_macro_block_id.cpp b/unittest/storage/blocksstable/test_macro_block_id.cpp index d32607483..55f5c229c 100644 --- a/unittest/storage/blocksstable/test_macro_block_id.cpp +++ b/unittest/storage/blocksstable/test_macro_block_id.cpp @@ -22,7 +22,7 @@ using namespace blocksstable; namespace unittest { class TestMacroBlockId : public ::testing::Test { - public: +public: TestMacroBlockId() = default; void SetUp() {} diff --git a/unittest/storage/blocksstable/test_mark_deletion.cpp b/unittest/storage/blocksstable/test_mark_deletion.cpp index f0a1f7239..03fc6eb53 100644 --- a/unittest/storage/blocksstable/test_mark_deletion.cpp +++ b/unittest/storage/blocksstable/test_mark_deletion.cpp @@ -32,13 +32,13 @@ using namespace share::schema; namespace unittest { class TestMarkDeletion : public TestDataFilePrepare { - public: +public: TestMarkDeletion(); virtual ~TestMarkDeletion(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: void prepare_schema(); void prepare_data(); static const int64_t TEST_COLUMN_CNT = ObExtendType - 1; diff --git a/unittest/storage/blocksstable/test_micro_block_index_cache.cpp b/unittest/storage/blocksstable/test_micro_block_index_cache.cpp index e89490342..c9f1a4562 100644 --- a/unittest/storage/blocksstable/test_micro_block_index_cache.cpp +++ b/unittest/storage/blocksstable/test_micro_block_index_cache.cpp @@ -31,13 +31,13 @@ using namespace memtable; namespace unittest { class TestMicroBlockIndexCache : public TestDataFilePrepare { - public: +public: TestMicroBlockIndexCache(); virtual ~TestMicroBlockIndexCache(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: static const int64_t TEST_TABLE_ID = 3001; static const int64_t TEST_COLUMN_CNT = ObExtendType - 1; static const int64_t MAX_TEST_COLUMN_CNT = TEST_COLUMN_CNT + 1; diff --git a/unittest/storage/blocksstable/test_micro_block_reader.cpp b/unittest/storage/blocksstable/test_micro_block_reader.cpp index b47e728ef..cd2ae4d55 100644 --- a/unittest/storage/blocksstable/test_micro_block_reader.cpp +++ b/unittest/storage/blocksstable/test_micro_block_reader.cpp @@ -32,7 +32,7 @@ using namespace share::schema; namespace unittest { class TestMicroBlockReader : public ::testing::Test { - public: +public: static const int64_t rowkey_column_count = 2; // Every ObObjType from ObTinyIntType to ObHexStringType inclusive. // Skip ObNullType and ObExtendType because for external usage, a column type @@ -40,7 +40,7 @@ class TestMicroBlockReader : public ::testing::Test { static const int64_t column_num = ObHexStringType; static const int64_t macro_block_size = 2L * 1024 * 1024L; - public: +public: TestMicroBlockReader() : allocator_(ObModIds::TEST) { reset_row(); @@ -58,7 +58,7 @@ class TestMicroBlockReader : public ::testing::Test { row_.row_val_.count_ = OB_ROW_MAX_COLUMNS_COUNT; } - protected: +protected: ObRowGenerate row_generate_; ObColumnMap column_map_; ObArenaAllocator allocator_; diff --git a/unittest/storage/blocksstable/test_micro_block_scanner.cpp b/unittest/storage/blocksstable/test_micro_block_scanner.cpp index 272d84a70..4efafee45 100644 --- a/unittest/storage/blocksstable/test_micro_block_scanner.cpp +++ b/unittest/storage/blocksstable/test_micro_block_scanner.cpp @@ -35,7 +35,7 @@ static const int64_t table_id = 3001; const int64_t test_row_num = 10; class TestMicroBlockScanner : public ::testing::Test { - public: +public: TestMicroBlockScanner(); virtual void SetUp(); virtual void TearDown() @@ -46,7 +46,7 @@ class TestMicroBlockScanner : public ::testing::Test { {} int check_row(ObMicroBlockScanner& scanner, const int64_t start_row, const int64_t end_row, const bool reverse); - protected: +protected: ObRowGenerate row_generate_; ObColumnMap column_map_; ObArenaAllocator allocator_; diff --git a/unittest/storage/blocksstable/test_micro_block_writer.cpp b/unittest/storage/blocksstable/test_micro_block_writer.cpp index a0113f7f5..cd014fe61 100644 --- a/unittest/storage/blocksstable/test_micro_block_writer.cpp +++ b/unittest/storage/blocksstable/test_micro_block_writer.cpp @@ -27,7 +27,7 @@ using namespace share::schema; namespace unittest { class TestMicroBlockWriter : public ::testing::Test { - public: +public: static const int64_t rowkey_column_count = 2; // Every ObObjType from ObTinyIntType to ObHexStringType inclusive. // Skip ObNullType and ObExtendType because for external usage, a column type @@ -35,7 +35,7 @@ class TestMicroBlockWriter : public ::testing::Test { static const int64_t column_num = ObHexStringType; static const int64_t macro_block_size = 2L * 1024 * 1024L; - public: +public: TestMicroBlockWriter() : allocator_(ObModIds::TEST){}; void SetUp(); virtual void TearDown() @@ -46,7 +46,7 @@ class TestMicroBlockWriter : public ::testing::Test { {} void test_alloc(char*& ptr, const int64_t size); - protected: +protected: ObRowGenerate row_generate_; ObColumnMap column_map_; ObArenaAllocator allocator_; diff --git a/unittest/storage/blocksstable/test_raid_file_system.cpp b/unittest/storage/blocksstable/test_raid_file_system.cpp index 45a56f59e..b89d86bc0 100644 --- a/unittest/storage/blocksstable/test_raid_file_system.cpp +++ b/unittest/storage/blocksstable/test_raid_file_system.cpp @@ -29,7 +29,7 @@ namespace unittest { static const char* TEST_CASE_NAME = "test_raid_file_system_data"; class TestRaidFileSystem : public ::testing::Test { - public: +public: virtual void SetUp() { for (int64_t i = 0; i < OB_DEFAULT_MACRO_BLOCK_SIZE; ++i) { diff --git a/unittest/storage/blocksstable/test_ref_cnt.cpp b/unittest/storage/blocksstable/test_ref_cnt.cpp index 77f61c2b1..c07934645 100644 --- a/unittest/storage/blocksstable/test_ref_cnt.cpp +++ b/unittest/storage/blocksstable/test_ref_cnt.cpp @@ -29,13 +29,13 @@ using namespace storage; namespace unittest { class TestStorageFile : public TestDataFilePrepare { - public: +public: TestStorageFile(); virtual ~TestStorageFile(); virtual void SetUp(); virtual void TearDown(); - private: +private: ObStorageFile* pg_file_; }; @@ -62,14 +62,14 @@ void TestStorageFile::TearDown() } class TestStorageFileRefCnt : public share::ObThreadPool { - public: +public: enum OptType { INC, DEC, MAX }; TestStorageFileRefCnt(); virtual ~TestStorageFileRefCnt() = default; int init(const int64_t thread_cnt, ObStorageFile* pg_file, OptType type); virtual void run1(); - private: +private: int do_work(const MacroBlockId& macro_id); ObStorageFile* pg_file_; OptType type_; diff --git a/unittest/storage/blocksstable/test_row_cache.cpp b/unittest/storage/blocksstable/test_row_cache.cpp index 161f12db7..1c736edfd 100644 --- a/unittest/storage/blocksstable/test_row_cache.cpp +++ b/unittest/storage/blocksstable/test_row_cache.cpp @@ -20,7 +20,7 @@ using namespace blocksstable; using namespace storage; namespace unittest { class TestRowCache : public ::testing::Test { - public: +public: TestRowCache(); virtual void SetUp() {} @@ -39,7 +39,7 @@ class TestRowCache : public ::testing::Test { return arena_; } - private: +private: ModulePageAllocator alloc_; ModuleArena arena_; }; diff --git a/unittest/storage/blocksstable/test_row_reader.cpp b/unittest/storage/blocksstable/test_row_reader.cpp index ef0ff432b..9be31061f 100644 --- a/unittest/storage/blocksstable/test_row_reader.cpp +++ b/unittest/storage/blocksstable/test_row_reader.cpp @@ -42,7 +42,7 @@ using namespace share::schema; namespace unittest { class TestRowReader : public ::testing::Test { - public: +public: static const int64_t rowkey_column_count = 1; // Every ObObjType from ObTinyIntType to ObHexStringType inclusive. // Skip ObNullType and ObExtendType because for external usage, a column type @@ -57,7 +57,7 @@ class TestRowReader : public ::testing::Test { ObLobType}; static const int64_t column_num = ObMaxType - sizeof(not_test_type) / sizeof(ObObjType); - public: +public: virtual void SetUp(); virtual void TearDown(); char* get_serialize_buf() @@ -65,12 +65,12 @@ class TestRowReader : public ::testing::Test { return serialize_buf_; } - private: +private: int build_column_map(const int64_t* columns, const int64_t count); int init_column_map(const ObStoreRow& writer_row, ObArray& columns); char* serialize_buf_; - protected: +protected: ObRowGenerate row_generate_; ObColumnMap column_map_; ObTableSchema table_schema_; diff --git a/unittest/storage/blocksstable/test_row_writer.cpp b/unittest/storage/blocksstable/test_row_writer.cpp index bd350cf5f..7136ae205 100644 --- a/unittest/storage/blocksstable/test_row_writer.cpp +++ b/unittest/storage/blocksstable/test_row_writer.cpp @@ -31,24 +31,24 @@ using namespace share::schema; namespace unittest { class TestRowWriter : public ::testing::Test { - public: +public: static const int64_t rowkey_column_count = 1; // Every ObObjType from ObTinyIntType to ObHexStringType inclusive. // Skip ObNullType and ObExtendType because for external usage, a column type // can't be NULL or NOP. static const int64_t column_num = ObHexStringType; - public: +public: TestRowWriter(); virtual void SetUp(); virtual void TearDown(); void alloc(char*& ptr, const int64_t size); - protected: +protected: ObRowGenerate row_generate_; ObColumnMap column_map_; - private: +private: ObArenaAllocator allocator_; }; diff --git a/unittest/storage/blocksstable/test_sstable_generator.h b/unittest/storage/blocksstable/test_sstable_generator.h index 4addcd499..5f6887e48 100644 --- a/unittest/storage/blocksstable/test_sstable_generator.h +++ b/unittest/storage/blocksstable/test_sstable_generator.h @@ -23,7 +23,7 @@ class ObDataFile; } namespace unittest { class TestSSTableGenerator { - public: +public: TestSSTableGenerator(); int open(blocksstable::ObDataStoreDesc& desc, const char* path, const int64_t row_count); int generate(); @@ -33,10 +33,10 @@ class TestSSTableGenerator { return &data_file_; } - private: +private: int generate_row(const int64_t index); - private: +private: char path_[OB_MAX_FILE_NAME_LENGTH]; blocksstable::ObDataStoreDesc desc_; blocksstable::ObDataFile data_file_; diff --git a/unittest/storage/blocksstable/test_storage_cache_suite.cpp b/unittest/storage/blocksstable/test_storage_cache_suite.cpp index 320f69231..dda1380b9 100644 --- a/unittest/storage/blocksstable/test_storage_cache_suite.cpp +++ b/unittest/storage/blocksstable/test_storage_cache_suite.cpp @@ -18,7 +18,7 @@ using namespace common; namespace blocksstable { class TestStorageCacheSuite : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/storage/blocksstable/test_super_block_buffer_holder.cpp b/unittest/storage/blocksstable/test_super_block_buffer_holder.cpp index d1216756b..48c8eea71 100644 --- a/unittest/storage/blocksstable/test_super_block_buffer_holder.cpp +++ b/unittest/storage/blocksstable/test_super_block_buffer_holder.cpp @@ -19,7 +19,7 @@ using namespace oceanbase::blocksstable; namespace oceanbase { namespace unittest { class TestSuperBlockBufferHolder : public ::testing::Test { - public: +public: TestSuperBlockBufferHolder(){}; virtual ~TestSuperBlockBufferHolder(){}; virtual void SetUp(){}; @@ -27,7 +27,7 @@ class TestSuperBlockBufferHolder : public ::testing::Test { static void format_super_block(ObSuperBlockV1& super_block); - private: +private: // disallow copy TestSuperBlockBufferHolder(const TestSuperBlockBufferHolder& other); TestSuperBlockBufferHolder& operator=(const TestSuperBlockBufferHolder& other); diff --git a/unittest/storage/blocksstable/test_tmp_file.cpp b/unittest/storage/blocksstable/test_tmp_file.cpp index bd3c7fc9b..2b77f2a4d 100644 --- a/unittest/storage/blocksstable/test_tmp_file.cpp +++ b/unittest/storage/blocksstable/test_tmp_file.cpp @@ -29,7 +29,7 @@ static const int64_t TEST_COLUMN_CNT = ObExtendType - 1; static const int64_t TEST_ROWKEY_COLUMN_CNT = 2; struct BufHeader { - public: +public: BufHeader() : data_size_(0), start_row_(0) {} virtual ~BufHeader() @@ -72,14 +72,14 @@ int64_t BufHeader::get_serialize_size() const } class TestTmpFileStress : public share::ObThreadPool { - public: +public: TestTmpFileStress(); virtual ~TestTmpFileStress(); int init(const int fd, const bool is_write, const int64_t thread_cnt, ObTableSchema* table_schema, const bool is_plain_data, const bool is_big_file); virtual void run1(); - private: +private: void prepare_data(char* buf, const int64_t macro_block_size); void prepare_plain_data(const int64_t buf_size, char* buf, ObIArray& size_array); void prepare_one_buffer(const int64_t macro_block_size, const int64_t start_index, char* buf, int64_t& end_index); @@ -90,7 +90,7 @@ class TestTmpFileStress : public share::ObThreadPool { void read_data(const int64_t macro_block_size); void read_plain_data(const char* buf, const int64_t macro_block_size); - private: +private: static const int64_t BUF_COUNT = 16; int64_t thread_cnt_; int64_t size_; @@ -356,18 +356,18 @@ void TestTmpFileStress::run1() } class TestMultiTmpFileStress : public share::ObThreadPool { - public: +public: TestMultiTmpFileStress(); virtual ~TestMultiTmpFileStress(); int init(const int64_t file_cnt, const int64_t dir_id, const int64_t thread_cnt, ObTableSchema* table_schema, const bool is_plain_data, const bool is_big_file); virtual void run1(); - private: +private: void run_plain_case(); void run_normal_case(); - private: +private: int64_t file_cnt_; int64_t dir_id_; int64_t thread_cnt_perf_file_; @@ -456,16 +456,16 @@ void TestMultiTmpFileStress::run1() } class TestTmpFile : public TestDataFilePrepare { - public: +public: TestTmpFile(); virtual ~TestTmpFile(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: ObTableSchema table_schema_; - private: +private: void prepare_schema(); }; diff --git a/unittest/storage/compaction/test_partition_merge_util.cpp b/unittest/storage/compaction/test_partition_merge_util.cpp index 925208d10..7b1d9156a 100644 --- a/unittest/storage/compaction/test_partition_merge_util.cpp +++ b/unittest/storage/compaction/test_partition_merge_util.cpp @@ -33,13 +33,13 @@ namespace compaction { static const int64_t BASE_ROW_COUNT = 2; class TestPartitionMergeUtil : public TestDataFilePrepare { - public: +public: TestPartitionMergeUtil(); virtual ~TestPartitionMergeUtil(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: void prepare_schema(); void create_base_sstable(); void create_inc_sstable1(); diff --git a/unittest/storage/exception_transaction/mock_ob_clog_adapter.h b/unittest/storage/exception_transaction/mock_ob_clog_adapter.h index d8a40a8bd..6315e8b72 100644 --- a/unittest/storage/exception_transaction/mock_ob_clog_adapter.h +++ b/unittest/storage/exception_transaction/mock_ob_clog_adapter.h @@ -27,7 +27,7 @@ class ObITransSubmitLogCb; } namespace unittest { class LogServiceSubmitTask { - public: +public: LogServiceSubmitTask() : cb_(NULL) {} ~LogServiceSubmitTask() @@ -49,13 +49,13 @@ class LogServiceSubmitTask { return partition_key_; } - private: +private: transaction::ObITransSubmitLogCb* cb_; ObPartitionKey partition_key_; }; class MockObClogAdapter : public transaction::ObIClogAdapter, public ObSimpleThreadPool { - public: +public: MockObClogAdapter() { ObSimpleThreadPool::init(1, 10000); diff --git a/unittest/storage/exception_transaction/mock_ob_election_callback.h b/unittest/storage/exception_transaction/mock_ob_election_callback.h index cfd8d3b36..e19463fe9 100644 --- a/unittest/storage/exception_transaction/mock_ob_election_callback.h +++ b/unittest/storage/exception_transaction/mock_ob_election_callback.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace unittest { class MockObElectionCallback : public election::ObIElectionCallback { - public: +public: int on_get_election_priority(election::ObElectionPriority& priority) { priority.set_candidate(true); diff --git a/unittest/storage/exception_transaction/mock_ob_election_mgr.h b/unittest/storage/exception_transaction/mock_ob_election_mgr.h index 88cf37920..fcd971b06 100644 --- a/unittest/storage/exception_transaction/mock_ob_election_mgr.h +++ b/unittest/storage/exception_transaction/mock_ob_election_mgr.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace unittest { class MockObElectionMgr : public election::ObElectionMgr { - public: +public: int set_election_rpc(election::ObIElectionRpc* election_rpc) { int ret = common::OB_SUCCESS; @@ -41,7 +41,7 @@ class MockObElectionMgr : public election::ObElectionMgr { return idx_; } - public: +public: common::ObAddr addr_; int64_t idx_; }; diff --git a/unittest/storage/exception_transaction/mock_ob_election_rpc.h b/unittest/storage/exception_transaction/mock_ob_election_rpc.h index 1b0f34da8..7b1746a44 100644 --- a/unittest/storage/exception_transaction/mock_ob_election_rpc.h +++ b/unittest/storage/exception_transaction/mock_ob_election_rpc.h @@ -26,7 +26,7 @@ using namespace election; using namespace common; namespace unittest { class ElectionRpcTask { - public: +public: ElectionRpcTask() { reset(); @@ -41,7 +41,7 @@ class ElectionRpcTask { timestamp_ = 0; } - public: +public: ObAddr server_; ObElectionMsgBuffer msgbuf_; ObPartitionKey partition_; @@ -49,17 +49,17 @@ class ElectionRpcTask { }; class ElectionRpcTaskFactory { - public: +public: static ElectionRpcTask* alloc(); static void release(ElectionRpcTask* task); - private: +private: static int64_t alloc_count_; static int64_t release_count_; }; class MockObElectionRpc : public ObIElectionRpc, public common::ObSimpleThreadPool { - public: +public: MockObElectionRpc() : inited_(false), election_mgr_(NULL) {} ~MockObElectionRpc() @@ -99,7 +99,7 @@ class MockObElectionRpc : public ObIElectionRpc, public common::ObSimpleThreadPo int init(ObIElectionMgr* election_mgr, const ObAddr& self); void handle(void* task); - private: +private: bool inited_; ObIElectionMgr* election_mgr_; }; diff --git a/unittest/storage/exception_transaction/mock_ob_freeze_cb.h b/unittest/storage/exception_transaction/mock_ob_freeze_cb.h index 70e8792e5..9d3a1e26d 100644 --- a/unittest/storage/exception_transaction/mock_ob_freeze_cb.h +++ b/unittest/storage/exception_transaction/mock_ob_freeze_cb.h @@ -19,7 +19,7 @@ class ObIFreezeCb; } namespace unittest { class MockObFreezeTransCb : public storage::ObIFreezeCb { - public: +public: MockObFreezeTransCb() {} virtual ~MockObFreezeTransCb() diff --git a/unittest/storage/exception_transaction/mock_ob_location_cache.h b/unittest/storage/exception_transaction/mock_ob_location_cache.h index 7e8b14e7c..2ce67a815 100644 --- a/unittest/storage/exception_transaction/mock_ob_location_cache.h +++ b/unittest/storage/exception_transaction/mock_ob_location_cache.h @@ -27,19 +27,19 @@ using namespace common::hash; namespace share { class MockObLocationCache : public ObIPartitionLocationCache { - public: +public: MockObLocationCache() {} virtual ~MockObLocationCache() {} int init(); - public: +public: int add(const ObPartitionKey& partition, const ObAddr& leader); int add_overwrite(const ObPartitionKey& partition, const ObAddr& leader); int remove(const ObPartitionKey& partition); - public: +public: virtual ObIPartitionLocationCache::PartitionLocationCacheType get_type() const { return static_cast(PART_LOC_CACHE_TYPE_NORMAL); @@ -115,10 +115,10 @@ class MockObLocationCache : public ObIPartitionLocationCache { return common::OB_NOT_SUPPORTED; } - private: +private: static const int64_t BUCKET_NUM = 137; - private: +private: ObHashMap partition_addr_map_; }; diff --git a/unittest/storage/exception_transaction/mock_ob_trans_rpc.h b/unittest/storage/exception_transaction/mock_ob_trans_rpc.h index ef5f8ad80..c8c6a03b3 100644 --- a/unittest/storage/exception_transaction/mock_ob_trans_rpc.h +++ b/unittest/storage/exception_transaction/mock_ob_trans_rpc.h @@ -23,7 +23,7 @@ using namespace transaction; using namespace common; namespace unittest { class MockObTransRpc : public ObITransRpc, public common::ObSimpleThreadPool { - public: +public: MockObTransRpc() : is_inited_(false), trans_service_(NULL) {} ~MockObTransRpc() @@ -82,7 +82,7 @@ class MockObTransRpc : public ObITransRpc, public common::ObSimpleThreadPool { int init(ObTransService* trans_service, const ObAddr& self); void handle(void* task); - private: +private: bool is_inited_; ObTransService* trans_service_; }; diff --git a/unittest/storage/exception_transaction/mock_ob_trans_service.h b/unittest/storage/exception_transaction/mock_ob_trans_service.h index 397be91ce..2fb9a18c3 100644 --- a/unittest/storage/exception_transaction/mock_ob_trans_service.h +++ b/unittest/storage/exception_transaction/mock_ob_trans_service.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace unittest { class MockObTransService : public transaction::ObTransService { - public: +public: int set_clog_adapter(transaction::ObIClogAdapter* clog_adapter) { int ret = OB_SUCCESS; @@ -51,7 +51,7 @@ class MockObTransService : public transaction::ObTransService { return addr_; } - public: +public: ObAddr addr_; int64_t idx_; }; diff --git a/unittest/storage/exception_transaction/test_ob_trans_service_cluster.h b/unittest/storage/exception_transaction/test_ob_trans_service_cluster.h index 314b24826..1b2ad84c9 100644 --- a/unittest/storage/exception_transaction/test_ob_trans_service_cluster.h +++ b/unittest/storage/exception_transaction/test_ob_trans_service_cluster.h @@ -40,11 +40,11 @@ namespace unittest { //}; class ObTransServiceCluster { - public: +public: ObTransServiceCluster(); ~ObTransServiceCluster(); - public: +public: bool is_inited() { return inited_; @@ -56,7 +56,7 @@ class ObTransServiceCluster { int wait(); int destroy(); - public: +public: ObTransRpcProxy* get_trans_proxy() { return &trans_proxy_; @@ -91,7 +91,7 @@ class ObTransServiceCluster { const int64_t start_request_abort_time, const int64_t end_request_abort_time, const bool response_abort, const int64_t start_response_abort_time, const int64_t end_response_abort_time, const bool is_clear = true); - private: +private: typedef common::hash::ObHashMap ObPartitionLeaderMap; int32_t get_scheduler_idx_() { @@ -99,7 +99,7 @@ class ObTransServiceCluster { } int add_partition_(const ObPartitionKey& partition, const ObAddr& addr, ObPartitionLeaderMap& partition_leader_map); - private: +private: int run_all_tests_(ObTransServiceCtx* trans_service_ctx); int run_local_single_partition_transaction_all_major_freeze_tests_(ObTransServiceCtx* trans_service_ctx); int run_local_single_partition_transaction_all_rpc_exp_tests_(ObTransServiceCtx* trans_service_ctx); @@ -136,7 +136,7 @@ class ObTransServiceCluster { const bool is_local, const bool is_remote, const bool is_distributed, const bool is_rollback = false); int set_test_retry_end_trans(ObTransServiceCtx* trans_service_ctx, const bool test_retry_end_trans); - private: +private: bool inited_; bool is_running_; bool is_add_partition_; diff --git a/unittest/storage/exception_transaction/test_ob_trans_service_ctx.h b/unittest/storage/exception_transaction/test_ob_trans_service_ctx.h index 71da7b2d8..8076cbe44 100644 --- a/unittest/storage/exception_transaction/test_ob_trans_service_ctx.h +++ b/unittest/storage/exception_transaction/test_ob_trans_service_ctx.h @@ -42,16 +42,16 @@ using namespace obrpc; namespace unittest { class ObTransServiceCtxThread : public share::ObThreadPool { - public: +public: int setThreadParameter(const int threadCount, void* arg); - protected: +protected: bool inited_; void* arg_; }; class ObTransServiceCtx : public ObITransRpc, public ObIElectionRpc { - public: +public: ObTransServiceCtx() : inited_(false), base_rpc_port_(0), scheduler_idx_(0), tenant_id_(0) { reset(); @@ -155,7 +155,7 @@ class ObTransServiceCtx : public ObITransRpc, public ObIElectionRpc { test_retry_end_trans_ = test_retry_end_trans; } - private: +private: ObTransService* get_scheduler_() { return &txs_[scheduler_idx_]; @@ -168,17 +168,17 @@ class ObTransServiceCtx : public ObITransRpc, public ObIElectionRpc { int get_participant_(const ObAddr& addr, ObTransService*& participant); int check_major_freeze_(const int64_t msg_type, const ObPartitionKey& partition); - public: +public: class ObGetLeaderThread : public ObTransServiceCtxThread { - public: + public: void run1(); }; class ObMajorfreezeThread : public ObTransServiceCtxThread { - public: + public: void run1(); }; - private: +private: bool inited_; int32_t base_rpc_port_; char ip_[MAX_IP_ADDR_LENGTH]; diff --git a/unittest/storage/exception_transaction/test_ob_trans_service_major_freeze_exp.h b/unittest/storage/exception_transaction/test_ob_trans_service_major_freeze_exp.h index df92707d7..b3fb00af5 100644 --- a/unittest/storage/exception_transaction/test_ob_trans_service_major_freeze_exp.h +++ b/unittest/storage/exception_transaction/test_ob_trans_service_major_freeze_exp.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace unittest { class ObTransMajorFreezeException { - public: +public: ObTransMajorFreezeException() { reset(); @@ -34,7 +34,7 @@ class ObTransMajorFreezeException { } TO_STRING_KV(K_(msg_type), K_(is_do_major_freeze), K_(partitions)); - private: +private: int64_t msg_type_; bool is_do_major_freeze_; common::ObPartitionArray partitions_; diff --git a/unittest/storage/exception_transaction/test_ob_trans_service_rpc_exp.h b/unittest/storage/exception_transaction/test_ob_trans_service_rpc_exp.h index aa316013f..82c761938 100644 --- a/unittest/storage/exception_transaction/test_ob_trans_service_rpc_exp.h +++ b/unittest/storage/exception_transaction/test_ob_trans_service_rpc_exp.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace unittest { class ObTransMsgException { - public: +public: ObTransMsgException() : inited_(false), request_abort_(false), @@ -63,7 +63,7 @@ class ObTransMsgException { TO_STRING_KV(K_(request_abort), K_(start_request_abort_time), K_(end_request_abort_time), K_(response_abort), K_(start_response_abort_time), K_(end_response_abort_time)); - public: +public: bool inited_; bool request_abort_; bool response_abort_; @@ -75,7 +75,7 @@ class ObTransMsgException { }; class ObTransRpcExecption { - public: +public: ObTransRpcExecption() { reset(); @@ -89,7 +89,7 @@ class ObTransRpcExecption { const int64_t end_request_abort_time, const bool response_abort, const int64_t start_response_abort_time, const int64_t end_response_abort_time); - public: +public: ObTransMsgException commit_msg_exp_; ObTransMsgException abort_msg_exp_; ObTransMsgException stmt_create_ctx_msg_exp_; diff --git a/unittest/storage/exception_transaction/test_ob_trans_service_switch_leader_exp.h b/unittest/storage/exception_transaction/test_ob_trans_service_switch_leader_exp.h index 84fab3d9a..7f0c756d2 100644 --- a/unittest/storage/exception_transaction/test_ob_trans_service_switch_leader_exp.h +++ b/unittest/storage/exception_transaction/test_ob_trans_service_switch_leader_exp.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace unittest { class ObTransSwitchLeader { - public: +public: ObTransSwitchLeader() : partitions_(common::ObModIds::OB_TRANS_PARTITION_ARRAY) { reset(); @@ -55,7 +55,7 @@ class ObTransSwitchLeader { TO_STRING_KV(K_(need_change), K_(change_back), K_(change_num), K_(partitions)); - public: +public: bool need_change_; bool change_back_; int64_t change_num_; @@ -84,7 +84,7 @@ enum ObTransSwitchLeaderType { }; class ObTransSwitchLeaderException { - public: +public: ObTransSwitchLeaderException() { reset(); @@ -92,13 +92,13 @@ class ObTransSwitchLeaderException { virtual ~ObTransSwitchLeaderException() {} - public: +public: void reset(); ObTransSwitchLeader* get_switch_leader_exp(const int64_t type); int set_switch_leader(const int64_t type, const bool need_change, const bool change_back, const int64_t change_num); int set_switch_leader_partitions(const int64_t type, const common::ObPartitionArray& partitions); - public: +public: ObTransSwitchLeader switch_leaders_[OB_SWITCH_LEADER_COUNT]; }; diff --git a/unittest/storage/exception_transaction/test_ob_trans_service_thread.h b/unittest/storage/exception_transaction/test_ob_trans_service_thread.h index 3a4afeec1..f65bba7bb 100644 --- a/unittest/storage/exception_transaction/test_ob_trans_service_thread.h +++ b/unittest/storage/exception_transaction/test_ob_trans_service_thread.h @@ -32,7 +32,7 @@ enum ObTransServiceType { }; class ObTransServiceHandler { - public: +public: ObTransServiceHandler(); ~ObTransServiceHandler(); @@ -42,17 +42,17 @@ class ObTransServiceHandler { void* get_trans_service_ctx(); - private: +private: static void destroy_thread_key(void* ptr); int create_thread_key(); int delete_thread_key(); - public: +public: pthread_key_t key_; }; class ObTransServiceThread : public share::ObThreadPool { - public: +public: ObTransServiceThread() : inited_(false) {} ~ObTransServiceThread() @@ -65,7 +65,7 @@ class ObTransServiceThread : public share::ObThreadPool { void* get_trans_service(); void run1(); - private: +private: void* arg_; bool inited_; ObTransServiceHandler* chandler_; diff --git a/unittest/storage/fake_major_freeze_partition_service.h b/unittest/storage/fake_major_freeze_partition_service.h index 4d58de1ec..b69fadffe 100644 --- a/unittest/storage/fake_major_freeze_partition_service.h +++ b/unittest/storage/fake_major_freeze_partition_service.h @@ -34,7 +34,7 @@ struct FakeMajorFreezePartition { class FakeMajorFreezePartitionService; class ObMajorFreezeTask : public share::ObAsyncTask { - public: +public: ObMajorFreezeTask(FakeMajorFreezePartitionService* pt_service, ObIPSFreezeCb* cb, const common::ObPartitionKey& partition_key, const int64_t cmd, const int64_t frozen_version, const int64_t frozen_timestamp, const int err); @@ -48,7 +48,7 @@ class ObMajorFreezeTask : public share::ObAsyncTask { } virtual share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: +private: FakeMajorFreezePartitionService* pt_service_; ObIPSFreezeCb* cb_; common::ObPartitionKey partition_key_; @@ -59,7 +59,7 @@ class ObMajorFreezeTask : public share::ObAsyncTask { }; class FakeMajorFreezePartitionService : public MockObIPartitionService { - public: +public: FakeMajorFreezePartitionService(); int init(); // use be test major freeze @@ -88,7 +88,7 @@ class FakeMajorFreezePartitionService : public MockObIPartitionService { int gen_err(const int64_t i); FakeMajorFreezePartition* get_partition(const common::ObPartitionKey& pk); - private: +private: bool inited_; ObIPSFreezeCb* major_freeze_cb_; common::ObArray partitions_; diff --git a/unittest/storage/fake_partition_mgr.h b/unittest/storage/fake_partition_mgr.h index 78ed00833..8b9cbc331 100644 --- a/unittest/storage/fake_partition_mgr.h +++ b/unittest/storage/fake_partition_mgr.h @@ -26,7 +26,7 @@ namespace oceanbase { namespace storage { class ObFakePartitionStorage : public ObIPartitionStorage { - public: +public: ObFakePartitionStorage(); virtual ~ObFakePartitionStorage(); @@ -210,7 +210,7 @@ class ObFakePartitionStorage : public ObIPartitionStorage { return NULL; } - private: +private: common::ObPartitionKey partition_key_; uint64_t merged_version_; enum ObPartitionStorageStatus state_; @@ -219,7 +219,7 @@ class ObFakePartitionStorage : public ObIPartitionStorage { }; class ObFakePartition : public ObIPartition { - public: +public: ObFakePartition(); virtual ~ObFakePartition() {} @@ -316,7 +316,7 @@ class ObFakePartition : public ObIPartition { return common::OB_SUCCESS; } - private: +private: common::ObPartitionKey partition_key_; ObFakePartitionStorage storage_; @@ -327,7 +327,7 @@ class ObFakePartition : public ObIPartition { }; class ObMajorFreezeTask : public share::ObAsyncTask { - public: +public: ObMajorFreezeTask(ObIMajorFreezeCb* cb, const common::ObPartitionKey& partition_key, const int64_t cmd, const int64_t frozen_version, const int64_t frozen_timestamp, const int err); virtual ~ObMajorFreezeTask() @@ -340,7 +340,7 @@ class ObMajorFreezeTask : public share::ObAsyncTask { } virtual share::ObAsyncTask* deep_copy(char* buf, const int64_t buf_size) const; - private: +private: ObIMajorFreezeCb* cb_; common::ObPartitionKey partition_key_; int64_t cmd_; @@ -350,9 +350,9 @@ class ObMajorFreezeTask : public share::ObAsyncTask { }; class ObFakePartitionMgr : public ObIPartitionMgr { - public: +public: class ObFakePartitionIter : public ObIPartitionIter { - public: + public: ObFakePartitionIter(ObFakePartitionMgr& pt_mgr) : index_(0), pt_mgr_(pt_mgr) {} virtual ~ObFakePartitionIter() @@ -366,7 +366,7 @@ class ObFakePartitionMgr : public ObIPartitionMgr { // make iterator work even delete partition during iteration void fit_delete(const int64_t index); - private: + private: int64_t index_; ObFakePartitionMgr& pt_mgr_; }; @@ -425,7 +425,7 @@ class ObFakePartitionMgr : public ObIPartitionMgr { mf_test_mode_ = mode; } - private: +private: int gen_err(const int64_t i); ObFakePartitionIter partition_iter_; diff --git a/unittest/storage/memtable/mvcc/test_keybtree.cpp b/unittest/storage/memtable/mvcc/test_keybtree.cpp index 7d12b7710..36c9df6e8 100644 --- a/unittest/storage/memtable/mvcc/test_keybtree.cpp +++ b/unittest/storage/memtable/mvcc/test_keybtree.cpp @@ -102,7 +102,7 @@ int alloc_key(BtreeKey*& ret_key, int64_t key) } class FakeAllocator : public ObIAllocator { - public: +public: void* alloc(int64_t size) { return ob_malloc(size, attr); diff --git a/unittest/storage/memtable/mvcc/test_mvcc_callback.cpp b/unittest/storage/memtable/mvcc/test_mvcc_callback.cpp index 19c308a01..04b0d5365 100644 --- a/unittest/storage/memtable/mvcc/test_mvcc_callback.cpp +++ b/unittest/storage/memtable/mvcc/test_mvcc_callback.cpp @@ -23,7 +23,7 @@ using namespace oceanbase::common; using namespace oceanbase::memtable; class ObMockTransCallback : public ObITransCallback { - public: +public: ObMockTransCallback(ObMemtable* mt) : fake_mt_(mt) {} diff --git a/unittest/storage/memtable/ob_row_builder.h b/unittest/storage/memtable/ob_row_builder.h index 548dccc4f..59cc719f4 100644 --- a/unittest/storage/memtable/ob_row_builder.h +++ b/unittest/storage/memtable/ob_row_builder.h @@ -26,7 +26,7 @@ namespace unittest { #include "strutils.h" typedef ObSEArray ColDescArray; class ColDescBuilder { - public: +public: const ColDescArray& get_columns() const { return columns_; @@ -40,12 +40,12 @@ class ColDescBuilder { columns_.push_back(col_desc); } - private: +private: ColDescArray columns_; }; class RowIterBuilder { - public: +public: enum { MAX_ROWKEY_OBJ = 64 }; RowIterBuilder(const ColDescArray& cols) : cols_(cols) {} @@ -70,7 +70,7 @@ class RowIterBuilder { return obj_array_; } - private: +private: static int parse_obj(ObObj& obj, const char* val) { int err = OB_SUCCESS; @@ -78,7 +78,7 @@ class RowIterBuilder { return err; } - private: +private: const ColDescArray& cols_; ObObj obj_array_[MAX_ROWKEY_OBJ]; ObMtRowIterator iter_; diff --git a/unittest/storage/memtable/strutils.h b/unittest/storage/memtable/strutils.h index e3511f7ec..f7ca8db45 100644 --- a/unittest/storage/memtable/strutils.h +++ b/unittest/storage/memtable/strutils.h @@ -11,7 +11,7 @@ */ class Printer { - public: +public: enum { MAX_BUF_SIZE = 4096 }; Printer() : limit_(MAX_BUF_SIZE), pos_(0) { @@ -60,14 +60,14 @@ class Printer { return src; } - private: +private: char buf_[MAX_BUF_SIZE]; int64_t limit_; int64_t pos_; }; class Tokenizer { - public: +public: Tokenizer(char* str, const char* delim) : str_(str), delim_(delim), saveptr_(NULL) {} ~Tokenizer() @@ -83,7 +83,7 @@ class Tokenizer { return ret; } - private: +private: char* str_; const char* delim_; char* saveptr_; diff --git a/unittest/storage/memtable/test_base.h b/unittest/storage/memtable/test_base.h index f9dbe0eeb..9eed365fd 100644 --- a/unittest/storage/memtable/test_base.h +++ b/unittest/storage/memtable/test_base.h @@ -60,7 +60,7 @@ struct Callable { typedef void* (*pthread_handler_t)(void*); class BaseWorker { - public: +public: static const int64_t MAX_N_THREAD = 16; struct WorkContext { WorkContext() : callable_(NULL), idx_(0) @@ -78,7 +78,7 @@ class BaseWorker { int64_t idx_; }; - public: +public: BaseWorker() : n_thread_(0), thread_running_(false) {} ~BaseWorker() @@ -86,7 +86,7 @@ class BaseWorker { wait(); } - public: +public: BaseWorker& set_thread_num(int64_t n) { n_thread_ = n; @@ -150,7 +150,7 @@ class BaseWorker { return err; } - protected: +protected: int64_t n_thread_; bool thread_running_; WorkContext ctx_[MAX_N_THREAD]; @@ -214,13 +214,13 @@ class RWT : public Callable { int64_t idx_; }; - public: +public: RWT() : n_read_thread_(0), n_write_thread_(0), n_admin_thread_(0) {} virtual ~RWT() {} - public: +public: int64_t get_thread_num() { return 1 + n_read_thread_ + n_write_thread_ + n_admin_thread_; @@ -296,7 +296,7 @@ class RWT : public Callable { return 0; } - protected: +protected: int64_t n_read_thread_; int64_t n_write_thread_; int64_t n_admin_thread_; @@ -354,13 +354,13 @@ struct BaseConfig { }; class FixedAllocator : public ObIAllocator { - public: +public: FixedAllocator(char* buf, int64_t limit) : buf_(buf), limit_(limit), pos_(0) {} virtual ~FixedAllocator() {} - public: +public: void reset() { pos_ = 0; @@ -381,7 +381,7 @@ class FixedAllocator : public ObIAllocator { UNUSED(ptr); } - private: +private: char* buf_; int64_t limit_; int64_t pos_; diff --git a/unittest/storage/memtable/test_memtable_multi_version_row_iterator.cpp b/unittest/storage/memtable/test_memtable_multi_version_row_iterator.cpp index 320e696ce..766d384c9 100644 --- a/unittest/storage/memtable/test_memtable_multi_version_row_iterator.cpp +++ b/unittest/storage/memtable/test_memtable_multi_version_row_iterator.cpp @@ -37,7 +37,7 @@ using namespace rpc::frame; using namespace compaction; namespace memtable { class TestMemtableMultiVersionRowIterator : public ::testing::Test { - public: +public: static const int64_t TEST_ROWKEY_COLUMN_CNT = 2; static const int64_t TEST_COLUMN_CNT = ObExtendType; TestMemtableMultiVersionRowIterator(); @@ -48,10 +48,10 @@ class TestMemtableMultiVersionRowIterator : public ::testing::Test { void init(); void init_table_param(const ObTableSchema& schema, const ObColDescIArray& cols); - private: +private: bool is_inited_; - protected: +protected: ObTableIterParam table_param_; ObTableAccessContext table_access_context_; ObArenaAllocator allocator_; diff --git a/unittest/storage/memtable/utils_mock_ctx.h b/unittest/storage/memtable/utils_mock_ctx.h index eecaeb5e6..8778979cd 100644 --- a/unittest/storage/memtable/utils_mock_ctx.h +++ b/unittest/storage/memtable/utils_mock_ctx.h @@ -32,13 +32,13 @@ struct ObMtCtxMembers { }; class ObMtCtx : public ObIMemtableCtx, public ObMtCtxMembers { - public: +public: ObMtCtx() {} ~ObMtCtx() {} - public: +public: void fill_trace_log(const char* fmt, ...) { va_list args; @@ -74,7 +74,7 @@ class ObMtCtx : public ObIMemtableCtx, public ObMtCtxMembers { return ret; } - public: +public: int trans_begin() { return OB_SUCCESS; diff --git a/unittest/storage/memtable/utils_mock_row.h b/unittest/storage/memtable/utils_mock_row.h index 6e2d22e77..ddf638ea6 100644 --- a/unittest/storage/memtable/utils_mock_row.h +++ b/unittest/storage/memtable/utils_mock_row.h @@ -26,7 +26,7 @@ using namespace oceanbase::memtable; using namespace oceanbase::storage; class ObMtRowIterator : public ObStoreRowIterator { - public: +public: ObMtRowIterator() : cursor_(0) {} ~ObMtRowIterator() @@ -55,7 +55,7 @@ class ObMtRowIterator : public ObStoreRowIterator { rows_.push_back(row); } - private: +private: int64_t cursor_; ObSEArray rows_; }; diff --git a/unittest/storage/memtable/utils_mod_allocator.h b/unittest/storage/memtable/utils_mod_allocator.h index cc27b21f9..c4f856f2b 100644 --- a/unittest/storage/memtable/utils_mod_allocator.h +++ b/unittest/storage/memtable/utils_mod_allocator.h @@ -20,7 +20,7 @@ namespace unittest { using namespace oceanbase::common; class ObModAllocator : public DefaultPageAllocator { - public: +public: void* mod_alloc(const int64_t size, const char* label) { set_label(label); diff --git a/unittest/storage/memtable/utils_rowkey_builder.h b/unittest/storage/memtable/utils_rowkey_builder.h index 482f08cda..83ebb9b1c 100644 --- a/unittest/storage/memtable/utils_rowkey_builder.h +++ b/unittest/storage/memtable/utils_rowkey_builder.h @@ -25,7 +25,7 @@ namespace unittest { using namespace oceanbase::common; class ObStoreRowkeyWrapper { - public: +public: template ObStoreRowkeyWrapper(const Args&... args) : obj_cnt_(0) { @@ -38,7 +38,7 @@ class ObStoreRowkeyWrapper { ~ObStoreRowkeyWrapper() {} - public: +public: CharArena& get_allocator() { return allocator_; @@ -68,7 +68,7 @@ class ObStoreRowkeyWrapper { return rowkey_ = ObStoreRowkey(objs_, obj_cnt_); } - private: +private: template void fill(const T& head, const Args&... args) { @@ -79,7 +79,7 @@ class ObStoreRowkeyWrapper { { /*for recursion exit*/ } - private: +private: CharArena allocator_; mutable ObObj objs_[OB_MAX_ROWKEY_COLUMN_NUMBER]; int64_t obj_cnt_; @@ -87,7 +87,7 @@ class ObStoreRowkeyWrapper { }; class ObColumnDesc { - public: +public: template ObColumnDesc(const Args&... args) { @@ -98,7 +98,7 @@ class ObColumnDesc { return columns_; } - private: +private: template void fill(const uint64_t col_id, const ObObjType col_type, const ObCollationType col_collation, const Args&... args) { @@ -113,7 +113,7 @@ class ObColumnDesc { { /*for recursion exit*/ } - private: +private: ObSEArray columns_; }; @@ -121,33 +121,33 @@ class ObColumnDesc { #define DEFINE_TYPE_OBJ(classname, ctype, obtype) \ class classname { \ - public: \ + public: \ classname(const ctype v) : v_(v) \ {} \ ~classname() \ {} \ \ - public: \ + public: \ void build(ObStoreRowkeyWrapper& rowkey_wrapper) const \ { \ rowkey_wrapper.get_cur_obj().set_##obtype(v_); \ rowkey_wrapper.add_obj(); \ } \ \ - private: \ + private: \ const ctype v_; \ }; #define DEFINE_CHARTYPE_OBJ(classname, obtype, cltype) \ class classname { \ - public: \ + public: \ classname(const char* str, const int64_t len, const ObCollationType cltype = CS_TYPE_UTF8MB4_BIN) \ : str_(str), len_(len), cltype_(cltype) \ {} \ ~classname() \ {} \ \ - public: \ + public: \ void build(ObStoreRowkeyWrapper& rowkey_wrapper) const \ { \ ObString obstr; \ @@ -157,7 +157,7 @@ class ObColumnDesc { rowkey_wrapper.add_obj(); \ } \ \ - private: \ + private: \ const char* str_; \ const int64_t len_; \ const ObCollationType cltype_; \ @@ -165,13 +165,13 @@ class ObColumnDesc { #define DEFINE_NMBTYPE_OBJ(classname, obtype) \ class classname { \ - public: \ + public: \ classname(const char* str) : str_(str) \ {} \ ~classname() \ {} \ \ - public: \ + public: \ void build(ObStoreRowkeyWrapper& rowkey_wrapper) const \ { \ number::ObNumber obnmb; \ @@ -180,18 +180,18 @@ class ObColumnDesc { rowkey_wrapper.add_obj(); \ } \ \ - private: \ + private: \ const char* str_; \ }; class U { - public: +public: U() {} ~U() {} - public: +public: void build(ObStoreRowkeyWrapper& rowkey_wrapper) const { rowkey_wrapper.get_cur_obj().set_null(); @@ -200,13 +200,13 @@ class U { }; class OBMIN { - public: +public: OBMIN() {} ~OBMIN() {} - public: +public: void build(ObStoreRowkeyWrapper& rowkey_wrapper) const { rowkey_wrapper.get_cur_obj().set_ext(ObObj::MIN_OBJECT_VALUE); @@ -215,13 +215,13 @@ class OBMIN { }; class OBMAX { - public: +public: OBMAX() {} ~OBMAX() {} - public: +public: void build(ObStoreRowkeyWrapper& rowkey_wrapper) const { rowkey_wrapper.get_cur_obj().set_ext(ObObj::MAX_OBJECT_VALUE); diff --git a/unittest/storage/mock_ob_base_storage.h b/unittest/storage/mock_ob_base_storage.h index 82e6a41d9..b6b4a5af6 100644 --- a/unittest/storage/mock_ob_base_storage.h +++ b/unittest/storage/mock_ob_base_storage.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace storage { class MockObBaseStorage : public ObBaseStorage { - public: +public: MockObBaseStorage() {} virtual ~MockObBaseStorage() diff --git a/unittest/storage/mock_ob_mem_store.h b/unittest/storage/mock_ob_mem_store.h index e9231c08e..c0ced28fb 100644 --- a/unittest/storage/mock_ob_mem_store.h +++ b/unittest/storage/mock_ob_mem_store.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace storage { class MockObMemStore : public ObIStore { - public: +public: MOCK_METHOD0(destroy, void()); MOCK_METHOD6(get, int(const ObStoreCtx& ctx, const ObQueryFlag query_flag, const uint64_t table_id, const common::ObStoreRowkey& rowkey, const common::ObIArray& columns, diff --git a/unittest/storage/mock_ob_partition.h b/unittest/storage/mock_ob_partition.h index d3eeefbfe..ffee155c9 100644 --- a/unittest/storage/mock_ob_partition.h +++ b/unittest/storage/mock_ob_partition.h @@ -36,7 +36,7 @@ class ObIPartitionComponentFactory; class ObIPartitionStorage; class ObReplayStatus; class MockObPartition : public ObIPartition { - public: +public: int init(const common::ObPartitionKey& key, ObIPartitionComponentFactory* cp_fty, share::schema::ObMultiVersionSchemaService* schema_service, ObBaseStorage* base_storage, clog::ObIPartitionLogService* pls, transaction::ObTransService* txs) @@ -321,12 +321,12 @@ class MockObPartition : public ObIPartition { return NULL; } - protected: +protected: common::ObPartitionKey partition_key_; ObReplayStatus relay_ststus_; ObPartitionMCState partition_mc_state_; - private: +private: // disallow copy // DISALLOW_COPY_AND_ASSIGN(ObIPartition); }; diff --git a/unittest/storage/mock_ob_partition_component_factory.h b/unittest/storage/mock_ob_partition_component_factory.h index ef4d371d6..ce233a328 100644 --- a/unittest/storage/mock_ob_partition_component_factory.h +++ b/unittest/storage/mock_ob_partition_component_factory.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace storage { class MockObIPartitionComponentFactory : public ObIPartitionComponentFactory { - public: +public: MOCK_METHOD1(get_partition, ObIPartitionGroup*(const uint64_t tenant_id)); MOCK_METHOD1(get_replay_status, ObReplayStatus*(const uint64_t tenant_id)); MOCK_METHOD0(get_ssstore, ObSSStore*()); diff --git a/unittest/storage/mock_ob_partition_report.h b/unittest/storage/mock_ob_partition_report.h index 5d96c8dc2..e713c297c 100644 --- a/unittest/storage/mock_ob_partition_report.h +++ b/unittest/storage/mock_ob_partition_report.h @@ -24,7 +24,7 @@ namespace oceanbase { namespace storage { class MockObIPartitionReport : public ObIPartitionReport { - public: +public: MockObIPartitionReport() {} virtual ~MockObIPartitionReport() diff --git a/unittest/storage/mock_ob_partition_service.h b/unittest/storage/mock_ob_partition_service.h index 8ec44cf7c..edde4984a 100644 --- a/unittest/storage/mock_ob_partition_service.h +++ b/unittest/storage/mock_ob_partition_service.h @@ -32,7 +32,7 @@ namespace oceanbase { namespace storage { class MockObIPartitionService : public ObPartitionService { - public: +public: MOCK_METHOD1(on_leader_revoke, int(const common::ObPartitionKey& pkey)); MOCK_METHOD1(on_leader_takeover, int(const common::ObPartitionKey& pkey)); MOCK_METHOD1(on_leader_active, int(const common::ObPartitionKey& pkey)); @@ -208,7 +208,7 @@ class MockObIPartitionService : public ObPartitionService { }; class MockObIPartitionArrayGuard : public ObIPartitionArrayGuard { - public: +public: MOCK_METHOD1(push_back, int(ObIPartitionGroup* partition)); MOCK_METHOD1(at, ObIPartitionGroup*(int64_t i)); MOCK_METHOD0(count, int64_t); @@ -222,7 +222,7 @@ namespace oceanbase { namespace storage { class MockObIPartitionArrayGuard : public ObIPartitionArrayGuard { - public: +public: }; } // namespace storage diff --git a/unittest/storage/mock_ob_ss_store.h b/unittest/storage/mock_ob_ss_store.h index 1fe287c68..fd7515461 100644 --- a/unittest/storage/mock_ob_ss_store.h +++ b/unittest/storage/mock_ob_ss_store.h @@ -20,7 +20,7 @@ namespace oceanbase { namespace storage { class MockObSSStore : public ObSSStore { - public: +public: MockObSSStore() {} virtual ~MockObSSStore() diff --git a/unittest/storage/mock_ob_sstable.h b/unittest/storage/mock_ob_sstable.h index a7e82a70f..2aa9329a3 100644 --- a/unittest/storage/mock_ob_sstable.h +++ b/unittest/storage/mock_ob_sstable.h @@ -16,7 +16,7 @@ namespace oceanbase { namespace storage { class MockObMacroBlockIterator : public ObMacroBlockIterator { - public: +public: MockObMacroBlockIterator() {} virtual ~MockObMacroBlockIterator() @@ -25,7 +25,7 @@ class MockObMacroBlockIterator : public ObMacroBlockIterator { }; class MockObSSTable : public ObSSTable { - public: +public: MockObSSTable() {} virtual ~MockObSSTable() diff --git a/unittest/storage/mock_ob_store_row_iterator.h b/unittest/storage/mock_ob_store_row_iterator.h index 2cb3bf101..8b8d02b90 100644 --- a/unittest/storage/mock_ob_store_row_iterator.h +++ b/unittest/storage/mock_ob_store_row_iterator.h @@ -17,7 +17,7 @@ namespace oceanbase { namespace storage { class MockObStoreRowIterator : public ObStoreRowIterator { - public: +public: MockObStoreRowIterator() {} virtual ~MockObStoreRowIterator() diff --git a/unittest/storage/mockcontainer/fake_partition_utils.h b/unittest/storage/mockcontainer/fake_partition_utils.h index 09f09c757..33f4b5781 100644 --- a/unittest/storage/mockcontainer/fake_partition_utils.h +++ b/unittest/storage/mockcontainer/fake_partition_utils.h @@ -27,7 +27,7 @@ namespace storage { class FakePartition; class FakePartitionStorage : public storage::MockObIPartitionStorage { - public: +public: FakePartitionStorage(FakePartition& holder) : holder_(holder) {} virtual ~FakePartitionStorage() @@ -82,12 +82,12 @@ class FakePartitionStorage : public storage::MockObIPartitionStorage { return common::OB_SUCCESS; } - private: +private: FakePartition& holder_; }; class FakePartition : public storage::MockObIPartition, public blocksstable::ObIBaseStorageLogEntry { - public: +public: FakePartition() : pmeta_(), smeta_(), arena_(ObModIds::OB_PARTITION_SERVICE), storage_(*this) {} virtual ~FakePartition() @@ -114,7 +114,7 @@ class FakePartition : public storage::MockObIPartition, public blocksstable::ObI return pos; } - public: +public: blocksstable::ObPartitionMeta pmeta_; blocksstable::ObSSTableMeta smeta_; ObArenaAllocator arena_; @@ -122,7 +122,7 @@ class FakePartition : public storage::MockObIPartition, public blocksstable::ObI }; class FakePartitionService : public MockObIPartitionService { - public: +public: FakePartitionService() : partition_list_(), cp_fty_(NULL), arena_(ObModIds::OB_PARTITION_SERVICE) { init(); @@ -143,7 +143,7 @@ class FakePartitionService : public MockObIPartitionService { virtual int replay_base_storage_log( const int64_t log_seq_num, const int64_t subcmd, const char* buf, const int64_t len, int64_t& pos); - private: +private: ObSEArray partition_list_; ObPartitionComponentFactory* cp_fty_; ObArenaAllocator arena_; diff --git a/unittest/storage/mockcontainer/mock_misc_for_ps_test.h b/unittest/storage/mockcontainer/mock_misc_for_ps_test.h index 157f84217..9fecd4f6c 100644 --- a/unittest/storage/mockcontainer/mock_misc_for_ps_test.h +++ b/unittest/storage/mockcontainer/mock_misc_for_ps_test.h @@ -39,18 +39,18 @@ using namespace sql; using namespace transaction; class TestTransVersion { - public: +public: static const int64_t TRANS_VERSION = 1; }; class MyIter : public ObStoreRowIterator { - public: +public: enum IterType { T_INVALID, T_GET, T_SCAN, }; - public: +public: MyIter() { clear(); @@ -62,7 +62,7 @@ class MyIter : public ObStoreRowIterator { inline int set_type(const IterType& type, const ObIArray* rowkeys = NULL); inline void clear(); - private: +private: IterType type_; ObStoreRow row_; const common::ObIArray* rowkeys_; @@ -133,7 +133,7 @@ int MyIter::get_next_row(const ObStoreRow*& row) } class MySSStore : public ObIStore { - public: +public: MySSStore() : allocator_(ObModIds::OB_ST_TEMP, OB_MALLOC_NORMAL_BLOCK_SIZE) { set_version(ObVersion(1)); @@ -243,7 +243,7 @@ class MySSStore : public ObIStore { return 0; } - private: +private: common::ObArenaAllocator allocator_; ObStoreRow not_exist_row_; }; @@ -333,7 +333,7 @@ inline int MySSStore::multi_get(const ObStoreCtx& ctx, const ObQueryFlag flag, c } class MySchemaService : public oceanbase::share::schema::MockSchemaService { - public: +public: inline int init(const char* file_name); void get_schema_guard(ObSchemaGetterGuard*& schema_guard) { @@ -342,10 +342,10 @@ class MySchemaService : public oceanbase::share::schema::MockSchemaService { // inline virtual int release_schema(const ObSchemaManager *schema); // inline virtual const ObSchemaManager *get_schema_manager_by_version(const int64_t version = 0, // const bool for_merge = false); - private: +private: // inline virtual const ObSchemaManager *get_user_schema_manager(const int64_t version); // inline virtual int get_all_schema(ObSchemaManager &out_schema, const int64_t frozen_version = -1); - private: +private: ObRestoreSchema restore_schema_; ObSchemaGetterGuard* schema_guard_; // ObSchemaManager *manager_; @@ -394,7 +394,7 @@ int MySchemaService::init(const char* file_name) class TestObSchemaService : public MySchemaService {}; class MyNewRowIter : public ObNewRowIterator { - public: +public: MyNewRowIter() : iter_(NULL) {} virtual ~MyNewRowIter() @@ -404,7 +404,7 @@ class MyNewRowIter : public ObNewRowIterator { virtual void reset(); virtual int get_next_row(ObNewRow*& row); - private: +private: ObStoreRowIterator* iter_; }; inline void MyNewRowIter::reset() @@ -433,13 +433,13 @@ inline int MyNewRowIter::get_next_row(ObNewRow*& row) template class TestArray : public ObIArray { - public: +public: TestArray() : count_(0) {} virtual ~TestArray() {} - public: +public: virtual int push_back(const T& obj); virtual void pop_back() {} @@ -478,7 +478,7 @@ class TestArray : public ObIArray { return OB_ERR_UNEXPECTED; } - private: +private: T array_[ARRAY_SIZE]; int64_t count_; }; @@ -525,7 +525,7 @@ const T& TestArray::at(int64_t idx) const template class TestArray2 : public TestArray { - public: +public: virtual int push_back(const T& obj) { UNUSED(obj); @@ -534,7 +534,7 @@ class TestArray2 : public TestArray { }; class TestPartitionComponentFactory : public ObPartitionComponentFactory { - public: +public: TestPartitionComponentFactory() {} virtual ~TestPartitionComponentFactory() @@ -546,7 +546,7 @@ class TestPartitionComponentFactory : public ObPartitionComponentFactory { }; class TestObMemtable : public ObMemtable { - public: +public: virtual int set(const storage::ObStoreCtx& ctx, const uint64_t table_id, const int64_t rowkey_len, const common::ObIArray& columns, const storage::ObStoreRow& row) { @@ -564,7 +564,7 @@ class TestObMemtable : public ObMemtable { }; class TestObMemtable2 : public ObMemtable { - public: +public: virtual int set(const storage::ObStoreCtx& ctx, const uint64_t table_id, const int64_t rowkey_len, const common::ObIArray& columns, const storage::ObStoreRow& row) { @@ -592,7 +592,7 @@ class TestObMemtable2 : public ObMemtable { }; class TestObMemtable3 : public ObMemtable { - public: +public: TestObMemtable3() { row_.flag_ = ObActionFlag::OP_DEL_ROW; @@ -629,12 +629,12 @@ class TestObMemtable3 : public ObMemtable { return ret; } - private: +private: ObStoreRow row_; }; class TestNewRowIter : public ObNewRowIterator { - public: +public: inline TestNewRowIter(); virtual ~TestNewRowIter() {} @@ -642,7 +642,7 @@ class TestNewRowIter : public ObNewRowIterator { {} inline virtual int get_next_row(ObNewRow*& row); - private: +private: ObNewRow row_; }; diff --git a/unittest/storage/mockcontainer/mock_ob_clog_adapter.h b/unittest/storage/mockcontainer/mock_ob_clog_adapter.h index 133fa72cc..d9da9adc5 100644 --- a/unittest/storage/mockcontainer/mock_ob_clog_adapter.h +++ b/unittest/storage/mockcontainer/mock_ob_clog_adapter.h @@ -36,7 +36,7 @@ struct MySubmitLogTask { }; class MockObClogAdapter : public ObIClogAdapter, public ObSimpleThreadPool { - public: +public: MockObClogAdapter() {} ~MockObClogAdapter() diff --git a/unittest/storage/mockcontainer/mock_ob_election_mgr.h b/unittest/storage/mockcontainer/mock_ob_election_mgr.h index a0b7663d1..e5c42eece 100644 --- a/unittest/storage/mockcontainer/mock_ob_election_mgr.h +++ b/unittest/storage/mockcontainer/mock_ob_election_mgr.h @@ -18,7 +18,7 @@ namespace oceanbase { namespace election { class MockObIElectionMgr : public ObIElectionMgr { - public: +public: MockObIElectionMgr() {} virtual ~MockObIElectionMgr() @@ -69,7 +69,7 @@ class MockObIElectionMgr : public ObIElectionMgr { return common::OB_SUCCESS; } - public: +public: virtual int add_partition(const common::ObPartitionKey& partition, const int64_t replica_num, ObIElectionCallback* election_cb, ObIElection*& election) { @@ -114,7 +114,7 @@ class MockObIElectionMgr : public ObIElectionMgr { return common::OB_SUCCESS; } - public: +public: virtual int handle_election_msg(const ObElectionMsgBuffer& msgbuf, obrpc::ObElectionRpcResult& result) { UNUSED(msgbuf); @@ -122,7 +122,7 @@ class MockObIElectionMgr : public ObIElectionMgr { return common::OB_SUCCESS; } - public: +public: virtual int set_candidate(const common::ObPartitionKey& partition, const common::ObMemberList& prev_mlist, const common::ObMemberList& curr_mlist) { diff --git a/unittest/storage/mockcontainer/mock_ob_end_trans_callback.h b/unittest/storage/mockcontainer/mock_ob_end_trans_callback.h index 1911752a2..5b5478c00 100644 --- a/unittest/storage/mockcontainer/mock_ob_end_trans_callback.h +++ b/unittest/storage/mockcontainer/mock_ob_end_trans_callback.h @@ -19,7 +19,7 @@ namespace oceanbase { namespace unittest { class MockObEndTransCallback : public sql::ObExclusiveEndTransCallback { - public: +public: virtual int wait() { int res = OB_SUCCESS; @@ -44,10 +44,10 @@ class MockObEndTransCallback : public sql::ObExclusiveEndTransCallback { return sql::MOCK_CALLBACK_TYPE; } - private: +private: static const int64_t WAIT_US = 1000 * 1000 * 1000; - private: +private: transaction::ObTransCond cond_; }; diff --git a/unittest/storage/mockcontainer/mock_ob_iterator.h b/unittest/storage/mockcontainer/mock_ob_iterator.h index a80a9df70..93fa161ad 100644 --- a/unittest/storage/mockcontainer/mock_ob_iterator.h +++ b/unittest/storage/mockcontainer/mock_ob_iterator.h @@ -24,10 +24,10 @@ namespace oceanbase { namespace common { class ObMockIterator : public storage::ObStoreRowIterator { - public: +public: static const int64_t DEF_ROW_NUM = 512; - public: +public: ObMockIterator(bool reverse = false); virtual ~ObMockIterator(); @@ -183,7 +183,7 @@ class ObMockIterator : public storage::ObStoreRowIterator { return metas_; } - private: +private: void setup_start_cursor(); void advance(); bool end_of_row() const; @@ -199,7 +199,7 @@ class ObMockIterator : public storage::ObStoreRowIterator { template class ObMockRowIterator : public T { - public: +public: ObMockRowIterator(bool reverse = false) : iter_(reverse) {} virtual ~ObMockRowIterator() @@ -272,7 +272,7 @@ class ObMockRowIterator : public T { return bool_ret; } - private: +private: ObMockIterator iter_; }; typedef ObMockRowIterator ObMockStoreRowIterator; @@ -283,7 +283,7 @@ typedef ObMockRowIterator ObMockNewR // parse -> parse->header // -> parse->row -> parse_int(parse_varchar..) class ObMockIteratorBuilder { - public: +public: static const int64_t MAX_DATA_LENGTH = 4096; static const int64_t DEF_COL_NUM = 16; static const int TYPE_NUM = 6; @@ -326,7 +326,7 @@ class ObMockIteratorBuilder { typedef int (*ObParseFunc)(common::ObIAllocator*, const common::ObString&, storage::ObStoreRow&, int64_t&); - public: +public: ObMockIteratorBuilder() : is_inited_(false), allocator_(NULL), escape_('\\') {} ~ObMockIteratorBuilder() @@ -337,7 +337,7 @@ class ObMockIteratorBuilder { int parse_with_specified_col_ids(const ObString& str, ObMockIterator& iter, uint16_t* col_id_array_list = nullptr, int64_t* result_col_id_array = nullptr); - private: +private: static int static_init(); static int parse_varchar( common::ObIAllocator* allocator, const common::ObString& word, storage::ObStoreRow& row, int64_t& idx); @@ -400,10 +400,10 @@ class ObMockIteratorBuilder { } // inline bool is_row_end(const common::ObString &word); - public: +public: static transaction::ObTransID trans_id_list_[TRANS_ID_NUM]; - private: +private: static bool is_static_inited_; // hash ObString to obj parse func , such as parse_int ... static common::hash::ObHashMap str_to_obj_parse_func_; @@ -417,7 +417,7 @@ class ObMockIteratorBuilder { static common::hash::ObHashMap str_to_multi_version_row_flag_; static common::hash::ObHashMap str_to_trans_id_; - private: +private: bool is_inited_; common::ObIAllocator* allocator_; char escape_; @@ -426,7 +426,7 @@ class ObMockIteratorBuilder { class MockObNewRowIterator : public ObNewRowIterator { OB_UNIS_VERSION(1); - public: +public: MockObNewRowIterator(); ~MockObNewRowIterator(); static bool equals(const common::ObNewRow& r1, const common::ObNewRow& r2); @@ -456,7 +456,7 @@ class MockObNewRowIterator : public ObNewRowIterator { return iter_.add_row(row); } - private: +private: ObMockIterator iter_; common::PageArena allocator_; }; diff --git a/unittest/storage/mockcontainer/mock_ob_location_cache.h b/unittest/storage/mockcontainer/mock_ob_location_cache.h index 3602526ce..14d896b5c 100644 --- a/unittest/storage/mockcontainer/mock_ob_location_cache.h +++ b/unittest/storage/mockcontainer/mock_ob_location_cache.h @@ -27,18 +27,18 @@ using namespace common::hash; namespace share { class MockObLocationCache : public ObIPartitionLocationCache { - public: +public: MockObLocationCache() {} virtual ~MockObLocationCache() {} int init(); - public: +public: int add(const ObPartitionKey& partition, const ObAddr& leader); int add_overwrite(const ObPartitionKey& partition, const ObAddr& leader); - public: +public: virtual ObIPartitionLocationCache::PartitionLocationCacheType get_type() const { return static_cast(PART_LOC_CACHE_TYPE_NORMAL); @@ -128,10 +128,10 @@ class MockObLocationCache : public ObIPartitionLocationCache { return common::OB_INVALID_ID; } - private: +private: static const int64_t BUCKET_NUM = 137; - private: +private: ObHashMap partition_addr_map_; }; diff --git a/unittest/storage/mockcontainer/mock_ob_partition.h b/unittest/storage/mockcontainer/mock_ob_partition.h index ce942c010..8c9d40173 100644 --- a/unittest/storage/mockcontainer/mock_ob_partition.h +++ b/unittest/storage/mockcontainer/mock_ob_partition.h @@ -27,7 +27,7 @@ namespace oceanbase { namespace storage { class MockObIPartitionGroup : public ObIPartitionGroup { - public: +public: MOCK_METHOD8(init, int(const common::ObPartitionKey& key, ObIPartitionComponentFactory* cp_fty, share::schema::ObMultiVersionSchemaService* schema_service, transaction::ObTransService* txs, replayengine::ObILogReplayEngine* rp_eg, ObPartitionService* ps, diff --git a/unittest/storage/mockcontainer/mock_ob_partition_service.h b/unittest/storage/mockcontainer/mock_ob_partition_service.h index b51cef3ca..0c32f74c9 100644 --- a/unittest/storage/mockcontainer/mock_ob_partition_service.h +++ b/unittest/storage/mockcontainer/mock_ob_partition_service.h @@ -39,7 +39,7 @@ using namespace blocksstable; namespace storage { class MockObIPartitionService : public ObPartitionService { - public: +public: MOCK_METHOD0(reload_config, int()); MOCK_METHOD1(on_leader_revoke, int(const common::ObPartitionKey& partition_key)); MOCK_METHOD1(on_leader_takeover, int(const common::ObPartitionKey& partition_key)); @@ -320,7 +320,7 @@ class MockObIPartitionService : public ObPartitionService { int(const common::ObPartitionKey& pkey, const int64_t schema_version, int64_t& max_commit_version)); MOCK_METHOD2(check_ctx_create_timestamp_elapsed, int(const common::ObPartitionKey& pkey, const int64_t ts)); - public: +public: ObPartitionGroup mock_pg_; }; diff --git a/unittest/storage/mockcontainer/mock_ob_partition_storage.h b/unittest/storage/mockcontainer/mock_ob_partition_storage.h index 39a1537ea..66d32e26f 100644 --- a/unittest/storage/mockcontainer/mock_ob_partition_storage.h +++ b/unittest/storage/mockcontainer/mock_ob_partition_storage.h @@ -21,7 +21,7 @@ namespace oceanbase { namespace storage { class MockObIPartitionStorage : public ObIPartitionStorage { - public: +public: virtual ~MockObIPartitionStorage() {} MOCK_METHOD5(init, diff --git a/unittest/storage/mockcontainer/mock_ob_schema_service.h b/unittest/storage/mockcontainer/mock_ob_schema_service.h index 9b18f12d7..8a6093e93 100644 --- a/unittest/storage/mockcontainer/mock_ob_schema_service.h +++ b/unittest/storage/mockcontainer/mock_ob_schema_service.h @@ -29,7 +29,7 @@ namespace share { namespace schema { class MockObSchemaService : public ObMultiVersionSchemaService { - public: +public: MockObSchemaService() : schema_guard_(NULL) {} ~MockObSchemaService() @@ -40,11 +40,11 @@ class MockObSchemaService : public ObMultiVersionSchemaService { // virtual int release_schema(const ObSchemaManager *schema); // virtual int64_t get_latest_local_version(const bool core_schema_version = false) const; // virtual int64_t get_received_broadcast_version(const bool core_schema_version = false) const; - private: +private: // virtual const ObSchemaManager *get_user_schema_manager(const int64_t version); virtual const ObSchemaGetterGuard* get_schema_guard(const int64_t version); - private: +private: ObRestoreSchema restore_schema_; // ObSchemaManager *manager_; ObSchemaGetterGuard* schema_guard_; diff --git a/unittest/storage/mockcontainer/mock_ob_server.h b/unittest/storage/mockcontainer/mock_ob_server.h index 09f1e3457..54a733139 100644 --- a/unittest/storage/mockcontainer/mock_ob_server.h +++ b/unittest/storage/mockcontainer/mock_ob_server.h @@ -107,7 +107,7 @@ class MockPartitionServiceVx : public ObPartitionService { namespace common { class MockObRsCb : public ObIPartitionReport { - public: +public: MockObRsCb() {} ~MockObRsCb() @@ -117,7 +117,7 @@ class MockObRsCb : public ObIPartitionReport { return OB_SUCCESS; } - public: +public: int submit_pt_update_task(const ObPartitionKey& pkey, const bool) { UNUSED(pkey); @@ -147,7 +147,7 @@ class MockObRsCb : public ObIPartitionReport { namespace unittest { class MockPartitionTableOperator : public ObPartitionTableOperator { - public: +public: MockPartitionTableOperator(ObIPartPropertyGetter& prop_getter) : ObPartitionTableOperator(prop_getter) {} @@ -158,7 +158,7 @@ class MockPartitionTableOperator : public ObPartitionTableOperator { }; class MockRootRpcProxy : public obrpc::ObCommonRpcProxy { - public: +public: MockRootRpcProxy() {} virtual ~MockRootRpcProxy() @@ -182,7 +182,7 @@ class MockRootRpcProxy : public obrpc::ObCommonRpcProxy { }; class MockObServer { - public: +public: MockObServer(const ObServerOptions& opts) : is_inited_(false), location_cache_(&location_cache_def_), @@ -216,7 +216,7 @@ class MockObServer { int stop(); int wait(); - public: +public: ObPartitionService* get_partition_service(); MockObLocationCache* get_location_cache(); ObAddr& get_self() @@ -229,13 +229,13 @@ class MockObServer { return restore_schema_.get_schema_guard(); } - protected: +protected: bool is_inited_; - protected: +protected: MockObLocationCache* location_cache_; - protected: +protected: ObPartitionComponentFactory partition_cfy_; // MockObSchemaService schema_service_; ObRestoreSchema restore_schema_; @@ -258,7 +258,7 @@ class MockObServer { int64_t warm_up_start_time_; int64_t global_last_merged_version_; - protected: +protected: ObServerOptions opts_; ObAddr self_addr_; ObServerConfig& config_; diff --git a/unittest/storage/mockcontainer/mock_ob_trans_rpc.h b/unittest/storage/mockcontainer/mock_ob_trans_rpc.h index ac4529fa2..876ef9fab 100644 --- a/unittest/storage/mockcontainer/mock_ob_trans_rpc.h +++ b/unittest/storage/mockcontainer/mock_ob_trans_rpc.h @@ -35,7 +35,7 @@ struct RpcTask { }; class MockObTransRpc : public ObITransRpc, public ObSimpleThreadPool { - public: +public: MockObTransRpc(STMap* st_map) { st_map_ = st_map; @@ -116,7 +116,7 @@ class MockObTransRpc : public ObITransRpc, public ObSimpleThreadPool { return ret; } - public: +public: void handle(void* task) { int tmp_ret = 0; @@ -134,7 +134,7 @@ class MockObTransRpc : public ObITransRpc, public ObSimpleThreadPool { delete rpc_task; } - private: +private: STMap* st_map_; }; diff --git a/unittest/storage/mockcontainer/mock_ob_trans_service.h b/unittest/storage/mockcontainer/mock_ob_trans_service.h index c5fe70a65..d3a112fa5 100644 --- a/unittest/storage/mockcontainer/mock_ob_trans_service.h +++ b/unittest/storage/mockcontainer/mock_ob_trans_service.h @@ -63,13 +63,13 @@ namespace transaction { class KillTransArg; class MockObTsMgr : public ObITsMgr { - public: +public: MockObTsMgr(ObLtsSource& source) : source_(source) {} virtual ~MockObTsMgr() {} - public: +public: virtual int update_gts(const uint64_t tenant_id, const int64_t gts, bool& update) { UNUSED(tenant_id); @@ -163,12 +163,12 @@ class MockObTsMgr : public ObITsMgr { return source_.get_gts(stc, NULL, gts, unused); } - private: +private: ObLtsSource& source_; }; class MockObTransService : public ObTransService { - public: +public: memtable::ObMemtableCtxFactory mt_ctx_factory_def_; memtable::ObMemtableCtxFactory* mt_ctx_factory_; memtable::ObIMemtableCtx* mt_ctx_; @@ -374,7 +374,7 @@ class MockObTransService : public ObTransService { return OB_SUCCESS; } - public: +public: virtual memtable::ObIMemtableCtxFactory* get_mem_ctx_factory() { return mt_ctx_factory_; @@ -775,7 +775,7 @@ class MockObTransService : public ObTransService { return OB_SUCCESS; } - private: +private: ObLtsSource lts_source; MockObTsMgr* ts_mgr; }; diff --git a/unittest/storage/mockcontainer/ob_restore_schema.h b/unittest/storage/mockcontainer/ob_restore_schema.h index 447cca2f5..e1b7a10c3 100644 --- a/unittest/storage/mockcontainer/ob_restore_schema.h +++ b/unittest/storage/mockcontainer/ob_restore_schema.h @@ -33,7 +33,7 @@ class ObStmt; class ObCreateIndexStmt; struct ObResolverParams; class ObRestoreSchema { - public: +public: ObRestoreSchema(); virtual ~ObRestoreSchema() = default; int parse_from_file(const char* filename, share::schema::ObSchemaGetterGuard*& schema_guard); @@ -44,14 +44,14 @@ class ObRestoreSchema { // share::schema::ObSchemaManager *get_schema_manager(); int init(); - public: +public: static const int64_t RESTORE_SCHEMA_VERSION = 1; - private: +private: // disallow copy DISALLOW_COPY_AND_ASSIGN(ObRestoreSchema); - protected: +protected: // function members int do_parse_line(common::ObArenaAllocator& allocator, const char* query); int do_create_table(ObStmt* stmt); @@ -61,7 +61,7 @@ class ObRestoreSchema { int add_database_schema(ObDatabaseSchema& database_schema); int add_table_schema(ObTableSchema& table_schema); - public: +public: // data members // share::schema::ObSchemaManager schema_manager_; share::schema::MockSchemaService* schema_service_; diff --git a/unittest/storage/mockcontainer/test_storage.cpp b/unittest/storage/mockcontainer/test_storage.cpp index f8c1d0c78..a4192fb9a 100644 --- a/unittest/storage/mockcontainer/test_storage.cpp +++ b/unittest/storage/mockcontainer/test_storage.cpp @@ -18,7 +18,7 @@ using namespace oceanbase::common; using namespace oceanbase::unittest; class TestObStorage : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/storage/my_fake_ps.h b/unittest/storage/my_fake_ps.h index ab2e0cbb1..ffc46fc71 100644 --- a/unittest/storage/my_fake_ps.h +++ b/unittest/storage/my_fake_ps.h @@ -40,7 +40,7 @@ class ObIPartitionStorage; class ObBaseStorage; class MyFakePartition : public storage::MockObIPartition, public blocksstable::ObIBaseStorageLogEntry { - public: +public: MyFakePartition() : pmeta_(), smeta_(), arena_(ObModIds::OB_PARTITION_SERVICE), storage_(NULL), unused(0) {} virtual ~MyFakePartition() @@ -66,7 +66,7 @@ class MyFakePartition : public storage::MockObIPartition, public blocksstable::O } TO_STRING_EMPTY(); - public: +public: blocksstable::ObPartitionMeta pmeta_; blocksstable::ObSSTableMeta smeta_; ObArenaAllocator arena_; @@ -76,7 +76,7 @@ class MyFakePartition : public storage::MockObIPartition, public blocksstable::O }; class MyFakePartitionService : public MockObIPartitionService { - public: +public: MyFakePartitionService() : partition_list_(), cp_fty_(NULL), @@ -112,7 +112,7 @@ class MyFakePartitionService : public MockObIPartitionService { trans_ = trans; } - private: +private: ObSEArray partition_list_; ObPartitionComponentFactory* cp_fty_; ObArenaAllocator arena_; diff --git a/unittest/storage/ob_multi_version_sstable_test.h b/unittest/storage/ob_multi_version_sstable_test.h index f89d1646b..e3865bdf5 100644 --- a/unittest/storage/ob_multi_version_sstable_test.h +++ b/unittest/storage/ob_multi_version_sstable_test.h @@ -31,12 +31,12 @@ using namespace share::schema; namespace unittest { static const int64_t MACRO_BLOCK_SIZE = 64 * 1024; class ObMultiVersionMockIterator { - private: +private: int64_t rowkey_cnt_; }; class ObMultiVersionSSTableTest : public TestDataFilePrepare { - public: +public: ObMultiVersionSSTableTest(const char* file) : TestDataFilePrepare(file, MACRO_BLOCK_SIZE), is_open_(false), data_iter_cursor_(0) { @@ -118,13 +118,13 @@ class ObMultiVersionSSTableTest : public TestDataFilePrepare { return is_open_; } - private: +private: void prepare_gap_schema(); void prepare_gap_sstable_data(const int load_type); void convert_to_multi_row(const ObStoreRow& org_row, const int64_t snapshot_version, const ObRowDml row_dml, const bool is_compacted_row, const bool is_last_row, const bool is_first_row, ObStoreRow& multi_row); - protected: +protected: static const int64_t DATA_VERSION = 2; static const int64_t MICRO_BLOCK_SIZE = 4 * 1024; static const int64_t MAX_MICRO_BLOCK_CNT = 20; diff --git a/unittest/storage/ob_row_generate_adapter.h b/unittest/storage/ob_row_generate_adapter.h index 1afa153a1..16c65e006 100644 --- a/unittest/storage/ob_row_generate_adapter.h +++ b/unittest/storage/ob_row_generate_adapter.h @@ -29,7 +29,7 @@ using namespace blocksstable; namespace common { class ObMockIterWithLimit : public ObNewRowIterator { - public: +public: ObMockIterWithLimit() : need_row_count_(0), got_row_count_(0){}; ~ObMockIterWithLimit(){}; @@ -48,7 +48,7 @@ class ObMockIterWithLimit : public ObNewRowIterator { return need_row_count_ == got_row_count_; } - protected: +protected: void advance_iter() { ++got_row_count_; @@ -60,7 +60,7 @@ class ObMockIterWithLimit : public ObNewRowIterator { class ObRowGenerateAdapter : public ObMockIterWithLimit { - public: +public: ObRowGenerateAdapter(){}; ~ObRowGenerateAdapter(){}; @@ -89,7 +89,7 @@ class ObRowGenerateAdapter : public ObMockIterWithLimit { generate_.reset(); } - private: +private: ObRowGenerate generate_; ObStoreRow new_row_; }; diff --git a/unittest/storage/ob_sstable_test.h b/unittest/storage/ob_sstable_test.h index 74288e8a8..fb5b39c40 100644 --- a/unittest/storage/ob_sstable_test.h +++ b/unittest/storage/ob_sstable_test.h @@ -40,7 +40,7 @@ struct SkipInfo { }; class ObSSTableTest : public TestDataFilePrepare { - public: +public: ObSSTableTest(const char* data_dir = "sstable", const int64_t macro_block_size = 64 * 1024, const int64_t macro_block_cnt = 100); virtual ~ObSSTableTest(); @@ -51,7 +51,7 @@ class ObSSTableTest : public TestDataFilePrepare { const ObIArray& rowkeys, ObArray& ext_rowkeys, ObIAllocator& allocator); bool compare(const bool is_reverse_scan, const int64_t curr, const int64_t end); - protected: +protected: static const int64_t TEST_ROWKEY_COLUMN_CNT = 8; static const int64_t TEST_COLUMN_CNT = ObExtendType - 1; static const int64_t TEST_MULTI_GET_CNT = 2000; @@ -81,7 +81,7 @@ class ObSSTableTest : public TestDataFilePrepare { ObBlockCacheWorkingSet block_cache_ws_; ObITable::TableKey table_key_; - protected: +protected: enum CacheHitMode { HIT_ALL = 0, HIT_NONE, diff --git a/unittest/storage/ob_uncommitted_trans_test.h b/unittest/storage/ob_uncommitted_trans_test.h index 0199601ee..39bf1ad85 100644 --- a/unittest/storage/ob_uncommitted_trans_test.h +++ b/unittest/storage/ob_uncommitted_trans_test.h @@ -22,7 +22,7 @@ namespace oceanbase { namespace unittest { class TestUncommittedMinorMergeScan : public transaction::ObPartitionTransCtxMgr { - public: +public: struct TestTransStatus { TestTransStatus() : status_(transaction::ObTransTableStatusType::RUNNING), commit_trans_version_(INT64_MAX) {} @@ -37,7 +37,7 @@ class TestUncommittedMinorMergeScan : public transaction::ObPartitionTransCtxMgr const static int64_t ROLLBACK_SQL_SEQUENCE_2 = 48; const static int64_t ROLLBACK_SQL_SEQUENCE_3 = 58; - public: +public: TestUncommittedMinorMergeScan() : peek_flag_(false), input_idx_(0), default_trans_id_(ObAddr(999, 999)) { int ret = OB_SUCCESS; @@ -166,7 +166,7 @@ class TestUncommittedMinorMergeScan : public transaction::ObPartitionTransCtxMgr peek_flag_ = false; } - private: +private: static const int TRANS_ID_NUM = 10; typedef common::hash::ObHashMap TransStatusMap; bool peek_flag_; diff --git a/unittest/storage/replayengine/mock_partition_service.h b/unittest/storage/replayengine/mock_partition_service.h index 435eab7ca..aec241b19 100644 --- a/unittest/storage/replayengine/mock_partition_service.h +++ b/unittest/storage/replayengine/mock_partition_service.h @@ -30,7 +30,7 @@ class ObBaseStorage; } // namespace storage namespace unittest { class MockPartition : public storage::MockObIPartitionGroup { - public: +public: MockPartition() : tenant_id_(1001) { partition_key_.init(1, 1, 1); @@ -38,7 +38,7 @@ class MockPartition : public storage::MockObIPartitionGroup { virtual ~MockPartition() {} - public: +public: void reset() { replay_status_.reset(); @@ -308,20 +308,20 @@ class MockPartition : public storage::MockObIPartitionGroup { return common::OB_SUCCESS; } - private: +private: uint64_t tenant_id_; ObReplayStatus replay_status_; common::ObPartitionKey partition_key_; }; class MockPartitionService : public storage::MockObIPartitionService { - public: +public: MockPartitionService() {} virtual ~MockPartitionService() {} - public: +public: void reset() { mock_partition_.reset(); @@ -793,7 +793,7 @@ class MockPartitionService : public storage::MockObIPartitionService { return OB_SUCCESS; } - private: +private: MockPartition mock_partition_; }; diff --git a/unittest/storage/replayengine/test_log_replay_engine.cpp b/unittest/storage/replayengine/test_log_replay_engine.cpp index 989c4d6a1..b64adcbff 100644 --- a/unittest/storage/replayengine/test_log_replay_engine.cpp +++ b/unittest/storage/replayengine/test_log_replay_engine.cpp @@ -28,19 +28,19 @@ using namespace transaction; using namespace storage; namespace unittest { class ObLogReplayEngineTest : public testing::Test { - public: +public: void init(); void destroy(); char* get_log_buf(storage::ObStorageLogType log_type, int64_t trans_id, int64_t& buf_len); char* get_log_buf(storage::ObStorageLogType log_type, int64_t& buf_len); char* get_invalid_log_buf(storage::ObStorageLogType log_type, int64_t& buf_len); - protected: +protected: replayengine::ObLogReplayEngine* log_replay_engine_; common::ObPartitionKey partition_key_; common::ObPartitionKey ignored_partition_key_; - protected: +protected: char buffer[1024]; MockPartitionService mock_partition_service_; MockObTransService mock_trans_replay_service_; diff --git a/unittest/storage/test_all_micro_block_range_iterator.cpp b/unittest/storage/test_all_micro_block_range_iterator.cpp index 2f6c9a3a1..033f148f1 100644 --- a/unittest/storage/test_all_micro_block_range_iterator.cpp +++ b/unittest/storage/test_all_micro_block_range_iterator.cpp @@ -23,13 +23,13 @@ using namespace common; namespace unittest { class TestAllMicroBlockRangeIterator : public ObSSTableTest { - public: +public: TestAllMicroBlockRangeIterator(); virtual ~TestAllMicroBlockRangeIterator(); void SetUp(); void TearDown(); - protected: +protected: static const int64_t ROW_CNT = 10000; ObPartitionComponentFactory cp_fty_; }; diff --git a/unittest/storage/test_dag_warning_history.cpp b/unittest/storage/test_dag_warning_history.cpp index 994939567..724421b06 100644 --- a/unittest/storage/test_dag_warning_history.cpp +++ b/unittest/storage/test_dag_warning_history.cpp @@ -24,7 +24,7 @@ using namespace storage; namespace unittest { class TestDagWarningHistory : public ::testing::Test { - public: +public: TestDagWarningHistory() {} virtual ~TestDagWarningHistory() diff --git a/unittest/storage/test_fixed_size_block_allocator.cpp b/unittest/storage/test_fixed_size_block_allocator.cpp index 333c8112e..034c342ff 100644 --- a/unittest/storage/test_fixed_size_block_allocator.cpp +++ b/unittest/storage/test_fixed_size_block_allocator.cpp @@ -17,13 +17,13 @@ using namespace oceanbase::common; using namespace oceanbase::lib; class FixedSizeBlockAllocatorTest : public ::testing::Test { - public: +public: FixedSizeBlockAllocatorTest(); virtual ~FixedSizeBlockAllocatorTest(); virtual void SetUp(); virtual void TearDown(); - private: +private: // disallow copy FixedSizeBlockAllocatorTest(const FixedSizeBlockAllocatorTest& other); FixedSizeBlockAllocatorTest& operator=(const FixedSizeBlockAllocatorTest& other); diff --git a/unittest/storage/test_handle_cache.cpp b/unittest/storage/test_handle_cache.cpp index 118933813..52a8be6d3 100644 --- a/unittest/storage/test_handle_cache.cpp +++ b/unittest/storage/test_handle_cache.cpp @@ -24,7 +24,7 @@ namespace unittest { class TestHandleCache : public ::testing::Test {}; class TestKey { - public: +public: TestKey() {} TestKey(const int key) : key_(key) @@ -47,7 +47,7 @@ class TestKey { }; class TestHandle { - public: +public: void reset() {} int v_; diff --git a/unittest/storage/test_hash_performance.cpp b/unittest/storage/test_hash_performance.cpp index 50b3f56c0..87195fea5 100644 --- a/unittest/storage/test_hash_performance.cpp +++ b/unittest/storage/test_hash_performance.cpp @@ -25,7 +25,7 @@ namespace oceanbase { namespace unittest { class SortIndices { - public: +public: SortIndices(const common::ObIArray& block_ids) : block_ids_(block_ids) {} bool operator()(int64_t i, int64_t j) const @@ -33,12 +33,12 @@ class SortIndices { return block_ids_.at(i) < block_ids_.at(j); } - private: +private: const common::ObIArray& block_ids_; }; class TestHashMapPerformance : public ::testing::Test { - public: +public: TestHashMapPerformance(); virtual ~TestHashMapPerformance(); int prepare_hash_map(const int64_t count, const double load_factor); @@ -62,7 +62,7 @@ class TestHashMapPerformance : public ::testing::Test { int test_array_performance(const common::ObIArray& block_ids); int test_cuckoo_hash_performance(const common::ObIArray& block_ids); - private: +private: common::hash::ObHashMap hash_map_; common::ObArrayHashMap array_hash_map_; common::hash::ObCuckooHashMap cuckoo_hash_map_; diff --git a/unittest/storage/test_i_store.cpp b/unittest/storage/test_i_store.cpp index bc15fdf6f..33495eee6 100644 --- a/unittest/storage/test_i_store.cpp +++ b/unittest/storage/test_i_store.cpp @@ -22,12 +22,12 @@ using namespace share::schema; using namespace storage; using namespace common; class TestIStore : public ::testing::Test { - public: +public: TestIStore(); ~TestIStore(); virtual void SetUp(); - protected: +protected: static const int64_t TEST_ROWKEY_COLUMN_CNT = 8; static const int64_t TEST_COLUMN_CNT = ObExtendType - 1; void prepare_schema(); diff --git a/unittest/storage/test_interm_macro_mgr.cpp b/unittest/storage/test_interm_macro_mgr.cpp index 9120f9180..4389a4592 100644 --- a/unittest/storage/test_interm_macro_mgr.cpp +++ b/unittest/storage/test_interm_macro_mgr.cpp @@ -23,7 +23,7 @@ namespace oceanbase { namespace unittest { class ObIntermMacroMgrTest : public TestDataFilePrepare { - public: +public: ObIntermMacroMgrTest(); virtual ~ObIntermMacroMgrTest(); virtual void SetUp(); @@ -33,7 +33,7 @@ class ObIntermMacroMgrTest : public TestDataFilePrepare { return storage_file_; } - private: +private: ObStorageFile* storage_file_; ObStorageFileWithRef file_with_ref_; }; diff --git a/unittest/storage/test_micro_block_row_scanner.cpp b/unittest/storage/test_micro_block_row_scanner.cpp index 974a888d7..c14a2e9fb 100644 --- a/unittest/storage/test_micro_block_row_scanner.cpp +++ b/unittest/storage/test_micro_block_row_scanner.cpp @@ -24,7 +24,7 @@ using namespace share::schema; namespace unittest { class TestMicroBlockRowScanner : public ObMultiVersionSSTableTest { - public: +public: TestMicroBlockRowScanner() : ObMultiVersionSSTableTest("testmicroblockrowscanner") {} virtual ~TestMicroBlockRowScanner() diff --git a/unittest/storage/test_micro_block_row_scanner_with_special_uncom_row.cpp b/unittest/storage/test_micro_block_row_scanner_with_special_uncom_row.cpp index 058ffc0e7..30237c6a3 100644 --- a/unittest/storage/test_micro_block_row_scanner_with_special_uncom_row.cpp +++ b/unittest/storage/test_micro_block_row_scanner_with_special_uncom_row.cpp @@ -24,7 +24,7 @@ using namespace share::schema; namespace unittest { class TestMicroBlockRowScanner : public ObMultiVersionSSTableTest { - public: +public: TestMicroBlockRowScanner() : ObMultiVersionSSTableTest("testmicroblockrowscanner_with_special_uncom_row") {} virtual ~TestMicroBlockRowScanner() diff --git a/unittest/storage/test_micro_block_row_scanner_with_uncom_row.cpp b/unittest/storage/test_micro_block_row_scanner_with_uncom_row.cpp index afb4767e7..106bb8212 100644 --- a/unittest/storage/test_micro_block_row_scanner_with_uncom_row.cpp +++ b/unittest/storage/test_micro_block_row_scanner_with_uncom_row.cpp @@ -24,7 +24,7 @@ using namespace share::schema; namespace unittest { class TestMicroBlockRowScanner : public ObMultiVersionSSTableTest { - public: +public: TestMicroBlockRowScanner() : ObMultiVersionSSTableTest("testmicroblockrowscanner_with_uncom_row") {} virtual ~TestMicroBlockRowScanner() diff --git a/unittest/storage/test_migrate_logical_row_writer.cpp b/unittest/storage/test_migrate_logical_row_writer.cpp index 548d2a022..ba777295b 100644 --- a/unittest/storage/test_migrate_logical_row_writer.cpp +++ b/unittest/storage/test_migrate_logical_row_writer.cpp @@ -34,13 +34,13 @@ using namespace share::schema; namespace unittest { class TestMigrateLogicalRowWriter : public TestDataFilePrepare { - public: +public: TestMigrateLogicalRowWriter(); virtual ~TestMigrateLogicalRowWriter(); virtual void SetUp(); virtual void TearDown(); - protected: +protected: void prepare_schema(); static const int64_t TEST_COLUMN_CNT = ObExtendType - 1; static const int64_t TEST_ROWKEY_COLUMN_CNT = 2; diff --git a/unittest/storage/test_migrate_rpc.cpp b/unittest/storage/test_migrate_rpc.cpp index 158b6d93c..e665a15f2 100644 --- a/unittest/storage/test_migrate_rpc.cpp +++ b/unittest/storage/test_migrate_rpc.cpp @@ -28,7 +28,7 @@ using namespace memtable; namespace obrpc { class TestMigrateRpc : public ::testing::Test { - public: +public: static void SetUpTestCase(); void SetUp() {} @@ -55,13 +55,13 @@ void TestMigrateRpc::SetUpTestCase() } class ObMockFetchPartitionInfoP : public ObFetchPartitionInfoP { - public: +public: ObMockFetchPartitionInfoP() : ObFetchPartitionInfoP(NULL) {} ~ObMockFetchPartitionInfoP() {} - protected: +protected: int process() { result_.meta_.pkey_ = arg_.pkey_; @@ -71,7 +71,7 @@ class ObMockFetchPartitionInfoP : public ObFetchPartitionInfoP { }; class ObMockFetchLogicRowP : public ObFetchLogicRowP { - public: +public: ObMockFetchLogicRowP() : ObFetchLogicRowP(NULL, NULL) {} ~ObMockFetchLogicRowP() @@ -79,7 +79,7 @@ class ObMockFetchLogicRowP : public ObFetchLogicRowP { ObMockIterator iter_; - protected: +protected: int process() { int ret = OB_SUCCESS; diff --git a/unittest/storage/test_multi_version_sparse_sstable_multi_get.cpp b/unittest/storage/test_multi_version_sparse_sstable_multi_get.cpp index 63278eb83..5aabe060d 100644 --- a/unittest/storage/test_multi_version_sparse_sstable_multi_get.cpp +++ b/unittest/storage/test_multi_version_sparse_sstable_multi_get.cpp @@ -22,7 +22,7 @@ using namespace share::schema; namespace unittest { class TestMultiVersionSparseSSTableMultiGet : public ObMultiVersionSSTableTest { - public: +public: TestMultiVersionSparseSSTableMultiGet() : ObMultiVersionSSTableTest("testmultiversionsparsemultiget") {} virtual ~TestMultiVersionSparseSSTableMultiGet() diff --git a/unittest/storage/test_multi_version_sparse_sstable_multi_scan.cpp b/unittest/storage/test_multi_version_sparse_sstable_multi_scan.cpp index d81c26c27..6ba37853e 100644 --- a/unittest/storage/test_multi_version_sparse_sstable_multi_scan.cpp +++ b/unittest/storage/test_multi_version_sparse_sstable_multi_scan.cpp @@ -24,7 +24,7 @@ using namespace share::schema; namespace unittest { class TestMultiVersionSparseSSTableMultiScan : public ObMultiVersionSSTableTest { - public: +public: TestMultiVersionSparseSSTableMultiScan() : ObMultiVersionSSTableTest("testmultiversionsparsemultiscan") {} virtual ~TestMultiVersionSparseSSTableMultiScan() diff --git a/unittest/storage/test_multi_version_sparse_sstable_single_get.cpp b/unittest/storage/test_multi_version_sparse_sstable_single_get.cpp index 410e35e79..29d45d323 100644 --- a/unittest/storage/test_multi_version_sparse_sstable_single_get.cpp +++ b/unittest/storage/test_multi_version_sparse_sstable_single_get.cpp @@ -24,7 +24,7 @@ using namespace share::schema; namespace unittest { class TestMultiVersionSparseSSTableSingleGet : public ObMultiVersionSSTableTest { - public: +public: TestMultiVersionSparseSSTableSingleGet() : ObMultiVersionSSTableTest("testmultiversionsparsesingeget") {} virtual ~TestMultiVersionSparseSSTableSingleGet() diff --git a/unittest/storage/test_multi_version_sparse_sstable_single_scan.cpp b/unittest/storage/test_multi_version_sparse_sstable_single_scan.cpp index 6b5761212..44829cb90 100644 --- a/unittest/storage/test_multi_version_sparse_sstable_single_scan.cpp +++ b/unittest/storage/test_multi_version_sparse_sstable_single_scan.cpp @@ -24,7 +24,7 @@ using namespace share::schema; namespace unittest { class TestMultiVersionSparseSSTableSingleScan : public ObMultiVersionSSTableTest { - public: +public: TestMultiVersionSparseSSTableSingleScan() : ObMultiVersionSSTableTest("testmultiversionsparsesingescan") {} virtual ~TestMultiVersionSparseSSTableSingleScan() diff --git a/unittest/storage/test_multi_version_sstable_multi_get.cpp b/unittest/storage/test_multi_version_sstable_multi_get.cpp index 92f6111dc..022cd8fce 100644 --- a/unittest/storage/test_multi_version_sstable_multi_get.cpp +++ b/unittest/storage/test_multi_version_sstable_multi_get.cpp @@ -22,7 +22,7 @@ using namespace share::schema; namespace unittest { class TestMultiVersionSSTableMultiGet : public ObMultiVersionSSTableTest { - public: +public: TestMultiVersionSSTableMultiGet() : ObMultiVersionSSTableTest("testmultiversionmultiget") {} virtual ~TestMultiVersionSSTableMultiGet() diff --git a/unittest/storage/test_multi_version_sstable_multi_scan.cpp b/unittest/storage/test_multi_version_sstable_multi_scan.cpp index c8b6d8394..15b521186 100644 --- a/unittest/storage/test_multi_version_sstable_multi_scan.cpp +++ b/unittest/storage/test_multi_version_sstable_multi_scan.cpp @@ -23,7 +23,7 @@ using namespace share::schema; namespace unittest { class TestMultiVersionSSTableMultiScan : public ObMultiVersionSSTableTest { - public: +public: TestMultiVersionSSTableMultiScan() : ObMultiVersionSSTableTest("testmultiversionmultiscan") {} virtual ~TestMultiVersionSSTableMultiScan() diff --git a/unittest/storage/test_multi_version_sstable_single_get.cpp b/unittest/storage/test_multi_version_sstable_single_get.cpp index 121d79938..c7c3fabe1 100644 --- a/unittest/storage/test_multi_version_sstable_single_get.cpp +++ b/unittest/storage/test_multi_version_sstable_single_get.cpp @@ -24,7 +24,7 @@ using namespace share::schema; namespace unittest { class TestMultiVersionSSTableSingleGet : public ObMultiVersionSSTableTest { - public: +public: TestMultiVersionSSTableSingleGet() : ObMultiVersionSSTableTest("testmultiversionsingeget") {} virtual ~TestMultiVersionSSTableSingleGet() diff --git a/unittest/storage/test_multi_version_sstable_single_scan.cpp b/unittest/storage/test_multi_version_sstable_single_scan.cpp index 4ae6bafc1..8e2e46fb6 100644 --- a/unittest/storage/test_multi_version_sstable_single_scan.cpp +++ b/unittest/storage/test_multi_version_sstable_single_scan.cpp @@ -22,7 +22,7 @@ using namespace share::schema; namespace unittest { class TestMultiVersionSSTableSingleScan : public ObMultiVersionSSTableTest { - public: +public: TestMultiVersionSSTableSingleScan() : ObMultiVersionSSTableTest("testmultiversionsingescan") {} virtual ~TestMultiVersionSSTableSingleScan() diff --git a/unittest/storage/test_multi_version_table_store.cpp b/unittest/storage/test_multi_version_table_store.cpp index 13f54550d..0d5301e4e 100644 --- a/unittest/storage/test_multi_version_table_store.cpp +++ b/unittest/storage/test_multi_version_table_store.cpp @@ -27,7 +27,7 @@ using namespace memtable; namespace unittest { class TestMultiVersionTableStore : public ::testing::Test { - public: +public: void fake_sstable(const int64_t base_version, const int64_t snapshot_version, ObSSTable& table); }; diff --git a/unittest/storage/test_multiple_merge.cpp b/unittest/storage/test_multiple_merge.cpp index 3cf9708bc..c3fd3af8f 100644 --- a/unittest/storage/test_multiple_merge.cpp +++ b/unittest/storage/test_multiple_merge.cpp @@ -24,7 +24,7 @@ using namespace ::testing; namespace unittest { class ObMultipleMergeTest : public ::testing::Test { - public: +public: ObMultipleMergeTest() = default; virtual ~ObMultipleMergeTest() = default; bool check_table_continues(const common::ObIArray& tables); diff --git a/unittest/storage/test_new_minor_fuser.cpp b/unittest/storage/test_new_minor_fuser.cpp index 213e3d96b..314067bc2 100644 --- a/unittest/storage/test_new_minor_fuser.cpp +++ b/unittest/storage/test_new_minor_fuser.cpp @@ -58,7 +58,7 @@ namespace storage { typedef compaction::ObIPartitionMergeFuser::MERGE_ITER_ARRAY MERGE_ITER_ARRAY; class TestNewMinorFuserMerge : public ObMultiVersionSSTableTest { - public: +public: static const int64_t MAX_PARALLEL_DEGREE = 10; TestNewMinorFuserMerge() : ObMultiVersionSSTableTest("test_new_minor_fuser") {} diff --git a/unittest/storage/test_ob_freeze_info_snapshot_mgr.cpp b/unittest/storage/test_ob_freeze_info_snapshot_mgr.cpp index f0b7718ac..e9071cb45 100644 --- a/unittest/storage/test_ob_freeze_info_snapshot_mgr.cpp +++ b/unittest/storage/test_ob_freeze_info_snapshot_mgr.cpp @@ -28,7 +28,7 @@ using namespace common; namespace unittest { const int TEST_ALL_TENANT_NUM = 10; class MockSchemaCache : public ObFreezeInfoSnapshotMgr::SchemaCache { - public: +public: MockSchemaCache() : SchemaCache(schema_query_set_), schema_query_set_(*this) {} virtual int fetch_freeze_schema(const uint64_t, const int64_t, int64_t& schema_version) override @@ -63,12 +63,12 @@ class MockSchemaCache : public ObFreezeInfoSnapshotMgr::SchemaCache { return ret; } - private: +private: ObFreezeInfoSnapshotMgr::SchemaQuerySet schema_query_set_; }; class TestFreezeInfoSnapshotMgr : public ::testing::Test { - public: +public: ObFreezeInfoSnapshotMgr mgr; const int TEST_TENANT_NUM = 10; const int TEST_NUM = 10; diff --git a/unittest/storage/test_parallel_external_sort.cpp b/unittest/storage/test_parallel_external_sort.cpp index 2723decc8..799577ce6 100644 --- a/unittest/storage/test_parallel_external_sort.cpp +++ b/unittest/storage/test_parallel_external_sort.cpp @@ -35,7 +35,7 @@ class TestItem; class TestItemCompare; class TestItem { - public: +public: TestItem(); virtual ~TestItem(); void set(const int64_t key, const char* buf, const int32_t length); @@ -61,13 +61,13 @@ class TestItem { TO_STRING_KV(K(key_), K(value_)); NEED_SERIALIZE_AND_DESERIALIZE; - private: +private: int64_t key_; ObString value_; }; class TestItemCompare { - public: +public: TestItemCompare(int& sort_ret) : result_code_(sort_ret) {} bool operator()(const TestItem* left, const TestItem* right) @@ -151,7 +151,7 @@ DEFINE_GET_SERIALIZE_SIZE(TestItem) } class TestParallelExternalSort : public blocksstable::TestDataFilePrepare { - public: +public: TestParallelExternalSort(); virtual ~TestParallelExternalSort() {} @@ -175,11 +175,11 @@ class TestParallelExternalSort : public blocksstable::TestDataFilePrepare { virtual void SetUp(); virtual void TearDown(); - public: +public: static const int64_t MACRO_BLOCK_SIZE = 2 * 1024 * 1024; static const int64_t MACRO_BLOCK_COUNT = 15 * 1024; - private: +private: common::ObArenaAllocator allocator_; }; diff --git a/unittest/storage/test_partition_merge_multi_version.cpp b/unittest/storage/test_partition_merge_multi_version.cpp index 0af8187e4..4d3175ecc 100644 --- a/unittest/storage/test_partition_merge_multi_version.cpp +++ b/unittest/storage/test_partition_merge_multi_version.cpp @@ -58,7 +58,7 @@ namespace storage { typedef compaction::ObIPartitionMergeFuser::MERGE_ITER_ARRAY MERGE_ITER_ARRAY; class TestMultiVersionMerge : public ObMultiVersionSSTableTest { - public: +public: static const int64_t MAX_PARALLEL_DEGREE = 10; TestMultiVersionMerge() : ObMultiVersionSSTableTest("test_multi_version_merge") {} diff --git a/unittest/storage/test_partition_migrator.cpp b/unittest/storage/test_partition_migrator.cpp index a947670ee..8e9c26a47 100644 --- a/unittest/storage/test_partition_migrator.cpp +++ b/unittest/storage/test_partition_migrator.cpp @@ -36,7 +36,7 @@ using namespace lib; namespace unittest { class ObPartitionMigratorTest : public ::testing::Test { - public: +public: void init() { ASSERT_EQ(OB_SUCCESS, a_.parse_from_cstring("10.10.10.1:1001")); @@ -81,7 +81,7 @@ class ObPartitionMigratorTest : public ::testing::Test { return ret; } - protected: +protected: ObAddr a_; ObAddr b_; ObAddr c_; diff --git a/unittest/storage/test_partition_migrator_table_key_mgr.cpp b/unittest/storage/test_partition_migrator_table_key_mgr.cpp index da7720d66..82eab704a 100644 --- a/unittest/storage/test_partition_migrator_table_key_mgr.cpp +++ b/unittest/storage/test_partition_migrator_table_key_mgr.cpp @@ -24,7 +24,7 @@ using namespace common; using namespace storage; namespace unittest { class TestPartitionMigrateTableKeyMgr : public ::testing::Test { - public: +public: TestPartitionMigrateTableKeyMgr() {} ~TestPartitionMigrateTableKeyMgr() diff --git a/unittest/storage/test_partition_range_spliter.cpp b/unittest/storage/test_partition_range_spliter.cpp index 2de24cb54..c0be3adf8 100644 --- a/unittest/storage/test_partition_range_spliter.cpp +++ b/unittest/storage/test_partition_range_spliter.cpp @@ -59,7 +59,7 @@ using namespace memtable; namespace storage { class TestRangeSpliter : public ObMultiVersionSSTableTest { - public: +public: static const int64_t MAX_PARALLEL_DEGREE = 10; static const int64_t MAX_MACRO_CNT = 20; static const int64_t RANGE_MAX = 0; diff --git a/unittest/storage/test_pg_macro_meta_checkpoint.cpp b/unittest/storage/test_pg_macro_meta_checkpoint.cpp index 2ad211be2..feeba4768 100644 --- a/unittest/storage/test_pg_macro_meta_checkpoint.cpp +++ b/unittest/storage/test_pg_macro_meta_checkpoint.cpp @@ -32,7 +32,7 @@ using namespace share::schema; namespace unittest { class TestPGMacroMetaCheckpoint : public ObSSTableTest { - public: +public: TestPGMacroMetaCheckpoint(); virtual ~TestPGMacroMetaCheckpoint() = default; @@ -41,10 +41,10 @@ class TestPGMacroMetaCheckpoint : public ObSSTableTest { void test_pg_macro_meta_checkpoint(const int64_t sstable_cnt, const int64_t row_cnt); - protected: +protected: int check_macro_meta(ObPGMacroMetaCheckpointReader& reader, const common::ObIArray& block_ids); - protected: +protected: static const int64_t MACRO_BLOCK_SIZE = 128 * 1024; static const int64_t MACRO_BLOCK_CNT = 500; common::ObPGKey pg_key_; diff --git a/unittest/storage/test_pg_meta_checkpoint.cpp b/unittest/storage/test_pg_meta_checkpoint.cpp index d0c464c80..25e104556 100644 --- a/unittest/storage/test_pg_meta_checkpoint.cpp +++ b/unittest/storage/test_pg_meta_checkpoint.cpp @@ -32,16 +32,16 @@ using namespace share::schema; namespace unittest { class TestCheckpoint : public TestDataFilePrepare { - public: +public: TestCheckpoint(); virtual ~TestCheckpoint() = default; virtual void SetUp(); virtual void TearDown(); - protected: +protected: void test_pg_meta_checkpoint(const int64_t meta_size); - protected: +protected: static const int64_t MACRO_BLOCK_SIZE = 128 * 1024; common::ObPGKey pg_key_; }; diff --git a/unittest/storage/test_range_iterator.cpp b/unittest/storage/test_range_iterator.cpp index 6ed062b0a..34a120120 100644 --- a/unittest/storage/test_range_iterator.cpp +++ b/unittest/storage/test_range_iterator.cpp @@ -23,7 +23,7 @@ using namespace storage; namespace unittest { class FakeTableScanParam : public ObTableScanParam { - public: +public: FakeTableScanParam(ObOrderType order = ObOrderType::ASC) { fake_column_orders_.push_back(order); @@ -36,7 +36,7 @@ class FakeTableScanParam : public ObTableScanParam { return true; } - private: +private: common::ObArray fake_column_orders_; }; diff --git a/unittest/storage/test_reserved_data_mgr.cpp b/unittest/storage/test_reserved_data_mgr.cpp index 9186e781d..e4ab18f4b 100644 --- a/unittest/storage/test_reserved_data_mgr.cpp +++ b/unittest/storage/test_reserved_data_mgr.cpp @@ -22,13 +22,13 @@ using namespace oceanbase::lib; namespace oceanbase { namespace unittest { class TestRecoveryDataMgr : public TestDataFilePrepare { - public: +public: TestRecoveryDataMgr(); virtual ~TestRecoveryDataMgr() = default; virtual void SetUp() override; virtual void TearDown() override; - private: +private: int prepare_pg_meta(const int64_t replay_log_ts, const int64_t publish_version, ObPartitionGroupMeta& meta); int prepare_pgpartition_store_meta(ObPGPartitionStoreMeta& partition_store_meta); int generate_table_key(const ObITable::TableType& type, common::ObVersionRange& trans_version_range, @@ -39,7 +39,7 @@ class TestRecoveryDataMgr : public TestDataFilePrepare { const int64_t major_version, const uint64_t table_id, const int64_t schema_version, ObTableHandle& handle, const ObLogTsRange& log_ts_range); - private: +private: ObPartitionKey pg_key_; common::ObArenaAllocator allocator_; }; diff --git a/unittest/storage/test_row_sample_iterator.cpp b/unittest/storage/test_row_sample_iterator.cpp index 52dbdc1e2..32d156e5b 100644 --- a/unittest/storage/test_row_sample_iterator.cpp +++ b/unittest/storage/test_row_sample_iterator.cpp @@ -20,7 +20,7 @@ using namespace common; using namespace storage; namespace unittest { class TestObRowSampleIterator : public ::testing::Test { - public: +public: void check_result(const char* input, const char* output, const SampleInfo& sample_info); void check_iters(ObQueryRowIterator& iter1, ObQueryRowIterator& iter2); }; diff --git a/unittest/storage/test_sstable.cpp b/unittest/storage/test_sstable.cpp index de4e62b26..2112237f8 100644 --- a/unittest/storage/test_sstable.cpp +++ b/unittest/storage/test_sstable.cpp @@ -21,7 +21,7 @@ using namespace share::schema; namespace unittest { class TestSSTable : public ObSSTableTest { - public: +public: TestSSTable(); virtual ~TestSSTable(); }; diff --git a/unittest/storage/test_sstable_multi_exist.cpp b/unittest/storage/test_sstable_multi_exist.cpp index 09d8cbe09..a764ed4ee 100644 --- a/unittest/storage/test_sstable_multi_exist.cpp +++ b/unittest/storage/test_sstable_multi_exist.cpp @@ -23,7 +23,7 @@ using namespace share::schema; namespace unittest { class TestSSTableMultiExist : public ObSSTableTest { - public: +public: TestSSTableMultiExist(); virtual ~TestSSTableMultiExist(); virtual void SetUp(); diff --git a/unittest/storage/test_sstable_multi_get.cpp b/unittest/storage/test_sstable_multi_get.cpp index 49054253f..5b5f50a80 100644 --- a/unittest/storage/test_sstable_multi_get.cpp +++ b/unittest/storage/test_sstable_multi_get.cpp @@ -23,7 +23,7 @@ using namespace share::schema; namespace unittest { class TestSSTableMultiGet : public ObSSTableTest { - public: +public: TestSSTableMultiGet(); void test_normal(const bool is_reverse_scan, const int64_t limit); void test_border(const bool is_reverse_scan, const int64_t limit); diff --git a/unittest/storage/test_sstable_multi_scan.cpp b/unittest/storage/test_sstable_multi_scan.cpp index 0b4f720a2..b6c51ff42 100644 --- a/unittest/storage/test_sstable_multi_scan.cpp +++ b/unittest/storage/test_sstable_multi_scan.cpp @@ -22,7 +22,7 @@ using namespace share::schema; namespace unittest { class TestSSTableMultiScanner : public ObSSTableTest { - public: +public: TestSSTableMultiScanner(); virtual ~TestSSTableMultiScanner(); void test_one_case(const ObIArray& start_seeds, const int64_t count_perf_range, const int64_t hit_mode, diff --git a/unittest/storage/test_sstable_single_exist.cpp b/unittest/storage/test_sstable_single_exist.cpp index 6a2047eb4..72fdc092e 100644 --- a/unittest/storage/test_sstable_single_exist.cpp +++ b/unittest/storage/test_sstable_single_exist.cpp @@ -23,7 +23,7 @@ using namespace share::schema; namespace unittest { class TestSSTableSingleExist : public ObSSTableTest { - public: +public: TestSSTableSingleExist(); virtual ~TestSSTableSingleExist(); virtual void SetUp(); diff --git a/unittest/storage/test_sstable_single_get.cpp b/unittest/storage/test_sstable_single_get.cpp index a58253b10..0b03df17f 100644 --- a/unittest/storage/test_sstable_single_get.cpp +++ b/unittest/storage/test_sstable_single_get.cpp @@ -21,7 +21,7 @@ using namespace share::schema; namespace unittest { class TestSSTableSingleGet : public ObSSTableTest { - public: +public: TestSSTableSingleGet(); virtual ~TestSSTableSingleGet(); void test_one_rowkey(const int64_t seed); diff --git a/unittest/storage/test_sstable_single_scan.cpp b/unittest/storage/test_sstable_single_scan.cpp index 8b93514c7..ae9b8f53e 100644 --- a/unittest/storage/test_sstable_single_scan.cpp +++ b/unittest/storage/test_sstable_single_scan.cpp @@ -21,7 +21,7 @@ using namespace share::schema; namespace unittest { class TestSSTableSingleScanner : public ObSSTableTest { - public: +public: TestSSTableSingleScanner(); void test_border(const bool is_reverse_scan, const int64_t limit); void test_normal(const bool is_reverse_scan, const int64_t limit); @@ -33,7 +33,7 @@ class TestSSTableSingleScanner : public ObSSTableTest { void test_skip_range(const bool is_reverse_scan, const common::ObIArray& skip_infos); virtual ~TestSSTableSingleScanner(); - private: +private: ObStoreRow start_row_; ObStoreRow end_row_; ObObj start_cells_[TEST_COLUMN_CNT]; diff --git a/unittest/storage/test_storage_struct.cpp b/unittest/storage/test_storage_struct.cpp index b86d2c626..b8480c0af 100644 --- a/unittest/storage/test_storage_struct.cpp +++ b/unittest/storage/test_storage_struct.cpp @@ -21,7 +21,7 @@ using namespace common; using namespace storage; class TestStorageStruct : public ::testing::Test { - public: +public: TestStorageStruct(); virtual ~TestStorageStruct(); }; diff --git a/unittest/storage/test_tenant_file_mgr.cpp b/unittest/storage/test_tenant_file_mgr.cpp index 4dda8a098..e98e62841 100644 --- a/unittest/storage/test_tenant_file_mgr.cpp +++ b/unittest/storage/test_tenant_file_mgr.cpp @@ -29,16 +29,16 @@ using namespace share::schema; namespace unittest { class TestTenantFileMgr : public TestDataFilePrepare { - public: +public: TestTenantFileMgr(); virtual ~TestTenantFileMgr() = default; virtual void SetUp(); virtual void TearDown(); - protected: +protected: void test_pg_meta_checkpoint(const int64_t meta_size); - protected: +protected: static const int64_t MACRO_BLOCK_SIZE = 128 * 1024; common::ObPGKey pg_key_; }; diff --git a/unittest/storage/transaction/performance.cpp b/unittest/storage/transaction/performance.cpp index 0cb35d419..f6b572ab3 100644 --- a/unittest/storage/transaction/performance.cpp +++ b/unittest/storage/transaction/performance.cpp @@ -51,7 +51,7 @@ LeaderActiveArg leader_active_arg; // (1) Packaage sent does not go through the network communication. // (2) OB_SUCCESS is returned for the function post_trans_msg. class MockObTransRpc : public ObITransRpc, common::ObSimpleThreadPool { - public: +public: MockObTransRpc() : trans_service_(NULL) {} virtual ~MockObTransRpc() @@ -182,12 +182,12 @@ class MockObTransRpc : public ObITransRpc, common::ObSimpleThreadPool { return ret; } - private: +private: ObTransService* trans_service_; }; class MockObLocationAdapter : public ObILocationAdapter { - public: +public: MockObLocationAdapter() {} ~MockObLocationAdapter() @@ -230,7 +230,7 @@ class MockObLocationAdapter : public ObILocationAdapter { self_ = self; } - private: +private: ObAddr self_; }; @@ -244,7 +244,7 @@ struct MySubmitLogTask { }; class MockObClogAdapter : public ObIClogAdapter, public ObSimpleThreadPool { - public: +public: MockObClogAdapter() {} ~MockObClogAdapter() @@ -525,7 +525,7 @@ class MockObClogAdapter : public ObIClogAdapter, public ObSimpleThreadPool { }; class MyMockObPartitionLogService : public MockPartitionLogService { - public: +public: int submit_log(const char* buff, const int64_t size, const storage::ObStorageLogType log_type, const common::ObVersion& version, ObITransSubmitLogCb* cb) { @@ -545,7 +545,7 @@ class MyMockObPartitionLogService : public MockPartitionLogService { }; class MyMockObPartitionComponentFactory : public MockObIPartitionComponentFactory { - public: +public: virtual void free(ObIPartitionGroup* partition) { UNUSED(partition); @@ -554,7 +554,7 @@ class MyMockObPartitionComponentFactory : public MockObIPartitionComponentFactor }; class MyMockObPartition : public MockObIPartitionGroup { - public: +public: MyMockObPartition() : partition_log_service_(NULL), pg_file_(NULL), pkey_(nullptr) {} virtual ~MyMockObPartition() @@ -594,7 +594,7 @@ class MyMockObPartition : public MockObIPartitionGroup { return *pkey_; } - private: +private: ObIPartitionLogService* partition_log_service_; blocksstable::ObStorageFile* pg_file_; blocksstable::ObStorageFileHandle file_handle_; @@ -602,7 +602,7 @@ class MyMockObPartition : public MockObIPartitionGroup { }; class MyMockObPartitionService : public MockObIPartitionService { - public: +public: MyMockObPartitionService() : partition_(NULL) { partition_ = new MyMockObPartition(); @@ -680,7 +680,7 @@ class MyMockObPartitionService : public MockObIPartitionService { return OB_SUCCESS; } - private: +private: MyMockObPartition* partition_; }; @@ -690,7 +690,7 @@ static const int32_t PORT = 8080; static const ObAddr::VER IP_TYPE = ObAddr::IPV4; class TestPerformance : public ::testing::Test { - public: +public: TestPerformance() : self_(IP_TYPE, LOCAL_IP, PORT), sp_trans_(false), access_mod_(ObTransAccessMode::UNKNOWN) {} virtual ~TestPerformance() @@ -706,7 +706,7 @@ class TestPerformance : public ::testing::Test { int init(); void destroy(); - public: +public: int smoke(); int get_random_partition(ObPartitionLeaderArray& array); void set_sp_trans(const bool sp_trans) @@ -718,17 +718,17 @@ class TestPerformance : public ::testing::Test { access_mod_ = access_mod; } - private: +private: int do_trans(); - private: +private: static const uint64_t TENANT_ID = 1234; static const int32_t PARTITION_COUNT_PER_TABLE = 5; static const int32_t MAX_TABLE = 10; static const int32_t TABLE_NUMBER_START = 20000; int generate_participant_arr_guard_(const ObPartitionArray& participants, ObIPartitionArrayGuard& pkey_guard_arr); - private: +private: ObAddr self_; MockObTransRpc rpc_; share::schema::ObMultiVersionSchemaService* schema_service_; diff --git a/unittest/storage/transaction/test_ob_clog_adapter.cpp b/unittest/storage/transaction/test_ob_clog_adapter.cpp index cc7e310b3..dd867370f 100644 --- a/unittest/storage/transaction/test_ob_clog_adapter.cpp +++ b/unittest/storage/transaction/test_ob_clog_adapter.cpp @@ -38,7 +38,7 @@ const int SUBMIT_EAGAIN_COUNT = 6; namespace clog { // add by dongjian class MockSubmitLogCb : public ObITransSubmitLogCb { - public: +public: MockSubmitLogCb() {} ~MockSubmitLogCb() @@ -86,13 +86,13 @@ class MockSubmitLogCb : public ObITransSubmitLogCb { namespace unittest { class TestObClogAdapter : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: // valid partition parameters static const int64_t VALID_TABLE_ID = 1; static const int32_t VALID_PARTITION_ID = 1; @@ -104,7 +104,7 @@ class TestObClogAdapter : public ::testing::Test { }; class MyMockObPartitionLogService : public MockPartitionLogService { - public: +public: int submit_log(const char* buff, const int64_t size, const storage::ObStorageLogType log_type, const common::ObVersion& version, ObITransSubmitLogCb* cb) { @@ -128,7 +128,7 @@ using clog::MockSubmitLogCb; class MyMockObPartitionLogService2 : public MockPartitionLogService, public ObSimpleThreadPool { // inner class class LogServiceSubmitTask { - public: + public: LogServiceSubmitTask() : cb_(NULL) {} ~LogServiceSubmitTask() @@ -142,11 +142,11 @@ class MyMockObPartitionLogService2 : public MockPartitionLogService, public ObSi return cb_; } - private: + private: ObITransSubmitLogCb* cb_; }; - public: +public: MyMockObPartitionLogService2() { ObAddr self; // we don't care about this field. @@ -198,7 +198,7 @@ class MyMockObPartitionLogService2 : public MockPartitionLogService, public ObSi }; class MyMockObPartitionComponentFactory : public MockObIPartitionComponentFactory { - public: +public: virtual void free(ObIPartitionGroup* partition) { UNUSED(partition); @@ -207,7 +207,7 @@ class MyMockObPartitionComponentFactory : public MockObIPartitionComponentFactor }; class MyMockObPartition : public MockObIPartitionGroup { - public: +public: MyMockObPartition() : partition_log_service_(NULL), pg_file_(NULL) {} virtual ~MyMockObPartition() @@ -243,14 +243,14 @@ class MyMockObPartition : public MockObIPartitionGroup { return OB_SUCCESS; } - private: +private: ObIPartitionLogService* partition_log_service_; blocksstable::ObStorageFile* pg_file_; blocksstable::ObStorageFileHandle file_handle_; }; class MyMockObPartitionService : public MockObIPartitionService { - public: +public: MyMockObPartitionService() : partition_(NULL) { partition_ = new MyMockObPartition(); @@ -318,13 +318,13 @@ class MyMockObPartitionService : public MockObIPartitionService { return OB_SUCCESS; } - private: +private: MyMockObPartition* partition_; }; // add by dongjian class MyMockObPartitionService2 : public MockObIPartitionService { - public: +public: MyMockObPartitionService2() { partition_ = new MyMockObPartition(); @@ -380,7 +380,7 @@ class MyMockObPartitionService2 : public MockObIPartitionService { return OB_SUCCESS; } - private: +private: MyMockObPartition* partition_; }; diff --git a/unittest/storage/transaction/test_ob_gc_partition_adapter.cpp b/unittest/storage/transaction/test_ob_gc_partition_adapter.cpp index d82992af4..13ace67f7 100644 --- a/unittest/storage/transaction/test_ob_gc_partition_adapter.cpp +++ b/unittest/storage/transaction/test_ob_gc_partition_adapter.cpp @@ -30,13 +30,13 @@ using namespace transaction; namespace unittest { class MyConnectionPool : public ObISQLConnectionPool { - public: +public: MyConnectionPool() {} ~MyConnectionPool() {} - public: +public: // sql string escape int escape(const char* from, const int64_t from_size, char* to, const int64_t to_size, int64_t& out_size) { @@ -63,7 +63,7 @@ class MyConnectionPool : public ObISQLConnectionPool { }; class MyPartitionInfo { - public: +public: MyPartitionInfo() : tenant_id_(0), table_id_(0), partition_id_(0) {} MyPartitionInfo(const int64_t tenant_id, const int64_t table_id, const int64_t partition_id) @@ -88,20 +88,20 @@ class MyPartitionInfo { } TO_STRING_KV(K_(tenant_id), K_(table_id), K_(partition_id)); - private: +private: int64_t tenant_id_; int64_t table_id_; int64_t partition_id_; }; class MyResult : public ObMySQLResult { - public: +public: MyResult() : index_(-1) {} ~MyResult() {} - public: +public: void reset() { array_.reset(); @@ -117,7 +117,7 @@ class MyResult : public ObMySQLResult { } TO_STRING_KV(K_(array), K_(index)); - public: +public: int close() { return OB_SUCCESS; @@ -383,7 +383,7 @@ class MyResult : public ObMySQLResult { return OB_NOT_SUPPORTED; } - private: +private: int inner_get_number(const int64_t col_idx, common::number::ObNumber& nmb_val, IAllocator& allocator) const { UNUSEDx(col_idx, nmb_val, allocator); @@ -414,42 +414,42 @@ class MyResult : public ObMySQLResult { return OB_NOT_SUPPORTED; } - private: +private: ObSEArray array_; int64_t index_; }; class MyResultHandler : public ObISQLResultHandler { - public: +public: explicit MyResultHandler(MyResult& my_result) : my_result_(my_result) {} ~MyResultHandler() {} - public: +public: ObMySQLResult* mysql_result() { return &my_result_; } - private: +private: MyResult& my_result_; }; class MyProxy : public ObMySQLProxy { - public: +public: MyProxy() {} ~MyProxy() {} - public: +public: MyResult& get_result() { return my_result_; } - public: +public: int read(ReadResult& res, const uint64_t tenant_id, const char* sql) override { int ret = OB_SUCCESS; @@ -462,12 +462,12 @@ class MyProxy : public ObMySQLProxy { return ret; } - private: +private: MyResult my_result_; }; class TestObGcPartitionAdapter : public ::testing::Test { - public: +public: virtual void SetUp() { GCTX.split_schema_version_ = OB_INVALID_VERSION; diff --git a/unittest/storage/transaction/test_ob_gts_mgr.cpp b/unittest/storage/transaction/test_ob_gts_mgr.cpp index beaadaa49..cc068d5bf 100644 --- a/unittest/storage/transaction/test_ob_gts_mgr.cpp +++ b/unittest/storage/transaction/test_ob_gts_mgr.cpp @@ -26,7 +26,7 @@ using namespace obrpc; namespace unittest { class MyTimestampService : public ObITimestampService { - public: +public: MyTimestampService() {} ~MyTimestampService() @@ -42,7 +42,7 @@ class MyTimestampService : public ObITimestampService { leader_.reset(); } - public: +public: int get_timestamp(const ObPartitionKey& partition, int64_t& gts, ObAddr& leader) const { UNUSEDx(partition); @@ -59,19 +59,19 @@ class MyTimestampService : public ObITimestampService { return ret; } - private: +private: ObAddr self_; ObAddr leader_; }; class MyResponseRpc : public ObIGtsResponseRpc { - public: +public: MyResponseRpc() {} ~MyResponseRpc() {} - public: +public: void set_valid_arg( const uint64_t tenant_id, const int status, const ObAddr& leader, const ObAddr& sender, const ObAddr self) { @@ -93,7 +93,7 @@ class MyResponseRpc : public ObIGtsResponseRpc { } TO_STRING_KV(K_(tenant_id), K_(status), K_(leader), K_(sender), K_(self)); - private: +private: uint64_t tenant_id_; int status_; ObAddr leader_; @@ -102,7 +102,7 @@ class MyResponseRpc : public ObIGtsResponseRpc { }; class TestObGtsMgr : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/storage/transaction/test_ob_location_adapter.cpp b/unittest/storage/transaction/test_ob_location_adapter.cpp index e3a49c2f5..8b02a3d12 100644 --- a/unittest/storage/transaction/test_ob_location_adapter.cpp +++ b/unittest/storage/transaction/test_ob_location_adapter.cpp @@ -25,13 +25,13 @@ using namespace share::schema; using namespace transaction; namespace unittest { class TestObLocationAdapter : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: // valid partition parameters static const int64_t VALID_TABLE_ID = 1; static const int32_t VALID_PARTITION_ID = 1; diff --git a/unittest/storage/transaction/test_ob_lts_source.cpp b/unittest/storage/transaction/test_ob_lts_source.cpp index f39d37d05..fecf60a89 100644 --- a/unittest/storage/transaction/test_ob_lts_source.cpp +++ b/unittest/storage/transaction/test_ob_lts_source.cpp @@ -22,13 +22,13 @@ using namespace transaction; namespace unittest { class TestObTsCbTask : public ObTsCbTask { - public: +public: TestObTsCbTask() {} ~TestObTsCbTask() {} - public: +public: int get_gts_callback(const MonotonicTs srr, const int64_t ts, const MonotonicTs receive_gts_ts) { UNUSED(srr); @@ -61,7 +61,7 @@ class TestObTsCbTask : public ObTsCbTask { }; class TestObLtsSource : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/storage/transaction/test_ob_mask_set.cpp b/unittest/storage/transaction/test_ob_mask_set.cpp index 5e838b858..4bd4387c4 100644 --- a/unittest/storage/transaction/test_ob_mask_set.cpp +++ b/unittest/storage/transaction/test_ob_mask_set.cpp @@ -20,13 +20,13 @@ namespace oceanbase { using namespace common; namespace unittest { class TestObMaskSet : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static const int64_t PARTITION_KEY_COUNT = 16; // valid partition parameters static const int64_t VALID_TABLE_ID = 1; diff --git a/unittest/storage/transaction/test_ob_trans_audit_record_mgr.cpp b/unittest/storage/transaction/test_ob_trans_audit_record_mgr.cpp index f76584e54..1bcf423e3 100644 --- a/unittest/storage/transaction/test_ob_trans_audit_record_mgr.cpp +++ b/unittest/storage/transaction/test_ob_trans_audit_record_mgr.cpp @@ -19,13 +19,13 @@ using namespace transaction; using namespace common; namespace unittest { class TestObTransAuditRecordMgr : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static const int32_t MAX_MEMORY = 100 * (1 << 20); // 100MB static const uint64_t TENANT_ID = 1000; }; diff --git a/unittest/storage/transaction/test_ob_trans_define.cpp b/unittest/storage/transaction/test_ob_trans_define.cpp index cc84f5d7b..7f3f48ae1 100644 --- a/unittest/storage/transaction/test_ob_trans_define.cpp +++ b/unittest/storage/transaction/test_ob_trans_define.cpp @@ -25,13 +25,13 @@ using namespace transaction; using namespace sql; namespace unittest { class TestObTransDefine : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: // valid partition parameters static const int64_t VALID_TABLE_ID = 1; static const int32_t VALID_PARTITION_ID = 1; diff --git a/unittest/storage/transaction/test_ob_trans_end_trans_callback.cpp b/unittest/storage/transaction/test_ob_trans_end_trans_callback.cpp index af629f8ee..a1dd6d770 100644 --- a/unittest/storage/transaction/test_ob_trans_end_trans_callback.cpp +++ b/unittest/storage/transaction/test_ob_trans_end_trans_callback.cpp @@ -26,7 +26,7 @@ using namespace common; namespace sql { class MockEndTransCallback : public ObExclusiveEndTransCallback { - public: +public: MockEndTransCallback() {} ~MockEndTransCallback() @@ -53,13 +53,13 @@ class MockEndTransCallback : public ObExclusiveEndTransCallback { namespace unittest { class TestObEndTransCallback : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static const int64_t PARTITION_KEY_COUNT = 16; // valid partition parameters static const int64_t VALID_TABLE_ID = 1; diff --git a/unittest/storage/transaction/test_ob_trans_factory.cpp b/unittest/storage/transaction/test_ob_trans_factory.cpp index c1a2398b0..cd6605715 100644 --- a/unittest/storage/transaction/test_ob_trans_factory.cpp +++ b/unittest/storage/transaction/test_ob_trans_factory.cpp @@ -23,19 +23,19 @@ using namespace common; using namespace transaction; namespace unittest { class TestObTransFactory : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static void* alloc_partition_mgr(void* args); static void* alloc_clog_buf(void* args); static void* alloc_trans_rpc(void* args); static void* alloc_mutator_buf(void* args); - public: +public: static const char* LOCAL_IP; static const int32_t PORT = 8080; static const ObAddr::VER IP_TYPE = ObAddr::IPV4; diff --git a/unittest/storage/transaction/test_ob_trans_log.cpp b/unittest/storage/transaction/test_ob_trans_log.cpp index 5e5531583..ee3121c89 100644 --- a/unittest/storage/transaction/test_ob_trans_log.cpp +++ b/unittest/storage/transaction/test_ob_trans_log.cpp @@ -23,13 +23,13 @@ using namespace transaction; using namespace storage; namespace unittest { class TestObTransLog : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static const char* LOCAL_IP; static const int32_t PORT = 8080; static const ObAddr::VER IP_TYPE = ObAddr::IPV4; @@ -42,7 +42,7 @@ const char* TestObTransLog::LOCAL_IP = "127.0.0.1"; const int64_t TIME_OUT = 1; class FakeObTransLog : public ObTransLog { - public: +public: virtual int replace_tenant_id(const uint64_t tenant_id) override { (void)ObTransLog::inner_replace_tenant_id(tenant_id); diff --git a/unittest/storage/transaction/test_ob_trans_mem_stat.cpp b/unittest/storage/transaction/test_ob_trans_mem_stat.cpp index 4f8a534b5..8522fe502 100644 --- a/unittest/storage/transaction/test_ob_trans_mem_stat.cpp +++ b/unittest/storage/transaction/test_ob_trans_mem_stat.cpp @@ -21,13 +21,13 @@ using namespace common; using namespace transaction; namespace unittest { class TestObTransMemStat : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static const char* LOCAL_IP; static const int32_t PORT = 8080; static const ObAddr::VER IP_TYPE = ObAddr::IPV4; diff --git a/unittest/storage/transaction/test_ob_trans_msg.cpp b/unittest/storage/transaction/test_ob_trans_msg.cpp index 2fd69985c..b6d883091 100644 --- a/unittest/storage/transaction/test_ob_trans_msg.cpp +++ b/unittest/storage/transaction/test_ob_trans_msg.cpp @@ -23,7 +23,7 @@ using namespace common; using namespace transaction; namespace unittest { class TestObTransMsg : public ::testing::Test { - public: +public: virtual void SetUp() { init_(); @@ -31,10 +31,10 @@ class TestObTransMsg : public ::testing::Test { virtual void TearDown() {} - private: +private: int init_(); - public: +public: // valid partition parameters static const int64_t VALID_TABLE_ID = 1; static const int32_t VALID_PARTITION_ID = 1; @@ -50,7 +50,7 @@ class TestObTransMsg : public ::testing::Test { static const char* LOCAL_IP; static const uint64_t TENANT_ID = 1001; - public: +public: common::ObAddr observer_; }; const char* TestObTransMsg::LOCAL_IP = "127.0.0.1"; diff --git a/unittest/storage/transaction/test_ob_trans_partition_stat.cpp b/unittest/storage/transaction/test_ob_trans_partition_stat.cpp index 0967ed1f2..5d68149ca 100644 --- a/unittest/storage/transaction/test_ob_trans_partition_stat.cpp +++ b/unittest/storage/transaction/test_ob_trans_partition_stat.cpp @@ -22,13 +22,13 @@ using namespace common; using namespace transaction; namespace unittest { class TestObTransPartitionStat : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static const char* LOCAL_IP; static const int32_t PORT = 8080; static const ObAddr::VER IP_TYPE = ObAddr::IPV4; diff --git a/unittest/storage/transaction/test_ob_trans_result.cpp b/unittest/storage/transaction/test_ob_trans_result.cpp index 51107c686..fc580b59e 100644 --- a/unittest/storage/transaction/test_ob_trans_result.cpp +++ b/unittest/storage/transaction/test_ob_trans_result.cpp @@ -21,17 +21,17 @@ using namespace common; using namespace transaction; namespace unittest { class TestObTransResult : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static void* wait_timeout(void* args); static void* wait_normal(void* args); - public: +public: static const int64_t WAIT_TIMES_US = 5 * 1000 * 1000; static const int64_t VALID_WAIT_TIME = -1; static const int64_t SLEEP_TIME_OUT_MS = 6000; diff --git a/unittest/storage/transaction/test_ob_trans_result_info_mgr.cpp b/unittest/storage/transaction/test_ob_trans_result_info_mgr.cpp index f21346a71..91b42fa1b 100644 --- a/unittest/storage/transaction/test_ob_trans_result_info_mgr.cpp +++ b/unittest/storage/transaction/test_ob_trans_result_info_mgr.cpp @@ -35,7 +35,7 @@ static const int32_t PORT2 = 8888888; static const ObAddr::VER IP_TYPE = ObAddr::IPV4; class MyMockObPartition : public MockObIPartitionGroup { - public: +public: MyMockObPartition() : pg_file_(NULL) {} virtual ~MyMockObPartition() @@ -62,13 +62,13 @@ class MyMockObPartition : public MockObIPartitionGroup { return OB_SUCCESS; } - private: +private: blocksstable::ObStorageFile* pg_file_; blocksstable::ObStorageFileHandle file_handle_; }; class MyMockObPartitionComponentFactory : public MockObIPartitionComponentFactory { - public: +public: virtual void free(ObIPartitionGroup* partition) { UNUSED(partition); @@ -77,7 +77,7 @@ class MyMockObPartitionComponentFactory : public MockObIPartitionComponentFactor }; class MyMockObPartitionService2 : public MockObIPartitionService { - public: +public: MyMockObPartitionService2() { partition_ = new MyMockObPartition(); @@ -118,7 +118,7 @@ class MyMockObPartitionService2 : public MockObIPartitionService { return OB_SUCCESS; } - private: +private: MyMockObPartition* partition_; }; diff --git a/unittest/storage/transaction/test_ob_trans_rpc.cpp b/unittest/storage/transaction/test_ob_trans_rpc.cpp index 7765d033e..f86a00082 100644 --- a/unittest/storage/transaction/test_ob_trans_rpc.cpp +++ b/unittest/storage/transaction/test_ob_trans_rpc.cpp @@ -29,7 +29,7 @@ using namespace obrpc; using namespace share; namespace unittest { class MyMockObPartitionService : public MockObIPartitionService { - public: +public: MyMockObPartitionService(transaction::ObTransService* trans_service) : trans_service_(trans_service) {} ~MyMockObPartitionService() @@ -39,12 +39,12 @@ class MyMockObPartitionService : public MockObIPartitionService { return trans_service_; } - private: +private: transaction::ObTransService* trans_service_; }; class ProcessorMgr : public ObTransP { - public: +public: ProcessorMgr(MyMockObPartitionService* partition_service) : ObTransP(partition_service) {} int do_response_msg() @@ -70,7 +70,7 @@ class MockObTransRpcProxy : public ObTransRpcProxy { }; class TestObTransRpc : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() diff --git a/unittest/storage/transaction/test_ob_trans_stat.cpp b/unittest/storage/transaction/test_ob_trans_stat.cpp index 5806b08e9..2cc7d7b75 100644 --- a/unittest/storage/transaction/test_ob_trans_stat.cpp +++ b/unittest/storage/transaction/test_ob_trans_stat.cpp @@ -23,13 +23,13 @@ using namespace common; using namespace transaction; namespace unittest { class TestObTransStat : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static const char* LOCAL_IP; static const int32_t PORT = 8080; static const ObAddr::VER IP_TYPE = ObAddr::IPV4; diff --git a/unittest/storage/transaction/test_ob_trans_submit_log_cb.cpp b/unittest/storage/transaction/test_ob_trans_submit_log_cb.cpp index 63b9ad403..dfabd2193 100644 --- a/unittest/storage/transaction/test_ob_trans_submit_log_cb.cpp +++ b/unittest/storage/transaction/test_ob_trans_submit_log_cb.cpp @@ -35,7 +35,7 @@ namespace unittest { LeaderActiveArg leader_active_arg; class MyMockObPartitionService2 : public MockObIPartitionService { - public: +public: MyMockObPartitionService2() {} @@ -65,12 +65,12 @@ class MyMockObPartitionService2 : public MockObIPartitionService { return &txs_; } - private: +private: transaction::ObTransService txs_; }; class MockObPartTransCtx : public ObPartTransCtx { - public: +public: MockObPartTransCtx() {} virtual ~MockObPartTransCtx() @@ -89,7 +89,7 @@ class MockObPartTransCtx : public ObPartTransCtx { }; class MockObLocationAdapter : public ObILocationAdapter { - public: +public: MockObLocationAdapter() {} ~MockObLocationAdapter() @@ -125,7 +125,7 @@ class MockObLocationAdapter : public ObILocationAdapter { } }; class MockObTransRpc : public ObITransRpc { - public: +public: MockObTransRpc() {} virtual ~MockObTransRpc() @@ -187,13 +187,13 @@ class MockObTransRpc : public ObITransRpc { }; class TestObTransSubmitLogCb : public ::testing::Test { - public: +public: virtual void SetUp() {} virtual void TearDown() {} - public: +public: static const int64_t PARTITION_KEY_COUNT = 16; static const int64_t TENANT_ID = 1001; // valid parameter partition diff --git a/unittest/storage/transaction/test_ob_transaction.h b/unittest/storage/transaction/test_ob_transaction.h index 0db40712b..59006b5ad 100644 --- a/unittest/storage/transaction/test_ob_transaction.h +++ b/unittest/storage/transaction/test_ob_transaction.h @@ -39,7 +39,7 @@ class ObIMemtableCtxFactory; namespace unittest { class TestServer : public transaction::ObTransService { - public: +public: TestServer() : is_inited_(false) {} ~TestServer() @@ -51,7 +51,7 @@ class TestServer : public transaction::ObTransService { memtable::ObIMemtableCtxFactory* mc_factory, storage::ObPartitionService* partition_service); void destroy(); - private: +private: bool is_inited_; common::ObAddr self_; };