<NME> Peer.java
<BEF> package com.github.wenweihu86.raft;

import com.github.wenweihu86.raft.service.RaftConsensusService;
import com.github.wenweihu86.rpc.client.RPCClient;
import com.github.wenweihu86.rpc.client.RPCProxy;


/**
 * Created by wenweihu86 on 2017/5/5.
 */
public class Peer {
    private RaftProto.Server server;
    private RpcClient rpcClient;
    private RaftConsensusServiceAsync raftConsensusServiceAsync;
    // 需要发送给follower的下一个日志条目的索引值，只对leader有效
    private long nextIndex;
    // 已复制日志的最高索引值
    private long matchIndex;

    public Peer(ServerAddress serverAddress) {
        this.serverAddress = serverAddress;
        this.rpcClient = new RPCClient(serverAddress.getHost() + ":" + serverAddress.getPort());
        raftConsensusService = RPCProxy.getProxy(rpcClient, RaftConsensusService.class);
    }

                server.getEndpoint().getPort()));
        raftConsensusServiceAsync = BrpcProxy.getProxy(rpcClient, RaftConsensusServiceAsync.class);
        isCatchUp = false;
    }

    public RaftProto.Server getServer() {
        return server;
    }

    public RpcClient getRpcClient() {
        return rpcClient;
    }

    public RaftConsensusServiceAsync getRaftConsensusServiceAsync() {
        return raftConsensusServiceAsync;
    }

    public long getNextIndex() {
        return nextIndex;
    }

    public void setNextIndex(long nextIndex) {
        this.nextIndex = nextIndex;
    }

    public long getMatchIndex() {
        return matchIndex;
    }

    public void setMatchIndex(long matchIndex) {
        this.matchIndex = matchIndex;
    }

    public Boolean isVoteGranted() {
        return voteGranted;
    }

    public void setVoteGranted(Boolean voteGranted) {
        this.voteGranted = voteGranted;
    }


    public boolean isCatchUp() {
        return isCatchUp;
    }

    public void setCatchUp(boolean catchUp) {
        isCatchUp = catchUp;
    }
}

<MSG> simplify usage

<DFF> @@ -1,6 +1,7 @@
 package com.github.wenweihu86.raft;
 
 import com.github.wenweihu86.raft.service.RaftConsensusService;
+import com.github.wenweihu86.rpc.client.EndPoint;
 import com.github.wenweihu86.rpc.client.RPCClient;
 import com.github.wenweihu86.rpc.client.RPCProxy;
 
@@ -19,7 +20,7 @@ public class Peer {
 
     public Peer(ServerAddress serverAddress) {
         this.serverAddress = serverAddress;
-        this.rpcClient = new RPCClient(serverAddress.getHost() + ":" + serverAddress.getPort());
+        this.rpcClient = new RPCClient(new EndPoint(serverAddress.getHost(), serverAddress.getPort()));
         raftConsensusService = RPCProxy.getProxy(rpcClient, RaftConsensusService.class);
     }
 

simplify usage