allocate correct buffer size for search query caching

This commit is contained in:
fjy 2013-08-16 11:36:30 -07:00
parent d208b535a6
commit ddcc1b53e0
1 changed files with 4 additions and 1 deletions

View File

@ -176,7 +176,10 @@ public class SearchQueryQueryToolChest extends QueryToolChest<Result<SearchResul
}
final ByteBuffer queryCacheKey = ByteBuffer
.allocate(1 + granularityBytes.length + filterBytes.length + querySpecBytes.length + dimensionsBytesSize)
.allocate(
1 + 4 + granularityBytes.length + filterBytes.length +
querySpecBytes.length + dimensionsBytesSize
)
.put(SEARCH_QUERY)
.put(Ints.toByteArray(query.getLimit()))
.put(granularityBytes)