This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git
The following commit(s) were added to refs/heads/master by this push:
new ff8aa66 RATIS-1365. Add message for potential NPE in
CombinedClientProtocolServerSideTranslatorPB (#467)
ff8aa66 is described below
commit ff8aa668f1a0569ba5e6b0f30dbd51a673913344
Author: Roni Juntunen <[email protected]>
AuthorDate: Mon Apr 26 12:34:12 2021 +0300
RATIS-1365. Add message for potential NPE in
CombinedClientProtocolServerSideTranslatorPB (#467)
---
.../client/CombinedClientProtocolServerSideTranslatorPB.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git
a/ratis-hadoop/src/main/java/org/apache/ratis/hadooprpc/client/CombinedClientProtocolServerSideTranslatorPB.java
b/ratis-hadoop/src/main/java/org/apache/ratis/hadooprpc/client/CombinedClientProtocolServerSideTranslatorPB.java
index 7a41f7b..5999507 100644
---
a/ratis-hadoop/src/main/java/org/apache/ratis/hadooprpc/client/CombinedClientProtocolServerSideTranslatorPB.java
+++
b/ratis-hadoop/src/main/java/org/apache/ratis/hadooprpc/client/CombinedClientProtocolServerSideTranslatorPB.java
@@ -41,11 +41,14 @@ import
org.apache.ratis.proto.RaftProtos.GroupInfoRequestProto;
import org.apache.ratis.proto.RaftProtos.GroupInfoReplyProto;
import org.apache.ratis.proto.RaftProtos.TransferLeadershipRequestProto;
import org.apache.ratis.thirdparty.com.google.protobuf.GeneratedMessageV3;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@InterfaceAudience.Private
public class CombinedClientProtocolServerSideTranslatorPB
implements CombinedClientProtocolPB {
+ private Logger log =
LoggerFactory.getLogger(CombinedClientProtocolServerSideTranslatorPB.class);
private final RaftServer impl;
public CombinedClientProtocolServerSideTranslatorPB(RaftServer impl) {
@@ -79,6 +82,10 @@ public class CombinedClientProtocolServerSideTranslatorPB
response =
transferLeadership(TransferLeadershipRequestProto.parseFrom(buf));
break;
default:
+ String message = "Internal error, all response types are not being
handled as expected. " +
+ "Developer: check that all response types have
appropriate handlers.";
+ log.error(message);
+ throw new ServiceException(message);
}
} catch(IOException ioe) {
throw new ServiceException(ioe);