Class MultiHostChooser
java.lang.Object
org.postgresql.hostchooser.MultiHostChooser
- All Implemented Interfaces:
Iterable<CandidateHost>, HostChooser
HostChooser that keeps track of known host statuses.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final HostSpec[]private booleanprivate final HostRequirement -
Constructor Summary
ConstructorsConstructorDescriptionMultiHostChooser(HostSpec[] hostSpecs, HostRequirement targetServerType, Properties info) -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> List<T> private Iterator<CandidateHost> private List<CandidateHost> getCandidateHosts(HostRequirement hostRequirement) iterator()Lists connection hosts in preferred order.private static <T> List<T> private static List<CandidateHost> withReqStatus(HostRequirement requirement, List<HostSpec> hosts) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
hostSpecs
-
targetServerType
-
hostRecheckTime
private int hostRecheckTime -
loadBalance
private boolean loadBalance
-
-
Constructor Details
-
MultiHostChooser
MultiHostChooser(HostSpec[] hostSpecs, HostRequirement targetServerType, Properties info)
-
-
Method Details
-
iterator
Description copied from interface:HostChooserLists connection hosts in preferred order.- Specified by:
iteratorin interfaceHostChooser- Specified by:
iteratorin interfaceIterable<CandidateHost>- Returns:
- connection hosts in preferred order.
-
candidateIterator
-
getCandidateHosts
-
withReqStatus
-
append
-
rtrim
-