Elffuss BraidHub

kikocis/java-driver public

Merge branch '2.0' into 2.1
Changeseta6a6cec35afb087814efb22e37836ec2c3fdaffeb2564f55775704d2c23b1824
Authorolim7t <omichallat+github@gmail.com> · 2015-03-11 20:19 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2015-03-11 20:19 +01:00
Parentsfbd0ca059df8, 0aeacc35956c

Browse the files at this changeset

2 files changed

modified driver-core/CHANGELOG.rst +1 −0
@@ -24,6 +24,7 @@
2424 - [bug] Quote single quotes contained in table comments in asCQLQuery method
2525 (JAVA-655)
2626 - [bug] Empty TokenRange returned in a one token cluster (JAVA-684)
27+- [improvement] Expose TokenRange#contains (JAVA-687)
2728 - [bug] Prevent race between cancellation and query completion (JAVA-614)
2829 - [bug] Prevent cancel and timeout from cancelling unrelated ResponseHandler if
2930 streamId was already released and reused (JAVA-632).
modified driver-core/src/main/java/com/datastax/driver/core/TokenRange.java +10 −0
@@ -213,6 +213,16 @@
213213 return intersected;
214214 }
215215
216+ /**
217+ * Checks whether this range contains a given token.
218+ *
219+ * @param token the token to check for.
220+ * @return whether this range contains the token, i.e. {@code range.start &lt; token &lt;= range.end}.
221+ */
222+ public boolean contains(Token token) {
223+ return contains(token, false);
224+ }
225+
216226 // isStart handles the case where the token is the start of another range, for example:
217227 // * ]1,2] contains 2, but it does not contain the start of ]2,3]
218228 // * ]1,2] does not contain 1, but it contains the start of ]1,3]