Skip to content

Conversation

li4wang
Copy link
Contributor

@li4wang li4wang commented Sep 29, 2025

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: 59faa12

The first commit is for the dependent JIRA https://issues.apache.org/jira/browse/ZOOKEEPER-4956. The PR will be updated once #2320 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant