fix cache

This commit is contained in:
fjy 2013-04-22 15:01:07 -07:00
parent 6c4e844f97
commit f28abd4256
1 changed files with 4 additions and 1 deletions

View File

@ -39,6 +39,7 @@ public class SpatialDimFilter implements DimFilter
) )
{ {
Preconditions.checkArgument(dimension != null, "dimension must not be null"); Preconditions.checkArgument(dimension != null, "dimension must not be null");
//FIXME
Preconditions.checkArgument(dimension.endsWith(".geo"), "must filter over geo dimension!"); Preconditions.checkArgument(dimension.endsWith(".geo"), "must filter over geo dimension!");
Preconditions.checkArgument(bound != null, "bound must not be null"); Preconditions.checkArgument(bound != null, "bound must not be null");
@ -49,10 +50,12 @@ public class SpatialDimFilter implements DimFilter
@Override @Override
public byte[] getCacheKey() public byte[] getCacheKey()
{ {
byte[] dimBytes = dimension.getBytes();
byte[] boundBytes = bound.getCacheKey(); byte[] boundBytes = bound.getCacheKey();
return ByteBuffer.allocate(1 + boundBytes.length) return ByteBuffer.allocate(1 + dimBytes.length + boundBytes.length)
.put(DimFilterCacheHelper.SPATIAL_CACHE_ID) .put(DimFilterCacheHelper.SPATIAL_CACHE_ID)
.put(dimBytes)
.put(boundBytes) .put(boundBytes)
.array(); .array();
} }