You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by aw...@apache.org on 2021/10/26 20:26:01 UTC
[kudu] 02/02: [tablet] fix non-handled switch warning
This is an automated email from the ASF dual-hosted git repository.
awong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 9015ccc162122b0d0a55431957c03fb085bc26c3
Author: Andrew Wong <aw...@cloudera.com>
AuthorDate: Mon Oct 25 19:24:10 2021 -0700
[tablet] fix non-handled switch warning
This patch addresses the following build warning:
../../src/kudu/tablet/ops/participant_op.cc: In member function ‘kudu::Status kudu::tablet::ParticipantOpState::PerformOp(const kudu::consensus::OpId&, kudu::tablet::Tablet*)’:
../../src/kudu/tablet/ops/participant_op.cc:220:10: warning: enumeration value ‘ParticipantOpPB_ParticipantOpType_GET_METADATA’ not handled in switch [-Wswitch]
switch (op_type) {
^
Change-Id: I25c05d90dd3716f755ddcd9e842c4080fea277e1
Reviewed-on: http://gerrit.cloudera.org:8080/17970
Reviewed-by: Alexey Serbin <as...@cloudera.com>
Tested-by: Kudu Jenkins
---
src/kudu/tablet/ops/participant_op.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/kudu/tablet/ops/participant_op.cc b/src/kudu/tablet/ops/participant_op.cc
index a5ed7eb..0bd305d 100644
--- a/src/kudu/tablet/ops/participant_op.cc
+++ b/src/kudu/tablet/ops/participant_op.cc
@@ -252,9 +252,10 @@ Status ParticipantOpState::PerformOp(const consensus::OpId& op_id, Tablet* table
txn_->ReleasePartitionLock();
break;
}
- case ParticipantOpPB::UNKNOWN: {
- return Status::InvalidArgument("unknown op type");
- }
+ default:
+ return Status::InvalidArgument(
+ Substitute("bad op type $0 ($1)",
+ op_type, ParticipantOpPB::ParticipantOpType_Name(op_type)));
}
return Status::OK();
}