public final class StaticHostProvider extends Object implements HostProvider
Constructor and Description |
---|
StaticHostProvider(Collection<InetSocketAddress> serverAddresses)
Constructs a SimpleHostSet.
|
Modifier and Type | Method and Description |
---|---|
InetSocketAddress |
next(long spinDelay)
The next host to try to connect to.
|
void |
onConnected()
Notify the HostProvider of a successful connection.
|
int |
size() |
public StaticHostProvider(Collection<InetSocketAddress> serverAddresses) throws UnknownHostException
serverAddresses
- possibly unresolved ZooKeeper server addressesUnknownHostException
IllegalArgumentException
- if serverAddresses is empty or resolves to an empty listpublic int size()
size
in interface HostProvider
public InetSocketAddress next(long spinDelay)
HostProvider
next
in interface HostProvider
spinDelay
- Milliseconds to wait if all hosts have been tried once.public void onConnected()
HostProvider
onConnected
in interface HostProvider
Copyright © 2016 The Apache Software Foundation