diff --git a/deps/oblib/src/lib/container/ob_se_array.h b/deps/oblib/src/lib/container/ob_se_array.h index 0449fc44930ec7e0729fee9c70792d9f4580312c..79a58ea9633e5a1493df7e01ee406c81ef021bf9 100644 --- a/deps/oblib/src/lib/container/ob_se_array.h +++ b/deps/oblib/src/lib/container/ob_se_array.h @@ -38,12 +38,12 @@ public: { UNUSED(allocator); } - virtual void* alloc(int64_t sz) + virtual void* alloc(const int64_t sz) override { UNUSEDx(sz); return nullptr; } - virtual void* alloc(int64_t sz, const ObMemAttr& attr) + virtual void* alloc(const int64_t sz, const ObMemAttr& attr) override { UNUSEDx(sz, attr); return nullptr; diff --git a/src/storage/ob_partition_group.h b/src/storage/ob_partition_group.h index 552bdfe0c675ba351f3a905891949f5fe800dfdd..e243819e1d46b0d0e5e3345541e5875e7f0d0613 100644 --- a/src/storage/ob_partition_group.h +++ b/src/storage/ob_partition_group.h @@ -135,9 +135,9 @@ public: const common::ObIArray& column_ids, const common::ObIArray& updated_column_ids, const common::ObNewRow& old_row, const common::ObNewRow& new_row) 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); + common::ObNewRowIterator* row_iter, const 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); + const common::ObNewRow& row, ObLockFlag lock_flag) override; virtual int get_role(common::ObRole& role) const; virtual int get_role_for_partition_table(common::ObRole& role) const; diff --git a/src/storage/ob_partition_service.cpp b/src/storage/ob_partition_service.cpp index 837562f893bbc30a5fa4937d647ab60ca0294b86..7581bdae91d7da6ebd61916cf3294bb7b8a37cc7 100644 --- a/src/storage/ob_partition_service.cpp +++ b/src/storage/ob_partition_service.cpp @@ -9365,12 +9365,12 @@ int ObPartitionService::xa_rollback_all_changes(ObTransDesc& trans_desc, const O return ret; } -int ObPartitionService::get_pg_key(const ObPartitionKey& pkey, ObPGKey& pg_key) +int ObPartitionService::get_pg_key(const ObPartitionKey& pkey, ObPGKey& pg_key) const { return get_pg_key_(pkey, pg_key); } -int ObPartitionService::get_pg_key_(const ObPartitionKey& pkey, ObPGKey& pg_key) +int ObPartitionService::get_pg_key_(const ObPartitionKey& pkey, ObPGKey& pg_key) const { int ret = OB_SUCCESS; if (pkey.is_trans_table()) { @@ -9401,7 +9401,7 @@ int ObPartitionService::get_pg_key_(const ObPartitionKey& pkey, ObPGKey& pg_key) return ret; } -int ObPartitionService::get_pg_key_from_index_schema_(const ObPartitionKey& pkey, ObPGKey& pg_key) +int ObPartitionService::get_pg_key_from_index_schema_(const ObPartitionKey& pkey, ObPGKey& pg_key) const { int ret = OB_SUCCESS; diff --git a/src/storage/ob_partition_service.h b/src/storage/ob_partition_service.h index ec0bf755c64dcb8fab4dfd009397445d74a69e82..f02e54da837acb59a53cd7e8533b58a4afa3c49a 100644 --- a/src/storage/ob_partition_service.h +++ b/src/storage/ob_partition_service.h @@ -758,7 +758,7 @@ public: int process_migrate_retry_task(const ObMigrateRetryTask& task); bool reach_tenant_partition_limit(const int64_t batch_cnt, const uint64_t tenant_id, const bool is_pg_arg); int retry_rebuild_loop(); - VIRTUAL_FOR_UNITTEST int get_pg_key(const ObPartitionKey& pkey, ObPGKey& pg_key); + VIRTUAL_FOR_UNITTEST int get_pg_key(const ObPartitionKey& pkey, ObPGKey& pg_key) const override; static int mtl_init(ObTenantStorageInfo*& tenant_store_info) { int ret = common::OB_SUCCESS; @@ -986,8 +986,8 @@ private: int handle_rebuild_result_( const common::ObPartitionKey pkey, const common::ObReplicaType replica_type, const int ret_val); bool reach_tenant_partition_limit_(const int64_t batch_cnt, const uint64_t tenant_id, const bool is_pg_arg); - int get_pg_key_(const ObPartitionKey& pkey, ObPGKey& pg_key); - int get_pg_key_from_index_schema_(const ObPartitionKey& pkey, ObPGKey& pg_key); + int get_pg_key_(const ObPartitionKey& pkey, ObPGKey& pg_key) const; + int get_pg_key_from_index_schema_(const ObPartitionKey& pkey, ObPGKey& pg_key) const; int submit_add_partition_to_pg_clog_(const common::ObIArray& batch_arg, const int64_t timeout, common::ObIArray& log_id_arr); int write_partition_schema_version_change_clog_(const common::ObPGKey& pg_key, const common::ObPartitionKey& pkey, diff --git a/src/storage/ob_pg_index.cpp b/src/storage/ob_pg_index.cpp index b908c4a9706e9ad6a94867f11afc5dfaf8c9d6a3..247d69053f25c4fa9eb394eaa94d623e347801b6 100644 --- a/src/storage/ob_pg_index.cpp +++ b/src/storage/ob_pg_index.cpp @@ -133,7 +133,7 @@ int ObPartitionGroupIndex::remove_partition(const ObPartitionKey& pkey) return ret; } -int ObPartitionGroupIndex::get_pg_key(const common::ObPartitionKey& pkey, common::ObPGKey& pg_key) +int ObPartitionGroupIndex::get_pg_key(const common::ObPartitionKey& pkey, common::ObPGKey& pg_key) const { int ret = OB_SUCCESS; ObPGKeyWrap* pg_key_wrap = NULL; diff --git a/src/storage/ob_pg_index.h b/src/storage/ob_pg_index.h index 8b2d6a7376431860560d64d9248b229f8d47b081..769d39fd62c74988b62f5d53d61c7aeb6fa185dd 100644 --- a/src/storage/ob_pg_index.h +++ b/src/storage/ob_pg_index.h @@ -96,14 +96,14 @@ public: int add_partition(const common::ObPartitionKey& pkey, const common::ObPGKey& pg_key); int remove_partition(const common::ObPartitionKey& pkey); - int get_pg_key(const common::ObPartitionKey& pkey, common::ObPGKey& pg_key); + int get_pg_key(const common::ObPartitionKey& pkey, common::ObPGKey& pg_key) const; private: DISALLOW_COPY_AND_ASSIGN(ObPartitionGroupIndex); private: bool is_inited_; - ObPGIndexMap pg_index_map_; + mutable ObPGIndexMap pg_index_map_; mutable lib::ObMutex change_mutex_; }; diff --git a/unittest/storage/mockcontainer/mock_ob_partition_service.h b/unittest/storage/mockcontainer/mock_ob_partition_service.h index 0c32f74c9cfb2dda8dfd3f6d96b4b81d89efc40b..a331819c634622c631d2d2e0012ad79f25c64398 100644 --- a/unittest/storage/mockcontainer/mock_ob_partition_service.h +++ b/unittest/storage/mockcontainer/mock_ob_partition_service.h @@ -176,7 +176,7 @@ public: MOCK_METHOD2(get_partitions_by_file_key, int(const ObTenantFileKey& file_key, ObIPartitionArrayGuard& partitions)); MOCK_CONST_METHOD1(get_partition_count, int(int64_t& partition_count)); - virtual int get_pg_key(const ObPartitionKey& pkey, ObPGKey& pg_key) + virtual int get_pg_key(const ObPartitionKey& pkey, ObPGKey& pg_key) const override { pg_key = pkey; return common::OB_SUCCESS;