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 <[email protected]>
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 <[email protected]>
    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();
 }

Reply via email to