absurdfarce commented on code in PR #2036:
URL:
https://github.com/apache/cassandra-java-driver/pull/2036#discussion_r2048233664
##########
core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilder.java:
##########
@@ -142,4 +151,14 @@ protected String getDriverName() {
protected String getDriverVersion() {
return Session.OSS_DRIVER_COORDINATES.getVersion().toString();
}
+
+ private String localDc(DriverExecutionProfile profile) {
+ String dc = context.getLocalDatacenter(profile.getName()); // DC set
programmatically
+ if (dc == null &&
profile.isDefined(DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER)) {
+ dc =
+ profile.getString(
+ DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER); // DC from
configuration
+ }
+ return dc;
Review Comment:
Mentioned to @lukasz-antoniak in separate conversation but I'll document is
here as well; checking for the presence of this config prop isn't enough. You
also need to see whether you have an LBP implementation which cares about that
prop; it's entirely possible a user could define
LOAD_BALANCING_LOCAL_DATACENTER and then use some other LBP which just ignores
it.
It's also worth noting that some LBPs can infer the local DC if it isn't
present... which means they may not have anything defined for this property but
would still have a notion of a local DC.
--
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]