scylladb / java-driver

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

Add Resolver interface and implementations #332

Closed Bouncheck closed 2 months ago

Bouncheck commented 2 months 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 2 months 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 2 months ago

Applied all suggestions with minor fixes.

Bouncheck commented 2 months ago

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