zookeeper
zookeeper copied to clipboard
ZOOKEEPER-4956: Provide a HostProvider that uses DNS SRV record for dynamic server discovery
The existing ZooKeeper client architecture relies on StaticHostProvider, which lacks auto service discovery capabilities and must wait for external mechanisms to push server list updates, either through manual configuration changes or reconfig notifications.
This PR provides a HostProvider implementation that performs dynamic service discovery based on DNS SRV record. The following is a summary of the changes:
- DnsSrvHostProvider: New HostProvider implementation that performs DNS SRV lookups to discover ZooKeeper servers
- HostConnectionManager: Extracted connection management and reconfiguration logic from StaticHostProvider into a reusable component
- StaticHostProvider Refactoring: Modified to use HostConnectionManager for consistent connection handling across providers
- ConnectionType: New enum that represents the type of connection resolutions
- Configuration: Added zookeeper.hostProvider.dnsSrvRefreshIntervalMs client property for DNS refresh intervals