scylladb / java-driver

ScyllaDB Java Driver for ScyllaDB and Apache Cassandra, based on the DataStax Java Driver
Apache License 2.0
61 stars 37 forks source link

Add Resolver interface and implementations #332

Closed Bouncheck closed 1 month ago

Bouncheck commented 1 month ago

Requested modification to allow for more control over hostname resolution when testing. Adds a set of Resolver classes and factories and hooks them into necessary places. See commit messages and javadoc for more details.

Bouncheck commented 1 month ago

I think this might be a little overzealous in replacing all found calls to InetAddress in core module, I'll probably revert codecs, clients etc. to direct calls. For our use case it's probably most important to plug it in ContactPoints class and metadata subdirectory

Bouncheck commented 1 month ago

Applied all suggestions with minor fixes.

Bouncheck commented 1 month ago

Changed logic of checking for "unresolvedness". Turns out Java 8 has different toString implementation than the version I used.