Package org.postgresql.hostchooser
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 int
private HostSpec[]
private boolean
private final HostRequirement
-
Constructor Summary
ConstructorsConstructorDescriptionMultiHostChooser
(HostSpec[] hostSpecs, HostRequirement targetServerType, Properties info) -
Method Summary
Modifier and TypeMethodDescriptionprivate <T> List<T>
private Iterator<CandidateHost>
private List<CandidateHost>
getCandidateHosts
(HostRequirement hostRequirement) iterator()
Lists connection hosts in preferred order.private <T> List<T>
private List<CandidateHost>
withReqStatus
(HostRequirement requirement, List<HostSpec> hosts) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.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:HostChooser
Lists connection hosts in preferred order.- Specified by:
iterator
in interfaceHostChooser
- Specified by:
iterator
in interfaceIterable<CandidateHost>
- Returns:
- connection hosts in preferred order.
-
candidateIterator
-
getCandidateHosts
-
withReqStatus
-
append
-
rtrim
-