Elffuss BraidHub

kikocis/java-driver public

Make ServerSideTimestampGenerator the default.
Changeset4104611f66e4ce14656911f117d1be84ffbcb78007458ce4db087239e498f252
Authorolim7t <omichallat+github@gmail.com> · 2014-10-07 19:01 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2014-10-08 10:45 +02:00
Parentse24e5cd01927

Browse the files at this changeset

2 files changed

modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +2 −4
@@ -24,7 +24,6 @@
2424 import java.util.concurrent.atomic.AtomicInteger;
2525 import java.util.concurrent.atomic.AtomicReference;
2626
27-import com.datastax.driver.core.exceptions.DriverException;
2827 import com.google.common.base.Predicates;
2928 import com.google.common.collect.HashMultimap;
3029 import com.google.common.collect.Iterables;
@@ -863,9 +862,8 @@
863862 * generated server-side, and setting a generator through this method will have
864863 * no effect.
865864 * <p>
866- * If no generator is set through this method, the default
867- * {@link CountingTimestampGenerator} will be used. To force server-side
868- * timestamps with V3 or above, use {@link ServerSideTimestampGenerator}.
865+ * If no generator is set through this method, the driver will default to the
866+ * legacy server-side behavior by using {@link ServerSideTimestampGenerator}.
869867 *
870868 * @param timestampGenerator the generator to use.
871869 * @return this Builder.
modified driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java +3 −4
@@ -15,7 +15,7 @@
1515 */
1616 package com.datastax.driver.core.policies;
1717
18-import com.datastax.driver.core.CountingTimestampGenerator;
18+import com.datastax.driver.core.ServerSideTimestampGenerator;
1919 import com.datastax.driver.core.TimestampGenerator;
2020
2121 /**
@@ -124,13 +124,12 @@
124124 /**
125125 * The default timestamp generator.
126126 * <p>
127- * This is an instance of {@link CountingTimestampGenerator}.
127+ * This is an instance of {@link ServerSideTimestampGenerator}.
128128 *
129129 * @return the default timestamp generator.
130130 */
131131 public static TimestampGenerator defaultTimestampGenerator() {
132- // Create a new instance each time to avoid sharing between different Cluster instances.
133- return new CountingTimestampGenerator();
132+ return ServerSideTimestampGenerator.INSTANCE;
134133 }
135134
136135 /**