Allow connecting with DcInferringLoadBalancingPolicy instead of localdatacenter #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
How to reproduce
Try connecting without specifying localdatacenter but with specifying DcInferringLoadBalancingPolicy which should discover localdatacenter automatically
jdbc:cassandra://localhost:9046/?loadBalancing=DcInferringLoadBalancingPolicy
Expected result
Successful connection
Actual result
Confusing error
No node was available to execute the query
Problem
localdatacenter is set to an empty string
Solution
Do not set localdatacenter if it was not specified.
If user set
loadBalancing
then connection will be successful.If user didn't set
loadBalancing
then at least they'll see the correct error messageSince you provided explicit contact points, the local DC must be explicitly set