|
18 | 18 | import com.datastax.oss.driver.api.core.DefaultProtocolVersion; |
19 | 19 | import com.datastax.oss.driver.api.core.config.DefaultDriverOption; |
20 | 20 | import com.datastax.oss.driver.api.core.metadata.Node; |
| 21 | +import com.datastax.oss.driver.api.core.retry.RetryDecision; |
21 | 22 | import com.datastax.oss.driver.api.core.session.Request; |
22 | 23 | import com.datastax.oss.driver.api.core.session.Session; |
23 | 24 | import com.datastax.oss.driver.api.core.specex.SpeculativeExecutionPolicy; |
@@ -147,4 +148,31 @@ default QueryTrace getQueryTrace() { |
147 | 148 | BlockingOperation.checkNotDriverThread(); |
148 | 149 | return CompletableFutures.getUninterruptibly(getQueryTraceAsync()); |
149 | 150 | } |
| 151 | + |
| 152 | + /** |
| 153 | + * The size of the binary response in bytes. |
| 154 | + * |
| 155 | + * <p>This is the size of the protocol-level frame (including the frame header) before it was |
| 156 | + * decoded by the driver, but after decompression (if compression is enabled). |
| 157 | + * |
| 158 | + * <p>If the information is not available (for example if this execution info comes from an {@link |
| 159 | + * RetryDecision#IGNORE IGNORE} decision of the retry policy), this method returns -1. |
| 160 | + * |
| 161 | + * @see #getCompressedResponseSizeInBytes() |
| 162 | + */ |
| 163 | + int getResponseSizeInBytes(); |
| 164 | + |
| 165 | + /** |
| 166 | + * The size of the compressed binary response in bytes. |
| 167 | + * |
| 168 | + * <p>This is the size of the protocol-level frame (including the frame header) as it came in the |
| 169 | + * TCP response, before decompression and decoding by the driver. |
| 170 | + * |
| 171 | + * <p>If compression is disabled, or if the information is not available (for example if this |
| 172 | + * execution info comes from an {@link RetryDecision#IGNORE IGNORE} decision of the retry policy), |
| 173 | + * this method returns -1. |
| 174 | + * |
| 175 | + * @see #getResponseSizeInBytes() |
| 176 | + */ |
| 177 | + int getCompressedResponseSizeInBytes(); |
150 | 178 | } |
0 commit comments