use of org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto in project incubator-ratis by apache.
the class NettyRpcService method startLeaderElection.
@Override
public StartLeaderElectionReplyProto startLeaderElection(StartLeaderElectionRequestProto request) throws IOException {
CodeInjectionForTesting.execute(SEND_SERVER_REQUEST, getId(), null, request);
final RaftNettyServerRequestProto proto = RaftNettyServerRequestProto.newBuilder().setStartLeaderElectionRequest(request).build();
final RaftRpcRequestProto serverRequest = request.getServerRequest();
return sendRaftNettyServerRequestProto(serverRequest, proto).getStartLeaderElectionReply();
}
use of org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto in project incubator-ratis by apache.
the class NettyRpcService method appendEntries.
@Override
public AppendEntriesReplyProto appendEntries(AppendEntriesRequestProto request) throws IOException {
CodeInjectionForTesting.execute(SEND_SERVER_REQUEST, getId(), null, request);
final RaftNettyServerRequestProto proto = RaftNettyServerRequestProto.newBuilder().setAppendEntriesRequest(request).build();
final RaftRpcRequestProto serverRequest = request.getServerRequest();
return sendRaftNettyServerRequestProto(serverRequest, proto).getAppendEntriesReply();
}
use of org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto in project incubator-ratis by apache.
the class NettyRpcService method requestVote.
@Override
public RequestVoteReplyProto requestVote(RequestVoteRequestProto request) throws IOException {
CodeInjectionForTesting.execute(SEND_SERVER_REQUEST, getId(), null, request);
final RaftNettyServerRequestProto proto = RaftNettyServerRequestProto.newBuilder().setRequestVoteRequest(request).build();
final RaftRpcRequestProto serverRequest = request.getServerRequest();
return sendRaftNettyServerRequestProto(serverRequest, proto).getRequestVoteReply();
}
use of org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto in project incubator-ratis by apache.
the class NettyRpcService method installSnapshot.
@Override
public InstallSnapshotReplyProto installSnapshot(InstallSnapshotRequestProto request) throws IOException {
CodeInjectionForTesting.execute(SEND_SERVER_REQUEST, getId(), null, request);
final RaftNettyServerRequestProto proto = RaftNettyServerRequestProto.newBuilder().setInstallSnapshotRequest(request).build();
final RaftRpcRequestProto serverRequest = request.getServerRequest();
return sendRaftNettyServerRequestProto(serverRequest, proto).getInstallSnapshotReply();
}
Aggregations