zookeeper
zookeeper copied to clipboard
ZOOKEEPER-4982 Automatic HostProvider selection based on connection string format
This PR implements automatic HostProvider selection based on connection string format, enabling ZooKeeper clients to automatically choose the appropriate HostProvider (e.g. DnsSrvHostProvder and StaticHostProvider) implementation without manual configuration.
The summary of the changes are :
- HostProviderFactory: New factory class that checks connection strings and instantiates appropriate HostProvider based on the detected format
- ConnectStringParser Enhancement: Extended to detect and validate DNS SRV connection string formats, adding support for dns-srv:// prefix detection
- ZooKeeper Constructor Integration: Updated ZooKeeper constructors to use HostProviderFactory for automatic provider creation when no custom HostProvider is specified
The changes are in the 2nd commit: https://github.com/apache/zookeeper/pull/2321/commits/59faa12e869f3f4460102e1dc8e3694e8aaec0cb
The first commit is for the dependent JIRA https://issues.apache.org/jira/browse/ZOOKEEPER-4956. The PR will be updated once https://github.com/apache/zookeeper/pull/2320 is merged.