Elffuss BraidHub

kikocis/java-driver public

JAVA-1175: Warn if DCAwarePolicy configuration is inconsistent. (#674)

Changeset493693bdeaa2a1eb5c12c2fefe9b36ecffe81dac3ae698d523384b049a9fc5a0
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2016-06-27 11:09 -07:00
CommitterGitHub <noreply@github.com> · 2016-06-27 11:09 -07:00
Parents4f91f988cb6c

Browse the files at this changeset

2 files changed

modified changelog/README.md +1 −0
@@ -9,6 +9,7 @@
99 - [improvement] JAVA-1204: Update documentation to indicate tcnative version requirement.
1010 - [bug] JAVA-1186: Fix duplicated hosts in DCAwarePolicy warn message.
1111 - [bug] JAVA-1187: Fix warning message when local CL used with RoundRobinPolicy.
12+- [improvement] JAVA-1175: Warn if DCAwarePolicy configuration is inconsistent.
1213
1314
1415 ### 3.0.2
modified driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java +4 −0
@@ -356,6 +356,10 @@
356356 * @return the policy.
357357 */
358358 public DCAwareRoundRobinPolicy build() {
359+ if (usedHostsPerRemoteDc == 0 && allowRemoteDCsForLocalConsistencyLevel) {
360+ logger.warn("Setting allowRemoteDCsForLocalConsistencyLevel has no effect if usedHostsPerRemoteDc = 0. "
361+ + "This setting will be ignored");
362+ }
359363 return new DCAwareRoundRobinPolicy(localDc, usedHostsPerRemoteDc, allowRemoteDCsForLocalConsistencyLevel, true);
360364 }
361365 }