Search in sources :

Example 1 with RaftNettyServerRequestProto

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();
}
Also used : RaftNettyServerRequestProto(org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto)

Example 2 with RaftNettyServerRequestProto

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();
}
Also used : RaftNettyServerRequestProto(org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto)

Example 3 with RaftNettyServerRequestProto

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();
}
Also used : RaftNettyServerRequestProto(org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto)

Example 4 with RaftNettyServerRequestProto

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();
}
Also used : RaftNettyServerRequestProto(org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto)

Aggregations

RaftNettyServerRequestProto (org.apache.ratis.proto.netty.NettyProtos.RaftNettyServerRequestProto)4