@InterfaceAudience.Public public final class StaticHostProvider extends java.lang.Object implements HostProvider
| Constructor and Description |
|---|
StaticHostProvider(java.util.Collection<java.net.InetSocketAddress> serverAddresses)
Constructs a SimpleHostSet.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.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(java.util.Collection<java.net.InetSocketAddress> serverAddresses)
serverAddresses - possibly unresolved ZooKeeper server addressesjava.lang.IllegalArgumentException - if serverAddresses is empty or resolves to an empty listpublic int size()
size in interface HostProviderpublic java.net.InetSocketAddress next(long spinDelay)
HostProvidernext in interface HostProviderspinDelay - Milliseconds to wait if all hosts have been tried once.public void onConnected()
HostProvideronConnected in interface HostProviderCopyright © 2018 The Apache Software Foundation