提交 c1a3a90f 编写于 作者: O obdev 提交者: wangzelin.wzl

fix coverity issues

上级 5b403f4e
......@@ -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;
......
......@@ -135,9 +135,9 @@ public:
const common::ObIArray<uint64_t>& column_ids, const common::ObIArray<uint64_t>& 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;
......
......@@ -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;
......
......@@ -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<obrpc::ObCreatePartitionArg>& batch_arg,
const int64_t timeout, common::ObIArray<uint64_t>& log_id_arr);
int write_partition_schema_version_change_clog_(const common::ObPGKey& pg_key, const common::ObPartitionKey& pkey,
......
......@@ -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;
......
......@@ -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_;
};
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册