@Override public byte[] getCacheKey() { byte[] subKey = field.getCacheKey(); return ByteBuffer.allocate(1 + subKey.length).put(DimFilterUtils.NOT_CACHE_ID).put(subKey).array(); }
public byte[] getCacheKey() { final byte[] filterBytes = dimFilter == null ? ByteArrays.EMPTY_ARRAY : dimFilter.getCacheKey(); final byte[] boundBytes = StringUtils.toUtf8(bound); final byte delimiter = (byte) 0xff; return ByteBuffer.allocate(2 + boundBytes.length + filterBytes.length) .put(CACHE_TYPE_ID) .put(boundBytes) .put(delimiter) .put(filterBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] filterCacheKey = filter.getCacheKey(); byte[] aggregatorCacheKey = delegate.getCacheKey(); return ByteBuffer.allocate(1 + filterCacheKey.length + aggregatorCacheKey.length) .put(AggregatorUtil.FILTERED_AGG_CACHE_TYPE_ID) .put(filterCacheKey) .put(aggregatorCacheKey) .array(); }
static byte[] computeCacheKey(byte cacheIdKey, List<DimFilter> filters) { if (filters.size() == 1) { return filters.get(0).getCacheKey(); } byte[][] cacheKeys = new byte[filters.size()][]; int totalSize = 0; int index = 0; for (DimFilter field : filters) { cacheKeys[index] = field.getCacheKey(); totalSize += cacheKeys[index].length; ++index; } ByteBuffer retVal = ByteBuffer.allocate(1 + totalSize); retVal.put(cacheIdKey); for (byte[] cacheKey : cacheKeys) { retVal.put(cacheKey); } return retVal.array(); }
final byte[] filterBytes = dimFilter == null ? new byte[]{} : dimFilter.getCacheKey(); final byte[] querySpecBytes = query.getQuery().getCacheKey(); final byte[] granularityBytes = query.getGranularity().getCacheKey();
final byte[] filterBytes = dimFilter == null ? new byte[]{} : dimFilter.getCacheKey(); final byte[] granularityBytes = query.getGranularity().getCacheKey();
@Test public void testGetCacheKey() { final DimFilter filter = new LikeDimFilter("foo", "bar%", "@", new SubstringDimExtractionFn(1, 2)); final DimFilter filter2 = new LikeDimFilter("foo", "bar%", "@", new SubstringDimExtractionFn(1, 2)); final DimFilter filter3 = new LikeDimFilter("foo", "bar%", null, new SubstringDimExtractionFn(1, 2)); Assert.assertArrayEquals(filter.getCacheKey(), filter2.getCacheKey()); Assert.assertFalse(Arrays.equals(filter.getCacheKey(), filter3.getCacheKey())); }
null ); Assert.assertNotEquals(intervalFilter1.getCacheKey(), intervalFilter2.getCacheKey()); regexFn ); Assert.assertNotEquals(intervalFilter3.getCacheKey(), intervalFilter4.getCacheKey());
@Override public byte[] getCacheKey() { byte[] subKey = field.getCacheKey(); return ByteBuffer.allocate(1 + subKey.length).put(DimFilterUtils.NOT_CACHE_ID).put(subKey).array(); }
@Override public byte[] getCacheKey() { byte[] filterCacheKey = filter.getCacheKey(); byte[] aggregatorCacheKey = delegate.getCacheKey(); return ByteBuffer.allocate(1 + filterCacheKey.length + aggregatorCacheKey.length) .put(AggregatorUtil.FILTERED_AGG_CACHE_TYPE_ID) .put(filterCacheKey) .put(aggregatorCacheKey) .array(); }
public byte[] getCacheKey() { final byte[] filterBytes = dimFilter == null ? ByteArrays.EMPTY_ARRAY : dimFilter.getCacheKey(); final byte[] boundBytes = StringUtils.toUtf8(bound); final byte delimiter = (byte) 0xff; return ByteBuffer.allocate(2 + boundBytes.length + filterBytes.length) .put(CACHE_TYPE_ID) .put(boundBytes) .put(delimiter) .put(filterBytes) .array(); }
static byte[] computeCacheKey(byte cacheIdKey, List<DimFilter> filters) { if (filters.size() == 1) { return filters.get(0).getCacheKey(); } byte[][] cacheKeys = new byte[filters.size()][]; int totalSize = 0; int index = 0; for (DimFilter field : filters) { cacheKeys[index] = field.getCacheKey(); totalSize += cacheKeys[index].length; ++index; } ByteBuffer retVal = ByteBuffer.allocate(1 + totalSize); retVal.put(cacheIdKey); for (byte[] cacheKey : cacheKeys) { retVal.put(cacheKey); } return retVal.array(); }
final byte[] filterBytes = dimFilter == null ? new byte[]{} : dimFilter.getCacheKey(); final byte[] querySpecBytes = query.getQuery().getCacheKey(); final byte[] granularityBytes = query.getGranularity().getCacheKey();
final byte[] filterBytes = dimFilter == null ? new byte[]{} : dimFilter.getCacheKey(); final byte[] granularityBytes = query.getGranularity().getCacheKey();