This is an automated email from the ASF dual-hosted git repository.
zhangstar333 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 1e0848d7995 [chore](status) Static member accessed through instance
(#42213)
1e0848d7995 is described below
commit 1e0848d79958e4895c5574b73c6e7be9f8f4523e
Author: Mryange <[email protected]>
AuthorDate: Wed Oct 23 19:16:05 2024 +0800
[chore](status) Static member accessed through instance (#42213)
## Proposed changes
The capitalized OK in status constructs an "ok" status.
Since we allow status to be converted to bool, these checks are
redundant.
<!--Describe your changes.-->
---
be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp | 2 +-
be/test/olap/compaction_score_test.cpp | 12 ++++++------
be/test/olap/compaction_task_test.cpp | 8 ++++----
be/test/olap/rowset/segment_v2/inverted_index_array_test.cpp | 2 +-
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp
b/be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp
index ce7198aa4f5..83a205e59c7 100644
--- a/be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp
+++ b/be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp
@@ -294,7 +294,7 @@ Status
PartitionedHashJoinSinkLocalState::revoke_memory(RuntimeState* state) {
return Status::OK();
}();
- if (!status.OK()) {
+ if (!status.ok()) {
std::unique_lock<std::mutex> lock(_spill_lock);
_dependency->set_ready();
_spill_status_ok = false;
diff --git a/be/test/olap/compaction_score_test.cpp
b/be/test/olap/compaction_score_test.cpp
index de4e5cdde0a..3db624c48de 100644
--- a/be/test/olap/compaction_score_test.cpp
+++ b/be/test/olap/compaction_score_test.cpp
@@ -90,12 +90,12 @@ TEST_F(CompactionScoreTest, TestCompactionScore) {
.set_min_threads(2)
.set_max_threads(2)
.build(&_storage_engine->_base_compaction_thread_pool);
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
st = ThreadPoolBuilder("CumuCompactionTaskThreadPool")
.set_min_threads(2)
.set_max_threads(2)
.build(&_storage_engine->_cumu_compaction_thread_pool);
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
*/
/*
@@ -115,12 +115,12 @@ TEST_F(CompactionScoreTest, TestCompactionScore) {
TabletSharedPtr tablet(new Tablet(*(_storage_engine.get()), tablet_meta,
_data_dir.get(),
CUMULATIVE_SIZE_BASED_POLICY));
Status st = tablet->init();
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
for (int i = 2; i < 10; ++i) {
RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 102400);
st = tablet->add_inc_rowset(rs);
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
}
EXPECT_EQ(tablet->get_compaction_score(), -1);
EXPECT_EQ(tablet->calc_compaction_score(), 8);
@@ -129,7 +129,7 @@ TEST_F(CompactionScoreTest, TestCompactionScore) {
for (int i = 10; i < 30; ++i) {
RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 102400);
st = tablet->add_inc_rowset(rs);
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
}
EXPECT_EQ(tablet->get_compaction_score(), 28);
EXPECT_EQ(tablet->calc_compaction_score(), 28);
@@ -148,7 +148,7 @@ TEST_F(CompactionScoreTest, TestCompactionScore) {
std::vector<RowsetSharedPtr> output_rowsets;
output_rowsets.push_back(rs);
st = tablet->modify_rowsets(output_rowsets, input_rowsets, true);
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
EXPECT_EQ(tablet->get_compaction_score(), 9);
EXPECT_EQ(tablet->calc_compaction_score(), 9);
diff --git a/be/test/olap/compaction_task_test.cpp
b/be/test/olap/compaction_task_test.cpp
index c00406e6d15..50148d4f88e 100644
--- a/be/test/olap/compaction_task_test.cpp
+++ b/be/test/olap/compaction_task_test.cpp
@@ -88,12 +88,12 @@ TEST_F(CompactionTaskTest, TestSubmitCompactionTask) {
.set_min_threads(2)
.set_max_threads(2)
.build(&_storage_engine->_base_compaction_thread_pool);
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
st = ThreadPoolBuilder("CumuCompactionTaskThreadPool")
.set_min_threads(2)
.set_max_threads(2)
.build(&_storage_engine->_cumu_compaction_thread_pool);
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
auto* sp = SyncPoint::get_instance();
sp->enable_processing();
@@ -111,7 +111,7 @@ TEST_F(CompactionTaskTest, TestSubmitCompactionTask) {
TabletSharedPtr tablet(new Tablet(*(_storage_engine.get()),
tablet_meta, _data_dir.get(),
CUMULATIVE_SIZE_BASED_POLICY));
st = tablet->init();
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
for (int i = 2; i < 30; ++i) {
RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024);
@@ -121,7 +121,7 @@ TEST_F(CompactionTaskTest, TestSubmitCompactionTask) {
st = _storage_engine->_submit_compaction_task(tablet,
CompactionType::CUMULATIVE_COMPACTION,
false);
- EXPECT_TRUE(st.OK());
+ EXPECT_TRUE(st.ok());
}
int executing_task_num =
diff --git a/be/test/olap/rowset/segment_v2/inverted_index_array_test.cpp
b/be/test/olap/rowset/segment_v2/inverted_index_array_test.cpp
index 8621b81518a..3b1d2784c99 100644
--- a/be/test/olap/rowset/segment_v2/inverted_index_array_test.cpp
+++ b/be/test/olap/rowset/segment_v2/inverted_index_array_test.cpp
@@ -110,7 +110,7 @@ public:
paths.emplace_back(kTestDir, 1024);
auto tmp_file_dirs = std::make_unique<segment_v2::TmpFileDirs>(paths);
st = tmp_file_dirs->init();
- if (!st.OK()) {
+ if (!st.ok()) {
std::cout << "init tmp file dirs error:" << st.to_string() <<
std::endl;
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]