@Override public String getUserDataBase64() { final String finalData; if (versionReplacementString != null && version != null) { finalData = data.replace(versionReplacementString, version); } else { finalData = data; } return Base64.encodeBase64String(StringUtils.toUtf8(finalData)); }
@Override public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8(fieldName); return ByteBuffer.allocate(1 + fieldNameBytes.length) .put(AggregatorUtil.LONG_LAST_CACHE_TYPE_ID) .put(fieldNameBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); return ByteBuffer.allocate(1 + dimensionBytes.length) .put(CACHE_TYPE_ID) .put(dimensionBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] metricBytes = StringUtils.toUtf8(metric); return ByteBuffer.allocate(1 + metricBytes.length) .put(CACHE_TYPE_ID) .put(metricBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8(fieldName); return ByteBuffer.allocate(1 + fieldNameBytes.length) .put(AggregatorUtil.DOUBLE_LAST_CACHE_TYPE_ID) .put(fieldNameBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8(fieldName); return ByteBuffer.allocate(1 + fieldNameBytes.length) .put(AggregatorUtil.DOUBLE_FIRST_CACHE_TYPE_ID) .put(fieldNameBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] previousStopBytes = previousStop == null ? new byte[]{} : StringUtils.toUtf8(previousStop); return ByteBuffer.allocate(1 + previousStopBytes.length) .put(CACHE_TYPE_ID) .put(previousStopBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] timeFormatBytes = StringUtils.toUtf8(timeFormat); return ByteBuffer.allocate(1 + timeFormatBytes.length) .put(ExtractionCacheHelper.CACHE_TYPE_ID_TIME_DIM) .put(timeFormatBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] bytes = StringUtils.toUtf8(function); return ByteBuffer.allocate(1 + bytes.length) .put(ExtractionCacheHelper.CACHE_TYPE_ID_JAVASCRIPT) .put(bytes) .array(); }
@Override public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8(fieldName); return ByteBuffer.allocate(1 + fieldNameBytes.length) .put(AggregatorUtil.LONG_FIRST_CACHE_TYPE_ID) .put(fieldNameBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8(fieldName); return ByteBuffer.allocate(2 + fieldNameBytes.length) .put(AggregatorUtil.FLOAT_LAST_CACHE_TYPE_ID) .put(fieldNameBytes) .put((byte) 0xff) .array(); }
public byte[] toByteArray() { final byte[] nsBytes = StringUtils.toUtf8(this.namespace); return ByteBuffer.allocate(Ints.BYTES + nsBytes.length + this.key.length) .putInt(nsBytes.length) .put(nsBytes) .put(this.key).array(); }
@Override public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8(fieldName); return ByteBuffer.allocate(1 + fieldNameBytes.length + Ints.BYTES * 2 + Floats.BYTES * 2) .put(AggregatorUtil.APPROX_HIST_CACHE_TYPE_ID) .put(fieldNameBytes) .putInt(resolution) .putInt(numBuckets) .putFloat(lowerLimit) .putFloat(upperLimit).array(); }
@Override public byte[] getCacheKey() { byte[] bytes = StringUtils.toUtf8(format); return ByteBuffer.allocate(2 + bytes.length) .put(ExtractionCacheHelper.CACHE_TYPE_ID_STRING_FORMAT) .put((byte) nullHandling.ordinal()) .put(bytes) .array(); }
public byte[] getCacheKey() { final byte[] filterBytes = dimFilter == null ? new byte[] {} : 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(); }
@Nullable private String charsetFix(String s) { if (s != null && !enc.canEncode(s)) { // Some whacky characters are in this string (e.g. \uD900). These are problematic because they are decodeable // by new String(...) but will not encode into the same character. This dance here will replace these // characters with something more sane. return StringUtils.fromUtf8(StringUtils.toUtf8(s)); } else { return s; } }
@Override public byte[] getCacheKey() { byte[] dimBytes = StringUtils.toUtf8(dimension); byte[] boundBytes = bound.getCacheKey(); return ByteBuffer.allocate(2 + dimBytes.length + boundBytes.length) .put(DimFilterUtils.SPATIAL_CACHE_ID) .put(dimBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(boundBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] delegateCacheKey = delegate.getCacheKey(); byte[] regexBytes = StringUtils.toUtf8(pattern); return ByteBuffer.allocate(2 + delegateCacheKey.length + regexBytes.length) .put(CACHE_TYPE_ID) .put(delegateCacheKey) .put(DimFilterUtils.STRING_SEPARATOR) .put(regexBytes) .array(); }
@Override public byte[] getCacheKey() { byte[] previousStopBytes = getPreviousStop() == null ? new byte[]{} : StringUtils.toUtf8(getPreviousStop()); return ByteBuffer.allocate(1 + previousStopBytes.length) .put(CACHE_TYPE_ID) .put(previousStopBytes) .array(); }