kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 49b6731e451ff40e586cacfeccb110cfec843e3360983e282590f6c3448c394b |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-10-09 15:23 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-10-14 22:05 +02:00 |
| Parents | cf32ad67f65d |
2 files changed
modified changelog/README.md +1 −0
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | - [improvement] Don't delay UP/ADDED notifications if protocol version = V4 (JAVA-877) |
| 8 | 8 | - [improvement] Parse 'extensions' column in table metadata (JAVA-938) |
| 9 | 9 | - [bug] Fix Configuration builder to allow disabled metrics (JAVA-900) |
| 10 | +- [new feature] Prepare API for async query trace (JAVA-902) | |
| 10 | 11 | |
| 11 | 12 | |
| 12 | 13 | ### 3.0.0-alpha3 |
modified driver-core/src/main/java/com/datastax/driver/core/ExecutionInfo.java +22 −1
| @@ -20,6 +20,9 @@ | ||
| 20 | 20 | import java.util.List; |
| 21 | 21 | import java.util.Map; |
| 22 | 22 | |
| 23 | +import com.google.common.util.concurrent.Futures; | |
| 24 | +import com.google.common.util.concurrent.ListenableFuture; | |
| 25 | + | |
| 23 | 26 | import com.datastax.driver.core.utils.Bytes; |
| 24 | 27 | |
| 25 | 28 | /** |
| @@ -132,7 +135,10 @@ | ||
| 132 | 135 | } |
| 133 | 136 | |
| 134 | 137 | /** |
| 135 | - * The query trace if tracing was enabled on this query. | |
| 138 | + * Return the query trace if tracing was enabled on this query. | |
| 139 | + * <p> | |
| 140 | + * Note that accessing the fields of the the returned object will trigger a | |
| 141 | + * <b>blocking</b> background query. | |
| 136 | 142 | * |
| 137 | 143 | * @return the {@code QueryTrace} object for this query if tracing was |
| 138 | 144 | * enable for this query, or {@code null} otherwise. |
| @@ -141,6 +147,21 @@ | ||
| 141 | 147 | return trace; |
| 142 | 148 | } |
| 143 | 149 | |
| 150 | + /** | |
| 151 | + * Placeholder for async query trace retrieval (not implemented yet). | |
| 152 | + * <p> | |
| 153 | + * Async query trace retrieval will be implemented in a future version. This method | |
| 154 | + * is added now to avoid breaking binary compatibility later. | |
| 155 | + * The current implementation merely wraps the result of {@link #getQueryTrace()} in | |
| 156 | + * an immediate future; it will still trigger a blocking query when the query | |
| 157 | + * trace's fields are accessed. | |
| 158 | + * | |
| 159 | + * @return currently, an immediate future containing the result of {@link #getQueryTrace()}. | |
| 160 | + */ | |
| 161 | + public ListenableFuture<QueryTrace> getQueryTraceAsync() { | |
| 162 | + return Futures.immediateFuture(trace); | |
| 163 | + } | |
| 164 | + | |
| 144 | 165 | /** |
| 145 | 166 | * The paging state of the query. |
| 146 | 167 | * |