absurdfarce commented on code in PR #2013:
URL: 
https://github.com/apache/cassandra-java-driver/pull/2013#discussion_r2127542294


##########
core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java:
##########
@@ -994,7 +994,48 @@ public enum DefaultDriverOption implements DriverOption {
    *
    * <p>Value-type: boolean
    */
-  
SSL_ALLOW_DNS_REVERSE_LOOKUP_SAN("advanced.ssl-engine-factory.allow-dns-reverse-lookup-san");
+  
SSL_ALLOW_DNS_REVERSE_LOOKUP_SAN("advanced.ssl-engine-factory.allow-dns-reverse-lookup-san"),
+  /**
+   * An address to always translate all node addresses to that same proxy 
hostname no matter what IP
+   * address a node has, but still using its native transport port.
+   *
+   * <p>Value-Type: {@link String}
+   */
+  
ADDRESS_TRANSLATOR_ADVERTISED_HOSTNAME("advanced.address-translator.advertised-hostname"),
+  /**
+   * A map of Cassandra node subnets (CIDR notations) to target addresses, for 
example (note quoted
+   * keys):
+   *
+   * <pre>
+   * advanced.address-translator.subnet-addresses {
+   *   "100.64.0.0/15" = "cassandra.datacenter1.com:9042"
+   *   "100.66.0.0/15" = "cassandra.datacenter2.com:9042"
+   *   # IPv6 example:
+   *   # "::ffff:6440:0/111" = "cassandra.datacenter1.com:9042"
+   *   # "::ffff:6442:0/111" = "cassandra.datacenter2.com:9042"
+   * }
+   * </pre>
+   *
+   * Note: subnets must be represented as prefix blocks, see {@link
+   * inet.ipaddr.Address#isPrefixBlock()}.
+   *
+   * <p>Value type: {@link java.util.Map Map}&#60;{@link String},{@link 
String}&#62;
+   */
+  
ADDRESS_TRANSLATOR_SUBNET_ADDRESSES("advanced.address-translator.subnet-addresses"),
+  /**
+   * A default address to fallback to if Cassandra node IP isn't contained in 
any of the configured
+   * subnets.
+   *
+   * <p>Value-Type: {@link String}
+   */
+  
ADDRESS_TRANSLATOR_DEFAULT_ADDRESS("advanced.address-translator.default-address"),
+  /**
+   * Whether to resolve the addresses on initialization (if true) or on each 
node (re-)connection
+   * (if false). Defaults to false.
+   *
+   * <p>Value-Type: boolean
+   */
+  
ADDRESS_TRANSLATOR_RESOLVE_ADDRESSES("advanced.address-translator.resolve-addresses");

Review Comment:
   TypedDriverOptionTest [will 
fail](https://github.com/apache/cassandra-java-driver/blob/4.19.0/core/src/test/java/com/datastax/oss/driver/api/core/config/TypedDriverOptionTest.java#L35)
 if this enum contains values which aren't also in TypedDriverOption.  The 
following diff should get you past this issue:
   
   ```diff
   diff --git 
a/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java
 
b/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java
   index 93e2b4684..aa4e4af12 100644
   --- 
a/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java
   +++ 
b/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java
   @@ -896,6 +896,20 @@ public class TypedDriverOption<ValueT> {
                  
DefaultDriverOption.LOAD_BALANCING_DC_FAILOVER_ALLOW_FOR_LOCAL_CONSISTENCY_LEVELS,
                  GenericType.BOOLEAN);
    
   +  public static final TypedDriverOption<String> 
ADDRESS_TRANSLATOR_ADVERTISED_HOSTNAME =
   +      new TypedDriverOption<>(
   +          DefaultDriverOption.ADDRESS_TRANSLATOR_ADVERTISED_HOSTNAME, 
GenericType.STRING);
   +  public static final TypedDriverOption<Map<String, String>> 
ADDRESS_TRANSLATOR_SUBNET_ADDRESSES =
   +      new TypedDriverOption<>(
   +          DefaultDriverOption.ADDRESS_TRANSLATOR_SUBNET_ADDRESSES,
   +          GenericType.mapOf(GenericType.STRING, GenericType.STRING));
   +  public static final TypedDriverOption<String> 
ADDRESS_TRANSLATOR_DEFAULT_ADDRESS =
   +      new TypedDriverOption<>(
   +          DefaultDriverOption.ADDRESS_TRANSLATOR_DEFAULT_ADDRESS, 
GenericType.STRING);
   +  public static final TypedDriverOption<Boolean> 
ADDRESS_TRANSLATOR_RESOLVE_ADDRESSES =
   +      new TypedDriverOption<>(
   +          DefaultDriverOption.ADDRESS_TRANSLATOR_RESOLVE_ADDRESSES, 
GenericType.BOOLEAN);
   +
      /**
       * Ordered preference list of remote dcs optionally supplied for 
automatic failover and included
       * in query plan. This feature is enabled only when 
max-nodes-per-remote-dc is greater than 0.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to