Package com.linkedin.alpini.router.api
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<H>
findHosts(java.lang.String requestMethod, java.lang.String resourceName, java.lang.String partitionName, HostHealthMonitor<H> hostHealthMonitor, R roles)
Find hosts that can serve the given database and partition with one of the roles passed.default AsyncFuture<HostFinder<H,R>>
getChangeFuture()
Returns an async future which is completed when a change in the routing table occurs.default HostFinder<H,R>
getSnapshot()
-
-
-
Method Detail
-
getSnapshot
default HostFinder<H,R> getSnapshot()
-
findHosts
@Nonnull java.util.List<H> findHosts(@Nonnull java.lang.String requestMethod, @Nonnull java.lang.String resourceName, @Nonnull java.lang.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.
-
-