default CompletableFuture<SyncReplicationState>
    getReplicationPeerSyncReplicationState(String peerId) {
    CompletableFuture<SyncReplicationState> future = new CompletableFuture<>();
    addListener(listReplicationPeers(Pattern.compile(peerId)), (peers, error) -> {
      if (error != null) {
        future.completeExceptionally(error);
      } else if (peers.isEmpty() || !peers.get(0).getPeerId().equals(peerId)) {
        future
          .completeExceptionally(new IOException("Replication peer " + peerId + " does not exist"));
      } else {
        future.complete(peers.get(0).getSyncReplicationState());
      }
    });
    return future;
  }
Get the current cluster state in a synchronous replication peer.
@param peerId a short name that identifies the peer
@return the current cluster state wrapped by a {@link CompletableFuture}.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java