|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HostProvider
A set of hosts a ZooKeeper client should connect to. Classes implementing this interface must guarantee the following: * Every call to next() returns an InetSocketAddress. So the iterator never ends. * The size() of a HostProvider may never be zero. A HostProvider must return resolved InetSocketAddress instances on next(), but it's up to the HostProvider, when it wants to do the resolving. Different HostProvider could be imagined: * A HostProvider that loads the list of Hosts from an URL or from DNS * A HostProvider that re-resolves the InetSocketAddress after a timeout. * A HostProvider that prefers nearby hosts.
| Method Summary | |
|---|---|
InetSocketAddress |
next(long spinDelay)
The next host to try to connect to. |
void |
onConnected()
Notify the HostProvider of a successful connection. |
int |
size()
|
| Method Detail |
|---|
int size()
InetSocketAddress next(long spinDelay)
spinDelay - Milliseconds to wait if all hosts have been tried once.void onConnected()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||