private void onComplete(HRegionLocation loc) {
    if (controller.failed()) {
      onError(controller.getFailed(),
        () -> "Call to " + loc.getServerName() + " for " + replica + " failed",
        err -> conn.getLocator().updateCachedLocationOnError(loc, err));
    } else {
      future.complete(null);
    }
  }
For replicating edits to secondary replicas.
hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionReplicationRetryingCaller.java