@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasRpcReply()) { hash = (37 * hash) + RPCREPLY_FIELD_NUMBER; hash = (53 * hash) + getRpcReply().hashCode(); } hash = (37 * hash) + EXCEPTION_FIELD_NUMBER; hash = (53 * hash) + getException().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
case 7: hash = (37 * hash) + EXCEPTIONREPLY_FIELD_NUMBER; hash = (53 * hash) + getExceptionReply().hashCode(); break; case 0:
case 7: result = result && getExceptionReply() .equals(other.getExceptionReply()); break; case 0:
/** * <code>.ratis.netty.RaftNettyExceptionReplyProto exceptionReply = 7;</code> */ public Builder mergeExceptionReply(org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto value) { if (exceptionReplyBuilder_ == null) { if (raftNettyServerReplyCase_ == 7 && raftNettyServerReply_ != org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.getDefaultInstance()) { raftNettyServerReply_ = org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.newBuilder((org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto) raftNettyServerReply_) .mergeFrom(value).buildPartial(); } else { raftNettyServerReply_ = value; } onChanged(); } else { if (raftNettyServerReplyCase_ == 7) { exceptionReplyBuilder_.mergeFrom(value); } exceptionReplyBuilder_.setMessage(value); } raftNettyServerReplyCase_ = 7; return this; } /**
/** * <code>.ratis.netty.RaftNettyExceptionReplyProto exceptionReply = 7;</code> */ private org.apache.ratis.thirdparty.com.google.protobuf.SingleFieldBuilderV3< org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto, org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.Builder, org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProtoOrBuilder> getExceptionReplyFieldBuilder() { if (exceptionReplyBuilder_ == null) { if (!(raftNettyServerReplyCase_ == 7)) { raftNettyServerReply_ = org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.getDefaultInstance(); } exceptionReplyBuilder_ = new org.apache.ratis.thirdparty.com.google.protobuf.SingleFieldBuilderV3< org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto, org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.Builder, org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProtoOrBuilder>( (org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto) raftNettyServerReply_, getParentForChildren(), isClean()); raftNettyServerReply_ = null; } raftNettyServerReplyCase_ = 7; onChanged();; return exceptionReplyBuilder_; } public final Builder setUnknownFields(
public static long getCallId(RaftNettyServerReplyProto proto) { switch (proto.getRaftNettyServerReplyCase()) { case REQUESTVOTEREPLY: return proto.getRequestVoteReply().getServerReply().getCallId(); case APPENDENTRIESREPLY: return proto.getAppendEntriesReply().getServerReply().getCallId(); case INSTALLSNAPSHOTREPLY: return proto.getInstallSnapshotReply().getServerReply().getCallId(); case RAFTCLIENTREPLY: return proto.getRaftClientReply().getRpcReply().getCallId(); case EXCEPTIONREPLY: return proto.getExceptionReply().getRpcReply().getCallId(); case RAFTNETTYSERVERREPLY_NOT_SET: throw new IllegalArgumentException("Reply case not set in proto: " + proto.getRaftNettyServerReplyCase()); default: throw new UnsupportedOperationException("Reply case not supported: " + proto.getRaftNettyServerReplyCase()); } }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto)) { return super.equals(obj); } org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto other = (org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto) obj; boolean result = true; result = result && (hasRpcReply() == other.hasRpcReply()); if (hasRpcReply()) { result = result && getRpcReply() .equals(other.getRpcReply()); } result = result && getException() .equals(other.getException()); result = result && unknownFields.equals(other.unknownFields); return result; }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (rpcReply_ != null) { size += org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream .computeMessageSize(1, getRpcReply()); } if (!exception_.isEmpty()) { size += org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream .computeBytesSize(2, exception_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
/** * <code>.ratis.netty.RaftNettyExceptionReplyProto exceptionReply = 7;</code> */ public org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto getExceptionReply() { if (exceptionReplyBuilder_ == null) { if (raftNettyServerReplyCase_ == 7) { return (org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto) raftNettyServerReply_; } return org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.getDefaultInstance(); } else { if (raftNettyServerReplyCase_ == 7) { return exceptionReplyBuilder_.getMessage(); } return org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.getDefaultInstance(); } } /**
@Override protected void channelRead0(ChannelHandlerContext ctx, RaftNettyServerReplyProto proto) { final CompletableFuture<RaftNettyServerReplyProto> future = pollReply(); if (future == null) { throw new IllegalStateException("Request #" + getCallId(proto) + " not found"); } if (proto.getRaftNettyServerReplyCase() == EXCEPTIONREPLY) { final Object ioe = ProtoUtils.toObject(proto.getExceptionReply().getException()); future.completeExceptionally((IOException)ioe); } else { future.complete(proto); } } };
public org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto getDefaultInstanceForType() { return org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.getDefaultInstance(); }
/** * <code>.ratis.netty.RaftNettyExceptionReplyProto exceptionReply = 7;</code> */ public org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProtoOrBuilder getExceptionReplyOrBuilder() { if ((raftNettyServerReplyCase_ == 7) && (exceptionReplyBuilder_ != null)) { return exceptionReplyBuilder_.getMessageOrBuilder(); } else { if (raftNettyServerReplyCase_ == 7) { return (org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto) raftNettyServerReply_; } return org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.getDefaultInstance(); } } /**
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (rpcReply_ != null) { output.writeMessage(1, getRpcReply()); } if (!exception_.isEmpty()) { output.writeBytes(2, exception_); } unknownFields.writeTo(output); }
private static RaftNettyServerReplyProto toRaftNettyServerReplyProto( RaftRpcRequestProto request, IOException e) { final RaftRpcReplyProto.Builder rpcReply = RaftRpcReplyProto.newBuilder() .setRequestorId(request.getRequestorId()) .setReplyId(request.getReplyId()) .setCallId(request.getCallId()) .setSuccess(false); final RaftNettyExceptionReplyProto.Builder ioe = RaftNettyExceptionReplyProto.newBuilder() .setRpcReply(rpcReply) .setException(ProtoUtils.writeObject2ByteString(e)); return RaftNettyServerReplyProto.newBuilder().setExceptionReply(ioe).build(); }
/** * <code>.ratis.netty.RaftNettyExceptionReplyProto exceptionReply = 7;</code> */ public org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto getExceptionReply() { if (raftNettyServerReplyCase_ == 7) { return (org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto) raftNettyServerReply_; } return org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.getDefaultInstance(); } /**
public org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto buildPartial() { org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto result = new org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto(this); if (rpcReplyBuilder_ == null) { result.rpcReply_ = rpcReply_; } else { result.rpcReply_ = rpcReplyBuilder_.build(); } result.exception_ = exception_; onBuilt(); return result; }
public org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto build() { org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
/** * <code>.ratis.netty.RaftNettyExceptionReplyProto exceptionReply = 7;</code> */ public org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProtoOrBuilder getExceptionReplyOrBuilder() { if (raftNettyServerReplyCase_ == 7) { return (org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto) raftNettyServerReply_; } return org.apache.ratis.proto.netty.NettyProtos.RaftNettyExceptionReplyProto.getDefaultInstance(); }
/** * <code>bytes exception = 2;</code> */ public Builder clearException() { exception_ = getDefaultInstance().getException(); onChanged(); return this; } public final Builder setUnknownFields(