Top Description Fields Constructors Methods
org.postgresql.hostchooser

pack-priv Class MultiHostChooser

extends Object
implements HostChooser
Class Inheritance
All Implemented Interfaces
org.postgresql.hostchooser.HostChooser, java.lang.Iterable
Static Imports
java.util.Collections.shuffle

HostChooser that keeps track of known host statuses.

Field Summary

Modifier and TypeField and Description
private int
private final HostSpec[]
private boolean
private final HostRequirement

Constructor Summary

AccessConstructor and Description
pack-priv
MultiHostChooser(HostSpec[] hostSpecs, HostRequirement targetServerType, Properties info)

Method Summary

Modifier and TypeMethod and Description
private <T> List<T>
append(final List<T> a, final List<T> b)

private Iterator<CandidateHost>
private List<CandidateHost>
public Iterator<CandidateHost>
iterator()

Implements org.postgresql.hostchooser.HostChooser.iterator.

Lists connection hosts in preferred order.

private <T> List<T>
rtrim(final int size, final List<T> a)

private List<CandidateHost>
withReqStatus(final HostRequirement requirement, final List<HostSpec> hosts)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hostRecheckTimeback to summary
private int hostRecheckTime
hostSpecsback to summary
private final HostSpec[] hostSpecs
loadBalanceback to summary
private boolean loadBalance
targetServerTypeback to summary
private final HostRequirement targetServerType

Constructor Detail

MultiHostChooserback to summary
pack-priv MultiHostChooser(HostSpec[] hostSpecs, HostRequirement targetServerType, Properties info)

Method Detail

appendback to summary
private <T> List<T> append(final List<T> a, final List<T> b)
candidateIteratorback to summary
private Iterator<CandidateHost> candidateIterator()
getCandidateHostsback to summary
private List<CandidateHost> getCandidateHosts(HostRequirement hostRequirement)
iteratorback to summary
public Iterator<CandidateHost> iterator()

Implements org.postgresql.hostchooser.HostChooser.iterator.

Doc from org.postgresql.hostchooser.HostChooser.iterator.

Lists connection hosts in preferred order.

Returns:Iterator<CandidateHost>

connection hosts in preferred order.

Annotations
@Override
rtrimback to summary
private <T> List<T> rtrim(final int size, final List<T> a)
withReqStatusback to summary
private List<CandidateHost> withReqStatus(final HostRequirement requirement, final List<HostSpec> hosts)