Github user anmolnar commented on the issue:
https://github.com/apache/zookeeper/pull/451
@afine @ijuma I've finished refactoring of StaticHostProvider.
The implementation follows that I explained in my email as **Option-3**:
> - Do not cache IPs,
> - Shuffle the names and resolve with getAllByName() every time when
next() is called,
> - Use getAllByName(), but shuffle the list and return the first IP to
properly handle hostnames associated with multiple IPs,
> - JDK's built-in caching will prevent name servers from being flooded and
will do the re-resolution automatically when cache expires,
The `Resolver` interface which is also introduced in this patch is the
solution for the problem that @afine raised: to properly mock out the
`getAllByName()` call in unit tests.
---