public interface HostSelector
| Modifier and Type | Method and Description |
|---|---|
@Nullable HostSpec |
getHost(@NonNull java.util.List<HostSpec> hosts,
@Nullable HostRole role,
@Nullable java.util.Properties props)
Selects a host with the requested role from the given host list.
|
@Nullable HostSpec getHost(@NonNull java.util.List<HostSpec> hosts, @Nullable HostRole role, @Nullable java.util.Properties props) throws java.sql.SQLException
hosts - a list of available hosts to pick from.role - the desired host role - either a writer or a reader. Null value means no preferences on host role.props - connection properties that may be needed by the host selector in order to choose a host.java.sql.SQLException - if an error occurs while selecting a host