Merge pull request #2615 from gianm/timeseries-skipEmptyBuckets-cache

Fix caching of skipEmptyBuckets for TimeseriesQuery.
This commit is contained in:
Fangjin Yang 2016-03-09 18:45:59 -08:00
commit 68cffe1d91
1 changed files with 12 additions and 10 deletions

View File

@ -135,12 +135,14 @@ public class TimeseriesQueryQueryToolChest extends QueryToolChest<Result<Timeser
final byte[] filterBytes = dimFilter == null ? new byte[]{} : dimFilter.getCacheKey(); final byte[] filterBytes = dimFilter == null ? new byte[]{} : dimFilter.getCacheKey();
final byte[] aggregatorBytes = QueryCacheHelper.computeAggregatorBytes(query.getAggregatorSpecs()); final byte[] aggregatorBytes = QueryCacheHelper.computeAggregatorBytes(query.getAggregatorSpecs());
final byte[] granularityBytes = query.getGranularity().cacheKey(); final byte[] granularityBytes = query.getGranularity().cacheKey();
final byte descending = query.isDescending() ? (byte)1 : 0; final byte descending = query.isDescending() ? (byte) 1 : 0;
final byte skipEmptyBuckets = query.isSkipEmptyBuckets() ? (byte) 1 : 0;
return ByteBuffer return ByteBuffer
.allocate(2 + granularityBytes.length + filterBytes.length + aggregatorBytes.length) .allocate(3 + granularityBytes.length + filterBytes.length + aggregatorBytes.length)
.put(TIMESERIES_QUERY) .put(TIMESERIES_QUERY)
.put(descending) .put(descending)
.put(skipEmptyBuckets)
.put(granularityBytes) .put(granularityBytes)
.put(filterBytes) .put(filterBytes)
.put(aggregatorBytes) .put(aggregatorBytes)