use of org.apache.ratis.grpc.GrpcFactory in project incubator-ratis by apache.
the class Client method run.
@Override
public void run() throws Exception {
RaftProperties raftProperties = new RaftProperties();
RaftGroup raftGroup = new RaftGroup(RaftGroupId.valueOf(ByteString.copyFromUtf8(raftGroupId)), parsePeers(peers));
RaftClient.Builder builder = RaftClient.newBuilder().setProperties(raftProperties);
builder.setRaftGroup(raftGroup);
builder.setClientRpc(new GrpcFactory(new Parameters()).newRaftClientRpc(ClientId.randomId(), raftProperties));
RaftClient client = builder.build();
operation(client);
}
Aggregations