Splits this query into one query for the part that is covered by the rollup table (as defined in its SLA) and one to get the data for the remaining time range from the raw table. @param query The original TSQuery as parsed @param index The index of the TSQuery @param rawQuery A new TsdbQuery instanc
(final TSQuery query, final int index, final TsdbQuery rawQuery)
| 442 | * @throws IllegalStateException if the query is not eligible or splitting is disabled |
| 443 | */ |
| 444 | public Deferred<Object> split(final TSQuery query, final int index, final TsdbQuery rawQuery) { |
| 445 | if (!needsSplitting()) { |
| 446 | throw new IllegalStateException("Query is not eligible for splitting" + this.toString()); |
| 447 | } |
| 448 | |
| 449 | Deferred<Object> rawResolutionDeferred = rawQuery.configureFromQuery(query, index, true); |
| 450 | |
| 451 | long lastRollupTimestampMillis = rollup_query.getLastRollupTimestampSeconds() * 1000L; |
| 452 | |
| 453 | boolean needsRawAndRollupData = QueryUtil.isTimestampAfter(lastRollupTimestampMillis, getStartTime()); |
| 454 | if (needsRawAndRollupData) { |
| 455 | updateRollupSplitTimes(rawQuery, lastRollupTimestampMillis); |
| 456 | } |
| 457 | |
| 458 | return rawResolutionDeferred; |
| 459 | } |
| 460 | |
| 461 | /** |
| 462 | * Updates the timestamp of this query and the corresponding raw part in the case of a split. |
no test coverage detected