public void start() throws InterruptedException, TimeoutException {
        cliOptions = new CliOptions();
        this.cliClientService.init(cliOptions);
        this.rpcClient = this.cliClientService.getRpcClient();
        if (conf != null) {
            final Set<PeerId> peers = conf.getPeerSet();
            for (final PeerId peer : peers) {
                try {
                    final BooleanCommand cmd = (BooleanCommand) this.rpcClient.invokeSync(peer.getEndpoint(),
                        new GetSlotsCommand(), cliOptions.getRpcDefaultTimeout());
                    if (cmd instanceof SlotsResponseCommand) {
                        groups = ((SlotsResponseCommand) cmd).getMap();
                        break;
                    } else {
                        LOG.warn("Fail to get slots from peer {}, error: {}", peer, cmd.getErrorMsg());
                    }
                } catch (final Throwable t) {
                    LOG.warn("Fail to get slots from peer {}, error: {}", peer, t.getMessage());
                    //continue;
                }
            }

            if (groups == null || groups.isEmpty()) {
                throw new IllegalArgumentException("Can't get slots from any peers");
            } else {
                LOG.info("All groups  is {}", groups);
            }
            for (final String groupId : groups.values()) {
                RouteTable.getInstance().updateConfiguration(groupId, conf);
                refreshLeader(groupId);
                refreshConf(groupId);
            }
        }

    }
A counter client
@author boyan (boyan@alibaba-inc.com)

2018-Apr-25 4:08:14 PM
jraft-test/src/main/java/com/alipay/sofa/jraft/test/atomic/client/AtomicClient.java