Interface HostFinder<H,R>

All Known Implementing Classes:
VeniceHostFinder

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

    • getSnapshot

      default HostFinder<H,R> getSnapshot()
    • findHosts

      @Nonnull List<H> findHosts(@Nonnull String requestMethod, @Nonnull String resourceName, @Nonnull String partitionName, @Nonnull HostHealthMonitor<H> hostHealthMonitor, @Nonnull 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
      Throws:
      RouterException
    • getChangeFuture

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