private void call(HRegionLocation loc) {
    AdminService.Interface stub;
    try {
      stub = conn.getAdminStub(loc.getServerName());
    } catch (IOException e) {
      onError(e,
        () -> "Get async admin stub to " + loc.getServerName() + " for " + replica + " failed",
        err -> conn.getLocator().updateCachedLocationOnError(loc, err));
      return;
    }
    Pair<ReplicateWALEntryRequest, ExtendedCellScanner> pair = ReplicationProtobufUtil
      .buildReplicateWALEntryRequest(entries, replica.getEncodedNameAsBytes(), null, null, null);
    resetCallTimeout();
    controller.setCellScanner(pair.getSecond());
    if (useReplay) {
      stub.replay(controller, pair.getFirst(), r -> onComplete(loc));
    } else {
      stub.replicateToReplica(controller, pair.getFirst(), r -> onComplete(loc));
    }
  }
For replicating edits to secondary replicas.
hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionReplicationRetryingCaller.java