You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2025/03/21 05:59:06 UTC
(kudu) 01/02: [benchmarks] fix result status handling
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit e3c9f6b88f486af48ba1a0853e52eaf01bcb6ec6
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Thu Feb 27 18:25:48 2025 -0800
[benchmarks] fix result status handling
This patch addresses sloppy result handling of functions/methods
that return Status in the following directories
* src/kudu/benchmarks
* src/kudu/clock
* src/kudu/codegen
Change-Id: I3d9868da085d3448db876ca93e1ffbbb69a7ef31
Reviewed-on: http://gerrit.cloudera.org:8080/22647
Tested-by: Alexey Serbin <al...@apache.org>
Reviewed-by: Abhishek Chennaka <ac...@cloudera.com>
---
src/kudu/benchmarks/tpch/rpc_line_item_dao.cc | 2 +-
src/kudu/clock/builtin_ntp.cc | 2 +-
src/kudu/clock/logical_clock-test.cc | 9 ++++++---
src/kudu/codegen/codegen-test.cc | 4 ++--
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc b/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
index a0c87ace1..a99e9a879 100644
--- a/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
+++ b/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
@@ -224,7 +224,7 @@ void RpcLineItemDAO::OpenScannerImpl(const vector<string>& columns,
unique_ptr<Scanner>* out_scanner) {
unique_ptr<Scanner> ret(new Scanner);
ret->scanner_.reset(new KuduScanner(client_table_.get()));
- ret->scanner_->SetCacheBlocks(FLAGS_tpch_cache_blocks_when_scanning);
+ CHECK_OK(ret->scanner_->SetCacheBlocks(FLAGS_tpch_cache_blocks_when_scanning));
CHECK_OK(ret->scanner_->SetProjectedColumnNames(columns));
for (KuduPredicate* pred : preds) {
CHECK_OK(ret->scanner_->AddConjunctPredicate(pred));
diff --git a/src/kudu/clock/builtin_ntp.cc b/src/kudu/clock/builtin_ntp.cc
index b2f1073b6..d00b6be35 100644
--- a/src/kudu/clock/builtin_ntp.cc
+++ b/src/kudu/clock/builtin_ntp.cc
@@ -685,7 +685,7 @@ void BuiltInNtp::Shutdown() {
if (socket_.GetFd() >= 0) {
// Shutting down the socket without closing it ensures that any attempt
// to call sendmsg() will get EPIPE.
- socket_.Shutdown(true, true);
+ WARN_NOT_OK(socket_.Shutdown(true, true), "coult not shutdown socket");
}
if (thread_) {
thread_->Join();
diff --git a/src/kudu/clock/logical_clock-test.cc b/src/kudu/clock/logical_clock-test.cc
index 7ee06b94e..5ba026da2 100644
--- a/src/kudu/clock/logical_clock-test.cc
+++ b/src/kudu/clock/logical_clock-test.cc
@@ -15,9 +15,12 @@
// specific language governing permissions and limitations
// under the License.
+#include "kudu/clock/logical_clock.h"
+
+#include <string>
+
#include <gtest/gtest.h>
-#include "kudu/clock/logical_clock.h"
#include "kudu/common/timestamp.h"
#include "kudu/util/monotime.h"
#include "kudu/util/status.h"
@@ -48,7 +51,7 @@ TEST_F(LogicalClockTest, NowValuesIncreaseMonotonically) {
TEST_F(LogicalClockTest, UpdateLogicalValueIncreasesByAmount) {
Timestamp initial = clock_.Now();
Timestamp future(initial.value() + 10);
- clock_.Update(future);
+ ASSERT_OK(clock_.Update(future));
Timestamp now = clock_.Now();
// now should be 1 after future
ASSERT_EQ(initial.value() + 11, now.value());
@@ -58,7 +61,7 @@ TEST_F(LogicalClockTest, UpdateLogicalValueIncreasesByAmount) {
TEST_F(LogicalClockTest, UpdateLogicalValueDoesNotIncrease) {
Timestamp ts(1);
// update the clock to 1, the initial value, should do nothing
- clock_.Update(ts);
+ ASSERT_OK(clock_.Update(ts));
Timestamp now = clock_.Now();
ASSERT_EQ(2, now.value());
}
diff --git a/src/kudu/codegen/codegen-test.cc b/src/kudu/codegen/codegen-test.cc
index dfde2297f..0caa04128 100644
--- a/src/kudu/codegen/codegen-test.cc
+++ b/src/kudu/codegen/codegen-test.cc
@@ -77,7 +77,7 @@ class CodegenTest : public KuduTest {
ColumnSchema("str32 ", STRING, false),
ColumnSchema("str32-null-val", STRING, true),
ColumnSchema("str32-null ", STRING, true) };
- base_.Reset(cols, 1);
+ CHECK_OK(base_.Reset(cols, 1));
base_ = SchemaBuilder(base_).Build(); // add IDs
// Create an extended default schema
@@ -85,7 +85,7 @@ class CodegenTest : public KuduTest {
cols.emplace_back("int32-RW", INT32, false, false, false, kI32R, kI32W);
cols.emplace_back("str32-R ", STRING, false, false, false, kStrR, nullptr);
cols.emplace_back("str32-RW", STRING, false, false, false, kStrR, kStrW);
- defaults_.Reset(cols, 1);
+ CHECK_OK(defaults_.Reset(cols, 1));
defaults_ = SchemaBuilder(defaults_).Build(); // add IDs
test_rows_arena_.reset(new Arena(2 * 1024));