You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by ru...@apache.org on 2020/09/09 05:53:54 UTC

[incubator-ratis] branch master updated: RATIS-1055. Switch cases should end with an unconditional "break" statement (#193)

This is an automated email from the ASF dual-hosted git repository.

runzhiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new 61f038b  RATIS-1055. Switch cases should end with an unconditional "break" statement (#193)
61f038b is described below

commit 61f038b6bea2934e910e8504df0d8c79d6d34799
Author: maobaolong <30...@qq.com>
AuthorDate: Wed Sep 9 13:53:45 2020 +0800

    RATIS-1055. Switch cases should end with an unconditional "break" statement (#193)
    
    * Update GrpcLogAppender.java
    
    Switch cases should end with an unconditional "break" statement
    
    * Add log for UNRECOGNIZED case
---
 .../src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
index 4eb5cb9..9f5eb76 100644
--- a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
+++ b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
@@ -407,7 +407,11 @@ public class GrpcLogAppender extends LogAppender {
           LOG.error("{}: Configuration Mismatch ({}): Leader {} has it set to {} but follower {} has it set to {}",
               this, RaftServerConfigKeys.Log.Appender.INSTALL_SNAPSHOT_ENABLED_KEY,
               getServer().getId(), installSnapshotEnabled, getFollowerId(), !installSnapshotEnabled);
+          break;
         case UNRECOGNIZED:
+          LOG.error("Unrecongnized the reply result {}: Leader is {}, follower is {}",
+              reply.getResult(), getServer().getId(), getFollowerId());
+          break;
         default:
           break;
       }