Interface HostFinder<H,​R>

  • All Known Implementing Classes:

    public interface HostFinder<H,​R>
    Provides methods to locate the storage node or nodes for database partitions.
    • Method Detail

      • findHosts

        java.util.List<H> findHosts​(@Nonnull
                                    java.lang.String requestMethod,
                                    java.lang.String resourceName,
                                    java.lang.String partitionName,
                                    HostHealthMonitor<H> hostHealthMonitor,
                                    R roles)
                             throws RouterException
        Find hosts that can serve the given database and partition with one of the roles passed. Roles are processed in order with roles at the same level being processed as equivalent, such that a request for {{"LEADER"}, {"FOLLOWER"}} would first look for a LEADER, and if none is available then it will look for a FOLLOWER, while a request for {{"LEADER","FOLLOWER"}} would pick a random host that is either a LEADER or a FOLLOWER. Note: This call is expected to be non-blocking
      • getChangeFuture

        default AsyncFuture<HostFinder<H,​R>> getChangeFuture()
        Returns an async future which is completed when a change in the routing table occurs.