From f1d705cb73059788227e35e1b381a886abb8b690 Mon Sep 17 00:00:00 2001 From: fjy Date: Tue, 22 Apr 2014 14:46:19 -0700 Subject: [PATCH] proper toStrings of filters --- .../druid/query/filter/JavaScriptDimFilter.java | 9 +++++++++ .../io/druid/query/filter/RegexDimFilter.java | 9 +++++++++ .../query/filter/SearchQueryDimFilter.java | 17 +++++++++++++---- .../io/druid/query/filter/SpatialDimFilter.java | 9 +++++++++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/processing/src/main/java/io/druid/query/filter/JavaScriptDimFilter.java b/processing/src/main/java/io/druid/query/filter/JavaScriptDimFilter.java index b9cef360238..1f8740562a3 100644 --- a/processing/src/main/java/io/druid/query/filter/JavaScriptDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/JavaScriptDimFilter.java @@ -67,4 +67,13 @@ public class JavaScriptDimFilter implements DimFilter .put(functionBytes) .array(); } + + @Override + public String toString() + { + return "JavaScriptDimFilter{" + + "dimension='" + dimension + '\'' + + ", function='" + function + '\'' + + '}'; + } } diff --git a/processing/src/main/java/io/druid/query/filter/RegexDimFilter.java b/processing/src/main/java/io/druid/query/filter/RegexDimFilter.java index 0644250f819..9a327dde3b5 100644 --- a/processing/src/main/java/io/druid/query/filter/RegexDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/RegexDimFilter.java @@ -69,4 +69,13 @@ public class RegexDimFilter implements DimFilter .put(patternBytes) .array(); } + + @Override + public String toString() + { + return "RegexDimFilter{" + + "dimension='" + dimension + '\'' + + ", pattern='" + pattern + '\'' + + '}'; + } } diff --git a/processing/src/main/java/io/druid/query/filter/SearchQueryDimFilter.java b/processing/src/main/java/io/druid/query/filter/SearchQueryDimFilter.java index 76c5ecd0148..c6d09c0a55c 100644 --- a/processing/src/main/java/io/druid/query/filter/SearchQueryDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/SearchQueryDimFilter.java @@ -64,9 +64,18 @@ public class SearchQueryDimFilter implements DimFilter final byte[] queryBytes = query.getCacheKey(); return ByteBuffer.allocate(1 + dimensionBytes.length + queryBytes.length) - .put(DimFilterCacheHelper.SEARCH_QUERY_TYPE_ID) - .put(dimensionBytes) - .put(queryBytes) - .array(); + .put(DimFilterCacheHelper.SEARCH_QUERY_TYPE_ID) + .put(dimensionBytes) + .put(queryBytes) + .array(); + } + + @Override + public String toString() + { + return "SearchQueryDimFilter{" + + "dimension='" + dimension + '\'' + + ", query=" + query + + '}'; } } diff --git a/processing/src/main/java/io/druid/query/filter/SpatialDimFilter.java b/processing/src/main/java/io/druid/query/filter/SpatialDimFilter.java index 6899d306602..2abcc9282b3 100644 --- a/processing/src/main/java/io/druid/query/filter/SpatialDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/SpatialDimFilter.java @@ -99,4 +99,13 @@ public class SpatialDimFilter implements DimFilter result = 31 * result + (bound != null ? bound.hashCode() : 0); return result; } + + @Override + public String toString() + { + return "SpatialDimFilter{" + + "dimension='" + dimension + '\'' + + ", bound=" + bound + + '}'; + } }